about summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeder Bergebakken Sundt <pbsds@hotmail.com>2024-04-21 19:56:42 +0200
committerGitHub <noreply@github.com>2024-04-21 19:56:42 +0200
commitb8af6d814ded5e1f07be53f338b9d0e5ac397d64 (patch)
tree2d6493f12a5b2a22c88be1119b30943b24dc6146
parentaa7c638706d77ce8fc63d9b535e1aa5f855ac90e (diff)
parentb831e46dd1a599ea4e630566cbac28181502d912 (diff)
Merge pull request #294739 from TomaSajt/gogui
gogui: make deterministic and clean up
-rw-r--r--pkgs/games/gogui/default.nix45
1 files changed, 23 insertions, 22 deletions
diff --git a/pkgs/games/gogui/default.nix b/pkgs/games/gogui/default.nix
index 43e1f3397b8fb..50cb29ddb454c 100644
--- a/pkgs/games/gogui/default.nix
+++ b/pkgs/games/gogui/default.nix
@@ -1,48 +1,46 @@
-{ ant
+{ lib
+, stdenv
+, fetchFromGitHub
+, ant
+, jdk
+, jre
 , docbook-xsl-ns
 , docbook_xml_dtd_42
-, fetchFromGitHub
 , imagemagick
-, lib
 , libxslt
+, stripJavaArchivesHook
 , makeWrapper
-, openjdk
-, stdenv
 }:
 
-let
-  version = "1.5.4a";
-in stdenv.mkDerivation {
+stdenv.mkDerivation (finalAttrs: {
   pname = "gogui";
-  inherit version;
+  version = "1.5.4a";
 
   src = fetchFromGitHub {
     owner = "Remi-Coulom";
     repo = "gogui";
-    rev = "v${version}";
+    rev = "v${finalAttrs.version}";
     hash = "sha256-UFhOk2mAnTtxfwEOHquN64YDCRq7nNUqZAPQf77MEEw=";
   };
 
   nativeBuildInputs = [
-    makeWrapper
     ant
-  ];
-
-  buildInputs = [
+    jdk
     docbook-xsl-ns
     imagemagick
     libxslt
-    openjdk
+    stripJavaArchivesHook
+    makeWrapper
   ];
 
   buildPhase = ''
     runHook preBuild
 
     substituteInPlace doc/manual/xml/book.xml \
-      --replace http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd \
+      --replace-fail http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd \
       ${docbook_xml_dtd_42}/xml/dtd/docbook/docbookx.dtd
     substituteInPlace doc/manual/xml/manpages.xml \
-      --replace http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd \
+      --replace-fail http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd \
       ${docbook_xml_dtd_42}/xml/dtd/docbook/docbookx.dtd
 
     # generate required gui images from svg
@@ -75,21 +73,24 @@ in stdenv.mkDerivation {
     ln -s $out/share/doc/gogui/manual/man $out/share/man/man1
 
     # copy programs
-    mv -vi {bin,lib} $out/
+    mv -vi bin lib $out/
 
     # wrap programs
     for x in $out/bin/*; do
-      wrapProgram $x --prefix PATH ":" ${openjdk}/bin --set GOGUI_JAVA_HOME ${openjdk}
+        wrapProgram $x \
+            --prefix PATH : ${jre}/bin \
+            --set GOGUI_JAVA_HOME ${jre}
     done
 
     runHook postInstall
   '';
 
   meta = {
-    maintainers = [ lib.maintainers.cleverca22 lib.maintainers.omnipotententity];
     description = "A graphical user interface to programs that play the board game Go and support the Go Text Protocol such as GNU Go";
     homepage = "https://github.com/Remi-Coulom/gogui";
+    license = lib.licenses.gpl3Plus;
+    mainProgram = "gogui";
+    maintainers = with lib.maintainers; [ cleverca22 omnipotententity ];
     platforms = lib.platforms.unix;
-    license = lib.licenses.gpl3;
   };
-}
+})