Skip to content

Commit

Permalink
squash! macos installer: convert to universal builds
Browse files Browse the repository at this point in the history
Mention hack using Homebrew's pre-built Intel and ARM binaries to
concoct universal libraries.
  • Loading branch information
dscho committed Nov 2, 2023
1 parent d8a018e commit 121de8f
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions .github/workflows/build-git-installers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,20 @@ jobs:

- name: Install Git dependencies
run: |
set -x
set -ex
# Install x86_64 packages
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
arch -x86_64 /usr/local/bin/brew install gettext curl
# Install arm64 packages
brew install automake asciidoc xmlto docbook
brew link --force gettext
# Make universal gettext and curl library
lipo -create -output libintl.a /usr/local/opt/gettext/lib/libintl.a /opt/homebrew/opt/gettext/lib/libintl.a
lipo -create -output libcurl.dylib /opt/homebrew/opt/curl/lib/libcurl.4.dylib /usr/local/opt/curl/lib/libcurl.4.dylib
- name: Set up signing/notarization infrastructure
env:
A1: ${{ secrets.APPLICATION_CERTIFICATE_BASE64 }}
Expand Down Expand Up @@ -94,7 +99,6 @@ jobs:
# Configure the environment
set -ex
PATH=/usr/local/bin:$PATH
export CURL_LDFLAGS=$(curl-config --libs)
# Write to "version" file to force match with trigger payload version
echo "v2.42.0.vfs.0.0-universal" >>git/version
Expand All @@ -110,8 +114,14 @@ jobs:
# Configure the Git build to pick up gettext
homebrew_prefix="$(brew --prefix)"
cat >>git/config.mak <<EOF
LDFLAGS = -L$homebrew_prefix/lib -L/usr/local/opt/gettext/lib
CFLAGS = -I$homebrew_prefix/include -I/usr/local/opt/gettext/include
LDFLAGS = -L"$(pwd)"
EOF
# Configure the Git build to pick up the universal `libcurl.dylib`
cat >>git/config.mak <<EOF
CURL_LDFLAGS := -L"$(pwd)" -lcurl
CURL_CONFIG := /usr/bin/true
EOF
# Avoid even building the dashed built-ins; Those should be hard-linked
Expand Down

0 comments on commit 121de8f

Please sign in to comment.