diff --git a/.SRCINFO b/.SRCINFO index 25774c0..03d6bcc 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,28 +1,15 @@ pkgbase = deskflow-bin - pkgdesc = Deskflow lets you share one mouse and keyboard between multiple computers - pkgver = 1.17.1 + pkgdesc = Share a single keyboard and mouse between multiple computers + pkgver = 1.26.0 pkgrel = 1 - url = https://deskflow.org/ + url = https://github.com/deskflow/deskflow arch = x86_64 - license = GPL-2.0 - depends = libxtst - depends = libxkbcommon - depends = libxkbcommon-x11 - depends = libnotify - depends = libxkbfile - depends = libxinerama - depends = libxrandr - depends = libei - depends = libportal - depends = qt6-base - depends = gdk-pixbuf2 - depends = pugixml - depends = tomlplusplus - optdepends = openssl: TLS encryption - optdepends = gtk3: GTK file/dir picker + license = AGPL3 provides = deskflow conflicts = deskflow - source = https://github.com/deskflow/deskflow/releases/download/v1.17.1/deskflow-1.17.1-arch-x86_64.pkg.tar.zst - sha256sums = eae8163c59ce8ac991eb1a9f59cb123b99ee350176693314e3489247397ef39b + options = !strip + options = !debug + source = deskflow-1.26.0.deb::https://github.com/deskflow/deskflow/releases/download/v1.26.0/deskflow-1.26.0-debian-trixie-x86_64.AppImage + sha256sums = 4760d432cd414539df029d1bf0776ebe9069f3c39193845badc52f36dcb27563 pkgname = deskflow-bin diff --git a/.gitignore b/.gitignore index daab163..6545585 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ -*/ +# Sources +*.deb +# built packages *.pkg.tar.zst -*.rpm \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..04f030a --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Bryan Joshua Pedini + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/PKGBUILD b/PKGBUILD index f86198b..6fb59cd 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -1,44 +1,24 @@ -# Maintainer: SelfRef +# Maintainer: Bryan Joshua Pedini -# INFO: Upstream binary is built with X11 support thus X11 dependencies are required. -# To built version for Wayland only use either `deskflow` or `deskflow-git` package. +_pkgname="deskflow" +_srcname="deskflow" +_srcmntr="deskflow" -_basename=deskflow -pkgname=${_basename}-bin -pkgver=1.17.1 -pkgrel=1 -pkgdesc="Deskflow lets you share one mouse and keyboard between multiple computers" -arch=('x86_64') -url="https://deskflow.org/" -license=('GPL-2.0') -depends=( - 'libxtst' - 'libxkbcommon' - 'libxkbcommon-x11' - 'libnotify' - 'libxkbfile' - 'libxinerama' - 'libxrandr' - 'libei' - 'libportal' - 'qt6-base' - 'gdk-pixbuf2' - 'pugixml' - 'tomlplusplus' - # 'libx11' # dependency of libxtst - # 'libxext' # dependency of libxtst - # 'libxi' # dependency of libxtst -) -optdepends=( - 'openssl: TLS encryption' - 'gtk3: GTK file/dir picker' -) -provides=("$_basename") -conflicts=("$_basename") -source=("https://github.com/deskflow/deskflow/releases/download/v$pkgver/deskflow-$pkgver-arch-x86_64.pkg.tar.zst") -sha256sums=('eae8163c59ce8ac991eb1a9f59cb123b99ee350176693314e3489247397ef39b') +pkgname="${_pkgname}-bin" +pkgver="1.26.0" +pkgrel="1" +pkgdesc="Share a single keyboard and mouse between multiple computers" +url="https://github.com/${_srcmntr}/${_srcname}" +arch=("x86_64") +license=("AGPL3") +options=("!strip" "!debug") +_archive="${_pkgname}-${pkgver}.deb" +source=("${_archive}::https://github.com/${_srcmntr}/${_srcname}/releases/download/v${pkgver}/deskflow-${pkgver}-debian-trixie-x86_64.AppImage") +conflicts=("deskflow") +provides=("deskflow") + +sha256sums=("4760d432cd414539df029d1bf0776ebe9069f3c39193845badc52f36dcb27563") package() { - mkdir "$pkgdir"/usr/ - cp -r usr/* "$pkgdir"/usr/ + bsdtar -xf "${srcdir}/data.tar.gz" -C "${pkgdir}" } diff --git a/README.md b/README.md new file mode 100644 index 0000000..d19af8a --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# deskflow-bin +PKGBUILD script for Arch Linux for `deskflow-bin` package diff --git a/push.sh b/push.sh new file mode 100644 index 0000000..7f68a3a --- /dev/null +++ b/push.sh @@ -0,0 +1,103 @@ +#!/usr/bin/env bash + +# Variables +gui=true +desktop="deskflow.desktop" +icon="deskflow.png" + +# Get version +oldver=$(grep -E "^pkgver=" PKGBUILD | sed 's/pkgver="//;s/"//') +if [ $# -eq 1 ]; then + pkgver="${1}" +else + echo "Old version: ${oldver}" + read -p "New version: " pkgver +fi + +# Check version +if [ "${pkgver}" = "${oldver}" ] && [ -z "${FORCE_REBUILD}" ]; then + echo >/dev/stderr "Error: same (old) version specified - update aborted" + exit +fi + +# Get variables from PKGBUILD +url=$(sed -n '/^source=(/,/)/p' PKGBUILD | grep -oE 'https?://[^"]+') +pkgname=$(grep -E "^pkgname=" PKGBUILD | sed 's/pkgname="//;s/"//') +_pkgname=$(grep -E "^_pkgname=" PKGBUILD | sed 's/_pkgname="//;s/"//') +_srcname=$(grep -E "^_srcname=" PKGBUILD | sed 's/_srcname="//;s/"//') +_srcmntr=$(grep -E "^_srcmntr=" PKGBUILD | sed 's/_srcmntr="//;s/"//') +_archive=$(grep -E "^_archive=" PKGBUILD | sed 's/_archive="//;s/"//') +pkgrel=$(grep -E "^pkgrel=" PKGBUILD | sed 's/pkgrel="//;s/"//') +aur_url="ssh://aur@aur.archlinux.org/${pkgname}.git" +if [ "${gui}" = "true" ] && [ -n "${_pkgname}" ]; then + newdesktop="${_pkgname}.desktop" + newicon="${_pkgname}.png" +else + newdesktop="${package}.desktop" + newicon="${package}.png" +fi + +# Perform variable substitution +url="${url//\$\{_pkgname\}/$_pkgname}" +url="${url//\$\{_srcname\}/$_srcname}" +url="${url//\$\{_srcmntr\}/$_srcmntr}" +url="${url//\$\{pkgver\}/$pkgver}" +_archive="${_archive//\$\{_pkgname\}/$_pkgname}" +_archive="${_archive//\$\{pkgver\}/$pkgver}" +aur_url="${aur_url//\$\{_pkgname\}/$_pkgname}" +pkgname="${pkgname//\$\{_pkgname\}/$_pkgname}" + +# Download archive +wget -qO ${_archive} "${url}" +# Extract icon / .desktop files if appimage +if printf '%s' "${_archive,,}" | grep -qi "appimage"; then + chmod +x "${_archive}" + "./${_archive}" --appimage-extract >/dev/null + cp "squashfs-root/${desktop}" "${newdesktop}" + cp "squashfs-root/${icon}" "${newicon}" + sed -i '/^X-AppImage-/d;/^$/d' "${newdesktop}" + sed -i 's/^Exec=.*/Exec=${_pkgname} %U/' "${newdesktop}" + rm -rf $(readlink -f squashfs-root) squashfs-root +fi +# Calculate checksums +sha256bin=$(sha256sum ${_archive} | awk '{print $1}') +if [ "${gui}" = "true" ]; then + sha256dsk=$(sha256sum ${newdesktop} | awk '{print $1}') + sha256ico=$(sha256sum ${newicon} | awk '{print $1}') +fi +# Yoink the archive - unnecessary anymore +rm -f ${_archive} + +# Update PKGBUILD with new values +sed -i -E "s/^pkgver=\"[^\"]+\"/pkgver=\"$pkgver\"/" PKGBUILD +if [ "${gui}" = "true" ]; then + sed -i '/^sha256sums=(/,/^)/c\ +sha256sums=(\ + "'"$sha256bin"'"\ + "'"$sha256dsk"'"\ + "'"$sha256ico"'"\ +)' PKGBUILD +else + sed -i -E "s/^sha256sums=\(\"[^\"]+\"\)/sha256sums=(\"$sha256bin\")/" PKGBUILD +fi +if [ "${pkgver}" != "${oldver}" ] && [ -n "${FORCE_REBUILD}" ]; then + sed -i -E "s/^pkgrel=\"[^\"]+\"/pkgrel=\"1\"/" PKGBUILD +fi +# Update .SRCINFO +makepkg --printsrcinfo > .SRCINFO + +# Create git message with correct variable +if [ -n "$_pkgname" ]; then + commit_msg="Updated ${pkgname//\$\{_pkgname\}/_pkgname} to ${pkgver}-${pkgrel}" +else + commit_msg="Updated ${pkgname} to ${pkgver}-${pkgrel}" +fi + +if [ -z "${NO_GIT_PUSH}" ]; then + # In case of fire, git commit, git push, leave building + git add . + git commit -m "${commit_msg}" + git remote add aur ${aur_url} + git push origin main + git push aur main:master +fi