minetest: 5.7.0 -> 5.8.0, cleanup

* Inline the generic builder, since we don't build multiple versions
anymore
* Remove unused patches, flags, and overrides
* Remove minetest_game, it has been debundled
* Use finalAttrs
* Use lib.cmake*
* Add a top-level attribute for the touch variant
* Define the server- and client-only variants through overrides in
all-packages.nix
* Move the *_5 aliases to top-level/aliases.nix
* General cleanup

Closes #273207

+93 -98
+86 -91
pkgs/games/minetest/default.nix
··· 38 38 , Carbon 39 39 , Cocoa 40 40 , withTouchSupport ? false 41 + , buildClient ? true 42 + , buildServer ? true 41 43 }: 42 44 43 - with lib; 45 + stdenv.mkDerivation (finalAttrs: { 46 + pname = "minetest"; 47 + version = "5.8.0"; 44 48 45 - let 46 - boolToCMake = b: if b then "ON" else "OFF"; 49 + src = fetchFromGitHub { 50 + owner = "minetest"; 51 + repo = "minetest"; 52 + rev = finalAttrs.version; 53 + hash = "sha256-Oct8nQORSH8PjYs+gHU9QrKObMfapjAlGvycj+AJnOs="; 54 + }; 47 55 48 - irrlichtmtInput = irrlichtmt.override { inherit withTouchSupport; }; 56 + cmakeFlags = [ 57 + (lib.cmakeBool "BUILD_CLIENT" buildClient) 58 + (lib.cmakeBool "BUILD_SERVER" buildServer) 59 + (lib.cmakeBool "ENABLE_PROMETHEUS" buildServer) 60 + (lib.cmakeBool "ENABLE_TOUCH" withTouchSupport) 61 + # Ensure we use system libraries 62 + (lib.cmakeBool "ENABLE_SYSTEM_GMP" true) 63 + (lib.cmakeBool "ENABLE_SYSTEM_JSONCPP" true) 64 + # Updates are handled by nix anyway 65 + (lib.cmakeBool "ENABLE_UPDATE_CHECKER" false) 66 + # ...but make it clear that this is a nix package 67 + (lib.cmakeFeature "VERSION_EXTRA" "NixOS") 49 68 50 - generic = { version, rev ? version, sha256, dataRev ? version, dataSha256, buildClient ? true, buildServer ? false }: let 51 - sources = { 52 - src = fetchFromGitHub { 53 - owner = "minetest"; 54 - repo = "minetest"; 55 - inherit rev sha256; 56 - }; 57 - data = fetchFromGitHub { 58 - owner = "minetest"; 59 - repo = "minetest_game"; 60 - rev = dataRev; 61 - sha256 = dataSha256; 62 - }; 63 - }; 64 - in stdenv.mkDerivation { 65 - pname = "minetest"; 66 - inherit version; 69 + # Remove when https://github.com/NixOS/nixpkgs/issues/144170 is fixed 70 + (lib.cmakeFeature "CMAKE_INSTALL_BINDIR" "bin") 71 + (lib.cmakeFeature "CMAKE_INSTALL_DATADIR" "share") 72 + (lib.cmakeFeature "CMAKE_INSTALL_DOCDIR" "share/doc/minetest") 73 + (lib.cmakeFeature "CMAKE_INSTALL_MANDIR" "share/man") 74 + (lib.cmakeFeature "CMAKE_INSTALL_LOCALEDIR" "share/locale") 67 75 68 - src = sources.src; 76 + ]; 69 77 70 - cmakeFlags = [ 71 - "-G Ninja" 72 - "-DBUILD_CLIENT=${boolToCMake buildClient}" 73 - "-DBUILD_SERVER=${boolToCMake buildServer}" 74 - "-DENABLE_GETTEXT=1" 75 - "-DENABLE_SPATIAL=1" 76 - "-DENABLE_SYSTEM_JSONCPP=1" 78 + nativeBuildInputs = [ 79 + cmake 80 + doxygen 81 + graphviz 82 + ninja 83 + ]; 77 84 78 - # Remove when https://github.com/NixOS/nixpkgs/issues/144170 is fixed 79 - "-DCMAKE_INSTALL_BINDIR=bin" 80 - "-DCMAKE_INSTALL_DATADIR=share" 81 - "-DCMAKE_INSTALL_DOCDIR=share/doc" 82 - "-DCMAKE_INSTALL_DOCDIR=share/doc" 83 - "-DCMAKE_INSTALL_MANDIR=share/man" 84 - "-DCMAKE_INSTALL_LOCALEDIR=share/locale" 85 - 86 - ] ++ optionals buildServer [ 87 - "-DENABLE_PROMETHEUS=1" 88 - ] ++ optionals withTouchSupport [ 89 - "-DENABLE_TOUCH=TRUE" 90 - ]; 91 - 92 - env.NIX_CFLAGS_COMPILE = "-DluaL_reg=luaL_Reg"; # needed since luajit-2.1.0-beta3 93 - 94 - nativeBuildInputs = [ cmake doxygen graphviz ninja ]; 95 - 96 - buildInputs = [ 97 - irrlichtmtInput jsoncpp gettext freetype sqlite curl bzip2 ncurses 98 - gmp libspatialindex 99 - ] ++ [ (if lib.meta.availableOn stdenv.hostPlatform luajit then luajit else lua5_1) ] ++ [ 100 - ] ++ optionals stdenv.isDarwin [ 101 - libiconv OpenGL OpenAL Carbon Cocoa 102 - ] ++ optionals buildClient [ 103 - libpng libjpeg libGLU openal libogg libvorbis xorg.libX11 104 - ] ++ optionals buildServer [ 105 - leveldb postgresql hiredis prometheus-cpp 106 - ]; 107 - 108 - postPatch = '' 109 - substituteInPlace src/filesys.cpp --replace "/bin/rm" "${coreutils}/bin/rm" 110 - '' + lib.optionalString stdenv.isDarwin '' 111 - sed -i '/pagezero_size/d;/fixup_bundle/d' src/CMakeLists.txt 112 - ''; 85 + buildInputs = [ 86 + irrlichtmt 87 + jsoncpp 88 + gettext 89 + freetype 90 + sqlite 91 + curl 92 + bzip2 93 + ncurses 94 + gmp 95 + libspatialindex 96 + ] ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform luajit) luajit 97 + ++ lib.optionals stdenv.isDarwin [ 98 + libiconv 99 + OpenGL 100 + OpenAL 101 + Carbon 102 + Cocoa 103 + ] ++ lib.optionals buildClient [ 104 + libpng 105 + libjpeg 106 + libGLU 107 + openal 108 + libogg 109 + libvorbis 110 + xorg.libX11 111 + ] ++ lib.optionals buildServer [ 112 + leveldb 113 + postgresql 114 + hiredis 115 + prometheus-cpp 116 + ]; 113 117 114 - postInstall = lib.optionalString stdenv.isLinux '' 115 - mkdir -pv $out/share/minetest/games/minetest_game/ 116 - cp -rv ${sources.data}/* $out/share/minetest/games/minetest_game/ 117 - patchShebangs $out 118 - '' + lib.optionalString stdenv.isDarwin '' 119 - mkdir -p $out/Applications 120 - mv $out/minetest.app $out/Applications 121 - ''; 118 + postPatch = '' 119 + substituteInPlace src/filesys.cpp --replace "/bin/rm" "${coreutils}/bin/rm" 120 + '' + lib.optionalString stdenv.isDarwin '' 121 + sed -i '/pagezero_size/d;/fixup_bundle/d' src/CMakeLists.txt 122 + ''; 122 123 123 - meta = with lib; { 124 - homepage = "http://minetest.net/"; 125 - description = "Infinite-world block sandbox game"; 126 - license = licenses.lgpl21Plus; 127 - platforms = platforms.linux ++ platforms.darwin; 128 - maintainers = with maintainers; [ pyrolagus fpletz fgaz ]; 129 - }; 130 - }; 124 + postInstall = lib.optionalString stdenv.isLinux '' 125 + patchShebangs $out 126 + '' + lib.optionalString stdenv.isDarwin '' 127 + mkdir -p $out/Applications 128 + mv $out/minetest.app $out/Applications 129 + ''; 131 130 132 - v5 = { 133 - version = "5.7.0"; 134 - sha256 = "sha256-9AL6gTmy05yTeYfCq3EMK4gqpBWdHwvJ5Flpzj8hFAE="; 135 - dataSha256 = "sha256-wWgeO8513N5jQdWvZrq357fPpAU5ik06mgZraWCQawo="; 131 + meta = with lib; { 132 + homepage = "https://minetest.net/"; 133 + description = "Infinite-world block sandbox game"; 134 + license = licenses.lgpl21Plus; 135 + platforms = platforms.linux ++ platforms.darwin; 136 + maintainers = with maintainers; [ pyrolagus fpletz fgaz ]; 136 137 }; 137 - 138 - mkClient = version: generic (version // { buildClient = true; buildServer = false; }); 139 - mkServer = version: generic (version // { buildClient = false; buildServer = true; }); 140 - in { 141 - minetestclient_5 = mkClient v5; 142 - minetestserver_5 = mkServer v5; 143 - } 138 + })
+2
pkgs/top-level/aliases.nix
··· 598 598 miopen-hip = throw "'miopen-hip' has been replaced with 'rocmPackages.miopen-hip'"; # Added 2023-10-08 599 599 miopen-opencl = throw "'miopen-opencl' has been replaced with 'rocmPackages.miopen-opencl'"; # Added 2023-10-08 600 600 mime-types = mailcap; # Added 2022-01-21 601 + minetestclient_5 = minetestclient; # Added 2023-12-11 602 + minetestserver_5 = minetestserver; # Added 2023-12-11 601 603 minizip2 = pkgs.minizip-ng; # Added 2022-12-28 602 604 mirage-im = throw "'mirage-im' has been removed, as it was broken and unmaintained"; # Added 2023-11-26 603 605 monero = monero-cli; # Added 2021-11-28
+5 -7
pkgs/top-level/all-packages.nix
··· 38029 38029 38030 38030 moon-buggy = callPackage ../games/moon-buggy { }; 38031 38031 38032 - inherit (callPackages ../games/minetest { 38032 + minetest = callPackage ../games/minetest { 38033 38033 inherit (darwin.apple_sdk.frameworks) OpenGL OpenAL Carbon Cocoa; 38034 - }) 38035 - minetestclient_5 minetestserver_5; 38036 - 38037 - minetest = minetestclient; 38038 - minetestclient = minetestclient_5; 38039 - minetestserver = minetestserver_5; 38034 + }; 38035 + minetestclient = minetest.override { buildServer = false; }; 38036 + minetest-touch = minetest.override { buildServer = false; withTouchSupport = true; }; 38037 + minetestserver = minetest.override { buildClient = false; }; 38040 38038 38041 38039 mnemosyne = callPackage ../games/mnemosyne { 38042 38040 python = python3;