Patch dwarf-fortress-unfuck to build in debug (pending upstream fix)

This commit is contained in:
Morgan Jones 2018-07-01 20:28:59 +00:00
parent 9a2898c6d1
commit 8d5b5fa68e
7 changed files with 25 additions and 7 deletions

View File

@ -40,7 +40,7 @@ in stdenv.mkDerivation rec {
src = fetchFromGitHub {
owner = "DFHack";
repo = "dfhack";
sha256 = "16ypcl9378xxnq7ngzh93pmx2haf2i32xgxs2p1q4bvvafdxvirz";
sha256 = "1vzrpdw0pn18calayf9dwqpyg37cb7wkzkvskxjx9nak5ilxzywm";
rev = version;
fetchSubmodules = true;
};

View File

@ -20,8 +20,8 @@ stdenv.mkDerivation rec {
'' else null;
meta = with stdenv.lib; {
description = "Tool to manage dwarves in in a running game of Dwarf Fortress";
maintainers = with maintainers; [ the-kenny abbradar bendlas ];
description = "Tool to manage dwarves in a running game of Dwarf Fortress";
maintainers = with maintainers; [ the-kenny abbradar bendlas numinit ];
license = licenses.mit;
platforms = platforms.unix;
homepage = https://github.com/Dwarf-Therapist/Dwarf-Therapist;

View File

@ -91,3 +91,4 @@ stdenv.mkDerivation {
maintainers = with maintainers; [ a1russell robbinch roconnor the-kenny abbradar numinit ];
};
}

View File

@ -20,12 +20,26 @@ stdenv.mkDerivation {
"-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include"
];
makeFlags = [
''CFLAGS="-fkeep-inline-functions"''
''CXXFLAGS="-fkeep-inline-functions"''
];
nativeBuildInputs = [ cmake ];
buildInputs = [
libSM SDL SDL_image SDL_ttf glew openalSoft
ncurses gtk2 libsndfile zlib libGL
];
patchPhase = ''
substituteInPlace CMakeLists.txt --replace \
'set(CMAKE_BUILD_TYPE Release)' \
'set(CMAKE_BUILD_TYPE Debug)'
'';
# Don't strip unused symbols; dfhack hooks into some of them.
dontStrip = true;
installPhase = ''
install -D -m755 ../build/libgraphics.so $out/lib/libgraphics.so
'';
@ -45,3 +59,4 @@ stdenv.mkDerivation {
maintainers = with maintainers; [ abbradar ];
};
}

View File

@ -83,3 +83,4 @@ stdenv.mkDerivation rec {
preferLocalBuild = true;
}

View File

@ -7,5 +7,6 @@ for i in dfhack.init-example dfhack-config/default hack/* stonesense/*; do
done
cd "$DF_DIR"
LD_LIBRARY_PATH="$env_dir/hack/libs:$env_dir/hack:$LD_LIBRARY_PATH" \
LD_PRELOAD="$env_dir/hack/libdfhack.so:$LD_PRELOAD" exec $env_dir/libs/Dwarf_Fortress "$@"
export LD_LIBRARY_PATH="$env_dir/hack/libs:$env_dir/hack:$LD_LIBRARY_PATH"
export LD_PRELOAD="$env_dir/hack/libdfhack.so:$LD_PRELOAD"
exec "$env_dir/libs/Dwarf_Fortress" "$@"