tridactyl-native: init new Nim rewrite at 0.3.6

This commit is contained in:
Mostly Void 2022-04-27 18:15:14 +05:30 committed by ehmry
parent fc1ba1be4e
commit 71c69919a0

View file

@ -1,44 +1,29 @@
{ lib, stdenv { lib, nimPackages, fetchFromGitHub }:
, fetchFromGitHub
, python3
}:
stdenv.mkDerivation rec { nimPackages.buildNimPackage rec {
pname = "tridactyl-native"; pname = "tridactly-native";
# this is actually the version of tridactyl itself; the native messenger will version = "0.3.6";
# probably not change with every tridactyl version
version = "1.20.4";
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "tridactyl"; owner = "tridactyl";
repo = "tridactyl"; repo = "native_messenger";
rev = version; rev = "5cc315da79a1caa8fd5b27b192377d8824a311c1";
sha256 = "sha256-BjjRB9VadQ/MSwNK2QLbcTDoRs6Ua+5MONHtmfq4xz0="; sha256 = "sha256-9IyVDJgdZleeNltD1b4PfqxeWAtFsPHtmq1ZC5Z0O9k=";
}; };
sourceRoot = "source/native"; buildInputs = with nimPackages; [ tempfile ];
nativeBuildInputs = [
python3.pkgs.wrapPython
];
buildPhase = ''
sed -i -e "s|REPLACE_ME_WITH_SED|$out/share/tridactyl/native_main.py|" "tridactyl.json"
'';
installPhase = '' installPhase = ''
mkdir -p "$out/lib/mozilla/native-messaging-hosts" mkdir -p "$out/lib/mozilla/native-messaging-hosts"
sed -i -e "s|REPLACE_ME_WITH_SED|$out/bin/native_main|" "tridactyl.json"
cp tridactyl.json "$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 lib; { meta = with lib; {
description = "Tridactyl native messaging host application"; description =
homepage = "https://github.com/tridactyl/tridactyl"; "Native messenger for Tridactyl, a vim-like Firefox webextension";
license = licenses.asl20; homepage = "https://github.com/tridactyl/native_messenger";
license = licenses.bsd2;
platforms = platforms.all; platforms = platforms.all;
maintainers = with maintainers; [ timokau ]; maintainers = with maintainers; [ timokau dit7ya ];
}; };
} }