Skip to content

Commit

Permalink
fix selector for win and build order (x libs only in graphics)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfouret committed Feb 11, 2025
1 parent 1156a70 commit 0456805
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 33 deletions.
12 changes: 6 additions & 6 deletions recipes/temurin-jre/bld.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ if not exist "%PREFIX%\opt" mkdir "%PREFIX%\opt"
if not exist "%PREFIX%\opt\temurin" mkdir "%PREFIX%\opt\temurin"

echo "Moving files to temurin directory..."
move bin "%PREFIX%\opt\temurin\"
move conf "%PREFIX%\opt\temurin\"
move legal "%PREFIX%\opt\temurin\"
move lib "%PREFIX%\opt\temurin\"
move NOTICE "%PREFIX%\opt\temurin\"
move release "%PREFIX%\opt\temurin\"
xcopy /e /k /h /i bin "%PREFIX%\opt\temurin\"
xcopy /e /k /h /i conf "%PREFIX%\opt\temurin\"
xcopy /e /k /h /i legal "%PREFIX%\opt\temurin\"
xcopy /e /k /h /i lib "%PREFIX%\opt\temurin\"
xcopy /e /k /h /i NOTICE "%PREFIX%\opt\temurin\"
xcopy /e /k /h /i release "%PREFIX%\opt\temurin\"

echo "Create bin directory if it doesn't exist"
if not exist "%PREFIX%\bin" mkdir "%PREFIX%\bin"
Expand Down
5 changes: 5 additions & 0 deletions recipes/temurin-jre/bld_graphics.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

xcopy /k lib\libawt_xawt.so "%PREFIX%\opt\temurin\lib\"
xcopy /k lib\libsplashscreen.so "%PREFIX%\opt\temurin\lib\"
xcopy /k lib\libjsound.so "%PREFIX%\opt\temurin\lib\"
xcopy /k lib\libjawt.so "%PREFIX%\opt\temurin\lib\"
7 changes: 7 additions & 0 deletions recipes/temurin-jre/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ do
done

echo "Creating symlinks"
mkdir -p ${PREFIX}/bin
ln -sf ${PREFIX}/opt/temurin/bin/java ${PREFIX}/bin/java


Expand All @@ -49,3 +50,9 @@ echo "JAVA_HOME: ${JAVA_HOME}"
echo "Creating CDS archive..."

java -Xshare:dump

# Remove x11 related libs
rm ${PREFIX}/opt/temurin/lib/libawt_xawt.so
rm ${PREFIX}/opt/temurin/lib/libsplashscreen.so
rm ${PREFIX}/opt/temurin/lib/libjsound.so
rm ${PREFIX}/opt/temurin/lib/libjawt.so
17 changes: 17 additions & 0 deletions recipes/temurin-jre/build_graphics.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

echo "Setting Archive Path"
if [ "$(uname -s)" == "Darwin" ]
then
ARCHIVE_PATH="Contents/Home/"
else
ARCHIVE_PATH=""
fi

echo "... set to '$ARCHIVE_PATH'"

echo "Copying java files"
for ITEM in libawt_xawt libsplashscreen libjsound libjawt
do
echo "... item $ITEM"
cp ${ARCHIVE_PATH}lib/${ITEM}.so ${PREFIX}/opt/temurin/lib/
done
69 changes: 42 additions & 27 deletions recipes/temurin-jre/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
{% set build_number = version.split('+')[1] %}
{% set base_url = 'https://github.com/adoptium/temurin' + version_major + '-binaries/releases/download/jdk-' + version_base + '%2B' + build_number + '/OpenJDK' + version_major + 'U-jre_' %}
{% set end_url = "_hotspot_" + version.replace('+', '_') %}

{% set name = "temurin-jre" %}

