nixpkgs/pkgs/applications/networking/qv2ray/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

85 lines
1.9 KiB
Nix
Raw Normal View History

{ lib
2021-09-01 23:48:41 +00:00
, stdenv
2020-11-23 09:50:03 +00:00
, mkDerivation
, fetchFromGitHub
2022-10-09 14:56:38 +00:00
, symlinkJoin
2020-11-23 09:50:03 +00:00
, qttools
, cmake
2021-09-01 23:48:41 +00:00
, clang_8
2020-11-23 09:50:03 +00:00
, grpc
, protobuf
, openssl
, pkg-config
2020-11-23 09:50:03 +00:00
, c-ares
, libGL
, zlib
2021-09-01 23:48:41 +00:00
, curl
2022-10-09 14:56:38 +00:00
, v2ray
, v2ray-geoip, v2ray-domain-list-community
, assets ? [ v2ray-geoip v2ray-domain-list-community ]
2020-11-23 09:50:03 +00:00
}:
mkDerivation rec {
pname = "qv2ray";
2022-10-09 14:56:38 +00:00
version = "unstable-2022-09-25";
2020-11-23 09:50:03 +00:00
src = fetchFromGitHub {
owner = "Qv2ray";
repo = "Qv2ray";
2022-10-09 14:56:38 +00:00
rev = "fb44fb1421941ab192229ff133bc28feeb4a8ce5";
sha256 = "sha256-TngDgLXKyAoQFnXpBNaz4QjfkVwfZyuQwatdhEiI57U=";
2020-11-23 09:50:03 +00:00
fetchSubmodules = true;
};
2022-10-09 14:56:38 +00:00
postPatch = lib.optionals stdenv.isDarwin ''
2021-09-01 23:48:41 +00:00
substituteInPlace cmake/platforms/macos.cmake \
--replace \''${QV2RAY_QtX_DIR}/../../../bin/macdeployqt macdeployqt
'';
2022-10-09 14:56:38 +00:00
assetsDrv = symlinkJoin {
name = "v2ray-assets";
paths = assets;
};
2020-11-23 09:50:03 +00:00
cmakeFlags = [
"-DCMAKE_BUILD_TYPE=Release"
"-DQV2RAY_DISABLE_AUTO_UPDATE=on"
2022-10-09 14:56:38 +00:00
"-DQV2RAY_USE_V5_CORE=on"
2020-11-23 09:50:03 +00:00
"-DQV2RAY_TRANSLATION_PATH=${placeholder "out"}/share/qv2ray/lang"
2022-10-09 14:56:38 +00:00
"-DQV2RAY_DEFAULT_VASSETS_PATH='${assetsDrv}/share/v2ray'"
"-DQV2RAY_DEFAULT_VCORE_PATH='${v2ray}/bin/v2ray'"
2020-11-23 09:50:03 +00:00
];
preConfigure = ''
export _QV2RAY_BUILD_INFO_="Qv2ray Nixpkgs"
export _QV2RAY_BUILD_EXTRA_INFO_="(Nixpkgs build) nixpkgs"
'';
buildInputs = [
libGL
zlib
grpc
protobuf
openssl
c-ares
];
nativeBuildInputs = [
cmake
pkg-config
2020-11-23 09:50:03 +00:00
qttools
2021-09-01 23:48:41 +00:00
curl
2022-10-09 14:56:38 +00:00
# The default clang_7 will result in reproducible ICE.
] ++ lib.optional (stdenv.isDarwin) clang_8;
2020-11-23 09:50:03 +00:00
meta = with lib; {
2020-11-23 09:50:03 +00:00
description = "An GUI frontend to v2ray";
2023-01-28 05:41:14 +00:00
homepage = "https://github.com/Qv2ray/Qv2ray";
license = licenses.gpl3Plus;
2022-10-09 14:56:38 +00:00
maintainers = with maintainers; [ poscat rewine ];
2020-11-23 09:50:03 +00:00
platforms = platforms.all;
2023-01-28 05:41:14 +00:00
# never built on aarch64-darwin, x86_64-darwin since update to unstable-2022-09-25
broken = stdenv.isDarwin;
2020-11-23 09:50:03 +00:00
};
}