Skip to content

Commit

Permalink
fix: darwin compilation fixes #21
Browse files Browse the repository at this point in the history
  • Loading branch information
zwindler committed Aug 25, 2023
1 parent cb8b94a commit a91b67b
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 7 deletions.
1 change: 1 addition & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ builds:
- linux
- windows
- android
- darwin
goarch:
- amd64
- arm64
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ Test release (against code not tagged)
```bash
goreleaser --snapshot --clean
```

Note: for darwin compilation, we need fyne-cross which requires having locally the XCode SDK, especially `Command_Line_Tools_for_Xcode_12.4.dmg`. [Download it here](https://developer.apple.com/download/all/?q=Command%20Line%20Tools). See [fyne-cross documentation for more information](https://github.com/fyne-io/fyne-cross/blob/master/README.md).
7 changes: 7 additions & 0 deletions developpement_diary/2023-08-25.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## 2023-08-25

Today, I just concentrated myself on darwin compilation issue with fyne-cross
* [https://github.com/zwindler/gocastle/issues/21](https://github.com/zwindler/gocastle/issues/21)
* [https://github.com/fyne-io/fyne-cross/issues/187](https://github.com/fyne-io/fyne-cross/issues/187)

I found out my mistake and made a PR to improve documentation [https://github.com/fyne-io/fyne-cross/pull/202](https://github.com/fyne-io/fyne-cross/pull/202)
57 changes: 50 additions & 7 deletions fake-releaser.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ build_linux_amd64() {
fyne-cross linux -arch=amd64,arm64 -app-id fr.zwindler.gocastle
fyne-cross android -arch=arm64 -app-id fr.zwindler.gocastle
fyne-cross windows -app-id fr.zwindler.gocastle
fyne-cross darwin -arch=amd64,arm64 --macosx-sdk-path /home/zwindler/sources/gocastle/bin/SDKs.12.4/MacOSX.sdk -app-id fr.zwindler.gocastle
mkdir -p dist/gocastle_linux_amd64_v1/
cp fyne-cross/bin/linux-amd64/gocastle dist/gocastle_linux_amd64_v1/gocastle
rm buildlock
Expand All @@ -17,14 +18,14 @@ build_linux_arm64() {
sleep 1

# build is done by build_linux_amd64, wait for it to finish
timeout=180
timeout=240
while [[ -e buildlock ]] && [[ $timeout -gt 0 ]]; do
sleep 1
((timeout--))
done

if [[ -e buildlock ]]; then
echo "Timeout: Lock file not removed after 180 seconds."
echo "Timeout: Lock file not removed after 240 seconds."
exit 1
fi

Expand All @@ -36,14 +37,14 @@ build_android() {
sleep 1

# build is done by build_linux_amd64, wait for it to finish
timeout=180
timeout=240
while [[ -e buildlock ]] && [[ $timeout -gt 0 ]]; do
sleep 1
((timeout--))
done

if [[ -e buildlock ]]; then
echo "Timeout: Lock file not removed after 180 seconds."
echo "Timeout: Lock file not removed after 240 seconds."
exit 1
fi

Expand All @@ -55,21 +56,59 @@ build_windows() {
sleep 1

# build is done by build_linux_amd64, wait for it to finish
timeout=180
timeout=240
while [[ -e buildlock ]] && [[ $timeout -gt 0 ]]; do
sleep 1
((timeout--))
done

if [[ -e buildlock ]]; then
echo "Timeout: Lock file not removed after 180 seconds."
echo "Timeout: Lock file not removed after 240 seconds."
exit 1
fi

mkdir -p dist/gocastle_windows_amd64_v1/
cp fyne-cross/bin/windows-amd64/gocastle.exe dist/gocastle_windows_amd64_v1/
}

build_darwin_amd64() {
sleep 1

# build is done by build_linux_amd64, wait for it to finish
timeout=240
while [[ -e buildlock ]] && [[ $timeout -gt 0 ]]; do
sleep 1
((timeout--))
done

if [[ -e buildlock ]]; then
echo "Timeout: Lock file not removed after 240 seconds."
exit 1
fi

mkdir -p dist/gocastle_darwin_amd64_v1/
cp fyne-cross/bin/darwin-amd64/gocastle dist/gocastle_darwin_amd64_v1/
}

build_darwin_arm64() {
sleep 1

# build is done by build_linux_amd64, wait for it to finish
timeout=240
while [[ -e buildlock ]] && [[ $timeout -gt 0 ]]; do
sleep 1
((timeout--))
done

if [[ -e buildlock ]]; then
echo "Timeout: Lock file not removed after 240 seconds."
exit 1
fi

mkdir -p dist/gocastle_darwin_arm64/
cp fyne-cross/bin/darwin-arm64/gocastle dist/gocastle_darwin_arm64/
}

if [[ "$4" == *"/gocastle_linux_amd64_v1/gocastle" ]]; then
build_linux_amd64
elif [[ "$4" == *"/gocastle_linux_arm64/gocastle" ]]; then
Expand All @@ -78,7 +117,11 @@ elif [[ "$4" == *"/gocastle_android_arm64/gocastle" ]]; then
build_android
elif [[ "$4" == *"/gocastle_windows_amd64_v1/gocastle.exe" ]]; then
build_windows
elif [[ "$4" == *"/gocastle_darwin_amd64_v1/gocastle" ]]; then
build_darwin_amd64
elif [[ "$4" == *"/gocastle_darwin_arm64/gocastle" ]]; then
build_darwin_arm64
else
echo "Invalid or unsupported path argument."
echo "Invalid or unsupported path argument '$4'"
exit 1
fi

0 comments on commit a91b67b

Please sign in to comment.