Merge pull request #235063 from andersk/mozillavpn

This commit is contained in:
Sandro 2023-05-31 21:55:48 +02:00 committed by GitHub
commit ae74238d4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2,6 +2,7 @@
, cargo
, cmake
, fetchFromGitHub
, fetchpatch
, go
, lib
, libsecret
@ -23,43 +24,56 @@
let
pname = "mozillavpn";
version = "2.14.1";
version = "2.15.0";
src = fetchFromGitHub {
owner = "mozilla-mobile";
repo = "mozilla-vpn-client";
rev = "v${version}";
fetchSubmodules = true;
hash = "sha256-xWm21guI+h0bKd/rEyxVMyxypCitLWEbVy7TaVBKh4o=";
hash = "sha256-eyYrA8ysfmXxlHNUBkGU9ioYrnbx3L1wP9byNz9L/MA=";
};
patches = [
# Force version downgrade for openssl and openssl-sys crates
(fetchpatch {
url = "https://github.com/mozilla-mobile/mozilla-vpn-client/commit/5911071ea37d12401af32dcdf2a542ca5049bf2f.patch";
hash = "sha256-b3yOgn3Et0sYpqzUUdmlGIbzZSz13Q9HW56hyQqRnHc=";
revert = true;
})
# [2.15] Restore qtglean/Cargo.lock
(fetchpatch {
url = "https://github.com/mozilla-mobile/mozilla-vpn-client/pull/7026/commits/13c1b77ee4249883a33b6ac240b3ca143b485ba1.patch";
hash = "sha256-L4D71zreDMLAIbP4x1as9QdNmMC1snUZSwlkKehg5yM=";
})
];
netfilter-go-modules = (buildGoModule {
inherit pname version src;
inherit pname version src patches;
modRoot = "linux/netfilter";
vendorHash = "sha256-Cmo0wnl0z5r1paaEf1MhCPbInWeoMhGjnxCxGh0cyO8=";
}).go-modules;
extensionBridgeDeps = rustPlatform.fetchCargoTarball {
inherit src;
inherit src patches;
name = "${pname}-${version}-extension-bridge";
preBuild = "cd extension/bridge";
hash = "sha256-XW47EnNHm5JUWCqDU/iHB6ZRGny4v5x7Fs/1dv5TfzM=";
hash = "sha256-R/9ePEhc4qVgg3WC5ng+cD88K/N3PTnx4QWyaZZfRds=";
};
signatureDeps = rustPlatform.fetchCargoTarball {
inherit src;
inherit src patches;
name = "${pname}-${version}-signature";
preBuild = "cd signature";
hash = "sha256-CNPL1Orn+ZbX0HL+CHMaoXPI9G8MoC+hY8pJTJlWH1U=";
hash = "sha256-27g2qnnUrxbThM1cHZquQgWQLWDtZaBnlf8PjvQtBJU=";
};
vpngleanDeps = rustPlatform.fetchCargoTarball {
inherit src;
name = "${pname}-${version}-vpnglean";
preBuild = "cd vpnglean";
hash = "sha256-5vazbCqzJG6iA0MFaTNha42jb1pgLhr0P9I8rQxSKtw=";
qtgleanDeps = rustPlatform.fetchCargoTarball {
inherit src patches;
name = "${pname}-${version}-qtglean";
preBuild = "cd qtglean";
hash = "sha256-cW+nf+Dho+eSzOBo3xhxki7NXpg0wd5ZM9OMA6iOUl4=";
};
in
stdenv.mkDerivation {
inherit pname version src;
inherit pname version src patches;
buildInputs = [
libsecret
@ -95,9 +109,9 @@ stdenv.mkDerivation {
signatureDepsCopy="$cargoDepsCopy"
popd
pushd source/vpnglean
cargoDeps='${vpngleanDeps}' cargoSetupPostUnpackHook
vpngleanDepsCopy="$cargoDepsCopy"
pushd source/qtglean
cargoDeps='${qtgleanDeps}' cargoSetupPostUnpackHook
qtgleanDepsCopy="$cargoDepsCopy"
popd
'';
dontCargoSetupPostUnpack = true;
@ -128,8 +142,8 @@ stdenv.mkDerivation {
cargoDepsCopy="$signatureDepsCopy" cargoSetupPostPatchHook
popd
pushd vpnglean
cargoDepsCopy="$vpngleanDepsCopy" cargoSetupPostPatchHook
pushd qtglean
cargoDepsCopy="$qtgleanDepsCopy" cargoSetupPostPatchHook
popd
cargoSetupPostPatchHook() { true; }