about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/repository-managers
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/development/tools/repository-managers
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/development/tools/repository-managers')
-rw-r--r--nixpkgs/pkgs/development/tools/repository-managers/nexus/default.nix46
-rw-r--r--nixpkgs/pkgs/development/tools/repository-managers/nexus/nexus-bin.patch54
-rw-r--r--nixpkgs/pkgs/development/tools/repository-managers/nexus/nexus-vm-opts.patch14
3 files changed, 114 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/tools/repository-managers/nexus/default.nix b/nixpkgs/pkgs/development/tools/repository-managers/nexus/default.nix
new file mode 100644
index 000000000000..39e37b217cf3
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/repository-managers/nexus/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchurl, makeWrapper, jre, gawk }:
+
+stdenv.mkDerivation rec {
+  name = "nexus-${version}";
+  version = "3.12.1-01";
+
+  src = fetchurl {
+    url = "https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-${version}-unix.tar.gz";
+    sha256 = "1vv50zv3cr42rq1g16gdl2d1hrxna2jjynlr7kivzlbyfq89ic3f";
+  };
+
+  sourceRoot = name;
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  patches = [ ./nexus-bin.patch ./nexus-vm-opts.patch ];
+
+  postPatch = ''
+    substituteInPlace bin/nexus.vmoptions \
+      --replace etc/karaf $out/etc/karaf \
+      --replace =. =$out
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out
+    cp -rfv * .install4j $out
+    rm -fv $out/bin/nexus.bat
+
+    wrapProgram $out/bin/nexus \
+      --set JAVA_HOME ${jre} \
+      --set ALTERNATIVE_NAME "nexus" \
+      --prefix PATH "${stdenv.lib.makeBinPath [ gawk ]}"
+
+    runHook postInstall
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Repository manager for binary software components";
+    homepage = http://www.sonatype.org/nexus;
+    license = licenses.epl10;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ aespinosa ironpinguin ma27 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/tools/repository-managers/nexus/nexus-bin.patch b/nixpkgs/pkgs/development/tools/repository-managers/nexus/nexus-bin.patch
new file mode 100644
index 000000000000..ce6ecc4a4c94
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/repository-managers/nexus/nexus-bin.patch
@@ -0,0 +1,54 @@
+--- nexus-3.5.1-02/bin/nexus	2017-08-18 17:51:08.000000000 +0200
++++ nexus	2017-08-31 12:41:01.271475645 +0200
+@@ -72,7 +72,7 @@
+   fi
+   db_new_file=${db_file}_new
+   if [ -f "$db_file" ]; then
+-    awk '$1 != "'"$test_dir"'" {print $0}' $db_file > $db_new_file
++    awk '$1 != "'"$test_dir"'" {print $scriptname}' $db_file > $db_new_file
+     rm "$db_file"
+     mv "$db_new_file" "$db_file"
+   fi
+@@ -236,7 +236,7 @@
+ 
+ unpack_file() {
+   if [ -f "$1" ]; then
+-    jar_file=`echo "$1" | awk '{ print substr($0,1,length-5) }'`
++    jar_file=`echo "$1" | awk '{ print substr($scriptname,1,length-5) }'`
+     bin/unpack200 -r "$1" "$jar_file"
+ 
+     if [ $? -ne 0 ]; then
+@@ -360,8 +360,14 @@
+ 
+ old_pwd=`pwd`
+ 
+-progname=`basename "$0"`
+-linkdir=`dirname "$0"`
++scriptname=$0
++
++if [ ! -z "$ALTERNATIVE_NAME" ]; then
++  scriptname=`dirname "$0"`"/"$ALTERNATIVE_NAME
++fi
++
++progname=`basename "$scriptname"`
++linkdir=`dirname "$scriptname"`
+ 
+ cd "$linkdir"
+ prg="$progname"
+@@ -522,7 +528,6 @@
+ 
+ $INSTALL4J_JAVA_PREFIX nohup "$app_java_home/bin/java" -server -Dinstall4j.jvmDir="$app_java_home" -Dexe4j.moduleName="$prg_dir/$progname" "-XX:+UnlockDiagnosticVMOptions" "-Dinstall4j.launcherId=245" "-Dinstall4j.swt=false" "$vmov_1" "$vmov_2" "$vmov_3" "$vmov_4" "$vmov_5" $INSTALL4J_ADD_VM_PARAMS -classpath "$local_classpath" com.install4j.runtime.launcher.UnixLauncher start 9d17dc87 "" "" org.sonatype.nexus.karaf.NexusMain  > /dev/null 2>&1 &
+ 
+-
+     ;;
+     start-launchd)
+         echo "Starting nexus"
+@@ -569,7 +574,7 @@
+ 
+     ;;
+     *)
+-        echo "Usage: $0 {start|stop|run|run-redirect|status|restart|force-reload}"
++        echo "Usage: $scriptname {start|stop|run|run-redirect|status|restart|force-reload}"
+         exit 1
+     ;;
+ esac
diff --git a/nixpkgs/pkgs/development/tools/repository-managers/nexus/nexus-vm-opts.patch b/nixpkgs/pkgs/development/tools/repository-managers/nexus/nexus-vm-opts.patch
new file mode 100644
index 000000000000..744b4b96a56b
--- /dev/null
+++ b/nixpkgs/pkgs/development/tools/repository-managers/nexus/nexus-vm-opts.patch
@@ -0,0 +1,14 @@
+diff --git a/bin/nexus b/bin/nexus
+index e7ed3fb..8db766b 100755
+--- a/bin/nexus
++++ b/bin/nexus
+@@ -440,7 +440,8 @@ add_class_path "$app_home/lib/boot/org.apache.karaf.diagnostic.boot-4.0.9.jar"
+ add_class_path "$app_home/lib/boot/org.apache.karaf.jaas.boot-4.0.9.jar"
+ 
+ vmoptions_val=""
+-read_vmoptions "$prg_dir/$progname.vmoptions"
++VM_OPTS=${VM_OPTS_FILE:-"$prg_dir/$progname.vmoptions"}
++read_vmoptions "$VM_OPTS"
+ INSTALL4J_ADD_VM_PARAMS="$INSTALL4J_ADD_VM_PARAMS $vmoptions_val"
+ 
+