2020-11-19 22:23:20 +00:00
{ stdenv , lib , fetchurl , makeWrapper
, gcc , git , gnumake , openssl , xapian
, buildPerlPackage
, coreutils
, curl
, git
, gnumake
, highlight
, libgit2
, man
, openssl
, pkg-config
, sqlite
, xapian
, AnyURIEscape
, DBDSQLite
, DBI
, EmailAddressXS
, EmailMIME
, highlight
, IOSocketSSL
, IPCRun
, Inline
, InlineC
, ParseRecDescent
, Plack
, PlackMiddlewareReverseProxy
, SearchXapian
, TimeDate
, URI
2019-12-16 18:42:21 +00:00
} :
let
2020-11-19 22:23:20 +00:00
skippedTests = [
# These tests would fail, and produce "Operation not permitted"
# errors from git, because they use git init --shared. This tries
# to set the setgid bit, which isn't permitted inside build
# sandboxes.
#
# These tests were indentified with
# grep -r shared t/
" c o n v e r t - c o m p a c t " " s e a r c h " " v 2 w r i t a b l e " " w w w _ l i s t i n g "
# perl5.32.0-public-inbox> t/eml.t ...................... 1/? Cannot parse parameter '=?ISO-8859-1?Q?=20charset=3D=1BOF?=' at t/eml.t line 270.
# perl5.32.0-public-inbox> # Failed test 'got wide character by assuming utf-8'
# perl5.32.0-public-inbox> # at t/eml.t line 272.
# perl5.32.0-public-inbox> Wide character in print at /nix/store/38vxlxrvg3yji3jms44qn94lxdysbj5j-perl-5.32.0/lib/perl5/5.32.0/Test2/Formatter/TAP.pm line 125.
" e m l "
# Failed test 'Makefile OK'
# at t/hl_mod.t line 19.
# got: 'makefile'
# expected: 'make'
" h l _ m o d "
] ;
2019-12-16 18:42:21 +00:00
testConditions = with lib ;
concatMapStringsSep " " ( n : " ! - n a m e ${ escapeShellArg n } . t " ) skippedTests ;
in
buildPerlPackage rec {
pname = " p u b l i c - i n b o x " ;
2020-11-19 22:23:20 +00:00
version = " 1 . 6 . 1 " ;
2019-12-16 18:42:21 +00:00
src = fetchurl {
2020-11-19 22:23:20 +00:00
url = " h t t p s : / / p u b l i c - i n b o x . o r g / p u b l i c - i n b o x . g i t / s n a p s h o t / p u b l i c - i n b o x - ${ version } . t a r . g z " ;
sha256 = " 0 m r 8 f 8 q v 1 5 l 0 l x 9 4 i m 9 0 8 4 l m s w 1 q h 8 l z y b 7 m j 1 s 5 y h p w 4 8 k 2 5 7 0 9 " ;
2019-12-16 18:42:21 +00:00
} ;
outputs = [ " o u t " " d e v d o c " " s a _ c o n f i g " ] ;
postConfigure = ''
substituteInPlace Makefile - - replace ' TEST_FILES = t /* . t ' \
' TEST_FILES = $ ( shell find t - name * . t $ { testConditions } ) '
'' ;
nativeBuildInputs = [ makeWrapper ] ;
buildInputs = [
2020-11-19 22:23:20 +00:00
AnyURIEscape
DBDSQLite
DBI
EmailAddressXS
EmailMIME
highlight
IOSocketSSL
IPCRun
Inline
InlineC
ParseRecDescent
Plack
PlackMiddlewareReverseProxy
SearchXapian
TimeDate
URI
2019-12-16 18:42:21 +00:00
] ;
checkInputs = [ git openssl xapian ] ;
preCheck = ''
perl certs/create-certs.perl
'' ;
installTargets = [ " i n s t a l l " ] ;
postInstall = ''
for prog in $ out/bin /* ; d o
2020-11-19 22:23:20 +00:00
wrapProgram $ prog - - prefix PATH : $ { lib . makeBinPath [
git
/* f o r I n l i n e C */
gnumake
stdenv . cc . cc
] }
2019-12-16 18:42:21 +00:00
done
mv sa_config $ sa_config
'' ;
meta = with lib ; {
homepage = " h t t p s : / / p u b l i c - i n b o x . o r g / " ;
license = licenses . agpl3Plus ;
2020-11-19 22:23:20 +00:00
maintainers = with maintainers ; [ qyliss julm ] ;
2019-12-16 18:42:21 +00:00
platforms = platforms . all ;
} ;
}