From 9fbc67d63ec3730e116e6be64b8029e10c640377 Mon Sep 17 00:00:00 2001 From: sternenseemann Date: Sat, 2 Jul 2022 11:00:32 +0200 Subject: opensoldat: rename from soldat-unstable Upstream project was [renamed] which removes the ambiguity with Soldat 1.7 as well as Soldat 2. [renamed]: https://github.com/opensoldat/opensoldat/commit/0fec3d86afa15c6c99f3c4a925ca1c27e65970af --- pkgs/games/opensoldat/default.nix | 91 ++++++++++++++++++++++++++++++++++ pkgs/games/soldat-unstable/default.nix | 91 ---------------------------------- 2 files changed, 91 insertions(+), 91 deletions(-) create mode 100644 pkgs/games/opensoldat/default.nix delete mode 100644 pkgs/games/soldat-unstable/default.nix (limited to 'pkgs/games') diff --git a/pkgs/games/opensoldat/default.nix b/pkgs/games/opensoldat/default.nix new file mode 100644 index 0000000000000..625fc0dce5ae4 --- /dev/null +++ b/pkgs/games/opensoldat/default.nix @@ -0,0 +1,91 @@ +{ lib, stdenv, fetchFromGitHub, fpc, zip, makeWrapper +, SDL2, freetype, physfs, openal, gamenetworkingsockets +, xorg, autoPatchelfHook, cmake +}: + +let + base = stdenv.mkDerivation rec { + pname = "opensoldat-base"; + version = "unstable-2021-09-05"; + + src = fetchFromGitHub { + name = "base"; + owner = "opensoldat"; + repo = "base"; + rev = "6c74d768d511663e026e015dde788006c74406b5"; + sha256 = "175gmkdccy8rnkd95h2zqldqfydyji1hfby8b1qbnl8wz4dh08mz"; + }; + + nativeBuildInputs = [ zip ]; + + buildPhase = '' + sh create_smod.sh + ''; + + installPhase = '' + install -Dm644 soldat.smod -t $out/share/soldat + install -Dm644 client/play-regular.ttf -t $out/share/soldat + ''; + + meta = with lib; { + description = "Opensoldat's base game content"; + license = licenses.cc-by-40; + platforms = platforms.all; + inherit (src.meta) homepage; + }; + }; + +in + +stdenv.mkDerivation rec { + pname = "opensoldat"; + version = "unstable-2022-07-02"; + + src = fetchFromGitHub { + name = "opensoldat"; + owner = "opensoldat"; + repo = "opensoldat"; + rev = "9574f5791b7993067f03d2df03d625908bc3762f"; + sha256 = "0kyxzikd4ngx3nshjw0411x61zqq1b7l01lxw41rlcy4nad3r0vi"; + }; + + nativeBuildInputs = [ fpc makeWrapper autoPatchelfHook cmake ]; + + cmakeFlags = [ + "-DADD_ASSETS=OFF" # We provide base's smods via nix + "-DBUILD_GNS=OFF" # Don't build GameNetworkingSockets as an ExternalProject + ]; + + buildInputs = [ SDL2 freetype physfs openal gamenetworkingsockets ]; + # TODO(@sternenseemann): set proper rpath via cmake, so we don't need autoPatchelfHook + runtimeDependencies = [ xorg.libX11 ]; + + # make sure soldat{,server} find their game archive, + # let them write their state and configuration files + # to $XDG_CONFIG_HOME/soldat/soldat{,server} unless + # the user specifies otherwise. + # TODO(@sternenseemann): rename config dir to opensoldat + postInstall = '' + for p in $out/bin/soldatserver $out/bin/soldat; do + configDir="\''${XDG_CONFIG_HOME:-\$HOME/.config}/soldat/$(basename "$p")" + + wrapProgram "$p" \ + --run "mkdir -p \"$configDir\"" \ + --add-flags "-fs_portable 0" \ + --add-flags "-fs_userpath \"$configDir\"" \ + --add-flags "-fs_basepath \"${base}/share/soldat\"" + done + ''; + + meta = with lib; { + description = "Opensoldat is a unique 2D (side-view) multiplayer action game"; + license = [ licenses.mit base.meta.license ]; + inherit (src.meta) homepage; + maintainers = [ maintainers.sternenseemann ]; + platforms = [ "x86_64-linux" "i686-linux" ]; + # portability currently mainly limited by fpc + # in nixpkgs which doesn't work on darwin, + # aarch64 and arm support should be possible: + # https://github.com/opensoldat/opensoldat/issues/45 + }; +} diff --git a/pkgs/games/soldat-unstable/default.nix b/pkgs/games/soldat-unstable/default.nix deleted file mode 100644 index 625fc0dce5ae4..0000000000000 --- a/pkgs/games/soldat-unstable/default.nix +++ /dev/null @@ -1,91 +0,0 @@ -{ lib, stdenv, fetchFromGitHub, fpc, zip, makeWrapper -, SDL2, freetype, physfs, openal, gamenetworkingsockets -, xorg, autoPatchelfHook, cmake -}: - -let - base = stdenv.mkDerivation rec { - pname = "opensoldat-base"; - version = "unstable-2021-09-05"; - - src = fetchFromGitHub { - name = "base"; - owner = "opensoldat"; - repo = "base"; - rev = "6c74d768d511663e026e015dde788006c74406b5"; - sha256 = "175gmkdccy8rnkd95h2zqldqfydyji1hfby8b1qbnl8wz4dh08mz"; - }; - - nativeBuildInputs = [ zip ]; - - buildPhase = '' - sh create_smod.sh - ''; - - installPhase = '' - install -Dm644 soldat.smod -t $out/share/soldat - install -Dm644 client/play-regular.ttf -t $out/share/soldat - ''; - - meta = with lib; { - description = "Opensoldat's base game content"; - license = licenses.cc-by-40; - platforms = platforms.all; - inherit (src.meta) homepage; - }; - }; - -in - -stdenv.mkDerivation rec { - pname = "opensoldat"; - version = "unstable-2022-07-02"; - - src = fetchFromGitHub { - name = "opensoldat"; - owner = "opensoldat"; - repo = "opensoldat"; - rev = "9574f5791b7993067f03d2df03d625908bc3762f"; - sha256 = "0kyxzikd4ngx3nshjw0411x61zqq1b7l01lxw41rlcy4nad3r0vi"; - }; - - nativeBuildInputs = [ fpc makeWrapper autoPatchelfHook cmake ]; - - cmakeFlags = [ - "-DADD_ASSETS=OFF" # We provide base's smods via nix - "-DBUILD_GNS=OFF" # Don't build GameNetworkingSockets as an ExternalProject - ]; - - buildInputs = [ SDL2 freetype physfs openal gamenetworkingsockets ]; - # TODO(@sternenseemann): set proper rpath via cmake, so we don't need autoPatchelfHook - runtimeDependencies = [ xorg.libX11 ]; - - # make sure soldat{,server} find their game archive, - # let them write their state and configuration files - # to $XDG_CONFIG_HOME/soldat/soldat{,server} unless - # the user specifies otherwise. - # TODO(@sternenseemann): rename config dir to opensoldat - postInstall = '' - for p in $out/bin/soldatserver $out/bin/soldat; do - configDir="\''${XDG_CONFIG_HOME:-\$HOME/.config}/soldat/$(basename "$p")" - - wrapProgram "$p" \ - --run "mkdir -p \"$configDir\"" \ - --add-flags "-fs_portable 0" \ - --add-flags "-fs_userpath \"$configDir\"" \ - --add-flags "-fs_basepath \"${base}/share/soldat\"" - done - ''; - - meta = with lib; { - description = "Opensoldat is a unique 2D (side-view) multiplayer action game"; - license = [ licenses.mit base.meta.license ]; - inherit (src.meta) homepage; - maintainers = [ maintainers.sternenseemann ]; - platforms = [ "x86_64-linux" "i686-linux" ]; - # portability currently mainly limited by fpc - # in nixpkgs which doesn't work on darwin, - # aarch64 and arm support should be possible: - # https://github.com/opensoldat/opensoldat/issues/45 - }; -} -- cgit 1.4.1