Initial commit

This commit is contained in:
Christian Schendel 2025-09-03 22:18:51 +02:00
commit 2b61f2be37
Signed by: doppelhelix
GPG key ID: 5874D2437CD5BBB3
10 changed files with 289 additions and 0 deletions

28
.SRCINFO Normal file
View file

@ -0,0 +1,28 @@
pkgbase = wireguird
pkgdesc = GUI frontend to connect to and manage WireGuard tunnels (GTK3)
pkgver = 1.1.0
pkgrel = 2
url = https://github.com/UnnoTed/wireguird
arch = x86_64
license = MIT
makedepends = git
makedepends = go
depends = bash
depends = cairo
depends = fontconfig
depends = gdk-pixbuf2
depends = glib2
depends = glibc
depends = gtk3
depends = hicolor-icon-theme
depends = libayatana-appindicator
depends = openresolv
depends = pango
depends = polkit
depends = wireguard-tools
source = wireguird-1.1.0::git+https://github.com/UnnoTed/wireguird.git#tag=v1.1.0
source = wireguird.desktop.patch
b2sums = 66538951a7fda7e58997a022fd49d4a3a23862a8f859c1b9551599de5d5606e023262c05fc48513789d5568267a019f9af7c1ca5be431afd88358a7ef2aeed67
b2sums = e6f387cc259f9ad84a921c6f4abfa2645aff9b909a327492faa44d180079578bfa863d11f57cac4b8f937983bdc2dbeeb6a075ada704f2c8540462b35614c6bf
pkgname = wireguird

17
.gitignore vendored Normal file
View file

