diff options
author | Stig Palmquist <stig@stig.io> | 2020-06-05 14:49:44 +0200 |
---|---|---|
committer | Stig Palmquist <stig@stig.io> | 2020-06-22 13:58:33 +0200 |
commit | 497ac5b423d0adbe5bf9d9466623ebeef40eae82 (patch) | |
tree | 514b074b91157aef8d755e40aaafad6e1a6af32d /pkgs/applications/networking/irc | |
parent | e755287ecdbed6f5302e30c146a694dbba4ea514 (diff) |
convos: init at 4.22
dependencies: perlPackages.IRCUtils: init at 0.12 perlPackages.LinkEmbedder: init at 1.12 perlPackages.MojoliciousPluginWebpack: init at 0.12 perlPackages.ParseIRC: init at 1.22 perlPackages.TimePiece: init at 1.3401 perlPackages.UnicodeUTF8: init at 0.62
Diffstat (limited to 'pkgs/applications/networking/irc')
-rw-r--r-- | pkgs/applications/networking/irc/convos/default.nix | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/pkgs/applications/networking/irc/convos/default.nix b/pkgs/applications/networking/irc/convos/default.nix new file mode 100644 index 0000000000000..a4eae497bc9d8 --- /dev/null +++ b/pkgs/applications/networking/irc/convos/default.nix @@ -0,0 +1,71 @@ +{ stdenv, fetchFromGitHub, perl, perlPackages, makeWrapper, shortenPerlShebang }: + +with stdenv.lib; + +perlPackages.buildPerlPackage rec { + pname = "convos"; + version = "4.22"; + + src = fetchFromGitHub rec { + owner = "Nordaaker"; + repo = pname; + rev = version; + sha256 = "0a5wq88ncbn7kwcw3z4wdl1wxmx5vq5a7crb1bvbvskgwwy8zfx8"; + }; + + nativeBuildInputs = [ makeWrapper ] + ++ optional stdenv.isDarwin [ shortenPerlShebang ]; + + 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 + ''; + + # 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 + # + # Module::Install is a runtime dependency not covered by the tests, so we add + # a test for it. + # + preCheck = '' + substituteInPlace t/web-register-open-to-public.t \ + --replace '!127.0.0.1!' '!localhost!' + + 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 ]; + }; +} |