2020-06-26 10:23:52 +02:00
|
|
|
{ stdenv, fetchFromGitHub, perl, perlPackages, makeWrapper, shortenPerlShebang
|
|
|
|
, nixosTests
|
|
|
|
}:
|
2020-06-05 14:49:44 +02:00
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
perlPackages.buildPerlPackage rec {
|
|
|
|
pname = "convos";
|
2020-09-23 13:11:00 +02:00
|
|
|
version = "4.40";
|
2020-06-05 14:49:44 +02:00
|
|
|
|
2020-07-29 13:56:44 +02:00
|
|
|
src = fetchFromGitHub {
|
2020-06-05 14:49:44 +02:00
|
|
|
owner = "Nordaaker";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-09-23 13:11:00 +02:00
|
|
|
sha256 = "0yyykr86d494xq1ga5ncr6jmdf0ny1r4gm0wzwn49bxn2x1l0xck";
|
2020-06-05 14:49:44 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ]
|
|
|
|
++ optional stdenv.isDarwin [ shortenPerlShebang ];
|
2020-06-26 10:23:52 +02:00
|
|
|
|
2020-06-05 14:49:44 +02:00
|
|
|
buildInputs = with perlPackages; [
|
|
|
|
CryptEksblowfish FileHomeDir FileReadBackwards
|
|
|
|
IOSocketSSL IRCUtils JSONValidator LinkEmbedder ModuleInstall
|
|
|
|
Mojolicious MojoliciousPluginOpenAPI MojoliciousPluginWebpack
|
|
|
|
ParseIRC TextMarkdown TimePiece UnicodeUTF8
|
|
|
|
CpanelJSONXS EV
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = with perlPackages; [ TestDeep TestMore ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs script/convos
|
|
|
|
'';
|
|
|
|
|
|
|
|
preCheck = ''
|
2020-08-27 05:32:11 +02:00
|
|
|
# Remove online test
|
|
|
|
#
|
|
|
|
rm t/web-pwa.t
|
|
|
|
|
2020-07-18 15:29:37 +02:00
|
|
|
# A test fails since gethostbyaddr(127.0.0.1) fails to resolve to localhost in
|
|
|
|
# the sandbox, we replace the this out from a substitution expression
|
|
|
|
#
|
2020-06-05 14:49:44 +02:00
|
|
|
substituteInPlace t/web-register-open-to-public.t \
|
|
|
|
--replace '!127.0.0.1!' '!localhost!'
|
|
|
|
|
2020-07-18 15:29:37 +02:00
|
|
|
# Module::Install is a runtime dependency not covered by the tests, so we add
|
|
|
|
# a test for it.
|
|
|
|
#
|
2020-06-05 14:49:44 +02:00
|
|
|
echo "use Test::More tests => 1;require_ok('Module::Install')" \
|
|
|
|
> t/00_nixpkgs_module_install.t
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Convos expects to find assets in both auto/share/dist/Convos, and $MOJO_HOME
|
|
|
|
# which is set to $out
|
|
|
|
#
|
|
|
|
postInstall = ''
|
|
|
|
AUTO_SHARE_PATH=$out/${perl.libPrefix}/auto/share/dist/Convos
|
|
|
|
mkdir -p $AUTO_SHARE_PATH
|
|
|
|
cp -vR public assets $AUTO_SHARE_PATH/
|
|
|
|
ln -s $AUTO_SHARE_PATH/public/asset $out/asset
|
|
|
|
cp -vR templates $out/templates
|
|
|
|
cp cpanfile $out/cpanfile
|
|
|
|
'' + optionalString stdenv.isDarwin ''
|
|
|
|
shortenPerlShebang $out/bin/convos
|
|
|
|
'' + ''
|
|
|
|
wrapProgram $out/bin/convos --set MOJO_HOME $out
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests = nixosTests.convos;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://convos.chat";
|
|
|
|
description = "Convos is the simplest way to use IRC in your browser";
|
|
|
|
license = stdenv.lib.licenses.artistic2;
|
|
|
|
maintainers = with maintainers; [ sgo ];
|
|
|
|
};
|
|
|
|
}
|