Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making local alsa properly optional #3756

Merged
merged 6 commits into from
May 1, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions makejdk-any-platform.1
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ Build JDK (tip), defaults to https://github.com/adoptium/jdk

.SH OPTIONS
.TP
.BR \-A ", " \-\-skip-alsa
Skip downloading of alsa automatically.
If you do so, the underlying configure will detect system lib and headers.
If you wish to point to some custom build/install pass it via \fI\-C, \-\-configure-args <args>\fR
Presence of \-\-with-alsa in \-\-configure-args will also not include freshly installed alsa to build.
.TP
.BR \-b ", " \-\-branch " " \fI<branch>\fR
specify a custom branch to build from, e.g. dev.
For reference, Adoptium GitHub source repos default to the \fI<dev>\fR
Expand Down
10 changes: 9 additions & 1 deletion sbin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,6 @@ buildingTheRestOfTheConfigParameters() {

if [ "${BUILD_CONFIG[OPENJDK_CORE_VERSION]}" == "${JDK8_CORE_VERSION}" ]; then
addConfigureArg "--with-x=" "/usr/include/X11"
addConfigureArg "--with-alsa=" "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/installedalsa"
fi
}

Expand All @@ -505,6 +504,14 @@ configureDebugParameters() {
fi
}

configureAlsaLocation() {
if [[ ! "${CONFIGURE_ARGS}" =~ "--with-alsa" ]]; then
karianna marked this conversation as resolved.
Show resolved Hide resolved
if [[ "${BUILD_CONFIG[ALSA]}" == "true" ]]; then
addConfigureArg "--with-alsa=" "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/installedalsa"
fi
fi
}

configureFreetypeLocation() {
if [[ ! "${CONFIGURE_ARGS}" =~ "--with-freetype" ]]; then
if [[ "${BUILD_CONFIG[FREETYPE]}" == "true" ]]; then
Expand Down Expand Up @@ -551,6 +558,7 @@ configureCommandParameters() {
else
echo "Building up the configure command..."
buildingTheRestOfTheConfigParameters
configureAlsaLocation
fi

echo "Adjust configure for reproducible build"
Expand Down
7 changes: 6 additions & 1 deletion sbin/common/config_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
CONFIG_PARAMS=(
ADOPTIUM_DEVKIT_LOCATION
ADOPT_PATCHES
ALSA
karianna marked this conversation as resolved.
Show resolved Hide resolved
ASSEMBLE_EXPLODED_IMAGE
OPENJDK_BUILD_REPO_BRANCH
OPENJDK_BUILD_REPO_URI
Expand Down Expand Up @@ -297,6 +298,9 @@ function parseConfigurationArguments() {
"--skip-freetype" | "-F" )
BUILD_CONFIG[FREETYPE]=false;;

"--skip-alsa" | "-A" )
BUILD_CONFIG[ALSA]=false;;

"--help" | "-h" )
man ./makejdk-any-platform.1 && exit 0;;

Expand Down Expand Up @@ -477,7 +481,8 @@ function configDefaults() {

BUILD_CONFIG[COPY_MACOSX_FREE_FONT_LIB_FOR_JDK_FLAG]="false"
BUILD_CONFIG[COPY_MACOSX_FREE_FONT_LIB_FOR_JRE_FLAG]="false"
BUILD_CONFIG[FREETYPE]=true
BUILD_CONFIG[ALSA]="true"
BUILD_CONFIG[FREETYPE]="true"
BUILD_CONFIG[FREETYPE_DIRECTORY]=""
BUILD_CONFIG[FREETYPE_FONT_VERSION]="86bc8a95056c97a810986434a3f268cbe67f2902" # 2.9.1
BUILD_CONFIG[FREETYPE_FONT_BUILD_TYPE_PARAM]=""
Expand Down
9 changes: 8 additions & 1 deletion sbin/prepareWorkspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ createWorkspace() {

# ALSA first for sound
checkingAndDownloadingAlsa() {

cd "${BUILD_CONFIG[WORKSPACE_DIR]}/libs/" || exit

echo "Checking for ALSA"
Expand Down Expand Up @@ -667,7 +668,13 @@ downloadingRequiredDependencies() {
echo "Non-Linux-based environment detected, skipping download of dependency Alsa."
else
echo "Checking and downloading Alsa dependency because OSTYPE=\"${OSTYPE}\""
checkingAndDownloadingAlsa
if [[ "${BUILD_CONFIG[ALSA]}" == "true" ]]; then
checkingAndDownloadingAlsa
else
echo ""
echo "---> Skipping the process of checking and downloading the Alsa dependency, a pre-built version should be provided via -C/--configure-args <---"
echo ""
fi
fi

if [[ "${BUILD_CONFIG[FREETYPE]}" == "true" ]]; then
Expand Down