Commit Graph

260 Commits

Author SHA1 Message Date
Iva Horn
10b86edecb fix(mac-crafter): Do not strip get-task-allow entitlement from developer builds of extensions during code signing.
Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-08-01 17:48:00 +02:00
Iva Horn
ebdee9aac0 feat(mac-crafter): Added time measurement of build phases to improve on.
Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-07-30 11:36:19 +02:00
Jyrki Gadinger
5ca272cb49 fix(mac-crafter): use AsyncParsableCommand everywhere
For some reason using `ParsableCommand` structs as subcommands of an
`AsyncParsableCommand` does not correctly handle all passed CLI
arguments.

The behaviour before this commit was as follows:

```
% mac-crafter create-dmg
Error: Missing expected argument '<app-bundle-path>'
Help:  <app-bundle-path>  Path to the desktop client app bundle.
Usage: mac-crafter create-dmg <app-bundle-path> [--product-path <product-path>] [--build-path <build-path>] [--app-name <app-name>] [--apple-id <apple-id>] [--apple-password <apple-password>] [--apple-team-id <apple-team-id>] [--package-signing-id <package-signing-id>] [--sparkle-package-sign-key <sparkle-package-sign-key>]
  See 'mac-crafter create-dmg --help' for more information.

% mac-crafter create-dmg /tmp/Nextcloud.app
OVERVIEW: Create a DMG for the client.

USAGE: mac-crafter create-dmg <app-bundle-path> [--product-path <product-path>] [--build-path <build-path>] [--app-name <app-name>] [--apple-id <apple-id>] [--apple-password <apple-password>] [--apple-team-id <apple-team-id>] [--package-signing-id <package-signing-id>] [--sparkle-package-sign-key <sparkle-package-sign-key>]

ARGUMENTS:
  <app-bundle-path>       Path to the desktop client app bundle.
[...]
```

After changing every command struct to derive from
`AsyncParsableCommand`:

```
% mac-crafter create-dmg
Error: Missing expected argument '<app-bundle-path>'
Help:  <app-bundle-path>  Path to the desktop client app bundle.
Usage: mac-crafter create-dmg <app-bundle-path> [--product-path <product-path>] [--build-path <build-path>] [--app-name <app-name>] [--apple-id <apple-id>] [--apple-password <apple-password>] [--apple-team-id <apple-team-id>] [--package-signing-id <package-signing-id>] [--sparkle-package-sign-key <sparkle-package-sign-key>]
  See 'mac-crafter create-dmg --help' for more information.

% mac-crafter create-dmg /tmp/Nextcloud.app
Required command "create-dmg" is missing, installing...
[...]
```

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-07-22 09:49:22 +02:00
Iva Horn
99e760363a fix(macOS): Enable debugger to attach to process.
- Disable hardened runtime for debug builds.
- Add required get-task-allow entitlement conditionally.

Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-07-21 14:11:16 +02:00
Iva Horn
472684cf2e fix(mac-crafter): Checked in Package.resolved.
- mac-crafter is an executable application, not a library
- Ensures all developers use identical dependency versions
- Provides reproducible builds across different environments
- Prevents "works on my machine" dependency issues
- Critical for production deployment consistency
- Enables reliable CI/CD builds with same dependency versions
- Helps with debugging by ensuring same versions across dev/test/prod
- Standard practice for applications vs libraries which should remain flexible

Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-07-16 16:15:33 +02:00
Iva Horn
5f3c381617 fix(mac-crafter): Updated .gitignore to not exclude source code files expected to be checked in.
Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-07-16 16:15:33 +02:00
Iva Horn
c898525d74 feat(mac-crafter): Added instructions to README on how to run and debug mac-crafter from Xcode.
Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-07-16 14:23:25 +02:00
Iva Horn
3e27c5f0f7 feat(mac-crafter): Reorganized commands in dedicated source code files for improved developer experience.
Had to rename Utils/Codesign.swift to Utils/Codesigning.swift to avoid duplicate module name compiler error.

Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-07-16 14:23:25 +02:00
Iva Horn
e93e23f0a7 feat(mac-crafter): Update to Swift 6.1 and Strict Concurrency Checks.
- Isolated global state into an actor.
- Updated declarations and calls to reflect asynchronicity.
- The replacement of the enumerator with subpathsOfDirectory(atPath:) was suggested by Copilot to necessarily avoid the use of synchronous enumeration in an asynchronous context.
- Updated README.

Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-07-16 11:56:55 +02:00
Jyrki Gadinger
ed22111100 ci: switch back to upstream CraftMaster
The fix we needed was merged this week 🎉
https://invent.kde.org/packaging/craftmaster/-/merge_requests/7

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-07-11 19:16:41 +02:00
Iva Horn
1c96f7fc18 fix(mac-crafter): Updated default CraftMaster repository URL.
Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-07-10 10:15:03 +02:00
Iva Horn
f05b37a214 fix(mac-crafter): Outsourced MacCrafterError type into dedicated source code file.
Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-07-10 10:15:03 +02:00
Iva Horn
1da444502e fix(mac-crafter): Textual improvements.
Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-07-10 10:15:03 +02:00
Iva Horn
b631940a1d Fix: mac-crafter installs wget on demand.
wget is used but not automatically installed, if missing.

