From 2418e4063865d95ba38d3cd62f7c089e95b8adea Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 26 Jul 2022 16:27:00 -0700 Subject: [PATCH] =?UTF-8?q?mozillavpn:=202.8.3=20=E2=86=92=202.9.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 | 80 ++++++-------------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 26 insertions(+), 56 deletions(-) diff --git a/pkgs/tools/networking/mozillavpn/default.nix b/pkgs/tools/networking/mozillavpn/default.nix index 3a652cca24fe..e963abc9b18c 100644 --- a/pkgs/tools/networking/mozillavpn/default.nix +++ b/pkgs/tools/networking/mozillavpn/default.nix @@ -1,17 +1,15 @@ { buildGoModule +, cmake , fetchFromGitHub -, fetchpatch , go , lib , pkg-config , polkit , python3 -, qmake +, qt5compat , qtbase , qtcharts -, qtgraphicaleffects , qtnetworkauth -, qtquickcontrols2 , qttools , qtwebsockets , rustPlatform @@ -22,50 +20,18 @@ }: let - glean_parser_4_1_1 = python3.pkgs.buildPythonPackage rec { - pname = "glean_parser"; - version = "4.1.1"; - src = python3.pkgs.fetchPypi { - inherit pname version; - hash = "sha256-4noazRqjjJNI2kTO714kSp70jZpWmqHWR2vnkgAftLE="; - }; - nativeBuildInputs = with python3.pkgs; [ setuptools-scm ]; - propagatedBuildInputs = with python3.pkgs; [ - appdirs - click - diskcache - jinja2 - jsonschema - pyyaml - setuptools - yamllint - ]; - postPatch = '' - substituteInPlace setup.py --replace '"pytest-runner", ' "" - ''; - doCheck = false; - }; - pname = "mozillavpn"; - version = "2.8.3"; + version = "2.9.0"; src = fetchFromGitHub { owner = "mozilla-mobile"; repo = "mozilla-vpn-client"; rev = "v${version}"; fetchSubmodules = true; - hash = "sha256-eKgoRE/JDEQEFp7xYY60ARDgw/n5VoZpD/Gb/CWzHuo="; + hash = "sha256-arz8hTgQfPFSZesSddcnZoyLfoLQsQT8LIsl+3ZfA0M="; }; - patches = [ - # Rust bridge: Add Cargo.lock file - (fetchpatch { - url = "https://github.com/mozilla-mobile/mozilla-vpn-client/commit/05c9a366cf9dc4e378485c8e9d494f77c35dbb8c.patch"; - hash = "sha256-fG+SATbJpGqpCFXSWEiBo4dYx6RLtJYR0yTdBqN6Fww="; - }) - ]; - netfilter-go-modules = (buildGoModule { - inherit pname version src patches; + inherit pname version src; vendorSha256 = "KFYMim5U8WlJHValvIBQgEN+17SDv0JVbH03IiyfDc0="; modRoot = "linux/netfilter"; }).go-modules; @@ -74,25 +40,25 @@ let in stdenv.mkDerivation { - inherit pname version src patches cargoRoot; + inherit pname version src cargoRoot; buildInputs = [ polkit + qt5compat qtbase qtcharts - qtgraphicaleffects qtnetworkauth - qtquickcontrols2 qtwebsockets ]; nativeBuildInputs = [ - glean_parser_4_1_1 + cmake go pkg-config python3 + python3.pkgs.glean-parser + python3.pkgs.lxml python3.pkgs.pyyaml - qmake - qttools + python3.pkgs.setuptools rustPlatform.cargoSetupHook rustPlatform.rust.cargo which @@ -100,29 +66,33 @@ stdenv.mkDerivation { ]; cargoDeps = rustPlatform.fetchCargoTarball { - inherit src patches; + inherit src; name = "${pname}-${version}"; preBuild = "cd ${cargoRoot}"; - hash = "sha256-C0wPmGVXbhUs0IzeIMZD6724P0XTOzeK1bzrnUMPlWo="; + hash = "sha256-lJfDLyoVDSFiZyWcBTI085MorWHPcNW4i7ua1+Ip3rA="; }; postPatch = '' for file in linux/*.service linux/extra/*.desktop src/platforms/linux/daemon/*.service; do substituteInPlace "$file" --replace /usr/bin/mozillavpn "$out/bin/mozillavpn" done - ''; - preBuild = '' + substituteInPlace scripts/addon/build.py \ + --replace 'qtbinpath = args.qtpath' 'qtbinpath = "${qttools.dev}/bin"' \ + --replace 'rcc = os.path.join(qtbinpath, rcc_bin)' 'rcc = "${qtbase.dev}/libexec/rcc"' + + substituteInPlace src/cmake/linux.cmake \ + --replace '${"$"}{SYSTEMD_UNIT_DIR}' "$out/lib/systemd/system" + ln -s '${netfilter-go-modules}' linux/netfilter/vendor - python3 scripts/utils/generate_glean.py - python3 scripts/utils/import_languages.py --qt_path '${lib.getDev qttools}/bin' ''; - qmakeFlags = [ - "USRPATH=$(out)" - "ETCPATH=$(out)/etc" - "CONFIG-=debug" # https://github.com/mozilla-mobile/mozilla-vpn-client/pull/3539 + cmakeFlags = [ + "-DQT_LCONVERT_EXECUTABLE=${qttools.dev}/bin/lconvert" + "-DQT_LUPDATE_EXECUTABLE=${qttools.dev}/bin/lupdate" + "-DQT_LRELEASE_EXECUTABLE=${qttools.dev}/bin/lrelease" ]; + qtWrapperArgs = [ "--prefix" "PATH" ":" (lib.makeBinPath [ wireguard-tools ]) ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 979424ffb830..8a44163e941b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5669,7 +5669,7 @@ with pkgs; mcrcon = callPackage ../tools/networking/mcrcon {}; - mozillavpn = libsForQt5.callPackage ../tools/networking/mozillavpn { }; + mozillavpn = qt6Packages.callPackage ../tools/networking/mozillavpn { }; mozwire = callPackage ../tools/networking/mozwire { inherit (darwin.apple_sdk.frameworks) Security;