Skip to content

Commit b34cdcc

Browse files
committedMar 18, 2025
nekoray: switch to maintained fork, 3.26 -> 4.2.12
1 parent 1bab4cb commit b34cdcc

File tree

3 files changed

+43
-157
lines changed

3 files changed

+43
-157
lines changed
 

‎pkgs/by-name/ne/nekoray/nekobox-core.nix

-36
This file was deleted.

‎pkgs/by-name/ne/nekoray/nekoray-core.nix

-26
This file was deleted.

‎pkgs/by-name/ne/nekoray/package.nix

+43-95
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,46 @@
11
{
22
lib,
33
stdenv,
4+
buildGoModule,
5+
46
fetchFromGitHub,
5-
libsForQt5,
67
cmake,
78
ninja,
8-
protobuf,
9-
yaml-cpp,
10-
zxing-cpp,
11-
callPackage,
129
makeDesktopItem,
1310
copyDesktopItems,
1411

15-
v2ray-geoip,
16-
v2ray-domain-list-community,
17-
sing-geoip,
18-
sing-geosite,
12+
libcpr,
13+
protobuf,
14+
qt6Packages,
15+
yaml-cpp,
16+
zxing-cpp,
1917
}:
2018

21-
let
22-
fetchSource =
23-
args:
24-
fetchFromGitHub (
25-
args
26-
// {
27-
owner = "MatsuriDayo";
28-
repo = args.name;
29-
}
30-
);
31-
32-
extraSources = {
33-
# revs found in https://github.com/MatsuriDayo/nekoray/blob/<version>/libs/get_source_env.sh
34-
Xray-core = fetchSource {
35-
name = "Xray-core";
36-
rev = "01208225ee7e508044cca8eb6776a117bcecd997";
37-
hash = "sha256-R66i9MITdE9JlhD4wV0EitKPxyahQqDNpunUxVTmupA=";
38-
};
39-
sing-box-extra = fetchSource {
40-
name = "sing-box-extra";
41-
rev = "d31d6da26a51a929349e0d75fd89dccbe20d1268";
42-
hash = "sha256-YlzMAff8VOZGyCP7ksjcmoBDHT5llTYwwXIrs+qO5P4=";
43-
};
44-
45-
# revs found in https://github.com/MatsuriDayo/sing-box-extra/blob/<sing-box-extra.rev>/libs/get_source_env.sh
46-
sing-box = fetchSource {
47-
name = "sing-box";
48-
rev = "64f4eed2c667d9ff1e52a84233dee0e2ca32c17e";
49-
hash = "sha256-jIg/+fvTn46h6tE6YXtov+ZaBD/ywApTZbzHlT5v4lM=";
50-
};
51-
sing-quic = fetchSource {
52-
name = "sing-quic";
53-
rev = "e396733db4de15266f0cfdb43c392aca0759324a";
54-
hash = "sha256-un5NtZPRx1QAjwNhXkR9OVGldtfM1jQoNRUzt9oilUE=";
55-
};
56-
libneko = fetchSource {
57-
name = "libneko";
58-
rev = "5277a5bfc889ee7a89462695b0e678c1bd4909b1";
59-
hash = "sha256-6dlWDzI9ox4PQzEtJNgwA0pXmPC7fGrGId88Zl+1gpw=";
60-
};
61-
};
62-
63-
geodata = {
64-
"geoip.dat" = "${v2ray-geoip}/share/v2ray/geoip.dat";
65-
"geosite.dat" = "${v2ray-domain-list-community}/share/v2ray/geosite.dat";
66-
"geoip.db" = "${sing-geoip}/share/sing-box/geoip.db";
67-
"geosite.db" = "${sing-geosite}/share/sing-box/geosite.db";
68-
};
69-
70-
installGeodata = lib.concatStringsSep "\n" (
71-
lib.mapAttrsToList (filename: file: ''
72-
install -Dm644 ${file} "$out/share/nekoray/${filename}"
73-
'') geodata
74-
);
75-
in
7619
stdenv.mkDerivation (finalAttrs: {
7720
pname = "nekoray";
78-
version = "3.26";
21+
version = "4.2.12";
7922

80-
src = fetchSource {
81-
name = "nekoray";
82-
rev = finalAttrs.version;
83-
hash = "sha256-fDm6fCI6XA4DHKCN3zm9B7Qbdh3LTHYGK8fPmeEnhjI=";
84-
fetchSubmodules = true;
23+
src = fetchFromGitHub {
24+
owner = "Mahdi-zarei";
25+
repo = "nekoray";
26+
tag = finalAttrs.version;
27+
hash = "sha256-5BXrfNPBZ+smpniA1jOPWE0X/be/C9MzswfbwmWEnyQ=";
8528
};
8629

8730
strictDeps = true;
8831

8932
nativeBuildInputs = [
90-
libsForQt5.wrapQtAppsHook
9133
cmake
92-
ninja
9334
copyDesktopItems
35+
ninja
36+
qt6Packages.wrapQtAppsHook
9437
];
9538

9639
buildInputs = [
97-
libsForQt5.qtbase
98-
libsForQt5.qttools
99-
libsForQt5.qtwayland
100-
libsForQt5.qtx11extras
40+
libcpr
10141
protobuf
42+
qt6Packages.qtbase
43+
qt6Packages.qttools
10244
yaml-cpp
10345
zxing-cpp
10446
];
@@ -115,13 +57,8 @@ stdenv.mkDerivation (finalAttrs: {
11557
ln -s "$out/share/nekoray/nekoray" "$out/bin"
11658
11759
# nekoray looks for other files and cores in the same directory it's located at
118-
ln -s ${finalAttrs.passthru.nekoray-core}/bin/nekoray_core "$out/share/nekoray/nekoray_core"
11960
ln -s ${finalAttrs.passthru.nekobox-core}/bin/nekobox_core "$out/share/nekoray/nekobox_core"
12061
121-
${installGeodata}
122-
123-
install -Dm644 "$src/res/public/nekoray.png" "$out/share/icons/hicolor/256x256/apps/nekoray.png"
124-
12562
runHook postInstall
12663
'';
12764

@@ -133,27 +70,38 @@ stdenv.mkDerivation (finalAttrs: {
13370
icon = "nekoray";
13471
comment = finalAttrs.meta.description;
13572
terminal = false;
136-
categories = [
137-
"Network"
138-
"Application"
139-
];
73+
categories = [ "Network" ];
14074
})
14175
];
14276

143-
passthru = {
144-
nekobox-core = callPackage ./nekobox-core.nix {
145-
inherit (finalAttrs) src version;
146-
inherit extraSources;
147-
};
148-
nekoray-core = callPackage ./nekoray-core.nix {
149-
inherit (finalAttrs) src version;
150-
inherit extraSources;
151-
};
77+
passthru.nekobox-core = buildGoModule {
78+
pname = "nekobox-core";
79+
inherit (finalAttrs) version src;
80+
sourceRoot = "${finalAttrs.src.name}/core/server";
81+
82+
vendorHash = "sha256-PDED6Haa3m2CZLij2A8Am7vSwep2YFrR984UNypduWo=";
83+
84+
# ldflags and tags are taken from script/build_go.sh
85+
ldflags = [
86+
"-w"
87+
"-s"
88+
"-X github.com/sagernet/sing-box/constant.Version=${finalAttrs.version}"
89+
];
90+
91+
tags = [
92+
"with_clash_api"
93+
"with_gvisor"
94+
"with_quic"
95+
"with_wireguard"
96+
"with_utls"
97+
"with_ech"
98+
"with_dhcp"
99+
];
152100
};
153101

154102
meta = {
155103
description = "Qt based cross-platform GUI proxy configuration manager";
156-
homepage = "https://github.com/MatsuriDayo/nekoray";
104+
homepage = "https://github.com/Mahdi-zarei/nekoray";
157105
license = lib.licenses.gpl3Plus;
158106
mainProgram = "nekoray";
159107
maintainers = with lib.maintainers; [ tomasajt ];

0 commit comments

Comments
 (0)
Failed to load comments.