Skip to content

Commit 0dc762b

Browse files
committed
Fix macOS signing
1 parent 59e7148 commit 0dc762b

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.github/workflows/macos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
python3 data/merge_universal_app.py "intel_dist" "arm_dist" "out/WiiUDownloader.app"
8181
- name: Sign and DMG
8282
run: |
83-
sudo codesign --force --sign - out/WiiUDownloader.app
83+
codesign --force --deep --sign - out/WiiUDownloader.app
8484
create-dmg \
8585
--volname "WiiUDownloader" \
8686
--window-pos 200 120 \

cmd/WiiUDownloader/main.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,16 @@ func main() {
4747
// 3. Set GdkPixbuf Module Dir (Crucial for icons)
4848
// Our new script puts them in lib/loaders
4949
os.Setenv("GDK_PIXBUF_MODULE_DIR", filepath.Join(bundlePath, "MacOS", "lib", "loaders"))
50-
// Also point to the cache if we generated one
51-
cachePath := filepath.Join(bundlePath, "MacOS", "lib", "loaders.cache")
50+
// Also point to the cache located in Resources
51+
cachePath := filepath.Join(bundlePath, "Resources", "loaders.cache")
5252
if _, err := os.Stat(cachePath); err == nil {
5353
os.Setenv("GDK_PIXBUF_MODULE_FILE", cachePath)
5454
}
5555

5656
// 4. Set GIO Module Dir
57-
os.Setenv("GIO_MODULE_DIR", filepath.Join(bundlePath, "MacOS", "lib", "gio-modules"))
57+
gioModPath := filepath.Join(bundlePath, "MacOS", "lib", "gio-modules")
58+
os.Setenv("GIO_MODULE_DIR", gioModPath)
59+
os.Setenv("GIO_EXTRA_MODULES", gioModPath)
5860

5961
// 5. Set XDG_DATA_DIRS for icons and themes
6062
sharePath := filepath.Join(bundlePath, "Resources", "share")

data/create_bundle.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,5 +191,7 @@ def bundle_lib(src_path, dest_dir, processed, search_paths):
191191
[query_loaders] + bundled_loaders, capture_output=True, text=True
192192
)
193193
if res.returncode == 0:
194-
with open(os.path.join(lib_path, "loaders.cache"), "w") as f:
194+
# Place it in Resources instead of MacOS/lib to satisfy codesign
195+
with open(os.path.join(resources_path, "loaders.cache"), "w") as f:
195196
f.write(res.stdout)
197+
print("Created loaders.cache in Resources")

0 commit comments

Comments
 (0)