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

bleeding - uriparser fix to build static linked library. #314

Merged
merged 6 commits into from
Dec 11, 2023
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions .github/workflows/clean-up-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: cleanup caches by a branch
on:
pull_request:
types:
- closed

jobs:
cleanup:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4

- name: Cleanup
run: |
gh extension install actions/gh-actions-cache

REPO=${{ github.repository }}
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"

echo "Fetching list of cache key"
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )

## Setting this to not fail the workflow while deleting cache keys.
set +e
echo "Deleting caches..."
for cacheKey in $cacheKeysForPR
do
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
done
echo "Done"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16 changes: 8 additions & 8 deletions apothecary/formulas/FreeImage/FreeImage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ function build() {
-DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1" \
-DCMAKE_C_FLAGS="-DUSE_PTHREADS=1" \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=Release \
-DNO_BUILD_LIBRAWLITE=ON \
Expand Down Expand Up @@ -121,7 +121,7 @@ function build() {
-DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1" \
-DCMAKE_C_FLAGS="-DUSE_PTHREADS=1" \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=Release \
-DCMAKE_INSTALL_LIBDIR="lib" \
Expand Down Expand Up @@ -190,7 +190,6 @@ function build() {
-D FT_REQUIRE_HARFBUZZ=FALSE \
-DDISABLE_PERF_MEASUREMENT=ON \
-DLIBRAW_LIBRARY_BUILD=ON\
-DOPJ_STATIC=ON \
-DLIBRAW_NODLL=ON \
-DDHAVE_UNISTD_H=OFF \
-DPNG_ARM_NEON_OPT=OFF \
Expand Down Expand Up @@ -226,20 +225,20 @@ function build() {
-DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1" \
-DCMAKE_C_FLAGS="-DUSE_PTHREADS=1" \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_INSTALL_LIBDIR="build_${TYPE}_${ARCH}" \
-DNO_BUILD_LIBRAWLITE=ON \
-DNO_BUILD_OPENEXR=ON \
-DNO_BUILD_WEBP=ON \
-DNO_BUILD_JXR=ON \
-DCMAKE_INSTALL_PREFIX=Release \
-DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \
-DCMAKE_INSTALL_INCLUDEDIR=include \
-DCMAKE_INSTALL_PREFIX=. \
${CMAKE_WIN_SDK} \
-A "${PLATFORM}" \
-G "${GENERATOR_NAME}"
cmake --build . --target install --config Release
cmake --build . --target install --config Debug
cmake --build . --target install --config Release
cd ..
elif [ "$TYPE" == "emscripten" ]; then
mkdir -p build_$TYPE
Expand Down Expand Up @@ -286,9 +285,10 @@ function copy() {
elif [ "$TYPE" == "vs" ] ; then
mkdir -p $1/include
mkdir -p $1/lib/$TYPE
cp -Rv "build_${TYPE}_${ARCH}/Release/include/" $1/include
cp Source/FreeImage.h $1/include
mkdir -p $1/lib/$TYPE/$PLATFORM/
cp -v "build_${TYPE}_${ARCH}/Release/FreeImage.lib" $1/lib/$TYPE/$PLATFORM/FreeImage.lib
cp -v "build_${TYPE}_${ARCH}/Debug/FreeImage.lib" $1/lib/$TYPE/$PLATFORM/FreeImageD.lib
elif [[ "$TYPE" == "ios" || "$TYPE" == "tvos" ]] ; then
mkdir -p $1/include
mkdir -p $1/lib/$TYPE/$PLATFORM/
Expand Down
49 changes: 32 additions & 17 deletions apothecary/formulas/uriparser/uriparser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function build() {
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DURIPARSER_ENABLE_INSTALL=ON \
-DCMAKE_INSTALL_PREFIX=Release \
-DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \
-DCMAKE_INSTALL_INCLUDEDIR=include"
Expand All @@ -57,7 +57,12 @@ function build() {
-DURIPARSER_BUILD_TESTS=OFF \
-DURIPARSER_BUILD_DOCS=OFF \
-DURIPARSER_BUILD_TOOLS=OFF \
-DURIPARSER_BUILD_WCHAR_T=ON \
-DBUILD_SHARED_LIBS=OFF \
-DURIPARSER_SHARED_LIBS=OFF \
-DURIPARSER_BUILD_CHAR=ON \
${CMAKE_WIN_SDK} \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-A "${PLATFORM}" \
-G "${GENERATOR_NAME}"
cmake --build . --config Release --target install
Expand Down Expand Up @@ -95,6 +100,7 @@ function build() {
-DANDROID_PLATFORM=${ANDROID_PLATFORM} \
-DURIPARSER_BUILD_TESTS=OFF \
-DURIPARSER_BUILD_DOCS=OFF \
-DURIPARSER_SHARED_LIBS=OFF \
-DURIPARSER_BUILD_TOOLS=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_C_COMPILER=${CC} \
Expand All @@ -118,6 +124,10 @@ function build() {
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DURIPARSER_BUILD_TESTS=OFF \
-DURIPARSER_BUILD_DOCS=OFF \
-DURIPARSER_BUILD_WCHAR_T=ON \
-DURIPARSER_BUILD_CHAR=ON \
-B${ABI} \
-G 'Unix Makefiles' ../..
cd ${ABI}
Expand Down Expand Up @@ -147,15 +157,17 @@ function build() {
-DCMAKE_CXX_FLAGS="-DUSE_PTHREADS=1 -D_GNU_SOURCE" \
-DCMAKE_C_FLAGS="-DUSE_PTHREADS=1 -D_GNU_SOURCE" \
-DCMAKE_CXX_EXTENSIONS=ON \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=Release \
-DCMAKE_INCLUDE_OUTPUT_DIRECTORY=include \
-DCMAKE_INSTALL_INCLUDEDIR=include \
-DCMAKE_TOOLCHAIN_FILE=$APOTHECARY_DIR/ios.toolchain.cmake \
-DURIPARSER_BUILD_TESTS=OFF \
-DURIPARSER_BUILD_DOCS=OFF \
-DURIPARSER_BUILD_TOOLS=ON \
-DURIPARSER_BUILD_TOOLS=OFF \
-DURIPARSER_BUILD_WCHAR_T=ON \
-DURIPARSER_SHARED_LIBS=OFF \
-DURIPARSER_BUILD_CHAR=ON \
-DCMAKE_C_FLAGS=${CFLAGS} \
-DCMAKE_CXX_FLAGS=${CXXFLAGS} \
-DPLATFORM=$PLATFORM \
Expand All @@ -176,30 +188,29 @@ function build() {
cd ..

elif [ "$TYPE" == "emscripten" ]; then
local BUILD_TO_DIR=$BUILD_DIR/uriparser/build/$TYPE
mkdir -p build
local BUILD_TO_DIR="build/${TYPE}"
rm -f CMakeCache.txt
mkdir -p "build_${TYPE}"
echo "int main(){return 0;}" > tool/uriparse.c
cd build
mkdir -p ${TYPE}
cd ${TYPE}
cd "build_${TYPE}"
export CFLAGS="-fvisibility-inlines-hidden -Wno-implicit-function-declaration "
export CXXFLAGS="-fvisibility-inlines-hidden -Wno-implicit-function-declaration"
cmake \
-DURIPARSER_BUILD_TESTS=OFF \
-DURIPARSER_BUILD_DOCS=OFF \
-DURIPARSER_BUILD_TOOLS=ON \
-DURIPARSER_BUILD_TOOLS=OFF \
-DURIPARSER_SHARED_LIBS=OFF \
-DURIPARSER_BUILD_WCHAR_T=ON \
-DURIPARSER_BUILD_CHAR=ON \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_FLAGS=${CFLAGS} \
-DCMAKE_CXX_FLAGS=${CXXFLAGS} \
-G 'Unix Makefiles' ../..
-G 'Unix Makefiles' ..
#emconfigure ./configure --prefix=$BUILD_TO_DIR --disable-test --disable-doc --enable-static --disable-shared
emmake make clean
emmake make -j${PARALLEL_MAKE}
# emmake make install
cd ..
cd ..
elif [ "$TYPE" == "ios" ] || [ "$TYPE" == "tvos" ]; then
mkdir -p build
# cd build
Expand All @@ -224,10 +235,12 @@ function build() {
cmake ../ \
-DURIPARSER_BUILD_TESTS=OFF \
-DURIPARSER_BUILD_DOCS=OFF \
-DURIPARSER_BUILD_TOOLS=ON \
-DURIPARSER_BUILD_TOOLS=OFF \
-DURIPARSER_BUILD_WCHAR_T=ON \
-DURIPARSER_BUILD_CHAR=ON \
-DURIPARSER_SHARED_LIBS=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_C_COMPILER=${CC} \
-DCMAKE_CXX_COMPILER=${CXX} \
-DCMAKE_OSX_SYSROOT=${SYSROOT} \
Expand All @@ -236,7 +249,6 @@ function build() {
-DCMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE=ON \
-DCMAKE_C_FLAGS="" \
-DCMAKE_CXX_FLAGS="" \
-DBUILD_SHARED_LIBS=OFF \
-DCMAKE_BUILD_TYPE=Release \
-G 'Unix Makefiles'
cmake --build . --config Release
Expand Down Expand Up @@ -270,10 +282,12 @@ function copy() {
mkdir -p $1/lib/$TYPE
if [ "$TYPE" == "vs" ] ; then
mkdir -p $1/lib/$TYPE/$PLATFORM/
cp -Rv "build_${TYPE}_${ARCH}/Release/include/" $1/
cp -Rv "build_${TYPE}_${ARCH}/Release/include/" $1/
cp -Rv "build_${TYPE}_${ARCH}/UriConfig.h" $1/include/uriparser/
cp -f "build_${TYPE}_${ARCH}/Release/lib/uriparser.lib" $1/lib/$TYPE/$PLATFORM/uriparser.lib
elif [ "$TYPE" == "osx" ] || [ "$TYPE" == "ios" ] || [ "$TYPE" == "tvos" ]; then
cp -v -r build_${TYPE}_${PLATFORM}/Release/include/* $1/include
cp -Rv "build_${TYPE}_${PLATFORM}/UriConfig.h" $1/include/uriparser/
mkdir -p $1/lib/$TYPE/$PLATFORM/
cp -Rv build_${TYPE}_${PLATFORM}/Release/lib/liburiparser.a $1/lib/$TYPE/$PLATFORM/uriparser.a
elif [ "$TYPE" == "emscripten" ]; then
Expand All @@ -282,7 +296,7 @@ function copy() {
cp -Rv include/uriparser/* $1/include/uriparser/
# copy lib
mkdir -p $1/lib/$TYPE
cp -Rv build/$TYPE/liburiparser.a $1/lib/$TYPE/liburiparser.a
cp -Rv "build_${TYPE}/liburiparser.a" $1/lib/$TYPE/liburiparser.a
elif [ "$TYPE" == "android" ]; then
# Standard *nix style copy.
# copy headers
Expand All @@ -304,6 +318,7 @@ function copy() {
function clean() {
if [ "$TYPE" == "vs" ] ; then
rm -f *.lib
rm -f CMakeCache.txt
if [ -d "build_${TYPE}_${ARCH}" ]; then
# Delete the folder and its contents
rm -r build_${TYPE}_${ARCH}
Expand Down
Loading