|
| 1 | +{ |
| 2 | + lib, |
| 3 | + rustPlatform, |
| 4 | + webkitgtk_4_1, |
| 5 | + pkg-config, |
| 6 | + buildNpmPackage, |
| 7 | + makeDesktopItem, |
| 8 | + fetchFromGitHub, |
| 9 | + nix-update-script, |
| 10 | + perl, |
| 11 | + stdenv, |
| 12 | + glib, |
| 13 | + copyDesktopItems, |
| 14 | + wrapGAppsHook4, |
| 15 | +}: |
| 16 | +let |
| 17 | + version = "5.3.1"; |
| 18 | + src = fetchFromGitHub { |
| 19 | + owner = "geph-official"; |
| 20 | + repo = "gephgui-pkg"; |
| 21 | + rev = "v${version}"; |
| 22 | + hash = "sha256-JKzb8Hu91SDYs3E2U2WKX3iXif8fi6rmPglhuCXWLco="; |
| 23 | + fetchSubmodules = true; |
| 24 | + }; |
| 25 | + |
| 26 | + gephgui = buildNpmPackage { |
| 27 | + pname = "gephgui"; |
| 28 | + inherit version src; |
| 29 | + |
| 30 | + sourceRoot = "${src.name}/gephgui-wry/gephgui"; |
| 31 | + |
| 32 | + npmDepsHash = "sha256-dGzmdvzKp/JHCgDf3NJb0oolgW4Y/spagzpeVpMF28w="; |
| 33 | + |
| 34 | + installPhase = '' |
| 35 | + mkdir -p $out |
| 36 | + cp -aR dist/* $out/ |
| 37 | + ''; |
| 38 | + }; |
| 39 | + |
| 40 | + pac-cmd = stdenv.mkDerivation { |
| 41 | + pname = "pac-cmd"; |
| 42 | + version = "0-unstable-2020-01-07"; |
| 43 | + |
| 44 | + src = fetchFromGitHub { |
| 45 | + owner = "getlantern"; |
| 46 | + repo = "pac-cmd"; |
| 47 | + rev = "495bad48b8601385daa8205ec4db504166dff18b"; |
| 48 | + hash = "sha256-T4g0FR20sOxJ20H4LTmhrA2EsRe8JYXj6MB2ImkbPsY="; |
| 49 | + }; |
| 50 | + |
| 51 | + postPatch = " |
| 52 | + rm binaries/*/pac |
| 53 | + substituteInPlace Makefile --replace-fail 'uname -p' 'uname -m' |
| 54 | + "; |
| 55 | + |
| 56 | + nativeBuildInputs = [ pkg-config ]; |
| 57 | + buildInputs = [ glib ]; |
| 58 | + installPhase = '' |
| 59 | + runHook preInstall |
| 60 | +
|
| 61 | + install -Dm755 -t $out/bin binaries/*/pac |
| 62 | +
|
| 63 | + runHook postInstall |
| 64 | + ''; |
| 65 | + |
| 66 | + meta = { |
| 67 | + description = "Simple Go library to toggle on and off system pac for various OS"; |
| 68 | + homepage = "https://github.com/getlantern/pac"; |
| 69 | + license = lib.licenses.unfree; |
| 70 | + mainProgram = "pac"; |
| 71 | + platforms = lib.platforms.all; |
| 72 | + }; |
| 73 | + }; |
| 74 | +in |
| 75 | +rustPlatform.buildRustPackage { |
| 76 | + pname = "gephgui-wry"; |
| 77 | + inherit version src; |
| 78 | + sourceRoot = "${src.name}/gephgui-wry"; |
| 79 | + |
| 80 | + cargoHash = "sha256-YljXyBIxi0DNmA78nSWAcxscMzd29wHHa4CmPdl/f2w="; |
| 81 | + |
| 82 | + nativeBuildInputs = [ |
| 83 | + pkg-config |
| 84 | + perl |
| 85 | + copyDesktopItems |
| 86 | + wrapGAppsHook4 |
| 87 | + ]; |
| 88 | + |
| 89 | + buildInputs = [ webkitgtk_4_1 ]; |
| 90 | + |
| 91 | + preBuild = '' |
| 92 | + cp -r ${gephgui}/ gephgui/dist/ |
| 93 | + ''; |
| 94 | + |
| 95 | + postInstall = '' |
| 96 | + install -m 444 -D gephgui/public/gephlogo.png $out/share/icons/hicolor/512x512/apps/geph.png |
| 97 | +
|
| 98 | + gappsWrapperArgs+=( |
| 99 | + --suffix PATH : ${lib.makeBinPath [ pac-cmd ]} |
| 100 | + ) |
| 101 | + ''; |
| 102 | + |
| 103 | + desktopItems = [ |
| 104 | + (makeDesktopItem { |
| 105 | + name = "Geph"; |
| 106 | + desktopName = "Geph"; |
| 107 | + icon = "geph"; |
| 108 | + exec = "gephgui-wry"; |
| 109 | + categories = [ "Network" ]; |
| 110 | + comment = "Modular Internet censorship circumvention system designed specifically to deal with national filtering"; |
| 111 | + startupWMClass = "geph"; |
| 112 | + }) |
| 113 | + ]; |
| 114 | + |
| 115 | + passthru.updateScript = nix-update-script { }; |
| 116 | + |
| 117 | + meta = { |
| 118 | + description = "Modular Internet censorship circumvention system designed specifically to deal with national filtering"; |
| 119 | + homepage = "https://github.com/geph-official/gephgui-wry"; |
| 120 | + mainProgram = "gephgui-wry"; |
| 121 | + platforms = lib.platforms.linux; |
| 122 | + license = lib.licenses.mpl20; |
| 123 | + maintainers = with lib.maintainers; [ |
| 124 | + penalty1083 |
| 125 | + MCSeekeri |
| 126 | + ]; |
| 127 | + }; |
| 128 | +} |
0 commit comments