package:
Expand All @@ -25,17 +24,52 @@ source:
sha256: "a4b0015872758aac6a5d17139e952a3951ee536ae6d9a99828823a80a71add56" # [linux and x86_64]
- url: "{{ base_url }}x64_mac{{ end_url }}.tar.gz" # [osx and x86_64]
sha256: "f2c7454f7aba076cd414887b31da92e4a50fda7a13d97f6e295c911af60de0b6" # [osx and x86_64]
- url: "{{ base_url }}x64_windows{{ end_url }}.zip" # [win and x86_64]
sha256: "d42f84605c8e27c38998b44ac493d1067abbe45be89969c935d71a858393405c" # [win and x86_64]
- url: "{{ base_url }}x86-32_windows{{ end_url }}.zip" # [win32 and x86]
sha256: "b4c418fd053fd85decacb124c9e84c94fee3bbec3999451132227d4bb6fd82cb" # [win32 and x86]
- url: "{{ base_url }}x64_windows{{ end_url }}.zip" # [win64]
sha256: "d42f84605c8e27c38998b44ac493d1067abbe45be89969c935d71a858393405c" # [win64]
- url: "{{ base_url }}x86-32_windows{{ end_url }}.zip" # [win32]
sha256: "b4c418fd053fd85decacb124c9e84c94fee3bbec3999451132227d4bb6fd82cb" # [win32]

build:
number: 0
ignore_run_exports:
- sysroot_linux-64
missing_dso_whitelist:
- "*/libfreetype.so.6" # freetype
- "*/libc.so.6" # glibc/libc6
- "*/libdl.so.2" # glibc/libc6
- "*/libm.so.6" # glibc/libc6
- "*/libpthread.so.0" # glibc/libc6
- "*/librt.so.1" # glibc/libc6
- "*/ld-linux-x86-64.so.2" # glibc/libc6
- "*/libutil.so.1" # glibc/libc6
- "*/libX11.so.6" # xorg-libx11
- "*/libXext.so.6" # xorg-libxext
- "*/libasound.so.2" # alsa-lib
- "*/libXi.so.6" # xorg-libxi
- "*/libXrender.so.1" # xorg-libxrender
- "*/libXtst.so.6" # xorg-libxtst
rpaths:
- opt/temurin/lib/server
- opt/temurin/lib
- opt/temurin/bin

outputs:
- name: {{ name|lower }}
requirements:
run:
- {{ stdlib('c') }}
- freetype
- name: {{ name|lower }}-headless
requirements:
run:
- {{ pin_subpackage(name|lower, exact=True) }}
test:
commands:
- java -version
- name: {{ name|lower }}-graphics
build:
script: bash $RECIPE_DIR/build_graphics.sh # [linux or osx]
script: batch %RECIPE_DIR%\build_graphics.bat # [win]
number: 0
ignore_run_exports:
- sysroot_linux-64
Expand All @@ -54,32 +88,13 @@ outputs:
- "*/libXi.so.6" # xorg-libxi
- "*/libXrender.so.1" # xorg-libxrender
- "*/libXtst.so.6" # xorg-libxtst
- "opt/temurin/lib/server/*"
- "opt/temurin/lib/*"
- "opt/temurin/bin/*"
rpaths:
- opt/temurin/lib/server
- opt/temurin/lib
- opt/temurin/bin
requirements:
build:
- tar # [linux or osx]
- unzip # [win]
- gzip # [linux or osx]
run:
- {{ stdlib('c') }}
- freetype
- name: {{ name|lower }}-headless
requirements:
run:
- {{ pin_subpackage(name|lower, exact=True) }}
files:
exclude:
- opt/temurin/lib/libawt_xawt.so
- opt/temurin/lib/libsplashscreen.so
- opt/temurin/lib/libjsound.so
- opt/temurin/lib/libjawt.so
test:
commands:
- java -version
- name: {{ name|lower }}-graphics
requirements:
run:
- {{ pin_subpackage(name|lower, exact=True) }}
Expand Down

0 comments on commit 0456805

Please sign in to comment.