1{
2 lib,
3 stdenv,
4 fetchurl,
5 amoeba-data,
6 alsa-lib,
7 expat,
8 freetype,
9 gtk3,
10 libvorbis,
11 libGLU,
12 xorg,
13 pkg-config,
14 installShellFiles,
15}:
16
17stdenv.mkDerivation rec {
18 pname = "amoeba";
19 version = "1.1";
20 debver = "31";
21
22 srcs = [
23 (fetchurl {
24 url = "http://http.debian.net/debian/pool/contrib/a/amoeba/amoeba_${version}.orig.tar.gz";
25 hash = "sha256-NT6oMuAlTcVZEnYjMCF+BD+k3/w7LfWEmj6bkQln3sM=";
26 })
27 (fetchurl {
28 url = "http://http.debian.net/debian/pool/contrib/a/amoeba/amoeba_${version}-${debver}.debian.tar.xz";
29 hash = "sha256-Ga/YeXbPXjkG/6qd9Z201d14Hlj/Je6DxgzeIQOqrWc=";
30 })
31 ];
32 sourceRoot = "amoeba-1.1.orig";
33
34 prePatch = ''
35 patches="${./include-string-h.patch} $(echo ../debian/patches/*.diff)"
36 '';
37 postPatch = ''
38 sed -i packer/pakfile.cpp -e 's|/usr/share/amoeba|${amoeba-data}/share/amoeba|'
39 sed -i main/linux-config/linux-config.cpp -e 's|libgdk-x11-2.0.so.0|${gtk3}/lib/&|'
40 sed -i main/linux-config/linux-config.cpp -e 's|libgtk-x11-2.0.so.0|${gtk3}/lib/&|'
41 '';
42
43 nativeBuildInputs = [
44 pkg-config
45 installShellFiles
46 ];
47 buildInputs = [
48 alsa-lib
49 expat
50 freetype
51 gtk3
52 libvorbis
53 libGLU
54 xorg.libXxf86vm
55 ];
56
57 installPhase = ''
58 mkdir -p $out/bin
59 cp amoeba $out/bin/
60 installManPage ../debian/amoeba.1
61 '';
62
63 meta = with lib; {
64 description = "Fast-paced, polished OpenGL demonstration by Excess";
65 homepage = "https://packages.qa.debian.org/a/amoeba.html";
66 license = licenses.gpl2Only; # Engine is GPLv2, data files in amoeba-data nonfree
67 maintainers = [ maintainers.dezgeg ];
68 platforms = platforms.linux;
69 };
70}