2021-01-23 12:26:19 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper
|
2019-03-20 18:23:30 +00:00
|
|
|
, coreutils, jdk, rlwrap, gnupg }:
|
2012-01-19 20:34:59 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "leiningen";
|
2023-01-07 14:05:07 +00:00
|
|
|
version = "2.10.0";
|
2012-01-19 20:34:59 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2023-01-07 14:05:07 +00:00
|
|
|
url = "https://codeberg.org/leiningen/leiningen/raw/tag/${version}/bin/lein-pkg";
|
|
|
|
hash = "sha256-sXV86UHky/Fcv2Sbe09BM2XmEtqJLSKEHsFyg5G7Zq8=";
|
2012-01-19 20:34:59 +00:00
|
|
|
};
|
|
|
|
|
2023-01-07 14:05:07 +00:00
|
|
|
# Check https://codeberg.org/leiningen/leiningen/releases to get the URL for the new version
|
2012-01-19 20:34:59 +00:00
|
|
|
jarsrc = fetchurl {
|
2023-01-07 14:05:07 +00:00
|
|
|
url = "https://codeberg.org/attachments/43cebda5-a7c2-405b-b641-5143a00051b5";
|
|
|
|
hash = "sha256-0nKZutNAdawoZNC9BVn4NcbixHbAsKKDvL21dP2tuzQ=";
|
2012-01-19 20:34:59 +00:00
|
|
|
};
|
|
|
|
|
2019-08-15 12:41:18 +00:00
|
|
|
JARNAME = "${pname}-${version}-standalone.jar";
|
2012-05-11 03:36:13 +00:00
|
|
|
|
2019-06-19 15:45:34 +00:00
|
|
|
dontUnpack = true;
|
2012-01-19 20:34:59 +00:00
|
|
|
|
2021-02-07 09:17:39 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2014-11-01 23:47:52 +00:00
|
|
|
propagatedBuildInputs = [ jdk ];
|
2012-01-19 20:34:59 +00:00
|
|
|
|
2018-12-04 01:57:28 +00:00
|
|
|
# the jar is not in share/java, because it's a standalone jar and should
|
|
|
|
# never be picked up by set-java-classpath.sh
|
|
|
|
|
2016-08-23 10:38:24 +00:00
|
|
|
installPhase = ''
|
2023-01-07 14:05:07 +00:00
|
|
|
runHook preInstall
|
|
|
|
|
2018-12-04 01:57:28 +00:00
|
|
|
mkdir -p $out/bin $out/share
|
2016-08-23 10:38:24 +00:00
|
|
|
cp -v $src $out/bin/lein
|
2018-12-04 01:57:28 +00:00
|
|
|
cp -v $jarsrc $out/share/$JARNAME
|
2023-01-07 14:05:07 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
2016-08-23 10:38:24 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
fixupPhase = ''
|
2023-01-07 14:05:07 +00:00
|
|
|
runHook preFixup
|
|
|
|
|
2016-08-23 10:38:24 +00:00
|
|
|
chmod +x $out/bin/lein
|
|
|
|
patchShebangs $out/bin/lein
|
|
|
|
substituteInPlace $out/bin/lein \
|
2018-12-04 01:57:28 +00:00
|
|
|
--replace 'LEIN_JAR=/usr/share/java/leiningen-$LEIN_VERSION-standalone.jar' "LEIN_JAR=$out/share/$JARNAME"
|
2016-08-23 10:38:24 +00:00
|
|
|
wrapProgram $out/bin/lein \
|
2021-01-23 12:26:19 +00:00
|
|
|
--prefix PATH ":" "${lib.makeBinPath [ rlwrap coreutils ]}" \
|
2019-03-20 18:23:30 +00:00
|
|
|
--set LEIN_GPG ${gnupg}/bin/gpg \
|
2016-08-23 10:38:24 +00:00
|
|
|
--set JAVA_CMD ${jdk}/bin/java
|
2023-01-07 14:05:07 +00:00
|
|
|
|
|
|
|
runHook postFixup
|
2016-08-23 10:38:24 +00:00
|
|
|
'';
|
|
|
|
|
2012-01-19 20:34:59 +00:00
|
|
|
meta = {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://leiningen.org/";
|
2012-01-19 20:34:59 +00:00
|
|
|
description = "Project automation for Clojure";
|
2022-06-02 13:38:41 +00:00
|
|
|
sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
|
2021-01-23 12:26:19 +00:00
|
|
|
license = lib.licenses.epl10;
|
2023-01-07 14:05:07 +00:00
|
|
|
platforms = jdk.meta.platforms;
|
2023-01-07 14:05:25 +00:00
|
|
|
maintainers = with lib.maintainers; [ ];
|
2022-01-04 18:28:54 +00:00
|
|
|
mainProgram = "lein";
|
2012-01-19 20:34:59 +00:00
|
|
|
};
|
2012-02-29 14:35:34 +00:00
|
|
|
}
|