Skip to content

Commit

Permalink
treewide: JAVA_HOME may not always be defined
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Nov 1, 2019
1 parent 45e5e68 commit 373236c
Show file tree
Hide file tree
Showing 15 changed files with 17 additions and 17 deletions.
Expand Up @@ -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
'';

Expand Down
Expand Up @@ -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
'';

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/graalvm/default.nix
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/graalvm/enterprise-edition.nix
Expand Up @@ -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
'';

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/openjdk/11.nix
Expand Up @@ -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
'';

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/openjdk/8.nix
Expand Up @@ -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
'';

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/openjdk/darwin/11.nix
Expand Up @@ -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
'';

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/openjdk/darwin/8.nix
Expand Up @@ -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
'';

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/openjdk/darwin/default.nix
Expand Up @@ -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
'';

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/openjdk/default.nix
Expand Up @@ -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
'';

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
Expand Up @@ -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
'';

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/zulu/8.nix
Expand Up @@ -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
'';

Expand Down
2 changes: 1 addition & 1 deletion pkgs/development/compilers/zulu/default.nix
Expand Up @@ -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
'';

Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/tools/build-managers/apache-ant/1.9.nix
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/tools/build-managers/apache-ant/default.nix
Expand Up @@ -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
Expand Down

0 comments on commit 373236c

Please sign in to comment.