summary refs log tree commit diff
path: root/pkgs/applications/gis
diff options
context:
space:
mode:
authorJulian Todd <julian@goatchurch.org.uk>2023-06-29 13:43:21 +0100
committermatthewcroughan <matt@croughan.sh>2023-07-13 18:15:43 +0100
commit35ec55c81382ed0744782ec0b09d1908fd281b17 (patch)
tree459d306cc507cd2d5ce66ebdb92817a695d92606 /pkgs/applications/gis
parent541797bedc0fc5a273ff3cb499ef7a260c3b7cc3 (diff)
tunnelx: init at 2023-07-nix
Diffstat (limited to 'pkgs/applications/gis')
-rw-r--r--pkgs/applications/gis/tunnelx/default.nix52
1 files changed, 52 insertions, 0 deletions
diff --git a/pkgs/applications/gis/tunnelx/default.nix b/pkgs/applications/gis/tunnelx/default.nix
new file mode 100644
index 0000000000000..821900a9d465e
--- /dev/null
+++ b/pkgs/applications/gis/tunnelx/default.nix
@@ -0,0 +1,52 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, jdk
+, jre
+, survex
+, makeWrapper
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "tunnelx";
+  version = "2023-07-nix";
+
+  src = fetchFromGitHub {
+    owner = "CaveSurveying";
+    repo = "tunnelx";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-H6lHqc9on/pv/KihNcaHPwbWf4JXRkeRqNoYq6yVKqM=";
+  };
+
+  nativeBuildInputs = [
+    makeWrapper
+  ];
+
+  buildInputs = [
+    jdk
+  ];
+
+  runtimeInputs = [
+    survex
+  ];
+
+  buildPhase = ''
+    javac -d . src/*.java
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/java
+    cp -r symbols Tunnel tutorials $out/java
+    makeWrapper ${jre}/bin/java $out/bin/tunnelx \
+      --add-flags "-cp $out/java Tunnel.MainBox" \
+      --set SURVEX_EXECUTABLE_DIR ${survex}/bin/ \
+      --set TUNNEL_USER_DIR $out/java/
+  '';
+
+  meta = with lib; {
+    description = "A program for drawing cave surveys in 2D";
+    homepage = "https://github.com/CaveSurveying/tunnelx/";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ goatchurchprime ];
+  };
+})