2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2019-05-28 11:14:06 +00:00
|
|
|
, 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
|
2021-01-23 10:36:17 +00:00
|
|
|
version = "1.20.4";
|
2019-05-28 11:14:06 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tridactyl";
|
|
|
|
repo = "tridactyl";
|
|
|
|
rev = version;
|
2021-01-23 10:36:17 +00:00
|
|
|
sha256 = "sha256-BjjRB9VadQ/MSwNK2QLbcTDoRs6Ua+5MONHtmfq4xz0=";
|
2019-05-28 11:14:06 +00:00
|
|
|
};
|
|
|
|
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"
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2019-05-28 11:14:06 +00:00
|
|
|
description = "Tridactyl native messaging host application";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/tridactyl/tridactyl";
|
2019-05-28 11:14:06 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ timokau ];
|
|
|
|
};
|
|
|
|
}
|