From 3eb4b5c8f2d0e13bec0b852384fa071f298fa88a Mon Sep 17 00:00:00 2001 From: MCSeekeri Date: Tue, 15 Apr 2025 09:27:06 +0000 Subject: [PATCH 1/3] maintainers: add MCSeekeri --- maintainers/maintainer-list.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index b1c0fc28f5dd..8f94ee6f5f1e 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -15325,6 +15325,16 @@ name = "John McParland"; keys = [ { fingerprint = "39D2 171D D733 C718 DD21 285E B326 E14B 05D8 7A4E"; } ]; }; + MCSeekeri = { + email = "mcseekeri@outlook.com"; + github = "mcseekeri"; + githubId = 20928094; + name = "MCSeekeri"; + keys = [ + { fingerprint = "5922 79AB D9D6 85EB 9D16 754C ECDC AD89 5A38 4A12"; } + { fingerprint = "0762 A387 F160 76F1 116C BF13 3276 6666 6666 6666"; } + ]; + }; McSinyx = { email = "cnx@loang.net"; github = "McSinyx"; From 9c446b23e05091fc607809eb80257c8e88637739 Mon Sep 17 00:00:00 2001 From: MCSeekeri Date: Mon, 21 Apr 2025 11:50:17 +0000 Subject: [PATCH 2/3] geph: move to by-name --- .../networking/geph/default.nix => by-name/ge/geph/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{applications/networking/geph/default.nix => by-name/ge/geph/package.nix} (100%) diff --git a/pkgs/applications/networking/geph/default.nix b/pkgs/by-name/ge/geph/package.nix similarity index 100% rename from pkgs/applications/networking/geph/default.nix rename to pkgs/by-name/ge/geph/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 85278cf90f59..a8b0ec6a764f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9370,8 +9370,6 @@ with pkgs; gecode_6 = qt5.callPackage ../development/libraries/gecode { }; gecode = gecode_6; - geph = recurseIntoAttrs (callPackages ../applications/networking/geph { pnpm = pnpm_8; }); - gegl = callPackage ../development/libraries/gegl { inherit (darwin.apple_sdk.frameworks) OpenCL; openexr = openexr_2; From c8955ea96eb127374bd4e0e3d9073c03b46f8f49 Mon Sep 17 00:00:00 2001 From: MCSeekeri Date: Sat, 31 May 2025 08:10:28 +0000 Subject: [PATCH 3/3] geph -> geph5 : 4.99.16 -> 0.2.61 Co-authored-by: awwpotato <153149335+awwpotato@users.noreply.github.com> Co-authored-by: penalty1083 --- pkgs/by-name/ge/geph/package.nix | 211 ++++++++++++---------------- pkgs/by-name/ge/geph/test-fix.patch | 27 ++++ 2 files changed, 119 insertions(+), 119 deletions(-) create mode 100644 pkgs/by-name/ge/geph/test-fix.patch diff --git a/pkgs/by-name/ge/geph/package.nix b/pkgs/by-name/ge/geph/package.nix index 3a8082687666..e8b6ba8cdbb2 100644 --- a/pkgs/by-name/ge/geph/package.nix +++ b/pkgs/by-name/ge/geph/package.nix @@ -1,142 +1,115 @@ { lib, - stdenvNoCC, rustPlatform, fetchFromGitHub, - buildGoModule, - makeWrapper, - nodejs, - pnpm, - esbuild, - perl, pkg-config, - glib, - webkitgtk_4_0, - libayatana-appindicator, - cairo, + libxkbcommon, openssl, + rust-jemalloc-sys-unprefixed, + sqlite, + vulkan-loader, + wayland, + iproute2, + iptables, + libglvnd, + copyDesktopItems, + makeDesktopItem, }: - let - version = "4.99.16"; - geph-meta = with lib; { - description = "Modular Internet censorship circumvention system designed specifically to deal with national filtering"; - homepage = "https://geph.io"; - platforms = platforms.linux; - maintainers = with maintainers; [ penalty1083 ]; - }; + binPath = lib.makeBinPath [ + iproute2 + iptables + ]; in -{ - cli = rustPlatform.buildRustPackage rec { - pname = "geph4-client"; - inherit version; +rustPlatform.buildRustPackage (finalAttrs: { + pname = "geph5"; + version = "0.2.61"; - src = fetchFromGitHub { - owner = "geph-official"; - repo = pname; - rev = "v${version}"; - hash = "sha256-6YWPsSRIZpvVCIGZ1z7srobDvVzLr0o2jBcB/7kbK7I="; - }; - - useFetchCargoVendor = true; - cargoHash = "sha256-igIYTlI3hqvlOTgdwouA9YussP9h0pOHUUTCjA2LE5U="; - - nativeBuildInputs = [ perl ]; - - meta = geph-meta // { - license = with lib.licenses; [ gpl3Only ]; - }; + src = fetchFromGitHub { + owner = "geph-official"; + repo = "geph5"; + rev = "geph5-client-v${finalAttrs.version}"; + hash = "sha256-qy1E5x5Fn+xwS5st6HkMrJu9nksXQQIyJf97FvNOKO4="; }; - gui = stdenvNoCC.mkDerivation (finalAttrs: { - pname = "geph-gui"; - inherit version; + cargoHash = "sha256-r97DsSsqp/KtgqtYQe92nz2qaOBcJF6w9ckfxpk8Cxg="; - src = fetchFromGitHub { - owner = "geph-official"; - repo = "gephgui-pkg"; - rev = "9f0d5c689c2cae67a4750a68295676f449724a98"; - hash = "sha256-/aHd1EDrFp1kXen5xRCCl8LVlMVH0pY8buILZri81II="; - fetchSubmodules = true; - }; + patches = [ ./test-fix.patch ]; - gephgui-wry = rustPlatform.buildRustPackage { - pname = "gephgui-wry"; - inherit (finalAttrs) version src; + postPatch = '' + substituteInPlace binaries/geph5-client/src/vpn/*.sh \ + --replace-fail 'PATH=' 'PATH=${binPath}:' + ''; - sourceRoot = "${finalAttrs.src.name}/gephgui-wry"; + nativeBuildInputs = [ + pkg-config + copyDesktopItems + ]; - useFetchCargoVendor = true; - cargoHash = "sha256-pCj4SulUVEC4QTPBrPQBn5xJ+sHPs6KfjsdVRcsRapY="; + buildInputs = [ + openssl + rust-jemalloc-sys-unprefixed + sqlite + ]; - pnpmDeps = pnpm.fetchDeps { - inherit (finalAttrs) pname version src; - sourceRoot = "${finalAttrs.src.name}/gephgui-wry/gephgui"; - hash = "sha256-0MGlsLEgugQ1wEz07ROIwkanTa8PSKwIaxNahyS1014="; - }; + env = { + OPENSSL_NO_VENDOR = true; + LIBSQLITE3_SYS_USE_PKG_CONFIG = "1"; + }; - nativeBuildInputs = [ - pkg-config - pnpm.configHook - makeWrapper - nodejs - ]; + buildFeatures = [ + "aws_lambda" + "windivert" + ]; - buildInputs = [ - glib - webkitgtk_4_0 - libayatana-appindicator - cairo - openssl - ]; + checkFlags = [ + # Wrong test + "--skip=traffcount::tests::test_traffic_cleanup" + "--skip=traffcount::tests::test_traffic_count_basic" + # Requires network + "--skip=dns::tests::resolve_google" + # Never finish + "--skip=tests::test_blind_sign" + "--skip=tests::test_generate_secret_key" + ]; - ESBUILD_BINARY_PATH = "${lib.getExe ( - esbuild.override { - buildGoModule = - args: - buildGoModule ( - args - // rec { - version = "0.15.10"; - src = fetchFromGitHub { - owner = "evanw"; - repo = "esbuild"; - rev = "v${version}"; - hash = "sha256-DebmLtgPrla+1UcvOHMnWmxa/ZqrugeRRKXIiJ9LYDk="; - }; - vendorHash = "sha256-+BfxCyg0KkDQpHt/wycy/8CTG6YBA/VJvJFhhzUnSiQ="; - } - ); - } - )}"; + desktopItems = [ + (makeDesktopItem { + name = "Geph5"; + desktopName = "Geph5"; + icon = "geph5"; + exec = "geph5-client-gui"; + categories = [ "Network" ]; + comment = "Modular Internet censorship circumvention system designed specifically to deal with national filtering"; + }) + ]; - pnpmRoot = "gephgui"; + postInstall = '' + install -m 444 -D binaries/geph5-client-gui/icon.png $out/share/icons/hicolor/512x512/apps/geph5.png + ''; - preBuild = '' - pushd gephgui - pnpm build - popd - ''; - }; + postFixup = '' + # Add required but not explicitly requested libraries + patchelf --add-rpath '${ + lib.makeLibraryPath [ + wayland + libxkbcommon + vulkan-loader + libglvnd + ] + }' "$out/bin/geph5-client-gui" + ''; - dontBuild = true; - - installPhase = '' - install -Dt $out/bin ${finalAttrs.gephgui-wry}/bin/gephgui-wry - install -d $out/share/icons/hicolor - for i in '16' '32' '64' '128' '256' - do - name=''${i}x''${i} - dir=$out/share/icons/hicolor - mkdir -p $dir - mv flatpak/icons/$name $dir - done - install -Dt $out/share/applications flatpak/icons/io.geph.GephGui.desktop - sed -i -e '/StartupWMClass/s/=.*/=gephgui-wry/' $out/share/applications/io.geph.GephGui.desktop - ''; - - meta = geph-meta // { - license = with lib.licenses; [ unfree ]; - }; - }); -} + meta = { + description = "Modular Internet censorship circumvention system designed specifically to deal with national filtering"; + homepage = "https://github.com/geph-official/geph5"; + changelog = "https://github.com/geph-official/geph5/releases/tag/geph5-client-v${finalAttrs.version}"; + mainProgram = "geph5-client"; + platforms = lib.platforms.unix; + license = lib.licenses.mpl20; + maintainers = with lib.maintainers; [ + penalty1083 + MCSeekeri + ]; + }; +}) diff --git a/pkgs/by-name/ge/geph/test-fix.patch b/pkgs/by-name/ge/geph/test-fix.patch new file mode 100644 index 000000000000..6df6cd4e589f --- /dev/null +++ b/pkgs/by-name/ge/geph/test-fix.patch @@ -0,0 +1,27 @@ +diff --git a/binaries/geph5-client/src/traffcount.rs b/binaries/geph5-client/src/traffcount.rs +index 5c91a27..61c0b3b 100644 +--- a/binaries/geph5-client/src/traffcount.rs ++++ b/binaries/geph5-client/src/traffcount.rs +@@ -28,14 +28,14 @@ impl TraffCount { + } + + // /// Create a new traffic counter with custom history length +- // pub fn with_history(max_seconds: usize) -> Self { +- // let now = Instant::now(); +- // Self { +- // bins: VecDeque::with_capacity(max_seconds), +- // window_start: now, +- // max_history_seconds: max_seconds, +- // } +- // } ++ pub fn with_history(max_seconds: usize) -> Self { ++ let now = Instant::now(); ++ Self { ++ bins: VecDeque::with_capacity(max_seconds), ++ window_start: now, ++ max_history_seconds: max_seconds, ++ } ++ } + + /// Increment the traffic count with the given number of bytes + pub fn incr(&mut self, bytes: f64) {