Try reverting to 0.6.8 again
This commit is contained in:
parent
330fab4269
commit
5cb0123393
|
@ -71,27 +71,29 @@ in stdenv.mkDerivation {
|
||||||
${concatStringsSep "\n" (map extract-jar dep-jars)}
|
${concatStringsSep "\n" (map extract-jar dep-jars)}
|
||||||
${concatStringsSep "\n"
|
${concatStringsSep "\n"
|
||||||
(map (java-compile tools-classpath) tools-namespaces)}
|
(map (java-compile tools-classpath) tools-namespaces)}
|
||||||
${java-compile "" "'build"}
|
${java-compile tools-classpath "'build"}
|
||||||
jar cmf ${manifest} ./out.jar -C . ${
|
jar cmf ${manifest} ./out.jar -C . ${
|
||||||
concatStringsSep " " [
|
concatStringsSep " " [
|
||||||
"build"
|
"META-INF"
|
||||||
"cljs"
|
|
||||||
"cognitect"
|
|
||||||
"com"
|
|
||||||
"javax"
|
|
||||||
"mozilla"
|
|
||||||
"plugin.xml"
|
|
||||||
"about.html"
|
"about.html"
|
||||||
|
"build.clj"
|
||||||
|
"classes"
|
||||||
|
"cljs"
|
||||||
"clojure"
|
"clojure"
|
||||||
|
"cognitect"
|
||||||
"cognitect_aws_http.edn"
|
"cognitect_aws_http.edn"
|
||||||
|
"com"
|
||||||
"data_readers.cljc"
|
"data_readers.cljc"
|
||||||
|
"javax"
|
||||||
"licenses"
|
"licenses"
|
||||||
|
"mozilla"
|
||||||
"org"
|
"org"
|
||||||
|
"plugin.xml"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
cat /tmp/*.edn
|
[ $? -eq 0 ] || /tmp/*.edn
|
||||||
'';
|
'';
|
||||||
in pthru "${build-script}";
|
in "${build-script}";
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
cp out.jar $out
|
cp out.jar $out
|
||||||
|
|
|
@ -89,16 +89,16 @@
|
||||||
},
|
},
|
||||||
"nixpkgs_2": {
|
"nixpkgs_2": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1645296114,
|
"lastModified": 1654005557,
|
||||||
"narHash": "sha256-y53N7TyIkXsjMpOG7RhvqJFGDacLs9HlyHeSTBioqYU=",
|
"narHash": "sha256-J6elwUzPoco+r5qWPHhvS2EHVWomUtNcxzkfdAQOwEU=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "530a53dcbc9437363471167a5e4762c5fcfa34a1",
|
"rev": "08950a6e29cf7bddee466592eb790a417550f7f9",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
"id": "nixpkgs",
|
"id": "nixpkgs",
|
||||||
"ref": "nixos-21.05",
|
"ref": "nixos-22.05",
|
||||||
"type": "indirect"
|
"type": "indirect"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
description = "clojure/tools.build packaged for NixOS.";
|
description = "clojure/tools.build packaged for NixOS.";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "nixpkgs/nixos-21.05";
|
nixpkgs.url = "nixpkgs/nixos-22.05";
|
||||||
utils.url = "github:numtide/flake-utils";
|
utils.url = "github:numtide/flake-utils";
|
||||||
clj2nix.url = "github:hlolli/clj2nix";
|
clj2nix.url = "github:hlolli/clj2nix";
|
||||||
build-tools-src = {
|
build-tools-src = {
|
||||||
url = "github:clojure/tools.build?tag=v0.8.2";
|
url = "github:clojure/tools.build?tag=v0.6.8";
|
||||||
flake = false;
|
flake = false;
|
||||||
};
|
};
|
||||||
gitignore = {
|
gitignore = {
|
||||||
|
@ -22,7 +22,7 @@
|
||||||
system = "x86_64-linux";
|
system = "x86_64-linux";
|
||||||
pkgs = nixpkgs.legacyPackages."${system}";
|
pkgs = nixpkgs.legacyPackages."${system}";
|
||||||
build-tools-jar = pkgs.callPackage ./build.tools.nix {
|
build-tools-jar = pkgs.callPackage ./build.tools.nix {
|
||||||
version = "0.8.2";
|
version = "0.6.8";
|
||||||
inherit build-tools-src;
|
inherit build-tools-src;
|
||||||
inherit (gitignore.lib) gitignoreSource;
|
inherit (gitignore.lib) gitignoreSource;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,19 +1,21 @@
|
||||||
{ lib, stdenv, callPackage, clojure, jre, writeTextDir, writeShellScript, toEDN
|
{ lib, stdenv, callPackage, clojure, jre, writeText, writeShellScript, toEDN }:
|
||||||
|
{ src, name, group, version, deps-edn, clj-deps, src-paths, build-tools-jar, ...
|
||||||
}:
|
}:
|
||||||
{ src, name, group, version, clj-deps, src-paths, build-tools-jar, ... }:
|
|
||||||
|
|
||||||
with lib;
|
with lib;
|
||||||
let
|
let
|
||||||
build-tools-deps = writeTextDir "deps.edn" (toEDN {
|
build-tools-deps = toEDN {
|
||||||
aliases.build = {
|
aliases.build = {
|
||||||
ns-default = "'build";
|
|
||||||
extra-deps."'io.github.clojure/tools.build"."local/root" =
|
extra-deps."'io.github.clojure/tools.build"."local/root" =
|
||||||
"${build-tools-jar}";
|
''\"${build-tools-jar}\"'';
|
||||||
};
|
};
|
||||||
});
|
};
|
||||||
|
|
||||||
classpath = clj-deps.makeClasspaths { };
|
classpath = clj-deps.makeClasspaths { };
|
||||||
|
|
||||||
|
build-deps = callPackage ./deps.nix { };
|
||||||
|
build-classpath = build-deps.makeClasspaths { };
|
||||||
|
|
||||||
full-name = "${name}-${version}-standalone.jar";
|
full-name = "${name}-${version}-standalone.jar";
|
||||||
|
|
||||||
target = "$TEMP/target";
|
target = "$TEMP/target";
|
||||||
|
@ -24,25 +26,31 @@ let
|
||||||
mkdir -p ${target}
|
mkdir -p ${target}
|
||||||
|
|
||||||
clojure \
|
clojure \
|
||||||
-Scp .:${build-tools-jar}:${classpath} \
|
-Scp ${build-classpath}:${classpath}:${build-tools-jar}:. \
|
||||||
-Sdeps ${build-tools-deps} \
|
-Sdeps "${build-tools-deps}" \
|
||||||
-X:build \
|
-X:build \
|
||||||
lib-uberjar \
|
build/lib-uberjar \
|
||||||
:project ${group}/${name} \
|
:project ${group}/${name} \
|
||||||
:version ${version} \
|
:version ${version} \
|
||||||
:src-dirs ${concatStringsSep "," src-paths} \
|
:src-dirs ${concatStringsSep "," src-paths} \
|
||||||
:target ${target}
|
:target '"${target}"' \
|
||||||
|
:deps-edn '"${deps-edn}"'
|
||||||
|
|
||||||
|
[ $? -eq 0 ] || cat /tmp/*.edn
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
pthru = o: builtins.trace o o;
|
||||||
|
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
name = full-name;
|
name = full-name;
|
||||||
|
|
||||||
src = src;
|
src = src;
|
||||||
|
|
||||||
nativeBuildInputs = [ clojure jre ];
|
nativeBuildInputs = [ clojure jre ];
|
||||||
buildInputs = (map (x: x.paths) clj-deps.packages);
|
buildInputs = (map (x: x.paths) clj-deps.packages)
|
||||||
|
++ (map (x: x.paths) build-deps.packages);
|
||||||
|
|
||||||
buildPhase = "${build-script}";
|
buildPhase = pthru "${build-script}";
|
||||||
|
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
mv ${target}/${name}-${version}-standalone.jar $out
|
mv ${target}/${name}-${version}-standalone.jar $out
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
(ns build
|
(ns build
|
||||||
(:require [clojure.tools.build.api :as b]))
|
(:require [clojure.tools.build.api :as b]
|
||||||
|
[clojure.string :as str]))
|
||||||
|
|
||||||
(defn make-class-dir [target] (format "%s/classes" target))
|
(defn make-class-dir [target] (format "%s/classes" target))
|
||||||
(def basis (b/create-basis {:project "deps.edn"}))
|
(defn make-basis [deps] (b/create-basis {:project deps}))
|
||||||
|
|
||||||
(defonce timestamp
|
|
||||||
(.format (java.time.LocalDateTime/now)
|
|
||||||
java.time.format.DateTimeFormatter/BASIC_ISO_DATE))
|
|
||||||
|
|
||||||
(defonce default-target "./target")
|
(defonce default-target "./target")
|
||||||
(defonce default-srcs ["src"])
|
(defonce default-srcs "src")
|
||||||
|
|
||||||
(defn make-jar-filename [target project version]
|
(defn make-jar-filename [target project version]
|
||||||
(format "%s/%s-%s.jar"
|
(format "%s/%s-%s.jar"
|
||||||
|
@ -25,43 +22,45 @@
|
||||||
params)
|
params)
|
||||||
|
|
||||||
(defn lib-jar
|
(defn lib-jar
|
||||||
[{:keys [project version target srcs]
|
[{:keys [project version target srcs deps-edn]
|
||||||
:or {version timestamp
|
:or {target default-target
|
||||||
target default-target
|
|
||||||
srcs default-srcs}
|
srcs default-srcs}
|
||||||
:as params}]
|
:as params}]
|
||||||
(let [project-sym (symbol project)
|
(let [project-sym (symbol project)
|
||||||
target-jar (make-jar-filename target project version)
|
target-jar (make-jar-filename target project version)
|
||||||
class-dir (make-class-dir target)]
|
class-dir (make-class-dir target)
|
||||||
|
basis (make-basis deps-edn)
|
||||||
|
src-dirs (str/split srcs #",")]
|
||||||
(clean params)
|
(clean params)
|
||||||
(b/copy-dir {:src-dirs srcs})
|
(b/copy-dir {:src-dirs src-dirs})
|
||||||
(b/compile-clj {:basis basis
|
(b/compile-clj {:basis basis
|
||||||
:src-dirs srcs
|
:src-dirs src-dirs
|
||||||
:class-dir class-dir})
|
:class-dir class-dir})
|
||||||
(b/write-pom {:class-dir class-dir
|
(b/write-pom {:class-dir class-dir
|
||||||
:lib project-sym
|
:lib project-sym
|
||||||
:version version
|
:version version
|
||||||
:basis basis
|
:basis basis
|
||||||
:src-dirs srcs})
|
:src-dirs src-dirs})
|
||||||
(b/jar {:class-dir class-dir
|
(b/jar {:class-dir class-dir
|
||||||
:jar-file target-jar})
|
:jar-file target-jar})
|
||||||
(println (format "jar file created at: %s" target-jar)))
|
(println (format "jar file created at: %s" target-jar)))
|
||||||
params)
|
params)
|
||||||
|
|
||||||
(defn lib-uberjar
|
(defn lib-uberjar
|
||||||
[{:keys [project version target srcs]
|
[{:keys [project version target srcs deps-edn]
|
||||||
:or {version timestamp
|
:or {target default-target
|
||||||
target default-target
|
|
||||||
srcs default-srcs}
|
srcs default-srcs}
|
||||||
:as params}]
|
:as params}]
|
||||||
(let [project-sym (symbol project)
|
(let [project-sym (symbol project)
|
||||||
target-uber (jar-filename target project version)
|
target-uber (make-uber-filename target project version)
|
||||||
class-dir (make-class-dir target)]
|
class-dir (make-class-dir target)
|
||||||
|
basis (make-basis deps-edn)
|
||||||
|
src-dirs (str/split srcs #",")]
|
||||||
(clean params)
|
(clean params)
|
||||||
(b/copy-dir {:src-dirs srcs
|
(b/copy-dir {:src-dirs src-dirs
|
||||||
:target-dir class-dir})
|
:target-dir class-dir})
|
||||||
(b/compile-clj {:basis basis
|
(b/compile-clj {:basis basis
|
||||||
:src-dirs srcs
|
:src-dirs src-dirs
|
||||||
:class-dir class-dir})
|
:class-dir class-dir})
|
||||||
(b/uber {:class-dir class-dir
|
(b/uber {:class-dir class-dir
|
||||||
:uber-file target-uber
|
:uber-file target-uber
|
||||||
|
|
Loading…
Reference in New Issue