From 89a5c661ffc9b9cc5f6592b60f5095bbf97d9b89 Mon Sep 17 00:00:00 2001 From: Marcin Puc Date: Tue, 4 Jul 2023 00:06:21 +0200 Subject: [PATCH] New package: rio-0.0.8 --- srcpkgs/rio-terminfo | 1 + srcpkgs/rio/files/rio.desktop | 13 ++++++++++ srcpkgs/rio/patches/musl-fix.patch | 39 ++++++++++++++++++++++++++++++ srcpkgs/rio/template | 33 +++++++++++++++++++++++++ 4 files changed, 86 insertions(+) create mode 120000 srcpkgs/rio-terminfo create mode 100644 srcpkgs/rio/files/rio.desktop create mode 100644 srcpkgs/rio/patches/musl-fix.patch create mode 100644 srcpkgs/rio/template diff --git a/srcpkgs/rio-terminfo b/srcpkgs/rio-terminfo new file mode 120000 index 000000000000..7b09b1f90778 --- /dev/null +++ b/srcpkgs/rio-terminfo @@ -0,0 +1 @@ +rio \ No newline at end of file diff --git a/srcpkgs/rio/files/rio.desktop b/srcpkgs/rio/files/rio.desktop new file mode 100644 index 000000000000..2e97cbc20475 --- /dev/null +++ b/srcpkgs/rio/files/rio.desktop @@ -0,0 +1,13 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=rio +GenericName=Terminal emulator +Comment=A hardware-accelerated GPU terminal emulator powered by WebGPU +TryExec=rio +Exec=rio +Icon=rio +Categories=System;TerminalEmulator; +StartupNotify=true +StartupWMClass=rio +SingleMainWindow=false diff --git a/srcpkgs/rio/patches/musl-fix.patch b/srcpkgs/rio/patches/musl-fix.patch new file mode 100644 index 000000000000..b8149a62c43c --- /dev/null +++ b/srcpkgs/rio/patches/musl-fix.patch @@ -0,0 +1,39 @@ +diff --git a/teletypewriter/src/unix/mod.rs b/teletypewriter/src/unix/mod.rs +index 52fa4f6..73f7471 100644 +--- a/teletypewriter/src/unix/mod.rs ++++ b/teletypewriter/src/unix/mod.rs +@@ -19,8 +19,10 @@ use std::process::Command; + use std::ptr; + use std::sync::Arc; + +-#[cfg(target_os = "linux")] ++#[cfg(all(target_os = "linux", not(target_env = "musl")))] + const TIOCSWINSZ: libc::c_ulong = 0x5414; ++#[cfg(all(target_os = "linux", target_env = "musl"))] ++const TIOCSWINSZ: libc::c_int = 0x80087467; + #[cfg(target_os = "macos")] + const TIOCSWINSZ: libc::c_ulong = 2148037735; + +@@ -244,6 +246,7 @@ pub fn terminfo_exists(terminfo: &str) -> bool { + } + + pub fn create_termp(utf8: bool) -> libc::termios { ++ // musl libc does not provide c_ispeed and c_ospeed fields in struct termios. + #[cfg(target_os = "linux")] + let mut term = libc::termios { + c_iflag: libc::ICRNL | libc::IXON | libc::IXANY | libc::IMAXBEL | libc::BRKINT, +@@ -258,8 +261,14 @@ pub fn create_termp(utf8: bool) -> libc::termios { + | libc::ECHOKE + | libc::ECHOCTL, + c_cc: Default::default(), ++ #[cfg(not(target_env = "musl"))] + c_ispeed: Default::default(), ++ #[cfg(not(target_env = "musl"))] + c_ospeed: Default::default(), ++ #[cfg(target_env = "musl")] ++ __c_ispeed: Default::default(), ++ #[cfg(target_env = "musl")] ++ __c_ospeed: Default::default(), + c_line: 0, + }; + diff --git a/srcpkgs/rio/template b/srcpkgs/rio/template new file mode 100644 index 000000000000..9e3ddecf0a22 --- /dev/null +++ b/srcpkgs/rio/template @@ -0,0 +1,33 @@ +# Template file for 'rio' +pkgname=rio +version=0.0.8 +revision=1 +build_style=cargo +make_install_args="--path rio" +hostmakedepends="pkg-config" +makedepends="fontconfig-devel freetype-devel libglvnd-devel libxcb-devel libxkbcommon-devel wayland-devel" +depends="rio-terminfo-${version}_${revision}" +short_desc="Hardware-accelerated GPU terminal emulator powered by WebGPU" +maintainer="Marcin Puc " +license="MIT" +homepage="https://raphamorim.io/rio/" +changelog="https://raw.githubusercontent.com/raphamorim/rio/main/CHANGELOG.md" +distfiles="https://github.com/raphamorim/rio/archive/refs/tags/v${version}.tar.gz" +checksum=995ad62ba79e1190d15a6e7e353e04750808ccf3d504b5c7d8790cf0e2d999c9 + +post_install() { + vlicense LICENSE + + vinstall ${FILESDIR}/rio.desktop 644 usr/share/applications + vinstall rio/src/screen/window/resources/images/logo-macos.png 644 usr/share/pixmaps rio.png + + vmkdir usr/share/terminfo + tic -sx -o ${DESTDIR}/usr/share/terminfo misc/rio.info +} + +rio-terminfo_package() { + short_desc+=" - terminfo data" + pkg_install() { + vmove usr/share/terminfo + } +}