Additional scripts for packager (#55000)

This commit is contained in:
Nikita Mikhaylov 2023-09-26 15:59:57 +02:00 committed by GitHub
parent edc9253ff4
commit aff486dac1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 5 deletions

View File

@ -55,6 +55,17 @@ ccache_status
# clear cache stats
ccache --zero-stats ||:
# Check whether the directory with pre-build scripts exists and not empty.
if [ -d "/build/packages/pre-build" ] && [ -z "$(ls -A /build/packages/pre-build)" ]; then
echo "There are no subcommands to execute :)"
else
# Execute all commands
for file in /build/packages/pre-build/*.sh ;
do
bash "$file"
done
fi
if [ "$BUILD_MUSL_KEEPER" == "1" ]
then
# build keeper with musl separately
@ -73,13 +84,13 @@ then
fi
rm -f CMakeCache.txt
# Build the rest of binaries
cmake --debug-trycompile -DBUILD_STANDALONE_KEEPER=0 -DCREATE_KEEPER_SYMLINK=0 -DCMAKE_VERBOSE_MAKEFILE=1 -LA "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" "-DSANITIZE=$SANITIZER" -DENABLE_CHECK_HEAVY_BUILDS=1 "${CMAKE_FLAGS[@]}" ..
else
# Build everything
cmake --debug-trycompile -DCMAKE_VERBOSE_MAKEFILE=1 -LA "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" "-DSANITIZE=$SANITIZER" -DENABLE_CHECK_HEAVY_BUILDS=1 "${CMAKE_FLAGS[@]}" ..
# Modify CMake flags, so we won't overwrite standalone keeper with symlinks
CMAKE_FLAGS+=(-DBUILD_STANDALONE_KEEPER=0 -DCREATE_KEEPER_SYMLINK=0)
fi
# Build everything
cmake --debug-trycompile -DCMAKE_VERBOSE_MAKEFILE=1 -LA "-DCMAKE_BUILD_TYPE=$BUILD_TYPE" "-DSANITIZE=$SANITIZER" -DENABLE_CHECK_HEAVY_BUILDS=1 "${CMAKE_FLAGS[@]}" ..
# No quotes because I want it to expand to nothing if empty.
# shellcheck disable=SC2086 # No quotes because I want it to expand to nothing if empty.
ninja $NINJA_FLAGS $BUILD_TARGET

1
packages/.gitignore vendored
View File

@ -1 +1,2 @@
*/
!pre-build/

3
packages/pre-build/example.sh Executable file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env bash
echo "This is an example pre-build script!"