Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 74 lines 1.7 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 fetchpatch, 6 SDL2, 7 libGL, 8 libpng, 9 libjpeg, 10 libX11, 11 SDL2_ttf, 12 libvorbis, 13 gettext, 14 physfs, 15}: 16 17stdenv.mkDerivation rec { 18 pname = "neverball"; 19 version = "1.6.0"; 20 src = fetchurl { 21 url = "https://neverball.org/neverball-${version}.tar.gz"; 22 sha256 = "184gm36c6p6vaa6gwrfzmfh86klhnb03pl40ahsjsvprlk667zkk"; 23 }; 24 patches = [ 25 # Pull upstream fix for -fno-common toolchains 26 # https://github.com/Neverball/neverball/pull/198 27 (fetchpatch { 28 name = "fno-common.patch"; 29 url = "https://github.com/Neverball/neverball/commit/a42492b8db06934c7a794630db92e3ff6ebaadaa.patch"; 30 sha256 = "0sqyxfwpl4xxra8iz87j5rxzwani16xra2xl4l5z61shvq30308h"; 31 }) 32 ]; 33 34 buildInputs = [ 35 libpng 36 SDL2 37 libGL 38 libjpeg 39 SDL2_ttf 40 libvorbis 41 libX11 42 gettext 43 physfs 44 ]; 45 46 dontPatchELF = true; 47 48 postPatch = '' 49 sed -i -e 's@\./data@'$out/share/neverball/data@ share/base_config.h Makefile 50 sed -i -e 's@\./locale@'$out/share/neverball/locale@ share/base_config.h Makefile 51 sed -i -e 's@-lvorbisfile@-lvorbisfile -lX11 -lgcc_s@' Makefile 52 ''; 53 54 # The map generation code requires a writable HOME 55 preConfigure = "export HOME=$TMPDIR"; 56 57 installPhase = '' 58 mkdir -p $out/bin $out/share/neverball 59 cp -R data locale $out/share/neverball 60 cp neverball $out/bin 61 cp neverputt $out/bin 62 cp mapc $out/bin 63 ''; 64 65 enableParallelBuilding = true; 66 67 meta = { 68 homepage = "https://neverball.org/"; 69 description = "Tilt the floor to roll a ball"; 70 license = "GPL"; 71 maintainers = [ ]; 72 platforms = with lib.platforms; linux; 73 }; 74}