2
0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-02-22 12:04:40 +00:00
nixpkgs/pkgs/by-name/co/convos/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

98 lines
2.8 KiB
Nix
Raw Normal View History

2021-01-20 01:23:13 +00:00
{ lib, stdenv, fetchFromGitHub, perl, perlPackages, makeWrapper, shortenPerlShebang, openssl
2020-06-26 08:23:52 +00:00
, nixosTests
}:
perlPackages.buildPerlPackage rec {
pname = "convos";
2023-10-19 11:16:08 +00:00
version = "8.05";
src = fetchFromGitHub {
2021-02-22 06:31:15 +00:00
owner = "convos-chat";
repo = pname;
2021-02-22 06:31:15 +00:00
rev = "v${version}";
2023-10-19 11:16:08 +00:00
sha256 = "sha256-dBvXo8y4OMKcb0imgnnzoklnPN3YePHDvy5rIBOkTfs=";
};
nativeBuildInputs = [ makeWrapper ]
++ lib.optionals stdenv.hostPlatform.isDarwin [ shortenPerlShebang ];
2020-06-26 08:23:52 +00:00
buildInputs = with perlPackages; [
2021-12-13 14:00:29 +00:00
CryptPassphrase CryptPassphraseArgon2 CryptPassphraseBcrypt
2022-06-06 23:46:07 +00:00
FileHomeDir FileReadBackwards HTTPAcceptLanguage SyntaxKeywordTry FutureAsyncAwait
IOSocketSSL IRCUtils JSONValidator LinkEmbedder ModuleInstall
2023-10-19 11:16:08 +00:00
Mojolicious MojoliciousPluginOpenAPI MojoliciousPluginSyslog ParseIRC
TextMarkdownHoedown TimePiece UnicodeUTF8 CpanelJSONXS EV YAMLLibYAML
];
2021-01-20 01:23:13 +00:00
propagatedBuildInputs = [ openssl ];
nativeCheckInputs = with perlPackages; [ TestDeep ];
postPatch = ''
patchShebangs script/convos
'';
preCheck = ''
2022-06-06 23:46:07 +00:00
# Remove unstable test (PR #176640)
#
rm t/plugin-auth-header.t
2020-08-27 03:32:11 +00:00
# Remove online test
#
rm t/web-pwa.t
# 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
#
substituteInPlace t/web-register-open-to-public.t \
--replace '!127.0.0.1!' '!localhost!'
2023-10-19 11:16:08 +00:00
# Another online test fails, so remove this.
rm t/irc-reconnect.t
2021-01-20 01:23:13 +00:00
# A webirc test fails to resolve "localhost" likely due to sandboxing, we
# remove this test.
#
rm t/irc-webirc.t
# A web-user test fails on Darwin, we remove it.
#
rm t/web-user.t
2021-02-22 06:31:15 +00:00
# Another web test fails, so we also remove this.
rm t/web-login.t
# Module::Install is a runtime dependency not covered by the tests, so we add
# a test for it.
#
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/
2023-10-19 11:16:08 +00:00
ln -s $AUTO_SHARE_PATH/public/assets $out/assets
cp -vR templates $out/templates
2023-10-19 11:16:08 +00:00
cp Makefile.PL $out/Makefile.PL
'' + lib.optionalString stdenv.hostPlatform.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";
mainProgram = "convos";
2021-01-15 05:42:41 +00:00
license = lib.licenses.artistic2;
maintainers = with lib.maintainers; [ sgo ];
};
}