forked from jeroen/autobrew-old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gpgme
41 lines (33 loc) · 1.33 KB
/
gpgme
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
export HOMEBREW_NO_ANALYTICS=1
export HOMEBREW_NO_AUTO_UPDATE=1
# Offical Homebrew no longer supports El-Capitain
UPSTREAM_ORG="autobrew"
if [ "$DISABLE_AUTOBREW" ]; then return 0; fi
AUTOBREW=${TMPDIR-/tmp}
export HOMEBREW_TEMP="$AUTOBREW/hbtmp"
BREWDIR="$AUTOBREW/build-$PKG_BREW_NAME"
BREW="$BREWDIR/bin/brew"
rm -Rf $BREWDIR
mkdir -p $BREWDIR
echo "$(date): Auto-brewing $PKG_BREW_NAME in $BREWDIR..."
curl -fsSL https://github.com/$UPSTREAM_ORG/brew/tarball/master | tar xz --strip 1 -C $BREWDIR
# Calculate deps
export HOMEBREW_CACHE="$AUTOBREW"
$BREW deps -n $PKG_BREW_NAME
BREW_DEPS=$($BREW deps -n $PKG_BREW_NAME)
$BREW install --force-bottle $BREW_DEPS $PKG_BREW_NAME [email protected] 2>&1 | perl -pe 's/Warning/Note/gi'
PKG_CFLAGS=$($BREWDIR/opt/$PKG_BREW_NAME/bin/gpgme-config --cflags)
PKG_LIBS=$($BREWDIR/opt/$PKG_BREW_NAME/bin/gpgme-config --libs)
# Ship a standalone 'gpg'
mkdir -p inst/bin
cp -f $BREWDIR/opt/[email protected]/bin/gpg1 inst/bin/gpg
# Delete shared libs
rm -f $BREWDIR/Cellar/libassuan/*/lib/*.dylib
rm -f $BREWDIR/Cellar/libgpg-error/*/lib/*.dylib
# Rebuild standalone pinentry (nb: autobrew bottle is already standalone)
if [ $UPSTREAM_ORG = "Homebrew" ]; then
$BREWDIR/bin/brew reinstall pinentry --build-from-source
fi
cp -f $BREWDIR/opt/pinentry/bin/pinentry inst/bin/pinentry
# Just to be sure
rm -f $BREWDIR/Cellar/*/*/lib/*.dylib