diff options
author | Roman Timushev <rtimush@gmail.com> | 2022-07-22 23:28:57 +0200 |
---|---|---|
committer | Weijia Wang <9713184+wegank@users.noreply.github.com> | 2023-10-18 00:46:20 +0200 |
commit | 0c16b9a0a793a71af5ead7204653b8cf4203ef43 (patch) | |
tree | 82826da2ef61bf07e55613e668300916b26a160c /pkgs/by-name/sc | |
parent | 1d50e695f33447906f4371ed27f2f45cf1946bc1 (diff) |
scala-update: init at 0.2.2
Diffstat (limited to 'pkgs/by-name/sc')
-rw-r--r-- | pkgs/by-name/sc/scala-update/package.nix | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/by-name/sc/scala-update/package.nix b/pkgs/by-name/sc/scala-update/package.nix new file mode 100644 index 0000000000000..d15292c4d32ea --- /dev/null +++ b/pkgs/by-name/sc/scala-update/package.nix @@ -0,0 +1,47 @@ +{ lib, stdenv, coursier, buildGraalvmNativeImage }: + +let + baseName = "scala-update"; + version = "0.2.2"; + deps = stdenv.mkDerivation { + name = "${baseName}-deps-${version}"; + buildCommand = '' + export COURSIER_CACHE=$(pwd) + ${coursier}/bin/cs fetch io.github.kitlangton:scala-update_2.13:${version} > deps + mkdir -p $out/share/java + cp $(< deps) $out/share/java/ + ''; + outputHashMode = "recursive"; + outputHashAlgo = "sha256"; + outputHash = "kNnFzzHn+rFq4taqRYjBYaDax0MHW+vIoSFVN3wxA8M="; + }; +in buildGraalvmNativeImage { + pname = baseName; + inherit version; + + buildInputs = [ deps ]; + + src = "${deps}/share/java/${baseName}_2.13-${version}.jar"; + + extraNativeImageBuildArgs = + [ "--no-fallback" "--enable-url-protocols=https" "update.Main" ]; + + buildPhase = '' + runHook preBuild + + native-image ''${nativeImageBuildArgs[@]} -cp $(JARS=("${deps}/share/java"/*.jar); IFS=:; echo "''${JARS[*]}") + + runHook postBuild + ''; + + installCheckPhase = '' + $out/bin/${baseName} --version | grep -q "${version}" + ''; + + meta = with lib; { + description = "Update your Scala dependencies interactively"; + homepage = "https://github.com/kitlangton/scala-update"; + license = licenses.asl20; + maintainers = [ maintainers.rtimush ]; + }; +} |