
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
57 lines
1.2 KiB
Nix
57 lines
1.2 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchFromGitHub
|
|
, jdk
|
|
, jre
|
|
, survex
|
|
, makeWrapper
|
|
}:
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
pname = "tunnelx";
|
|
version = "2023-09-29";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "CaveSurveying";
|
|
repo = "tunnelx";
|
|
rev = "v${finalAttrs.version}";
|
|
hash = "sha256-4vTtmhVNDXUD7pCiugt+Yl/M3MFsUnzJfpcU9AxnGvA=";
|
|
};
|
|
|
|
nativeBuildInputs = [
|
|
jdk
|
|
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 ${lib.getBin survex}/bin/ \
|
|
--set TUNNEL_USER_DIR $out/java/
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
meta = {
|
|
description = "Program for drawing cave surveys in 2D";
|
|
homepage = "https://github.com/CaveSurveying/tunnelx/";
|
|
license = lib.licenses.gpl3;
|
|
maintainers = with lib.maintainers; [ goatchurchprime ];
|
|
platforms = lib.platforms.linux;
|
|
mainProgram = "tunnelx";
|
|
};
|
|
})
|