Change:
Package name: nexus Latest released version: 3.69.0 <!-- Search your package here: --- Current version on the unstable channel: 3.68.1-02 Current version on the stable/release channel: 3.68.1-02 <!-- Type the name of your package and try to find an open pull request for the package If you find an open pull request, you can review it! There's a high chance that you'll have the new version right away while helping the community! --- Notify maintainers <!-- If the result shows no maintainers, tag the person that last updated the package. --Note for maintainers: Please tag this issue in your PR. Add a :+1: [reaction] to [issues you find important]. [reaction]: [issues you find important]:

Discussion:
<ins> diff --git a/bin/nexus b/bin/nexus index d06cb44..37c606e 100755 --- a/bin/nexus +++ b/bin/nexus @@ -88,7 +88,7 @@ create_db_entry() { fi db_new_file=${db_file}_new if [ -f "$db_file" ]; then -    awk '$2 != "'"$test_dir"'" {print $0}' $db_file > $db_new_file +    awk '$2 != "'"$test_dir"'" {print $scriptname}' $db_file > $db_new_file rm "$db_file" mv "$db_new_file" "$db_file" fi @@ -246,7 +246,7 @@ read_vmoptions() { 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 @@ -377,9 +377,14 @@ fi 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" @@ -590,7 +595,7 @@ return_code=$? ;; *) -        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 </ins>

<ins> 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" </ins>

<ins> { lib, stdenv, fetchurl, makeWrapper, jre_headless, gawk, }: stdenv.mkDerivation rec { pname = "nexus"; version = "3.69.0-02"; src = fetchurl { url = "https://download.sonatype.com/nexus/3/nexus-${version}-unix.tar.gz"; hash = "sha256-7sgLPuM93mFEPlTd3qJY+FGVHErvgcTGJWwSBcqBgWI="; }; preferLocalBuild = true; sourceRoot = "${pname}-${version}"; nativeBuildInputs = [ makeWrapper ]; patches = [ ./nexus-bin.patch ./nexus-vm-opts.patch ]; postPatch = '' substituteInPlace bin/nexus.vmoptions  --replace-fail ../sonatype-work /var/lib/sonatype-work  --replace-fail etc/karaf $out/etc/karaf  --replace-fail =. =$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_headless}  --set ALTERNATIVE_NAME "nexus"  --prefix PATH "${lib.makeBinPath [ gawk ]}" runHook postInstall ''; meta = { description = "Repository manager for binary software components"; homepage = "https://www.sonatype.com/products/sonatype-nexus-oss"; sourceProvenance = with lib.sourceTypes; [ binaryBytecode ]; license = lib.licenses.epl10; platforms = lib.platforms.all; maintainers = with lib.maintainers; [ aespinosa ironpinguin luftmensch-luftmensch zaninime ]; }; } </ins>

<del> { lib, stdenv, fetchurl, makeWrapper, jre_headless, gawk }: stdenv.mkDerivation rec { pname = "nexus"; version = "3.68.1-02"; src = fetchurl { url = "https://download.sonatype.com/nexus/3/nexus-${version}-unix.tar.gz"; hash = "sha256-VHS4KDFgU3djteDzDAe43TZIwRG/8bb7u3usoOCJS5M="; }; preferLocalBuild = true; sourceRoot = "${pname}-${version}"; nativeBuildInputs = [ makeWrapper ]; patches = [ ./nexus-bin.patch ./nexus-vm-opts.patch ]; postPatch = '' substituteInPlace bin/nexus.vmoptions  --replace ../sonatype-work /var/lib/sonatype-work  --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_headless}  --set ALTERNATIVE_NAME "nexus"  --prefix PATH "${lib.makeBinPath [ gawk ]}" runHook postInstall ''; meta = with lib; { description = "Repository manager for binary software components"; homepage = "https://www.sonatype.com/products/sonatype-nexus-oss"; sourceProvenance = with sourceTypes; [ binaryBytecode ]; license = licenses.epl10; platforms = platforms.all; maintainers = with maintainers; [ aespinosa ironpinguin zaninime ]; }; } </del>

<del> diff --git a/bin/nexus b/bin/nexus index d06cb44..37c606e 100755 --- a/bin/nexus +++ b/bin/nexus @@ -88,7 +88,7 @@ create_db_entry() { fi db_new_file=${db_file}_new if [ -f "$db_file" ]; then -    awk '$2 != "'"$test_dir"'" {print $0}' $db_file > $db_new_file +    awk '$2 != "'"$test_dir"'" {print $scriptname}' $db_file > $db_new_file rm "$db_file" mv "$db_new_file" "$db_file" fi @@ -246,7 +246,7 @@ read_vmoptions() { 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 @@ -377,9 +377,14 @@ fi 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" @@ -590,7 +595,7 @@ return_code=$? ;; *) -        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 </del>

<del> 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" </del>

nix-build-uncached = callPackage ../development/tools/misc/nix-build-uncached { }; <del> nexus = callPackage ../development/tools/repository-managers/nexus { jre_headless = jre8_headless; }; </del> nexusmods-app-unfree = callPackage ../by-name/ne/nexusmods-app/package.nix { enableUnfree = true; };