2022-02-14 22:53:18 +00:00
|
|
|
{ buildGoModule
|
2023-05-12 14:17:16 +00:00
|
|
|
, cargo
|
2022-07-26 23:27:00 +00:00
|
|
|
, cmake
|
2022-02-14 22:53:18 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, go
|
|
|
|
, lib
|
2023-08-17 16:09:38 +00:00
|
|
|
, libcap
|
2023-08-07 17:39:30 +00:00
|
|
|
, libgcrypt
|
|
|
|
, libgpg-error
|
2023-02-02 06:32:55 +00:00
|
|
|
, libsecret
|
2022-02-14 22:53:18 +00:00
|
|
|
, pkg-config
|
|
|
|
, polkit
|
|
|
|
, python3
|
2022-07-26 23:27:00 +00:00
|
|
|
, qt5compat
|
2022-02-14 22:53:18 +00:00
|
|
|
, qtbase
|
|
|
|
, qtnetworkauth
|
2023-03-27 20:31:46 +00:00
|
|
|
, qtsvg
|
2022-02-14 22:53:18 +00:00
|
|
|
, qttools
|
|
|
|
, qtwebsockets
|
2022-04-14 21:34:22 +00:00
|
|
|
, rustPlatform
|
2023-05-12 14:17:16 +00:00
|
|
|
, rustc
|
2022-02-14 22:53:18 +00:00
|
|
|
, stdenv
|
|
|
|
, wireguard-tools
|
|
|
|
, wrapQtAppsHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pname = "mozillavpn";
|
2023-08-17 16:09:38 +00:00
|
|
|
version = "2.16.1";
|
2022-02-14 22:53:18 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mozilla-mobile";
|
|
|
|
repo = "mozilla-vpn-client";
|
|
|
|
rev = "v${version}";
|
|
|
|
fetchSubmodules = true;
|
2023-08-17 16:09:38 +00:00
|
|
|
hash = "sha256-UMWBn3DoEU1fG7qh6F0GOhOqod+grPwp15wSSdP0eCo=";
|
2022-02-14 22:53:18 +00:00
|
|
|
};
|
2023-08-07 17:39:30 +00:00
|
|
|
patches = [ ];
|
2022-02-14 22:53:18 +00:00
|
|
|
|
2023-08-07 17:39:30 +00:00
|
|
|
netfilterGoModules = (buildGoModule {
|
2023-05-30 20:13:43 +00:00
|
|
|
inherit pname version src patches;
|
2022-02-14 22:53:18 +00:00
|
|
|
modRoot = "linux/netfilter";
|
2022-10-27 20:22:06 +00:00
|
|
|
vendorHash = "sha256-Cmo0wnl0z5r1paaEf1MhCPbInWeoMhGjnxCxGh0cyO8=";
|
2023-07-11 18:16:30 +00:00
|
|
|
}).goModules;
|
2022-02-14 22:53:18 +00:00
|
|
|
|
2022-10-27 20:22:06 +00:00
|
|
|
extensionBridgeDeps = rustPlatform.fetchCargoTarball {
|
2023-05-30 20:13:43 +00:00
|
|
|
inherit src patches;
|
2022-10-27 20:22:06 +00:00
|
|
|
name = "${pname}-${version}-extension-bridge";
|
|
|
|
preBuild = "cd extension/bridge";
|
2023-08-17 16:09:38 +00:00
|
|
|
hash = "sha256-1wYTRc+NehiHwAd/2CmsJNv/TV6wH5wXwNiUdjzEUIk=";
|
2022-10-27 20:22:06 +00:00
|
|
|
};
|
|
|
|
signatureDeps = rustPlatform.fetchCargoTarball {
|
2023-05-30 20:13:43 +00:00
|
|
|
inherit src patches;
|
2022-10-27 20:22:06 +00:00
|
|
|
name = "${pname}-${version}-signature";
|
|
|
|
preBuild = "cd signature";
|
2023-08-17 16:09:38 +00:00
|
|
|
hash = "sha256-oaKkQWMYkAy1c2biVt+GyjHBeYb2XkuRvFrWQJJIdPw=";
|
2022-12-15 19:41:10 +00:00
|
|
|
};
|
2023-05-30 20:13:43 +00:00
|
|
|
qtgleanDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src patches;
|
|
|
|
name = "${pname}-${version}-qtglean";
|
|
|
|
preBuild = "cd qtglean";
|
2023-08-17 16:09:38 +00:00
|
|
|
hash = "sha256-cqfiOBS8xFC2BbYp6BJWK6NHIU0tILSgu4eo3Ik4YqY=";
|
2022-10-27 20:22:06 +00:00
|
|
|
};
|
2022-04-14 21:34:22 +00:00
|
|
|
|
2022-02-14 22:53:18 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2023-05-30 20:13:43 +00:00
|
|
|
inherit pname version src patches;
|
2022-02-14 22:53:18 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2023-08-17 16:09:38 +00:00
|
|
|
libcap
|
2023-08-07 17:39:30 +00:00
|
|
|
libgcrypt
|
|
|
|
libgpg-error
|
2023-02-02 06:32:55 +00:00
|
|
|
libsecret
|
2022-07-26 23:27:00 +00:00
|
|
|
qt5compat
|
2022-02-14 22:53:18 +00:00
|
|
|
qtbase
|
|
|
|
qtnetworkauth
|
2023-03-27 20:31:46 +00:00
|
|
|
qtsvg
|
2022-02-14 22:53:18 +00:00
|
|
|
qtwebsockets
|
|
|
|
];
|
|
|
|
nativeBuildInputs = [
|
2023-08-07 17:39:30 +00:00
|
|
|
cargo
|
2022-07-26 23:27:00 +00:00
|
|
|
cmake
|
2022-02-14 22:53:18 +00:00
|
|
|
go
|
|
|
|
pkg-config
|
|
|
|
python3
|
2022-07-26 23:27:00 +00:00
|
|
|
python3.pkgs.glean-parser
|
2022-02-14 22:53:18 +00:00
|
|
|
python3.pkgs.pyyaml
|
2022-07-26 23:27:00 +00:00
|
|
|
python3.pkgs.setuptools
|
2023-08-07 17:39:30 +00:00
|
|
|
qttools
|
2022-04-14 21:34:22 +00:00
|
|
|
rustPlatform.cargoSetupHook
|
2023-05-12 14:17:16 +00:00
|
|
|
rustc
|
2022-02-14 22:53:18 +00:00
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
2022-10-27 20:22:06 +00:00
|
|
|
postUnpack = ''
|
|
|
|
pushd source/extension/bridge
|
|
|
|
cargoDeps='${extensionBridgeDeps}' cargoSetupPostUnpackHook
|
|
|
|
extensionBridgeDepsCopy="$cargoDepsCopy"
|
|
|
|
popd
|
|
|
|
|
|
|
|
pushd source/signature
|
|
|
|
cargoDeps='${signatureDeps}' cargoSetupPostUnpackHook
|
|
|
|
signatureDepsCopy="$cargoDepsCopy"
|
|
|
|
popd
|
2022-12-15 19:41:10 +00:00
|
|
|
|
2023-05-30 20:13:43 +00:00
|
|
|
pushd source/qtglean
|
|
|
|
cargoDeps='${qtgleanDeps}' cargoSetupPostUnpackHook
|
|
|
|
qtgleanDepsCopy="$cargoDepsCopy"
|
2022-12-15 19:41:10 +00:00
|
|
|
popd
|
2022-10-27 20:22:06 +00:00
|
|
|
'';
|
|
|
|
dontCargoSetupPostUnpack = true;
|
2022-04-14 21:34:22 +00:00
|
|
|
|
2022-02-14 22:53:18 +00:00
|
|
|
postPatch = ''
|
2023-02-02 06:32:55 +00:00
|
|
|
substituteInPlace src/apps/vpn/cmake/linux.cmake \
|
2022-10-27 20:22:06 +00:00
|
|
|
--replace '/etc/xdg/autostart' "$out/etc/xdg/autostart" \
|
|
|
|
--replace '/usr/share/dbus-1' "$out/share/dbus-1" \
|
2022-07-26 23:27:00 +00:00
|
|
|
--replace '${"$"}{SYSTEMD_UNIT_DIR}' "$out/lib/systemd/system"
|
|
|
|
|
2022-10-27 20:22:06 +00:00
|
|
|
substituteInPlace extension/CMakeLists.txt \
|
|
|
|
--replace '/etc' "$out/etc"
|
|
|
|
|
2023-08-07 17:39:30 +00:00
|
|
|
ln -s '${netfilterGoModules}' linux/netfilter/vendor
|
2022-10-27 20:22:06 +00:00
|
|
|
|
|
|
|
pushd extension/bridge
|
|
|
|
cargoDepsCopy="$extensionBridgeDepsCopy" cargoSetupPostPatchHook
|
|
|
|
popd
|
|
|
|
|
|
|
|
pushd signature
|
|
|
|
cargoDepsCopy="$signatureDepsCopy" cargoSetupPostPatchHook
|
|
|
|
popd
|
|
|
|
|
2023-05-30 20:13:43 +00:00
|
|
|
pushd qtglean
|
|
|
|
cargoDepsCopy="$qtgleanDepsCopy" cargoSetupPostPatchHook
|
2022-12-15 19:41:10 +00:00
|
|
|
popd
|
|
|
|
|
2022-10-27 20:22:06 +00:00
|
|
|
cargoSetupPostPatchHook() { true; }
|
2022-02-14 22:53:18 +00:00
|
|
|
'';
|
|
|
|
|
2022-07-26 23:27:00 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DQT_LCONVERT_EXECUTABLE=${qttools.dev}/bin/lconvert"
|
|
|
|
"-DQT_LUPDATE_EXECUTABLE=${qttools.dev}/bin/lupdate"
|
|
|
|
"-DQT_LRELEASE_EXECUTABLE=${qttools.dev}/bin/lrelease"
|
2022-05-14 22:16:50 +00:00
|
|
|
];
|
2022-10-27 20:22:06 +00:00
|
|
|
dontFixCmake = true;
|
2022-07-26 23:27:00 +00:00
|
|
|
|
2022-02-14 22:53:18 +00:00
|
|
|
qtWrapperArgs =
|
|
|
|
[ "--prefix" "PATH" ":" (lib.makeBinPath [ wireguard-tools ]) ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Client for the Mozilla VPN service";
|
|
|
|
homepage = "https://vpn.mozilla.org/";
|
|
|
|
license = lib.licenses.mpl20;
|
|
|
|
maintainers = with lib.maintainers; [ andersk ];
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
};
|
|
|
|
}
|