mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-14 15:36:47 +03:00
Merge pull request #103220 from servalcatty/v2ray
v2ray: 4.31.0 -> 4.32.1
This commit is contained in:
commit
2bdd0fc9d0
@ -3,33 +3,33 @@
|
|||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "4.31.0";
|
version = "4.32.1";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "v2ray";
|
owner = "v2fly";
|
||||||
repo = "v2ray-core";
|
repo = "v2ray-core";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "0s0blc05nrqm78qslv5xb42pjlx5v8qqwg0pwbzhxn9s71x2669m";
|
sha256 = "1mlrl5fz1v3bcb83pczqp859d8w9mi7jj600a2yw7xm372w2irk8";
|
||||||
};
|
};
|
||||||
|
|
||||||
vendorSha256 = "0n2mf19fvgk5x0j2wwm4zk9xikzvl6cdvw26qar91wzcsraf5z2d";
|
vendorSha256 = "1mz1acdj8ailgyqrr1v47n36qc24ggzw5rmj4p2awfwz3gp2yz6z";
|
||||||
|
|
||||||
assets = {
|
assets = {
|
||||||
# MIT licensed
|
# MIT licensed
|
||||||
"geoip.dat" = let
|
"geoip.dat" = let
|
||||||
geoipRev = "202009300006";
|
geoipRev = "202011050012";
|
||||||
geoipSha256 = "1ss2izqlmrp5b5kpw804jk6c1nyimwlccbkikix3bwfaz4vlv1nc";
|
geoipSha256 = "1d2n3hskgdmcfk1nl7a8lxxz325p84i7gz44cs77z1m9r7c2vsjy";
|
||||||
in fetchurl {
|
in fetchurl {
|
||||||
url = "https://github.com/v2ray/geoip/releases/download/${geoipRev}/geoip.dat";
|
url = "https://github.com/v2fly/geoip/releases/download/${geoipRev}/geoip.dat";
|
||||||
sha256 = geoipSha256;
|
sha256 = geoipSha256;
|
||||||
};
|
};
|
||||||
|
|
||||||
# MIT licensed
|
# MIT licensed
|
||||||
"geosite.dat" = let
|
"geosite.dat" = let
|
||||||
geositeRev = "20201010021828";
|
geositeRev = "20201102141726";
|
||||||
geositeSha256 = "0gpfhcf4iyx7ip7rlkb0l1q64w84zvmcah52qyjwljs6l4p3hrj9";
|
geositeSha256 = "0sn2f5vd6w94ryh845mnbfyjzycg7cvb66rkzh37pg9l7fvgs4jh";
|
||||||
in fetchurl {
|
in fetchurl {
|
||||||
url = "https://github.com/v2ray/domain-list-community/releases/download/${geositeRev}/dlc.dat";
|
url = "https://github.com/v2fly/domain-list-community/releases/download/${geositeRev}/dlc.dat";
|
||||||
sha256 = geositeSha256;
|
sha256 = geositeSha256;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -59,19 +59,22 @@ let
|
|||||||
installPhase = ''
|
installPhase = ''
|
||||||
install -Dm755 v2ray v2ctl -t $out/bin
|
install -Dm755 v2ray v2ctl -t $out/bin
|
||||||
'';
|
'';
|
||||||
};
|
|
||||||
|
|
||||||
in runCommand "v2ray-${version}" {
|
|
||||||
inherit version;
|
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
homepage = "https://www.v2ray.com/en/index.html";
|
homepage = "https://www.v2ray.com/en/index.html";
|
||||||
description = "A platform for building proxies to bypass network restrictions";
|
description = "A platform for building proxies to bypass network restrictions";
|
||||||
license = with lib.licenses; [ mit ];
|
# The license of the dependency `https://github.com/XTLS/Go` doesn't allowed user to modify its source code,
|
||||||
|
# which made it unfree.
|
||||||
|
license = with lib.licenses; [ mit unfree ];
|
||||||
maintainers = with lib.maintainers; [ servalcatty ];
|
maintainers = with lib.maintainers; [ servalcatty ];
|
||||||
};
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
in runCommand "v2ray-${version}" {
|
||||||
|
inherit version;
|
||||||
|
inherit (core) meta;
|
||||||
|
|
||||||
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
updateScript = ./update.sh;
|
updateScript = ./update.sh;
|
||||||
|
@ -14,7 +14,7 @@ echo "Current version:" >&2
|
|||||||
echo "core: $old_core_rev, geoip: $old_geoip_rev, geosite: $old_geosite_rev" >&2
|
echo "core: $old_core_rev, geoip: $old_geoip_rev, geosite: $old_geosite_rev" >&2
|
||||||
|
|
||||||
function fetch_latest_rev {
|
function fetch_latest_rev {
|
||||||
curl "https://api.github.com/repos/v2ray/$1/releases" |
|
curl "https://api.github.com/repos/v2fly/$1/releases" |
|
||||||
jq '.[0].tag_name' --raw-output
|
jq '.[0].tag_name' --raw-output
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,7 +28,7 @@ echo "core: $core_rev, geoip: $geoip_rev, geosite: $geosite_rev" >&2
|
|||||||
if [[ $core_rev != $old_core_rev ]]; then
|
if [[ $core_rev != $old_core_rev ]]; then
|
||||||
echo "Prefetching core..." >&2
|
echo "Prefetching core..." >&2
|
||||||
{ read hash; read store_path; } < <(
|
{ read hash; read store_path; } < <(
|
||||||
nix-prefetch-url --unpack --print-path "https://github.com/v2ray/v2ray-core/archive/v$core_rev.zip"
|
nix-prefetch-url --unpack --print-path "https://github.com/v2fly/v2ray-core/archive/v$core_rev.zip"
|
||||||
)
|
)
|
||||||
|
|
||||||
sed --in-place \
|
sed --in-place \
|
||||||
@ -40,7 +40,7 @@ fi
|
|||||||
|
|
||||||
if [[ $geoip_rev != $old_geoip_rev ]]; then
|
if [[ $geoip_rev != $old_geoip_rev ]]; then
|
||||||
echo "Prefetching geoip..." >&2
|
echo "Prefetching geoip..." >&2
|
||||||
hash=$(nix-prefetch-url "https://github.com/v2ray/geoip/releases/download/$geoip_rev/geoip.dat")
|
hash=$(nix-prefetch-url "https://github.com/v2fly/geoip/releases/download/$geoip_rev/geoip.dat")
|
||||||
sed --in-place \
|
sed --in-place \
|
||||||
-e "s/\bgeoipRev = \".*\"/geoipRev = \"$geoip_rev\"/" \
|
-e "s/\bgeoipRev = \".*\"/geoipRev = \"$geoip_rev\"/" \
|
||||||
-e "s/\bgeoipSha256 = \".*\"/geoipSha256 = \"$hash\"/" \
|
-e "s/\bgeoipSha256 = \".*\"/geoipSha256 = \"$hash\"/" \
|
||||||
@ -49,7 +49,7 @@ fi
|
|||||||
|
|
||||||
if [[ $geosite_rev != $old_geosite_rev ]]; then
|
if [[ $geosite_rev != $old_geosite_rev ]]; then
|
||||||
echo "Prefetching geosite..." >&2
|
echo "Prefetching geosite..." >&2
|
||||||
hash=$(nix-prefetch-url "https://github.com/v2ray/domain-list-community/releases/download/$geosite_rev/dlc.dat")
|
hash=$(nix-prefetch-url "https://github.com/v2fly/domain-list-community/releases/download/$geosite_rev/dlc.dat")
|
||||||
sed --in-place \
|
sed --in-place \
|
||||||
-e "s/\bgeositeRev = \".*\"/geositeRev = \"$geosite_rev\"/" \
|
-e "s/\bgeositeRev = \".*\"/geositeRev = \"$geosite_rev\"/" \
|
||||||
-e "s/\bgeositeSha256 = \".*\"/geositeSha256 = \"$hash\"/" \
|
-e "s/\bgeositeSha256 = \".*\"/geositeSha256 = \"$hash\"/" \
|
||||||
|
Loading…
Reference in New Issue
Block a user