Skip to content

Commit c8955ea

Browse files
MCSeekeri0xda157penalty1083
committed
geph -> geph5 : 4.99.16 -> 0.2.61
Co-authored-by: awwpotato <[email protected]> Co-authored-by: penalty1083 <[email protected]>
1 parent 9c446b2 commit c8955ea

File tree

2 files changed

+125
-125
lines changed

2 files changed

+125
-125
lines changed

pkgs/by-name/ge/geph/package.nix

Lines changed: 98 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1,142 +1,115 @@
11
{
22
lib,
3-
stdenvNoCC,
43
rustPlatform,
54
fetchFromGitHub,
6-
buildGoModule,
7-
makeWrapper,
8-
nodejs,
9-
pnpm,
10-
esbuild,
11-
perl,
125
pkg-config,
13-
glib,
14-
webkitgtk_4_0,
15-
libayatana-appindicator,
16-
cairo,
6+
libxkbcommon,
177
openssl,
8+
rust-jemalloc-sys-unprefixed,
9+
sqlite,
10+
vulkan-loader,
11+
wayland,
12+
iproute2,
13+
iptables,
14+
libglvnd,
15+
copyDesktopItems,
16+
makeDesktopItem,
1817
}:
19-
2018
let
21-
version = "4.99.16";
22-
geph-meta = with lib; {
23-
description = "Modular Internet censorship circumvention system designed specifically to deal with national filtering";
24-
homepage = "https://geph.io";
25-
platforms = platforms.linux;
26-
maintainers = with maintainers; [ penalty1083 ];
27-
};
19+
binPath = lib.makeBinPath [
20+
iproute2
21+
iptables
22+
];
2823
in
29-
{
30-
cli = rustPlatform.buildRustPackage rec {
31-
pname = "geph4-client";
32-
inherit version;
33-
34-
src = fetchFromGitHub {
35-
owner = "geph-official";
36-
repo = pname;
37-
rev = "v${version}";
38-
hash = "sha256-6YWPsSRIZpvVCIGZ1z7srobDvVzLr0o2jBcB/7kbK7I=";
39-
};
40-
41-
useFetchCargoVendor = true;
42-
cargoHash = "sha256-igIYTlI3hqvlOTgdwouA9YussP9h0pOHUUTCjA2LE5U=";
43-
44-
nativeBuildInputs = [ perl ];
45-
46-
meta = geph-meta // {
47-
license = with lib.licenses; [ gpl3Only ];
48-
};
24+
rustPlatform.buildRustPackage (finalAttrs: {
25+
pname = "geph5";
26+
version = "0.2.61";
27+
28+
src = fetchFromGitHub {
29+
owner = "geph-official";
30+
repo = "geph5";
31+
rev = "geph5-client-v${finalAttrs.version}";
32+
hash = "sha256-qy1E5x5Fn+xwS5st6HkMrJu9nksXQQIyJf97FvNOKO4=";
4933
};
5034

51-
gui = stdenvNoCC.mkDerivation (finalAttrs: {
52-
pname = "geph-gui";
53-
inherit version;
54-
55-
src = fetchFromGitHub {
56-
owner = "geph-official";
57-
repo = "gephgui-pkg";
58-
rev = "9f0d5c689c2cae67a4750a68295676f449724a98";
59-
hash = "sha256-/aHd1EDrFp1kXen5xRCCl8LVlMVH0pY8buILZri81II=";
60-
fetchSubmodules = true;
61-
};
35+
cargoHash = "sha256-r97DsSsqp/KtgqtYQe92nz2qaOBcJF6w9ckfxpk8Cxg=";
6236

63-
gephgui-wry = rustPlatform.buildRustPackage {
64-
pname = "gephgui-wry";
65-
inherit (finalAttrs) version src;
37+
patches = [ ./test-fix.patch ];
6638

67-
sourceRoot = "${finalAttrs.src.name}/gephgui-wry";
39+
postPatch = ''
40+
substituteInPlace binaries/geph5-client/src/vpn/*.sh \
41+
--replace-fail 'PATH=' 'PATH=${binPath}:'
42+
'';
6843

69-
useFetchCargoVendor = true;
70-
cargoHash = "sha256-pCj4SulUVEC4QTPBrPQBn5xJ+sHPs6KfjsdVRcsRapY=";
44+
nativeBuildInputs = [
45+
pkg-config
46+
copyDesktopItems
47+
];
7148

72-
pnpmDeps = pnpm.fetchDeps {
73-
inherit (finalAttrs) pname version src;
74-
sourceRoot = "${finalAttrs.src.name}/gephgui-wry/gephgui";
75-
hash = "sha256-0MGlsLEgugQ1wEz07ROIwkanTa8PSKwIaxNahyS1014=";
76-
};
49+
buildInputs = [
50+
openssl
51+
rust-jemalloc-sys-unprefixed
52+
sqlite
53+
];
7754

78-
nativeBuildInputs = [
79-
pkg-config
80-
pnpm.configHook
81-
makeWrapper
82-
nodejs
83-
];
84-
85-
buildInputs = [
86-
glib
87-
webkitgtk_4_0
88-
libayatana-appindicator
89-
cairo
90-
openssl
91-
];
92-
93-
ESBUILD_BINARY_PATH = "${lib.getExe (
94-
esbuild.override {
95-
buildGoModule =
96-
args:
97-
buildGoModule (
98-
args
99-
// rec {
100-
version = "0.15.10";
101-
src = fetchFromGitHub {
102-
owner = "evanw";
103-
repo = "esbuild";
104-
rev = "v${version}";
105-
hash = "sha256-DebmLtgPrla+1UcvOHMnWmxa/ZqrugeRRKXIiJ9LYDk=";
106-
};
107-
vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ=";
108-
}
109-
);
110-
}
111-
)}";
112-
113-
pnpmRoot = "gephgui";
114-
115-
preBuild = ''
116-
pushd gephgui
117-
pnpm build
118-
popd
119-
'';
120-
};
121-
122-
dontBuild = true;
123-
124-
installPhase = ''
125-
install -Dt $out/bin ${finalAttrs.gephgui-wry}/bin/gephgui-wry
126-
install -d $out/share/icons/hicolor
127-
for i in '16' '32' '64' '128' '256'
128-
do
129-
name=''${i}x''${i}
130-
dir=$out/share/icons/hicolor
131-
mkdir -p $dir
132-
mv flatpak/icons/$name $dir
133-
done
134-
install -Dt $out/share/applications flatpak/icons/io.geph.GephGui.desktop
135-
sed -i -e '/StartupWMClass/s/=.*/=gephgui-wry/' $out/share/applications/io.geph.GephGui.desktop
136-
'';
55+
env = {
56+
OPENSSL_NO_VENDOR = true;
57+
LIBSQLITE3_SYS_USE_PKG_CONFIG = "1";
58+
};
13759

138-
meta = geph-meta // {
139-
license = with lib.licenses; [ unfree ];
140-
};
141-
});
142-
}
60+
buildFeatures = [
61+
"aws_lambda"
62+
"windivert"
63+
];
64+
65+
checkFlags = [
66+
# Wrong test
67+
"--skip=traffcount::tests::test_traffic_cleanup"
68+
"--skip=traffcount::tests::test_traffic_count_basic"
69+
# Requires network
70+
"--skip=dns::tests::resolve_google"
71+
# Never finish
72+
"--skip=tests::test_blind_sign"
73+
"--skip=tests::test_generate_secret_key"
74+
];
75+
76+
desktopItems = [
77+
(makeDesktopItem {
78+
name = "Geph5";
79+
desktopName = "Geph5";
80+
icon = "geph5";
81+
exec = "geph5-client-gui";
82+
categories = [ "Network" ];
83+
comment = "Modular Internet censorship circumvention system designed specifically to deal with national filtering";
84+
})
85+
];
86+
87+
postInstall = ''
88+
install -m 444 -D binaries/geph5-client-gui/icon.png $out/share/icons/hicolor/512x512/apps/geph5.png
89+
'';
90+
91+
postFixup = ''
92+
# Add required but not explicitly requested libraries
93+
patchelf --add-rpath '${
94+
lib.makeLibraryPath [
95+
wayland
96+
libxkbcommon
97+
vulkan-loader
98+
libglvnd
99+
]
100+
}' "$out/bin/geph5-client-gui"
101+
'';
102+
103+
meta = {
104+
description = "Modular Internet censorship circumvention system designed specifically to deal with national filtering";
105+
homepage = "https://github.com/geph-official/geph5";
106+
changelog = "https://github.com/geph-official/geph5/releases/tag/geph5-client-v${finalAttrs.version}";
107+
mainProgram = "geph5-client";
108+
platforms = lib.platforms.unix;
109+
license = lib.licenses.mpl20;
110+
maintainers = with lib.maintainers; [
111+
penalty1083
112+
MCSeekeri
113+
];
114+
};
115+
})
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
diff --git a/binaries/geph5-client/src/traffcount.rs b/binaries/geph5-client/src/traffcount.rs
2+
index 5c91a27..61c0b3b 100644
3+
--- a/binaries/geph5-client/src/traffcount.rs
4+
+++ b/binaries/geph5-client/src/traffcount.rs
5+
@@ -28,14 +28,14 @@ impl TraffCount {
6+
}
7+
8+
// /// Create a new traffic counter with custom history length
9+
- // pub fn with_history(max_seconds: usize) -> Self {
10+
- // let now = Instant::now();
11+
- // Self {
12+
- // bins: VecDeque::with_capacity(max_seconds),
13+
- // window_start: now,
14+
- // max_history_seconds: max_seconds,
15+
- // }
16+
- // }
17+
+ pub fn with_history(max_seconds: usize) -> Self {
18+
+ let now = Instant::now();
19+
+ Self {
20+
+ bins: VecDeque::with_capacity(max_seconds),
21+
+ window_start: now,
22+
+ max_history_seconds: max_seconds,
23+
+ }
24+
+ }
25+
26+
/// Increment the traffic count with the given number of bytes
27+
pub fn incr(&mut self, bytes: f64) {

0 commit comments

Comments
 (0)