diff --git a/.github/workflows/aur.yml b/.github/workflows/aur.yml new file mode 100644 index 00000000..d7e1ce86 --- /dev/null +++ b/.github/workflows/aur.yml @@ -0,0 +1,26 @@ +name: aur-updater +on: + push: + branches: + - master + +jobs: + update: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: update version + if: startsWith(github.ref, 'refs/tags/v') + run: | + sed -i "s/pkgver=.*/pkgver=$(git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | tr -d 'v')/" aur/mihomo-party-git/PKGBUILD + - name: Publish AUR package + uses: KSXGitHub/github-actions-deploy-aur@v2.7.2 + with: + pkgname: mihomo-party-git + pkgbuild: aur/mihomo-party-git/PKGBUILD + commit_username: pompurin404 + commit_email: pompurin404@mihomo.party + ssh_private_key: ${{ secrets.PRIVATE_KEY }} + commit_message: Update AUR package + ssh_keyscan_types: rsa,ed25519 + allow_empty_commits: false diff --git a/aur/mihomo-party-bin/PKGBUILD b/aur/mihomo-party-bin/PKGBUILD new file mode 100644 index 00000000..f0731b1e --- /dev/null +++ b/aur/mihomo-party-bin/PKGBUILD @@ -0,0 +1,29 @@ +pkgname=mihomo-party-bin +_pkgname=mihomo-party +pkgver=0.1.3 +pkgrel=1 +pkgdesc="Another Mihomo GUI." +arch=('x86_64' 'aarch64') +url="https://github.com/pompurin404/mihomo-party" +license=('GPL3') +conflicts=("mihomo-party-git" 'mihomo-party') +depends=('gtk3' 'libnotify' 'nss' 'libxss' 'libxtst' 'xdg-utils' 'at-spi2-core' 'util-linux-libs' 'at-spi2-core' 'libsecret') +optdepends=('libappindicator-gtk3: Allow mihomo-party to extend a menu via Ayatana indicators in Unity, KDE or Systray (GTK+ 3 library).') +makedepends=('nodejs' 'pnpm' 'jq' 'libxcrypt-compat') +install=$_pkgname.install +source_x86_64=("${_pkgname}-${pkgver}-x86_64.deb::${url}/releases/download/v${pkgver}/mihomo-party-linux-${pkgver}-amd64.deb") +source_x86_64=("${_pkgname}-${pkgver}-aarch64.deb::${url}/releases/download/v${pkgver}/mihomo-party-linux-${pkgver}-arm64.deb") +sha256sums_x86_64=('b8d166f1134573336aaae1866d25262284b0cbabbf393684226aca0fd8d1bd83') +sha256sums_aarch64=('8cd7398b8fc1cd70d41e386af9995cbddc1043d9018391c29f056f1435712a10') + +package() { + tar xpf data.tar.gz -C ${pkgdir} + chmod +x ${pkgdir}/opt/mihomo-party/mihomo-party + chmod +x ${pkgdir}/opt/mihomo-party/resources/sidecar/mihomo + chmod +x ${pkgdir}/opt/mihomo-party/resources/sidecar/mihomo-alpha + cd ${pkgdir}/../.. + install -Dm755 "${_pkgname}.sh" "${pkgdir}/usr/bin/${_pkgname}" + sed -i '3s!/opt/mihomo-party/mihomo-party!mihomo-party!' "${pkgdir}/usr/share/applications/${_pkgname}.desktop" + + chown -R root:root ${pkgdir} +} diff --git a/aur/mihomo-party-bin/mihomo-party.install b/aur/mihomo-party-bin/mihomo-party.install new file mode 100644 index 00000000..218d794c --- /dev/null +++ b/aur/mihomo-party-bin/mihomo-party.install @@ -0,0 +1,14 @@ +# Colored makepkg-like functions +note() { + printf "${_blue}==>${_yellow} NOTE:${_bold} %s${_all_off}\n" "$1" +} + +_all_off="$(tput sgr0)" +_bold="${_all_off}$(tput bold)" +_blue="${_bold}$(tput setaf 4)" +_yellow="${_bold}$(tput setaf 3)" + +post_install() { + note "Custom flags should be put directly in: ~/.config/mihomo-party-flags.conf" + note "The launcher is called: 'mihomo-party'" +} \ No newline at end of file diff --git a/aur/mihomo-party-bin/mihomo-party.sh b/aur/mihomo-party-bin/mihomo-party.sh new file mode 100644 index 00000000..6304ccbd --- /dev/null +++ b/aur/mihomo-party-bin/mihomo-party.sh @@ -0,0 +1,12 @@ +#!/usr/bin/bash + +XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config} + +# Allow users to override command-line options +if [[ -f "${XDG_CONFIG_HOME}/mihomo-party-flags.conf" ]]; then + mapfile -t MIHOMO_PARTY_USER_FLAGS <<<"$(grep -v '^#' "${XDG_CONFIG_HOME}/mihomo-party-flags.conf")" + echo "User flags:" ${MIHOMO_PARTY_USER_FLAGS[@]} +fi + +# Launch +exec /opt/mihomo-party/mihomo-party ${MIHOMO_PARTY_USER_FLAGS[@]} "$@" diff --git a/aur/mihomo-party-git/PKGBUILD b/aur/mihomo-party-git/PKGBUILD new file mode 100644 index 00000000..5bdf2321 --- /dev/null +++ b/aur/mihomo-party-git/PKGBUILD @@ -0,0 +1,52 @@ +pkgname=mihomo-party-git +_pkgname=${pkgname%-git} +pkgver=0.1.3.r4.g935b95b +pkgrel=1 +pkgdesc="Another Mihomo GUI." +arch=('x86_64' 'aarch64') +url="https://github.com/pompurin404/mihomo-party" +license=('GPL3') +conflicts=("mihomo-party" 'mihomo-party-bin') +depends=('gtk3' 'libnotify' 'nss' 'libxss' 'libxtst' 'xdg-utils' 'at-spi2-core' 'util-linux-libs' 'at-spi2-core' 'libsecret') +optdepends=('libappindicator-gtk3: Allow mihomo-party to extend a menu via Ayatana indicators in Unity, KDE or Systray (GTK+ 3 library).') +makedepends=('nodejs' 'pnpm' 'jq' 'libxcrypt-compat') +install=$_pkgname.install +source=("git+$url.git") +sha256sums=("SKIP") +options=('!lto') + +pkgver() { + cd $srcdir/${_pkgname} + ( set -o pipefail + git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | tr -d 'v' || + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + ) +} + +prepare(){ + cd $srcdir/${_pkgname} + pnpm install +} + +build(){ + cd $srcdir/${_pkgname} + pnpm build:linux deb +} + +package() { + version = jq '.version'|tr -d 'v"' + cd $srcdir/${_pkgname}/dist + bsdtar -xf mihomo-party-linux-${version}*.deb + bsdtar -xf data.tar.xz -C "${pkgdir}/" + chmod +x ${pkgdir}/opt/mihomo-party/mihomo-party + chmod +x ${pkgdir}/opt/mihomo-party/resources/sidecar/mihomo + chmod +x ${pkgdir}/opt/mihomo-party/resources/sidecar/mihomo-alpha + cd ${pkgdir}/../.. + # Launcher + install -Dm755 "${_pkgname}.sh" "${pkgdir}/usr/bin/${_pkgname}" + + # Launcher Fix + sed -i '3s!/opt/mihomo-party/mihomo-party!mihomo-party!' "${pkgdir}/usr/share/applications/${_pkgname}.desktop" + + chown -R root:root ${pkgdir} +} diff --git a/aur/mihomo-party-git/mihomo-party.install b/aur/mihomo-party-git/mihomo-party.install new file mode 100644 index 00000000..218d794c --- /dev/null +++ b/aur/mihomo-party-git/mihomo-party.install @@ -0,0 +1,14 @@ +# Colored makepkg-like functions +note() { + printf "${_blue}==>${_yellow} NOTE:${_bold} %s${_all_off}\n" "$1" +} + +_all_off="$(tput sgr0)" +_bold="${_all_off}$(tput bold)" +_blue="${_bold}$(tput setaf 4)" +_yellow="${_bold}$(tput setaf 3)" + +post_install() { + note "Custom flags should be put directly in: ~/.config/mihomo-party-flags.conf" + note "The launcher is called: 'mihomo-party'" +} \ No newline at end of file diff --git a/aur/mihomo-party-git/mihomo-party.sh b/aur/mihomo-party-git/mihomo-party.sh new file mode 100644 index 00000000..6304ccbd --- /dev/null +++ b/aur/mihomo-party-git/mihomo-party.sh @@ -0,0 +1,12 @@ +#!/usr/bin/bash + +XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config} + +# Allow users to override command-line options +if [[ -f "${XDG_CONFIG_HOME}/mihomo-party-flags.conf" ]]; then + mapfile -t MIHOMO_PARTY_USER_FLAGS <<<"$(grep -v '^#' "${XDG_CONFIG_HOME}/mihomo-party-flags.conf")" + echo "User flags:" ${MIHOMO_PARTY_USER_FLAGS[@]} +fi + +# Launch +exec /opt/mihomo-party/mihomo-party ${MIHOMO_PARTY_USER_FLAGS[@]} "$@" diff --git a/aur/mihomo-party/PKGBUILD b/aur/mihomo-party/PKGBUILD new file mode 100644 index 00000000..99edfaae --- /dev/null +++ b/aur/mihomo-party/PKGBUILD @@ -0,0 +1,43 @@ +pkgname=mihomo-party +pkgver=0.1.3 +pkgrel=1 +pkgdesc="Another Mihomo GUI." +arch=('x86_64' 'aarch64') +url="https://github.com/pompurin404/mihomo-party" +license=('GPL3') +conflicts=("mihomo-party-git" 'mihomo-party-bin') +depends=('gtk3' 'libnotify' 'nss' 'libxss' 'libxtst' 'xdg-utils' 'at-spi2-core' 'util-linux-libs' 'at-spi2-core' 'libsecret') +optdepends=('libappindicator-gtk3: Allow mihomo-party to extend a menu via Ayatana indicators in Unity, KDE or Systray (GTK+ 3 library).') +makedepends=('nodejs' 'pnpm' 'jq' 'libxcrypt-compat') +install=$pkgname.install +source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz") +sha256sums=("52d761e9432e17477acb8adb5744676df946476e0eb5210fee2b6d45f497f218") +options=('!lto') + +prepare(){ + cd $srcdir/${pkgname} + pnpm install +} + +build(){ + cd $srcdir/${pkgname} + pnpm build:linux deb +} + +package() { + version = jq '.version'|tr -d 'v"' + cd $srcdir/${pkgname}/dist + bsdtar -xf mihomo-party-linux-${version}*.deb + bsdtar -xf data.tar.xz -C "${pkgdir}/" + chmod +x ${pkgdir}/opt/mihomo-party/mihomo-party + chmod +x ${pkgdir}/opt/mihomo-party/resources/sidecar/mihomo + chmod +x ${pkgdir}/opt/mihomo-party/resources/sidecar/mihomo-alpha + cd ${pkgdir}/../.. + # Launcher + install -Dm755 "${pkgname}.sh" "${pkgdir}/usr/bin/${pkgname}" + + # Launcher Fix + sed -i '3s!/opt/mihomo-party/mihomo-party!mihomo-party!' "${pkgdir}/usr/share/applications/${pkgname}.desktop" + + chown -R root:root ${pkgdir} +} diff --git a/aur/mihomo-party/mihomo-party.install b/aur/mihomo-party/mihomo-party.install new file mode 100644 index 00000000..218d794c --- /dev/null +++ b/aur/mihomo-party/mihomo-party.install @@ -0,0 +1,14 @@ +# Colored makepkg-like functions +note() { + printf "${_blue}==>${_yellow} NOTE:${_bold} %s${_all_off}\n" "$1" +} + +_all_off="$(tput sgr0)" +_bold="${_all_off}$(tput bold)" +_blue="${_bold}$(tput setaf 4)" +_yellow="${_bold}$(tput setaf 3)" + +post_install() { + note "Custom flags should be put directly in: ~/.config/mihomo-party-flags.conf" + note "The launcher is called: 'mihomo-party'" +} \ No newline at end of file diff --git a/aur/mihomo-party/mihomo-party.sh b/aur/mihomo-party/mihomo-party.sh new file mode 100644 index 00000000..6304ccbd --- /dev/null +++ b/aur/mihomo-party/mihomo-party.sh @@ -0,0 +1,12 @@ +#!/usr/bin/bash + +XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config} + +# Allow users to override command-line options +if [[ -f "${XDG_CONFIG_HOME}/mihomo-party-flags.conf" ]]; then + mapfile -t MIHOMO_PARTY_USER_FLAGS <<<"$(grep -v '^#' "${XDG_CONFIG_HOME}/mihomo-party-flags.conf")" + echo "User flags:" ${MIHOMO_PARTY_USER_FLAGS[@]} +fi + +# Launch +exec /opt/mihomo-party/mihomo-party ${MIHOMO_PARTY_USER_FLAGS[@]} "$@"