From 885dbfc7a7f711ac4b763633aaf8cd7ab206b858 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 14 Apr 2022 14:34:22 -0700 Subject: [PATCH] =?UTF-8?q?mozillavpn:=202.7.1=20=E2=86=92=202.8.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Anders Kaseorg --- pkgs/tools/networking/mozillavpn/default.nix | 35 ++++++++++++++++---- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/pkgs/tools/networking/mozillavpn/default.nix b/pkgs/tools/networking/mozillavpn/default.nix index 9e4e7cc29d47..ab03c61a164c 100644 --- a/pkgs/tools/networking/mozillavpn/default.nix +++ b/pkgs/tools/networking/mozillavpn/default.nix @@ -1,5 +1,6 @@ { buildGoModule , fetchFromGitHub +, fetchpatch , go , lib , pkg-config @@ -13,6 +14,7 @@ , qtquickcontrols2 , qttools , qtwebsockets +, rustPlatform , stdenv , which , wireguard-tools @@ -45,24 +47,34 @@ let }; pname = "mozillavpn"; - version = "2.7.1"; + version = "2.8.0"; src = fetchFromGitHub { owner = "mozilla-mobile"; repo = "mozilla-vpn-client"; rev = "v${version}"; fetchSubmodules = true; - hash = "sha256-i551UkCOwWnioe1YgCNZAlYiQJ4YDDBMoDZhfbkLTbs="; + hash = "sha256-UmLYs/J6syfMrjA66K33h8ubYqzvmcGf5spIilVVdVk="; }; + patches = [ + # Rust bridge: Add Cargo.lock file + (fetchpatch { + url = "https://github.com/mozilla-mobile/mozilla-vpn-client/pull/3341/commits/718c7f52756b5a88511da91dafad7af312bb2473.patch"; + hash = "sha256-fG+SATbJpGqpCFXSWEiBo4dYx6RLtJYR0yTdBqN6Fww="; + }) + ]; + netfilter-go-modules = (buildGoModule { - inherit pname version src; - vendorSha256 = "sha256-KFYMim5U8WlJHValvIBQgEN+17SDv0JVbH03IiyfDc0="; + inherit pname version src patches; + vendorSha256 = "KFYMim5U8WlJHValvIBQgEN+17SDv0JVbH03IiyfDc0="; modRoot = "linux/netfilter"; }).go-modules; + cargoRoot = "extension/bridge"; + in stdenv.mkDerivation { - inherit pname version src; + inherit pname version src patches cargoRoot; buildInputs = [ polkit @@ -81,10 +93,19 @@ stdenv.mkDerivation { python3.pkgs.pyyaml qmake qttools + rustPlatform.cargoSetupHook + rustPlatform.rust.cargo which wrapQtAppsHook ]; + cargoDeps = rustPlatform.fetchCargoTarball { + inherit src patches; + name = "${pname}-${version}"; + preBuild = "cd ${cargoRoot}"; + hash = "sha256-dnbF1hfm3qoZaPrIimhY2bUzlrYaNVUZ+nyp6NbgP3Y="; + }; + postPatch = '' for file in linux/*.service linux/extra/*.desktop src/platforms/linux/daemon/*.service; do substituteInPlace "$file" --replace /usr/bin/mozillavpn "$out/bin/mozillavpn" @@ -93,8 +114,8 @@ stdenv.mkDerivation { preBuild = '' ln -s '${netfilter-go-modules}' linux/netfilter/vendor - python3 scripts/generate_glean.py - python3 scripts/importLanguages.py + python3 scripts/utils/generate_glean.py + python3 scripts/utils/import_languages.py --qt_path '${lib.getDev qttools}/bin' ''; qmakeFlags = [ "USRPATH=$(out)" "ETCPATH=$(out)/etc" ];