Merge pull request #168727 from andersk/mozillavpn

mozillavpn: 2.7.1 → 2.8.0
This commit is contained in:
Sandro 2022-04-26 02:03:13 +02:00 committed by GitHub
commit 3ad21f0c7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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" ];