summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorgithub-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>2021-06-23 00:09:37 +0000
committerGitHub <noreply@github.com>2021-06-23 00:09:37 +0000
commit64eb8c173da51def327a8ca4a7fcca8e96a971d4 (patch)
tree4a4ea16ee480e45aa1a2d2566e9b3734bd138782 /pkgs/games
parentb7666646457ee97b8914a88c78e1ee202bb8e833 (diff)
parente8122c362847810d168dcc2a8c9153e6008d1d14 (diff)
downloadnixpkgs-64eb8c173da51def327a8ca4a7fcca8e96a971d4.tar
nixpkgs-64eb8c173da51def327a8ca4a7fcca8e96a971d4.tar.gz
nixpkgs-64eb8c173da51def327a8ca4a7fcca8e96a971d4.tar.bz2
nixpkgs-64eb8c173da51def327a8ca4a7fcca8e96a971d4.tar.lz
nixpkgs-64eb8c173da51def327a8ca4a7fcca8e96a971d4.tar.xz
nixpkgs-64eb8c173da51def327a8ca4a7fcca8e96a971d4.tar.zst
nixpkgs-64eb8c173da51def327a8ca4a7fcca8e96a971d4.zip
Merge staging-next into staging
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/widelands/default.nix108
1 files changed, 73 insertions, 35 deletions
diff --git a/pkgs/games/widelands/default.nix b/pkgs/games/widelands/default.nix
index 8b96dcc04e2..f094c7cd596 100644
--- a/pkgs/games/widelands/default.nix
+++ b/pkgs/games/widelands/default.nix
@@ -1,52 +1,90 @@
-{ lib, stdenv, fetchurl, cmake, python, gettext
-, boost, libpng, zlib, glew, lua, doxygen, icu
-, SDL2, SDL2_image, SDL2_mixer, SDL2_net, SDL2_ttf
+{ lib
+, stdenv
+, fetchFromGitHub
+, SDL2
+, SDL2_image
+, SDL2_mixer
+, SDL2_net
+, SDL2_ttf
+, boost
+, cmake
+, curl
+, doxygen
+, gettext
+, glew
+, graphviz
+, icu
+, installShellFiles
+, libpng
+, lua
+, python3
+, zlib
 }:
 
 stdenv.mkDerivation rec {
   pname = "widelands";
-  version = "21";
+  version = "1.0";
 
-  meta = with lib; {
-    description = "RTS with multiple-goods economy";
-    homepage    = "http://widelands.org/";
-    longDescription = ''
-      Widelands is a real time strategy game based on "The Settlers" and "The
-      Settlers II". It has a single player campaign mode, as well as a networked
-      multiplayer mode.
-    '';
-    license        = licenses.gpl2Plus;
-    platforms      = platforms.linux;
-    maintainers    = with maintainers; [ raskin jcumming ];
-    hydraPlatforms = [];
+  src = fetchFromGitHub {
+    owner = "widelands";
+    repo = "widelands";
+    rev = "v${version}";
+    sha256 = "sha256-gNumYoeKePaxiAzrqEPKibMxFwv9vyBrCSoua+MKhcM=";
   };
 
-  patches = [
-    ./bincmake.patch
-  ];
-
-  src = fetchurl {
-    url = "https://launchpad.net/widelands/build${version}/build${version}/+download/widelands-build${version}-source.tar.gz";
-    sha256 = "sha256-YB4OTG+Rs/sOzizRuD7PsCNEobkZT7tw7z9w4GmU41c=";
-  };
+  patches = [ ./bincmake.patch ];
 
-  preConfigure = ''
-    cmakeFlags="
-      -DWL_INSTALL_BASEDIR=$out
-      -DWL_INSTALL_DATADIR=$out/share/widelands
-      -DWL_INSTALL_BINARY=$out/bin
-    "
+  postPatch = ''
+    substituteInPlace xdg/org.widelands.Widelands.desktop \
+      --replace 'Exec=widelands' "Exec=$out/bin/widelands"
   '';
 
-  nativeBuildInputs = [ cmake python gettext ];
+  cmakeFlags = [
+    "-Wno-dev" # dev warnings are only needed for upstream development
+    "-DWL_INSTALL_BASEDIR=${placeholder "out"}"
+    "-DWL_INSTALL_DATADIR=${placeholder "out"}/share/widelands"
+    "-DWL_INSTALL_BINARY=${placeholder "out"}/bin"
+  ];
+
+  nativeBuildInputs = [ cmake doxygen gettext graphviz installShellFiles ];
 
   buildInputs = [
-    boost libpng zlib glew lua doxygen icu
-    SDL2 SDL2_image SDL2_mixer SDL2_net SDL2_ttf
+    SDL2
+    SDL2_image
+    SDL2_mixer
+    SDL2_net
+    SDL2_ttf
+    boost
+    curl
+    glew
+    icu
+    libpng
+    lua
+    python3
+    zlib
   ];
 
   postInstall = ''
-    mkdir -p "$out/share/applications/"
-    cp -v "../xdg/org.widelands.Widelands.desktop" "$out/share/applications/"
+    install -Dm444 -t $out/share/applications ../xdg/org.widelands.Widelands.desktop
+
+    for s in 16 32 48 64 128; do
+      install -Dm444 ../data/images/logos/wl-ico-''${s}.png $out/share/icons/hicolor/''${s}x''${s}/org.widelands.Widelands.png
+    done
+
+    installManPage ../xdg/widelands.6
   '';
+
+  meta = with lib; {
+    description = "RTS with multiple-goods economy";
+    homepage = "https://widelands.org/";
+    longDescription = ''
+      Widelands is a real time strategy game based on "The Settlers" and "The
+      Settlers II". It has a single player campaign mode, as well as a networked
+      multiplayer mode.
+    '';
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ raskin jcumming ];
+    platforms = platforms.linux;
+    hydraPlatforms = [ ];
+  };
 }