Guest User

sgt-puzzles default.nix

a guest
Mar 9th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. with import <nixos> {};
  2. callPackage ( { stdenv, fetchurl
  3. , gtk3, libX11
  4. , makeWrapper, pkgconfig, perl, autoreconfHook, wrapGAppsHook
  5. , version ? "20170228.1f613ba"
  6. }:
  7.  
  8. stdenv.mkDerivation rec {
  9. name = "sgt-puzzles-r${version}";
  10. inherit version;
  11.  
  12. src = ./.;
  13.  
  14. nativeBuildInputs = [ autoreconfHook makeWrapper pkgconfig perl wrapGAppsHook ];
  15.  
  16. buildInputs = [ gtk3 libX11 ];
  17.  
  18. makeFlags = ["prefix=$(out)" "gamesdir=$(out)/bin"];
  19. preInstall = ''
  20. mkdir -p "$out"/{bin,share/doc/sgtpuzzles}
  21. cp gamedesc.txt LICENCE README "$out/share/doc/sgtpuzzles"
  22. '';
  23. # SGT Puzzles use generic names like net, map, etc.
  24. # Create symlinks with sgt-puzzle- prefix for possibility of
  25. # disambiguation
  26. postInstall = ''
  27. (
  28. cd "$out"/bin ;
  29. for i in *; do ln -s "$i" "sgt-puzzle-$i"; done
  30. )
  31. '';
  32. preConfigure = ''
  33. perl mkfiles.pl
  34. export NIX_LDFLAGS="$NIX_LDFLAGS -lX11"
  35. export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -Wno-error"
  36. cp Makefile.gtk Makefile
  37. '';
  38. meta = with stdenv.lib; {
  39. description = "Simon Tatham's portable puzzle collection";
  40. license = licenses.mit;
  41. maintainers = [ maintainers.raskin ];
  42. platforms = platforms.linux;
  43. homepage = http://www.chiark.greenend.org.uk/~sgtatham/puzzles/;
  44. };
  45.  
  46.  
  47.  
  48. } ) {}
Advertisement
Add Comment
Please, Sign In to add comment