# Contributor: Jakub Panek # Maintainer: Jakub Panek pkgname=wezterm pkgver=20230712.072601 _pkgver="${pkgver/./-}-f4abf8fd" pkgrel=3 pkgdesc="GPU-accelerated cross-platform terminal emulator and multiplexer written in Rust" url="https://wezfurlong.org/wezterm/" # s390x, riscv64 limited by rust # ppc64le limited by ring https://github.com/briansmith/ring/issues/389 # armv7 armhf x86 limited by 32-bit incompatibility arch="x86_64 aarch64" license="MIT" options="net" # See remove-bundled-fonts.patch for more info about fonts. _depends_fonts=" font-jetbrains-mono-vf font-noto-emoji font-roboto " makedepends=" $_depends_fonts cargo cargo-auditable fontconfig-dev freetype-dev harfbuzz-dev libgit2-dev libpng-dev libssh2-dev libx11-dev libxkbcommon-dev lua5.4-dev ncurses openssl-dev>3 python3 wayland-dev xcb-imdkit-dev xcb-util-dev xcb-util-image-dev xcb-util-keysyms-dev xcb-util-wm-dev zlib-dev zstd-dev " checkdepends="openssh" install="$pkgname.post-install $pkgname.post-upgrade" subpackages=" $pkgname-common $pkgname-mux-server:_mux_server $pkgname-extra-terminfo:_extra_terminfo:noarch $pkgname-fonts::noarch $pkgname-bash-completion $pkgname-fish-completion $pkgname-zsh-completion " source=" https://github.com/wez/wezterm/releases/download/$_pkgver/wezterm-$_pkgver-src.tar.gz link-against-system-libs.patch remove-rare-image-formats.patch " builddir="$srcdir/wezterm-$_pkgver" options="net" export LIBSSH2_SYS_USE_PKG_CONFIG=1 # use system libssh2 prepare() { cargo fetch --target="$CTARGET" --locked default_prepare # Rust target triple. local target=$(rustc -vV | sed -n 's/host: //p') # Build against system-provided libs mkdir -p .cargo cat >> .cargo/config <<-EOF [target.$target] git2 = { rustc-link-lib = ["git2"] } EOF cargo fetch --target="$CTARGET" # regenerate Cargo.lock after patching # dont print malformed sshd config, this can possibly fail on builders but not on CI sed 's|std::fs::write|//std::fs::write|g' -i "$builddir"/wezterm-ssh/tests/sshd.rs } build() { cargo auditable build \ --release \ --frozen \ --no-default-features \ --features wayland,distro-defaults \ --bin wezterm \ --bin wezterm-gui \ --bin wezterm-mux-server \ --bin strip-ansi-escapes # Regenerate shell completions (to be up-to-date). local sh; for sh in bash fish zsh; do ./target/release/wezterm shell-completion --shell $sh > assets/shell-completion/$sh done tic -x -o "$builddir"/terminfo "$builddir"/termwiz/data/wezterm.terminfo } check() { # Test ligatures_jetbrains is somehow broken; it's *not* related to our # patches, but probably to fontconfig or freetype version. cargo test --frozen -- \ --skip shapecache::test::ligatures_jetbrains # required to unstuck CI killall -q sshd || true } package() { depends="$pkgname-common=$pkgver-r$pkgrel" local appid="org.wezfurlong.wezterm" cd target/release install -Dm755 -t "$pkgdir"/usr/bin/ \ wezterm \ wezterm-gui \ wezterm-mux-server \ strip-ansi-escapes cd "$builddir" install -Dm644 assets/wezterm.desktop "$pkgdir"/usr/share/applications/$appid.desktop install -Dm644 assets/wezterm.appdata.xml "$pkgdir"/usr/share/metainfo/$appid.appdata.xml install -Dm644 LICENSE.md -t "$pkgdir"/usr/share/licences/$pkgname/ install -Dm644 assets/shell-integration/wezterm.sh -t "$pkgdir"/etc/profile.d/ install -Dm644 assets/icon/terminal.png "$pkgdir"/usr/share/icons/hicolor/128x128/apps/$appid.png install -Dm644 assets/icon/wezterm-icon.svg "$pkgdir"/usr/share/icons/hicolor/scalable/apps/$appid.svg install -Dm644 terminfo/w/wezterm "$pkgdir"/usr/share/terminfo/w/wezterm install -Dm644 assets/shell-completion/bash "$pkgdir"/usr/share/bash-completion/completions/wezterm install -Dm644 assets/shell-completion/fish "$pkgdir"/usr/share/fish/vendor_completions.d/wezterm.fish install -Dm644 assets/shell-completion/zsh "$pkgdir"/usr/share/zsh/site-functions/_wezterm } # NOTE: This package contains programs that don't depend on Gtk, X11 etc. # It may be installed on a remote server. common() { pkgdesc="Common files for WezTerm GUI and multiplexer server" depends="$pkgname-extra-terminfo=$pkgver-r$pkgrel" amove etc/profile.d amove usr/bin/strip-ansi-escapes amove usr/bin/wezterm } _mux_server() { pkgdesc="WezTerm multiplexer server" depends="$pkgname-common=$pkgver-r$pkgrel" amove usr/bin/wezterm-mux-server } _extra_terminfo() { pkgdesc="$pkgdesc (extra terminfo data)" depends="ncurses-terminfo-base" amove usr/share/terminfo/w/wezterm } fonts() { pkgdesc="Meta package for fonts bundled in Wezterm" depends="$_depends_fonts" mkdir -p "$subpkgdir" } sha512sums=" 4dfa55ab6cf5e9994465b13a1a1581a6e6532d0295c5677e2f7f5b89e311dd9b7bd99dac5c110f44fcc4674f732ce5b175fadba8ed8f07aac1f4f958e4781ab6 wezterm-20230712-072601-f4abf8fd-src.tar.gz cdb094eca83e316903f5134107cb5a1ba0cbc2dd13b7a0bac1c5f24154edefecf01bcceb60ce28542849663a396043be9d8d104bc4cf73507338c00693334477 link-against-system-libs.patch 8fbad50fd7bce21e6c45c46d8be31523b6a8b08303712847de78a3c78d5eb6d03252bff6f5d9eb58e94bbf233e04f686ad066a9cc0afeaf40e88b3266a598d47 remove-rare-image-formats.patch "