2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2021-09-02 00:48:41 +01:00
|
|
|
, stdenv
|
2020-11-23 09:50:03 +00:00
|
|
|
, mkDerivation
|
|
|
|
, fetchFromGitHub
|
|
|
|
, qmake
|
|
|
|
, qttools
|
|
|
|
, cmake
|
2021-09-02 00:48:41 +01:00
|
|
|
, clang_8
|
2020-11-23 09:50:03 +00:00
|
|
|
, grpc
|
|
|
|
, protobuf
|
|
|
|
, openssl
|
2021-01-17 02:09:27 +00:00
|
|
|
, pkg-config
|
2020-11-23 09:50:03 +00:00
|
|
|
, c-ares
|
|
|
|
, abseil-cpp
|
|
|
|
, libGL
|
|
|
|
, zlib
|
2021-09-02 00:48:41 +01:00
|
|
|
, curl
|
2020-11-23 09:50:03 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
mkDerivation rec {
|
|
|
|
pname = "qv2ray";
|
2021-09-02 00:48:41 +01:00
|
|
|
version = "2.7.0";
|
2020-11-23 09:50:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Qv2ray";
|
|
|
|
repo = "Qv2ray";
|
|
|
|
rev = "v${version}";
|
2021-09-02 00:48:41 +01:00
|
|
|
sha256 = "sha256-afFTGX/zrnwq/p5p1kj+ANU4WeN7jNq3ieeW+c+GO5M=";
|
2020-11-23 09:50:03 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
|
2021-09-02 00:48:41 +01:00
|
|
|
patchPhase = lib.optionals stdenv.isDarwin ''
|
|
|
|
substituteInPlace cmake/platforms/macos.cmake \
|
|
|
|
--replace \''${QV2RAY_QtX_DIR}/../../../bin/macdeployqt macdeployqt
|
|
|
|
'';
|
|
|
|
|
2020-11-23 09:50:03 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_BUILD_TYPE=Release"
|
|
|
|
"-DQV2RAY_DISABLE_AUTO_UPDATE=on"
|
|
|
|
"-DQV2RAY_TRANSLATION_PATH=${placeholder "out"}/share/qv2ray/lang"
|
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
export _QV2RAY_BUILD_INFO_="Qv2ray Nixpkgs"
|
|
|
|
export _QV2RAY_BUILD_EXTRA_INFO_="(Nixpkgs build) nixpkgs"
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libGL
|
|
|
|
zlib
|
|
|
|
grpc
|
|
|
|
protobuf
|
|
|
|
openssl
|
|
|
|
abseil-cpp
|
|
|
|
c-ares
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2021-09-02 00:48:41 +01:00
|
|
|
|
|
|
|
# The default clang_7 will result in reproducible ICE.
|
|
|
|
clang_8
|
|
|
|
|
2021-01-17 02:09:27 +00:00
|
|
|
pkg-config
|
2020-11-23 09:50:03 +00:00
|
|
|
qmake
|
|
|
|
qttools
|
2021-09-02 00:48:41 +01:00
|
|
|
curl
|
2020-11-23 09:50:03 +00:00
|
|
|
];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-11-23 09:50:03 +00:00
|
|
|
description = "An GUI frontend to v2ray";
|
|
|
|
homepage = "https://qv2ray.github.io/en/";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
maintainers = with maintainers; [ poscat ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|