2021-02-05 17:12:51 +00:00
|
|
|
{ lib
|
2021-09-22 15:38:15 +00:00
|
|
|
, stdenv
|
2020-11-30 08:33:03 +00:00
|
|
|
, mkDerivation
|
|
|
|
, fetchFromGitHub
|
2023-02-02 18:25:31 +00:00
|
|
|
, symlinkJoin
|
2020-11-30 08:33:03 +00:00
|
|
|
, qttools
|
|
|
|
, cmake
|
|
|
|
, grpc
|
|
|
|
, protobuf
|
|
|
|
, openssl
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-11-30 08:33:03 +00:00
|
|
|
, c-ares
|
|
|
|
, libGL
|
|
|
|
, zlib
|
2021-09-22 15:38:15 +00:00
|
|
|
, curl
|
2023-02-02 18:25:31 +00:00
|
|
|
, v2ray
|
|
|
|
, v2ray-geoip, v2ray-domain-list-community
|
|
|
|
, assets ? [ v2ray-geoip v2ray-domain-list-community ]
|
2020-11-30 08:33:03 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
mkDerivation rec {
|
|
|
|
pname = "qv2ray";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "unstable-2023-07-11";
|
2020-11-30 08:33:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Qv2ray";
|
|
|
|
repo = "Qv2ray";
|
2023-11-16 04:20:00 +00:00
|
|
|
rev = "b3080564809dd8aef864a54ca1b79f0984fe986b";
|
|
|
|
hash = "sha256-LwBjuX5x3kQcdEfPLEirWpkMqOigkhNoh/VNmBfPAzw=";
|
2020-11-30 08:33:03 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
postPatch = lib.optionals stdenv.isDarwin ''
|
2021-09-22 15:38:15 +00:00
|
|
|
substituteInPlace cmake/platforms/macos.cmake \
|
|
|
|
--replace \''${QV2RAY_QtX_DIR}/../../../bin/macdeployqt macdeployqt
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
assetsDrv = symlinkJoin {
|
|
|
|
name = "v2ray-assets";
|
|
|
|
paths = assets;
|
|
|
|
};
|
|
|
|
|
2020-11-30 08:33:03 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DQV2RAY_DISABLE_AUTO_UPDATE=on"
|
2023-02-02 18:25:31 +00:00
|
|
|
"-DQV2RAY_USE_V5_CORE=on"
|
2020-11-30 08:33:03 +00:00
|
|
|
"-DQV2RAY_TRANSLATION_PATH=${placeholder "out"}/share/qv2ray/lang"
|
2023-02-02 18:25:31 +00:00
|
|
|
"-DQV2RAY_DEFAULT_VASSETS_PATH='${assetsDrv}/share/v2ray'"
|
|
|
|
"-DQV2RAY_DEFAULT_VCORE_PATH='${v2ray}/bin/v2ray'"
|
2020-11-30 08:33: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
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-11-30 08:33:03 +00:00
|
|
|
qttools
|
2021-09-22 15:38:15 +00:00
|
|
|
curl
|
2024-02-07 01:22:34 +00:00
|
|
|
];
|
2020-11-30 08:33:03 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-11-30 08:33:03 +00:00
|
|
|
description = "An GUI frontend to v2ray";
|
2023-02-02 18:25:31 +00:00
|
|
|
homepage = "https://github.com/Qv2ray/Qv2ray";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ poscat rewine ];
|
2020-11-30 08:33:03 +00:00
|
|
|
platforms = platforms.all;
|
2023-02-02 18:25:31 +00:00
|
|
|
# never built on aarch64-darwin, x86_64-darwin since update to unstable-2022-09-25
|
|
|
|
broken = stdenv.isDarwin;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "qv2ray";
|
2020-11-30 08:33:03 +00:00
|
|
|
};
|
|
|
|
}
|