From 2c687f06f213f5d5b8904d19047cf1cf43f6f83c Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Fri, 14 Jul 2023 19:42:50 +0200 Subject: [PATCH 1/2] tunnelx: minor refactor and cleanup Follow up of https://github.com/NixOS/nixpkgs/pull/239739 --- pkgs/applications/gis/tunnelx/default.nix | 27 +++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/gis/tunnelx/default.nix b/pkgs/applications/gis/tunnelx/default.nix index 821900a9d465..fd8c893a91b3 100644 --- a/pkgs/applications/gis/tunnelx/default.nix +++ b/pkgs/applications/gis/tunnelx/default.nix @@ -19,34 +19,37 @@ stdenv.mkDerivation (finalAttrs: { }; nativeBuildInputs = [ + jdk makeWrapper ]; - buildInputs = [ - jdk - ]; - - runtimeInputs = [ - survex - ]; - 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; }; }) From 3ecdb1d32d79cd6c123b679818549f39699c59a7 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Sat, 15 Jul 2023 19:03:01 +0200 Subject: [PATCH 2/2] survex: minor cleanup and refactor --- pkgs/applications/misc/survex/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/survex/default.nix b/pkgs/applications/misc/survex/default.nix index b23cd02220b2..6f2098ea4778 100644 --- a/pkgs/applications/misc/survex/default.nix +++ b/pkgs/applications/misc/survex/default.nix @@ -45,14 +45,16 @@ stdenv.mkDerivation rec { buildInputs = [ ffmpeg glib - libGLU - mesa proj wxGTK32 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Carbon Cocoa ] ++ lib.optionals stdenv.hostPlatform.isLinux [ + # TODO: libGLU doesn't build for macOS because of Mesa issues + # (#233265); is it required for anything? + libGLU + mesa libICE libX11 ];