Skip to content

Commit e2b4fbf

Browse files
committed
Removal: Failing CI on mac
1 parent e714356 commit e2b4fbf

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

mac/build.command

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ RUST_LIB="rust/release/libccx_rust.a"
55
RUST_PROFILE="--release"
66
RUST_FEATURES=""
77

8+
# Parse command line arguments
89
while [[ $# -gt 0 ]]; do
910
case $1 in
1011
OCR)
@@ -31,20 +32,22 @@ done
3132

3233
BLD_FLAGS="-std=gnu99 -Wno-write-strings -Wno-pointer-sign -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -Dfopen64=fopen -Dopen64=open -Dlseek64=lseek -DFT2_BUILD_LIBRARY -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP"
3334

35+
# Add debug flags if needed
3436
if [[ "$DEBUG" == "true" ]]; then
3537
BLD_FLAGS="$BLD_FLAGS -g -fsanitize=address"
3638
fi
3739

40+
# Add OCR support if requested
3841
if [[ "$ENABLE_OCR" == "true" ]]; then
3942
BLD_FLAGS="$BLD_FLAGS -DENABLE_OCR"
4043
fi
4144

45+
# Add hardsubx support if requested
4246
if [[ "$HARDSUBX" == "true" ]]; then
4347
BLD_FLAGS="$BLD_FLAGS -DENABLE_HARDSUBX"
4448
fi
4549

46-
BLD_INCLUDE="-I../src/ -I../src/lib_ccx -I../src/lib_hash -I../src/thirdparty/libpng -I../src/thirdparty -I../src/thirdparty/
47-
-c -I../src/thirdparty/zlib -I../src/thirdparty/freetype/include `pkg-config --cflags --silence-errors gpac`"
50+
BLD_INCLUDE="-I../src/ -I../src/lib_ccx -I../src/lib_hash -I../src/thirdparty/libpng -I../src/thirdparty -I../src/thirdparty/zlib -I../src/thirdparty/freetype/include `pkg-config --cflags --silence-errors gpac`"
4851

4952
if [[ "$ENABLE_OCR" == "true" ]]; then
5053
BLD_INCLUDE="$BLD_INCLUDE `pkg-config --cflags --silence-errors tesseract`"
@@ -97,7 +100,7 @@ SRC_FREETYPE="../src/thirdparty/freetype/autofit/autofit.c \
97100
../src/thirdparty/freetype/type42/type42.c \
98101
../src/thirdparty/freetype/winfonts/winfnt.c"
99102

100-
BLD_SOURCES="../src/ccextractor.c $SRC_API $SRC_CCX $SRC_LIB_HASH $SRC_LIBPNG $SRC_UTF8 $SRC_ZLIB $SRC_ZVBI $SRC_FREETYPE"
103+
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_LIB_HASH $SRC_LIBPNG $SRC_UTF8 $SRC_ZLIB $SRC_FREETYPE"
101104

102105
BLD_LINKER="-lm -liconv -lpthread -ldl `pkg-config --libs --silence-errors gpac`"
103106

@@ -113,12 +116,14 @@ echo "Running pre-build script..."
113116
./pre-build.sh
114117
echo "Trying to compile..."
115118

119+
# Check for cargo
116120
echo "Checking for cargo..."
117121
if ! [ -x "$(command -v cargo)" ]; then
118122
echo 'Error: cargo is not installed.' >&2
119123
exit 1
120124
fi
121125

126+
# Check rust version
122127
rustc_version="$(rustc --version)"
123128
semver=( ${rustc_version//./ } )
124129
version="${semver[1]}.${semver[2]}.${semver[3]}"
@@ -133,14 +138,17 @@ fi
133138
echo "Building rust files..."
134139
(cd ../src/rust && CARGO_TARGET_DIR=../../mac/rust cargo build $RUST_PROFILE $RUST_FEATURES) || { echo "Failed building Rust components." ; exit 1; }
135140

141+
# Copy the Rust library
136142
cp $RUST_LIB ./libccx_rust.a
137143

144+
# Add Rust library to linker flags
138145
BLD_LINKER="$BLD_LINKER ./libccx_rust.a"
139146

140147
echo "Building ccextractor"
141-
out=$( (LC_ALL=C gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER) 2>&1)
148+
out=$((LC_ALL=C gcc $BLD_FLAGS $BLD_INCLUDE -o ccextractor $BLD_SOURCES $BLD_LINKER) 2>&1)
142149
res=$?
143150
151+
# Handle common error cases
144152
if [[ $out == *"gcc: command not found"* ]]; then
145153
echo "Error: please install gcc or Xcode command line tools"
146154
exit 1
@@ -161,7 +169,7 @@ if [[ $out == *"allheaders.h: No such file or directory"* ]]; then
161169
exit 4
162170
fi
163171
164-
if [[ $res -ne 0 ]]; then
172+
if [[ $res -ne 0 ]]; then # Unknown error
165173
echo "Compiled with errors"
166174
>&2 echo "$out"
167175
exit 5

0 commit comments

Comments
 (0)