forked from openscad/openscad
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacosx-build-homebrew.sh
executable file
·83 lines (68 loc) · 2.04 KB
/
macosx-build-homebrew.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
#
# This script builds library dependencies of OpenSCAD for Mac OS X using Homebrew.
#
# This script must be run from the OpenSCAD source root directory
#
# Prerequisites:
# - Homebrew (http://brew.sh)
#
OPENSCADDIR=$PWD
printUsage()
{
echo "Usage: $0"
}
log()
{
echo "$(date):" "$@"
}
if [ ! -f $OPENSCADDIR/openscad.appdata.xml.in ]; then
echo "Must be run from the OpenSCAD source root directory"
exit 0
fi
log "Updating homebrew"
time brew update
log "Listing homebrew configuration"
time brew config
# Install special packages not yet in upstream homebrew repo.
# Check if there's already an active openscad tap and skip
# tap/untap in that case.
TAP=:
if ! brew tap | grep ^openscad/ >/dev/null 2>/dev/null
then
log "Tapping openscad homebrew repo"
TAP=brew
fi
$TAP tap openscad/homebrew-tap
# FIXME: We used to require unlinking boost, but doing so also causes us to lose boost.
# Disabling until we can figure out why we unlinked in the first place
# brew unlink boost
# Python 2 conflicts with Python 3 links
brew unlink python@2
for formula in boost; do
log "Installing or updating formula $formula"
if brew ls --versions $formula; then
time brew upgrade $formula
else
time brew install $formula
fi
done
for formula in pkg-config eigen cgal glew glib opencsg freetype libzip libxml2 fontconfig harfbuzz qt5 lib3mf double-conversion imagemagick ccache ghostscript tbb; do
log "Installing formula $formula"
brew ls --versions $formula
time brew install $formula
done
# Link for formulas that are cached on Travis.
for formula in libzip opencsg; do
log "Linking formula $formula"
time brew link $formula
done
for formula in gettext qt5; do
log "Linking formula $formula"
time brew link --force $formula
done
# FIXME: Workaround for https://github.com/openscad/openscad/issues/5058
curl -o qscintilla2.rb https://raw.githubusercontent.com/Homebrew/homebrew-core/da59bcdf7f1dadf70e30240394ddc0bd6014affe/Formula/q/qscintilla2.rb
brew unlink qscintilla2
brew install qscintilla2.rb
$TAP untap openscad/homebrew-tap || true