3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/tools/misc/clojure-lsp/repository.nix
Thiago Kenji Okada 2c3ad4ef9c clojure-lsp: build it from source
Nowadays we build it from the jar released from upstream, but this PRs
changes it to build it from source code.
2021-02-19 10:38:31 -03:00

41 lines
885 B
Nix

{ lib, stdenv, src, pname, version, leiningen }:
stdenv.mkDerivation {
inherit src;
name = "${pname}-${version}-repository";
buildInputs = [ leiningen ];
postPatch = ''
# Hack to set maven cache in another directory since MAVEN_OPTS doesn't work
substituteInPlace project.clj \
--replace ":main" ":local-repo \"$out\" :main"
'';
buildPhase = ''
runHook preBuild
export LEIN_HOME="$(mktemp -d)"
lein with-profiles +native-image deps
runHook postBuild
'';
installPhase = ''
runHook preInstall
find $out -type f \
-name \*.lastUpdated -or \
-name resolver-status.properties -or \
-name _remote.repositories \
-delete
runHook postInstall
'';
dontFixup = true;
outputHashAlgo = "sha256";
outputHashMode = "recursive";
outputHash = "sha256-aWZPsJF32ENyYNZCHf5amxVF9pb+5M73JqG/OITZlak=";
}