2021-06-10 04:57:09 +02:00
|
|
|
{ lib, stdenv, config, fetchurl, patchelf, makeWrapper, gtk2, glib, udev, alsa-lib, atk
|
2019-05-22 13:03:39 +02:00
|
|
|
, nspr, fontconfig, cairo, pango, nss, freetype, gnome2, gdk-pixbuf, curl, systemd, xorg }:
|
2014-03-16 23:31:00 +01:00
|
|
|
|
|
|
|
# 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:
|
2017-02-01 16:03:42 +01:00
|
|
|
$ cat ~/.config/nixpkgs/config.nix
|
2014-03-16 23:31:00 +01:00
|
|
|
{
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2018-09-27 23:38:10 +02:00
|
|
|
nativeBuildInputs = [ patchelf makeWrapper ];
|
2019-05-22 13:03:39 +02:00
|
|
|
|
2014-03-16 23:31:00 +01:00
|
|
|
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 19:11:30 +01:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$out/PA"
|
2021-06-10 04:57:09 +02:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib xorg.libXdamage xorg.libXfixes gtk2 glib stdenv.glibc.out "$out" xorg.libXext pango udev xorg.libX11 xorg.libXcomposite alsa-lib atk nspr fontconfig cairo pango nss freetype gnome2.GConf gdk-pixbuf xorg.libXrender ]}:{stdenv.cc.cc.lib}/lib64:${stdenv.glibc.out}/lib64" "$out/host/CoherentUI_Host"
|
2014-03-16 23:31:00 +01:00
|
|
|
|
2021-01-15 05:31:39 +01:00
|
|
|
wrapProgram $out/PA --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ stdenv.cc.cc.lib stdenv.glibc.out xorg.libX11 xorg.libXcursor gtk2 glib curl "$out" ]}:${stdenv.cc.cc.lib}/lib64:${stdenv.glibc.out}/lib64"
|
2014-03-16 23:31:00 +01:00
|
|
|
|
|
|
|
for f in $out/lib/*; do
|
2021-01-15 05:31:39 +01:00
|
|
|
patchelf --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc.lib curl xorg.libX11 stdenv.glibc.out xorg.libXcursor "$out" ]}:${stdenv.cc.cc.lib}/lib64:${stdenv.glibc.out}/lib64" $f
|
2014-03-16 23:31:00 +01:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://www.uberent.com/pa/";
|
2016-06-20 12:53:46 +02:00
|
|
|
description = "Next-generation RTS that takes the genre to a planetary scale";
|
2021-01-15 05:31:39 +01:00
|
|
|
license = lib.licenses.unfree;
|
2014-03-16 23:31:00 +01:00
|
|
|
platforms = platforms.linux;
|
2016-05-17 13:57:28 +02:00
|
|
|
maintainers = [ maintainers.domenkozar ];
|
2014-03-16 23:31:00 +01:00
|
|
|
};
|
|
|
|
}
|