2014-03-16 22:31:00 +00:00
|
|
|
{ stdenv, config, fetchurl, patchelf, makeWrapper, xlibs, gtk, glib, udev, alsaLib, atk
|
|
|
|
, nspr, fontconfig, cairo, pango, nss, freetype, gnome3, gdk_pixbuf, curl, systemd, xorg }:
|
|
|
|
|
|
|
|
# TODO: use dynamic attributes once Nix 1.7 is out
|
|
|
|
assert ((config.planetary_annihilation or null).url or null) != null;
|
|
|
|
assert ((config.planetary_annihilation or null).sha256 or null) != null;
|
|
|
|
|
|
|
|
/* to setup:
|
|
|
|
$ cat ~/.nixpkgs/config.nix
|
|
|
|
{
|
|
|
|
planetary_annihilation = {
|
|
|
|
url = "file:///home/user/PA_Linux_62857.tar.bz2";
|
|
|
|
sha256 = "0imi3k5144dsn3ka9khx3dj76klkw46ga7m6rddqjk4yslwabh3k";
|
|
|
|
};
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "planetary-annihalation";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
inherit (config.planetary_annihilation) url sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ patchelf makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{bin,lib}
|
|
|
|
|
|
|
|
cp -R * $out/
|
|
|
|
mv $out/*.so $out/lib
|
|
|
|
ln -s $out/PA $out/bin/PA
|
|
|
|
|
|
|
|
ln -s ${systemd}/lib/libudev.so.1 $out/lib/libudev.so.0
|
|
|
|
|
2014-12-17 18:11:30 +00:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$out/PA"
|
2015-03-16 08:14:50 +00:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath "${stdenv.lib.makeLibraryPath [ stdenv.cc.cc xlibs.libXdamage xorg.libXfixes gtk glib stdenv.glibc "$out" xlibs.libXext pango udev xlibs.libX11 xlibs.libXcomposite alsaLib atk nspr fontconfig cairo pango nss freetype gnome3.gconf gdk_pixbuf xlibs.libXrender ]}:{stdenv.cc.cc}/lib64:${stdenv.glibc}/lib64" "$out/host/CoherentUI_Host"
|
2014-03-16 22:31:00 +00:00
|
|
|
|
2015-01-15 04:25:26 +00:00
|
|
|
wrapProgram $out/PA --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ stdenv.cc.cc stdenv.glibc xlibs.libX11 xlibs.libXcursor gtk glib curl "$out" ]}:${stdenv.cc.cc}/lib64:${stdenv.glibc}/lib64"
|
2014-03-16 22:31:00 +00:00
|
|
|
|
|
|
|
for f in $out/lib/*; do
|
2015-01-15 04:25:26 +00:00
|
|
|
patchelf --set-rpath "${stdenv.lib.makeLibraryPath [ stdenv.cc.cc curl xlibs.libX11 stdenv.glibc xlibs.libXcursor "$out" ]}:${stdenv.cc.cc}/lib64:${stdenv.glibc}/lib64" $f
|
2014-03-16 22:31:00 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
homepage = http://www.uberent.com/pa/;
|
|
|
|
description = "next-generation RTS that takes the genre to a planetary scale";
|
2014-06-19 04:19:00 +00:00
|
|
|
license = stdenv.lib.licenses.unfree;
|
2014-03-16 22:31:00 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.iElectric ];
|
|
|
|
};
|
|
|
|
}
|