Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

nexus: 2.12.0-01 -> 3.5.1-02

Update Nexus to version 3.5.1-02 and fix startup stript to run in nix
environment.

authored by

Michele Catalano and committed by
Robin Gloster
e783c2b3 11cd027b

+85 -12
+31 -12
pkgs/development/tools/repository-managers/nexus/default.nix
··· 1 - { stdenv, fetchurl, makeWrapper, jre }: 2 stdenv.mkDerivation rec { 3 name = "nexus-${version}"; 4 - version = "2.12.0-01"; 5 6 src = fetchurl { 7 - url = "https://sonatype-download.global.ssl.fastly.net/nexus/oss/nexus-${version}-bundle.tar.gz"; 8 - sha256 = "1k3z7kwcmr1pxaxfnak99fq5s8br9zbqbfpyw1afi86ykkph4g5z"; 9 }; 10 11 sourceRoot = name; 12 13 - buildInputs = [ makeWrapper ]; 14 15 - installPhase = 16 - '' 17 - mkdir -p $out 18 - cp -rfv * $out 19 - rm -fv $out/bin/nexus.bat 20 - ''; 21 22 meta = with stdenv.lib; { 23 description = "Repository manager for binary software components"; 24 homepage = http://www.sonatype.org/nexus; 25 license = licenses.epl10; 26 platforms = platforms.all; 27 - maintainers = [ maintainers.aespinosa ]; 28 }; 29 }
··· 1 + { stdenv, fetchurl, makeWrapper, jre, gawk }: 2 stdenv.mkDerivation rec { 3 name = "nexus-${version}"; 4 + version = "3.5.1-02"; 5 6 src = fetchurl { 7 + url = "https://sonatype-download.global.ssl.fastly.net/nexus/3/nexus-${version}-mac.tgz"; 8 + sha256 = "5ef3512c2bbdd45ef35921c1a0ba109b45bd9dad88311750196aa689262258b6"; 9 }; 10 11 sourceRoot = name; 12 13 + nativeBuildInputs = [ makeWrapper ]; 14 + 15 + patches = [ ./nexus-bin.patch ]; 16 + 17 + postPatch = '' 18 + substituteInPlace bin/nexus.vmoptions \ 19 + --replace ../sonatype-work/nexus3 /run/sonatype-work/nexus3 \ 20 + --replace etc/karaf $out/etc/karaf \ 21 + --replace =. =$out 22 + ''; 23 + 24 + installPhase = '' 25 + runHook preInstall 26 + 27 + mkdir -p $out 28 + cp -rfv * .install4j $out 29 + rm -fv $out/bin/nexus.bat 30 + 31 + runHook postInstall 32 + ''; 33 34 + postInstall = '' 35 + wrapProgram $out/bin/nexus \ 36 + --set JAVA_HOME ${jre} \ 37 + --set ALTERNATIVE_NAME "nexus" \ 38 + --prefix PATH "${stdenv.lib.makeBinPath [ gawk ]}" 39 + ''; 40 41 meta = with stdenv.lib; { 42 description = "Repository manager for binary software components"; 43 homepage = http://www.sonatype.org/nexus; 44 license = licenses.epl10; 45 platforms = platforms.all; 46 + maintainers = with maintainers; [ aespinosa ironpinguin ]; 47 }; 48 }
+54
pkgs/development/tools/repository-managers/nexus/nexus-bin.patch
···
··· 1 + --- nexus-3.5.1-02/bin/nexus 2017-08-18 17:51:08.000000000 +0200 2 + +++ nexus 2017-08-31 12:41:01.271475645 +0200 3 + @@ -72,7 +72,7 @@ 4 + fi 5 + db_new_file=${db_file}_new 6 + if [ -f "$db_file" ]; then 7 + - awk '$1 != "'"$test_dir"'" {print $0}' $db_file > $db_new_file 8 + + awk '$1 != "'"$test_dir"'" {print $scriptname}' $db_file > $db_new_file 9 + rm "$db_file" 10 + mv "$db_new_file" "$db_file" 11 + fi 12 + @@ -236,7 +236,7 @@ 13 + 14 + unpack_file() { 15 + if [ -f "$1" ]; then 16 + - jar_file=`echo "$1" | awk '{ print substr($0,1,length-5) }'` 17 + + jar_file=`echo "$1" | awk '{ print substr($scriptname,1,length-5) }'` 18 + bin/unpack200 -r "$1" "$jar_file" 19 + 20 + if [ $? -ne 0 ]; then 21 + @@ -360,8 +360,14 @@ 22 + 23 + old_pwd=`pwd` 24 + 25 + -progname=`basename "$0"` 26 + -linkdir=`dirname "$0"` 27 + +scriptname=$0 28 + + 29 + +if [ ! -z "$ALTERNATIVE_NAME" ]; then 30 + + scriptname=`dirname "$0"`"/"$ALTERNATIVE_NAME 31 + +fi 32 + + 33 + +progname=`basename "$scriptname"` 34 + +linkdir=`dirname "$scriptname"` 35 + 36 + cd "$linkdir" 37 + prg="$progname" 38 + @@ -522,7 +528,6 @@ 39 + 40 + $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 & 41 + 42 + - 43 + ;; 44 + start-launchd) 45 + echo "Starting nexus" 46 + @@ -569,7 +574,7 @@ 47 + 48 + ;; 49 + *) 50 + - echo "Usage: $0 {start|stop|run|run-redirect|status|restart|force-reload}" 51 + + echo "Usage: $scriptname {start|stop|run|run-redirect|status|restart|force-reload}" 52 + exit 1 53 + ;; 54 + esac