diff options
Diffstat (limited to 'pkgs/games')
-rw-r--r-- | pkgs/games/ferium/default.nix | 28 | ||||
-rw-r--r-- | pkgs/games/freeciv/default.nix | 4 | ||||
-rw-r--r-- | pkgs/games/gnonograms/default.nix | 14 | ||||
-rw-r--r-- | pkgs/games/itch-setup/default.nix | 24 | ||||
-rw-r--r-- | pkgs/games/itch/butler.nix | 29 | ||||
-rw-r--r-- | pkgs/games/itch/default.nix | 85 | ||||
-rw-r--r-- | pkgs/games/sil-q/default.nix | 9 | ||||
-rw-r--r-- | pkgs/games/sil/default.nix | 34 | ||||
-rw-r--r-- | pkgs/games/sm64ex/default.nix | 112 | ||||
-rw-r--r-- | pkgs/games/sm64ex/generic.nix | 83 | ||||
-rw-r--r-- | pkgs/games/umoria/default.nix | 24 |
11 files changed, 296 insertions, 150 deletions
diff --git a/pkgs/games/ferium/default.nix b/pkgs/games/ferium/default.nix new file mode 100644 index 0000000000000..b542ae3451e74 --- /dev/null +++ b/pkgs/games/ferium/default.nix @@ -0,0 +1,28 @@ +{ lib, stdenv, fetchFromGitHub, rustPlatform, Security }: + +rustPlatform.buildRustPackage rec { + pname = "ferium"; + version = "4.1.1"; + + src = fetchFromGitHub { + owner = "gorilla-devs"; + repo = pname; + rev = "v${version}"; + sha256 = "5DYdeK6JdA7oLBkjP3WkwLwlBitdf4Yt2dNP7P0INN0="; + }; + + buildInputs = lib.optionals stdenv.isDarwin [ Security ]; + + cargoSha256 = "7rpxHfe+pWarPJ72WSXjgr63YctZ5+RrsEgmw7o66VI="; + + buildNoDefaultFeatures = true; # by default pulls in GTK 3 just for its directory picker + + doCheck = false; # requires internet + + meta = with lib; { + description = "A CLI Minecraft mod manager for mods from Modrinth, CurseForge, and Github Releases"; + homepage = "https://github.com/theRookieCoder/ferium"; + license = licenses.mpl20; + maintainers = [ maintainers.leo60228 ]; + }; +} diff --git a/pkgs/games/freeciv/default.nix b/pkgs/games/freeciv/default.nix index b1d215912a0a8..e3057d59cd43a 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.1"; + version = "3.0.2"; src = fetchFromGitHub { owner = "freeciv"; repo = "freeciv"; rev = "R${lib.replaceStrings [ "." ] [ "_" ] version}"; - sha256 = "sha256-Nzc6Tirj6TKLgTYN5XjZZut9HVYLKGOp1GZeaoqEtW8="; + sha256 = "sha256-1QGARXIfb97aLxQ5TZ6Fjznlniznnyuc2ugiW/Drf9g="; }; postPatch = '' diff --git a/pkgs/games/gnonograms/default.nix b/pkgs/games/gnonograms/default.nix index 21f522d3418f9..2446384ff719a 100644 --- a/pkgs/games/gnonograms/default.nix +++ b/pkgs/games/gnonograms/default.nix @@ -1,7 +1,6 @@ { lib , stdenv , fetchFromGitHub -, fetchpatch , vala , meson , ninja @@ -19,24 +18,15 @@ stdenv.mkDerivation rec { pname = "gnonograms"; - version = "2.0.0"; + version = "2.1.2"; src = fetchFromGitHub { owner = "jeremypw"; repo = "gnonograms"; rev = "v${version}"; - sha256 = "sha256-2uXaybpCAm9cr0o7bqfhgD7mMNPwtv1X/PgnFnSDOl0="; + sha256 = "sha256-TkEVjrwlr4Q5FsfcdY+9fxwaMq+DFs0RwGI2E+GT5Mk="; }; - patches = [ - # Fix build with meson 0.61, can be removed on next release - # https://github.com/jeremypw/gnonograms/pull/45 - (fetchpatch { - url = "https://github.com/jeremypw/gnonograms/commit/0e90d8ff42d64a94002ec8500889bc4d7e06c1b6.patch"; - sha256 = "sha256-G/yqsZFmOA69A3E2CROMYAS5vmok/K5l1S/M2m8DMh4="; - }) - ]; - postPatch = '' patchShebangs meson/post_install.py ''; diff --git a/pkgs/games/itch-setup/default.nix b/pkgs/games/itch-setup/default.nix deleted file mode 100644 index 55d488bcaac06..0000000000000 --- a/pkgs/games/itch-setup/default.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ lib, writeShellScriptBin, steam-run, fetchurl }: -let - - pname = "itch-setup"; - version = "1.26.0"; - - src = fetchurl { - url = "https://broth.itch.ovh/itch-setup/linux-amd64/${version}/unpacked/default"; - hash = "sha256-bcJKqhgZK42Irx12BIvbTDMb/DHEOEXljetlDokF7x8="; - executable = true; - }; - -in -(writeShellScriptBin pname ''exec ${steam-run}/bin/steam-run ${src} "$@"'') // { - - passthru = { inherit pname version src; }; - meta = with lib; { - description = "An installer for the itch.io desktop app"; - homepage = "https://github.com/itchio/itch-setup"; - license = licenses.mit; - platforms = platforms.linux; - maintainers = with maintainers; [ pasqui23 ]; - }; -} diff --git a/pkgs/games/itch/butler.nix b/pkgs/games/itch/butler.nix new file mode 100644 index 0000000000000..68f1bac49e903 --- /dev/null +++ b/pkgs/games/itch/butler.nix @@ -0,0 +1,29 @@ +{ lib +, buildGoModule +, fetchFromGitHub +}: + +buildGoModule rec { + pname = "butler"; + version = "15.21.0"; + + src = fetchFromGitHub { + owner = "itchio"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-vciSmXR3wI3KcnC+Uz36AgI/WUfztA05MJv1InuOjJM="; + }; + + proxyVendor = true; + + vendorSha256 = "sha256-EIl0ZFDKbZopUR22hp5a2vRUu0O1h1O953NrtoNa2x8="; + + doCheck = false; + + meta = with lib; { + description = "Command-line itch.io helper"; + homepage = "https://github.com/itchio/butler"; + license = licenses.mit; + maintainers = with maintainers; [ martfont ]; + }; +} diff --git a/pkgs/games/itch/default.nix b/pkgs/games/itch/default.nix index 34a2775c3c80c..991623b6c9f7e 100644 --- a/pkgs/games/itch/default.nix +++ b/pkgs/games/itch/default.nix @@ -1,30 +1,56 @@ { lib , stdenvNoCC -, fetchurl -, libnotify -, nss -, gtk3 +, fetchpatch +, fetchzip , fetchFromGitHub +, butler +, electron_11 +, steam-run +, makeWrapper +, copyDesktopItems , makeDesktopItem -, itch-setup -, runtimeShell }: -stdenvNoCC.mkDerivation rec{ +stdenvNoCC.mkDerivation rec { pname = "itch"; version = "25.5.1"; - src = fetchFromGitHub { - owner = "itchio"; - repo = pname; - rev = "v${version}"; - hash = "sha256-Pi3l3uK4kr+N3p7fGQuqckYIzycRqJHDVX00reoSbp4="; + src = fetchzip { + url = "https://broth.itch.ovh/${pname}/linux-amd64/${version}/itch.zip"; + stripRoot = false; + sha256 = "sha256-ejfS+sqhacW2h8u96W4fout3V8xrBs0SrW5w/7X83m4="; }; + patches = [ + # Fixes crash while browsing the store. + (fetchpatch { + name = "itch.patch"; + url = "https://aur.archlinux.org/cgit/aur.git/plain/itch.patch?h=itch-bin&id=0b181454567029141749f870880b10093216e133"; + sha256 = "sha256-gmLL/BMondSflERm0z+DuGDP56JhDXiyxEwLUavTD8Q="; + }) + ]; + + itch-setup = fetchzip { + url = "https://broth.itch.ovh/itch-setup/linux-amd64/1.26.0/itch-setup.zip"; + stripRoot = false; + sha256 = "sha256-5MP6X33Jfu97o5R1n6Og64Bv4ZMxVM0A8lXeQug+bNA="; + }; + + icons = let sparseCheckout = "/release/images/itch-icons"; in + fetchFromGitHub { + owner = "itchio"; + repo = pname; + rev = "v${version}"; + hash = "sha256-1L6STTBHA9xL9IaERaH2OTvurTSng1D+P3KoW0ucEJc="; + inherit sparseCheckout; + } + sparseCheckout; + + nativeBuildInputs = [ copyDesktopItems makeWrapper ]; + desktopItems = [ (makeDesktopItem { name = pname; - exec = pname; - tryExec = "itch %U"; + exec = "itch %U"; + tryExec = pname; icon = pname; desktopName = pname; mimeTypes = [ "x-scheme-handler/itchio" "x-scheme-handler/itch" ]; @@ -33,23 +59,33 @@ stdenvNoCC.mkDerivation rec{ }) ]; - itchBin = '' - #!${runtimeShell} - exec ${itch-setup}/bin/itch-setup --prefer-launch -- "$@" - ''; + # As taken from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=itch-bin + installPhase = '' + runHook preInstall - passAsFile = [ "itchBin" ]; + mkdir -p $out/bin $out/share/${pname}/resources/app + cp -r resources/app "$out/share/${pname}/resources/" - # as taken from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=itch - installPhase = '' - install -Dm0777 $itchBinPath $out/bin/itch - for icon in release/images/itch-icons/icon*.png + install -Dm644 LICENSE -t "$out/share/licenses/$pkgname/" + install -Dm644 LICENSES.chromium.html -t "$out/share/licenses/$pkgname/" + + for icon in $icons/icon*.png do - iconsize="''${icon#release/images/itch-icons/icon}" + iconsize="''${icon#$icons/icon}" iconsize="''${iconsize%.png}" icondir="$out/share/icons/hicolor/''${iconsize}x''${iconsize}/apps/" install -Dm644 "$icon" "$icondir/itch.png" done + + runHook postInstall + ''; + + postFixup = '' + makeWrapper ${steam-run}/bin/steam-run $out/bin/${pname} \ + --add-flags ${electron_11}/bin/electron \ + --add-flags $out/share/${pname}/resources/app \ + --set BROTH_USE_LOCAL butler,itch-setup \ + --prefix PATH : ${butler}/bin/:${itch-setup} ''; meta = with lib; { @@ -57,6 +93,7 @@ stdenvNoCC.mkDerivation rec{ homepage = "https://github.com/itchio/itch"; license = licenses.mit; platforms = platforms.linux; + sourceProvenance = lib.sourceTypes.binaryBytecode; maintainers = with maintainers; [ pasqui23 ]; }; } diff --git a/pkgs/games/sil-q/default.nix b/pkgs/games/sil-q/default.nix index 1676f8da55a90..e4299bd8aca73 100644 --- a/pkgs/games/sil-q/default.nix +++ b/pkgs/games/sil-q/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchFromGitHub, writeScript, makeWrapper, ncurses, libX11 }: +{ pkgs, lib, stdenv, fetchFromGitHub, writeScript, makeWrapper, ncurses, libX11 }: let setup = writeScript "setup" '' @@ -47,6 +47,13 @@ in stdenv.mkDerivation rec { runHook postInstall ''; + passthru.tests = { + saveDirCreation = pkgs.runCommand "save-dir-creation" {} '' + HOME=$(pwd) ${lib.getExe pkgs.sil-q} --help + test -d .sil && touch $out + ''; + }; + meta = { description = "A roguelike game set in the First Age of Middle-earth"; longDescription = '' diff --git a/pkgs/games/sil/default.nix b/pkgs/games/sil/default.nix index 2e6c50daa8236..7d446a684aae0 100644 --- a/pkgs/games/sil/default.nix +++ b/pkgs/games/sil/default.nix @@ -1,4 +1,6 @@ -{ lib, stdenv, fetchzip, ncurses, libX11, libXaw, libXt, libXext, libXmu, makeWrapper, writeScript, ... }: +{ pkgs, lib, stdenv, fetchzip, ncurses, libX11, libXaw, libXt, libXext, libXmu +, makeWrapper, writeScript }: + let setup = writeScript "setup" '' mkdir -p "$ANGBAND_PATH" @@ -15,7 +17,7 @@ stdenv.mkDerivation rec { src = fetchzip { url = "http://www.amirrorclear.net/flowers/game/sil/Sil-130-src.zip"; sha256 = "1amp2mr3fxascra0k76sdsvikjh8g76nqh46kka9379zd35lfq8w"; - stripRoot=false; + stripRoot = false; }; nativeBuildInputs = [ makeWrapper ]; @@ -25,7 +27,7 @@ stdenv.mkDerivation rec { makefile = "Makefile.std"; - prePatch = '' + postPatch = '' # Allow usage of ANGBAND_PATH substituteInPlace config.h --replace "#define FIXED_PATHS" "" ''; @@ -41,30 +43,42 @@ stdenv.mkDerivation rec { NIX_CFLAGS_COMPILE = "-fcommon"; installPhase = '' - # the makefile doesn't have a sensible install target, so we hav to do it ourselves + runHook preInstall + + # the makefile doesn't have a sensible install target, so we have to do it ourselves mkdir -p $out/bin cp sil $out/bin/sil - # Wrap the program to set a user-local ANGBAND_PATH, and run the setup script to copy files into place + + # Wrap the program to set a user-local ANGBAND_PATH, and run the setup script to copy files into place. # We could just use the options for a user-local save and scores dir, but it tried to write to the # lib directory anyway, so we might as well give everyone a copy wrapProgram $out/bin/sil \ - --run "set -u" \ --run "export ANGBAND_PATH=\$HOME/.sil" \ --run "${setup} ${src}/Sil/lib" + + runHook postInstall ''; + passthru.tests = { + saveDirCreation = pkgs.runCommand "save-dir-creation" {} '' + HOME=$(pwd) ${lib.getExe pkgs.sil} --help + test -d .sil && touch $out + ''; + }; + meta = { - description = "A rouge-like game set in the first age of Middle-earth"; + description = "A rogue-like game set in the First Age of Middle-earth"; longDescription = '' - A game of adventure set in the first age of Middle-earth, when the world still - rang with elven song and gleamed with dwarven mail. + A game of adventure set in the First Age of Middle-earth, when the world still + rang with Elven song and gleamed with Dwarven mail. Walk the dark halls of Angband. Slay creatures black and fell. Wrest a shining Silmaril from Morgoth’s iron crown. ''; homepage = "http://www.amirrorclear.net/flowers/game/sil/index.html"; license = lib.licenses.gpl2; - maintainers = [ lib.maintainers.michaelpj ]; + maintainers = with lib.maintainers; [ michaelpj kenran ]; platforms = lib.platforms.linux; + mainProgram = "sil"; }; } diff --git a/pkgs/games/sm64ex/default.nix b/pkgs/games/sm64ex/default.nix index c6df2099d3ce3..a6bf7202adcf4 100644 --- a/pkgs/games/sm64ex/default.nix +++ b/pkgs/games/sm64ex/default.nix @@ -1,71 +1,55 @@ -{ lib, stdenv +{ lib +, stdenv , fetchFromGitHub -, python3 -, pkg-config -, audiofile -, SDL2 -, hexdump -, requireFile -, compileFlags ? [ ] -, region ? "us" -, baseRom ? requireFile { - name = "baserom.${region}.z64"; - message = '' - This nix expression requires that baserom.${region}.z64 is - already part of the store. To get this file you can dump your Super Mario 64 cartridge's contents - and add it to the nix store with nix-store --add-fixed sha256 <FILE>. - Note that if you are not using a US baserom, you must overwrite the "region" attribute with either "eu" or "jp". - ''; - sha256 = { - "us" = "17ce077343c6133f8c9f2d6d6d9a4ab62c8cd2aa57c40aea1f490b4c8bb21d91"; - "eu" = "c792e5ebcba34c8d98c0c44cf29747c8ee67e7b907fcc77887f9ff2523f80572"; - "jp" = "9cf7a80db321b07a8d461fe536c02c87b7412433953891cdec9191bfad2db317"; - }.${region}; - } +, callPackage +, autoPatchelfHook +, branch }: -stdenv.mkDerivation rec { - pname = "sm64ex"; - version = "unstable-2021-11-30"; - - src = fetchFromGitHub { - owner = "sm64pc"; - repo = "sm64ex"; - rev = "db9a6345baa5acb41f9d77c480510442cab26025"; - sha256 = "sha256-q7JWDvNeNrDpcKVtIGqB1k7I0FveYwrfqu7ZZK7T8F8="; +{ + sm64ex = callPackage ./generic.nix { + pname = "sm64ex"; + version = "0.pre+date=2021-11-30"; + + src = fetchFromGitHub { + owner = "sm64pc"; + repo = "sm64ex"; + rev = "db9a6345baa5acb41f9d77c480510442cab26025"; + sha256 = "sha256-q7JWDvNeNrDpcKVtIGqB1k7I0FveYwrfqu7ZZK7T8F8="; + }; + + extraMeta = { + homepage = "https://github.com/sm64pc/sm64ex"; + description = "Super Mario 64 port based off of decompilation"; + }; }; - nativeBuildInputs = [ python3 pkg-config ]; - buildInputs = [ audiofile SDL2 hexdump ]; - - makeFlags = [ "VERSION=${region}" ] ++ compileFlags - ++ lib.optionals stdenv.isDarwin [ "OSX_BUILD=1" ]; - - inherit baseRom; - - preBuild = '' - patchShebangs extract_assets.py - cp $baseRom ./baserom.${region}.z64 - ''; - - installPhase = '' - mkdir -p $out/bin - cp build/${region}_pc/sm64.${region}.f3dex2e $out/bin/sm64ex - ''; - - enableParallelBuilding = true; - - meta = with lib; { - homepage = "https://github.com/sm64pc/sm64ex"; - description = "Super Mario 64 port based off of decompilation"; - longDescription = '' - Super Mario 64 port based off of decompilation. - Note that you must supply a baserom yourself to extract assets from. - If you are not using an US baserom, you must overwrite the "region" attribute with either "eu" or "jp". - If you would like to use patches sm64ex distributes as makeflags, add them to the "compileFlags" attribute. + sm64ex-coop = callPackage ./generic.nix { + pname = "sm64ex-coop"; + version = "0.pre+date=2022-05-14"; + + src = fetchFromGitHub { + owner = "djoslin0"; + repo = "sm64ex-coop"; + rev = "8200b175607fe2939f067d496627c202a15fe24c"; + sha256 = "sha256-c1ZmMBtvYYcaJ/WxkZBVvNGVCeSXfm8NKe/BiAIJtks="; + }; + + extraNativeBuildInputs = [ + autoPatchelfHook + ]; + + postInstall = let + sharedLib = stdenv.hostPlatform.extensions.sharedLibrary; + in '' + mkdir -p $out/lib + cp $src/lib/bass/libbass{,_fx}${sharedLib} $out/lib + cp $src/lib/discordsdk/libdiscord_game_sdk${sharedLib} $out/lib ''; - license = licenses.unfree; - maintainers = with maintainers; [ ivar ]; - platforms = platforms.unix; + + extraMeta = { + homepage = "https://github.com/djoslin0/sm64ex-coop"; + description = "Super Mario 64 online co-op mod, forked from sm64ex"; + }; }; -} +}.${branch} diff --git a/pkgs/games/sm64ex/generic.nix b/pkgs/games/sm64ex/generic.nix new file mode 100644 index 0000000000000..ab75ac70b9c53 --- /dev/null +++ b/pkgs/games/sm64ex/generic.nix @@ -0,0 +1,83 @@ +{ pname +, version +, src +, extraNativeBuildInputs ? [ ] +, extraMeta ? {} +, compileFlags ? [ ] +, postInstall ? "" +, region ? "us" + +, lib +, stdenv +, fetchFromGitHub +, python3 +, pkg-config +, audiofile +, SDL2 +, hexdump +, requireFile +, baseRom ? requireFile { + name = "baserom.${region}.z64"; + message = '' + This nix expression requires that baserom.${region}.z64 is + already part of the store. To get this file you can dump your Super Mario 64 cartridge's contents + and add it to the nix store with nix-store --add-fixed sha256 <FILE>. + Note that if you are not using a US baserom, you must overwrite the "region" attribute with either "eu" or "jp". + ''; + sha256 = { + "us" = "17ce077343c6133f8c9f2d6d6d9a4ab62c8cd2aa57c40aea1f490b4c8bb21d91"; + "eu" = "c792e5ebcba34c8d98c0c44cf29747c8ee67e7b907fcc77887f9ff2523f80572"; + "jp" = "9cf7a80db321b07a8d461fe536c02c87b7412433953891cdec9191bfad2db317"; + }.${region}; + } +}: + +stdenv.mkDerivation rec { + inherit pname version src postInstall; + + nativeBuildInputs = [ + python3 + pkg-config + hexdump + ] ++ extraNativeBuildInputs; + + buildInputs = [ + audiofile + SDL2 + ]; + + enableParallelBuilding = true; + + makeFlags = [ + "VERSION=${region}" + ] ++ lib.optionals stdenv.isDarwin [ + "OSX_BUILD=1" + ] ++ compileFlags; + + preBuild = '' + patchShebangs extract_assets.py + ln -s ${baseRom} ./baserom.${region}.z64 + ''; + + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + cp build/${region}_pc/sm64.${region}.f3dex2e $out/bin/sm64ex + + runHook postInstall + ''; + + meta = with lib; { + longDescription = + extraMeta.description or "Super Mario 64 port based off of decompilation" + "\n" + '' + Note that you must supply a baserom yourself to extract assets from. + If you are not using an US baserom, you must overwrite the "region" attribute with either "eu" or "jp". + If you would like to use patches sm64ex distributes as makeflags, add them to the "compileFlags" attribute. + ''; + mainProgram = "sm64ex"; + license = licenses.unfree; + maintainers = with maintainers; [ ivar ]; + platforms = platforms.unix; + } // extraMeta; +} diff --git a/pkgs/games/umoria/default.nix b/pkgs/games/umoria/default.nix index 1114d47b7be56..13ec037afba78 100644 --- a/pkgs/games/umoria/default.nix +++ b/pkgs/games/umoria/default.nix @@ -8,7 +8,7 @@ }: let - savesDir = "~/.umoria/"; + savesDir = "~/.umoria"; in gcc9Stdenv.mkDerivation rec { pname = "umoria"; @@ -38,24 +38,22 @@ gcc9Stdenv.mkDerivation rec { RUNDIR=\$(mktemp -d) - cleanup() { - rm -rf \$RUNDIR - } - - trap cleanup EXIT + # Print the directory, so users have access to dumps, and let the system + # take care of cleaning up temp files. + echo "Running umoria in \$RUNDIR" cd \$RUNDIR - mkdir data - - for i in $out/data/*; do - ln -s \$i "data/\$(basename \$i)" - done + ln -sn $out/data \$RUNDIR/data mkdir -p ${savesDir} [[ ! -f ${savesDir}/scores.dat ]] && touch ${savesDir}/scores.dat ln -s ${savesDir}/scores.dat scores.dat - $out/.umoria-unwrapped + if [ \$# -eq 0 ]; then + $out/.umoria-unwrapped ${savesDir}/game.sav + else + $out/.umoria-unwrapped "\$@" + fi EOF chmod +x $out/bin/umoria @@ -74,7 +72,7 @@ gcc9Stdenv.mkDerivation rec { ''; platforms = platforms.unix; badPlatforms = [ "aarch64-darwin" ]; - maintainers = [ maintainers.aciceri ]; + maintainers = with maintainers; [ aciceri kenran ]; license = licenses.gpl3Plus; }; } |