Skip to content

Commit b2fece1

Browse files
authored
Apothecary fixes for linux / emscripten brotli / split ios (#500)
* Apothecary fixes for linux / emscripten brotli / split ios * Apothecary formuale brotli move / pixman move and add "all" * apothecary fix * brotli * package indiv opt _ fix. brotli android fix * pixman fix / brotli include libpng emscripten * brotli arm64ec vs fix with M define * brotli use git for vs * actions vs artifacts arch in name * emscripten libpng * libpng include * libpng * whats going on libpng * freetype * freetype emscripten * freetype fix * eh * what * i dont * libpng * libpng * freetype include dir
1 parent 8f13a6d commit b2fece1

20 files changed

+161
-81
lines changed

.github/workflows/build-linux-cross.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,4 @@ jobs:
9898
token: ${{ secrets.GITHUB_TOKEN }}
9999
tag_name: ${{ env.RELEASE }}
100100
draft: false
101-
files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}_${{ env.ARCH }}_$github{{ env.GCC }}.tar.bz2
101+
files: out/openFrameworksLibs_${{ env.RELEASE }}_${{ env.TARGET }}_${{ env.ARCH }}_${{ env.GCC }}.tar.bz2

.github/workflows/build-vs2022-arm64.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ jobs:
125125
const max = 1;
126126
127127
for (const artifact of artifacts.data.artifacts) {
128-
const isArtifactMatch = artifact.name.includes(`libs-${release}-${target}`) && !artifact.expired;
128+
const isArtifactMatch = artifact.name.includes(`libs-${release}-${target}-${arch}`) && !artifact.expired;
129129
if (isArtifactMatch) {
130130
const download = await github.rest.actions.downloadArtifact({
131131
owner: context.repo.owner,

.github/workflows/build-vs2022-arm64ec.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ jobs:
5858
fi
5959
- name: Setup MSBuild
6060
uses: microsoft/setup-msbuild@v2
61-
#with:
62-
# msbuild-architecture: arm64
6361

6462
- name: Setup msys2
6563
uses: msys2/setup-msys2@v2
@@ -130,7 +128,7 @@ jobs:
130128
const max = 1;
131129
132130
for (const artifact of artifacts.data.artifacts) {
133-
const isArtifactMatch = artifact.name.includes(`libs-${release}-${target}`) && !artifact.expired;
131+
const isArtifactMatch = artifact.name.includes(`libs-${release}-${target}-${arch}`) && !artifact.expired;
134132
if (isArtifactMatch) {
135133
const download = await github.rest.actions.downloadArtifact({
136134
owner: context.repo.owner,

.github/workflows/build-vs2022-x64.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ jobs:
125125
const max = 1;
126126
127127
for (const artifact of artifacts.data.artifacts) {
128-
const isArtifactMatch = artifact.name.includes(`libs-${release}-${target}`) && !artifact.expired;
128+
const isArtifactMatch = artifact.name.includes(`libs-${release}-${target}-${arch}`) && !artifact.expired;
129129
if (isArtifactMatch) {
130130
const download = await github.rest.actions.downloadArtifact({
131131
owner: context.repo.owner,

apothecary/apothecary

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ if [ "$TYPE" = "vs" ]; then
605605
export EXE_FLAGS=""
606606
else
607607
if [ $ARCH == "arm64ec" ]; then
608-
export VS_C_FLAGS="/Gy /GL- /guard:cf"
608+
export VS_C_FLAGS="/Gy /GL- /guard:cf -D_M_ARM64EC"
609609
else
610610
export VS_C_FLAGS="/GL-"
611611
fi
@@ -1212,37 +1212,43 @@ function doCommand() {
12121212

12131213
# process all formulas in formulas dir, ignore depends subdir
12141214
if [ "$1" == "core" ] ; then
1215-
source ${CALCULATE_FORMULAS_SCRIPT}
1216-
if [ -z "$FORMULAS" ]; then
1215+
source ${CALCULATE_FORMULAS_SCRIPT}
1216+
if [ -z "$FORMULAS" ]; then
12171217
echo "No formulas to build"
12181218
exit 0
1219-
fi
1220-
local formula
1221-
#for formula in $( ls -1 $FORMULAS_DIR | grep -v $DEPENDS_SUBDIR) ; do
1222-
for formula in "${FORMULAS[@]}"; do
1223-
doCommand $shouldSource $cmd "${formula%.*}"
1224-
done
1225-
echoInfo " ----- Apothecary Core Build Sucessfully completed for $TYPE -----"
1219+
fi
1220+
local formula
1221+
#for formula in $( ls -1 $FORMULAS_DIR | grep -v $DEPENDS_SUBDIR) ; do
1222+
for formula in "${FORMULAS[@]}"; do
1223+
doCommand $shouldSource $cmd "${formula%.*}"
1224+
done
1225+
echoInfo " ----- Apothecary All Build Sucessfully completed for $TYPE -----"
1226+
elif [ "$1" == "all" ] ; then
1227+
local formula
1228+
for formula in $( ls -1 $FORMULAS_DIR | grep -v $DEPENDS_SUBDIR) ; do
1229+
doCommand $shouldSource $cmd "${formula%.*}"
1230+
done
1231+
echoInfo " ----- Apothecary All Build Sucessfully completed for $TYPE -----"
12261232
# process all addons in the addons dir
12271233
elif [ "$1" == "addons" ] ; then
1228-
local addon
1229-
for addon in $(ls -1 $REL_ADDONS_DIR) ; do
1230-
if [ -d $REL_ADDONS_DIR/$addon ] ; then
1231-
doCommand $shouldSource $cmd $addon
1232-
fi
1233-
done
1234+
local addon
1235+
for addon in $(ls -1 $REL_ADDONS_DIR) ; do
1236+
if [ -d $REL_ADDONS_DIR/$addon ] ; then
1237+
doCommand $shouldSource $cmd $addon
1238+
fi
1239+
done
12341240

12351241
# process all formulas in the dependencies dir
12361242
elif [ "$1" == "depends" ] ; then
1237-
local depend
1238-
for depends in $( ls -1 $FORMULAS_DIR/$DEPENDS_SUBDIR) ; do
1239-
OUTPUT_DEPEND=$(realpath ${LIBS_DIR}/)/${depends}/${TYPE}
1240-
echo "Making Dependencies to ${OUTPUT_DEPEND}"
1241-
# if [ -f "$LIBS_DIR/${depends}/$TYPE/$ABI/lib.a" ]; then
1242-
# echo "Build Already exists at $LIBS_DIR/${depends}/$TYPE/ skipping"
1243-
# fi
1244-
doCommand $shouldSource $cmd "${depend%.*}"
1245-
done
1243+
local depend
1244+
for depends in $( ls -1 $FORMULAS_DIR/$DEPENDS_SUBDIR) ; do
1245+
OUTPUT_DEPEND=$(realpath ${LIBS_DIR}/)/${depends}/${TYPE}
1246+
echoInfo "Making Dependencies to [${OUTPUT_DEPEND}]"
1247+
# if [ -f "$LIBS_DIR/${depends}/$TYPE/$ABI/lib.a" ]; then
1248+
# echo "Build Already exists at $LIBS_DIR/${depends}/$TYPE/ skipping"
1249+
# fi
1250+
doCommand $shouldSource $cmd "${depend%.*}"
1251+
done
12461252

12471253
else # process given lib, addon, or dependency
12481254

@@ -1278,7 +1284,7 @@ function doCommand() {
12781284
LIBS_DIR=$tmpLibsDir
12791285
fi
12801286
else
1281-
echoInfo " Skipping addon \"$1\": no formulas found"
1287+
echoInfo " Skipping addon [\"$1\"]: no formulas found"
12821288
fi
12831289

12841290
else # OF lib or dependency formula
@@ -1299,7 +1305,7 @@ function doCommand() {
12991305
local bFormulaType=0 # bool
13001306
isFormulaType $TYPE bFormulaType
13011307
if [ $bFormulaType == 0 ] && [ $TYPE != "macos" ] ; then
1302-
echoInfo " Skipping \"$currentLib\": $cmd not needed for type \"$TYPE\""
1308+
echoInfo " Skipping [\"$currentLib\":] $cmd not needed for type \"$TYPE\""
13031309
else
13041310
# do command
13051311
$cmd $currentLib

apothecary/formulas/_depends/brotli.sh renamed to apothecary/formulas/brotli.sh

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# It is similar in speed with deflate but offers more dense compression.
66
# https://github.com/google/brotli
77

8-
FORMULA_TYPES=("osx" "vs" "ios" "watchos" "catos" "xros" "tvos" "linux")
8+
FORMULA_TYPES=("osx" "vs" "ios" "watchos" "catos" "xros" "tvos" "linux" "android" )
99
FORMULA_DEPENDS=()
1010

1111
# define the version
@@ -21,10 +21,12 @@ GIT_TAG=v$VER
2121
function download() {
2222
. "$DOWNLOADER_SCRIPT"
2323
if [ "$TYPE" == "vs" ]; then
24-
downloader ${GIT_URL}/archive/refs/tags/v${VER}.zip
25-
unzip -q v${VER}.zip
26-
mv brotli-${VER} brotli
27-
rm -f v${VER}.zip
24+
# downloader ${GIT_URL}/archive/refs/tags/v${VER}.zip
25+
# unzip -q v${VER}.zip
26+
# mv brotli-${VER} brotli
27+
# rm -f v${VER}.zip
28+
git clone "$GIT_URL.git" brotli
29+
# https://github.com/google/brotli/issues/1105 # using git for VS due to my report fix on upstream
2830
else
2931
downloader ${GIT_URL}/archive/refs/tags/v${VER}.tar.gz
3032
tar -xf v${VER}.tar.gz
@@ -41,6 +43,21 @@ function prepare() {
4143
# executed inside the lib src dir
4244
function build() {
4345
LIBS_ROOT=$(realpath $LIBS_DIR)
46+
47+
if [[ $FORCE_DOWNLOAD -eq 0 ]] && [[ $USE_SAVE == 1 ]]; then
48+
result=$(load "brotli" | tail -n 1)
49+
echoInfo "===Build $1 - Checking if Precompiled binary :[$result]==="
50+
if [ $result -eq 1 ]; then
51+
echoInfo "===Build \"$1\" Precompiled binary validated. Skipping updateFormula==="
52+
return 0
53+
else
54+
echoInfo "===Build Precompiled not found or outdated. Continue updateFormula for \"$1\"=== "
55+
fi
56+
else
57+
echoInfo "===Build Not using cache : [FORCE_DOWNLOAD=$FORCE_DOWNLOAD] [USE_SAVE=$USE_SAVE == 1] for updateFormula \"$1\" ==="
58+
fi
59+
60+
4461
if [ "$TYPE" == "vs" ]; then
4562
echo "building $TYPE | $ARCH | $VS_VER | vs: $VS_VER_GEN"
4663
echo "--------------------"
@@ -163,9 +180,7 @@ function build() {
163180
cd ..
164181
elif [[ "$TYPE" =~ ^(android)$ ]]; then
165182

166-
if [ $CROSSCOMPILING -eq 1 ]; then
167-
source $APOTHECARY_DIR/configure/${TYPE}${PLATFORM}_configure.sh
168-
fi
183+
source $APOTHECARY_DIR/configure/android_configure.sh $ABI cmake
169184

170185
mkdir -p "build_${TYPE}_${PLATFORM}"
171186
cd "build_${TYPE}_${PLATFORM}"
@@ -181,13 +196,13 @@ function build() {
181196
-DCMAKE_INSTALL_PREFIX=Release \
182197
-DCMAKE_BUILD_TYPE=Release \
183198
-DCMAKE_TOOLCHAIN_FILE=$APOTHECARY_DIR/toolchains/android.toolchain.cmake \
199+
-DCMAKE_ANDROID_ARCH_ABI=$ABI \
184200
-DPLATFORM=$PLATFORM \
185201
-DANDROID_PLATFORM=${ANDROID_PLATFORM} \
186202
-DANDROID_ABI=${ABI} \
187203
-DANDROID_API=${ANDROID_API} \
188204
-DANDROID_TOOLCHAIN=clang \
189205
-DANDROID_NDK_ROOT=$ANDROID_NDK_ROOT \
190-
-DURIPARSER_ENABLE_INSTALL=ON \
191206
-DBUILD_SHARED_LIBS=OFF \
192207
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
193208
-DCMAKE_MINIMUM_REQUIRED_VERSION=3.22 \
@@ -196,7 +211,6 @@ function build() {
196211
-DENABLE_VISIBILITY=OFF \
197212
-DCMAKE_VERBOSE_MAKEFILE=${VERBOSE_MAKEFILE} \
198213
-DCMAKE_CXX_EXTENSIONS=OFF \
199-
-DGCC_VERSION=${GCC_VERSION} \
200214
-DCMAKE_SYSTEM_NAME=$TYPE \
201215
-DBROTLI_DISABLE_TESTS=ON \
202216
-DBROTLI_BUILD_TOOLS=OFF \

apothecary/formulas/freetype/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,10 +537,15 @@ if (BZIP2_FOUND)
537537
list(APPEND PKGCONFIG_LIBS_PRIVATE "-lbz2")
538538
endif ()
539539
endif ()
540+
message(STATUS "PNG_FOUND: ${PNG_FOUND}")
540541
if (PNG_FOUND)
542+
message(STATUS "PNG_INCLUDE_DIRS: ${PNG_INCLUDE_DIRS}")
543+
message(STATUS "PNG_LIBRARIES: ${PNG_LIBRARIES}")
544+
message(STATUS "PNG_DEFINITIONS: ${PNG_DEFINITIONS}")
541545
target_link_libraries(freetype PRIVATE ${PNG_LIBRARIES})
542546
target_compile_definitions(freetype PRIVATE ${PNG_DEFINITIONS})
543-
target_include_directories(freetype PRIVATE ${PNG_INCLUDE_DIRS})
547+
target_include_directories(freetype PRIVATE ${LIBPNG_INCLUDE_DIR})
548+
target_include_directories(freetype PRIVATE ${ZLIB_INCLUDE_DIR})
544549
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "libpng")
545550
endif ()
546551
if (HarfBuzz_FOUND)
@@ -680,4 +685,4 @@ set(CPACK_COMPONENT_HEADERS_DEPENDS libraries)
680685
set(CPACK_COMPONENT_LIBRARIES_GROUP "Development")
681686
set(CPACK_COMPONENT_HEADERS_GROUP "Development")
682687

683-
include(CPack)
688+
include(CPack)

0 commit comments

Comments
 (0)