Mac bundle, icons

This commit is contained in:
Mitchell Hashimoto
2022-10-31 14:04:41 -07:00
parent a9df393580
commit 9d736985b3
15 changed files with 31 additions and 0 deletions

View File

@ -109,3 +109,9 @@ $ zig build -Drelease-fast
You can verify you have a release version by checking the filesize of the You can verify you have a release version by checking the filesize of the
built binary (`zig-out/bin/ghostty`). The release version should be less built binary (`zig-out/bin/ghostty`). The release version should be less
than 5 MB on all platforms. The debug version is around 70MB. than 5 MB on all platforms. The debug version is around 70MB.
### Mac `.app`
When targeting macOS, a macOS application bundle will be created at
`zig-out/Ghostty.app`. This can be copied as-is and used like a normal app.
This app will be not be signed or notarized.

View File

@ -89,6 +89,14 @@ pub fn build(b: *std.build.Builder) !void {
try addDeps(b, exe, static); try addDeps(b, exe, static);
} }
// App (Mac)
if (target.isDarwin()) {
const bin_path = try std.fmt.allocPrint(b.allocator, "{s}/bin/ghostty", .{b.install_path});
b.installFile(bin_path, "Ghostty.app/Contents/MacOS/ghostty");
b.installFile("dist/macos/Info.plist", "Ghostty.app/Contents/Info.plist");
b.installFile("dist/macos/Ghostty.icns", "Ghostty.app/Contents/Resources/Ghostty.icns");
}
// term.wasm // term.wasm
{ {
const wasm = b.addSharedLibrary( const wasm = b.addSharedLibrary(

BIN
dist/macos/Ghostty.icns vendored Executable file

Binary file not shown.

17
dist/macos/Info.plist vendored Normal file
View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleExecutable</key>
<string>ghostty</string>
<key>CFBundleIdentifier</key>
<string>com.mitchellh.ghostty</string>
<key>CFBundleName</key>
<string>Ghostty</string>
<key>CFBundleDisplayName</key>
<string>Ghostty</string>
<key>CFBundleIconFile</key>
<string>Ghostty.icns</string>
</dict>
</plist>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

BIN
images/icons/icon_128x128.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
images/icons/icon_16x16.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 582 B

BIN
images/icons/icon_16x16@2x@2x.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
images/icons/icon_256x256.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
images/icons/icon_32x32.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
images/icons/icon_32x32@2x@2x.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
images/icons/icon_512x512.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 93 KiB