diff options
Diffstat (limited to 'pkgs/games')
48 files changed, 516 insertions, 628 deletions
diff --git a/pkgs/games/alienarena/default.nix b/pkgs/games/alienarena/default.nix index 39b232b267c3..2aff5c86151e 100644 --- a/pkgs/games/alienarena/default.nix +++ b/pkgs/games/alienarena/default.nix @@ -1,19 +1,42 @@ -{ lib, stdenv, fetchsvn, pkg-config, libjpeg, libX11, libXxf86vm, curl, libogg -, libvorbis, freetype, openal, libGL }: +{ curl +, fetchFromGitHub +, freetype +, lib +, libGL +, libjpeg +, libogg +, libvorbis +, libX11 +, libXxf86vm +, openal +, pkg-config +, stdenv +}: stdenv.mkDerivation rec { pname = "alienarena"; - version = "7.71.2"; + version = "7.71.6"; - src = fetchsvn { - url = "svn://svn.icculus.org/alienarena/trunk"; - rev = "5673"; - sha256 = "1qfrgrp7nznk5n1jqvjba6l1w8y2ixzyx9swkpvd02rdwlwrp9kw"; + src = fetchFromGitHub { + owner = "alienarena"; + repo = "alienarena"; + rev = version; + hash = "sha256-Dml0VY5VQiWLq8LjItBSzNwJB9L4biJ/nJWmEGtG2ZY="; }; nativeBuildInputs = [ pkg-config ]; - buildInputs = [ libjpeg libX11 curl libogg libvorbis - freetype openal libGL libXxf86vm ]; + + buildInputs = [ + curl + freetype + libGL + libjpeg + libogg + libvorbis + libX11 + libXxf86vm + openal + ]; patchPhase = '' substituteInPlace ./configure \ @@ -22,6 +45,7 @@ stdenv.mkDerivation rec { ''; meta = with lib; { + changelog = "https://github.com/alienarena/alienarena/releases/tag/${version}"; description = "A free, stand-alone first-person shooter computer game"; longDescription = '' Do you like old school deathmatch with modern features? How @@ -32,7 +56,7 @@ stdenv.mkDerivation rec { with a retro alien theme, while adding tons of original ideas to make the game quite unique. ''; - homepage = "http://red.planetarena.org"; + homepage = "https://alienarena.org"; # Engine is under GPLv2, everything else is under license = licenses.unfreeRedistributable; maintainers = with maintainers; [ astsmtl ]; diff --git a/pkgs/games/brogue-ce/default.nix b/pkgs/games/brogue-ce/default.nix index 77e58ed5a1a6..32ca328492bc 100644 --- a/pkgs/games/brogue-ce/default.nix +++ b/pkgs/games/brogue-ce/default.nix @@ -7,14 +7,14 @@ , SDL2_image }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "brogue-ce"; version = "1.13"; src = fetchFromGitHub { owner = "tmewett"; repo = "BrogueCE"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; hash = "sha256-FUIdi1Ytn+INeD9550MW41qXtLb6in0QS3Snt8QaXUA="; }; @@ -60,4 +60,4 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ AndersonTorres fgaz ]; platforms = platforms.all; }; -} +}) diff --git a/pkgs/games/brogue/default.nix b/pkgs/games/brogue/default.nix index 0cd3e779c563..770ff3622923 100644 --- a/pkgs/games/brogue/default.nix +++ b/pkgs/games/brogue/default.nix @@ -1,11 +1,11 @@ { lib, stdenv, fetchurl, fetchpatch, SDL, ncurses, libtcod, makeDesktopItem }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "brogue"; version = "1.7.5"; src = fetchurl { - url = "https://sites.google.com/site/broguegame/brogue-${version}-linux-amd64.tbz2"; + url = "https://sites.google.com/site/broguegame/brogue-${finalAttrs.version}-linux-amd64.tbz2"; sha256 = "0i042zb3axjf0cpgpdh8hvfn66dbfizidyvw0iymjk2n760z2kx7"; }; patches = [ @@ -40,7 +40,7 @@ stdenv.mkDerivation rec { installPhase = '' install -m 555 -D bin/brogue $out/bin/brogue - install -m 444 -D ${desktopItem}/share/applications/brogue.desktop $out/share/applications/brogue.desktop + install -m 444 -D ${finalAttrs.desktopItem}/share/applications/brogue.desktop $out/share/applications/brogue.desktop install -m 444 -D bin/brogue-icon.png $out/share/icons/hicolor/256x256/apps/brogue.png mkdir -p $out/share/brogue cp -r bin/fonts $out/share/brogue/ @@ -56,4 +56,4 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ AndersonTorres fgaz ]; platforms = [ "x86_64-linux" ]; }; -} +}) diff --git a/pkgs/games/cdogs-sdl/default.nix b/pkgs/games/cdogs-sdl/default.nix index 5c74b10ef32a..e6ea213b6220 100644 --- a/pkgs/games/cdogs-sdl/default.nix +++ b/pkgs/games/cdogs-sdl/default.nix @@ -13,13 +13,13 @@ stdenv.mkDerivation rec { pname = "cdogs-sdl"; - version = "1.5.0"; + version = "2.0.0"; src = fetchFromGitHub { repo = pname; owner = "cxong"; rev = version; - sha256 = "sha256-XSq0TK3ZuLOa8JJnp/Qxt16Ru3p35tq5FOo4+tv+c60="; + sha256 = "sha256-es04sCqthjf9unK2mbsBVHlxOeTpimQ+ViabhC/WD0I="; }; postPatch = '' diff --git a/pkgs/games/curseofwar/default.nix b/pkgs/games/curseofwar/default.nix index fef456816ff2..c0accf1e7b64 100644 --- a/pkgs/games/curseofwar/default.nix +++ b/pkgs/games/curseofwar/default.nix @@ -4,14 +4,14 @@ , SDL }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "curseofwar"; version = "1.3.0"; src = fetchFromGitHub { owner = "a-nikolaev"; - repo = pname; - rev = "v${version}"; + repo = "curseofwar"; + rev = "v${finalAttrs.version}"; sha256 = "1wd71wdnj9izg5d95m81yx3684g4zdi7fsy0j5wwnbd9j34ilz1i"; }; @@ -33,5 +33,4 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ fgaz ]; platforms = platforms.all; }; -} - +}) diff --git a/pkgs/games/eduke32/default.nix b/pkgs/games/eduke32/default.nix index 051e097eb3a3..1ddcccd27f9d 100644 --- a/pkgs/games/eduke32/default.nix +++ b/pkgs/games/eduke32/default.nix @@ -1,16 +1,16 @@ { lib , stdenv -, fetchurl +, fetchFromGitLab , makeWrapper , pkg-config , nasm , makeDesktopItem +, copyDesktopItems , alsa-lib , flac , gtk2 , libvorbis , libvpx -, libGLU , libGL , SDL2 , SDL2_mixer @@ -18,29 +18,23 @@ , Cocoa , GLUT , OpenGL +, graphicsmagick }: let - desktopItem = makeDesktopItem { - name = "eduke32"; - exec = "@out@/bin/${wrapper}"; - comment = "Duke Nukem 3D port"; - desktopName = "Enhanced Duke Nukem 3D"; - genericName = "Duke Nukem 3D port"; - categories = [ "Game" ]; - }; - wrapper = "eduke32-wrapper"; + swWrapper = "voidsw-wrapper"; -in stdenv.mkDerivation rec { +in stdenv.mkDerivation (finalAttrs: { pname = "eduke32"; - version = "20230926"; - rev = "10459"; - revExtra = "8feaf6c25"; - - src = fetchurl { - url = "https://dukeworld.com/eduke32/synthesis/${version}-${rev}-${revExtra}/eduke32_src_${version}-${rev}-${revExtra}.tar.xz"; - hash = "sha256-GQOpDQm2FeaOMyYu9L5zhrM6XFvZAHMAwn1tSK7RCB8="; + version = "0-unstable-2024-02-17"; + + src = fetchFromGitLab { + domain = "voidpoint.io"; + owner = "terminx"; + repo = "eduke32"; + rev = "8afa42e388e0434b38979fdddc763363717a2727"; + hash = "sha256-dyZ4JtDBxsTDe9uQDWxJe7M74X7m+5wpEHm+i+s9hwo="; }; buildInputs = [ @@ -53,7 +47,6 @@ in stdenv.mkDerivation rec { alsa-lib gtk2 libGL - libGLU ] ++ lib.optionals stdenv.isDarwin [ AGL Cocoa @@ -61,21 +54,24 @@ in stdenv.mkDerivation rec { OpenGL ]; - nativeBuildInputs = [ makeWrapper pkg-config ] - ++ lib.optional (stdenv.hostPlatform.system == "i686-linux") nasm; + nativeBuildInputs = [ + makeWrapper + pkg-config + copyDesktopItems + graphicsmagick + ] ++ lib.optionals (stdenv.hostPlatform.system == "i686-linux") [ + nasm + ]; postPatch = '' substituteInPlace source/imgui/src/imgui_impl_sdl2.cpp \ - --replace '#include <SDL.h>' '#include <SDL2/SDL.h>' \ - --replace '#include <SDL_syswm.h>' '#include <SDL2/SDL_syswm.h>' \ - --replace '#include <SDL_vulkan.h>' '#include <SDL2/SDL_vulkan.h>' + --replace-fail '#include <SDL.h>' '#include <SDL2/SDL.h>' \ + --replace-fail '#include <SDL_syswm.h>' '#include <SDL2/SDL_syswm.h>' \ + --replace-fail '#include <SDL_vulkan.h>' '#include <SDL2/SDL_vulkan.h>' '' + lib.optionalString stdenv.isLinux '' - substituteInPlace source/build/src/glbuild.cpp \ - --replace libGLU.so ${libGLU}/lib/libGLU.so - for f in glad.c glad_wgl.c ; do substituteInPlace source/glad/src/$f \ - --replace libGL.so ${libGL}/lib/libGL.so + --replace-fail libGL.so ${libGL}/lib/libGL.so done ''; @@ -86,38 +82,72 @@ in stdenv.mkDerivation rec { "LTO=0" ]; + buildFlags = [ + "duke3d" + "sw" + ]; + + desktopItems = [ + (makeDesktopItem { + name = "eduke32"; + icon = "eduke32"; + exec = "${wrapper}"; + comment = "Duke Nukem 3D port"; + desktopName = "Enhanced Duke Nukem 3D"; + genericName = "Duke Nukem 3D port"; + categories = [ "Game" ]; + }) + (makeDesktopItem { + name = "voidsw"; + icon = "voidsw"; + exec = "${swWrapper}"; + comment = "Shadow Warrior eduke32 source port"; + desktopName = "VoidSW"; + genericName = "Shadow Warrior source port"; + categories = [ "Game" ]; + }) + ]; + enableParallelBuilding = true; installPhase = '' runHook preInstall - install -Dm755 -t $out/bin eduke32 mapster32 + install -Dm755 -t $out/bin eduke32 mapster32 voidsw wangulator '' + lib.optionalString stdenv.isLinux '' makeWrapper $out/bin/eduke32 $out/bin/${wrapper} \ --set-default EDUKE32_DATA_DIR /var/lib/games/eduke32 \ --add-flags '-g "$EDUKE32_DATA_DIR/DUKE3D.GRP"' - - cp -rv ${desktopItem}/share $out - substituteInPlace $out/share/applications/eduke32.desktop \ - --subst-var out + makeWrapper $out/bin/voidsw $out/bin/${swWrapper} \ + --set-default EDUKE32_DATA_DIR /var/lib/games/eduke32 \ + --add-flags '-g"$EDUKE32_DATA_DIR/SW.GRP"' + mkdir -p $out/share/icons/hicolor/scalable/apps + gm convert "./source/duke3d/rsrc/game_icon.ico[10]" $out/share/icons/hicolor/scalable/apps/eduke32.png + install -Dm644 ./source/sw/rsrc/game_icon.svg $out/share/icons/hicolor/scalable/apps/voidsw.svg '' + lib.optionalString stdenv.isDarwin '' mkdir -p $out/Applications/EDuke32.app/Contents/MacOS mkdir -p $out/Applications/Mapster32.app/Contents/MacOS + mkdir -p $out/Applications/VoidSW.app/Contents/MacOS + mkdir -p $out/Applications/Wangulator.app/Contents/MacOS cp -r platform/Apple/bundles/EDuke32.app/* $out/Applications/EDuke32.app/ cp -r platform/Apple/bundles/Mapster32.app/* $out/Applications/Mapster32.app/ + cp -r platform/Apple/bundles/VoidSW.app/* $out/Applications/VoidSW.app/ + cp -r platform/Apple/bundles/Wangulator.app/* $out/Applications/Wangulator.app/ ln -sf $out/bin/eduke32 $out/Applications/EDuke32.app/Contents/MacOS/eduke32 ln -sf $out/bin/mapster32 $out/Applications/Mapster32.app/Contents/MacOS/mapster32 + ln -sf $out/bin/voidsw $out/Applications/VoidSW.app/Contents/MacOS/voidsw + ln -sf $out/bin/wangulator $out/Applications/Wangulator.app/Contents/MacOS/wangulator '' + '' runHook postInstall ''; - meta = with lib; { + meta = { description = "Enhanched port of Duke Nukem 3D for various platforms"; homepage = "http://eduke32.com"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ mikroskeem sander ]; - platforms = platforms.all; + license = with lib.licenses; [ gpl2Plus ]; + maintainers = with lib.maintainers; [ mikroskeem sander ]; + platforms = lib.platforms.all; }; -} +}) diff --git a/pkgs/games/etlegacy/default.nix b/pkgs/games/etlegacy/default.nix deleted file mode 100644 index befbbc5ed291..000000000000 --- a/pkgs/games/etlegacy/default.nix +++ /dev/null @@ -1,141 +0,0 @@ -{ lib -, stdenv -, fetchurl -, writeShellApplication -, fetchFromGitHub -, cjson -, cmake -, git -, makeWrapper -, unzip -, curl -, freetype -, glew -, libjpeg -, libogg -, libpng -, libtheora -, lua -, minizip -, openal -, SDL2 -, sqlite -, zlib -}: -let - version = "2.81.1"; - - fetchAsset = { asset, hash }: fetchurl { - url = "https://mirror.etlegacy.com/etmain/${asset}"; - inherit hash; - }; - - pak0 = fetchAsset { - asset = "pak0.pk3"; - hash = "sha256-cSlmsg4GUj/oFBlRZQDkmchrK0/sgjhW3b0zP8s9JuU="; - }; - - pak1 = fetchAsset { - asset = "pak1.pk3"; - hash = "sha256-VhD9dJAkQFtEJafOY5flgYe5QdIgku8R1IRLQn31Pl0="; - }; - - pak2 = fetchAsset { - asset = "pak2.pk3"; - hash = "sha256-pIq3SaGhKrTZE3KGsfI9ZCwp2lmEWyuvyPZOBSzwbz4="; - }; - - fakeGit = writeShellApplication { - name = "git"; - - text = '' - if [ "$1" = "describe" ]; then - echo "${version}" - fi - ''; - }; -in -stdenv.mkDerivation { - pname = "etlegacy"; - inherit version; - - src = fetchFromGitHub { - owner = "etlegacy"; - repo = "etlegacy"; - rev = "refs/tags/v${version}"; - hash = "sha256-CGXtc51vaId/SHbD34ZeT0gPsrl7p2DEw/Kp+GBZIaA="; # 2.81.1 - }; - - nativeBuildInputs = [ - cjson - cmake - fakeGit - git - makeWrapper - unzip - ]; - - buildInputs = [ - curl - freetype - glew - libjpeg - libogg - libpng - libtheora - lua - minizip - openal - SDL2 - sqlite - zlib - ]; - - preBuild = '' - # Required for build time to not be in 1980 - export SOURCE_DATE_EPOCH=$(date +%s) - # This indicates the build was by a CI pipeline and prevents the resource - # files from being flagged as 'dirty' due to potentially being custom built. - export CI="true" - ''; - - cmakeFlags = [ - "-DCROSS_COMPILE32=0" - "-DBUILD_SERVER=1" - "-DBUILD_CLIENT=1" - "-DBUNDLED_JPEG=0" - "-DBUNDLED_LIBS=0" - "-DINSTALL_EXTRA=0" - "-DINSTALL_OMNIBOT=0" - "-DINSTALL_GEOIP=0" - "-DINSTALL_WOLFADMIN=0" - "-DFEATURE_AUTOUPDATE=0" - "-DINSTALL_DEFAULT_BASEDIR=${placeholder "out"}/lib/etlegacy" - "-DINSTALL_DEFAULT_BINDIR=${placeholder "out"}/bin" - ]; - - postInstall = '' - ln -s ${pak0} $out/lib/etlegacy/etmain/pak0.pk3 - ln -s ${pak1} $out/lib/etlegacy/etmain/pak1.pk3 - ln -s ${pak2} $out/lib/etlegacy/etmain/pak2.pk3 - - makeWrapper $out/bin/etl.* $out/bin/etl - makeWrapper $out/bin/etlded.* $out/bin/etlded - ''; - - hardeningDisable = [ "fortify" ]; - - meta = { - description = "ET: Legacy is an open source project based on the code of Wolfenstein: Enemy Territory which was released in 2010 under the terms of the GPLv3 license"; - homepage = "https://etlegacy.com"; - license = with lib.licenses; [ gpl3 cc-by-nc-sa-30 ]; - longDescription = '' - ET: Legacy, an open source project fully compatible client and server - for the popular online FPS game Wolfenstein: Enemy Territory - whose - gameplay is still considered unmatched by many, despite its great age. - ''; - mainProgram = "etl"; - maintainers = with lib.maintainers; [ ashleyghooper drupol ]; - platforms = lib.platforms.linux; - }; -} diff --git a/pkgs/games/fallout-ce/fallout-ce.nix b/pkgs/games/fallout-ce/fallout-ce.nix index 5f55743a674b..2f229fdf7380 100644 --- a/pkgs/games/fallout-ce/fallout-ce.nix +++ b/pkgs/games/fallout-ce/fallout-ce.nix @@ -4,13 +4,13 @@ callPackage ./build.nix rec { pname = "fallout-ce"; - version = "1.0.0"; + version = "1.1.0"; src = fetchFromGitHub { owner = "alexbatalov"; repo = "fallout1-ce"; rev = "v${version}"; - hash = "sha256-EvRkOlvtiVao63S0WRKKuHlhfkdTgc0m6GTyv4EfJFU="; + hash = "sha256-ZiBoF3SL00sN0QrD3fkWG9SAknumOvzRB1oQJff6ITA="; }; extraMeta = { diff --git a/pkgs/games/freeciv/default.nix b/pkgs/games/freeciv/default.nix index 9ff36c949ce3..6f653c46df86 100644 --- a/pkgs/games/freeciv/default.nix +++ b/pkgs/games/freeciv/default.nix @@ -10,13 +10,13 @@ stdenv.mkDerivation rec { pname = "freeciv"; - version = "3.0.10"; + version = "3.1.0"; src = fetchFromGitHub { owner = "freeciv"; repo = "freeciv"; rev = "R${lib.replaceStrings [ "." ] [ "_" ] version}"; - hash = "sha256-f+VJYWsfsoGLs9Ypk5cJQgn86PhsJ/6ODDjlnp84Frg="; + hash = "sha256-8cMy0O5VxVi1ffvA/Gz4BnTB0WvJptMSgM7Zu992k5k="; }; postPatch = '' @@ -55,6 +55,7 @@ stdenv.mkDerivation rec { ] ++ lib.optionals qtClient [ "--enable-client=qt" + "--with-qtver=qt5" "--with-qt5-includes=${qt5.qtbase.dev}/include" ] ++ lib.optionals gtkClient [ "--enable-client=gtk3.22" ] ++ lib.optional enableSqlite "--enable-fcdb=sqlite3" @@ -82,5 +83,6 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ pierron ]; platforms = platforms.unix; hydraPlatforms = platforms.linux; # sdl-config times out on darwin + broken = qtClient && stdenv.isDarwin; # Missing Qt5 development files }; } diff --git a/pkgs/games/galaxis/default.nix b/pkgs/games/galaxis/default.nix deleted file mode 100644 index a3847e73c8da..000000000000 --- a/pkgs/games/galaxis/default.nix +++ /dev/null @@ -1,47 +0,0 @@ -{ lib, stdenv, fetchurl, ncurses, xmlto }: - -with lib; -stdenv.mkDerivation rec { - - pname = "galaxis"; - version = "1.10"; - - src = fetchurl{ - url = "http://www.catb.org/~esr/galaxis/${pname}-${version}.tar.gz"; - sha256 = "1181x3z4r0794v2bkpigb5fablw1nayj42wvhy2am79p7j1iqq5r"; - }; - - buildInputs = [ ncurses xmlto ]; - - patchPhase = '' - sed -i\ - -e 's|^install: galaxis\.6 uninstall|install: galaxis.6|'\ - -e 's|usr/||g' -e 's|ROOT|DESTDIR|g'\ - -e 's|install -m 755 -o 0 -g 0|install -m 755|' Makefile - ''; - - dontConfigure = true; - - makeFlags = [ "DESTDIR=$(out)" ]; - - meta = { - description = "Rescue lifeboats lost in interstellar space"; - longDescription = '' - Lifeboats from a crippled interstellar liner are adrift in a starfield. To - find them, you can place probes that look in all eight compass directions - and tell you how many lifeboats they see. If you drop a probe directly on - a lifeboat it will be revealed immediately. Your objective: find the - lifeboats as quickly as possible, before the stranded passengers run out - of oxygen! - - This is a UNIX-hosted, curses-based clone of the nifty little Macintosh - freeware game Galaxis. It doesn't have the super-simple, point-and-click - interface of the original, but compensates by automating away some of the - game's simpler deductions. - ''; - homepage = "http://catb.org/~esr/galaxis/"; - license = licenses.gpl2; - maintainers = [ maintainers.AndersonTorres ]; - platforms = platforms.linux; - }; -} diff --git a/pkgs/games/gcompris/default.nix b/pkgs/games/gcompris/default.nix index a9e9f860d852..c6e16da0280c 100644 --- a/pkgs/games/gcompris/default.nix +++ b/pkgs/games/gcompris/default.nix @@ -20,11 +20,11 @@ stdenv.mkDerivation rec { pname = "gcompris"; - version = "3.3"; + version = "4.0"; src = fetchurl { url = "mirror://kde/stable/gcompris/qt/src/gcompris-qt-${version}.tar.xz"; - hash = "sha256-8hqiq1wYw4irbOXCrwcJqTMuLISzSmSqPuw2Rn8XzQA="; + hash = "sha256-wcTqnK7ESv+jWHr5asedlkQ5rZV9iV4PLS8yQkvuDrY="; }; cmakeFlags = [ diff --git a/pkgs/games/gimx/default.nix b/pkgs/games/gimx/default.nix index 9c2b260f1dbf..4173ac0cc2d6 100644 --- a/pkgs/games/gimx/default.nix +++ b/pkgs/games/gimx/default.nix @@ -1,4 +1,5 @@ -{ stdenv, lib, fetchFromGitHub, makeWrapper, curl, libusb1, xorg, libxml2 +{ stdenv, lib, fetchFromGitHub, fetchpatch +, makeWrapper, curl, libusb1, xorg, libxml2 , ncurses5, bluez, libmhash, gimxPdpGamepad ? false }: let @@ -21,7 +22,23 @@ in stdenv.mkDerivation rec { sha256 = "05kdv2qqr311c2p76hdlgvrq7b04vcpps5c80zn8b8l7p831ilgz"; }; - patches = [ ./conf.patch ]; + patches = [ + ./conf.patch + + # gcc-13 build fixes: + # https://github.com/matlo/GIMX/pull/705 + (fetchpatch { + name = "gcc-13-headers.patch"; + url = "https://github.com/matlo/GIMX/commit/4525dff4d9af672116d8c6c182707f2ad6295b2d.patch"; + hash = "sha256-LkswnFsxqADooa09yO7Yf0AbxTrGfjBObyv/6FQJvRs="; + }) + (fetchpatch { + name = "gcc-13-protos.patch"; + url = "https://github.com/matlo/GIMX/commit/f11855fcb8bd9d0cb9c94871b4111ddfd5b610df.patch"; + hash = "sha256-JL67UUsEyPcOuaimJtMviiGLGghuq9665Lg1QuiaWUU="; + }) + ]; + nativeBuildInputs = [ makeWrapper ]; buildInputs = [ curl libusb1 bluez libxml2 ncurses5 libmhash diff --git a/pkgs/games/gnonograms/default.nix b/pkgs/games/gnonograms/default.nix index 2446384ff719..c021ca46f57a 100644 --- a/pkgs/games/gnonograms/default.nix +++ b/pkgs/games/gnonograms/default.nix @@ -16,14 +16,14 @@ , libhandy }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "gnonograms"; version = "2.1.2"; src = fetchFromGitHub { owner = "jeremypw"; repo = "gnonograms"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; sha256 = "sha256-TkEVjrwlr4Q5FsfcdY+9fxwaMq+DFs0RwGI2E+GT5Mk="; }; @@ -63,4 +63,4 @@ stdenv.mkDerivation rec { homepage = "https://github.com/jeremypw/gnonograms"; platforms = platforms.all; }; -} +}) diff --git a/pkgs/games/gnujump/default.nix b/pkgs/games/gnujump/default.nix index 1c918395d40b..0fdffcf6fadb 100644 --- a/pkgs/games/gnujump/default.nix +++ b/pkgs/games/gnujump/default.nix @@ -1,10 +1,10 @@ { lib, stdenv, makeDesktopItem, copyDesktopItems, fetchurl, SDL, SDL_image, SDL_mixer }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "gnujump"; version = "1.0.8"; src = fetchurl { - url = "mirror://gnu/gnujump/${pname}-${version}.tar.gz"; + url = "mirror://gnu/gnujump/gnujump-${finalAttrs.version}.tar.gz"; sha256 = "05syy9mzbyqcfnm0hrswlmhwlwx54f0l6zhcaq8c1c0f8dgzxhqk"; }; @@ -39,4 +39,4 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ fgaz ]; platforms = platforms.linux; }; -} +}) diff --git a/pkgs/games/hikounomizu/default.nix b/pkgs/games/hikounomizu/default.nix index bca6c8ecf8b9..6e05a17b082e 100644 --- a/pkgs/games/hikounomizu/default.nix +++ b/pkgs/games/hikounomizu/default.nix @@ -22,12 +22,12 @@ , bc }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "hikounomizu"; version = "1.0.1"; src = fetchurl { - url = "http://download.tuxfamily.org/hnm/${version}/hikounomizu-${version}-src.tar.bz2"; + url = "http://download.tuxfamily.org/hnm/${finalAttrs.version}/hikounomizu-${finalAttrs.version}-src.tar.bz2"; hash = "sha256-3wRhe6CDq1dD0SObAygfqslYJx+EM3LM3rj6HI0whYU="; }; @@ -78,4 +78,4 @@ stdenv.mkDerivation rec { license = [ licenses.gpl3Plus licenses.lal13 ]; platforms = platforms.all; }; -} +}) diff --git a/pkgs/games/katago/default.nix b/pkgs/games/katago/default.nix index 4a66f6cc711e..834ec0774d7a 100644 --- a/pkgs/games/katago/default.nix +++ b/pkgs/games/katago/default.nix @@ -19,6 +19,7 @@ , enableBigBoards ? false , enableContrib ? false , enableTcmalloc ? true +, enableTrtPlanCache ? false }: assert lib.assertOneOf "backend" backend [ "opencl" "cuda" "tensorrt" "eigen" ]; @@ -67,25 +68,15 @@ stdenv.mkDerivation rec { ]; cmakeFlags = [ - "-DNO_GIT_REVISION=ON" - ] ++ lib.optionals enableAVX2 [ - "-DUSE_AVX2=ON" - ] ++ lib.optionals (backend == "eigen") [ - "-DUSE_BACKEND=EIGEN" - ] ++ lib.optionals (backend == "cuda") [ - "-DUSE_BACKEND=CUDA" - ] ++ lib.optionals (backend == "tensorrt") [ - "-DUSE_BACKEND=TENSORRT" - ] ++ lib.optionals (backend == "opencl") [ - "-DUSE_BACKEND=OPENCL" + (lib.cmakeFeature "USE_BACKEND" (lib.toUpper backend)) + (lib.cmakeBool "USE_AVX2" enableAVX2) + (lib.cmakeBool "USE_TCMALLOC" enableTcmalloc) + (lib.cmakeBool "USE_BIGGER_BOARDS_EXPENSIVE" enableBigBoards) + (lib.cmakeBool "USE_CACHE_TENSORRT_PLAN" enableTrtPlanCache) + (lib.cmakeBool "NO_GIT_REVISION" (!enableContrib)) ] ++ lib.optionals enableContrib [ - "-DBUILD_DISTRIBUTED=1" - "-DNO_GIT_REVISION=OFF" - "-DGIT_EXECUTABLE=${fakegit}/bin/git" - ] ++ lib.optionals enableTcmalloc [ - "-DUSE_TCMALLOC=ON" - ] ++ lib.optionals enableBigBoards [ - "-DUSE_BIGGER_BOARDS_EXPENSIVE=ON" + (lib.cmakeBool "BUILD_DISTRIBUTED" true) + (lib.cmakeFeature "GIT_EXECUTABLE" "${fakegit}/bin/git") ]; preConfigure = '' diff --git a/pkgs/games/lgames/barrage/default.nix b/pkgs/games/lgames/barrage/default.nix deleted file mode 100644 index 822ec04f1d45..000000000000 --- a/pkgs/games/lgames/barrage/default.nix +++ /dev/null @@ -1,32 +0,0 @@ -{ lib -, stdenv -, fetchurl -, SDL -, SDL_mixer -}: - -stdenv.mkDerivation rec { - pname = "barrage"; - version = "1.0.7"; - - src = fetchurl { - url = "mirror://sourceforge/lgames/${pname}-${version}.tar.gz"; - hash = "sha256-cGYrG7A4Ffh51KyR+UpeWu7A40eqxI8g4LefBIs18kg="; - }; - - buildInputs = [ - SDL - SDL_mixer - ]; - - hardeningDisable = [ "format" ]; - - meta = with lib; { - homepage = "https://lgames.sourceforge.io/Barrage/"; - description = "A destructive action game"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ AndersonTorres ]; - inherit (SDL.meta) platforms; - broken = stdenv.isDarwin; - }; -} diff --git a/pkgs/games/lgames/lbreakout2/default.nix b/pkgs/games/lgames/lbreakout2/default.nix deleted file mode 100644 index f554a1683eee..000000000000 --- a/pkgs/games/lgames/lbreakout2/default.nix +++ /dev/null @@ -1,48 +0,0 @@ -{ lib -, stdenv -, fetchurl -, fetchpatch -, SDL -, SDL_mixer -, libintl -, libpng -, zlib -}: - -stdenv.mkDerivation rec { - pname = "lbreakout2"; - version = "2.6.5"; - - src = fetchurl { - url = "mirror://sourceforge/lgames/${pname}-${version}.tar.gz"; - sha256 = "0vwdlyvh7c4y80q5vp7fyfpzbqk9lq3w8pvavi139njkalbxc14i"; - }; - - # Can't exit from pause without this patch - patches = [(fetchpatch { - url = "https://sources.debian.org/data/main/l/lbreakout2/2.6.5-2/debian/patches/sdl_fix_pauses.patch"; - hash = "sha256-ycsuxfokpOblLky42MwtJowdEp7v5dZRMFIR4id4ZBI="; - })]; - - buildInputs = [ - SDL - SDL_mixer - libintl - libpng - zlib - ]; - - # With fortify it crashes at runtime: - # *** buffer overflow detected ***: terminated - # Aborted (core dumped) - hardeningDisable = [ "fortify" ]; - - meta = with lib; { - homepage = "http://lgames.sourceforge.net/LBreakout2/"; - description = "Breakout clone from the LGames series"; - license = licenses.gpl2Plus; - maintainers = [ maintainers.ciil ]; - platforms = platforms.unix; - hydraPlatforms = lib.platforms.linux; # sdl-config times out on darwin - }; -} diff --git a/pkgs/games/lgames/lbreakouthd/default.nix b/pkgs/games/lgames/lbreakouthd/default.nix deleted file mode 100644 index 64be757c35ad..000000000000 --- a/pkgs/games/lgames/lbreakouthd/default.nix +++ /dev/null @@ -1,43 +0,0 @@ -{ lib -, stdenv -, fetchurl -, directoryListingUpdater -, SDL2 -, SDL2_image -, SDL2_mixer -, SDL2_ttf -}: - -stdenv.mkDerivation (finalAttrs: { - pname = "lbreakouthd"; - version = "1.1.6"; - - src = fetchurl { - url = "mirror://sourceforge/lgames/lbreakouthd-${finalAttrs.version}.tar.gz"; - hash = "sha256-Gor2LnM8vi6skJbzfR5023J13GxvqcpIrua9S+nT/S0="; - }; - - buildInputs = [ - SDL2 - SDL2_image - SDL2_mixer - SDL2_ttf - ]; - - hardeningDisable = [ "format" ]; - - passthru.updateScript = directoryListingUpdater { - inherit (finalAttrs) pname version; - url = "https://lgames.sourceforge.io/LBreakoutHD/"; - extraRegex = "(?!.*-win(32|64)).*"; - }; - - meta = { - homepage = "https://lgames.sourceforge.io/LBreakoutHD/"; - description = "A widescreen Breakout clone"; - license = lib.licenses.gpl2Plus; - maintainers = with lib.maintainers; [ AndersonTorres ]; - inherit (SDL2.meta) platforms; - broken = stdenv.isDarwin; - }; -}) diff --git a/pkgs/games/lgames/lpairs2/default.nix b/pkgs/games/lgames/lpairs2/default.nix deleted file mode 100644 index 7993fd0657da..000000000000 --- a/pkgs/games/lgames/lpairs2/default.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ lib -, stdenv -, fetchurl -, SDL2 -, SDL2_image -, SDL2_mixer -, SDL2_ttf -, directoryListingUpdater -}: - -stdenv.mkDerivation rec { - pname = "lpairs2"; - version = "2.3"; - - src = fetchurl { - url = "mirror://sourceforge/lgames/${pname}-${version}.tar.gz"; - hash = "sha256-gw1BNkcztyTuoXRdx5+TBZNJEJNrLCfEUCQ1JzROogA="; - }; - - buildInputs = [ - SDL2 - SDL2_image - SDL2_mixer - SDL2_ttf - ]; - - passthru.updateScript = directoryListingUpdater { - inherit pname version; - url = "https://lgames.sourceforge.io/LPairs/"; - extraRegex = "(?!.*-win(32|64)).*"; - }; - - meta = with lib; { - broken = stdenv.isDarwin; - homepage = "http://lgames.sourceforge.net/LPairs/"; - description = "Matching the pairs - a typical Memory Game"; - license = licenses.gpl2Plus; - maintainers = with maintainers; [ AndersonTorres ]; - platforms = platforms.unix; - }; -} diff --git a/pkgs/games/nile/default.nix b/pkgs/games/nile/default.nix index d7eb2cfb3b8e..f1117f2fba89 100644 --- a/pkgs/games/nile/default.nix +++ b/pkgs/games/nile/default.nix @@ -15,14 +15,14 @@ buildPythonApplication rec { pname = "nile"; - version = "unstable-2024-02-05"; + version = "unstable-2024-03-09"; format = "pyproject"; src = fetchFromGitHub { owner = "imLinguin"; repo = "nile"; - rev = "5e878e19f6caba74bfe18369d84476ceb6779ff1"; - hash = "sha256-sGhceSW1bL5uQ726apfn9BJaO1FxjOBqzAdt2x7us9Q="; + rev = "ae09acfc20fe4e462762666871f78caae70f6c74"; + hash = "sha256-hqhIacsbultY3CvvkYAZHmhCkQLi1mkPQwkztaUOd10="; }; disabled = pythonOlder "3.8"; diff --git a/pkgs/games/openjk/default.nix b/pkgs/games/openjk/default.nix index 5ef8aa3e43b4..07ef12b00365 100644 --- a/pkgs/games/openjk/default.nix +++ b/pkgs/games/openjk/default.nix @@ -32,13 +32,13 @@ let }; in stdenv.mkDerivation { pname = "OpenJK"; - version = "0-unstable-2024-02-20"; + version = "0-unstable-2024-03-05"; src = fetchFromGitHub { owner = "JACoders"; repo = "OpenJK"; - rev = "1e8a7998ca2fe434daebb41d586ac3cd5296433a"; - sha256 = "sha256-TKJNaz+oWNYyReFZVefg1frPXyd3Yl96JDklp1qY1to="; + rev = "62124e18ef09b293ea66a1f673b827d83e073928"; + sha256 = "sha256-2LgxRWoAfxNE6YDyrpNmDH9APhi2XH4ufNCNMd91llU="; }; dontAddPrefix = true; diff --git a/pkgs/games/openloco/default.nix b/pkgs/games/openloco/default.nix index c884c39dafa2..df5b2ca31862 100644 --- a/pkgs/games/openloco/default.nix +++ b/pkgs/games/openloco/default.nix @@ -7,19 +7,19 @@ , libzip , openal , pkg-config -, span-lite , yaml-cpp +, fmt }: stdenv.mkDerivation rec { pname = "openloco"; - version = "23.02"; + version = "24.01.1"; src = fetchFromGitHub { owner = "OpenLoco"; repo = "OpenLoco"; rev = "v${version}"; - hash = "sha256-35g7tnKez4tnTdZzavfU+X8f3btFG6EbLkU+cqL6Qek="; + hash = "sha256-QkJmJGObp5irk66SSGTxjydcp3sPaCbxcjcU3XGTVfo="; }; # the upstream build process determines the version tag from git; since we @@ -44,7 +44,7 @@ stdenv.mkDerivation rec { libzip openal yaml-cpp - span-lite + fmt ]; meta = { diff --git a/pkgs/games/openttd/jgrpp.nix b/pkgs/games/openttd/jgrpp.nix index 5fbe527425eb..74baeb12387e 100644 --- a/pkgs/games/openttd/jgrpp.nix +++ b/pkgs/games/openttd/jgrpp.nix @@ -2,13 +2,13 @@ openttd.overrideAttrs (oldAttrs: rec { pname = "openttd-jgrpp"; - version = "0.57.1"; + version = "0.58.1"; src = fetchFromGitHub rec { owner = "JGRennison"; repo = "OpenTTD-patches"; rev = "jgrpp-${version}"; - hash = "sha256-mQy+QdhEXoM9wIWvSkMgRVBXJO1ugXWS3lduccez1PQ="; + hash = "sha256-6R+biPgQyFPJD6Or6Jhm+7RZ7xe/SC6h83XVZkE+gSk="; }; buildInputs = oldAttrs.buildInputs ++ [ zstd ]; diff --git a/pkgs/games/osu-lazer/bin.nix b/pkgs/games/osu-lazer/bin.nix index 30affcd8f8ef..dc599bf34f8b 100644 --- a/pkgs/games/osu-lazer/bin.nix +++ b/pkgs/games/osu-lazer/bin.nix @@ -7,22 +7,22 @@ let pname = "osu-lazer-bin"; - version = "2024.221.0"; + version = "2024.312.0"; src = { aarch64-darwin = fetchzip { url = "https://github.com/ppy/osu/releases/download/${version}/osu.app.Apple.Silicon.zip"; - hash = "sha256-R//GKMpOelPBqRQoEHrjG56xvlZvEYqG8nJSS0iwUkM="; + hash = "sha256-RwOSB/WcAqR8j0xw1QUji1IEn7iHXcHj2xOcKjnpl00="; stripRoot = false; }; x86_64-darwin = fetchzip { url = "https://github.com/ppy/osu/releases/download/${version}/osu.app.Intel.zip"; - hash = "sha256-nz8zUbhv/rWy+MXLMBAoG3B0f4QVrhu6p/AAkrFvhVc="; + hash = "sha256-Wnr7CtQIfugKrGsl72NXdHJIsF7rRNhzjV1Q+gRHK10="; stripRoot = false; }; x86_64-linux = fetchurl { url = "https://github.com/ppy/osu/releases/download/${version}/osu.AppImage"; - hash = "sha256-UY1HSOpcir9ybcxDuicklArynOFWkDtKqJe/LGeQOEM="; + hash = "sha256-kWNobQXGGS2TWvPkhfheqnlbijfnxfcP36ANUeN6bW0="; }; }.${stdenv.system} or (throw "${pname}-${version}: ${stdenv.system} is unsupported."); diff --git a/pkgs/games/osu-lazer/default.nix b/pkgs/games/osu-lazer/default.nix index eb9b4a670a3d..e51b451847ae 100644 --- a/pkgs/games/osu-lazer/default.nix +++ b/pkgs/games/osu-lazer/default.nix @@ -17,13 +17,13 @@ buildDotnetModule rec { pname = "osu-lazer"; - version = "2024.221.0"; + version = "2024.312.0"; src = fetchFromGitHub { owner = "ppy"; repo = "osu"; rev = version; - hash = "sha256-isRGruIMU05/4WDI0jkgycmA0sxkBL4pu9fclTr8VtY="; + hash = "sha256-54georjON2Fu/kj4w4SeW0BR/aHomGrKeicJ9N4/Y9s="; }; projectFile = "osu.Desktop/osu.Desktop.csproj"; diff --git a/pkgs/games/osu-lazer/deps.nix b/pkgs/games/osu-lazer/deps.nix index 6045847e2777..8985785a4da9 100644 --- a/pkgs/games/osu-lazer/deps.nix +++ b/pkgs/games/osu-lazer/deps.nix @@ -5,12 +5,12 @@ (fetchNuGet { pname = "AutoMapper"; version = "12.0.1"; sha256 = "0s0wjl4ck3sal8a50x786wxs9mbca7bxaqk3558yx5wpld4h4z3b"; }) (fetchNuGet { pname = "Clowd.Squirrel"; version = "2.11.1"; sha256 = "0s8ar0cl1pz1cbh3xm79cyaqdnfdm89mxd18qkhbyavhn6kqgnm0"; }) (fetchNuGet { pname = "CodeFileSanity"; version = "0.0.37"; sha256 = "03ja3g66lb0smjmkr3yf28h7fy52wwbdnf6p268zfla3azh006pq"; }) - (fetchNuGet { pname = "DiffPlex"; version = "1.7.1"; sha256 = "1q78r70pirgb7j5wkh454ws237lihh0fig212cpbj02cz53c2h6j"; }) + (fetchNuGet { pname = "DiffPlex"; version = "1.7.2"; sha256 = "04db3fs6cl380309kdsabss61f6gqjb8fd0yj47z5640vgazrjan"; }) (fetchNuGet { pname = "DiscordRichPresence"; version = "1.2.1.24"; sha256 = "0maw0yd6xgwy0cgk593z3zva0r5j267zpdmmpq8avj3zbna6n4x1"; }) (fetchNuGet { pname = "FFmpeg.AutoGen"; version = "4.3.0.1"; sha256 = "0n6x57mnnvcjnrs8zyvy07h5zm4bcfy9gh4n4bvd9fx5ys4pxkvv"; }) (fetchNuGet { pname = "Fody"; version = "6.8.0"; sha256 = "1y159433n5wzlvc8hjjrhjarf7mjvngbmh34jkd452zlrjqrhmns"; }) (fetchNuGet { pname = "HidSharpCore"; version = "1.2.1.1"; sha256 = "1zkndglmz0s8rblfhnqcvv90rkq2i7lf4bc380g7z8h1avf2ikll"; }) - (fetchNuGet { pname = "HtmlAgilityPack"; version = "1.11.57"; sha256 = "0brswm659d2vb11021z7xylljlnaf344yf5q093bqxyhbxva8ijq"; }) + (fetchNuGet { pname = "HtmlAgilityPack"; version = "1.11.59"; sha256 = "0h4a2aq50x5hlgzp6qyqcly67j49rsrscrd83qmzqk6a7g1a50cz"; }) (fetchNuGet { pname = "Humanizer"; version = "2.14.1"; sha256 = "18cycx9gvbc3735chdi2r583x73m2fkz1ws03yi3g640j9zv00fp"; }) (fetchNuGet { pname = "Humanizer.Core"; version = "2.14.1"; sha256 = "1ai7hgr0qwd7xlqfd92immddyi41j3ag91h3594yzfsgsy6yhyqi"; }) (fetchNuGet { pname = "Humanizer.Core.af"; version = "2.14.1"; sha256 = "197lsky6chbmrixgsg6dvxbdbbpis0an8mn6vnwjcydhncis087h"; }) @@ -137,18 +137,18 @@ (fetchNuGet { pname = "ppy.ManagedBass.Fx"; version = "2022.1216.0"; sha256 = "1vw573mkligpx9qiqasw1683cqaa1kgnxhlnbdcj9c4320b1pwjm"; }) (fetchNuGet { pname = "ppy.ManagedBass.Mix"; version = "2022.1216.0"; sha256 = "185bpvgbnd8y20r7vxb1an4pd1aal9b7b5wvmv3knz0qg8j0chd9"; }) (fetchNuGet { pname = "ppy.ManagedBass.Wasapi"; version = "2022.1216.0"; sha256 = "0h2ncf59sza8whvrwwqi8b6fcrkqrnfgfhd0vnhyw0s98nj74f0z"; }) - (fetchNuGet { pname = "ppy.osu.Framework"; version = "2024.221.0"; sha256 = "0lwvmxssd88vir3a3199i4rasn2c1v850vzcqchkc1z7h9xl3b82"; }) + (fetchNuGet { pname = "ppy.osu.Framework"; version = "2024.306.0"; sha256 = "0fvjr0955n8y5cysdmwzqq3anj59qk3dv2x23mrgdr3hdc75xb92"; }) (fetchNuGet { pname = "ppy.osu.Framework.NativeLibs"; version = "2023.1225.0-nativelibs"; sha256 = "008kj91i9486ff2q7fcgb8mmpinskvnmfsqza2m5vafh295y3h7m"; }) (fetchNuGet { pname = "ppy.osu.Framework.SourceGeneration"; version = "2023.720.0"; sha256 = "001vvxyv483ibid25fdknvij77x0y983mp4psx2lbg3x2al7yxax"; }) - (fetchNuGet { pname = "ppy.osu.Game.Resources"; version = "2024.207.0"; sha256 = "0960jg0a860f545phscimv5qw6bzijpc4pyplx126zcm1w1cpmfi"; }) + (fetchNuGet { pname = "ppy.osu.Game.Resources"; version = "2024.309.0"; sha256 = "1ckl3yzxijnsg73awwvbs1rfnla29r88f2qarq51l8fd1ngcig26"; }) (fetchNuGet { pname = "ppy.osuTK.NS20"; version = "1.0.211"; sha256 = "0j4a9n39pqm0cgdcps47p5n2mqph3h94r7hmf0bs59imif4jxvjy"; }) (fetchNuGet { pname = "ppy.SDL2-CS"; version = "1.0.693-alpha"; sha256 = "15fgd3j9cs3adldiscqm0ffixf68h06wqdz1xy1286z4gczhi954"; }) (fetchNuGet { pname = "ppy.Veldrid"; version = "4.9.5-gc8dfc5ca19"; sha256 = "0w0mimfwdgbywmvq2yv04p65wgi1plhlk1ya012yyxp13vvhfgi8"; }) (fetchNuGet { pname = "ppy.Veldrid.MetalBindings"; version = "4.9.5-gc8dfc5ca19"; sha256 = "0i6bb79kprrmsfphjq26rgxqfvvf12pxr7dfwcq448dw2xgq6rpy"; }) (fetchNuGet { pname = "ppy.Veldrid.OpenGLBindings"; version = "4.9.5-gc8dfc5ca19"; sha256 = "06a4kkfidr7yj60xl3k4yfawz4wzwkkjpaki8fmsanif1yhz69l8"; }) (fetchNuGet { pname = "ppy.Veldrid.SPIRV"; version = "1.0.15-gca6cec7843"; sha256 = "09pi4c91ljavilw9kx7kzhcax7ar4zk7zy1qwvqfrqsgxznvyxa1"; }) - (fetchNuGet { pname = "Realm"; version = "11.5.0"; sha256 = "0r7j5si3n4ncq8xnnjk1q5jjqbj0s1w3ps124y8pgqd14dzvch6a"; }) - (fetchNuGet { pname = "Realm.PlatformHelpers"; version = "11.5.0"; sha256 = "1ggbmlsf04pxnh1k86hs0wxnvcw0ja2xnn6358qmrp826km0w1g9"; }) + (fetchNuGet { pname = "Realm"; version = "11.7.0"; sha256 = "1vp8rparpcv7rbqx7m55xcji941a6qjamxhb943fgfkjf196z69w"; }) + (fetchNuGet { pname = "Realm.PlatformHelpers"; version = "11.7.0"; sha256 = "1a7kaap5ad3n7cgf07xa9yc4c1qi7cf2zj3f5hdv7fp84bdzmysg"; }) (fetchNuGet { pname = "Remotion.Linq"; version = "2.2.0"; sha256 = "1y46ni0xswmmiryp8sydjgryafwn458dr91f9xn653w73kdyk4xf"; }) (fetchNuGet { pname = "runtime.any.System.Collections"; version = "4.3.0"; sha256 = "0bv5qgm6vr47ynxqbnkc7i797fdi8gbjjxii173syrx14nmrkwg0"; }) (fetchNuGet { pname = "runtime.any.System.Diagnostics.Tools"; version = "4.3.0"; sha256 = "1wl76vk12zhdh66vmagni66h5xbhgqq7zkdpgw21jhxhvlbcl8pk"; }) @@ -168,8 +168,11 @@ (fetchNuGet { pname = "runtime.any.System.Threading.Tasks"; version = "4.3.0"; sha256 = "03mnvkhskbzxddz4hm113zsch1jyzh2cs450dk3rgfjp8crlw1va"; }) (fetchNuGet { pname = "runtime.any.System.Threading.Timer"; version = "4.3.0"; sha256 = "0aw4phrhwqz9m61r79vyfl5la64bjxj8l34qnrcwb28v49fg2086"; }) (fetchNuGet { pname = "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "16rnxzpk5dpbbl1x354yrlsbvwylrq456xzpsha1n9y3glnhyx9d"; }) + (fetchNuGet { pname = "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.2"; sha256 = "0rwpqngkqiapqc5c2cpkj7idhngrgss5qpnqg0yh40mbyflcxf8i"; }) (fetchNuGet { pname = "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0hkg03sgm2wyq8nqk6dbm9jh5vcq57ry42lkqdmfklrw89lsmr59"; }) + (fetchNuGet { pname = "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.2"; sha256 = "1n06gxwlinhs0w7s8a94r1q3lwqzvynxwd3mp10ws9bg6gck8n4r"; }) (fetchNuGet { pname = "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0c2p354hjx58xhhz7wv6div8xpi90sc6ibdm40qin21bvi7ymcaa"; }) + (fetchNuGet { pname = "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.2"; sha256 = "0404wqrc7f2yc0wxv71y3nnybvqx8v4j9d47hlscxy759a525mc3"; }) (fetchNuGet { pname = "runtime.native.System"; version = "4.0.0"; sha256 = "1ppk69xk59ggacj9n7g6fyxvzmk1g5p4fkijm0d7xqfkig98qrkf"; }) (fetchNuGet { pname = "runtime.native.System"; version = "4.3.0"; sha256 = "15hgf6zaq9b8br2wi1i3x0zvmk410nlmsmva9p0bbg73v6hml5k4"; }) (fetchNuGet { pname = "runtime.native.System.IO.Compression"; version = "4.3.0"; sha256 = "1vvivbqsk6y4hzcid27pqpm5bsi6sc50hvqwbcx8aap5ifrxfs8d"; }) @@ -177,14 +180,22 @@ (fetchNuGet { pname = "runtime.native.System.Net.Security"; version = "4.3.0"; sha256 = "0dnqjhw445ay3chpia9p6vy4w2j6s9vy3hxszqvdanpvvyaxijr3"; }) (fetchNuGet { pname = "runtime.native.System.Security.Cryptography.Apple"; version = "4.3.0"; sha256 = "1b61p6gw1m02cc1ry996fl49liiwky6181dzr873g9ds92zl326q"; }) (fetchNuGet { pname = "runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "18pzfdlwsg2nb1jjjjzyb5qlgy6xjxzmhnfaijq5s2jw3cm3ab97"; }) + (fetchNuGet { pname = "runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.2"; sha256 = "0zy5r25jppz48i2bkg8b9lfig24xixg6nm3xyr1379zdnqnpm8f6"; }) (fetchNuGet { pname = "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0qyynf9nz5i7pc26cwhgi8j62ps27sqmf78ijcfgzab50z9g8ay3"; }) + (fetchNuGet { pname = "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.2"; sha256 = "096ch4n4s8k82xga80lfmpimpzahd2ip1mgwdqgar0ywbbl6x438"; }) (fetchNuGet { pname = "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "1klrs545awhayryma6l7g2pvnp9xy4z0r1i40r80zb45q3i9nbyf"; }) + (fetchNuGet { pname = "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.2"; sha256 = "1dm8fifl7rf1gy7lnwln78ch4rw54g0pl5g1c189vawavll7p6rj"; }) (fetchNuGet { pname = "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple"; version = "4.3.0"; sha256 = "10yc8jdrwgcl44b4g93f1ds76b176bajd3zqi2faf5rvh1vy9smi"; }) (fetchNuGet { pname = "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0zcxjv5pckplvkg0r6mw3asggm7aqzbdjimhvsasb0cgm59x09l3"; }) + (fetchNuGet { pname = "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.2"; sha256 = "1m9z1k9kzva9n9kwinqxl97x2vgl79qhqjlv17k9s2ymcyv2bwr6"; }) (fetchNuGet { pname = "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0vhynn79ih7hw7cwjazn87rm9z9fj0rvxgzlab36jybgcpcgphsn"; }) + (fetchNuGet { pname = "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.2"; sha256 = "1cpx56mcfxz7cpn57wvj18sjisvzq8b5vd9rw16ihd2i6mcp3wa1"; }) (fetchNuGet { pname = "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "160p68l2c7cqmyqjwxydcvgw7lvl1cr0znkw8fp24d1by9mqc8p3"; }) + (fetchNuGet { pname = "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.2"; sha256 = "15gsm1a8jdmgmf8j5v1slfz8ks124nfdhk2vxs2rw3asrxalg8hi"; }) (fetchNuGet { pname = "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "15zrc8fgd8zx28hdghcj5f5i34wf3l6bq5177075m2bc2j34jrqy"; }) + (fetchNuGet { pname = "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.2"; sha256 = "0q0n5q1r1wnqmr5i5idsrd9ywl33k0js4pngkwq9p368mbxp8x1w"; }) (fetchNuGet { pname = "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "1p4dgxax6p7rlgj4q73k73rslcnz4wdcv8q2flg1s8ygwcm58ld5"; }) + (fetchNuGet { pname = "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.2"; sha256 = "1x0g58pbpjrmj2x2qw17rdwwnrcl0wvim2hdwz48lixvwvp22n9c"; }) (fetchNuGet { pname = "runtime.unix.Microsoft.Win32.Primitives"; version = "4.3.0"; sha256 = "0y61k9zbxhdi0glg154v30kkq7f8646nif8lnnxbvkjpakggd5id"; }) (fetchNuGet { pname = "runtime.unix.System.Console"; version = "4.3.0"; sha256 = "1pfpkvc6x2if8zbdzg9rnc5fx51yllprl8zkm5npni2k50lisy80"; }) (fetchNuGet { pname = "runtime.unix.System.Diagnostics.Debug"; version = "4.3.0"; sha256 = "1lps7fbnw34bnh3lm31gs5c0g0dh7548wfmb8zz62v0zqz71msj5"; }) @@ -198,12 +209,12 @@ (fetchNuGet { pname = "SharpFNT"; version = "2.0.0"; sha256 = "1bgacgh9hbck0qvji6frbb50sdiqfdng2fvvfgfw8b9qaql91mx0"; }) (fetchNuGet { pname = "SharpGen.Runtime"; version = "2.0.0-beta.13"; sha256 = "1250z6sa9ghf84czlkzvaysb29c0n229z1f0vh5qls89akrkl7h8"; }) (fetchNuGet { pname = "SharpGen.Runtime.COM"; version = "2.0.0-beta.13"; sha256 = "1lmv3jp2g7mgy9j23pd3j0wr3p89qiq8v6c6qxqf688izyni1166"; }) - (fetchNuGet { pname = "SixLabors.ImageSharp"; version = "2.1.0"; sha256 = "0lmj3qs39v5jcf2rjwav43nqnc7g6sd4l226l2jw85nidzmpvkwr"; }) - (fetchNuGet { pname = "SQLitePCLRaw.bundle_e_sqlite3"; version = "2.1.7"; sha256 = "1pi9mpzy7wi0rcqpny0gkn7pxykg01b0x2pkv8sxl0ddzl8ywg7s"; }) + (fetchNuGet { pname = "SixLabors.ImageSharp"; version = "3.1.3"; sha256 = "0f36my2lzkgc5fvk6s0lh4gn15vxhbl2zg71rdql7vrzh8b77c6q"; }) + (fetchNuGet { pname = "SQLitePCLRaw.bundle_e_sqlite3"; version = "2.1.8"; sha256 = "0m5jhil1h0z9x9j38x0k4053s065z28bsdgy3fxa85d4b5898shw"; }) (fetchNuGet { pname = "SQLitePCLRaw.core"; version = "2.1.4"; sha256 = "09akxz92qipr1cj8mk2hw99i0b81wwbwx26gpk21471zh543f8ld"; }) - (fetchNuGet { pname = "SQLitePCLRaw.core"; version = "2.1.7"; sha256 = "1y3jl4c76g2i13xss72nfvx5qr6mzsbjvjc5f9arybh53a0wavd6"; }) - (fetchNuGet { pname = "SQLitePCLRaw.lib.e_sqlite3"; version = "2.1.7"; sha256 = "1kbwf3fn8kcf1q3gm87m359yxmb6kcnclk2y469008yijvijwa26"; }) - (fetchNuGet { pname = "SQLitePCLRaw.provider.e_sqlite3"; version = "2.1.7"; sha256 = "0kcbn0s7n3ck1s1x30zf9y7x8n6c09qgj7n20h4zj2hyxcp3ag9b"; }) + (fetchNuGet { pname = "SQLitePCLRaw.core"; version = "2.1.8"; sha256 = "1j67fs6qznkcsfnf2z2571vks1c0bhg4nzcbh8i286rz77hk9gcg"; }) + (fetchNuGet { pname = "SQLitePCLRaw.lib.e_sqlite3"; version = "2.1.8"; sha256 = "1v193rgm734kymaia5ws4zkq2a9qri7sd2vhqxv0xlysbpsahs1s"; }) + (fetchNuGet { pname = "SQLitePCLRaw.provider.e_sqlite3"; version = "2.1.8"; sha256 = "12x7z1i13571fbiddvp8bzhyxvvvwwd2wwd7c8kd11hpkfza0kbq"; }) (fetchNuGet { pname = "StbiSharp"; version = "1.1.0"; sha256 = "0wbw20m7nyhxj32k153l668sxigamlwig0qpz8l8d0jqz35vizm0"; }) (fetchNuGet { pname = "System.AppContext"; version = "4.1.0"; sha256 = "0fv3cma1jp4vgj7a8hqc9n7hr1f1kjp541s6z0q1r6nazb4iz9mz"; }) (fetchNuGet { pname = "System.AppContext"; version = "4.3.0"; sha256 = "1649qvy3dar900z3g817h17nl8jp4ka5vcfmsr05kh0fshn7j3ya"; }) @@ -247,7 +258,7 @@ (fetchNuGet { pname = "System.Net.Http"; version = "4.3.0"; sha256 = "1i4gc757xqrzflbk7kc5ksn20kwwfjhw9w7pgdkn19y3cgnl302j"; }) (fetchNuGet { pname = "System.Net.NameResolution"; version = "4.3.0"; sha256 = "15r75pwc0rm3vvwsn8rvm2krf929mjfwliv0mpicjnii24470rkq"; }) (fetchNuGet { pname = "System.Net.Primitives"; version = "4.3.0"; sha256 = "0c87k50rmdgmxx7df2khd9qj7q35j9rzdmm2572cc55dygmdk3ii"; }) - (fetchNuGet { pname = "System.Net.Security"; version = "4.3.0"; sha256 = "1aa5igz31ivk6kpgsrwck3jccab7wd88wr52lddmgypmbh9mmf87"; }) + (fetchNuGet { pname = "System.Net.Security"; version = "4.3.2"; sha256 = "1aw1ca1vssqrillrh4qkarx0lxwc8wcaqdkfdima8376wb98j2q8"; }) (fetchNuGet { pname = "System.Net.Sockets"; version = "4.3.0"; sha256 = "1ssa65k6chcgi6mfmzrznvqaxk8jp0gvl77xhf1hbzakjnpxspla"; }) (fetchNuGet { pname = "System.Net.WebHeaderCollection"; version = "4.3.0"; sha256 = "0ms3ddjv1wn8sqa5qchm245f3vzzif6l6fx5k92klqpn7zf4z562"; }) (fetchNuGet { pname = "System.Net.WebSockets"; version = "4.3.0"; sha256 = "1gfj800078kggcgl0xyl00a6y5k4wwh2k2qm69rjy22wbmq7fy4p"; }) @@ -276,7 +287,6 @@ (fetchNuGet { pname = "System.Runtime"; version = "4.1.0"; sha256 = "02hdkgk13rvsd6r9yafbwzss8kr55wnj8d5c7xjnp8gqrwc8sn0m"; }) (fetchNuGet { pname = "System.Runtime"; version = "4.3.0"; sha256 = "066ixvgbf2c929kgknshcxqj6539ax7b9m570cp8n179cpfkapz7"; }) (fetchNuGet { pname = "System.Runtime.CompilerServices.Unsafe"; version = "4.7.1"; sha256 = "119br3pd85lq8zcgh4f60jzmv1g976q1kdgi3hvqdlhfbw6siz2j"; }) - (fetchNuGet { pname = "System.Runtime.CompilerServices.Unsafe"; version = "5.0.0"; sha256 = "02k25ivn50dmqx5jn8hawwmz24yf0454fjd823qk6lygj9513q4x"; }) (fetchNuGet { pname = "System.Runtime.CompilerServices.Unsafe"; version = "6.0.0"; sha256 = "0qm741kh4rh57wky16sq4m0v05fxmkjjr87krycf5vp9f0zbahbc"; }) (fetchNuGet { pname = "System.Runtime.CompilerServices.Unsafe"; version = "6.0.0-rc.1.21451.13"; sha256 = "0v5bc80p35jj5b5xdgsn5r1v4w68gqz0sahi214rprrrlr3sl206"; }) (fetchNuGet { pname = "System.Runtime.Extensions"; version = "4.1.0"; sha256 = "0rw4rm4vsm3h3szxp9iijc3ksyviwsv6f63dng3vhqyg4vjdkc2z"; }) @@ -305,7 +315,6 @@ (fetchNuGet { pname = "System.Security.Principal.Windows"; version = "5.0.0"; sha256 = "1mpk7xj76lxgz97a5yg93wi8lj0l8p157a5d50mmjy3gbz1904q8"; }) (fetchNuGet { pname = "System.Text.Encoding"; version = "4.0.11"; sha256 = "1dyqv0hijg265dwxg6l7aiv74102d6xjiwplh2ar1ly6xfaa4iiw"; }) (fetchNuGet { pname = "System.Text.Encoding"; version = "4.3.0"; sha256 = "1f04lkir4iladpp51sdgmis9dj4y8v08cka0mbmsy0frc9a4gjqr"; }) - (fetchNuGet { pname = "System.Text.Encoding.CodePages"; version = "5.0.0"; sha256 = "1bn2pzaaq4wx9ixirr8151vm5hynn3lmrljcgjx9yghmm4k677k0"; }) (fetchNuGet { pname = "System.Text.Encoding.Extensions"; version = "4.3.0"; sha256 = "11q1y8hh5hrp5a3kw25cb6l00v5l5dvirkz8jr3sq00h1xgcgrxy"; }) (fetchNuGet { pname = "System.Text.RegularExpressions"; version = "4.3.0"; sha256 = "1bgq51k7fwld0njylfn7qc5fmwrk2137gdq7djqdsw347paa9c2l"; }) (fetchNuGet { pname = "System.Threading"; version = "4.0.11"; sha256 = "19x946h926bzvbsgj28csn46gak2crv2skpwsx80hbgazmkgb1ls"; }) diff --git a/pkgs/games/papermc/default.nix b/pkgs/games/papermc/default.nix index aa16e51a7ac8..29d5c6b85203 100644 --- a/pkgs/games/papermc/default.nix +++ b/pkgs/games/papermc/default.nix @@ -1,50 +1,15 @@ -{ - lib, - stdenvNoCC, - fetchurl, - jre, - makeBinaryWrapper, -}: -stdenvNoCC.mkDerivation (finalAttrs: { - pname = "papermc"; - version = "1.20.4.435"; - - src = - let - mcVersion = lib.versions.pad 3 finalAttrs.version; - buildNum = builtins.elemAt (lib.splitVersion finalAttrs.version) 3; - in - fetchurl { - url = "https://papermc.io/api/v2/projects/paper/versions/${mcVersion}/builds/${buildNum}/downloads/paper-${mcVersion}-${buildNum}.jar"; - hash = "sha256-NrIsYLoAAWORw/S26NDFjYBVwpNITJxuWGZow3696wM="; - }; - - installPhase = '' - runHook preInstall - - install -D $src $out/share/papermc/papermc.jar - - makeWrapper ${lib.getExe jre} "$out/bin/minecraft-server" \ - --append-flags "-jar $out/share/papermc/papermc.jar nogui" - - runHook postInstall - ''; - - nativeBuildInputs = [ - makeBinaryWrapper - ]; - - dontUnpack = true; - preferLocalBuild = true; - allowSubstitutes = false; - - meta = { - description = "High-performance Minecraft Server"; - homepage = "https://papermc.io/"; - sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; - license = lib.licenses.gpl3Only; - platforms = lib.platforms.unix; - maintainers = with lib.maintainers; [ aaronjanse neonfuz ]; - mainProgram = "minecraft-server"; - }; +{ callPackage, lib, ... }: +let + versions = lib.importJSON ./versions.json; + latestVersion = lib.last (builtins.sort lib.versionOlder (builtins.attrNames versions)); + escapeVersion = builtins.replaceStrings [ "." ] [ "_" ]; + packages = lib.mapAttrs' + (version: value: { + name = "papermc-${escapeVersion version}"; + value = callPackage ./derivation.nix { inherit (value) version hash; }; + }) + versions; +in +lib.recurseIntoAttrs (packages // { + papermc = builtins.getAttr "papermc-${escapeVersion latestVersion}" packages; }) diff --git a/pkgs/games/papermc/derivation.nix b/pkgs/games/papermc/derivation.nix new file mode 100644 index 000000000000..f244031f0590 --- /dev/null +++ b/pkgs/games/papermc/derivation.nix @@ -0,0 +1,50 @@ +{ lib, stdenvNoCC, fetchurl, makeBinaryWrapper, jre, version, hash }: + +stdenvNoCC.mkDerivation { + pname = "papermc"; + inherit version; + + src = + let + version-split = lib.strings.splitString "-" version; + mcVersion = builtins.elemAt version-split 0; + buildNum = builtins.elemAt version-split 1; + in + fetchurl { + url = "https://papermc.io/api/v2/projects/paper/versions/${mcVersion}/builds/${buildNum}/downloads/paper-${version}.jar"; + inherit hash; + }; + + installPhase = '' + runHook preInstall + + install -D $src $out/share/papermc/papermc.jar + + makeWrapper ${lib.getExe jre} "$out/bin/minecraft-server" \ + --append-flags "-jar $out/share/papermc/papermc.jar nogui" + + runHook postInstall + ''; + + nativeBuildInputs = [ + makeBinaryWrapper + ]; + + dontUnpack = true; + preferLocalBuild = true; + allowSubstitutes = false; + + passthru = { + updateScript = ./update.py; + }; + + meta = { + description = "High-performance Minecraft Server"; + homepage = "https://papermc.io/"; + sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; + license = lib.licenses.gpl3Only; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ aaronjanse neonfuz MayNiklas ]; + mainProgram = "minecraft-server"; + }; +} diff --git a/pkgs/games/papermc/update.py b/pkgs/games/papermc/update.py new file mode 100755 index 000000000000..6e2d0ec9274e --- /dev/null +++ b/pkgs/games/papermc/update.py @@ -0,0 +1,145 @@ +#!/usr/bin/env nix-shell +#! nix-shell -i python -p "python3.withPackages (ps: with ps; [ps.requests ])" + +import hashlib +import base64 +import json + +import requests + + +class Version: + def __init__(self, name: str): + self.name: str = name + self.hash: str | None = None + self.build_number: int | None = None + + @property + def full_name(self): + v_name = f"{self.name}-{self.build_number}" + + # this will probably never happen because the download of a build with NoneType in URL would fail + if not self.name or not self.build_number: + print(f"Warning: version '{v_name}' contains NoneType!") + + return v_name + + +class VersionManager: + def __init__(self, base_url: str = "https://api.papermc.io/v2/projects/paper"): + self.versions: list[Version] = [] + self.base_url: str = base_url + + def fetch_versions(self, not_before_minor_version: int = 18): + """ + Fetch all versions after given minor release + """ + + response = requests.get(self.base_url) + + try: + response.raise_for_status() + + except requests.exceptions.HTTPError as e: + print(e) + return + + # we only want versions that are no pre-releases + release_versions = filter( + lambda v_name: 'pre' not in v_name, response.json()["versions"]) + + for version_name in release_versions: + + # split version string, convert to list ot int + version_split = version_name.split(".") + version_split = list(map(int, version_split)) + + # check if version is higher than 1.<not_before_sub_version> + if (version_split[0] > 1) or (version_split[0] == 1 and version_split[1] >= not_before_minor_version): + self.versions.append(Version(version_name)) + + def fetch_latest_version_builds(self): + """ + Set latest build number to each version + """ + + for version in self.versions: + url = f"{self.base_url}/versions/{version.name}" + response = requests.get(url) + + # check that we've got a good response + try: + response.raise_for_status() + + except requests.exceptions.HTTPError as e: + print(e) + return + + # the highest build in response.json()['builds']: + latest_build = response.json()['builds'][-1] + version.build_number = latest_build + + def generate_version_hashes(self): + """ + Generate and set the hashes for all registered versions (versions will are downloaded to memory) + """ + + for version in self.versions: + url = f"{self.base_url}/versions/{version.name}/builds/{version.build_number}/downloads/paper-{version.full_name}.jar" + version.hash = self.download_and_generate_sha256_hash(url) + + def versions_to_json(self): + return json.dumps( + {version.name: {'hash': version.hash, 'version': version.full_name} + for version in self.versions}, + indent=4 + ) + + def write_versions(self, file_name: str): + """ write all processed versions to json """ + # save json to versions.json + with open(file_name, 'w') as f: + f.write(self.versions_to_json() + "\n") + + @staticmethod + def download_and_generate_sha256_hash(url: str) -> str | None: + """ + Fetch the tarball from the given URL. + Then generate a sha256 hash of the tarball. + """ + + try: + # Download the file from the URL + response = requests.get(url) + response.raise_for_status() + + except requests.exceptions.RequestException as e: + print(f"Error: {e}") + return None + + # Create a new SHA-256 hash object + sha256_hash = hashlib.sha256() + + # Update the hash object with chunks of the downloaded content + for byte_block in response.iter_content(4096): + sha256_hash.update(byte_block) + + # Get the hexadecimal representation of the hash + hash_value = sha256_hash.digest() + + # Encode the hash value in base64 + base64_hash = base64.b64encode(hash_value).decode('utf-8') + + # Format it as "sha256-{base64_hash}" + sri_representation = f"sha256-{base64_hash}" + + return sri_representation + + +if __name__ == '__main__': + version_manager = VersionManager() + + version_manager.fetch_versions() + version_manager.fetch_latest_version_builds() + version_manager.generate_version_hashes() + version_manager.write_versions(file_name="versions.json") diff --git a/pkgs/games/papermc/versions.json b/pkgs/games/papermc/versions.json new file mode 100644 index 000000000000..0fa4bad8ba04 --- /dev/null +++ b/pkgs/games/papermc/versions.json @@ -0,0 +1,50 @@ +{ + "1.18": { + "hash": "sha256-PJlfINrk5OIdVVT6yVegqKXIW9W/NJFfrEtPFuDvEBs=", + "version": "1.18-66" + }, + "1.18.1": { + "hash": "sha256-qUkXpEcsLLyZB6FcZmu7eE+V7Ne1PHe8CP5xED5Uh/U=", + "version": "1.18.1-216" + }, + "1.18.2": { + "hash": "sha256-BXjxj01jK0lLRo7FaztBS1tW/qCH7n05z23N9MnQHwU=", + "version": "1.18.2-388" + }, + "1.19": { + "hash": "sha256-DTnKzFGneysHHhzoYvy/C0pL1mjMfosxNZjYT6Cfq6w=", + "version": "1.19-81" + }, + "1.19.1": { + "hash": "sha256-Wv4jofreksVHEk+odLx9kI+mdvSfCYefqHYiS2Lp1Rs=", + "version": "1.19.1-111" + }, + "1.19.2": { + "hash": "sha256-LrXHRZ7JS83Fl+1xHVSaOrSw/aE+QSoHkqGgabWQOGQ=", + "version": "1.19.2-307" + }, + "1.19.3": { + "hash": "sha256-MAfyxjjV8E7TK2raozBT/jY0zPp0NFyD0+pJgtONtdw=", + "version": "1.19.3-448" + }, + "1.19.4": { + "hash": "sha256-5YfXjLo+me+MS8JM8gzDvbvonjOwtXIHBEavTra+XM8=", + "version": "1.19.4-550" + }, + "1.20": { + "hash": "sha256-HkzPwFmfSR7m/uRFXTciMyrF14WE/M1Vy7O1HhFQRQU=", + "version": "1.20-17" + }, + "1.20.1": { + "hash": "sha256-I0qbMgmBAMb8EWZk1k42zNtYtbZJrw+AvMywiwJV6uo=", + "version": "1.20.1-196" + }, + "1.20.2": { + "hash": "sha256-ujQKg1rEC4Vjqn7aHNZHmhGnYjQJyJosNc2ddJDtF6c=", + "version": "1.20.2-318" + }, + "1.20.4": { + "hash": "sha256-NrIsYLoAAWORw/S26NDFjYBVwpNITJxuWGZow3696wM=", + "version": "1.20.4-435" + } +} diff --git a/pkgs/games/pioneer/default.nix b/pkgs/games/pioneer/default.nix index b70ef8c3dab6..878101a917fc 100644 --- a/pkgs/games/pioneer/default.nix +++ b/pkgs/games/pioneer/default.nix @@ -20,13 +20,13 @@ stdenv.mkDerivation rec { pname = "pioneer"; - version = "20220203"; + version = "20240203"; src = fetchFromGitHub{ owner = "pioneerspacesim"; repo = "pioneer"; rev = version; - hash = "sha256-HNVg8Lq6k6gQDmgOdpnBwJ57WSEnn5XwtqzmkDU1WGI="; + hash = "sha256-Jqv013VM0177VqGYR7vSvdq+67ONM91RrjcdVXNLcHs="; }; postPatch = '' diff --git a/pkgs/games/powermanga/default.nix b/pkgs/games/powermanga/default.nix index 25a1df5211a3..5f82eaebb8eb 100644 --- a/pkgs/games/powermanga/default.nix +++ b/pkgs/games/powermanga/default.nix @@ -8,12 +8,12 @@ , libpng }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "powermanga"; version = "0.93.1"; src = fetchurl { - url = "https://linux.tlk.fr/games/Powermanga/download/powermanga-${version}.tgz"; + url = "https://linux.tlk.fr/games/Powermanga/download/powermanga-${finalAttrs.version}.tgz"; sha256 = "sha256-2nU/zoOQWm2z/Y6mXHDFfWYjYshsQp1saVRBcUT5Q+g="; }; @@ -56,4 +56,4 @@ stdenv.mkDerivation rec { platforms = platforms.all; broken = stdenv.isDarwin; }; -} +}) diff --git a/pkgs/games/principia/default.nix b/pkgs/games/principia/default.nix index 3cf98dada027..5074b3582c3e 100644 --- a/pkgs/games/principia/default.nix +++ b/pkgs/games/principia/default.nix @@ -1,13 +1,14 @@ { lib , stdenv , fetchFromGitHub -, autoreconfHook +, cmake , pkg-config +, wrapGAppsHook , curl , freetype , glew -, gtk2 +, gtk3 , libGL , libjpeg , libpng @@ -18,27 +19,28 @@ , SDL2_ttf }: -stdenv.mkDerivation { +stdenv.mkDerivation (finalAttrs: { pname = "principia"; - version = "unstable-2023-03-21"; + version = "2024.02.29"; src = fetchFromGitHub { owner = "Bithack"; repo = "principia"; - rev = "af2cfda21b6ce4c0725700e2a01b0597a97dbeff"; - hash = "sha256-jBWdXzbPpk23elHcs5sWkxXfkekj+aa24VvEHzid8KE="; + rev = finalAttrs.version; + hash = "sha256-L37H261IGCcH2K7RhX8iTdHRkle83vKhgpyssRmSKN0="; }; nativeBuildInputs = [ - autoreconfHook + cmake pkg-config + wrapGAppsHook ]; buildInputs = [ curl freetype glew - gtk2 + gtk3 libGL libjpeg libpng @@ -49,45 +51,13 @@ stdenv.mkDerivation { SDL2_ttf ]; - preAutoreconf = '' - cd build-linux - ''; - - # Since we bypass the "build-linux/go" wrapper script so we can use nixpkgs' - # autotools/make integration, set the release flags manually. - # https://github.com/Bithack/principia/issues/98 - preBuild = '' - RELEASE_SHARED="-ffast-math -DNDEBUG=1 -s -fomit-frame-pointer -fvisibility=hidden -fdata-sections -ffunction-sections" - makeFlagsArray+=( - CFLAGS="$RELEASE_SHARED -O1" - CXXFLAGS="$RELEASE_SHARED -O2 -fvisibility-inlines-hidden -fno-rtti" - LDFLAGS="-Wl,-O,-s,--gc-sections" - ) - ''; - - # `make install` only installs the binary, and the binary looks for data - # files in its same directory, so we override installPhase, install the - # binary in $out/share, and link to it from $out/bin - installPhase = '' - runHook preInstall - - mkdir -p $out/bin - mkdir -p $out/share/principia - install -Dm755 principia $out/share/principia/principia - ln -s $out/share/principia/principia $out/bin/principia - - cp -r --dereference data-pc data-shared $out/share/principia/ - install -Dm644 principia.desktop $out/share/applications/principia.desktop - install -Dm644 principia-url-handler.desktop $out/share/applications/principia-url-handler.desktop - install -Dm644 principia.png $out/share/pixmaps/principia.png - - runHook postInstall - ''; - - # The actual binary is here, see comment above installPhase - stripDebugList = [ "share/principia" ]; + cmakeFlags = [ + # Remove when https://github.com/NixOS/nixpkgs/issues/144170 is fixed + (lib.cmakeFeature "CMAKE_INSTALL_BINDIR" "bin") + ]; meta = with lib; { + changelog = "https://principia-web.se/wiki/Changelog#${lib.replaceStrings ["."] ["-"] finalAttrs.version}"; description = "Physics-based sandbox game"; homepage = "https://principia-web.se/"; downloadPage = "https://principia-web.se/download"; @@ -95,4 +65,4 @@ stdenv.mkDerivation { maintainers = [ maintainers.fgaz ]; platforms = platforms.linux; }; -} +}) diff --git a/pkgs/games/prismlauncher/default.nix b/pkgs/games/prismlauncher/default.nix index c6378fbc368f..c4571ceaa71b 100644 --- a/pkgs/games/prismlauncher/default.nix +++ b/pkgs/games/prismlauncher/default.nix @@ -31,13 +31,13 @@ assert lib.assertMsg (stdenv.isLinux || !gamemodeSupport) "gamemodeSupport is on stdenv.mkDerivation (finalAttrs: { pname = "prismlauncher-unwrapped"; - version = "8.0"; + version = "8.2"; src = fetchFromGitHub { owner = "PrismLauncher"; repo = "PrismLauncher"; rev = finalAttrs.version; - hash = "sha256-WBajtfj3qAMq8zd2S53CQyHiyqtvffLOHOjmOpdALAA="; + hash = "sha256-4VsoxZzi/EfEsnDvvwzg2xhj7j5B+k3gvaSqwJFDweE="; }; nativeBuildInputs = [ extra-cmake-modules cmake jdk17 ninja canonicalize-jars-hook ]; diff --git a/pkgs/games/runelite/default.nix b/pkgs/games/runelite/default.nix index 02c41307101f..f6d205d473bc 100644 --- a/pkgs/games/runelite/default.nix +++ b/pkgs/games/runelite/default.nix @@ -11,13 +11,13 @@ maven.buildMavenPackage rec { pname = "runelite"; - version = "2.6.12"; + version = "2.6.13"; src = fetchFromGitHub { owner = "runelite"; repo = "launcher"; rev = version; - hash = "sha256-lovDkEvzclZCBu/Ha8h0j595NZ4ejefEOX7lNmzb8I8="; + hash = "sha256-KE0UMtm1rypyV5FIxxiJeoP/IeSEzpzqfUyQ9UnxA0o="; }; mvnHash = "sha256-bsJlsIXIIVzZyVgEF/SN+GgpZt6v0u800arO1c5QYHk="; diff --git a/pkgs/games/steam/fhsenv.nix b/pkgs/games/steam/fhsenv.nix index d5b266cece37..9c68f241a7fe 100644 --- a/pkgs/games/steam/fhsenv.nix +++ b/pkgs/games/steam/fhsenv.nix @@ -111,8 +111,7 @@ in buildFHSEnv rec { xorg.libXdamage xorg.libxshmfence xorg.libXxf86vm - libelf - (lib.getLib elfutils) + elfutils # Without these it silently fails xorg.libXinerama diff --git a/pkgs/games/stone-kingdoms/default.nix b/pkgs/games/stone-kingdoms/default.nix index 3138e1fc3aa8..3680f3af1275 100644 --- a/pkgs/games/stone-kingdoms/default.nix +++ b/pkgs/games/stone-kingdoms/default.nix @@ -11,13 +11,13 @@ stdenvNoCC.mkDerivation rec { pname = "stone-kingdoms"; - version = "0.6.0"; + version = "0.6.1"; src = fetchFromGitLab { owner = "stone-kingdoms"; repo = pname; rev = version; - hash = "sha256-qdaGowzAmMSCJrXzWLPDmyICsmvs0w+tfTsqKQewzJ8="; + hash = "sha256-W2hzJg22O857Kh7CJVVHV5qu8QKjXCwW3hmgKBc0n2g="; }; nativeBuildInputs = [ diff --git a/pkgs/games/tecnoballz/default.nix b/pkgs/games/tecnoballz/default.nix index 6366e0ab06a5..f65383a37a89 100644 --- a/pkgs/games/tecnoballz/default.nix +++ b/pkgs/games/tecnoballz/default.nix @@ -10,12 +10,12 @@ , tinyxml }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "tecnoballz"; version = "0.93.1"; src = fetchurl { - url = "https://linux.tlk.fr/games/TecnoballZ/download/tecnoballz-${version}.tgz"; + url = "https://linux.tlk.fr/games/TecnoballZ/download/tecnoballz-${finalAttrs.version}.tgz"; sha256 = "sha256-WRW76e+/eXE/KwuyOjzTPFQnKwNznbIrUrz14fnvgug="; }; @@ -66,4 +66,4 @@ stdenv.mkDerivation rec { platforms = platforms.all; broken = stdenv.isDarwin; }; -} +}) diff --git a/pkgs/games/titanion/default.nix b/pkgs/games/titanion/default.nix index 47db68aa483e..94e04a053c4e 100644 --- a/pkgs/games/titanion/default.nix +++ b/pkgs/games/titanion/default.nix @@ -16,12 +16,12 @@ debianPatch = patchname: hash: fetchpatch { sha256 = hash; }; -in stdenv.mkDerivation rec { +in stdenv.mkDerivation (finalAttrs: { pname = "titanion"; version = "0.3"; src = fetchurl { - url = "http://abagames.sakura.ne.jp/windows/ttn${lib.replaceStrings ["."] ["_"] version}.zip"; + url = "http://abagames.sakura.ne.jp/windows/ttn${lib.replaceStrings ["."] ["_"] finalAttrs.version}.zip"; sha256 = "sha256-fR0cufi6dU898wP8KGl/vxbfQJzMmMxlYZ3QNGLajfM="; }; @@ -88,4 +88,4 @@ in stdenv.mkDerivation rec { maintainers = with maintainers; [ fgaz ]; platforms = platforms.all; }; -} +}) diff --git a/pkgs/games/toppler/default.nix b/pkgs/games/toppler/default.nix index 890e13498747..fe36229363ce 100644 --- a/pkgs/games/toppler/default.nix +++ b/pkgs/games/toppler/default.nix @@ -15,14 +15,14 @@ , zlib }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "toppler"; version = "1.3"; src = fetchFromGitLab { owner = "roever"; repo = "toppler"; - rev = "v${version}"; + rev = "v${finalAttrs.version}"; sha256 = "sha256-ecEaELu52Nmov/BD9VzcUw6wyWeHJcsKQkEzTnaW330="; }; @@ -58,4 +58,4 @@ stdenv.mkDerivation rec { maintainers = with maintainers; [ fgaz ]; platforms = platforms.all; }; -} +}) diff --git a/pkgs/games/torus-trooper/default.nix b/pkgs/games/torus-trooper/default.nix index 645abc76c807..6e39aac63ff6 100644 --- a/pkgs/games/torus-trooper/default.nix +++ b/pkgs/games/torus-trooper/default.nix @@ -16,12 +16,12 @@ debianPatch = patchname: hash: fetchpatch { sha256 = hash; }; -in stdenv.mkDerivation rec { +in stdenv.mkDerivation (finalAttrs: { pname = "torus-trooper"; version = "0.22"; src = fetchurl { - url = "http://abagames.sakura.ne.jp/windows/tt${lib.replaceStrings ["."] ["_"] version}.zip"; + url = "http://abagames.sakura.ne.jp/windows/tt${lib.replaceStrings ["."] ["_"] finalAttrs.version}.zip"; sha256 = "1yhki1fdp3fi4y2iq12vca69f6k38dqjaw9z4lwcxky5kbgb7jvg"; }; @@ -101,4 +101,4 @@ in stdenv.mkDerivation rec { maintainers = with maintainers; [ fgaz ]; platforms = platforms.all; }; -} +}) diff --git a/pkgs/games/tumiki-fighters/default.nix b/pkgs/games/tumiki-fighters/default.nix index b4becea65756..344d062e08c3 100644 --- a/pkgs/games/tumiki-fighters/default.nix +++ b/pkgs/games/tumiki-fighters/default.nix @@ -16,12 +16,12 @@ debianPatch = patchname: hash: fetchpatch { sha256 = hash; }; -in stdenv.mkDerivation rec { +in stdenv.mkDerivation (finalAttrs: { pname = "tumiki-fighters"; version = "0.21"; src = fetchurl { - url = "http://abagames.sakura.ne.jp/windows/tf${lib.replaceStrings ["."] ["_"] version}.zip"; + url = "http://abagames.sakura.ne.jp/windows/tf${lib.replaceStrings ["."] ["_"] finalAttrs.version}.zip"; sha256 = "0djykfc1r8ysapklm621h89ana1c4qzc1m5nr9bqw4iccnmvwk3p"; }; @@ -94,4 +94,4 @@ in stdenv.mkDerivation rec { maintainers = with maintainers; [ fgaz ]; platforms = platforms.all; }; -} +}) diff --git a/pkgs/games/unciv/default.nix b/pkgs/games/unciv/default.nix index 68bf0fc8feba..703ee9b18b9f 100644 --- a/pkgs/games/unciv/default.nix +++ b/pkgs/games/unciv/default.nix @@ -27,11 +27,11 @@ let in stdenv.mkDerivation rec { pname = "unciv"; - version = "4.10.5"; + version = "4.10.15"; src = fetchurl { url = "https://github.com/yairm210/Unciv/releases/download/${version}/Unciv.jar"; - hash = "sha256-XRm3V2JEwJJWMEVohkT+8JGcTJttYPcB1u0VNnMRxVY="; + hash = "sha256-SikrApaaGCAQc6ncqI4vRfXSgG/hgfO1wn5B5fj+W6Y="; }; dontUnpack = true; diff --git a/pkgs/games/warzone2100/default.nix b/pkgs/games/warzone2100/default.nix index be2525c98716..7e6b8986109e 100644 --- a/pkgs/games/warzone2100/default.nix +++ b/pkgs/games/warzone2100/default.nix @@ -44,12 +44,12 @@ let }; in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { inherit pname; version = "4.4.2"; src = fetchurl { - url = "mirror://sourceforge/project/warzone2100/releases/${version}/warzone2100_src.tar.xz"; + url = "mirror://sourceforge/project/warzone2100/releases/${finalAttrs.version}/warzone2100_src.tar.xz"; hash = "sha256-O5Yqxqp1vKYr8uvAZ1SdsI/kocOzg0KRCirCqqvLrN4="; }; @@ -142,4 +142,4 @@ stdenv.mkDerivation rec { # https://github.com/Warzone2100/warzone2100/blob/master/macosx/README.md broken = stdenv.isDarwin; }; -} +}) diff --git a/pkgs/games/wesnoth/default.nix b/pkgs/games/wesnoth/default.nix index df5b393ccded..9afbdf1913b0 100644 --- a/pkgs/games/wesnoth/default.nix +++ b/pkgs/games/wesnoth/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, fetchpatch +{ lib, stdenv, fetchFromGitHub , cmake, pkg-config, SDL2, SDL2_image, SDL2_mixer, SDL2_net, SDL2_ttf , pango, gettext, boost, libvorbis, fribidi, dbus, libpng, pcre, openssl, icu , Cocoa, Foundation @@ -6,25 +6,15 @@ stdenv.mkDerivation rec { pname = "wesnoth"; - version = "1.16.9"; + version = "1.16.11"; src = fetchFromGitHub { rev = version; owner = "wesnoth"; repo = "wesnoth"; - hash = "sha256-KtAPc2nsqSoHNsLTLom/yaUECn+IWBdBFpiMclrUHxM="; + hash = "sha256-nnAMMc1pPYOziaHGUfh8LevECBb/lzCkaPyzFWs4zTY="; }; - patches = [ - # Pull upstream fix https://github.com/wesnoth/wesnoth/pull/6726 - # for gcc-13 support. - (fetchpatch { - name = "gcc-134.patch"; - url = "https://github.com/wesnoth/wesnoth/commit/f073493ebc279cefa391d364c48265058795e1d2.patch"; - hash = "sha256-uTB65DEBZwHFRgDwNx/yVjzmnW3jRoiibadXhNcwMkI="; - }) - ]; - nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ SDL2 SDL2_image SDL2_mixer SDL2_net SDL2_ttf pango gettext boost diff --git a/pkgs/games/xskat/default.nix b/pkgs/games/xskat/default.nix index 6baf397ad678..0d9fc5fe312f 100644 --- a/pkgs/games/xskat/default.nix +++ b/pkgs/games/xskat/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Famous german card game"; platforms = platforms.unix; - license = licenses.free; + license = licenses.xskat; longDescription = "Play the german card game Skat against the AI or over IRC."; homepage = "https://web.archive.org/web/20221003060115/https://www.xskat.de/xskat.html"; }; diff --git a/pkgs/games/zaz/default.nix b/pkgs/games/zaz/default.nix index 3b6c7244507c..9cfbad23c278 100644 --- a/pkgs/games/zaz/default.nix +++ b/pkgs/games/zaz/default.nix @@ -11,12 +11,12 @@ , freetype }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "zaz"; version = "1.0.1"; src = fetchurl { - url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz"; + url = "mirror://sourceforge/zaz/zaz-${finalAttrs.version}.tar.gz"; sha256 = "1r3bmwny05zzmdalxm5ah2rray0nnsg1w00r30p47q6x2lpwj8ml"; }; @@ -56,5 +56,4 @@ stdenv.mkDerivation rec { platforms = platforms.all; mainProgram = "zaz"; }; -} - +}) |