Skip to content

Commit

Permalink
Add darwin universal build and package (wailsapp#3902)
Browse files Browse the repository at this point in the history
* Added Support for darwin universal builds and packages

* Fix universal task

* Added the missing Taskfile.tmpl.yml file
  • Loading branch information
ansxuman authored Nov 23, 2024
1 parent 76e7654 commit abcc37f
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mkdocs-website/docs/en/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- Added Support for darwin universal builds and packages by [ansxuman](https://github.com/ansxuman) in [#3902](https://github.com/wailsapp/wails/pull/3902)
- Events documentation to the mkdocs webite by [atterpac](https://github.com/atterpac) in [#3867](https://github.com/wailsapp/wails/pull/3867)
- Templates for sveltekit and sveltekit-ts that are set for non-SSR development by [atterpac](https://github.com/atterpac) in [#3829](https://github.com/wailsapp/wails/pull/3829)
- Update build assets using new `wails3 update build-assets` command by [leaanthony](https://github.com/leaanthony)
Expand All @@ -42,7 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed
- Fixed amd64 appimage compile by @atterpac in [#3898](https://github.com/wailsapp/wails/pull/3898)
- Fixed build assets update by @ansxuman in [#3900](https://github.com/wailsapp/wails/pull/3900)
- Fixed build assets update by @ansxuman in [#3901](https://github.com/wailsapp/wails/pull/3901)
- Fixed Linux systray `OnClick` and `OnRightClick` implementation by @atterpac in [#3886](https://github.com/wailsapp/wails/pull/3886)
- Fixed `AlwaysOnTop` not working on Mac by [leaanthony](https://github.com/leaanthony) in [#3841](https://github.com/wailsapp/wails/pull/3841)
- [darwin] Fixed `application.NewEditMenu` including a duplicate `PasteAndMatchStyle` role in the edit menu on Darwin by [johnmccabe](https://github.com/johnmccabe) in [#3839](https://github.com/wailsapp/wails/pull/3839)
Expand Down
21 changes: 21 additions & 0 deletions v3/examples/file-association/Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,24 @@ tasks:
summary: Runs the application in development mode
cmds:
- wails3 dev -config ./build/config.yml -port {{.VITE_PORT}}

darwin:build:universal:
summary: Builds darwin universal binary (arm64 + amd64)
cmds:
- task: darwin:build
vars:
ARCH: amd64
- mv {{.BIN_DIR}}/{{.APP_NAME}} {{.BIN_DIR}}/{{.APP_NAME}}-amd64
- task: darwin:build
vars:
ARCH: arm64
- mv {{.BIN_DIR}}/{{.APP_NAME}} {{.BIN_DIR}}/{{.APP_NAME}}-arm64
- lipo -create -output {{.BIN_DIR}}/{{.APP_NAME}} {{.BIN_DIR}}/{{.APP_NAME}}-amd64 {{.BIN_DIR}}/{{.APP_NAME}}-arm64
- rm {{.BIN_DIR}}/{{.APP_NAME}}-amd64 {{.BIN_DIR}}/{{.APP_NAME}}-arm64

darwin:package:universal:
summary: Packages darwin universal binary (arm64 + amd64)
deps:
- darwin:build:universal
cmds:
- task: darwin:create:app:bundle
21 changes: 21 additions & 0 deletions v3/internal/templates/_common/Taskfile.tmpl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,24 @@ tasks:
summary: Runs the application in development mode
cmds:
- wails3 dev -config ./build/config.yml -port {{ "{{.VITE_PORT}}" }}

darwin:build:universal:
summary: Builds darwin universal binary (arm64 + amd64)
cmds:
- task: darwin:build
vars:
ARCH: amd64
- mv {{ "{{.BIN_DIR}}/{{.APP_NAME}}" }} {{ "{{.BIN_DIR}}/{{.APP_NAME}}-amd64" }}
- task: darwin:build
vars:
ARCH: arm64
- mv {{ "{{.BIN_DIR}}/{{.APP_NAME}}" }} {{ "{{.BIN_DIR}}/{{.APP_NAME}}-arm64" }}
- lipo -create -output {{ "{{.BIN_DIR}}/{{.APP_NAME}}" }} {{ "{{.BIN_DIR}}/{{.APP_NAME}}-amd64" }} {{ "{{.BIN_DIR}}/{{.APP_NAME}}-arm64" }}
- rm {{ "{{.BIN_DIR}}/{{.APP_NAME}}-amd64" }} {{ "{{.BIN_DIR}}/{{.APP_NAME}}-arm64" }}

darwin:package:universal:
summary: Packages darwin universal binary (arm64 + amd64)
deps:
- darwin:build:universal
cmds:
- task: darwin:create:app:bundle

0 comments on commit abcc37f

Please sign in to comment.