mullvad: 2024.4 -> 2024.6, 2024.6 -> 2024.7 (#350746)

This commit is contained in:
Sandro 2024-10-31 03:29:37 +01:00 committed by GitHub
commit 5596696103
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 514 additions and 229 deletions

File diff suppressed because it is too large Load Diff

View File

@ -10,19 +10,19 @@ buildGoModule {
src
;
sourceRoot = "${mullvad.src.name}/wireguard/libwg";
vendorHash = "sha256-gaU3na3sjzM6lvmsGRkuGtV2AHvkl6IgzmyGx3R5ZpM=";
modRoot = "wireguard-go-rs/libwg";
proxyVendor = true;
vendorHash = "sha256-uyAzY1hoCtS7da3wtjxTGx5wBb9c9m749TzihVr94rc=";
# XXX: hack to make the ar archive go to the correct place
# This is necessary because passing `-o ...` to `ldflags` does not work
# (this doesn't get communicated everywhere in the chain, apparently, so
# `go` complains that it can't find an `a.out` file).
GOBIN = "${placeholder "out"}/lib";
ldflags = [ "-s" "-w" "-buildmode=c-archive" ];
patches = [
];
subPackages = [ "." ];
ldflags = [ "-s" "-w" "-buildmode=c-archive" ];
tags = [ "daita" ];
postInstall = ''
mv $out/lib/libwg{,.a}
@ -30,7 +30,7 @@ buildGoModule {
meta = with lib; {
description = "Tiny wrapper around wireguard-go";
homepage = "https://github.com/mullvad/mullvadvpn-app/tree/main/wireguard/libwg";
homepage = "https://github.com/mullvad/mullvadvpn-app/tree/main/wireguard-go-rs/libwg";
license = licenses.gpl3Only;
maintainers = with maintainers; [ cole-h ];
};

View File

@ -14,16 +14,27 @@
, openvpn-mullvad
, shadowsocks-rust
, installShellFiles
, writeShellScriptBin
}:
let
# NOTE(cole-h): This is necessary because wireguard-go-rs executes go in its build.rs (whose goal
# is to produce $OUT_DIR/libwg.a), and a mixed Rust-Go build is non-trivial (read: I didn't want
# to attempt it). So, we just fake the "go" binary and do what it would have done: put libwg.a
# under $OUT_DIR so that it can be linked against.
fakeGoCopyLibwg = writeShellScriptBin "go" ''
[ ! -e "$OUT_DIR"/libwg.a ] && cp ${libwg}/lib/libwg.a "$OUT_DIR"/libwg.a
'';
in
rustPlatform.buildRustPackage rec {
pname = "mullvad";
version = "2024.4";
version = "2024.7";
src = fetchFromGitHub {
owner = "mullvad";
repo = "mullvadvpn-app";
rev = version;
hash = "sha256-d7poR1NnvqaPutXLFizpQnyipl+38N1Qe2zVXeV7v1Q=";
fetchSubmodules = true;
hash = "sha256-me0e8Cb1dRrnAeiCmsXiclcDMruVLV3t0eGAM3RU1es=";
};
cargoLock = {
@ -41,6 +52,7 @@ rustPlatform.buildRustPackage rec {
makeWrapper
git
installShellFiles
fakeGoCopyLibwg
];
buildInputs = [
@ -49,13 +61,6 @@ rustPlatform.buildRustPackage rec {
libmnl
];
# talpid-core wants libwg.a in build/lib/{triple}
preBuild = ''
dest=build/lib/${stdenv.hostPlatform.config}
mkdir -p $dest
ln -s ${libwg}/lib/libwg.a $dest
'';
postInstall = ''
compdir=$(mktemp -d)
for shell in bash zsh fish; do