On 14.09.2017 15:05, Branko Čibej wrote:
> On 14.09.2017 13:36, Paul Hammant wrote:
>> The tests made for https://github.com/apache/subversion/pull/5 didn't
>> even require me to have Svn on my system. That's because I'm asserting
>> against a series of expected shell operations, because that's how the
>> author implemented svn-viewspec
>>
>> Has anyone built Subversion on a Mac?
> All the time.
>
>> If yes, do you have the homebrew installables you needed handy?
>> #LemmeKnowPls
> "brew install subversion"?
For building from source you'll need apr, apr-util, and serf; serf is
not a standalone package in homebrew, but it is part of its subversion
install. So when I build from source I install homebrew's subversion and
use serf from there. My generic configure script is attached. For
building from trunk, for example, I just create a symlink to the script
called config.trunk. Oh, and I use a ramdisk for build artefacts and for
running tests; speeds things up quite a bit.
I also test with BDB and (used to) with Neon, those are standalone
homebrew packages.
-- Brane
#!/bin/bash
set -e
set -x
repobase=/Users/brane/src/svn/repos
buildbase=/Volumes/svn-test
prefixbase=/opt/mine
aprdebug=/opt/mine/apr-pool-debug
if [ -z ${reponame} ]; then
reponame=$(echo $(basename "$0") | sed -e 's/^config\.//')
fi
if [ -z ${buildname} ]; then
buildname=${reponame}
fi
if [ -z ${prefixname} ]; then
prefixname=svn-${buildname}
fi
repodir=${repobase}/${reponame}
builddir=${buildbase}/${buildname}
prefix=${prefixbase}/${prefixname}
$(dirname "$0")/create-test-ramdisk.sh
opt_maintainer=--enable-maintainer-mode
opt_debug=--enable-debug
opt_optimize=--disable-optimize
opt_disable_plaintext_passwd=--disable-plaintext-password-storage
opt_apr=--with-apr=/usr/local/opt/apr/bin/apr-1-config
opt_apr_util=--with-apr-util=/usr/local/opt/apr-util/bin/apu-1-config
opt_serf=--with-serf=/usr/local/opt/subversion/libexec/serf
opt_neon=
opt_sqlite=--with-sqlite=/usr/local/opt/sqlite
opt_bdb6=--enable-bdb6
#opt_swig=--with-swig=/usr/local
opt_swig=--with-swig=/opt/mine/swig-2
opt_cflags=
opt_cxxflags=
#opt_apr=--with-apr=/opt/mine/apr-1.6.2
#opt_apr_util=--with-apr-util=/opt/mine/apr-util-1.6.0
args=
while [ ! -z "$1" ]; do
case "$1" in
--clean)
if [ -d ${builddir} ]; then
rm -fr ${builddir}
fi
;;
--mainataner-mode)
opt_maintainer=--enable-maintainer-mode
;;
--no-mainataner-mode)
opt_maintainer=
;;
--default-debug)
opt_debug=
;;
--enable-debug)
opt_debug=--enable-debug
;;
--disable-debug)
opt_debug=--disable-debug
;;
--default-optimize)
opt_optimize=
;;
--enable-optimize)
opt_optimize=--enable-optimize
;;
--disable-optimize)
opt_optimize=--disable-optimize
;;
--no-disable-plaintext-passwd)
opt_disable_plaintext_passwd=
;;
--default-bdb6)
opt_bdb6=
;;
--disable-bdb6)
opt_bdb6=--disable-bdb6
;;
--apr-pool-debug)
opt_apr=--with-apr=${aprdebug}/bin/apr-2-config
opt_apr_util=--with-apr-util=${aprdebug}/bin/apr-2-config
opt_serf=--with-serf=${aprdebug}
opt_cflags="-DAPR_POOL_DEBUG=19 $opt_cflags"
opt_cxxflags="-DAPR_POOL_DEBUG=19 $opt_cxxflags"
;;
--use-neon)
opt_neon=--with-neon=/usr/local/opt/neon
;;
--use-sqlite-amalgamation)
opt_sqlite=
;;
--disable*)
args="${args} $1"
;;
--enable*)
args="${args} $1"
;;
--with*)
args="${args} $1"
;;
*)
# Ignore unknown command-line options
;;
esac
shift
done
if [ ! -d ${builddir} ]; then
mkdir ${builddir}
fi
cd ${builddir}
env CC=clang CFLAGS="$opt_cflags" CXX=clang++ CXXFLAGS="$opt_cxxflags" \
${repodir}/configure \
--prefix=${prefix} \
${opt_maintainer} \
${opt_debug} \
${opt_optimize} \
--disable-nls \
--enable-keychain \
${opt_disable_plaintext_passwd} \
--enable-javahl \
--disable-mod-activation \
${opt_apr} \
${opt_apr_util} \
${opt_sqlite} \
${opt_serf} \
${opt_neon} \
--with-apxs=/usr/sbin/apxs \
--with-berkeley-db=db.h:/usr/local/include:/usr/local/lib:db \
--with-utf8proc=internal \
--with-lz4=internal \
${opt_bdb6} \
--without-libmagic \
${opt_swig} \
--without-jikes \
--with-junit=/opt/mine/junit-4.11.jar \
$args
#!/bin/bash
set -x
set -e
mountpoint=/Volumes/svn-test
mount | grep " on ${mountpoint} " >/dev/null || {
device=$(hdiutil attach -nomount ram://3000000)
newfs_hfs -M 0700 -v svn-test ${device}
hdiutil mountvol ${device}
}