Compare commits
7
Commits
699530cf62
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f2ba1d0100 | ||
|
|
8a99cf0f7c | ||
|
|
015626b65b | ||
|
|
c449402b04 | ||
|
|
35cc4eb39b | ||
|
|
fb7df904c5 | ||
|
|
8c57c9ddb6 |
No files matched your search
@@ -0,0 +1,7 @@
|
|||||||
|
# Arch Linux with QtPotato's build dependencies, so CI skips the pacman step.
|
||||||
|
# Built and pushed by .gitea/workflows/ci-image.yml.
|
||||||
|
FROM archlinux:latest
|
||||||
|
RUN pacman -Syu --noconfirm --needed git nodejs base-devel cmake ninja ccache extra-cmake-modules \
|
||||||
|
qt6-base qt6-declarative kirigami ki18n kcoreaddons kcrash kconfig \
|
||||||
|
mpvqt qcoro qtkeychain-qt6 ffmpeg \
|
||||||
|
&& rm -rf /var/cache/pacman/pkg/*
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
name: Arch package
|
||||||
|
|
||||||
|
# Builds the qtpotato package from a release tag and publishes it to this Gitea's Arch
|
||||||
|
# registry, so users can install it with pacman until it is on the AUR.
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: ['v*']
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag:
|
||||||
|
description: Release tag to package, e.g. v0.1.0
|
||||||
|
required: true
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
package:
|
||||||
|
# Arch Linux only ships x86_64 images, so pick an amd64 runner.
|
||||||
|
runs-on: amd64
|
||||||
|
container: archlinux:latest
|
||||||
|
env:
|
||||||
|
TAG: ${{ inputs.tag || github.ref_name }}
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pacman -Syu --noconfirm --needed git nodejs base-devel cmake ninja extra-cmake-modules \
|
||||||
|
qt6-base qt6-declarative kirigami ki18n kcoreaddons kcrash kconfig \
|
||||||
|
mpvqt qcoro qtkeychain-qt6 ffmpeg hicolor-icon-theme
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
ref: ${{ inputs.tag || github.ref }}
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
version="${TAG#v}"
|
||||||
|
dir=/tmp/pkg
|
||||||
|
mkdir -p "$dir"
|
||||||
|
git config --global --add safe.directory "$PWD"
|
||||||
|
git archive --format=tar --prefix="qtpotato-$version/" HEAD | gzip -n > "$dir/qtpotato-$version.tar.gz"
|
||||||
|
sum="$(sha256sum "$dir/qtpotato-$version.tar.gz" | cut -d' ' -f1)"
|
||||||
|
sed -e "s/^pkgver=.*/pkgver=$version/" -e "s/^pkgrel=.*/pkgrel=1/" \
|
||||||
|
-e 's/^source=.*/source=("$pkgname-$pkgver.tar.gz")/' \
|
||||||
|
-e "s/^sha256sums=.*/sha256sums=('$sum')/" \
|
||||||
|
packaging/aur/qtpotato/PKGBUILD > "$dir/PKGBUILD"
|
||||||
|
# makepkg refuses to run as root.
|
||||||
|
useradd -m builder
|
||||||
|
chown -R builder "$dir"
|
||||||
|
su builder -c "cd $dir && makepkg --noconfirm"
|
||||||
|
- name: Publish
|
||||||
|
env:
|
||||||
|
# The package registry rejects the job token, so this is a personal access token
|
||||||
|
# with the write:package scope.
|
||||||
|
TOKEN: ${{ secrets.PACKAGE_TOKEN }}
|
||||||
|
run: |
|
||||||
|
for f in /tmp/pkg/qtpotato-[0-9]*.pkg.tar.zst; do
|
||||||
|
curl -fsS -X PUT -H "Authorization: token $TOKEN" --upload-file "$f" \
|
||||||
|
"$GITHUB_SERVER_URL/api/packages/${GITHUB_REPOSITORY%%/*}/arch/qtpotato"
|
||||||
|
done
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
name: CI image
|
||||||
|
|
||||||
|
# Builds the Arch image that ci.yml runs in, with the build dependencies preinstalled.
|
||||||
|
# Rebuilt weekly to pick up Arch updates.
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths: ['.gitea/ci-image/**', '.gitea/workflows/ci-image.yml']
|
||||||
|
schedule:
|
||||||
|
- cron: '0 3 * * 1'
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
image:
|
||||||
|
# The build runs on the runner's own Docker daemon, so the amd64 runner has the new
|
||||||
|
# image locally right away. It does not re-pull tags it already has.
|
||||||
|
runs-on: amd64
|
||||||
|
env:
|
||||||
|
IMAGE: git.trivk.dev/tri/qtpotato-ci:latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- name: Build
|
||||||
|
# No layer cache, so each rebuild picks up the week's Arch updates.
|
||||||
|
run: docker build --pull --no-cache -t "$IMAGE" .gitea/ci-image
|
||||||
|
- name: Push
|
||||||
|
# Gitea's Actions token cannot push to the container registry, so this uses an
|
||||||
|
# access token with the write:package scope. Cloudflare rejects request bodies over
|
||||||
|
# 100 MB and docker push sends each layer in one request, so regctl pushes the
|
||||||
|
# layers in 50 MB chunks instead.
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ secrets.PACKAGE_TOKEN }}
|
||||||
|
run: |
|
||||||
|
curl -fsSL -o /usr/local/bin/regctl \
|
||||||
|
https://github.com/regclient/regclient/releases/download/v0.11.7/regctl-linux-amd64
|
||||||
|
echo "3737fbbdd791e04e7a831640b681f3397a376498e80e2ad9b1b2d27296f239bc /usr/local/bin/regctl" | sha256sum -c
|
||||||
|
chmod +x /usr/local/bin/regctl
|
||||||
|
echo "$TOKEN" | regctl registry login git.trivk.dev -u "${{ github.repository_owner }}" --pass-stdin
|
||||||
|
regctl registry set git.trivk.dev --blob-chunk 52428800 --blob-max 52428800
|
||||||
|
docker save "$IMAGE" -o "$RUNNER_TEMP/image.tar"
|
||||||
|
regctl image import "$IMAGE" "$RUNNER_TEMP/image.tar"
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
name: CI
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
paths-ignore: ['README.md', 'LICENSES/**']
|
||||||
|
pull_request:
|
||||||
|
paths-ignore: ['README.md', 'LICENSES/**']
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
# Arch Linux only ships x86_64 images, so pick an amd64 runner.
|
||||||
|
runs-on: amd64
|
||||||
|
# Arch with the build dependencies preinstalled; see ci-image.yml.
|
||||||
|
container: git.trivk.dev/tri/qtpotato-ci:latest
|
||||||
|
env:
|
||||||
|
CCACHE_DIR: ${{ github.workspace }}/.ccache
|
||||||
|
# Keep hits across weekly image rebuilds when the compiler did not change.
|
||||||
|
CCACHE_COMPILERCHECK: content
|
||||||
|
CCACHE_MAXSIZE: 500M
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
- uses: actions/cache@v4
|
||||||
|
with:
|
||||||
|
path: .ccache
|
||||||
|
key: ccache-${{ github.sha }}
|
||||||
|
restore-keys: ccache-
|
||||||
|
- name: Configure
|
||||||
|
# The tests do not load QML, so skip QML cachegen and debug info: they take over
|
||||||
|
# half of the build. Release and AUR builds keep both.
|
||||||
|
run: |
|
||||||
|
cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_FLAGS_DEBUG=-O0 \
|
||||||
|
-DQT_QML_NO_CACHEGEN=ON -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DBUILD_TESTING=ON
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
ccache -z
|
||||||
|
cmake --build build
|
||||||
|
ccache -s
|
||||||
|
- name: Test
|
||||||
|
env:
|
||||||
|
QT_QPA_PLATFORM: offscreen
|
||||||
|
run: ctest --test-dir build --output-on-failure
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags: ['v*']
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
# Arch Linux only ships x86_64 images, so pick an amd64 runner.
|
||||||
|
runs-on: amd64
|
||||||
|
container: archlinux:latest
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
pacman -Syu --noconfirm --needed git nodejs curl jq
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Source tarball
|
||||||
|
run: |
|
||||||
|
git config --global --add safe.directory "$PWD"
|
||||||
|
version="${GITHUB_REF_NAME#v}"
|
||||||
|
mkdir -p dist
|
||||||
|
git archive --format=tar --prefix="qtpotato-$version/" "$GITHUB_REF_NAME" \
|
||||||
|
| gzip -n > "dist/qtpotato-$version.tar.gz"
|
||||||
|
- name: Publish release
|
||||||
|
env:
|
||||||
|
TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
cd dist
|
||||||
|
sha256sum -- * > SHA256SUMS
|
||||||
|
api="$GITHUB_SERVER_URL/api/v1/repos/$GITHUB_REPOSITORY"
|
||||||
|
id=$(jq -n --arg tag "$GITHUB_REF_NAME" '{tag_name: $tag, name: ("QtPotato " + ($tag | ltrimstr("v")))}' \
|
||||||
|
| curl -fsS -X POST -H "Authorization: token $TOKEN" -H 'Content-Type: application/json' \
|
||||||
|
--data @- "$api/releases" | jq -r .id)
|
||||||
|
for f in *; do
|
||||||
|
curl -fsS -X POST -H "Authorization: token $TOKEN" \
|
||||||
|
-F "attachment=@$f" "$api/releases/$id/assets?name=$f" > /dev/null
|
||||||
|
done
|
||||||
@@ -24,6 +24,42 @@ translate a whole subtitle track with any OpenAI-compatible API and show the res
|
|||||||
auto-hiding controls.
|
auto-hiding controls.
|
||||||
- Follows your Plasma style, colours and icons.
|
- Follows your Plasma style, colours and icons.
|
||||||
|
|
||||||
|
## Installing on Arch Linux
|
||||||
|
|
||||||
|
### From the pacman repository
|
||||||
|
|
||||||
|
Every release is built and published to this Gitea's package registry. Import the signing key
|
||||||
|
once:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -O https://git.trivk.dev/api/packages/tri/arch/repository.key
|
||||||
|
sudo pacman-key --add repository.key
|
||||||
|
sudo pacman-key --lsign-key 9C48725295A5F54A6A491CF86B273DD49890E8A7
|
||||||
|
```
|
||||||
|
|
||||||
|
Then add the repository to `/etc/pacman.conf` and install:
|
||||||
|
|
||||||
|
```ini
|
||||||
|
[qtpotato]
|
||||||
|
SigLevel = Required
|
||||||
|
Server = https://git.trivk.dev/api/packages/tri/arch/$repo/$arch
|
||||||
|
```
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo pacman -Syu qtpotato
|
||||||
|
```
|
||||||
|
|
||||||
|
The package is built against Arch's current Qt and KDE Frameworks. If it breaks after a system
|
||||||
|
update before a new release is out, build it from source as below.
|
||||||
|
|
||||||
|
### From the PKGBUILD
|
||||||
|
|
||||||
|
```sh
|
||||||
|
git clone https://git.trivk.dev/tri/QtPotato.git
|
||||||
|
cd QtPotato/packaging/aur/qtpotato # or qtpotato-git for the latest main
|
||||||
|
makepkg -si
|
||||||
|
```
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
|
|
||||||
### Dependencies
|
### Dependencies
|
||||||
|
|||||||
@@ -33,6 +33,12 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private Q_SLOTS:
|
private Q_SLOTS:
|
||||||
|
void initTestCase()
|
||||||
|
{
|
||||||
|
// The C locale's collation is case-sensitive, so the sort order would depend on $LANG.
|
||||||
|
QLocale::setDefault(QLocale(QLocale::English, QLocale::UnitedStates));
|
||||||
|
}
|
||||||
|
|
||||||
void sortsEpisodesNaturallyAndSkipsOtherFiles()
|
void sortsEpisodesNaturallyAndSkipsOtherFiles()
|
||||||
{
|
{
|
||||||
QTemporaryDir dir;
|
QTemporaryDir dir;
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
pkgbase = qtpotato-git
|
||||||
|
pkgdesc = KDE video player built on mpv that translates subtitles with an LLM (development version)
|
||||||
|
pkgver = 0.1.0
|
||||||
|
pkgrel = 1
|
||||||
|
url = https://git.trivk.dev/tri/QtPotato
|
||||||
|
arch = x86_64
|
||||||
|
license = GPL-3.0-or-later
|
||||||
|
makedepends = git
|
||||||
|
makedepends = cmake
|
||||||
|
makedepends = ninja
|
||||||
|
makedepends = extra-cmake-modules
|
||||||
|
depends = qt6-base
|
||||||
|
depends = qt6-declarative
|
||||||
|
depends = kirigami
|
||||||
|
depends = ki18n
|
||||||
|
depends = kcoreaddons
|
||||||
|
depends = kcrash
|
||||||
|
depends = kconfig
|
||||||
|
depends = mpvqt
|
||||||
|
depends = qcoro
|
||||||
|
depends = qtkeychain-qt6
|
||||||
|
depends = ffmpeg
|
||||||
|
depends = hicolor-icon-theme
|
||||||
|
optdepends = qqc2-desktop-style: Plasma look for the interface
|
||||||
|
optdepends = plasma-integration: Plasma file dialogs, colours and icons
|
||||||
|
provides = qtpotato=0.1.0
|
||||||
|
conflicts = qtpotato
|
||||||
|
source = qtpotato::git+https://git.trivk.dev/tri/QtPotato.git
|
||||||
|
sha256sums = SKIP
|
||||||
|
|
||||||
|
pkgname = qtpotato-git
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
# Maintainer: Tri Vo Khac
|
||||||
|
|
||||||
|
pkgname=qtpotato-git
|
||||||
|
_pkgname=qtpotato
|
||||||
|
pkgver=0.1.0
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc='KDE video player built on mpv that translates subtitles with an LLM (development version)'
|
||||||
|
arch=('x86_64')
|
||||||
|
url='https://git.trivk.dev/tri/QtPotato'
|
||||||
|
license=('GPL-3.0-or-later')
|
||||||
|
depends=('qt6-base' 'qt6-declarative' 'kirigami' 'ki18n' 'kcoreaddons' 'kcrash' 'kconfig'
|
||||||
|
'mpvqt' 'qcoro' 'qtkeychain-qt6' 'ffmpeg' 'hicolor-icon-theme')
|
||||||
|
makedepends=('git' 'cmake' 'ninja' 'extra-cmake-modules')
|
||||||
|
optdepends=('qqc2-desktop-style: Plasma look for the interface'
|
||||||
|
'plasma-integration: Plasma file dialogs, colours and icons')
|
||||||
|
provides=("$_pkgname=$pkgver")
|
||||||
|
conflicts=("$_pkgname")
|
||||||
|
source=("$_pkgname::git+$url.git")
|
||||||
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
|
pkgver() {
|
||||||
|
cd "$_pkgname"
|
||||||
|
if git describe --tags --long >/dev/null 2>&1; then
|
||||||
|
git describe --tags --long --abbrev=7 | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
|
||||||
|
else
|
||||||
|
printf 'r%s.%s' "$(git rev-list --count HEAD)" "$(git rev-parse --short=7 HEAD)"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cmake -B build -S "$_pkgname" -G Ninja \
|
||||||
|
-DCMAKE_BUILD_TYPE=None \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
|
-DBUILD_TESTING=ON
|
||||||
|
cmake --build build
|
||||||
|
}
|
||||||
|
|
||||||
|
check() {
|
||||||
|
QT_QPA_PLATFORM=offscreen ctest --test-dir build --output-on-failure
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
DESTDIR="$pkgdir" cmake --install build
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
pkgbase = qtpotato
|
||||||
|
pkgdesc = KDE video player built on mpv that translates subtitles with an LLM
|
||||||
|
pkgver = 0.1.0
|
||||||
|
pkgrel = 1
|
||||||
|
url = https://git.trivk.dev/tri/QtPotato
|
||||||
|
arch = x86_64
|
||||||
|
license = GPL-3.0-or-later
|
||||||
|
makedepends = cmake
|
||||||
|
makedepends = ninja
|
||||||
|
makedepends = extra-cmake-modules
|
||||||
|
depends = qt6-base
|
||||||
|
depends = qt6-declarative
|
||||||
|
depends = kirigami
|
||||||
|
depends = ki18n
|
||||||
|
depends = kcoreaddons
|
||||||
|
depends = kcrash
|
||||||
|
depends = kconfig
|
||||||
|
depends = mpvqt
|
||||||
|
depends = qcoro
|
||||||
|
depends = qtkeychain-qt6
|
||||||
|
depends = ffmpeg
|
||||||
|
depends = hicolor-icon-theme
|
||||||
|
optdepends = qqc2-desktop-style: Plasma look for the interface
|
||||||
|
optdepends = plasma-integration: Plasma file dialogs, colours and icons
|
||||||
|
source = https://git.trivk.dev/tri/QtPotato/releases/download/v0.1.0/qtpotato-0.1.0.tar.gz
|
||||||
|
sha256sums = 8ac4cd95e04880411f16009478765f698c1ba84538c776e68a431033e10ae837
|
||||||
|
|
||||||
|
pkgname = qtpotato
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# Maintainer: Tri Vo Khac
|
||||||
|
|
||||||
|
pkgname=qtpotato
|
||||||
|
pkgver=0.1.0
|
||||||
|
pkgrel=1
|
||||||
|
pkgdesc='KDE video player built on mpv that translates subtitles with an LLM'
|
||||||
|
arch=('x86_64')
|
||||||
|
url='https://git.trivk.dev/tri/QtPotato'
|
||||||
|
license=('GPL-3.0-or-later')
|
||||||
|
depends=('qt6-base' 'qt6-declarative' 'kirigami' 'ki18n' 'kcoreaddons' 'kcrash' 'kconfig'
|
||||||
|
'mpvqt' 'qcoro' 'qtkeychain-qt6' 'ffmpeg' 'hicolor-icon-theme')
|
||||||
|
makedepends=('cmake' 'ninja' 'extra-cmake-modules')
|
||||||
|
optdepends=('qqc2-desktop-style: Plasma look for the interface'
|
||||||
|
'plasma-integration: Plasma file dialogs, colours and icons')
|
||||||
|
source=("$url/releases/download/v$pkgver/$pkgname-$pkgver.tar.gz")
|
||||||
|
# Filled in by update-pkgbuild.sh from the release's SHA256SUMS.
|
||||||
|
sha256sums=('8ac4cd95e04880411f16009478765f698c1ba84538c776e68a431033e10ae837')
|
||||||
|
|
||||||
|
build() {
|
||||||
|
cmake -B build -S "$pkgname-$pkgver" -G Ninja \
|
||||||
|
-DCMAKE_BUILD_TYPE=None \
|
||||||
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
|
-DBUILD_TESTING=ON
|
||||||
|
cmake --build build
|
||||||
|
}
|
||||||
|
|
||||||
|
check() {
|
||||||
|
QT_QPA_PLATFORM=offscreen ctest --test-dir build --output-on-failure
|
||||||
|
}
|
||||||
|
|
||||||
|
package() {
|
||||||
|
DESTDIR="$pkgdir" cmake --install build
|
||||||
|
}
|
||||||
Executable
+18
@@ -0,0 +1,18 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Point the qtpotato PKGBUILD at a published release and regenerate .SRCINFO.
|
||||||
|
#
|
||||||
|
# Usage: packaging/aur/update-pkgbuild.sh <version> (e.g. 0.2.0, after the v0.2.0 release)
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
version="${1#v}"
|
||||||
|
dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
|
url="https://git.trivk.dev/tri/QtPotato/releases/download/v$version"
|
||||||
|
sum="$(curl -fsSL "$url/SHA256SUMS" | awk -v f="qtpotato-$version.tar.gz" '$2 == f { print $1 }')"
|
||||||
|
[[ -n "$sum" ]] || { echo "qtpotato-$version.tar.gz not found in $url/SHA256SUMS" >&2; exit 1; }
|
||||||
|
|
||||||
|
cd "$dir/qtpotato"
|
||||||
|
sed -i -e "s/^pkgver=.*/pkgver=$version/" -e "s/^pkgrel=.*/pkgrel=1/" \
|
||||||
|
-e "s/^sha256sums=.*/sha256sums=('$sum')/" PKGBUILD
|
||||||
|
makepkg --printsrcinfo > .SRCINFO
|
||||||
|
cd "$dir/qtpotato-git"
|
||||||
|
makepkg --printsrcinfo > .SRCINFO
|
||||||
Reference in new issue
Block a user