about summary refs log tree commit diff
path: root/pkgs/applications/gis/tunnelx
diff options
context:
space:
mode:
authorPol Dellaiera <pol.dellaiera@protonmail.com>2023-07-14 19:42:50 +0200
committerPol Dellaiera <pol.dellaiera@protonmail.com>2023-07-15 19:02:08 +0200
commit2c687f06f213f5d5b8904d19047cf1cf43f6f83c (patch)
treef8c881e311a84e659023dd9244ccb52ed9527b6b /pkgs/applications/gis/tunnelx
parentaf59b3fb98ba6c3868522a3bc1c13388c09163ab (diff)
tunnelx: minor refactor and cleanup
Follow up of https://github.com/NixOS/nixpkgs/pull/239739
Diffstat (limited to 'pkgs/applications/gis/tunnelx')
-rw-r--r--pkgs/applications/gis/tunnelx/default.nix27
1 files changed, 15 insertions, 12 deletions
diff --git a/pkgs/applications/gis/tunnelx/default.nix b/pkgs/applications/gis/tunnelx/default.nix
index 821900a9d465e..fd8c893a91b38 100644
--- a/pkgs/applications/gis/tunnelx/default.nix
+++ b/pkgs/applications/gis/tunnelx/default.nix
@@ -19,34 +19,37 @@ stdenv.mkDerivation (finalAttrs: {
   };
 
   nativeBuildInputs = [
-    makeWrapper
-  ];
-
-  buildInputs = [
     jdk
-  ];
-
-  runtimeInputs = [
-    survex
+    makeWrapper
   ];
 
   buildPhase = ''
+    runHook preBuild
+
     javac -d . src/*.java
+
+    runHook postBuild
   '';
 
   installPhase = ''
+    runHook preInstall
+
     mkdir -p $out/bin $out/java
     cp -r symbols Tunnel tutorials $out/java
+    # `SURVEX_EXECUTABLE_DIR` must include trailing slash
     makeWrapper ${jre}/bin/java $out/bin/tunnelx \
       --add-flags "-cp $out/java Tunnel.MainBox" \
-      --set SURVEX_EXECUTABLE_DIR ${survex}/bin/ \
+      --set SURVEX_EXECUTABLE_DIR ${lib.getBin survex}/bin/ \
       --set TUNNEL_USER_DIR $out/java/
+
+    runHook postInstall
   '';
 
-  meta = with lib; {
+  meta = {
     description = "A program for drawing cave surveys in 2D";
     homepage = "https://github.com/CaveSurveying/tunnelx/";
-    license = licenses.gpl3;
-    maintainers = with maintainers; [ goatchurchprime ];
+    license = lib.licenses.gpl3;
+    maintainers = with lib.maintainers; [ goatchurchprime ];
+    platforms = lib.platforms.linux;
   };
 })