Commit 9044d9d0 authored by rewine's avatar rewine
Browse files

qv2ray: 2.7.0 -> unstable-2022-09-25

parent dcd6aa7b
Loading
Loading
Loading
Loading
+20 −13
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
, stdenv
, mkDerivation
, fetchFromGitHub
, qmake
, symlinkJoin
, qttools
, cmake
, clang_8
@@ -15,29 +15,40 @@
, libGL
, zlib
, curl
, v2ray
, v2ray-geoip, v2ray-domain-list-community
, assets ? [ v2ray-geoip v2ray-domain-list-community ]
}:

mkDerivation rec {
  pname = "qv2ray";
  version = "2.7.0";
  version = "unstable-2022-09-25";

  src = fetchFromGitHub {
    owner = "Qv2ray";
    repo = "Qv2ray";
    rev = "v${version}";
    sha256 = "sha256-afFTGX/zrnwq/p5p1kj+ANU4WeN7jNq3ieeW+c+GO5M=";
    rev = "fb44fb1421941ab192229ff133bc28feeb4a8ce5";
    sha256 = "sha256-TngDgLXKyAoQFnXpBNaz4QjfkVwfZyuQwatdhEiI57U=";
    fetchSubmodules = true;
  };

  patchPhase = lib.optionals stdenv.isDarwin ''
  postPatch = lib.optionals stdenv.isDarwin ''
    substituteInPlace cmake/platforms/macos.cmake \
      --replace \''${QV2RAY_QtX_DIR}/../../../bin/macdeployqt macdeployqt
  '';

  assetsDrv = symlinkJoin {
    name = "v2ray-assets";
    paths = assets;
  };

  cmakeFlags = [
    "-DCMAKE_BUILD_TYPE=Release"
    "-DQV2RAY_DISABLE_AUTO_UPDATE=on"
    "-DQV2RAY_USE_V5_CORE=on"
    "-DQV2RAY_TRANSLATION_PATH=${placeholder "out"}/share/qv2ray/lang"
    "-DQV2RAY_DEFAULT_VASSETS_PATH='${assetsDrv}/share/v2ray'"
    "-DQV2RAY_DEFAULT_VCORE_PATH='${v2ray}/bin/v2ray'"
  ];

  preConfigure = ''
@@ -57,21 +68,17 @@ mkDerivation rec {

  nativeBuildInputs = [
    cmake

    # The default clang_7 will result in reproducible ICE.
    clang_8

    pkg-config
    qmake
    qttools
    curl
  ];
    # The default clang_7 will result in reproducible ICE.
  ] ++ lib.optional (stdenv.isDarwin) clang_8;

  meta = with lib; {
    description = "An GUI frontend to v2ray";
    homepage = "https://qv2ray.github.io/en/";
    homepage = "https://qv2ray.net";
    license = licenses.gpl3;
    maintainers = with maintainers; [ poscat ];
    maintainers = with maintainers; [ poscat rewine ];
    platforms = platforms.all;
  };
}