treewide: JAVA_HOME may not always be defined

This commit is contained in:
John Ericson 2019-11-01 15:30:09 -04:00
parent 45e5e68c53
commit 373236ccff
15 changed files with 17 additions and 17 deletions

View File

@ -37,7 +37,7 @@ let cpuName = stdenv.hostPlatform.parsed.cpu.name;
# Set JAVA_HOME automatically.
cat <<EOF >> $out/nix-support/setup-hook
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
EOF
'';

View File

@ -54,7 +54,7 @@ let result = stdenv.mkDerivation rec {
# Set JAVA_HOME automatically.
cat <<EOF >> "$out/nix-support/setup-hook"
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
EOF
'';

View File

@ -270,7 +270,7 @@ in rec {
# Set JAVA_HOME automatically.
mkdir -p $out/nix-support
cat <<EOF > $out/nix-support/setup-hook
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
EOF
'';
postFixup = openjdk.postFixup or null;

View File

@ -72,7 +72,7 @@ let
# Set JAVA_HOME automatically.
mkdir -p $out/nix-support
cat <<EOF > $out/nix-support/setup-hook
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
EOF
'';

View File

@ -106,7 +106,7 @@ let
# Set JAVA_HOME automatically.
mkdir -p $out/nix-support
cat <<EOF > $out/nix-support/setup-hook
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out/lib/openjdk; fi
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out/lib/openjdk; fi
EOF
'';

View File

@ -231,7 +231,7 @@ let
# Set JAVA_HOME automatically.
mkdir -p $out/nix-support
cat <<EOF > $out/nix-support/setup-hook
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out/lib/openjdk; fi
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out/lib/openjdk; fi
EOF
'';

View File

@ -44,7 +44,7 @@ let
# Set JAVA_HOME automatically.
cat <<EOF >> $out/nix-support/setup-hook
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
EOF
'';

View File

@ -44,7 +44,7 @@ let
# Set JAVA_HOME automatically.
cat <<EOF >> $out/nix-support/setup-hook
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
EOF
'';

View File

@ -44,7 +44,7 @@ let
# Set JAVA_HOME automatically.
cat <<EOF >> $out/nix-support/setup-hook
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
EOF
'';

View File

@ -114,7 +114,7 @@ let
# Set JAVA_HOME automatically.
mkdir -p $out/nix-support
cat <<EOF > $out/nix-support/setup-hook
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out/lib/openjdk; fi
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out/lib/openjdk; fi
EOF
'';

View File

@ -156,7 +156,7 @@ let result = stdenv.mkDerivation rec {
# Set JAVA_HOME automatically.
cat <<EOF >> $out/nix-support/setup-hook
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
EOF
'';

View File

@ -58,7 +58,7 @@ in stdenv.mkDerivation {
# Set JAVA_HOME automatically.
cat <<EOF >> $out/nix-support/setup-hook
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
EOF
'';

View File

@ -55,7 +55,7 @@ in stdenv.mkDerivation {
# Set JAVA_HOME automatically.
cat <<EOF >> $out/nix-support/setup-hook
if [ -z "\$JAVA_HOME" ]; then export JAVA_HOME=$out; fi
if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out; fi
EOF
'';

View File

@ -46,14 +46,14 @@ stdenv.mkDerivation {
# JRE by looking for java. The latter allows just the JRE to be
# used with (say) ECJ as the compiler. Finally, allow the GNU
# JVM.
if [ -z "\$JAVA_HOME" ]; then
if [ -z "\''${JAVA_HOME-}" ]; then
for i in javac java gij; do
if p="\$(type -p \$i)"; then
export JAVA_HOME="\$(${coreutils}/bin/dirname \$(${coreutils}/bin/dirname \$(${coreutils}/bin/readlink -f \$p)))"
break
fi
done
if [ -z "\$JAVA_HOME" ]; then
if [ -z "\''${JAVA_HOME-}" ]; then
echo "\$0: cannot find the JDK or JRE" >&2
exit 1
fi

View File

@ -46,14 +46,14 @@ stdenv.mkDerivation {
# JRE by looking for java. The latter allows just the JRE to be
# used with (say) ECJ as the compiler. Finally, allow the GNU
# JVM.
if [ -z "\$JAVA_HOME" ]; then
if [ -z "\''${JAVA_HOME-}" ]; then
for i in javac java gij; do
if p="\$(type -p \$i)"; then
export JAVA_HOME="\$(${coreutils}/bin/dirname \$(${coreutils}/bin/dirname \$(${coreutils}/bin/readlink -f \$p)))"
break
fi
done
if [ -z "\$JAVA_HOME" ]; then
if [ -z "\''${JAVA_HOME-}" ]; then
echo "\$0: cannot find the JDK or JRE" >&2
exit 1
fi