From 0063c8acb4a5de8d90c0cbadf54ce337bd921e76 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sat, 17 Dec 2016 15:04:59 +0300 Subject: [PATCH 1/5] p7zip: add setup hook --- pkgs/tools/archivers/p7zip/default.nix | 2 ++ pkgs/tools/archivers/p7zip/setup-hook.sh | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 pkgs/tools/archivers/p7zip/setup-hook.sh diff --git a/pkgs/tools/archivers/p7zip/default.nix b/pkgs/tools/archivers/p7zip/default.nix index 1af3f53ade9..2b61b5b2679 100644 --- a/pkgs/tools/archivers/p7zip/default.nix +++ b/pkgs/tools/archivers/p7zip/default.nix @@ -25,6 +25,8 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + setupHook = ./setup-hook.sh; + meta = { homepage = http://p7zip.sourceforge.net/; description = "A port of the 7-zip archiver"; diff --git a/pkgs/tools/archivers/p7zip/setup-hook.sh b/pkgs/tools/archivers/p7zip/setup-hook.sh new file mode 100644 index 00000000000..4dc88f07c0b --- /dev/null +++ b/pkgs/tools/archivers/p7zip/setup-hook.sh @@ -0,0 +1,5 @@ +unpackCmdHooks+=(_try7zip) +_try7zip() { + if ! [[ "$curSrc" =~ \.7z$ ]]; then return 1; fi + 7z x "$curSrc" +} From 60903f7320cdfc517a23ce80a0c21a31d4a2eee9 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sat, 17 Dec 2016 15:04:44 +0300 Subject: [PATCH 2/5] gzdoom: 2015-05-07 -> 2.2.0 --- pkgs/games/gzdoom/default.nix | 53 +++++++++++++++++++++++------------ 1 file changed, 35 insertions(+), 18 deletions(-) diff --git a/pkgs/games/gzdoom/default.nix b/pkgs/games/gzdoom/default.nix index 332c2fbeff1..9e6cc48b435 100644 --- a/pkgs/games/gzdoom/default.nix +++ b/pkgs/games/gzdoom/default.nix @@ -1,34 +1,51 @@ -{stdenv, fetchFromGitHub, cmake, fmod, mesa, SDL2}: +{ stdenv, fetchFromGitHub, cmake, zdoom +, openal, fluidsynth, soundfont-fluid, mesa_noglu, SDL2 +, bzip2, zlib, libjpeg, libsndfile, mpg123, game-music-emu }: -stdenv.mkDerivation { - name = "gzdoom-2015-05-07"; - src = fetchFromGitHub{ +stdenv.mkDerivation rec { + name = "gzdoom-${version}"; + version = "2.2.0"; + + src = fetchFromGitHub { owner = "coelckers"; repo = "gzdoom"; - rev = "a59824cd8897dea5dd452c31be1328415478f990"; - sha256 = "1lg9dk5prn2bjmyznq941a862alljvfgbb42whbpg0vw9vhpikak"; + rev = "g${version}"; + sha256 = "0xxgd8fa29pcdir1xah5cvx41bfy76p4dydpp13mf44p9pr29hrb"; }; - buildInputs = [ cmake fmod mesa SDL2 ]; + nativeBuildInputs = [ cmake ]; + buildInputs = [ + SDL2 mesa_noglu openal fluidsynth bzip2 zlib libjpeg libsndfile mpg123 + game-music-emu + ]; - cmakeFlags = [ "-DFMOD_LIBRARY=${fmod}/lib/libfmodex.so" ]; + enableParallelBuilding = true; - preConfigure='' - sed s@gzdoom.pk3@$out/share/gzdoom.pk3@ -i src/version.h + NIX_CFLAGS_LINK = [ "-lopenal" "-lfluidsynth" ]; + + preConfigure = '' + sed -i \ + -e "s@/usr/share/sounds/sf2/@${soundfont-fluid}/share/soundfonts/@g" \ + -e "s@FluidR3_GM.sf2@FluidR3_GM2-2.sf2@g" \ + src/sound/music_fluidsynth_mididevice.cpp ''; installPhase = '' - mkdir -p $out/bin - cp gzdoom $out/bin - mkdir -p $out/share - cp gzdoom.pk3 $out/share + install -Dm755 gzdoom "$out/lib/gzdoom/gzdoom" + for i in *.pk3; do + install -Dm644 "$i" "$out/lib/gzdoom/$i" + done + mkdir $out/bin + ln -s $out/lib/gzdoom/gzdoom $out/bin/gzdoom ''; - meta = { - homepage = https://github.com/coelckers/gzdoom; + meta = with stdenv.lib; { + homepage = "https://github.com/coelckers/gzdoom"; description = "A Doom source port based on ZDoom. It features an OpenGL renderer and lots of new features"; - license = stdenv.lib.licenses.unfree; - maintainers = [ stdenv.lib.maintainers.lassulus ]; + # Doom source license, MAME license + license = licenses.unfreeRedistributable; + platforms = platforms.linux; + maintainers = with maintainers; [ lassulus ]; }; } From 1cc9d9ef2ce80dee5c8f2ef9f8ae20ae76337d73 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sat, 17 Dec 2016 15:05:45 +0300 Subject: [PATCH 3/5] zdoom: 2.7.1 -> 2.8.1 --- pkgs/games/zdoom/default.nix | 73 ++++++++++++++++++++++-------------- 1 file changed, 45 insertions(+), 28 deletions(-) diff --git a/pkgs/games/zdoom/default.nix b/pkgs/games/zdoom/default.nix index ce25f3efda3..4aca0e0114d 100644 --- a/pkgs/games/zdoom/default.nix +++ b/pkgs/games/zdoom/default.nix @@ -1,40 +1,57 @@ -{ stdenv, fetchFromGitHub, cmake, fmod, mesa, SDL }: +{ stdenv, fetchurl, p7zip, cmake +, SDL2, openal, fluidsynth, soundfont-fluid, bzip2, zlib, libjpeg, game-music-emu +, libsndfile, mpg123 }: -stdenv.mkDerivation { - name = "zdoom-2.7.1"; - src = fetchFromGitHub { - #url = "https://github.com/rheit/zdoom"; - owner = "rheit"; - repo = "zdoom"; - rev = "2.7.1"; - sha256 = "00bx4sgl9j1dyih7yysfq4ah6msxw8580g53p99jfym34ky5ppkh"; +stdenv.mkDerivation rec { + name = "zdoom-${version}"; + majorVersion = "2.8"; + version = "${majorVersion}.1"; + + src = fetchurl { + url = "https://zdoom.org/files/zdoom/${majorVersion}/zdoom-${version}-src.7z"; + sha256 = "0453fqrh9l00xwphfxni5qkf9y134n3s1mr1dvi5cbkxcva7j8bq"; }; - buildInputs = [ cmake fmod mesa SDL ]; - - cmakeFlags = [ - "-DFMOD_LIBRARY=${fmod}/lib/libfmodex.so" - "-DSDL_INCLUDE_DIR=${SDL.dev}/include" + nativeBuildInputs = [ p7zip cmake ]; + buildInputs = [ + SDL2 openal fluidsynth bzip2 zlib libjpeg game-music-emu libsndfile mpg123 ]; - NIX_CFLAGS_COMPILE = [ "-I ${SDL.dev}/include/SDL" ]; - - preConfigure = '' - sed s@zdoom.pk3@$out/share/zdoom.pk3@ -i src/version.h - ''; + cmakeFlags = [ + "-DFORCE_INTERNAL_GME=OFF" + "-DGME_INCLUDE_DIR=${game-music-emu}/include" + "-DGME_LIBRARIES=${game-music-emu}/lib/libgme.so" + ]; - installPhase = '' - mkdir -p $out/bin - cp zdoom $out/bin - mkdir -p $out/share - cp zdoom.pk3 $out/share + sourceRoot = "."; + + enableParallelBuilding = true; + + NIX_CFLAGS_LINK = [ "-lopenal" "-lfluidsynth" ]; + + preConfigure = '' + sed -i \ + -e "s@/usr/share/sounds/sf2/@${soundfont-fluid}/share/soundfonts/@g" \ + -e "s@FluidR3_GM.sf2@FluidR3_GM2-2.sf2@g" \ + src/sound/music_fluidsynth_mididevice.cpp ''; - meta = { - homepage = http://zdoom.org/; + installPhase = '' + install -Dm755 zdoom "$out/lib/zdoom/zdoom" + for i in *.pk3; do + install -Dm644 "$i" "$out/lib/zdoom/$i" + done + mkdir -p $out/bin + ln -s $out/lib/zdoom/zdoom $out/bin/zdoom + ''; + + meta = with stdenv.lib; { + homepage = "http://zdoom.org/"; description = "Enhanced port of the official DOOM source code"; - license = stdenv.lib.licenses.unfree; - maintainers = [ stdenv.lib.maintainers.lassulus ]; + # Doom source license, MAME license + license = licenses.unfreeRedistributable; + platforms = platforms.linux; + maintainers = with maintainer;s [ lassulus ]; }; } From dca2e720bc2882edfa6589abe2fea0392e200519 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sat, 17 Dec 2016 15:31:45 +0300 Subject: [PATCH 4/5] zandronum: bundle fmod, fix libraries --- pkgs/games/zandronum/default.nix | 30 ++++++++++-------- pkgs/games/zandronum/fmod.nix | 52 ++++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 - 3 files changed, 70 insertions(+), 13 deletions(-) create mode 100644 pkgs/games/zandronum/fmod.nix diff --git a/pkgs/games/zandronum/default.nix b/pkgs/games/zandronum/default.nix index 39c1ea6b746..7b418559418 100644 --- a/pkgs/games/zandronum/default.nix +++ b/pkgs/games/zandronum/default.nix @@ -1,9 +1,11 @@ -{ stdenv, lib, fetchhg, cmake, pkgconfig, makeWrapper -, SDL, mesa, bzip2, zlib, fmod, libjpeg, fluidsynth, openssl, sqlite-amalgamation +{ stdenv, lib, fetchhg, cmake, pkgconfig, makeWrapper, callPackage +, soundfont-fluid, SDL, mesa, bzip2, zlib, libjpeg, fluidsynth, openssl, sqlite-amalgamation, gtk2 , serverOnly ? false }: -let suffix = lib.optionalString serverOnly "-server"; +let + suffix = lib.optionalString serverOnly "-server"; + fmod = callPackage ./fmod.nix { }; # FIXME: drop binary package when upstream fixes their protocol versioning in stdenv.mkDerivation { @@ -18,7 +20,7 @@ in stdenv.mkDerivation { # I have no idea why would SDL and libjpeg be needed for the server part! # But they are. buildInputs = [ openssl bzip2 zlib SDL libjpeg ] - ++ lib.optionals (!serverOnly) [ mesa fmod fluidsynth ]; + ++ lib.optionals (!serverOnly) [ mesa fmod fluidsynth gtk2 ]; nativeBuildInputs = [ cmake pkgconfig makeWrapper ]; @@ -26,6 +28,11 @@ in stdenv.mkDerivation { ln -s ${sqlite-amalgamation}/* sqlite/ sed -ie 's| restrict| _restrict|g' dumb/include/dumb.h \ dumb/src/it/*.c + '' + lib.optionalString serverOnly '' + sed -i \ + -e "s@/usr/share/sounds/sf2/@${soundfont-fluid}/share/soundfonts/@g" \ + -e "s@FluidR3_GM.sf2@FluidR3_GM2-2.sf2@g" \ + src/sound/music_fluidsynth_mididevice.cpp ''; cmakeFlags = @@ -39,27 +46,26 @@ in stdenv.mkDerivation { installPhase = '' mkdir -p $out/bin - mkdir -p $out/share/zandronum + mkdir -p $out/lib/zandronum cp zandronum${suffix} \ - zandronum.pk3 \ - skulltag_actors.pk3 \ + *.pk3 \ ${lib.optionalString (!serverOnly) "liboutput_sdl.so"} \ - $out/share/zandronum + $out/lib/zandronum # For some reason, while symlinks work for binary version, they don't for source one. - makeWrapper $out/share/zandronum/zandronum${suffix} $out/bin/zandronum${suffix} + makeWrapper $out/lib/zandronum/zandronum${suffix} $out/bin/zandronum${suffix} ''; postFixup = lib.optionalString (!serverOnly) '' - patchelf --set-rpath $(patchelf --print-rpath $out/share/zandronum/zandronum):$out/share/zandronum \ - $out/share/zandronum/zandronum + patchelf --set-rpath $(patchelf --print-rpath $out/lib/zandronum/zandronum):$out/lib/zandronum \ + $out/lib/zandronum/zandronum ''; meta = with stdenv.lib; { homepage = http://zandronum.com/; description = "Multiplayer oriented port, based off Skulltag, for Doom and Doom II by id Software"; maintainers = with maintainers; [ lassulus ]; - license = stdenv.lib.licenses.unfree; + license = licenses.unfreeRedistributable; platforms = platforms.linux; }; } diff --git a/pkgs/games/zandronum/fmod.nix b/pkgs/games/zandronum/fmod.nix new file mode 100644 index 00000000000..b45ec24ca6b --- /dev/null +++ b/pkgs/games/zandronum/fmod.nix @@ -0,0 +1,52 @@ +{ stdenv, fetchurl }: + +assert (stdenv.system == "x86_64-linux") || (stdenv.system == "i686-linux"); +let + bits = stdenv.lib.optionalString (stdenv.system == "x86_64-linux") "64"; + + libPath = stdenv.lib.makeLibraryPath + [ stdenv.cc.libc stdenv.cc.cc ] + ":${stdenv.cc.cc.lib}/lib64"; + patchLib = x: "patchelf --set-rpath ${libPath} ${x}"; + + src = + (if (bits == "64") then + fetchurl { + url = "http://zandronum.com/essentials/fmod/fmodapi42416linux64.tar.gz"; + sha256 = "0hkwlzchzzgd7fanqznbv5bs53z2qy8iiv9l2y77l4sg1jwmlm6y"; + } + else + fetchurl { + url = "http://zandronum.com/essentials/fmod/fmodapi42416linux.tar.gz"; + sha256 = "13diw3ax2slkr99mwyjyc62b8awc30k0z08cvkpk2p3i1j6f85m5"; + } + ); +in +stdenv.mkDerivation rec { + inherit src; + + name = "fmod-${version}"; + version = "4.24.16"; + + dontStrip = true; + dontPatchELF = true; + dontBuild = true; + + makeFlags = [ "DESTLIBDIR=$(out)/lib" "DESTHDRDIR=$(out)/include" ]; + + preInstall = '' + mkdir -p $out/lib + ''; + + postInstall = '' + mv $out/lib/libfmodex${bits}-${version}.so $out/lib/libfmodex.so + mv $out/lib/libfmodexp${bits}-${version}.so $out/lib/libfmodexp.so + ''; + + meta = with stdenv.lib; { + description = "Programming library and toolkit for the creation and playback of interactive audio"; + homepage = "http://www.fmod.org/"; + license = licenses.unfreeRedistributable; + platforms = platforms.linux; + maintainers = [ stdenv.lib.maintainers.lassulus ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 910df7d74af..e632e2a795b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -16124,7 +16124,6 @@ in xsokoban = callPackage ../games/xsokoban { }; zandronum = callPackage ../games/zandronum { - fmod = fmod42416; cmake = cmake_2_8; }; From 18d42e1aa526cb9a28b1f4e4907665abf050c039 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Sat, 17 Dec 2016 15:32:08 +0300 Subject: [PATCH 5/5] fmod: remove --- pkgs/development/libraries/fmod/4.24.16.nix | 52 --------------------- pkgs/development/libraries/fmod/default.nix | 41 ---------------- pkgs/top-level/all-packages.nix | 4 -- 3 files changed, 97 deletions(-) delete mode 100644 pkgs/development/libraries/fmod/4.24.16.nix delete mode 100644 pkgs/development/libraries/fmod/default.nix diff --git a/pkgs/development/libraries/fmod/4.24.16.nix b/pkgs/development/libraries/fmod/4.24.16.nix deleted file mode 100644 index b45ec24ca6b..00000000000 --- a/pkgs/development/libraries/fmod/4.24.16.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ stdenv, fetchurl }: - -assert (stdenv.system == "x86_64-linux") || (stdenv.system == "i686-linux"); -let - bits = stdenv.lib.optionalString (stdenv.system == "x86_64-linux") "64"; - - libPath = stdenv.lib.makeLibraryPath - [ stdenv.cc.libc stdenv.cc.cc ] + ":${stdenv.cc.cc.lib}/lib64"; - patchLib = x: "patchelf --set-rpath ${libPath} ${x}"; - - src = - (if (bits == "64") then - fetchurl { - url = "http://zandronum.com/essentials/fmod/fmodapi42416linux64.tar.gz"; - sha256 = "0hkwlzchzzgd7fanqznbv5bs53z2qy8iiv9l2y77l4sg1jwmlm6y"; - } - else - fetchurl { - url = "http://zandronum.com/essentials/fmod/fmodapi42416linux.tar.gz"; - sha256 = "13diw3ax2slkr99mwyjyc62b8awc30k0z08cvkpk2p3i1j6f85m5"; - } - ); -in -stdenv.mkDerivation rec { - inherit src; - - name = "fmod-${version}"; - version = "4.24.16"; - - dontStrip = true; - dontPatchELF = true; - dontBuild = true; - - makeFlags = [ "DESTLIBDIR=$(out)/lib" "DESTHDRDIR=$(out)/include" ]; - - preInstall = '' - mkdir -p $out/lib - ''; - - postInstall = '' - mv $out/lib/libfmodex${bits}-${version}.so $out/lib/libfmodex.so - mv $out/lib/libfmodexp${bits}-${version}.so $out/lib/libfmodexp.so - ''; - - meta = with stdenv.lib; { - description = "Programming library and toolkit for the creation and playback of interactive audio"; - homepage = "http://www.fmod.org/"; - license = licenses.unfreeRedistributable; - platforms = platforms.linux; - maintainers = [ stdenv.lib.maintainers.lassulus ]; - }; -} diff --git a/pkgs/development/libraries/fmod/default.nix b/pkgs/development/libraries/fmod/default.nix deleted file mode 100644 index af946019540..00000000000 --- a/pkgs/development/libraries/fmod/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ stdenv, fetchurl }: - -assert (stdenv.system == "x86_64-linux") || (stdenv.system == "i686-linux"); -let - bits = stdenv.lib.optionalString (stdenv.system == "x86_64-linux") "64"; - - libPath = stdenv.lib.makeLibraryPath - [ stdenv.cc.libc stdenv.cc.cc ] + ":${stdenv.cc.cc.lib}/lib64"; - patchLib = x: "patchelf --set-rpath ${libPath} ${x}"; -in -stdenv.mkDerivation rec { - name = "fmod-${version}"; - version = "4.44.41"; - - src = fetchurl { - url = "http://www.fmod.org/download/fmodex/api/Linux/fmodapi44441linux.tar.gz"; - sha256 = "0qjvbhx9g6ijv542n6w3ryv20f74p1qx6bbllda9hl14683z8r8p"; - }; - - dontStrip = true; - dontBuild = true; - - installPhase = '' - mkdir -p $out/lib $out/include/fmodex - - cd api/inc && cp * $out/include/fmodex && cd ../lib - cp libfmodex${bits}-${version}.so $out/lib/libfmodex.so - cp libfmodexL${bits}-${version}.so $out/lib/libfmodexL.so - - ${patchLib "$out/lib/libfmodex.so"} - ${patchLib "$out/lib/libfmodexL.so"} - ''; - - meta = { - description = "Programming library and toolkit for the creation and playback of interactive audio"; - homepage = "http://www.fmod.org/"; - license = stdenv.lib.licenses.unfreeRedistributable; - platforms = stdenv.lib.platforms.linux; - maintainers = [ stdenv.lib.maintainers.thoughtpolice ]; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e632e2a795b..68491795b42 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7012,10 +7012,6 @@ in fltk13 = callPackage ../development/libraries/fltk { }; fltk = self.fltk13; - fmod = callPackage ../development/libraries/fmod { }; - - fmod42416 = callPackage ../development/libraries/fmod/4.24.16.nix { }; - fplll = callPackage ../development/libraries/fplll {}; fplll_20160331 = callPackage ../development/libraries/fplll/20160331.nix {};