Files
chromebrew/packages/ghostty.rb
github-actions[bot] 0c81ec2d7f Add ghostty and update necessary deps (#11261)
* Add ghostty

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Fix compatibility

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Fixup packages

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Update deps

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add bzip2 dep

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* adjust deps

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Cleanup ghostty package

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
Co-authored-by: Satadru Pramanik <satadru@gmail.com>
2025-02-07 04:29:56 +00:00

58 lines
1.7 KiB
Ruby

# Adapted from Arch Linux ghostty PKGBUILD at:
# https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=ghostty
require 'package'
class Ghostty < Package
description 'Fast, native, feature-rich terminal emulator pushing modern features'
homepage 'https://ghostty.org'
version '1.1.0'
license 'MIT'
compatibility 'x86_64'
source_url "https://release.files.ghostty.org/#{version}/ghostty-source.tar.gz"
source_sha256 '51dd34e68d3eac61beff8e12db0068790678778b81208bb4d626fa59e9ff171a'
binary_compression 'tar.zst'
binary_sha256({
x86_64: '88693f453d735af7fe1932cd5ad827af2ac9f8308b1f1e2a16903f284655bbb4'
})
depends_on 'fontconfig' # R
depends_on 'freetype' # R
depends_on 'glibc' # R
depends_on 'glib' # R
depends_on 'gtk4' # R
depends_on 'harfbuzz' # R
depends_on 'libadwaita' # R
depends_on 'libx11' # R
depends_on 'oniguruma' # R
depends_on 'pandoc' => :build
depends_on 'wayland' # R
depends_on 'zig' => :build
def self.patch
system "sed -i 's/linkSystemLibrary2(\"bzip2\", dynamic_link_opts)/linkSystemLibrary2(\"bz2\", dynamic_link_opts)/' src/build/SharedDeps.zig"
end
def self.build
@zig_global_cache_dir = `pwd`.chomp + '/zig_cache'
FileUtils.mkdir_p @zig_global_cache_dir
system "ZIG_GLOBAL_CACHE_DIR=#{@zig_global_cache_dir} ./nix/build-support/fetch-zig-cache.sh"
system "DESTDIR=build zig build \
--summary all \
-p #{CREW_PREFIX} \
--search-prefix #{CREW_LIB_PREFIX} \
--system #{@zig_global_cache_dir}/p \
-Doptimize=ReleaseFast \
-Demit-docs \
-Dgtk-x11=true \
-Dcpu=baseline \
-Dpie=true \
-Dversion-string=#{version}-Chromebrew"
end
def self.install
FileUtils.mv Dir.glob('build/*'), "#{CREW_DEST_DIR}/"
end
end