mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-05-05 15:33:00 +00:00
snap: build from source tarball
This commit is contained in:
parent
f5b5a36835
commit
6bd9e35cd6
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@ -353,15 +353,19 @@ jobs:
|
|||||||
os:
|
os:
|
||||||
[namespace-profile-ghostty-snap, namespace-profile-ghostty-snap-arm64]
|
[namespace-profile-ghostty-snap, namespace-profile-ghostty-snap-arm64]
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
needs: test
|
needs: [test, build-dist]
|
||||||
env:
|
env:
|
||||||
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
|
ZIG_LOCAL_CACHE_DIR: /zig/local-cache
|
||||||
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
|
ZIG_GLOBAL_CACHE_DIR: /zig/global-cache
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- name: Download Source Tarball Artifacts
|
||||||
|
uses: actions/download-artifact@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
name: source-tarball
|
||||||
fetch-tags: true
|
- name: Extract tarball
|
||||||
|
run: |
|
||||||
|
mkdir dist
|
||||||
|
tar --verbose --extract --strip-components 1 --directory dist --file ghostty-source.tar.gz
|
||||||
- name: Setup Cache
|
- name: Setup Cache
|
||||||
uses: namespacelabs/nscloud-cache-action@v1.2.0
|
uses: namespacelabs/nscloud-cache-action@v1.2.0
|
||||||
with:
|
with:
|
||||||
@ -371,6 +375,8 @@ jobs:
|
|||||||
- run: sudo apt install -y udev
|
- run: sudo apt install -y udev
|
||||||
- run: sudo systemctl start systemd-udevd
|
- run: sudo systemctl start systemd-udevd
|
||||||
- uses: snapcore/action-build@v1
|
- uses: snapcore/action-build@v1
|
||||||
|
with:
|
||||||
|
path: dist
|
||||||
|
|
||||||
build-windows:
|
build-windows:
|
||||||
runs-on: windows-2022
|
runs-on: windows-2022
|
||||||
|
@ -70,7 +70,6 @@ parts:
|
|||||||
plugin: nil
|
plugin: nil
|
||||||
build-attributes: [enable-patchelf]
|
build-attributes: [enable-patchelf]
|
||||||
build-packages:
|
build-packages:
|
||||||
- blueprint-compiler
|
|
||||||
- libgtk-4-dev
|
- libgtk-4-dev
|
||||||
- libadwaita-1-dev
|
- libadwaita-1-dev
|
||||||
# TODO: Add when the Snap is updated to Ubuntu 24.10+
|
# TODO: Add when the Snap is updated to Ubuntu 24.10+
|
||||||
@ -80,7 +79,7 @@ parts:
|
|||||||
- patchelf
|
- patchelf
|
||||||
- gettext
|
- gettext
|
||||||
override-build: |
|
override-build: |
|
||||||
craftctl set version=$(git describe --abbrev=8)
|
craftctl set version=$(cat VERSION)
|
||||||
$CRAFT_PART_SRC/../../zig/src/zig build -Dpatch-rpath=\$ORIGIN/../usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:/snap/core24/current/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR -Doptimize=ReleaseFast
|
$CRAFT_PART_SRC/../../zig/src/zig build -Dpatch-rpath=\$ORIGIN/../usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:/snap/core24/current/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR -Doptimize=ReleaseFast
|
||||||
cp -rp zig-out/* $CRAFT_PART_INSTALL/
|
cp -rp zig-out/* $CRAFT_PART_INSTALL/
|
||||||
sed -i 's|Icon=com.mitchellh.ghostty|Icon=/snap/ghostty/current/share/icons/hicolor/512x512/apps/com.mitchellh.ghostty.png|g' $CRAFT_PART_INSTALL/share/applications/com.mitchellh.ghostty.desktop
|
sed -i 's|Icon=com.mitchellh.ghostty|Icon=/snap/ghostty/current/share/icons/hicolor/512x512/apps/com.mitchellh.ghostty.png|g' $CRAFT_PART_INSTALL/share/applications/com.mitchellh.ghostty.desktop
|
||||||
|
@ -36,6 +36,17 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyDist {
|
|||||||
"--format=tgz",
|
"--format=tgz",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// embed the Ghostty version in the tarball
|
||||||
|
{
|
||||||
|
const version = b.addWriteFiles().add("VERSION", b.fmt("{}", .{cfg.version}));
|
||||||
|
// --add-file uses the most recent --prefix to determine the path
|
||||||
|
// in the archive to copy the file (the directory only).
|
||||||
|
git_archive.addArg(b.fmt("--prefix=ghostty-{}/", .{
|
||||||
|
cfg.version,
|
||||||
|
}));
|
||||||
|
git_archive.addPrefixedFileArg("--add-file=", version);
|
||||||
|
}
|
||||||
|
|
||||||
// Add all of our resources into the tarball.
|
// Add all of our resources into the tarball.
|
||||||
for (resources.items) |resource| {
|
for (resources.items) |resource| {
|
||||||
// Our dist path basename may not match our generated file basename,
|
// Our dist path basename may not match our generated file basename,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user