@ -0,0 +1,17 @@
# Ignore everything
*
# But not these files...
!.gitignore
!PKGBUILD
!.SRCINFO
!LICENSE
!chroot-build
!.nvchecker.toml
!/keys
!/keys/pgp
!/keys/pgp/*.asc
!/LICENSES
!/LICENSES/*.txt
!REUSE.toml
!*.patch

4
.nvchecker.toml Normal file
View file

@ -0,0 +1,4 @@
[wireguird]
source = "git"
git = "https://github.com/UnnoTed/wireguird.git"
prefix = "v"

12
LICENSE Normal file
View file

@ -0,0 +1,12 @@
Copyright Arch Linux Contributors
Permission to use, copy, modify, and/or distribute this software for
any purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE
FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY
DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

1
LICENSES/0BSD.txt Symbolic link
View file

@ -0,0 +1 @@
../LICENSE

18
LICENSES/MIT.txt Normal file
View file

@ -0,0 +1,18 @@
MIT License
Copyright (c) <year> <copyright holders>
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.

100
PKGBUILD Normal file
View file

@ -0,0 +1,100 @@
# Maintainer: Christian Schendel <doppelhelix@gmail.com>
# Contributor: flan_suse <windows2linux_AT_zoho_DOT_com>
# The "stylized" name of the application is "WireGUIrd" (aka: "wireguard GUI")
# PACKAGER'S NOTE:
# This program runs with elevated permissions ("Polkit").
# The config file is located under /root/wireguird.settings
# It's preferable to use your WireGuard VPN provider's official application.
# If they do not provide one, you can use NetworkManager to create WireGuard tunnels.
# As a last resort, this application is a simple GUI that leverages "wg-quick".
# Any *.conf files found under /etc/wireguard will automatically be loaded in the list.
# You can also manually add or remove WireGuard *.conf files using the GUI interface.
# IMPORTANT NOTE ABOUT USAGE:
# If a config's filename is longer than 15 characters, you cannot activate the tunnel.
# This is due to a limitation of interface names on Linux.
pkgname=wireguird
pkgver=1.1.0
pkgrel=2
pkgdesc="GUI frontend to connect to and manage WireGuard tunnels (GTK3)"
arch=('x86_64')
url="https://github.com/UnnoTed/wireguird"
license=('MIT')
depends=(
bash
cairo
fontconfig
gdk-pixbuf2
glib2
glibc
gtk3
hicolor-icon-theme
libayatana-appindicator
openresolv
pango
polkit
wireguard-tools
)
makedepends=(
git
go
)
source=(
"$pkgname-$pkgver::git+$url.git#tag=v$pkgver"
'wireguird.desktop.patch'
)
b2sums=('66538951a7fda7e58997a022fd49d4a3a23862a8f859c1b9551599de5d5606e023262c05fc48513789d5568267a019f9af7c1ca5be431afd88358a7ef2aeed67'
'e6f387cc259f9ad84a921c6f4abfa2645aff9b909a327492faa44d180079578bfa863d11f57cac4b8f937983bdc2dbeeb6a075ada704f2c8540462b35614c6bf')
prepare() {
cd "$pkgname-$pkgver"
mkdir -p build/
# a patch is more robust than sed
patch -p1 -i ../wireguird.desktop.patch
}
build() {
cd $pkgname-$pkgver
# Prepare the environment, so as to not download modules outside
# the working source directory
mkdir -p "$srcdir/go/"{.config,.cache}
export GOPATH=$srcdir/go
export GOENV=$srcdir/go/.config
export GOCACHE=$srcdir/go/.cache
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"
go build -o build
go clean -cache -modcache
}
package() {
cd "$pkgname-$pkgver"
install -dm0755 "$pkgdir/opt/$pkgname"
install -Dm0755 build/$pkgname "$pkgdir/opt/$pkgname"
install -dm0755 "$pkgdir/opt/$pkgname/Icon"
cp -a --no-preserve=ownership Icon "$pkgdir/opt/$pkgname"
install -dm0755 "$pkgdir/usr/share/icons/hicolor/scalable/apps"
install -Dm0644 Icon/wireguard.svg \
"$pkgdir/usr/share/icons/hicolor/scalable/apps/wireguird.svg"
install -Dm0755 -t "$pkgdir/usr/bin" \
deb/usr/local/bin/wireguird
cp -a --no-preserve=ownership deb/usr/share "$pkgdir/usr"
install -Dm0644 -t "$pkgdir/usr/share/doc/$pkgname/" \
README.md preview.png deb/DEBIAN/changelog
install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
}

30
REUSE.toml Normal file
View file

@ -0,0 +1,30 @@
version = 1
[[annotations]]
path = [
"PKGBUILD",
"README.md",
"keys/**",
".SRCINFO",
".nvchecker.toml",
".gitignore",
"*.install",
"*.sysusers",
"*.tmpfiles",
"*.logrotate",
"*.pam",
"*.service",
"*.socket",
"*.timer",
"*.desktop",
"*.hook",
]
SPDX-FileCopyrightText = "Arch Linux contributors"
SPDX-License-Identifier = "0BSD"
[[annotations]]
path = [
"*.patch",
]
SPDX-FileCopyrightText = "wireguird contributors"
SPDX-License-Identifier = "MIT"

65
chroot-build Executable file
View file

@ -0,0 +1,65 @@
#!/bin/bash
# SPDX-FileCopyrightText: Christian Schendel
# SPDX-License-Identifier: 0BSD
set -euo pipefail
use_tmpfs=true
CHROOT="/tmp/mkarchroot"
check_available_ram() {
if [ "$(awk '/^MemAvailable:/ { print $2; }' /proc/meminfo)" -lt 50000 ]; then
use_tmpfs=false
fi
}
create_chroot_directory() {
if [ $use_tmpfs ]; then
sudo mount --mkdir -t tmpfs -o defaults,size=20G tmpfs $CHROOT
else
sudo mkdir -p "$CHROOT"
fi
}
create_chroot_environment() {
if [[ ! -d "$CHROOT/root" ]]; then
mkarchroot -M ~/.config/pacman/makepkg.conf "$CHROOT/root" base-devel
fi
}
build_package(){
arch-nspawn "$CHROOT/root" pacman -Syu
if makechrootpkg -c -r "$CHROOT" -- -Asf . ; then
makepkg --printsrcinfo >.SRCINFO
else
delete_chroot_environment && echo -e "\n\e[1;31m==> BUILD FAILED: \e[1;37m$CHROOT removed\e[0m " && exit 1
fi
}
sign_package(){
PACKAGE="$(makepkg --packagelist)"
gpg --use-agent --output "$PACKAGE.sig" --detach-sign "$PACKAGE"
}
delete_chroot_environment() {
if [ "$(stat -f --format=%T "$CHROOT")" == "btrfs" ]; then
{
sudo btrfs subvolume delete "$CHROOT/root/var/lib/portables"
sudo btrfs subvolume delete "$CHROOT/root/var/lib/machines"
sudo btrfs subvolume delete "$CHROOT/root"
sudo rm -Rf $CHROOT
} >>/dev/null 2>&1
elif [ "$(stat -f --format=%T "$CHROOT")" == "tmpfs" ]; then
sudo umount -f $CHROOT
fi
sudo rm -Rf $CHROOT
}
check_available_ram
create_chroot_directory
create_chroot_environment
build_package
sign_package
delete_chroot_environment
# vim: set ts=4 sw=4 et:

14
wireguird.desktop.patch Normal file
View file

@ -0,0 +1,14 @@
--- a/deb/usr/share/applications/wireguird.desktop
+++ b/deb/usr/share/applications/wireguird.desktop
@@ -3,6 +3,8 @@
Version=1.1
Type=Application
Terminal=false
-Exec=/usr/local/bin/wireguird
+Exec=wireguird
Name=Wireguird
-Icon=/opt/wireguird/Icon/128x128/wireguard.png
+Icon=wireguird
+Categories=Network
+Comment=Manage, create, and connect to WireGuard tunnels