Skip to content

Commit

Permalink
Made download (and its usage) of alsa optional
Browse files Browse the repository at this point in the history
  • Loading branch information
judovana committed Apr 9, 2024
1 parent 5f0b38f commit f2afb6e
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
6 changes: 6 additions & 0 deletions makejdk-any-platform.1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,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
6 changes: 5 additions & 1 deletion sbin/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,11 @@ configureDebugParameters() {
}

configureAlsaLocation() {
addConfigureArg "--with-alsa=" "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/installedalsa"
if [[ ! "${CONFIGURE_ARGS}" =~ "--with-alsa" ]]; then
if [[ "${BUILD_CONFIG[ALSA]}" == "true" ]]; then
addConfigureArg "--with-alsa=" "${BUILD_CONFIG[WORKSPACE_DIR]}/${BUILD_CONFIG[WORKING_DIR]}/installedalsa"
fi
fi
}

configureFreetypeLocation() {
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
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 provided via -C/--configure-args <---"
echo ""
fi
fi

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

0 comments on commit f2afb6e

Please sign in to comment.