-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove mavenix + unused old nix infrastructure (#923)
Co-authored-by: Bruce Collie <[email protected]>
- Loading branch information
1 parent
87eefda
commit e8c7319
Showing
13 changed files
with
144 additions
and
5,839 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
{ lib, stdenv, maven }: | ||
|
||
{ src, sourceRoot ? null, buildOffline ? false, patches ? [ ], pname, version | ||
, mvnHash ? "", mvnFetchExtraArgs ? { }, mvnDepsParameters ? "" | ||
, manualMvnArtifacts ? [ ], mvnParameters ? "", ... }@args: | ||
|
||
# originally extracted from dbeaver | ||
# created to allow using maven packages in the same style as rust | ||
|
||
let | ||
fetchedMavenDeps = stdenv.mkDerivation ({ | ||
name = "${pname}-${version}-maven-deps"; | ||
inherit src sourceRoot patches; | ||
|
||
nativeBuildInputs = [ maven ]; | ||
|
||
buildPhase = '' | ||
runHook preBuild | ||
'' + lib.optionalString buildOffline '' | ||
mvn org.apache.maven.plugins:maven-dependency-plugin:3.6.1:go-offline -Dmaven.repo.local=$out/.m2 ${mvnDepsParameters} | ||
for artifactId in ${builtins.toString manualMvnArtifacts} | ||
do | ||
echo "downloading manual $artifactId" | ||
mvn dependency:get -Dartifact="$artifactId" -Dmaven.repo.local=$out/.m2 | ||
done | ||
'' + lib.optionalString (!buildOffline) '' | ||
mvn package -Dmaven.repo.local=$out/.m2 ${mvnParameters} | ||
'' + '' | ||
runHook postBuild | ||
''; | ||
|
||
# keep only *.{pom,jar,sha1,nbm} and delete all ephemeral files with lastModified timestamps inside | ||
installPhase = '' | ||
runHook preInstall | ||
find $out -type f \( \ | ||
-name \*.lastUpdated \ | ||
-o -name resolver-status.properties \ | ||
-o -name _remote.repositories \ | ||
-o -name \*.snapshots.xml \ | ||
-o -name \*.snapshots.xml.sha1 \) \ | ||
-delete | ||
# delete any empty directories | ||
find . -type d -empty -delete | ||
runHook postInstall | ||
''; | ||
|
||
# don't do any fixup | ||
dontFixup = true; | ||
outputHashAlgo = if mvnHash != "" then null else "sha256"; | ||
outputHashMode = "recursive"; | ||
outputHash = mvnHash; | ||
} // mvnFetchExtraArgs); | ||
in stdenv.mkDerivation (builtins.removeAttrs args [ "mvnFetchExtraArgs" ] // { | ||
inherit fetchedMavenDeps; | ||
|
||
nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [ maven ]; | ||
|
||
buildPhase = '' | ||
runHook preBuild | ||
mvnDeps=$(cp -dpR ${fetchedMavenDeps}/.m2 ./ && chmod +w -R .m2 && pwd) | ||
mvn package -o -nsu "-Dmaven.repo.local=$mvnDeps/.m2" ${mvnParameters} | ||
runHook postBuild | ||
''; | ||
|
||
meta = args.meta or { } // { | ||
platforms = args.meta.platforms or maven.meta.platforms; | ||
}; | ||
}) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.