3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/networking/tridactyl-native/default.nix
2020-12-01 23:27:35 -08:00

45 lines
1.1 KiB
Nix

{ stdenv
, fetchFromGitHub
, python3
}:
stdenv.mkDerivation rec {
pname = "tridactyl-native";
# this is actually the version of tridactyl itself; the native messenger will
# probably not change with every tridactyl version
version = "1.20.3";
src = fetchFromGitHub {
owner = "tridactyl";
repo = "tridactyl";
rev = version;
sha256 = "064cl9m4hdv69q1af0xjcf2rf30n3pvz6ym2l53w90aq3217amps";
};
sourceRoot = "source/native";
nativeBuildInputs = [
python3.pkgs.wrapPython
];
buildPhase = ''
sed -i -e "s|REPLACE_ME_WITH_SED|$out/share/tridactyl/native_main.py|" "tridactyl.json"
'';
installPhase = ''
mkdir -p "$out/lib/mozilla/native-messaging-hosts"
cp tridactyl.json "$out/lib/mozilla/native-messaging-hosts/"
mkdir -p "$out/share/tridactyl"
cp native_main.py "$out/share/tridactyl"
wrapPythonProgramsIn "$out/share/tridactyl"
'';
meta = with stdenv.lib; {
description = "Tridactyl native messaging host application";
homepage = "https://github.com/tridactyl/tridactyl";
license = licenses.asl20;
platforms = platforms.all;
maintainers = with maintainers; [ timokau ];
};
}