pytrainer: unpin python 3.10
[NixPkgs.git] / pkgs / games / globulation / default.nix
bloba444f18335fc4b303dc2fdee5dfbca244a9ee5c2
1 { lib, stdenv, fetchurl, libGLU, libGL, SDL, scons, SDL_ttf, SDL_image, zlib, SDL_net
2 , speex, libvorbis, libogg, boost, fribidi, bsdiff
3 , fetchpatch
4 }:
5 let
6   version = "0.9.4";
7   patchlevel = "4";
8   tutorial4patch = fetchurl {
9     url = "http://bugs.debian.org/cgi-bin/bugreport.cgi?msg=34;filename=tutorial-part4.map.bspatch;att=1;bug=595448";
10     name = "globulation2-tutorial4-map-patch-debian.bspatch";
11     sha256 = "d3511ac0f822d512c42abd34b3122f2990862d3d0af6ce464ff372f5bd7f35e9";
12   };
14 stdenv.mkDerivation rec {
15   name = "glob2-${version}.${patchlevel}";
17   src = fetchurl {
18     url = "mirror://savannah/glob2/${version}/${name}.tar.gz";
19     sha256 = "1f0l2cqp2g3llhr9jl6jj15k0wb5q8n29vqj99xy4p5hqs78jk8g";
20   };
22   patches = [ ./header-order.patch ./public-buildproject.patch
23     (fetchpatch {
24       url = "https://bitbucket.org/giszmo/glob2/commits/c9dc715624318e4fea4abb24e04f0ebdd9cd8d2a/raw";
25       sha256 = "0017xg5agj3dy0hx71ijdcrxb72bjqv7x6aq7c9zxzyyw0mkxj0k";
26     })
27     (fetchpatch {
28       url = "https://sources.debian.org/data/main/g/glob2/0.9.4.4-6/debian/patches/10_pthread_underlinkage.patch";
29       sha256 = "sha256-L9POADlkgQbUQEUmx4s3dxXG9tS0w2IefpRGuQNRMI0=";
30     })
31     (fetchpatch {
32       url = "https://sources.debian.org/data/main/g/glob2/0.9.4.4-6/debian/patches/link-boost-system.patch";
33       sha256 = "sha256-ne6F2ZowB+TUmg3ePuUoPNxXI0ZJC6HEol3oQQHJTy4=";
34     })
35     (fetchpatch {
36       url = "https://sources.debian.org/data/main/g/glob2/0.9.4.4-6/debian/patches/scons.patch";
37       sha256 = "sha256-Gah7SoVcd/Aljs0Nqo3YF0lZImUWtrGM4HbbQ4yrhHU=";
38     })
39     (fetchpatch {
40       url = "https://sources.debian.org/data/main/g/glob2/0.9.4.4-6/debian/patches/boost-1.69.patch";
41       sha256 = "sha256-D7agFR4uyIHxQz690Q8EHPF+rTEoiGUpgkm7r5cL5SI=";
42     })
43   ];
45   postPatch = ''
46     cp campaigns/tutorial-part4.map{,.orig}
47     bspatch  campaigns/tutorial-part4.map{.orig,} ${tutorial4patch}
48     sed -i -e "s@env = Environment()@env = Environment( ENV = os.environ )@" SConstruct
49   '';
51   nativeBuildInputs = [ scons ];
52   buildInputs = [ libGLU libGL SDL SDL_ttf SDL_image zlib SDL_net speex libvorbis libogg boost fribidi bsdiff ];
54   postConfigure = ''
55     sconsFlags+=" BINDIR=$out/bin"
56     sconsFlags+=" INSTALLDIR=$out/share/globulation2"
57     sconsFlags+=" DATADIR=$out/share/globulation2/glob2"
58   '';
60   NIX_LDFLAGS = "-lboost_system";
62   meta = with lib; {
63     description = "RTS without micromanagement";
64     mainProgram = "glob2";
65     maintainers = with maintainers; [ raskin ];
66     platforms = platforms.linux;
67     license = licenses.gpl3;
68   };
69   passthru.updateInfo.downloadPage = "http://globulation2.org/wiki/Download_and_Install";