From 33989073a02780a98d9e3bf8a2963debeba44fbd Mon Sep 17 00:00:00 2001 From: Salvatore Stella Date: Wed, 27 Sep 2023 11:54:42 +0200 Subject: [PATCH 1/4] Add package for wireguard-tools --- package/wireguard-tools/package | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 package/wireguard-tools/package diff --git a/package/wireguard-tools/package b/package/wireguard-tools/package new file mode 100755 index 000000000..8c0550769 --- /dev/null +++ b/package/wireguard-tools/package @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +# Copyright (c) 2031 The Toltec Contributors +# SPDX-License-Identifier: MIT + +pkgnames=(wireguard-tools) +pkgdesc="Fast, modern, secure VPN tunnel" +url=https://www.wireguard.com +pkgver=1.0.20210914-1 +timestamp=2021-02-23T00:00Z +section=kernel +maintainer="Salvatore Stella " +license=GPL-2.0-only +image=base:v3.1 +source=("https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-${pkgver%-*}.tar.xz") + +sha256sums=(97ff31489217bb265b7ae850d3d0f335ab07d2652ba1feec88b734bc96bd05ac) + +prepare() { + # The symlink at src/wg-quick/wg needs something to point to + touch "$srcdir/src/wg" +} + +build() { + make -C "$srcdir/src" PLATFORM=linux "CC=${CROSS_COMPILE}cc" +} + +package() { + install -D -t "$pkgdir/opt/bin" "$srcdir/src/wg" + install -D "$srcdir/src/wg-quick/linux.bash" "$pkgdir/opt/bin/wg-quick" +} From ce079d1421609595dc086855bc6fa49fa25848b9 Mon Sep 17 00:00:00 2001 From: Salvatore Stella Date: Wed, 22 Nov 2023 00:44:47 +0100 Subject: [PATCH 2/4] Pull in provides from #600 --- docs/package.md | 15 +++++++++++++++ scripts/toltec/recipe.py | 4 +++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/docs/package.md b/docs/package.md index fcd9690a4..b49a1d134 100644 --- a/docs/package.md +++ b/docs/package.md @@ -404,6 +404,21 @@ A list of packages that the current package replaces. Setting this field allows the current package to overwrite and take ownership of files from other packages. Note that the replaced packages will not be automatically uninstalled unless you also declare a conflict with them using the [`conflicts` field](#conflicts-field). +#### `provides` field + + + + + + + + + +
Required?No, defaults to () +
TypeArray of strings
+ +A list of virtual packages that the current package provides. + #### `package()` function The `package()` function populates the `$pkgdir` directory with the files and directories that need to be installed using artifacts from the `$srcdir` directory. diff --git a/scripts/toltec/recipe.py b/scripts/toltec/recipe.py index fc1cf9ae0..de3844490 100644 --- a/scripts/toltec/recipe.py +++ b/scripts/toltec/recipe.py @@ -344,6 +344,7 @@ class Package: # pylint:disable=too-many-instance-attributes installdepends: Set[Dependency] conflicts: Set[Dependency] replaces: Set[Dependency] + provides: Set[Dependency] functions: bash.Functions custom_functions: bash.Functions @@ -391,7 +392,7 @@ def _load_fields(self, variables: bash.Variables) -> None: self.license = _pop_field_string(variables, "license") self.variables["license"] = self.license - for field in ("installdepends", "conflicts", "replaces"): + for field in ("installdepends", "conflicts", "replaces", "provides"): field_raw = _pop_field_indexed(variables, field, []) self.variables[field] = field_raw setattr(self, field, set()) @@ -483,6 +484,7 @@ def control_fields(self) -> str: ("Depends", self.installdepends), ("Conflicts", self.conflicts), ("Replaces", self.replaces), + ("Provides", self.provides), ): if field: control += ( From d1f11c6937f549b4b11467112696e516e9370771 Mon Sep 17 00:00:00 2001 From: Salvatore Stella Date: Wed, 22 Nov 2023 00:59:46 +0100 Subject: [PATCH 3/4] Add provides to wireguard packages --- package/wireguard-tools/package | 1 + package/wireguard/package | 1 + 2 files changed, 2 insertions(+) diff --git a/package/wireguard-tools/package b/package/wireguard-tools/package index 8c0550769..830d96210 100755 --- a/package/wireguard-tools/package +++ b/package/wireguard-tools/package @@ -11,6 +11,7 @@ section=kernel maintainer="Salvatore Stella " license=GPL-2.0-only image=base:v3.1 +provides=(wireguard-tools) source=("https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-${pkgver%-*}.tar.xz") sha256sums=(97ff31489217bb265b7ae850d3d0f335ab07d2652ba1feec88b734bc96bd05ac) diff --git a/package/wireguard/package b/package/wireguard/package index d01ce5f3a..67b900c9d 100755 --- a/package/wireguard/package +++ b/package/wireguard/package @@ -13,6 +13,7 @@ maintainer="Jonah Weissman " license=GPL-2.0-only makedepends=(build:bc build:lzop build:git) flags=(nostrip) +provides=(wireguard-tools) _kernelrepo=https://github.com/remarkable/linux _kernelrevs=( From f20b80d24dd0b7343bcae240036b39851259ebd2 Mon Sep 17 00:00:00 2001 From: Salvatore Stella Date: Wed, 22 Nov 2023 01:08:50 +0100 Subject: [PATCH 4/4] add conflicts --- package/wireguard-tools/package | 1 + 1 file changed, 1 insertion(+) diff --git a/package/wireguard-tools/package b/package/wireguard-tools/package index 830d96210..87bbb3971 100755 --- a/package/wireguard-tools/package +++ b/package/wireguard-tools/package @@ -12,6 +12,7 @@ maintainer="Salvatore Stella " license=GPL-2.0-only image=base:v3.1 provides=(wireguard-tools) +conflicts=(wireguard) source=("https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-${pkgver%-*}.tar.xz") sha256sums=(97ff31489217bb265b7ae850d3d0f335ab07d2652ba1feec88b734bc96bd05ac)