feat: add awg-go and awg-apple recipes

This commit is contained in:
Yaroslav Gurov
2026-02-24 11:51:18 +01:00
parent 544ad4ba6e
commit 0bfbd82536
11 changed files with 10173 additions and 6248 deletions
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+9 -1
View File
@@ -5,4 +5,12 @@ class AmneziaVPN(ConanFile):
generators = "CMakeDeps" generators = "CMakeDeps"
def requirements(self): def requirements(self):
self.requires("amnezia-xray-bindings/1.1.0") os = str(self.settings.os)
arch = str(self.settings.arch)
if os == "Windows" or os == "Linux" or (os == "Macos" and arch == "x86_64"):
self.requires("amnezia-xray-bindings/1.1.0")
self.requires("awg-go/0.2.16")
if os == "iOS" or (os == "Macos" and arch == "arm64"):
self.requires("awg-apple/2.0.1")
+62
View File
@@ -0,0 +1,62 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.layout import basic_layout
from conan.tools.files import get, copy, collect_libs
import os
class AwgApple(ConanFile):
name = "awg-apple"
version = "2.0.1"
settings = "os", "arch"
_os_map = {
"iOS": "iphoneos",
"Macos": "macosx"
}
_arch_map = {
"x86_64": "x86_64",
"armv8": "arm64"
}
def build_requirements(self):
self.tool_requires("go/1.26.0")
if self.settings.os != "Windows":
self.build_requires("make/4.4.1")
def validate(self):
os = str(self.settings.os)
if os not in self._os_map:
raise ConanInvalidConfiguration(
f"{self.name} v{self.version} does not support {os}"
)
arch = str(self.settings.arch)
if arch not in self._arch_map:
raise ConanInvalidConfiguration(
f"{self.name} v{self.version} does not support {arch}"
)
def layout(self):
basic_layout(self, build_folder=os.path.join(self.folders.source, "Sources/WireGuardKitGo"))
def source(self):
get(self, f"https://github.com/amnezia-vpn/amneziawg-apple/archive/refs/tags/v{self.version}.zip",
sha256="9fe4f8cfbb6a751558b54b7979db3a5ea46e49731912aae99f093e84a1433e97", strip_root=True
)
def build(self):
os = self._os_map.get(str(self.settings.os))
arch = self._arch_map.get(str(self.settings.arch))
self.run(f"ARCHS={arch} PLATFORM_NAME={os} make")
def package(self):
copy(self, "wireguard.h", src=self.build_folder, dst=os.path.join(self.package_folder, "include"))
copy(self, "*.a", src=os.path.join(self.build_folder, "out"), dst=os.path.join(self.package_folder, "lib"))
def package_info(self):
self.cpp_info.set_property("cmake_target_name", "amnezia::awg-apple")
self.cpp_info.libs = collect_libs(self)
+57
View File
@@ -0,0 +1,57 @@
from conan import ConanFile
from conan.errors import ConanInvalidConfiguration
from conan.tools.layout import basic_layout
from conan.tools.files import get, copy
import os
class AwgGo(ConanFile):
name = "awg-go"
version = "0.2.16"
settings = "os", "arch"
_os_map = {
"Linux": "linux",
"Macos": "darwin",
"Windows": "windows"
}
_arch_map = {
"x86": "386",
"x86_64": "amd64",
"armv8": "arm64",
}
def validate(self):
os = str(self.settings.os)
if os not in self._os_map:
raise ConanInvalidConfiguration(
f"{self.name} v{self.version} does not support {os}"
)
arch = str(self.settings.arch)
if arch not in self._arch_map:
raise ConanInvalidConfiguration(
f"{self.name} v{self.version} does not support {arch}"
)
def source(self):
get(self, f"https://github.com/amnezia-vpn/amneziawg-go/archive/refs/tags/v{self.version}.zip",
sha256="34da7d4189f215f3930de441548bc2a0c89d54d347a4fb85cb9c715fce6413aa", strip_root=True
)
def layout(self):
basic_layout(self, build_folder=".")
def build(self):
os = self._os_map[str(self.settings.os)]
arch = self._arch_map[str(self.settings.arch)]
self.run(f"GOOS={os} GOARCH={arch} make")
def package(self):
copy(self, "amneziawg-go", src=self.build_folder, dst=os.path.join(self.package_folder, "bin"))
def package_info(self):
self.cpp_info.set_property("cmake_target_name", "amnezia::awg-go")