Signed-off-by: Iva Horn <iva.horn@icloud.com>
2025-07-07 15:24:21 +02:00
Claudio Cambra
bc102fc06b fix(cmake): Strip final newline from bundled localisations
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-06-02 15:15:04 +02:00
Claudio Cambra
a2b12cff72 fix(cmake): Build CFBundleLocalizations
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-06-02 15:15:04 +02:00
Jyrki Gadinger
1001ad10e1 feat(mac-crafter): retry code-signing attempts
This step sometimes fails with an error such as: "A timestamp was
expected but was not found.".  Any code-signing errors will result in
the notarisation step to fail.

Apparently this might be due to intermittent network issues.  Let's just
retry codesigning a couple of times in the case it fails ...

See also: https://developer.apple.com/documentation/security/resolving-common-notarization-issues#Include-a-secure-timestamp

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-05-16 11:03:23 +02:00
Jyrki Gadinger
a6e9b6fcf0 feat(mac-crafter): also clone KDE blueprints, set a specific git ref for blueprint repos
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-05-14 12:15:46 +02:00
Andy Scherzinger
5fe94ea149 docs(reuse): Migrate to SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2025-05-07 09:28:53 +02:00
Andy Scherzinger
7655efa230 docs(reuse): Migrate to SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2025-05-06 09:49:30 +02:00
Claudio Cambra
4b6df246d2 feat(mac-crafter): Use our default entitlements file during default mac-crafter build run
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-05-06 09:43:55 +02:00
Claudio Cambra
957bf580cc feat(macOS): Add entitlements file
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-05-06 09:43:55 +02:00
Claudio Cambra
7b3099fc44 feat(mac-crafter): Add entitlements path option to codesign command
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-05-06 09:43:55 +02:00
Claudio Cambra
5957169f73 feat(mac-crafter): Add ability to codesign with an entitlements file
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-05-06 09:43:55 +02:00
Andy Scherzinger
00994aa9e8
docs(reuse): Migrate to SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
2025-04-16 15:19:26 +02:00
Jyrki Gadinger
e6c9c5477a fix: move array to correct value in dict
Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-04-07 14:56:42 +02:00
Claudio Cambra
0ac8eefa52 fix(mac-crafter): Work around broken consecutive shell integration builds
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-04-04 15:32:16 +02:00
Jyrki Gadinger
2bbbacb8dc fix(mac): bump deployment target to 12.0
Qt 6.8 now requires macOS 12.0 as per https://doc.qt.io/qt-6.8/macos.html

for comparison, Qt 6.7 supported 11.0 and newer: https://doc.qt.io/qt-6.7/macos.html

also update the Packages project to refuse to install on anything older
than Monterey (12.0)

Signed-off-by: Jyrki Gadinger <nilsding@nilsding.org>
2025-04-04 12:28:04 +02:00
Claudio Cambra
6735288308
feat(mac-crafter): Improve readme
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-04-03 15:38:24 +08:00
Claudio Cambra
2d40ab607b mac-crafter: Improve dmg window aesthetics
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-03-07 10:35:47 +01:00
Claudio Cambra
960dd9db9a mac-crafter: Only try to install create-dmg in command run
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-03-07 10:35:47 +01:00
Claudio Cambra
31c5ccde85 mac-crafter: Add command to create DMGs for app bundle
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-03-07 10:35:47 +01:00
Claudio Cambra
92223f8107 mac-crafter: Add DMG creation procedure
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-03-07 10:35:47 +01:00
Claudio Cambra
d16efb0727 mac-crafter: Apply code-signing procedure on Sparkle as recommended by Sparkle docs
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-01-15 09:21:19 +01:00
Claudio Cambra
51ffdb2a53 mac-crafter: Update Sparkle version to 2.6.4
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2025-01-15 09:21:19 +01:00
Claudio Cambra
582beeec6c Close isExecutable command outpipe file handle after use
Prevents exhaustion of fds

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-12-10 08:52:37 +01:00
Claudio Cambra
154cb1cdc6 mac-crafter: Only attempt sparkle codesign if it exists in the app bundle
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-12-09 09:08:58 +01:00
Claudio Cambra
f3e4fe9846 mac-crafter: Check if path to trecursively codesign exists and throw error if it doesn't
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-12-09 09:08:58 +01:00
Claudio Cambra
bd7c78300a
Skip main executable during first binary codesign round
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-22 02:30:04 +08:00
Claudio Cambra
cc37aa14bc
Add ability to skip certain files in recursive codesign
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-22 02:29:49 +08:00
Claudio Cambra
07d6456d5b
Ensure we sign the app bundle's main executable last
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-22 00:36:25 +08:00
Claudio Cambra
d4b9405870
Only define enumeratedItemPath once
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-22 00:36:12 +08:00
Claudio Cambra
8d01462c80
Ensure path passed to codesigning is absolute when using mac-crafter codesign
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-21 23:09:13 +08:00
Claudio Cambra
119883965a
Do not take current dir pth for filemanager for recursive codesign executable path check
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-21 23:08:38 +08:00
Claudio Cambra
a8c0eca6ba
Do not do final bundle codesign
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-21 18:47:32 +08:00
Claudio Cambra
e8ac221769
Do not rely on FileManager's isExecutableFile, check manually for Mach-O executable type
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-21 18:47:32 +08:00
Claudio Cambra
92f0cd96ef
Allow using an external task for running commands in mac-crafter run command
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-21 18:46:59 +08:00
Claudio Cambra
da581e2b0e
Do not treat bundles as executables in codesign check
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-21 16:24:52 +08:00
Claudio Cambra
87a5b245fe Do a codesign of the app bundle itself as final step
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-21 13:18:20 +08:00
Claudio Cambra
2ea991228e Also sign executables during recursive codesign
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
2024-11-21 13:18:20 +08:00