@@ -15,28 +15,36 @@ export CGO_CXXFLAGS=-mmacosx-version-min=11.3
15
15
export CGO_LDFLAGS=-mmacosx-version-min=11.3
16
16
17
17
rm -rf llama/build dist/darwin-*
18
+
19
+ # Generate the universal ollama binary for stand-alone usage: metal + avx
20
+ echo " Building binary"
18
21
echo " Building darwin arm64"
19
22
GOOS=darwin ARCH=arm64 GOARCH=arm64 make -j 8 dist
20
23
echo " Building darwin amd64 with AVX enabled"
21
24
GOOS=darwin ARCH=amd64 GOARCH=amd64 CUSTOM_CPU_FLAGS=" avx" make -j 8 dist_exe
22
-
23
- # Generate the universal ollama binary for stand-alone usage: metal + avx
24
25
lipo -create -output dist/ollama-darwin dist/darwin-arm64/bin/ollama dist/darwin-amd64/bin/ollama
25
26
27
+ # sign the binary and rename it
28
+ if [ -n " $APPLE_IDENTITY " ]; then
29
+ codesign -f --timestamp -s " $APPLE_IDENTITY " --identifier ai.ollama.ollama --options=runtime dist/ollama-darwin
30
+ else
31
+ echo " WARNING: Skipping code signing - set APPLE_IDENTITY"
32
+ fi
33
+ ditto -c -k --keepParent dist/ollama-darwin dist/temp.zip
34
+ if [ -n " $APPLE_IDENTITY " ]; then
35
+ xcrun notarytool submit dist/temp.zip --wait --timeout 10m --apple-id $APPLE_ID --password $APPLE_PASSWORD --team-id $APPLE_TEAM_ID
36
+ fi
37
+ rm -f dist/temp.zip
38
+
39
+ # Build the app bundle
40
+ echo " Building app"
26
41
echo " Building darwin amd64 with runners"
27
42
rm dist/darwin-amd64/bin/ollama
28
43
GOOS=darwin ARCH=amd64 GOARCH=amd64 make -j 8 dist
44
+
29
45
# Generate the universal ollama binary for the app bundle: metal + no-avx
30
46
lipo -create -output dist/ollama dist/darwin-arm64/bin/ollama dist/darwin-amd64/bin/ollama
31
47
32
-
33
- if [ -n " $APPLE_IDENTITY " ]; then
34
- codesign --deep --force --options=runtime --sign " $APPLE_IDENTITY " --timestamp dist/ollama
35
- else
36
- echo " Skipping code signing - set APPLE_IDENTITY"
37
- fi
38
- chmod +x dist/ollama
39
-
40
48
# build and optionally sign the mac app
41
49
npm install --prefix macapp
42
50
if [ -n " $APPLE_IDENTITY " ]; then
46
54
fi
47
55
cp macapp/out/make/zip/darwin/universal/Ollama-darwin-universal-$VERSION .zip dist/Ollama-darwin.zip
48
56
49
- # sign the binary and rename it
50
- if [ -n " $APPLE_IDENTITY " ]; then
51
- codesign -f --timestamp -s " $APPLE_IDENTITY " --identifier ai.ollama.ollama --options=runtime dist/ollama
52
- else
53
- echo " WARNING: Skipping code signing - set APPLE_IDENTITY"
54
- fi
55
- ditto -c -k --keepParent dist/ollama dist/temp.zip
56
- if [ -n " $APPLE_IDENTITY " ]; then
57
- xcrun notarytool submit dist/temp.zip --wait --timeout 10m --apple-id $APPLE_ID --password $APPLE_PASSWORD --team-id $APPLE_TEAM_ID
58
- fi
59
- rm -f dist/temp.zip
0 commit comments