From abcc37f9a16640ef377198bf11ddf6b712d9b92a Mon Sep 17 00:00:00 2001 From: Anshuman <43794060+ansxuman@users.noreply.github.com> Date: Sat, 23 Nov 2024 17:45:10 +0530 Subject: [PATCH] Add darwin universal build and package (#3902) * Added Support for darwin universal builds and packages * Fix universal task * Added the missing Taskfile.tmpl.yml file --- mkdocs-website/docs/en/changelog.md | 3 ++- v3/examples/file-association/Taskfile.yml | 21 +++++++++++++++++++ .../templates/_common/Taskfile.tmpl.yml | 21 +++++++++++++++++++ 3 files changed, 44 insertions(+), 1 deletion(-) diff --git a/mkdocs-website/docs/en/changelog.md b/mkdocs-website/docs/en/changelog.md index b73e49d87..996ece436 100644 --- a/mkdocs-website/docs/en/changelog.md +++ b/mkdocs-website/docs/en/changelog.md @@ -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) @@ -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) diff --git a/v3/examples/file-association/Taskfile.yml b/v3/examples/file-association/Taskfile.yml index f0dcbdbf0..4ec68e23f 100644 --- a/v3/examples/file-association/Taskfile.yml +++ b/v3/examples/file-association/Taskfile.yml @@ -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 diff --git a/v3/internal/templates/_common/Taskfile.tmpl.yml b/v3/internal/templates/_common/Taskfile.tmpl.yml index c5f99d931..f391194dc 100644 --- a/v3/internal/templates/_common/Taskfile.tmpl.yml +++ b/v3/internal/templates/_common/Taskfile.tmpl.yml @@ -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