2016-03-03 13:01:52 +01:00
|
|
|
{ stdenv, fetchFromGitHub, cmake
|
2018-02-24 13:06:44 +01:00
|
|
|
, libGL, libSM, SDL, SDL_image, SDL_ttf, glew, openalSoft
|
2016-04-23 00:34:11 +02:00
|
|
|
, ncurses, glib, gtk2, libsndfile, zlib
|
2016-01-12 18:56:59 +01:00
|
|
|
}:
|
|
|
|
|
2018-06-25 10:21:57 +02:00
|
|
|
let dfVersion = "0.44.11"; in
|
2017-12-07 00:53:24 +01:00
|
|
|
|
2016-01-12 18:56:59 +01:00
|
|
|
stdenv.mkDerivation {
|
2017-12-07 00:53:24 +01:00
|
|
|
name = "dwarf_fortress_unfuck-${dfVersion}";
|
2016-01-12 18:56:59 +01:00
|
|
|
|
2016-03-03 13:01:52 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "svenstaro";
|
|
|
|
repo = "dwarf_fortress_unfuck";
|
2017-12-07 00:53:24 +01:00
|
|
|
rev = dfVersion;
|
2018-06-25 10:21:57 +02:00
|
|
|
sha256 = "0kkk8md2xq8l0c4m9hkg66qqjad3xi4jbb5z2ginhqixxpfbz8rf";
|
2016-01-12 18:56:59 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
cmakeFlags = [
|
2016-04-14 03:11:58 +02:00
|
|
|
"-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib.out}/lib/glib-2.0/include"
|
|
|
|
"-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk2.out}/lib/gtk-2.0/include"
|
2016-01-12 18:56:59 +01:00
|
|
|
];
|
|
|
|
|
2018-07-01 22:28:59 +02:00
|
|
|
makeFlags = [
|
|
|
|
''CFLAGS="-fkeep-inline-functions"''
|
|
|
|
''CXXFLAGS="-fkeep-inline-functions"''
|
|
|
|
];
|
|
|
|
|
2016-01-12 18:56:59 +01:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [
|
2016-08-22 06:43:12 +02:00
|
|
|
libSM SDL SDL_image SDL_ttf glew openalSoft
|
2018-02-24 13:06:44 +01:00
|
|
|
ncurses gtk2 libsndfile zlib libGL
|
2016-01-12 18:56:59 +01:00
|
|
|
];
|
|
|
|
|
2018-07-02 17:57:07 +02:00
|
|
|
postPatch = ''
|
2018-07-01 22:28:59 +02:00
|
|
|
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;
|
|
|
|
|
2016-01-12 18:56:59 +01:00
|
|
|
installPhase = ''
|
|
|
|
install -D -m755 ../build/libgraphics.so $out/lib/libgraphics.so
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2016-11-24 00:51:51 +01:00
|
|
|
# Breaks dfhack because of inlining.
|
|
|
|
hardeningDisable = [ "fortify" ];
|
|
|
|
|
2017-12-07 00:53:24 +01:00
|
|
|
passthru = { inherit dfVersion; };
|
2016-01-12 18:56:59 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Unfucked multimedia layer for Dwarf Fortress";
|
2017-08-01 22:03:30 +02:00
|
|
|
homepage = https://github.com/svenstaro/dwarf_fortress_unfuck;
|
2016-01-12 18:56:59 +01:00
|
|
|
license = licenses.free;
|
2016-08-13 02:11:45 +02:00
|
|
|
platforms = platforms.linux;
|
2016-01-12 18:56:59 +01:00
|
|
|
maintainers = with maintainers; [ abbradar ];
|
|
|
|
};
|
|
|
|
}
|