weechatScripts.multiline: init at 0.6.3

This commit is contained in:
Alvar Penning 2021-02-04 13:52:09 +01:00
parent e74cfaf671
commit 997e0a8863
3 changed files with 54 additions and 1 deletions

View File

@ -1,8 +1,12 @@
{ callPackage, luaPackages, python3Packages }:
{ callPackage, luaPackages, perlPackages, python3Packages }:
{
colorize_nicks = callPackage ./colorize_nicks { };
multiline = callPackage ./multiline {
inherit (perlPackages) PodParser;
};
weechat-matrix-bridge = callPackage ./weechat-matrix-bridge {
inherit (luaPackages) cjson luaffi;
};

View File

@ -0,0 +1,40 @@
{ stdenv, lib, fetchurl, substituteAll, PodParser }:
stdenv.mkDerivation {
pname = "multiline";
version = "0.6.3";
src = fetchurl {
url = "https://raw.githubusercontent.com/weechat/scripts/945315bed4bc2beaf1e47f9b946ffe8f638f77fe/perl/multiline.pl";
sha256 = "1smialb21ny7brhij4sbw46xvsmrdv6ig2da0ip63ga2afngwsy4";
};
dontUnpack = true;
prePatch = ''
cp $src multiline.pl
'';
patches = [
# The script requires a special Perl environment.
(substituteAll {
src = ./libpath.patch;
env = PodParser;
})
];
passthru.scripts = [ "multiline.pl" ];
installPhase = ''
runHook preInstall
install -D multiline.pl $out/share/multiline.pl
runHook postInstall
'';
meta = with lib; {
description = "Multi-line edit box";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ oxzi ];
};
}

View File

@ -0,0 +1,9 @@
diff --git a/multiline.pl b/multiline.pl
index 54474d4..42fbef8 100644
--- a/multiline.pl
+++ b/multiline.pl
@@ -1,3 +1,4 @@
+use lib '@env@/lib/perl5/site_perl';
use strict; use warnings;
$INC{'Encode/ConfigLocal.pm'}=1;
require Encode;