2c3ad4ef9c
Nowadays we build it from the jar released from upstream, but this PRs changes it to build it from source code.
40 lines
885 B
Nix
40 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=";
|
|
}
|