From d2979760841fbefd9a553888e45a5d0da1a5522d Mon Sep 17 00:00:00 2001 From: sudacode Date: Sun, 4 May 2025 00:08:33 -0700 Subject: [PATCH] initial commit --- .gitignore | 7 ++++++ builder/Dockerfile | 21 ++++++++++++++++ builder/PKGBUILD | 58 +++++++++++++++++++++++++++++++++++++++++++++ builder/compose.yml | 10 ++++++++ python-rofi-git | 1 + screenshot/.SRCINFO | 24 +++++++++++++++++++ screenshot/PKGBUILD | 46 +++++++++++++++++++++++++++++++++++ 7 files changed, 167 insertions(+) create mode 100644 .gitignore create mode 100644 builder/Dockerfile create mode 100644 builder/PKGBUILD create mode 100644 builder/compose.yml create mode 160000 python-rofi-git create mode 100644 screenshot/.SRCINFO create mode 100644 screenshot/PKGBUILD diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..516a87f --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +*.zst +.git +**/pkg/ +**/src/ +**/.git/ +**/.mypy_cache/ +screenshot/screenshot/ diff --git a/builder/Dockerfile b/builder/Dockerfile new file mode 100644 index 0000000..a855fd2 --- /dev/null +++ b/builder/Dockerfile @@ -0,0 +1,21 @@ +FROM archlinux:base-devel + +RUN pacman -Syu --noconfirm && pacman -S git sudo reflector rsync --noconfirm --needed && \ + sed -i 's/#Color/Color/' /etc/pacman.conf && \ + sed -i 's/ParallelDownloads = 5/ParallelDownloads = 8/' /etc/pacman.conf && \ + sed -i '42c\ILoveCandy' /etc/pacman.conf && \ + reflector --latest 5 --sort rate --save /etc/pacman.d/mirrorlist && \ + pacman -Scc --noconfirm && rm -rf /var/cache/pacman/pkg/* && \ + useradd -m -G wheel -s /bin/bash testuser && \ + sed -Ei 's/^#\ (%wheel.*NOPASSWD.*)/\1/' /etc/sudoers && \ + mkdir -p /home/testuser/packages/paru && \ + chown -R testuser:testuser /home/testuser + +USER testuser +WORKDIR /home/testuser/packages/paru + +RUN git clone https://aur.archlinux.org/paru.git . && makepkg --noconfirm -si + +WORKDIR /home/testuser + +CMD [ "/bin/bash" ] diff --git a/builder/PKGBUILD b/builder/PKGBUILD new file mode 100644 index 0000000..44e8785 --- /dev/null +++ b/builder/PKGBUILD @@ -0,0 +1,58 @@ +# Maintainer: sudacode +pkgname=python-manga-ocr +_pkgname=manga_ocr +pkgver=0.1.14 +pkgrel=1 +pkgdesc="A tool for extracting text from manga images using OCR" +arch=('x86_64') +url="https://github.com/kha-white/manga-ocr" +license=('Apache-2.0') +makedepends=('python-pip' 'python-installer' 'python-wheel') +depends=( + 'python>=3.6' + 'python-fire' + 'python-fugashi' + 'python-jaconv' + 'python-loguru' + 'python-numpy' + 'python-pillow>=10.0.0' + 'python-pyperclip' + 'python-pytorch>=1.0' + 'python-transformers>=4.25.0' + 'python-unidic-lite' +) +optdepends=( + 'python-pytorch: GPU acceleration' + 'wl-clipboard: Read images from the clipboard in the command-line mode on Wayland' + 'xclip: Read images from the clipbaord in the command-line mode on X11' +) +checkdepends=('python-pytest') + +conflicts=('manga-ocr-git') + +source=( + "https://github.com/kha-white/manga_ocr/archive/refs/tags/v${pkgver}.tar.gz" + "skip-example-run-on-boot.patch" +) +sha256sums=('f7d73bbf482cbefb6f91ff3c628a3131d6c7dc863612539fe5d03a4b7d640643' + 'd287a2fbfa71d9753cdfd921ce67bd7bf1fcf1e36dd08fc00c8d142305d4da88') + +prepare() { + cd "${_pkgname//_/-}-$pkgver" + patch --forward --strip=0 --input=../skip-example-run-on-boot.patch +} + +build() { + cd "${_pkgname//_/-}-$pkgver" + python -m pip wheel . --no-deps --wheel-dir dist +} + +check() { + cd "${_pkgname//_/-}-$pkgver" + pytest -o addopts="" +} + +package() { + cd "${_pkgname//_/-}-$pkgver" + python -m pip install --no-deps --root="$pkgdir" --prefix=/usr --ignore-installed . +} diff --git a/builder/compose.yml b/builder/compose.yml new file mode 100644 index 0000000..4613251 --- /dev/null +++ b/builder/compose.yml @@ -0,0 +1,10 @@ +--- +services: + pkgbuilder: + build: . + container_name: pkgbuilder + network_mode: host + tty: true + volumes: + - ./PKGBUILD:/home/testuser/packages/PKGBUILD:ro + restart: no diff --git a/python-rofi-git b/python-rofi-git new file mode 160000 index 0000000..1c48df9 --- /dev/null +++ b/python-rofi-git @@ -0,0 +1 @@ +Subproject commit 1c48df9554758c622b6aad542fd338e23a78d814 diff --git a/screenshot/.SRCINFO b/screenshot/.SRCINFO new file mode 100644 index 0000000..a5e3046 --- /dev/null +++ b/screenshot/.SRCINFO @@ -0,0 +1,24 @@ +pkgbase = screenshot-git + pkgdesc = Wayland screenshot tool (grim/slurp/rofi/zenity/swappy) – git version + pkgver = 20250504.r0fa6ed0 + pkgrel = 1 + url = https://gitea.suda.codes/sudacode/screenshot + arch = x86_64 + license = MIT + makedepends = git + makedepends = go + depends = grim + depends = slurp + depends = rofi + depends = zenity + depends = wl-clipboard + depends = jq + depends = hyprland + depends = swappy + depends = libnotify + provides = screenshot + conflicts = screenshot + source = git+https://gitea.suda.codes/sudacode/screenshot.git + md5sums = SKIP + +pkgname = screenshot-git diff --git a/screenshot/PKGBUILD b/screenshot/PKGBUILD new file mode 100644 index 0000000..d2adf3c --- /dev/null +++ b/screenshot/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: Kyle Yasuda +pkgname=screenshot-git +pkgver=20250504.r0fa6ed0 # overridden by pkgver() +pkgrel=1 +pkgdesc="Wayland screenshot tool (grim/slurp/rofi/zenity/swappy) – git version" +arch=('x86_64') +url="https://gitea.suda.codes/sudacode/screenshot" +license=('MIT') +depends=( + grim # capture + slurp # region select + rofi # menu picker + zenity # file-save dialog + wl-clipboard # wl-copy + jq # JSON parsing + hyprland # hyprctl + swappy # annotation + libnotify # notifications +) +makedepends=(git go) +provides=('screenshot') +conflicts=('screenshot') +source=("git+https://gitea.suda.codes/sudacode/screenshot.git") +md5sums=('SKIP') + +pkgver() { + cd screenshot + local _ct=$(git log -1 --format='%ct') + local _date=$(date -u -d "@${_ct}" +%Y%m%d) + local _hash=$(git rev-parse --short=7 HEAD) + printf '%s.r%s' "${_date}" "${_hash}" +} + +build() { + cd screenshot + go mod download + go build -trimpath -o screenshot +} + +package() { + cd screenshot + install -Dm755 screenshot "${pkgdir}/usr/bin/screenshot" + # install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md" +} + +# vim:set ts=2 sw=2 et: