summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorShea Levy <shea@shealevy.com>2015-07-08 06:24:55 -0400
committerShea Levy <shea@shealevy.com>2015-07-08 06:25:07 -0400
commita5a8bad0e6b7af11ec25dd34a5dba16fef6c5faa (patch)
treea02ba45846f3e26eacce6cbbf2fa452eaf1fbab7 /pkgs/build-support
parente987d1c1e32d877d3d214165991a87bc81833c30 (diff)
downloadnixpkgs-a5a8bad0e6b7af11ec25dd34a5dba16fef6c5faa.tar
nixpkgs-a5a8bad0e6b7af11ec25dd34a5dba16fef6c5faa.tar.gz
nixpkgs-a5a8bad0e6b7af11ec25dd34a5dba16fef6c5faa.tar.bz2
nixpkgs-a5a8bad0e6b7af11ec25dd34a5dba16fef6c5faa.tar.lz
nixpkgs-a5a8bad0e6b7af11ec25dd34a5dba16fef6c5faa.tar.xz
nixpkgs-a5a8bad0e6b7af11ec25dd34a5dba16fef6c5faa.tar.zst
nixpkgs-a5a8bad0e6b7af11ec25dd34a5dba16fef6c5faa.zip
buildMaven: Handle authenticated repos
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/build-maven.nix8
1 files changed, 5 insertions, 3 deletions
diff --git a/pkgs/build-support/build-maven.nix b/pkgs/build-support/build-maven.nix
index 26be7d2aebb..646b3243583 100644
--- a/pkgs/build-support/build-maven.nix
+++ b/pkgs/build-support/build-maven.nix
@@ -1,4 +1,4 @@
-{ stdenv, maven, runCommand, writeText, fetchurl, lib }:
+{ stdenv, maven, runCommand, writeText, fetchurl, lib, requireFile }:
 /* Takes an info file generated by mvn2nix
  * (https://github.com/NixOS/mvn2nix-maven-plugin) and builds the maven
  * project with it.
@@ -15,9 +15,11 @@ infoFile: let
 
   script = writeText "build-maven-repository.sh" ''
     ${lib.concatStrings (map (dep: let
-      inherit (dep) url sha1 groupId artifactId version;
+      inherit (dep) url sha1 groupId artifactId version authenticated;
 
-      fetch = fetchurl { inherit url sha1; };
+      fetch = (if authenticated then requireFile else fetchurl) {
+        inherit url sha1;
+      };
     in ''
       dir=$out/$(echo ${groupId} | sed 's|\.|/|g')/${artifactId}/${version}
       mkdir -p $dir