···31313232 dontConfigure = true;
33333434- postPatch = ''
3434+ postPatch = let
3535+ extra_config = builtins.concatStringsSep " " extraConfig;
3636+ in ''
3537 # The rpm/deb task definitions require a Gradle plugin which we don't
3638 # have and so the build fails. We'll simply remove them here because
3739 # they are not needed anyways.
···4143 for file in $(find installers -name "build.gradle"); do
4244 substituteInPlace $file --replace-warn "workingDir '/usr/bin'" "workingDir '.'"
4345 done
4444- '';
4545-46464747- buildPhase =
4848- let
4949- # The Linux installer is placed at linux/universal/tar whereas the MacOS
5050- # one is at mac/tar.
5151- task =
5252- if stdenv.isDarwin then
5353- ":installers:mac:tar:packageBuildResults"
5454- else ":installers:linux:universal:tar:packageBuildResults";
5555- extra_config = builtins.concatStringsSep " " extraConfig;
5656- in
5757- ''
5858- runHook preBuild
4747+ gradleFlagsArray+=(-Pcorretto.extra_config="${extra_config}")
4848+ '';
59496060- # Corretto's actual built is triggered via `gradle`.
6161- gradle -Pcorretto.extra_config="${extra_config}" --console=plain --no-daemon ${task}
5050+ # since we dontConfigure, we must run this manually
5151+ preBuild = "gradleConfigureHook";
62526363- # Prepare for the installPhase so that it looks like if a normal
6464- # OpenJDK had been built.
6565- dir=build/jdkImageName/images
6666- mkdir -p $dir
6767- file=$(find ./installers -name 'amazon-corretto-${version}*.tar.gz')
6868- tar -xzf $file -C $dir
6969- mv $dir/amazon-corretto-* $dir/jdk
5353+ # The Linux installer is placed at linux/universal/tar whereas the MacOS
5454+ # one is at mac/tar.
5555+ gradleBuildTask =
5656+ if stdenv.isDarwin then
5757+ ":installers:mac:tar:build"
5858+ else ":installers:linux:universal:tar:packageBuildResults";
70597171- runHook postBuild
7272- '';
6060+ postBuild = ''
6161+ # Prepare for the installPhase so that it looks like if a normal
6262+ # OpenJDK had been built.
6363+ dir=build/jdkImageName/images
6464+ mkdir -p $dir
6565+ file=$(find ./installers -name 'amazon-corretto-${version}*.tar.gz')
6666+ tar -xzf $file -C $dir
6767+ mv $dir/amazon-corretto-* $dir/jdk
6868+ '' + oldAttrs.postBuild or "";
73697470 installPhase = oldAttrs.installPhase + ''
7571 # The installPhase will place everything in $out/lib/openjdk and