about summary refs log tree commit diff
path: root/pkgs/games/unvanquished
diff options
context:
space:
mode:
authorAndersonTorres <torres.anderson.85@protonmail.com>2022-06-08 22:30:32 -0300
committerAndersonTorres <torres.anderson.85@protonmail.com>2022-06-09 23:33:55 -0300
commit3f953478bee6771a8ce5c86540b1fda451df1808 (patch)
tree9a687c0737226146c5f9c339ccb27a6fc619b316 /pkgs/games/unvanquished
parent2275593fe8a3c577ddf79c46207cfefa7a0f5133 (diff)
unvanquished: use SRI hash format
Diffstat (limited to 'pkgs/games/unvanquished')
-rw-r--r--pkgs/games/unvanquished/default.nix75
1 files changed, 61 insertions, 14 deletions
diff --git a/pkgs/games/unvanquished/default.nix b/pkgs/games/unvanquished/default.nix
index 191d8c2180705..574c639ad125e 100644
--- a/pkgs/games/unvanquished/default.nix
+++ b/pkgs/games/unvanquished/default.nix
@@ -1,8 +1,34 @@
-{ lib, stdenv, fetchzip, fetchFromGitHub, buildFHSUserEnv, makeDesktopItem
-, copyDesktopItems, gcc, cmake, gmp , libGL, zlib, ncurses, geoip, lua5
-, nettle, curl, SDL2, freetype, glew , openal, libopus, opusfile, libogg
-, libvorbis, libjpeg, libwebp, libpng
-, cacert, aria2 # to download assets
+{ lib
+, stdenv
+, fetchzip
+, fetchFromGitHub
+, SDL2
+, buildFHSUserEnv
+, cmake
+, copyDesktopItems
+, curl
+, freetype
+, gcc
+, geoip
+, glew
+, gmp
+, libGL
+, libjpeg
+, libogg
+, libopus
+, libpng
+, libvorbis
+, libwebp
+, lua5
+, makeDesktopItem
+, ncurses
+, nettle
+, openal
+, opusfile
+, zlib
+# to download assets
+, aria2
+, cacert
 }:
 
 let
@@ -14,18 +40,21 @@ let
     repo = "Unvanquished";
     rev = "v${version}";
     fetchSubmodules = true;
-    sha256 = "1fiqn9f6nsh4cfjy7gfsv950hphwi9ca0ddgsjvn77g7yc0arp6c";
+    sha256 = "sha256-zNysAPPnnWO31K81oFiKHF4IStraveOlYwRqa1yyOLo=";
   };
 
   unvanquished-binary-deps = stdenv.mkDerivation rec {
     # DISCLAIMER: this is selected binary crap from the NaCl SDK
     name = "unvanquished-binary-deps";
     version = binary-deps-version;
+
     src = fetchzip {
       url = "https://dl.unvanquished.net/deps/linux64-${version}.tar.bz2";
-      sha256 = "08bpyavbh5lmyprvqqi59gnm8s1fjmlk9f1785wlv7f52d9f9z1p";
+      sha256 = "sha256-N/zkUhPFnU15QSe4NGmVLmhU7UslYrzz9ZUWuLbydyE=";
     };
+
     dontPatchELF = true;
+
     preFixup = ''
       # We are not using the autoPatchelfHook, because it would make
       # nacl_bootstrap_helper unable to load nacl_loader:
@@ -38,7 +67,12 @@ let
         fi
       done
     '';
-    preCheck = "pnacl/bin/clang -v"; # check it links correctly
+
+    preCheck = ''
+      # check it links correctly
+      pnacl/bin/clang -v
+    '';
+
     installPhase = ''
       runHook preInstall
 
@@ -51,15 +85,18 @@ let
 
   libstdcpp-preload-for-unvanquished-nacl = stdenv.mkDerivation {
     name = "libstdcpp-preload-for-unvanquished-nacl";
+
+    propagatedBuildInputs = [ gcc.cc.lib ];
+
     buildCommand = ''
       mkdir $out/etc -p
       echo ${gcc.cc.lib}/lib/libstdc++.so.6 > $out/etc/ld-nix.so.preload
     '';
-    propagatedBuildInputs = [ gcc.cc.lib ];
   };
 
   fhsEnv = buildFHSUserEnv {
     name = "unvanquished-fhs-wrapper";
+
     targetPkgs = pkgs: [ libstdcpp-preload-for-unvanquished-nacl ];
   };
 
@@ -81,10 +118,14 @@ let
     pname = "unvanquished-assets";
     inherit version src;
 
-    outputHash = "sha256:084jdisb48xyk9agjifn0nlnsdnjgg32si8zd1khsywd0kffplzx";
+    outputHash = "sha256-/dPr3ASNew1naB9FLcZ70jZtqQXWRflUmr4jsnRskiA=";
     outputHashMode = "recursive";
+
     nativeBuildInputs = [ aria2 cacert ];
-    buildCommand = "bash $src/download-paks --cache=$(pwd) --version=${version} $out";
+
+    buildCommand = ''
+      bash $src/download-paks --cache=$(pwd) --version=${version} $out
+    '';
   };
 
 # this really is the daemon game engine, the game itself is in the assets
@@ -98,7 +139,12 @@ in stdenv.mkDerivation rec {
     chmod +w -R daemon/external_deps/linux64-${binary-deps-version}/
   '';
 
-  nativeBuildInputs = [ cmake unvanquished-binary-deps copyDesktopItems ];
+  nativeBuildInputs = [
+    cmake
+    unvanquished-binary-deps
+    copyDesktopItems
+  ];
+
   buildInputs = [
     gmp
     libGL
@@ -168,17 +214,18 @@ in stdenv.mkDerivation rec {
 
     runHook postInstall
   '';
+
   meta = {
-    platforms = [ "x86_64-linux" ];
     homepage = "https://unvanquished.net/";
     downloadPage = "https://unvanquished.net/download/";
     description = "A fast paced, first person strategy game";
-    maintainers = with lib.maintainers; [ afontain ];
     # don't replace the following lib.licenses.zlib with just "zlib",
     # or you would end up with the package instead
     license = with lib.licenses; [
       mit gpl3Plus lib.licenses.zlib bsd3 # engine
       cc-by-sa-25 cc-by-sa-30 cc-by-30 cc-by-sa-40 cc0 # assets
     ];
+    maintainers = with lib.maintainers; [ afontain ];
+    platforms = [ "x86_64-linux" ];
   };
 }