mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-26 00:43:20 +00:00
Build support
This commit is contained in:
parent
870fc84412
commit
d849c0e2e1
@ -396,4 +396,9 @@ rec {
|
||||
https://archive.mozilla.org/pub/
|
||||
];
|
||||
|
||||
# Maven Central
|
||||
maven = [
|
||||
http://repo1.maven.org/maven2
|
||||
http://central.maven.org/maven2
|
||||
];
|
||||
}
|
||||
|
26
pkgs/development/java-modules/build-maven-package.nix
Normal file
26
pkgs/development/java-modules/build-maven-package.nix
Normal file
@ -0,0 +1,26 @@
|
||||
{ stdenv, maven, lib }:
|
||||
{ mavenDeps, src, name, meta, m2Path, ... }:
|
||||
|
||||
with builtins;
|
||||
with lib;
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
inherit mavenDeps src name meta m2Path;
|
||||
|
||||
flatDeps = flatten mavenDeps;
|
||||
|
||||
propagatedBuildInput = [ maven ] ++ flatDeps;
|
||||
|
||||
find = ''find ${foldl' (x: y: x + " " + y) "" (map (x: x + "/m2/") flatDeps)} -type d -printf '%P\n' | xargs -I {} mkdir -p $out/m2/{}'';
|
||||
copy = ''cp -rs ${foldl' (x: y: x + " " + y) "" (map (x: x + "/m2/*") flatDeps)} $out/m2'';
|
||||
|
||||
buildPhase = ''
|
||||
mkdir -p $out/m2/${m2Path}
|
||||
${optionalString (length flatDeps > 0) find}
|
||||
${optionalString (length flatDeps > 0) copy}
|
||||
echo "<settings><mirrors>\
|
||||
<mirror><id>tmpm2</id><url>file://$out/m2</url><mirrorOf>*</mirrorOf></mirror></mirrors>\
|
||||
<localRepository>$out/m2</localRepository></settings>" >> $out/m2/settings.xml
|
||||
${maven}/bin/mvn clean install -Dmaven.test.skip=true -gs $out/m2/settings.xml
|
||||
'';
|
||||
}
|
21
pkgs/development/java-modules/m2install.nix
Normal file
21
pkgs/development/java-modules/m2install.nix
Normal file
@ -0,0 +1,21 @@
|
||||
{ stdenv, fetchurl }:
|
||||
{ version, baseName, package, sha512, type ? "jar" }:
|
||||
|
||||
let
|
||||
name = "${baseName}-${version}";
|
||||
m2Path = "${package}/${baseName}/${version}";
|
||||
m2File = "${name}.${type}";
|
||||
src = fetchurl rec {
|
||||
inherit sha512;
|
||||
url = "mirror://maven/${m2Path}/${m2File}";
|
||||
};
|
||||
in stdenv.mkDerivation rec {
|
||||
inherit name m2Path m2File src;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/m2/$m2Path
|
||||
cp $src $out/m2/$m2Path/$m2File
|
||||
'';
|
||||
|
||||
phases = "installPhase";
|
||||
}
|
@ -9761,6 +9761,10 @@ in
|
||||
|
||||
leaps = callPackage ../development/tools/leaps { };
|
||||
|
||||
### DEVELOPMENT / JAVA MODULES
|
||||
|
||||
javaPackages = recurseIntoAttrs (callPackage ./java-packages.nix { });
|
||||
|
||||
### DEVELOPMENT / LISP MODULES
|
||||
|
||||
asdf = callPackage ../development/lisp-modules/asdf {
|
||||
|
Loading…
Reference in New Issue
Block a user