From ec7a511af6d96c8ca6a9af4944f05494cb4496ae Mon Sep 17 00:00:00 2001 From: EnumDev Date: Sat, 18 Oct 2025 16:50:09 +0300 Subject: [PATCH] Initial commit --- .gitignore | 2 ++ check-version.sh | 12 +++++++++++ pkg.info | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ source.sh | 51 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 120 insertions(+) create mode 100644 .gitignore create mode 100644 check-version.sh create mode 100644 pkg.info create mode 100644 source.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3e58e5f --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +# Exclude bpm archives +*.bpm \ No newline at end of file diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..7691988 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Github repository +REPO="kovidgoyal/kitty" + +# Get tag name using Github Rest API +TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/releases/latest | jq -r '.tag_name') + +# Trim 'v' character in TAG_NAME variable +VERSION=$(echo "$TAG_NAME" | tr -d 'v') + +echo "$VERSION" diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..70d15ae --- /dev/null +++ b/pkg.info @@ -0,0 +1,55 @@ +name: kitty +description: A cross-platform, fast and feature-rich, GPU-based terminal emulator +version: 0.43.1 +revision: 1 +url: https://github.com/kovidgoyal/kitty +license: GPL3-or-later +architecture: any +type: source +depends: + - cairo + - dbus + - fontconfig + - freetype2 + - harfbuzz + - hicolor-icon-theme + - lcms2 + - libglvnd + - libpng + - libx11 + - libxcursor + - libxi + - libxkbcommon + - openssl + - python3 + - wayland + - xxhash + - zlib +optional_depends: + - imagemagick + - libcanberra + - python-pygments +make_depends: + - golang + - libxinerama + - libxrandr + - simde + - nerd-fonts-symbols + - wayland-protocols +downloads: + - url: https://github.com/kovidgoyal/kitty/releases/download/v${BPM_PKG_VERSION}/kitty-${BPM_PKG_VERSION}.tar.xz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: 44a875e34e6a5f9b8f599b25b0796c07a1506fec2b2310573e03077ef1ae159f +split_packages: + - name: kitty + - name: kitty-terminfo + description: Terminfo for Kitty + depends: + - kitty + - ncurses + - name: kitty-shell-integration + description: Shell integration for Kitty + depends: + - kitty + - python3 diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..33a1953 --- /dev/null +++ b/source.sh @@ -0,0 +1,51 @@ +# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + export CGO_CPPFLAGS="${CPPFLAGS}" + export CGO_CFLAGS="${CFLAGS}" + export CGO_CXXFLAGS="${CXXFLAGS}" + export CGO_LDFLAGS="${LDFLAGS}" + export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" + + python3 setup.py linux-package --update-check-interval=0 +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package_kitty() { + cp -r linux-package "$BPM_OUTPUT"/usr + + # Install shell completions + linux-package/bin/kitten __complete__ setup bash | install -Dm644 /dev/stdin "$BPM_OUTPUT"/usr/share/bash-completion/completions/kitty + linux-package/bin/kitten __complete__ setup fish | install -Dm644 /dev/stdin "$BPM_OUTPUT"/usr/share/fish/vendor_completions.d/kitty.fish + linux-package/bin/kitten __complete__ setup zsh | install -Dm644 /dev/stdin "$BPM_OUTPUT"/usr/share/zsh/site-functions/_kitty + + # Remove files + rm -r "$BPM_OUTPUT"/usr/share/terminfo + rm -r "$BPM_OUTPUT"/usr/lib/kitty/shell-integration + + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/kitty/LICENSE +} + +package_kitty-terminfo() { + install -d "$BPM_OUTPUT"/usr/share/terminfo + tic -x -o "$BPM_OUTPUT"/usr/share/terminfo terminfo/kitty.terminfo + + # Install package license + install -d "$BPM_OUTPUT"/usr/share/licenses/ + ln -sf kitty "$BPM_OUTPUT"/usr/share/licenses/kitty +} + +package_kitty-shell-integration() { + install -d "$BPM_OUTPUT"/usr/lib/kitty + cp -r shell-integration "$BPM_OUTPUT"/usr/lib/kitty + + # Install package license + install -d "$BPM_OUTPUT"/usr/share/licenses/ + ln -sf kitty "$BPM_OUTPUT"/usr/share/licenses/kitty +}