2022-04-15 01:41:22 +00:00
|
|
|
{ buildGoModule
|
2023-05-24 13:37:59 +00:00
|
|
|
, cargo
|
2022-08-12 12:06:08 +00:00
|
|
|
, cmake
|
2022-04-15 01:41:22 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, go
|
|
|
|
, lib
|
2023-08-22 20:05:09 +00:00
|
|
|
, libcap
|
2023-08-10 07:59:29 +00:00
|
|
|
, libgcrypt
|
|
|
|
, libgpg-error
|
2023-02-09 11:40:11 +00:00
|
|
|
, libsecret
|
2022-04-15 01:41:22 +00:00
|
|
|
, pkg-config
|
|
|
|
, polkit
|
|
|
|
, python3
|
2022-08-12 12:06:08 +00:00
|
|
|
, qt5compat
|
2022-04-15 01:41:22 +00:00
|
|
|
, qtbase
|
|
|
|
, qtnetworkauth
|
2023-03-30 22:05:00 +00:00
|
|
|
, qtsvg
|
2022-04-15 01:41:22 +00:00
|
|
|
, qttools
|
|
|
|
, qtwebsockets
|
2022-04-27 09:35:20 +00:00
|
|
|
, rustPlatform
|
2023-05-24 13:37:59 +00:00
|
|
|
, rustc
|
2022-04-15 01:41:22 +00:00
|
|
|
, stdenv
|
|
|
|
, wireguard-tools
|
|
|
|
, wrapQtAppsHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
pname = "mozillavpn";
|
2023-08-22 20:05:09 +00:00
|
|
|
version = "2.16.1";
|
2022-04-15 01:41:22 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mozilla-mobile";
|
|
|
|
repo = "mozilla-vpn-client";
|
|
|
|
rev = "v${version}";
|
|
|
|
fetchSubmodules = true;
|
2023-08-22 20:05:09 +00:00
|
|
|
hash = "sha256-UMWBn3DoEU1fG7qh6F0GOhOqod+grPwp15wSSdP0eCo=";
|
2022-04-15 01:41:22 +00:00
|
|
|
};
|
2023-08-10 07:59:29 +00:00
|
|
|
patches = [ ];
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
netfilterGoModules = (buildGoModule {
|
2023-07-15 17:15:38 +00:00
|
|
|
inherit pname version src patches;
|
2022-04-15 01:41:22 +00:00
|
|
|
modRoot = "linux/netfilter";
|
2022-11-21 17:40:18 +00:00
|
|
|
vendorHash = "sha256-Cmo0wnl0z5r1paaEf1MhCPbInWeoMhGjnxCxGh0cyO8=";
|
2023-08-04 22:07:22 +00:00
|
|
|
}).goModules;
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
extensionBridgeDeps = rustPlatform.fetchCargoTarball {
|
2023-07-15 17:15:38 +00:00
|
|
|
inherit src patches;
|
2022-11-21 17:40:18 +00:00
|
|
|
name = "${pname}-${version}-extension-bridge";
|
|
|
|
preBuild = "cd extension/bridge";
|
2023-08-22 20:05:09 +00:00
|
|
|
hash = "sha256-1wYTRc+NehiHwAd/2CmsJNv/TV6wH5wXwNiUdjzEUIk=";
|
2022-11-21 17:40:18 +00:00
|
|
|
};
|
|
|
|
signatureDeps = rustPlatform.fetchCargoTarball {
|
2023-07-15 17:15:38 +00:00
|
|
|
inherit src patches;
|
2022-11-21 17:40:18 +00:00
|
|
|
name = "${pname}-${version}-signature";
|
|
|
|
preBuild = "cd signature";
|
2023-08-22 20:05:09 +00:00
|
|
|
hash = "sha256-oaKkQWMYkAy1c2biVt+GyjHBeYb2XkuRvFrWQJJIdPw=";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
qtgleanDeps = rustPlatform.fetchCargoTarball {
|
|
|
|
inherit src patches;
|
|
|
|
name = "${pname}-${version}-qtglean";
|
|
|
|
preBuild = "cd qtglean";
|
2023-08-22 20:05:09 +00:00
|
|
|
hash = "sha256-cqfiOBS8xFC2BbYp6BJWK6NHIU0tILSgu4eo3Ik4YqY=";
|
2022-11-21 17:40:18 +00:00
|
|
|
};
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
2023-07-15 17:15:38 +00:00
|
|
|
inherit pname version src patches;
|
2022-04-15 01:41:22 +00:00
|
|
|
|
|
|
|
buildInputs = [
|
2023-08-22 20:05:09 +00:00
|
|
|
libcap
|
2023-08-10 07:59:29 +00:00
|
|
|
libgcrypt
|
|
|
|
libgpg-error
|
2023-02-09 11:40:11 +00:00
|
|
|
libsecret
|
2022-08-12 12:06:08 +00:00
|
|
|
qt5compat
|
2022-04-15 01:41:22 +00:00
|
|
|
qtbase
|
|
|
|
qtnetworkauth
|
2023-03-30 22:05:00 +00:00
|
|
|
qtsvg
|
2022-04-15 01:41:22 +00:00
|
|
|
qtwebsockets
|
|
|
|
];
|
|
|
|
nativeBuildInputs = [
|
2023-08-10 07:59:29 +00:00
|
|
|
cargo
|
2022-08-12 12:06:08 +00:00
|
|
|
cmake
|
2022-04-15 01:41:22 +00:00
|
|
|
go
|
|
|
|
pkg-config
|
|
|
|
python3
|
2022-08-12 12:06:08 +00:00
|
|
|
python3.pkgs.glean-parser
|
2022-04-15 01:41:22 +00:00
|
|
|
python3.pkgs.pyyaml
|
2022-08-12 12:06:08 +00:00
|
|
|
python3.pkgs.setuptools
|
2023-08-10 07:59:29 +00:00
|
|
|
qttools
|
2022-04-27 09:35:20 +00:00
|
|
|
rustPlatform.cargoSetupHook
|
2023-05-24 13:37:59 +00:00
|
|
|
rustc
|
2022-04-15 01:41:22 +00:00
|
|
|
wrapQtAppsHook
|
|
|
|
];
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
postUnpack = ''
|
|
|
|
pushd source/extension/bridge
|
|
|
|
cargoDeps='${extensionBridgeDeps}' cargoSetupPostUnpackHook
|
|
|
|
extensionBridgeDepsCopy="$cargoDepsCopy"
|
|
|
|
popd
|
|
|
|
|
|
|
|
pushd source/signature
|
|
|
|
cargoDeps='${signatureDeps}' cargoSetupPostUnpackHook
|
|
|
|
signatureDepsCopy="$cargoDepsCopy"
|
|
|
|
popd
|
2022-12-17 10:02:37 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
pushd source/qtglean
|
|
|
|
cargoDeps='${qtgleanDeps}' cargoSetupPostUnpackHook
|
|
|
|
qtgleanDepsCopy="$cargoDepsCopy"
|
2022-12-17 10:02:37 +00:00
|
|
|
popd
|
2022-11-21 17:40:18 +00:00
|
|
|
'';
|
|
|
|
dontCargoSetupPostUnpack = true;
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
postPatch = ''
|
2023-02-09 11:40:11 +00:00
|
|
|
substituteInPlace src/apps/vpn/cmake/linux.cmake \
|
2022-11-21 17:40:18 +00:00
|
|
|
--replace '/etc/xdg/autostart' "$out/etc/xdg/autostart" \
|
|
|
|
--replace '/usr/share/dbus-1' "$out/share/dbus-1" \
|
2022-08-12 12:06:08 +00:00
|
|
|
--replace '${"$"}{SYSTEMD_UNIT_DIR}' "$out/lib/systemd/system"
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
substituteInPlace extension/CMakeLists.txt \
|
|
|
|
--replace '/etc' "$out/etc"
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
ln -s '${netfilterGoModules}' linux/netfilter/vendor
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
pushd extension/bridge
|
|
|
|
cargoDepsCopy="$extensionBridgeDepsCopy" cargoSetupPostPatchHook
|
|
|
|
popd
|
|
|
|
|
|
|
|
pushd signature
|
|
|
|
cargoDepsCopy="$signatureDepsCopy" cargoSetupPostPatchHook
|
|
|
|
popd
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
pushd qtglean
|
|
|
|
cargoDepsCopy="$qtgleanDepsCopy" cargoSetupPostPatchHook
|
2022-12-17 10:02:37 +00:00
|
|
|
popd
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
cargoSetupPostPatchHook() { true; }
|
2022-04-15 01:41:22 +00:00
|
|
|
'';
|
|
|
|
|
2022-08-12 12:06:08 +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-18 14:49:53 +00:00
|
|
|
];
|
2022-11-21 17:40:18 +00:00
|
|
|
dontFixCmake = true;
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2022-04-15 01:41:22 +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;
|
|
|
|
};
|
|
|
|
}
|