Skip to content

Commit 6795d57

Browse files
authored
Merge pull request #41 from robxu9/robxu9-5.2
build a macos-universal variant
2 parents 01b5bdf + 7f4546b commit 6795d57

2 files changed

Lines changed: 24 additions & 20 deletions

File tree

.github/workflows/build.yml

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -82,27 +82,27 @@ jobs:
8282
with:
8383
name: bash-linux-${{matrix.arch}}
8484
path: releases/bash-linux-${{matrix.arch}}
85-
# macos-universal:
86-
# needs:
87-
# - build
88-
# runs-on: macos-latest
89-
# steps:
90-
# - uses: actions/download-artifact@v3
91-
# with:
92-
# path: artifacts
93-
# - name: make executable
94-
# run: chmod +x artifacts/* && ls -al && ls -al artifacts/
95-
# - name: run lipo to create universal binary
96-
# run: lipo -arch x86_64 artifacts/bash-macos-x86_64 -arch arm64 artifacts/bash-macos-aarch64 -create -output bash-macos-universal
97-
# - uses: actions/upload-artifact@v3
98-
# with:
99-
# name: bash-macos-universal
100-
# path: bash-macos-universal
85+
macos-universal:
86+
needs:
87+
- build
88+
runs-on: macos-latest
89+
steps:
90+
- uses: actions/download-artifact@v3
91+
with:
92+
path: artifacts
93+
- name: make executable
94+
run: chmod +x artifacts/*/* && ls -al && ls -al artifacts/
95+
- name: run lipo to create universal binary
96+
run: lipo -create -arch arm64 artifacts/bash-macos-aarch64/bash-macos-aarch64 -arch x86_64 artifacts/bash-macos-x86_64/bash-macos-x86_64 -output bash-macos-universal
97+
- uses: actions/upload-artifact@v3
98+
with:
99+
name: bash-macos-universal
100+
path: bash-macos-universal
101101
release:
102102
needs:
103103
- build
104104
- docker-build
105-
# - macos-universal
105+
- macos-universal
106106
if: startsWith(github.ref, 'refs/tags/')
107107
runs-on: ubuntu-latest
108108
steps:

build.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ echo "= preparing gpg"
5858
GNUPGHOME="$(mktemp -d)"
5959
export GNUPGHOME
6060
# public key for bash
61-
gpg --batch --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 7C0135FB088AAF6C66C650B9BB5869F064EA74AB
61+
gpg --batch --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys 7C0135FB088AAF6C66C650B9BB5869F064EA74AB
6262
# public key for musl
63-
gpg --batch --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 836489290BB6B70F99FFDA0556BCDB593020450F
63+
gpg --batch --keyserver hkps://keyserver.ubuntu.com:443 --recv-keys 836489290BB6B70F99FFDA0556BCDB593020450F
6464

6565
# download tarballs
6666
echo "= downloading bash"
@@ -126,14 +126,18 @@ else
126126
# set minimum version of macOS to 10.13
127127
export MACOSX_DEPLOYMENT_TARGET="10.13"
128128
# https://www.gnu.org/software/bash/manual/html_node/Compilers-and-Options.html
129-
export CC="gcc -std=c89 -Wno-implicit-function-declaration -Wno-return-type"
129+
export CC="clang -std=c89 -Wno-implicit-function-declaration -Wno-return-type"
130+
131+
# use included gettext to avoid reading from other places, like homebrew
132+
configure_args=("${configure_args[@]}" "--with-included-gettext")
130133

131134
# if $arch is aarch64 for mac, target arm64e
132135
if [[ $arch == "aarch64" ]]; then
133136
export CFLAGS="-target arm64-apple-macos"
134137
configure_args=("${configure_args[@]}" "--host=aarch64-apple-darwin")
135138
else
136139
export CFLAGS="-target x86_64-apple-macos10.12"
140+
configure_args=("${configure_args[@]}" "--host=x86_64-apple-macos10.12")
137141
fi
138142
fi
139143
fi

0 commit comments

Comments
 (0)