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

geph: init at 4.7.8 #206817

Merged
merged 2 commits into from
Mar 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions maintainers/maintainer-list.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11536,6 +11536,12 @@
githubId = 1368952;
name = "Pedro Lara Campos";
};
penalty1083 = {
email = "penalty1083@outlook.com";
github = "penalty1083";
githubId = 121009904;
name = "penalty1083";
};
penguwin = {
email = "penguwin@penguwin.eu";
github = "penguwin";
Expand Down
122 changes: 122 additions & 0 deletions pkgs/applications/networking/geph/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{ lib
, stdenvNoCC
, rustPlatform
, fetchFromGitHub
, buildNpmPackage
, perl
, pkg-config
, glib
, webkitgtk
, libappindicator-gtk3
, libayatana-appindicator
, cairo
, openssl
}:

let
version = "4.7.8";
geph-meta = with lib; {
description = "A modular Internet censorship circumvention system designed specifically to deal with national filtering.";
homepage = "https://geph.io";
platforms = platforms.linux;
maintainers = with maintainers; [ penalty1083 ];
};
in
{
cli = rustPlatform.buildRustPackage rec {
pname = "geph4-client";
inherit version;

src = fetchFromGitHub {
owner = "geph-official";
repo = pname;
rev = "v${version}";
hash = "sha256-DVGbLyFgraQMSIUAqDehF8DqbnvcaeWbuLVgiSQY3KE=";
};

cargoHash = "sha256-uBq6rjUnKEscwhu60HEZffLvuXcArz+AiR52org+qKw=";

nativeBuildInputs = [ perl ];

meta = geph-meta // {
license = with lib.licenses; [ gpl3Only ];
};
};

gui = stdenvNoCC.mkDerivation rec {
pname = "geph-gui";
inherit version;

src = fetchFromGitHub {
owner = "geph-official";
repo = "gephgui-pkg";
rev = "85a55bfc2f4314d9c49608f252080696b1f8e2a9";
hash = "sha256-id/sfaQsF480kUXg//O5rBIciuuhDuXY19FQe1E3OQs=";
fetchSubmodules = true;
penalty1083 marked this conversation as resolved.
Show resolved Hide resolved
};

gephgui = buildNpmPackage {
pname = "gephgui";
inherit version src;

sourceRoot = "source/gephgui-wry/gephgui";

postPatch = "ln -s ${./package-lock.json} ./package-lock.json";

npmDepsHash = "sha256-5y6zpMF4M56DiWVhMvjJGsYpVdlJSoWoWyPgLc7hJoo=";

installPhase = ''
runHook preInstall

mkdir -p $out
mv dist $out

runHook postInstall
'';
};

gephgui-wry = rustPlatform.buildRustPackage rec {
pname = "gephgui-wry";
inherit version src;

sourceRoot = "source/gephgui-wry";

cargoHash = "sha256-lidlUUfHXKPUlICdaVv/SFlyyWsZ7cYHyTJ3kkMn3L4=";

nativeBuildInputs = [ pkg-config ];

buildInputs = [
glib
webkitgtk
libappindicator-gtk3
libayatana-appindicator
cairo
openssl
];

preBuild = ''
ln -s ${gephgui}/dist ./gephgui
'';
};

dontBuild = true;

installPhase = ''
install -Dt $out/bin ${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 ];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we be a bit more specific which unfree license or is it custom?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no license in the repo. 🤷

};
};
}