Created
May 16, 2019 12:19
-
-
Save Jomik/6db12935b9f793c69120026c06c7ddd0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ lib, pkgs, stdenv }: | |
let | |
inherit (pkgs) python2Packages fetchurl fetchhg; | |
llbase = python2Packages.buildPythonApplication rec { | |
pname = "llbase"; | |
version = "1.2.2"; | |
src = python2Packages.fetchPypi { | |
inherit pname version; | |
sha256 = "1dzxnvqx55ifbccc7n01lyd7zpj22xy69f1nrwfnkcq9x0vmfmx6"; | |
}; | |
propagatedBuildInputs = [ python2Packages.requests ]; | |
doCheck = false; | |
}; | |
autobuild = python2Packages.buildPythonApplication rec { | |
pname = "autobuild"; | |
version = "1.1.7"; | |
src = python2Packages.fetchPypi { | |
inherit pname version; | |
sha256 = "0fag1zvr7f052p4wklp6fih2vwlq9bi5y8c0sv2vbfqlv5gw0a9g"; | |
}; | |
propagatedBuildInputs = with pkgs; [ llbase python2Packages.pydot ]; | |
postPatch = '' | |
sed -i -e 's!\(['\'''"]\)/var/tmp!tempfile.gettempdir() + \1/!' \ | |
autobuild/common.py | |
''; | |
}; | |
xmlrpc-epi = stdenv.mkDerivation rec { | |
name = "xmlrpc-epi-${version}"; | |
version = "0.54.2"; | |
src = fetchurl { | |
url = "mirror://sourceforge/xmlrpc-epi/${name}.tar.bz2"; | |
sha256 = "1f6hvqndc290pawpb9r5j3v6fjvi35vg70la2f80h50bd3xzhkn7"; | |
}; | |
buildInputs = with pkgs; [ expat ]; | |
postPatch = "sed -i -e '/printf([^,)]*)/d' sample/*.c"; | |
}; | |
buildvars = fetchhg { | |
url = https://hg.phoenixviewer.com/fs-build-variables; | |
rev = "bb1995f93305"; | |
sha256 = "1ijnyd8gplw6qd8bhp378w3pwrd0iq73fzab7zhv5rky5rxplbgw"; | |
}; | |
# FIXME: Not actually 1.45 but boost 1.57 version with some weird patches | |
# specific to Firestorm :-/ | |
boostPhoenix = pkgs.boost15x.overrideAttrs (drv: rec { | |
name = "boost-${version}"; | |
version = "1.45"; | |
src = "${fetchhg { | |
url = https://hg.phoenixviewer.com/boost145; | |
rev = "0b96a1bc30df"; | |
sha256 = "0bpj2zkb59zd38sf243azn2ad72ryjg1kcahvlvdnanlkx0z4d6k"; | |
}}/boost_1_45_0"; | |
}); | |
in stdenv.mkDerivation rec { | |
name = "firestorm-${version}"; | |
version = "6.0.2"; | |
src = fetchhg { | |
url = https://hg.phoenixviewer.com/phoenix-firestorm-lgpl; | |
rev = "Firestorm_${version}_Release"; | |
sha256 = "1z2cchg5ba05va1ynkjqwlh6diy3ax69g2ryfbyhcg8bb14v650j"; | |
}; | |
enableParallelBuilding = true; | |
nativeBuildInputs = with pkgs; [ autobuild cmake pkgconfig ]; | |
buildInputs = with pkgs; [ | |
SDL apr aprutil atk boostPhoenix cairo curl db dbus_glib freealut freetype | |
gtk2 hunspell jsoncpp libGL libjpeg libogg libpng libvorbis nghttp2 openal | |
opencollada openjpeg pangox_compat pcre uriparser xmlrpc-epi zlib | |
]; | |
AUTOBUILD_VARIABLES_FILE = "${buildvars}/variables"; | |
cmakeFlags = with pkgs; [ | |
"-DUSESYSTEMLIBS=ON" | |
"-DNDOF=OFF" | |
"-DOpenGL_GL_PREFERENCE=GLVND" | |
"-DCOLLADA_INCLUDE_DIRS=${lib.getDev opencollada}/include" | |
"-DHUNSPELL_INCLUDE_DIR=${lib.getDev hunspell}/include" | |
"-DHUNSPELL_LIBRARY=${lib.getLib hunspell}/lib" | |
"-DJSONCPP_INCLUDE_DIR=${lib.getDev jsoncpp}/include" | |
"-DJSONCPP_LIBRARY=${lib.getLib jsoncpp}/lib" | |
"-DOPENJPEG_INCLUDE_DIR=${lib.getDev openjpeg}/include/${openjpeg.incDir}" | |
"-DOPENJPEG_LIBRARY=${lib.getLib openjpeg}/lib" | |
"-DXMLRPCEPI_INCLUDE_DIR=${lib.getDev xmlrpc-epi}/include" | |
"-DXMLRPCEPI_LIBRARY=${lib.getLib xmlrpc-epi}/lib" | |
]; | |
dontUseCmakeBuildDir = true; | |
configurePhase = '' | |
# This is to add the CMake flags from the setup hook | |
wrapper_path="$PWD/wrap_cmake" | |
mkdir "$wrapper_path" | |
cat > wrap_cmake/cmake <<EOF | |
#!${stdenv.shell} | |
rm -f "$wrapper_path/cmake" | |
source ${buildvars}/convenience Release | |
shift # Remove cmakeDir | |
exec autobuild configure -A ${if stdenv.is64bit then "64" else "32"} \ | |
-c ReleaseFS_open -- "\$@" | |
EOF | |
chmod +x "$wrapper_path/cmake" | |
PATH="$PWD/wrap_cmake:$PATH" runHook cmakeConfigurePhase | |
rmdir "$wrapper_path" | |
cd build-* | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment