Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions pkgs/development/compilers/jetbrains-jdk/17.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
libgbm,
wayland,
udev,
fontconfig,
}:

assert debugBuild -> withJcef;
Expand Down Expand Up @@ -59,9 +60,16 @@ openjdk17.overrideAttrs (oldAttrs: rec {
hash = "sha256-a7cJF2iCW/1GK0/GmVbaY5pYcn3YtZy5ngFkyAGRhu0=";
};

BOOT_JDK = openjdk17-bootstrap.home;
# run `git log -1 --pretty=%ct` in jdk repo for new value on update
SOURCE_DATE_EPOCH = 1715809405;
env = {
BOOT_JDK = openjdk17-bootstrap.home;
# run `git log -1 --pretty=%ct` in jdk repo for new value on update
SOURCE_DATE_EPOCH = 1715809405;
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU (toString [
"-Wno-error=format-overflow"
"-Wno-error=template-id-cdtor"
"-Wno-error=calloc-transposed-args"
]);
};

patches = [ ];

Expand All @@ -77,7 +85,7 @@ openjdk17.overrideAttrs (oldAttrs: rec {
-e "s/SOURCE_DATE_EPOCH=.*//" \
-e "s/export SOURCE_DATE_EPOCH//" \
-i jb/project/tools/common/scripts/common.sh
sed -i "s/STATIC_CONF_ARGS/STATIC_CONF_ARGS \$configureFlags/" jb/project/tools/linux/scripts/mkimages_${arch}.sh
substituteInPlace jb/project/tools/linux/scripts/mkimages_${arch}.sh --replace-fail "STATIC_CONF_ARGS" "STATIC_CONF_ARGS ''${configureFlags[*]}"
sed \
-e "s/create_image_bundle \"jb/#/" \
-e "s/echo Creating /exit 0 #/" \
Expand Down Expand Up @@ -133,20 +141,20 @@ openjdk17.overrideAttrs (oldAttrs: rec {
libgbm
wayland
udev
fontconfig
]
}"
for output in $outputs; do
for output in ${lib.concatStringsSep " " oldAttrs.outputs}; do
if [ "$output" = debug ]; then continue; fi
LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort -u | tr '\n' ':'):$LIBDIRS"
done
# Add the local library paths to remove dependencies on the bootstrap
for output in $outputs; do
for output in ${lib.concatStringsSep " " oldAttrs.outputs}; do
if [ "$output" = debug ]; then continue; fi
OUTPUTDIR=$(eval echo \$$output)
BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*)
echo "$BINLIBS" | while read i; do
patchelf --set-rpath "$LIBDIRS:$(patchelf --print-rpath "$i")" "$i" || true
patchelf --shrink-rpath "$i" || true
done
done
'';
Expand Down
30 changes: 22 additions & 8 deletions pkgs/development/compilers/jetbrains-jdk/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
libgbm,
wayland,
udev,
fontconfig,
}:

assert debugBuild -> withJcef;
Expand Down Expand Up @@ -58,9 +59,11 @@ jdk.overrideAttrs (oldAttrs: rec {
hash = "sha256-Neh0PGer4JnNaForBKRlGPLft5cae5GktreyPRNjFCk=";
};

BOOT_JDK = jdk.home;
# run `git log -1 --pretty=%ct` in jdk repo for new value on update
SOURCE_DATE_EPOCH = 1726275531;
env = {
BOOT_JDK = jdk.home;
# run `git log -1 --pretty=%ct` in jdk repo for new value on update
SOURCE_DATE_EPOCH = 1726275531;
};

patches = [ ];

Expand All @@ -76,8 +79,19 @@ jdk.overrideAttrs (oldAttrs: rec {
-e "s/SOURCE_DATE_EPOCH=.*//" \
-e "s/export SOURCE_DATE_EPOCH//" \
-i jb/project/tools/common/scripts/common.sh
configureFlags=$(echo $configureFlags | sed 's/--host=[^ ]*//')
sed -i "s|STATIC_CONF_ARGS|STATIC_CONF_ARGS \$configureFlags|" jb/project/tools/linux/scripts/mkimages_${arch}.sh
declare -a realConfigureFlags
for configureFlag in "''${configureFlags[@]}"; do
case "$configureFlag" in
--host=*)
# intentionally omit flag
;;
*)
realConfigureFlags+=("$configureFlag")
;;
esac
done
echo "computed configure flags: ''${realConfigureFlags[*]}"
substituteInPlace jb/project/tools/linux/scripts/mkimages_${arch}.sh --replace-fail "STATIC_CONF_ARGS" "STATIC_CONF_ARGS ''${realConfigureFlags[*]}"
sed \
-e "s/create_image_bundle \"jb/#/" \
-e "s/echo Creating /exit 0 #/" \
Expand Down Expand Up @@ -133,20 +147,20 @@ jdk.overrideAttrs (oldAttrs: rec {
libgbm
wayland
udev
fontconfig
]
}"
for output in $outputs; do
for output in ${lib.concatStringsSep " " oldAttrs.outputs}; do
if [ "$output" = debug ]; then continue; fi
LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort -u | tr '\n' ':'):$LIBDIRS"
done
# Add the local library paths to remove dependencies on the bootstrap
for output in $outputs; do
for output in ${lib.concatStringsSep " " oldAttrs.outputs}; do
if [ "$output" = debug ]; then continue; fi
OUTPUTDIR=$(eval echo \$$output)
BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*)
echo "$BINLIBS" | while read i; do
patchelf --set-rpath "$LIBDIRS:$(patchelf --print-rpath "$i")" "$i" || true
patchelf --shrink-rpath "$i" || true
done
done
'';
Expand Down
Loading