nixpkgs/pkgs/games/xsok/default.nix
Rick van Schijndel 9833d56c24 treewide: mark packages broken that never built on PLATFORM
Done with the help of https://github.com/Mindavi/nixpkgs-mark-broken
Tool is still WIP but this is one of the first results.

I manually audited the results and removed some results that were not valid.

Note that some of these packages maybe should have more constrained platforms set
instead of broken set, but I think not being perfectly correct is better than
just keep trying to build all these things and never succeeding.

Some observations:

- Some darwin builds require XCode tools
- aarch64-linux builds sometimes suffer from using gcc9
  - gcc9 is getting older and misses some new libraries/features
- Sometimes tools try to do system detection or expect some explicit settings for
  platforms that are not x86_64-linux
2022-12-13 21:40:12 +01:00

49 lines
1.5 KiB
Nix

{lib, stdenv, fetchurl, libX11, imake, libXt, libXaw, libXpm, libXext
, withNethackLevels ? true
}:
stdenv.mkDerivation rec {
pname = "xsok";
version = "1.02";
src = fetchurl {
url = "http://http.debian.net/debian/pool/main/x/xsok/xsok_1.02.orig.tar.gz";
sha256 = "0f4z53xsy4w8x8zp5jya689xp3rcfpi5wri2ip0qa8nk3sw7zj73";
};
nethackLevels = fetchurl {
url = "https://www.electricmonk.nl/data/nethack/nethack.def";
sha256 = "057ircp13hfpy513c7wpyp986hsvhqs7km98w4k39f5wkvp3dj02";
};
buildInputs = [libX11 libXt libXaw libXpm libXext];
nativeBuildInputs = [imake];
NIX_CFLAGS_COMPILE=" -isystem ${libXpm.dev}/include/X11 ";
preConfigure = ''
sed -e "s@/usr/@$out/share/@g" -i src/Imakefile
sed -e "s@/var/games/xsok@./.xsok/@g" -i src/Imakefile
sed -e '/chown /d' -i src/Imakefile
sed -e '/chmod /d' -i src/Imakefile
sed -e '/InstallAppDefaults/d' -i src/Imakefile
sed -e 's/CC = gcc/CC = cc/g' -i src/Imakefile
'';
makeFlags = ["BINDIR=$(out)/bin"];
postInstall = lib.optionalString withNethackLevels ''
gzip < ${nethackLevels} > "$out/share/games/lib/xsok/Nethack.def.gz"
echo Nethack > "$out/share/games/lib/xsok/gametypes"
'';
meta = {
description = "A generic Sokoban game for X11";
license = lib.licenses.gpl2Plus;
maintainers = [lib.maintainers.raskin];
platforms = lib.platforms.unix;
homepage = "https://tracker.debian.org/pkg/xsok";
# never built on aarch64-darwin since first introduction in nixpkgs
broken = stdenv.isDarwin && stdenv.isAarch64;
};
}