Skip to content

Commit 8115ee4

Browse files
Etn40ffEeems
andauthored
Add package for wireguard-tools (#743)
* Add package for wireguard-tools * Pull in provides from #600 * Add provides to wireguard packages * add conflicts --------- Co-authored-by: Nathaniel van Diepen <[email protected]>
1 parent ee79e99 commit 8115ee4

File tree

4 files changed

+51
-1
lines changed

4 files changed

+51
-1
lines changed

docs/package.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,21 @@ A list of packages that the current package replaces.
405405
Setting this field allows the current package to overwrite and take ownership of files from other packages.
406406
Note that the replaced packages will not be automatically uninstalled unless you also declare a conflict with them using the [`conflicts` field](#conflicts-field).
407407

408+
#### `provides` field
409+
410+
<table>
411+
<tr>
412+
<th>Required?</th>
413+
<td>No, defaults to <code>()</code></th>
414+
</tr>
415+
<tr>
416+
<th>Type</th>
417+
<td>Array of strings</td>
418+
</tr>
419+
</table>
420+
421+
A list of virtual packages that the current package provides.
422+
408423
#### `package()` function
409424

410425
The `package()` function populates the `$pkgdir` directory with the files and directories that need to be installed using artifacts from the `$srcdir` directory.

package/wireguard-tools/package

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2031 The Toltec Contributors
3+
# SPDX-License-Identifier: MIT
4+
5+
pkgnames=(wireguard-tools)
6+
pkgdesc="Fast, modern, secure VPN tunnel"
7+
url=https://www.wireguard.com
8+
pkgver=1.0.20210914-1
9+
timestamp=2021-02-23T00:00Z
10+
section=kernel
11+
maintainer="Salvatore Stella <[email protected]>"
12+
license=GPL-2.0-only
13+
image=base:v3.1
14+
provides=(wireguard-tools)
15+
conflicts=(wireguard)
16+
source=("https://git.zx2c4.com/wireguard-tools/snapshot/wireguard-tools-${pkgver%-*}.tar.xz")
17+
18+
sha256sums=(97ff31489217bb265b7ae850d3d0f335ab07d2652ba1feec88b734bc96bd05ac)
19+
20+
prepare() {
21+
# The symlink at src/wg-quick/wg needs something to point to
22+
touch "$srcdir/src/wg"
23+
}
24+
25+
build() {
26+
make -C "$srcdir/src" PLATFORM=linux "CC=${CROSS_COMPILE}cc"
27+
}
28+
29+
package() {
30+
install -D -t "$pkgdir/opt/bin" "$srcdir/src/wg"
31+
install -D "$srcdir/src/wg-quick/linux.bash" "$pkgdir/opt/bin/wg-quick"
32+
}

package/wireguard/package

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ maintainer="Jonah Weissman <[email protected]>"
1313
license=GPL-2.0-only
1414
makedepends=(build:bc build:lzop build:git)
1515
flags=(nostrip)
16+
provides=(wireguard-tools)
1617

1718
_kernelrepo=https://github.com/remarkable/linux
1819
_kernelrevs=(

scripts/toltec/recipe.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,7 @@ class Package: # pylint:disable=too-many-instance-attributes
344344
installdepends: Set[Dependency]
345345
conflicts: Set[Dependency]
346346
replaces: Set[Dependency]
347+
provides: Set[Dependency]
347348

348349
functions: bash.Functions
349350
custom_functions: bash.Functions
@@ -391,7 +392,7 @@ def _load_fields(self, variables: bash.Variables) -> None:
391392
self.license = _pop_field_string(variables, "license")
392393
self.variables["license"] = self.license
393394

394-
for field in ("installdepends", "conflicts", "replaces"):
395+
for field in ("installdepends", "conflicts", "replaces", "provides"):
395396
field_raw = _pop_field_indexed(variables, field, [])
396397
self.variables[field] = field_raw
397398
setattr(self, field, set())
@@ -483,6 +484,7 @@ def control_fields(self) -> str:
483484
("Depends", self.installdepends),
484485
("Conflicts", self.conflicts),
485486
("Replaces", self.replaces),
487+
("Provides", self.provides),
486488
):
487489
if field:
488490
control += (

0 commit comments

Comments
 (0)