diff --git a/nix/deps/clojure/README.md b/nix/deps/clojure/README.md index 7f048904a9..5e532669f6 100644 --- a/nix/deps/clojure/README.md +++ b/nix/deps/clojure/README.md @@ -12,12 +12,13 @@ By using the following command: ```sh shadow-cljs classpath --force-spawn ``` -We both download the necessary JARs and POMs into `~/.m2` folder, but also get the classpath printed into standard output. +We download the necessary JARs into `~/.m2` folder, but also get the classpath printed into standard output. +We skip POM files since they are not necessary, and add edge cases we don't want to handle. We then use the classpath in combination with contents of `~/.m2` folder to generate the following files: * `deps.list` - List of JARs relative to the `~/.m2` cache folder. -* `deps.json` - Full list of JARs and POMs including their SHAs. +* `deps.json` - Full list of JARs including their SHAs. The `deps.list` file is just intermediate and for debugging purposes. The `deps.json` is loaded by the derivation in [`default.nix`](./default.nix) and used to produce a derivation that contains all the necessary dependencies: diff --git a/nix/deps/clojure/default.nix b/nix/deps/clojure/default.nix index 0b08a6bb30..9bea02a99a 100644 --- a/nix/deps/clojure/default.nix +++ b/nix/deps/clojure/default.nix @@ -8,9 +8,6 @@ let # load dependencies deps = importJSON ./deps.json; - # some .jar files have an `-aot` suffix that doesn't work for .pom files - getPOM = jarUrl: "${removeSuffix "-aot" jarUrl}.pom"; - script = writeShellScriptBin "create-local-maven-repo" ('' mkdir -p $out cd $out @@ -18,18 +15,11 @@ let (concatMapStrings (dep: let url = "${dep.host}/${dep.path}"; - pom = { - sha1 = attrByPath [ "pom" "sha1" ] "" dep; - sha256 = attrByPath [ "pom" "sha256" ] "" dep; - }; - pom-download = optionalString (pom.sha256 != "") ( - fetchurl { url = getPOM url; inherit (pom) sha256; } - ); jar = { sha1 = attrByPath [ "jar" "sha1" ] "" dep; sha256 = attrByPath [ "jar" "sha256" ] "" dep; }; - jar-download = optionalString (jar.sha256 != "") ( + jarFile = optionalString (jar.sha256 != "") ( fetchurl { url = "${url}.jar"; inherit (jar) sha256; } ); fileName = last (splitString "/" dep.path); @@ -38,14 +28,8 @@ let '' mkdir -p ${directory} - ${optionalString (pom-download != "") '' - ln -s "${pom-download}" "${getPOM dep.path}" - ''} - ${optionalString (pom.sha1 != "") '' - echo "${pom.sha1}" > "${getPOM dep.path}.sha1" - ''} - ${optionalString (jar-download != "") '' - ln -s "${jar-download}" "${dep.path}.jar" + ${optionalString (jarFile != "") '' + ln -s "${jarFile}" "${dep.path}.jar" ''} ${optionalString (jar.sha1 != "") '' echo "${jar.sha1}" > "${dep.path}.jar.sha1" diff --git a/nix/deps/clojure/generate.sh b/nix/deps/clojure/generate.sh index f2dca2397b..42d34f73a7 100755 --- a/nix/deps/clojure/generate.sh +++ b/nix/deps/clojure/generate.sh @@ -53,8 +53,6 @@ function nix_entry_from_jar() { JAR_PATH="${MAVEN_CACHE_PATH}/${JAR_REL_PATH}" JAR_NAME=$(basename "${JAR_PATH}") JAR_DIR=$(dirname "${JAR_PATH}") - # POM might have a slightly different name - POM_PATH=$(echo ${JAR_DIR}/*.pom) REPO_NAME=$(get_repo_for_dir "${JAR_DIR}") REPO_URL=${REPOS[${REPO_NAME}]} @@ -62,18 +60,11 @@ function nix_entry_from_jar() { JAR_SHA1=$(cat "${JAR_PATH}.sha1") JAR_SHA256=$(get_nix_sha "${JAR_PATH}") - POM_SHA1=$(cat "${POM_PATH}.sha1") - POM_SHA256=$(get_nix_sha "${POM_PATH}") - # Format into a Nix attrset entry echo -n " { \"path\": \"${JAR_REL_NAME}\", \"host\": \"${REPO_URL}\", - \"pom\": { - \"sha1\": \"${POM_SHA1}\", - \"sha256\": \"${POM_SHA256}\" - }, \"jar\": { \"sha1\": \"${JAR_SHA1}\", \"sha256\": \"${JAR_SHA256}\"