Move to using a lockfile
This is easier to work with (after I figured out how to use mvn2nix…) and probably much faster too.
This commit is contained in:
17594
mvn2nix-lock.json
Normal file
17594
mvn2nix-lock.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,25 +1,16 @@
|
|||||||
# Downloads various dependencies for the openhab build.
|
# Downloads various dependencies for the openhab build.
|
||||||
{ lib, stdenv, maven, openhab-distro }:
|
{ lib, stdenv, maven, openhab-distro, fetchurl, linkFarm }:
|
||||||
stdenv.mkDerivation {
|
|
||||||
pname = "openhab-repository";
|
|
||||||
version = openhab-distro.shortRev;
|
|
||||||
nativeBuildInputs = [ maven ];
|
|
||||||
src = openhab-distro;
|
|
||||||
|
|
||||||
buildPhase = ''
|
let
|
||||||
mvn -B -T 128 -Drelease -Dmaven.repo.local="$out" package
|
dependencies = (builtins.fromJSON (builtins.readFile ./mvn2nix-lock.json )).dependencies;
|
||||||
'';
|
dependenciesAsDrv = (lib.forEach (lib.attrValues dependencies) (dependency: {
|
||||||
|
drv = fetchurl {
|
||||||
installPhase = ''
|
url = dependency.url;
|
||||||
# Delete all ephemeral files with lastModified timestamps inside
|
sha256 = dependency.sha256;
|
||||||
find "$out" -type f '(' \
|
};
|
||||||
-name '*.lastUpdated' -or \
|
layout = dependency.layout;
|
||||||
-name 'resolver-status.properties' -or \
|
}));
|
||||||
-name '_remote.repositories' ')' -delete
|
in linkFarm "openhab-repository" (lib.forEach dependenciesAsDrv (dependency: {
|
||||||
'';
|
name = dependency.layout;
|
||||||
|
path = dependency.drv;
|
||||||
dontFixup = true;
|
}))
|
||||||
outputHashAlgo = "sha256";
|
|
||||||
outputHashMode = "recursive";
|
|
||||||
outputHash = builtins.readFile ./openhab-repository.sha256;
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user