From 57084eb6061b62092ab3ff44d031bfd38c323fc8 Mon Sep 17 00:00:00 2001 From: albexk Date: Fri, 24 May 2024 20:34:09 +0300 Subject: [PATCH] Restore getting goBackend version from go.mod --- .../UI/iOS/ViewController/SettingsTableViewController.swift | 6 +++--- Sources/WireGuardApp/UI/macOS/AppDelegate.swift | 2 +- Sources/WireGuardKitGo/Makefile | 2 +- WireGuard.xcodeproj/project.pbxproj | 2 -- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Sources/WireGuardApp/UI/iOS/ViewController/SettingsTableViewController.swift b/Sources/WireGuardApp/UI/iOS/ViewController/SettingsTableViewController.swift index d643de594..253d42543 100644 --- a/Sources/WireGuardApp/UI/iOS/ViewController/SettingsTableViewController.swift +++ b/Sources/WireGuardApp/UI/iOS/ViewController/SettingsTableViewController.swift @@ -150,9 +150,9 @@ extension SettingsTableViewController { } cell.value = appVersion } -// else if field == .goBackendVersion { -// cell.value = WIREGUARD_GO_VERSION -// } + else if field == .goBackendVersion { + cell.value = WIREGUARD_GO_VERSION + } return cell } else if field == .exportZipArchive { let cell: ButtonCell = tableView.dequeueReusableCell(for: indexPath) diff --git a/Sources/WireGuardApp/UI/macOS/AppDelegate.swift b/Sources/WireGuardApp/UI/macOS/AppDelegate.swift index a2471d6db..1dda3e61a 100644 --- a/Sources/WireGuardApp/UI/macOS/AppDelegate.swift +++ b/Sources/WireGuardApp/UI/macOS/AppDelegate.swift @@ -195,7 +195,7 @@ extension AppDelegate { } let appVersionString = [ tr(format: "macAppVersion (%@)", appVersion), -// tr(format: "macGoBackendVersion (%@)", WIREGUARD_GO_VERSION) + tr(format: "macGoBackendVersion (%@)", WIREGUARD_GO_VERSION) ].joined(separator: "\n") NSApp.activate(ignoringOtherApps: true) NSApp.orderFrontStandardAboutPanel(options: [ diff --git a/Sources/WireGuardKitGo/Makefile b/Sources/WireGuardKitGo/Makefile index 16cb2d584..542f0154a 100644 --- a/Sources/WireGuardKitGo/Makefile +++ b/Sources/WireGuardKitGo/Makefile @@ -46,7 +46,7 @@ endef $(foreach ARCH,$(ARCHS),$(eval $(call libwg-go-a,$(ARCH)))) $(DESTDIR)/wireguard-go-version.h: go.mod $(GOROOT)/.prepared - sed -E -n 's/.*golang\.zx2c4\.com\/wireguard +v[0-9.]+-[0-9]+-([0-9a-f]{8})[0-9a-f]{4}.*/#define WIREGUARD_GO_VERSION "\1"/p' "$<" > "$@" + sed -E -n 's/.*github\.com\/amnezia-vpn\/amneziawg-go +v([0-9.]+).*/#define WIREGUARD_GO_VERSION "\1"/p' "$<" > "$@" $(DESTDIR)/libwg-go.a: $(foreach ARCH,$(ARCHS),$(BUILDDIR)/libwg-go-$(ARCH).a) @mkdir -vp "$(DESTDIR)" diff --git a/WireGuard.xcodeproj/project.pbxproj b/WireGuard.xcodeproj/project.pbxproj index e1cabd70d..b36685475 100644 --- a/WireGuard.xcodeproj/project.pbxproj +++ b/WireGuard.xcodeproj/project.pbxproj @@ -1758,7 +1758,6 @@ SWIFT_PRECOMPILE_BRIDGING_HEADER = NO; SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; - WIREGUARD_GO_VERSION = 0.2.1; }; name = Debug; }; @@ -1825,7 +1824,6 @@ SWIFT_VERSION = 5.0; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; - WIREGUARD_GO_VERSION = 0.2.1; }; name = Release; };