Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2rayn: 7.4.1 -> 7.6.1 #367858

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 34 additions & 34 deletions pkgs/by-name/v2/v2rayn/deps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 17 additions & 25 deletions pkgs/by-name/v2/v2rayn/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,21 @@
openssl,
lttng-ust_2_12,
krb5,
imagemagick,
makeDesktopItem,
copyDesktopItems,
bash,
xorg,
xdg-utils,
}:
buildDotnetModule rec {
pname = "v2rayn";
version = "7.4.1";
version = "7.6.1";

src = fetchFromGitHub {
owner = "2dust";
repo = "v2rayN";
tag = version;
hash = "sha256-mtmuEwZy72LPYFf7hzE8TYiSh2kK6xe2CRdkOSbg2h4=";
hash = "sha256-mpd9Krlmu/XgyEGMsuBLCP58/RgEQWcQWLMOmt0/7KM=";
};

projectFile = "v2rayN/v2rayN.Desktop/v2rayN.Desktop.csproj";
Expand All @@ -35,9 +35,13 @@ buildDotnetModule rec {
postPatch = ''
substituteInPlace v2rayN/ServiceLib/Common/Utils.cs \
--replace-fail "/bin/bash" "${bash}/bin/bash"
substituteInPlace v2rayN/ServiceLib/Handler/AutoStartupHandler.cs \
--replace-fail "Utils.GetExePath())" '"${placeholder "out"}/bin/v2rayN")'
substituteInPlace v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs \
--replace-fail "nautilus" "${xdg-utils}/bin/xdg-open"
'';

dotnetInstallFlags = [ "-p:PublishReadyToRun=false" ];
dotnetBuildFlags = [ "-p:PublishReadyToRun=false" ];

dotnet-sdk = dotnetCorePackages.sdk_8_0;

Expand All @@ -46,7 +50,6 @@ buildDotnetModule rec {
executables = [ "v2rayN" ];

nativeBuildInputs = [
imagemagick
copyDesktopItems
autoPatchelfHook
];
Expand All @@ -71,39 +74,28 @@ buildDotnetModule rec {
xorg.libXext
];

postBuild =
let
selectSystem =
attrs:
attrs.${stdenv.hostPlatform.system}
or (throw "v2rayn: ${stdenv.hostPlatform.system} is not supported");
arch = selectSystem {
x86_64-linux = "x64";
aarch64-linux = "arm64";
};
in
''
mv ./v2rayN/v2rayN.Desktop/bin/Release/net8.0/linux-${arch} ./v2rayN/v2rayN.Desktop/bin/Release/v2rayn
rm -r ./v2rayN/v2rayN.Desktop/bin/Release/net8.0
mv ./v2rayN/v2rayN.Desktop/bin/Release/v2rayn ./v2rayN/v2rayN.Desktop/bin/Release/net8.0
ln -s . ./v2rayN/v2rayN.Desktop/bin/Release/net8.0/linux-${arch}
'';

desktopItems = [
(makeDesktopItem {
name = "v2rayn";
exec = "v2rayN";
icon = "v2rayn";
genericName = "v2rayN";
desktopName = "v2rayN";
categories = [
"Network"
"Application"
];
terminal = false;
comment = "A GUI client for Windows and Linux, support Xray core and sing-box-core and others";
})
];

postInstall = ''
mkdir -p $out/share/pixmaps
magick "v2rayN/v2rayN.Desktop/Assets/v2rayN.ico[11]" $out/share/pixmaps/v2rayn.png
install -Dm644 v2rayN/v2rayN.Desktop/v2rayN.png $out/share/pixmaps/v2rayn.png
'';

passthru.updateScript = ./update.sh;

meta = {
description = "GUI client for Windows and Linux, support Xray core and sing-box-core and others";
homepage = "https://github.com/2dust/v2rayN";
Expand Down
8 changes: 8 additions & 0 deletions pkgs/by-name/v2/v2rayn/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bash nix nix-update

set -eou pipefail

nix-update v2rayn

$(nix-build -A v2rayn.fetch-deps)