2022-06-09 21:22:21 +00:00
|
|
|
{ lib, stdenv, fetchurl, fetchpatch, SDL2, libGL, libpng, libjpeg, SDL2_ttf, libvorbis, gettext
|
2015-07-30 18:20:27 +00:00
|
|
|
, physfs }:
|
2009-03-04 17:28:25 +00:00
|
|
|
|
2009-11-06 19:25:45 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2021-06-22 21:44:58 +00:00
|
|
|
pname = "neverball";
|
|
|
|
version = "1.6.0";
|
2009-03-04 17:28:25 +00:00
|
|
|
src = fetchurl {
|
2021-06-22 21:44:58 +00:00
|
|
|
url = "https://neverball.org/neverball-${version}.tar.gz";
|
2015-07-30 18:20:27 +00:00
|
|
|
sha256 = "184gm36c6p6vaa6gwrfzmfh86klhnb03pl40ahsjsvprlk667zkk";
|
2009-03-04 17:28:25 +00:00
|
|
|
};
|
2022-06-09 21:22:21 +00:00
|
|
|
patches = [
|
|
|
|
# Pull upstream fix for -fno-common toolchains
|
|
|
|
# https://github.com/Neverball/neverball/pull/198
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fno-common.patch";
|
|
|
|
url = "https://github.com/Neverball/neverball/commit/a42492b8db06934c7a794630db92e3ff6ebaadaa.patch";
|
|
|
|
sha256 = "0sqyxfwpl4xxra8iz87j5rxzwani16xra2xl4l5z61shvq30308h";
|
|
|
|
})
|
|
|
|
];
|
2009-03-04 17:28:25 +00:00
|
|
|
|
2018-02-24 12:06:44 +00:00
|
|
|
buildInputs = [ libpng SDL2 libGL libjpeg SDL2_ttf libvorbis gettext physfs ];
|
2009-03-04 17:28:25 +00:00
|
|
|
|
2019-07-23 10:32:11 +00:00
|
|
|
dontPatchELF = true;
|
2009-03-04 17:28:25 +00:00
|
|
|
|
2022-06-09 21:22:21 +00:00
|
|
|
postPatch = ''
|
2016-05-31 07:18:12 +00:00
|
|
|
sed -i -e 's@\./data@'$out/share/neverball/data@ share/base_config.h Makefile
|
|
|
|
sed -i -e 's@\./locale@'$out/share/neverball/locale@ share/base_config.h Makefile
|
2009-04-14 21:01:23 +00:00
|
|
|
sed -i -e 's@-lvorbisfile@-lvorbisfile -lX11 -lgcc_s@' Makefile
|
2009-03-04 17:28:25 +00:00
|
|
|
'';
|
|
|
|
|
2009-11-08 22:35:19 +00:00
|
|
|
# The map generation code requires a writable HOME
|
|
|
|
preConfigure = "export HOME=$TMPDIR";
|
|
|
|
|
2009-03-04 17:28:25 +00:00
|
|
|
installPhase = ''
|
2016-05-31 07:18:12 +00:00
|
|
|
mkdir -p $out/bin $out/share/neverball
|
|
|
|
cp -R data locale $out/share/neverball
|
2009-03-04 17:28:25 +00:00
|
|
|
cp neverball $out/bin
|
|
|
|
cp neverputt $out/bin
|
|
|
|
cp mapc $out/bin
|
|
|
|
'';
|
|
|
|
|
2016-05-31 07:18:12 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2009-03-04 17:28:25 +00:00
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://neverball.org/";
|
2009-03-04 17:28:25 +00:00
|
|
|
description = "Tilt the floor to roll a ball";
|
|
|
|
license = "GPL";
|
2021-01-15 04:31:39 +00:00
|
|
|
maintainers = with lib.maintainers; [viric];
|
|
|
|
platforms = with lib.platforms; linux;
|
2009-03-04 17:28:25 +00:00
|
|
|
};
|
|
|
|
}
|