Skip to content

Commit

Permalink
Build serf in order to run davautocheck on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
jun66j5 committed Dec 31, 2023
1 parent 7a7c155 commit 9321f27
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 20 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/test-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,13 @@ jobs:
enableCrossOsArchive: true
key: arc--${{ fromJson(inputs.subversion).archive }}

- name: Checkout serf
uses: actions/checkout@v4
with:
repository: apache/serf
ref: ${{ fromJson(inputs.dependencies).serf }}
path: serf

- run: ./build.sh all

- name: Upload log files
Expand Down Expand Up @@ -327,4 +334,11 @@ jobs:
enableCrossOsArchive: true
key: arc--${{ fromJson(inputs.subversion).archive }}

- name: Checkout serf
uses: actions/checkout@v4
with:
repository: apache/serf
ref: ${{ fromJson(inputs.dependencies).serf }}
path: serf

- run: ./build.sh install
56 changes: 36 additions & 20 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ else
fi
cd "$workspace/subversion"

test -d "$prefix/lib" || mkdir -p "$prefix/lib"

case "$MATRIX_OS" in
ubuntu-*)
pkgs="build-essential libtool libtool-bin libapr1-dev libaprutil1-dev
Expand Down Expand Up @@ -65,14 +67,15 @@ ubuntu-*)
sudo apt-get purge -qq -y subversion libsvn-dev
echo '::endgroup::'
with_apr=/usr/bin/apr-1-config
with_apr_util=/usr/bin/apu-1-config
with_apu=/usr/bin/apu-1-config
with_serf=
with_apxs=/usr/bin/apxs2
with_sqlite=/usr
opt_sqlite_compat_version=
with_sqlite=
sqlite_compat_ver=
parallel=3
;;
macos-*)
pkgs="apr apr-util sqlite lz4 utf8proc"
pkgs="apr apr-util sqlite lz4 utf8proc openssl zlib"
case "$target" in
swig-py)
case "$MATRIX_PYVER" in
Expand Down Expand Up @@ -101,21 +104,41 @@ macos-*)
brew install $pkgs
brew uninstall subversion || :
echo '::endgroup::'
with_apr="$(brew --prefix apr)/bin/apr-1-config"
with_apr_util="$(brew --prefix apr-util)/bin/apu-1-config"
prefix_apr="$(brew --prefix apr)"
prefix_apu="$(brew --prefix apr-util)"
with_apr="$prefix_apr/bin/apr-1-config"
with_apu="$prefix_apu/bin/apu-1-config"
with_serf="$prefix"
with_apxs="$(brew --prefix httpd)/bin/apxs"
with_sqlite="$(brew --prefix sqlite)"
sqlite_version="$(/usr/bin/sqlite3 :memory: 'SELECT sqlite_version()')"
opt_sqlite_compat_version="--enable-sqlite-compatibility-version=$sqlite_version"
sqlite_compat_ver="$(/usr/bin/sqlite3 :memory: 'SELECT sqlite_version()')"
parallel=4
if [ -d "$workspace/serf" ]; then
echo '::group::serf'
python3 -m venv "$workspace/scons"
"$workspace/scons/bin/pip" install scons
scons="$workspace/scons/bin/scons"
pushd "$workspace/serf"
"$scons" -j "$parallel" \
SOURCE_LAYOUT=no \
APR_STATIC=no \
"PREFIX=$prefix" \
"LIBDIR=$prefix/lib" \
"APR=$prefix_apr" \
"APU=$prefix_apu" \
"OPENSSL=$(brew --prefix openssl)" \
"ZLIB=$(brew --prefix zlib)"
"$scons" install
popd
fi
echo '::endgroup::'
;;
*)
echo "Unsupported $MATRIX_OS" 1>&2
exit 1
;;
esac

test -d "$prefix/lib" || mkdir -p "$prefix/lib"
cflags=
if [ "$target" = install ]; then
ldflags="-Wl,-rpath,$prefix/lib"
Expand Down Expand Up @@ -218,8 +241,9 @@ fi

echo '::group::./configure'
./configure --prefix="$prefix" \
--with-apr="$with_apr" --with-apr-util="$with_apr_util" \
--with-sqlite="$with_sqlite" $opt_sqlite_compat_version $opt_swig \
--with-apr="$with_apr" --with-apr-util="$with_apu" \
--with-serf="$with_serf" --with-sqlite="$with_sqlite" \
--enable-sqlite-compatibility-version="$sqlite_compat_ver" \
"$opt_py3c" "$opt_apxs" "$opt_javahl" "$opt_jdk" "$opt_junit" \
--without-doxygen --without-berkeley-db --without-gpg-agent \
--without-gnome-keyring --without-kwallet \
Expand All @@ -240,16 +264,8 @@ all)
echo '::group::make all'
time make -j"$parallel" all
echo '::endgroup::'
case "$MATRIX_OS" in
ubuntu-*)
tasks='check svnserveautocheck davautocheck'
;;
macos-*)
tasks='check svnserveautocheck'
;;
esac
rc=0
for task in $tasks; do
for task in check svnserveautocheck davautocheck; do
echo "::group::make $task"
time make $task PARALLEL="$parallel" APACHE_MPM=event || rc=1
for i in tests.log fails.log; do
Expand Down

0 comments on commit 9321f27

Please sign in to comment.