nixpkgs/pkgs/servers/mail/sympa/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

121 lines
2.2 KiB
Nix

{ lib, stdenv, perl, fetchFromGitHub, autoreconfHook, nixosTests }:
let
dataDir = "/var/lib/sympa";
runtimeDir = "/run/sympa";
perlEnv = perl.withPackages (p: with p; [
ArchiveZip
CGI
CGIFast
ClassSingleton
DateTime
DBI
DateTimeFormatMail
DateTimeTimeZone
DigestMD5
Encode
FCGI
FileCopyRecursive
FileNFSLock
FilePath
HTMLParser
HTMLFormatter
HTMLTree
HTMLStripScriptsParser
IO
IOStringy
LWP
libintl_perl
MHonArc
MIMEBase64
MIMECharset
MIMETools
MIMEEncWords
MIMELiteHTML
MailTools
NetCIDR
ScalarListUtils
SysSyslog
TermProgressBar
TemplateToolkit
URI
UnicodeLineBreak
XMLLibXML
### Features
Clone
CryptEksblowfish
DBDPg
DBDSQLite
DBDmysql
DataPassword
EncodeLocale
IOSocketSSL
MailDKIM
NetDNS
NetLDAP
NetSMTP
SOAPLite
]);
in
stdenv.mkDerivation rec {
pname = "sympa";
version = "6.2.56";
src = fetchFromGitHub {
owner = "sympa-community";
repo = pname;
rev = version;
sha256 = "13cs2azpskmp2hkfy5zqf4qb6sb9r8d4wwzc8mw74mg2kdjnvfpy";
};
configureFlags = [
"--enable-fhs"
"--without-initdir"
"--without-unitsdir"
"--without-smrshdir"
"--with-lockdir=${runtimeDir}"
"--with-piddir=${runtimeDir}"
"--with-confdir=${dataDir}/etc"
"--sysconfdir=${dataDir}/etc"
"--with-spooldir=${dataDir}/spool"
"--with-expldir=${dataDir}/list_data"
];
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ perlEnv ];
patches = [ ./make-docs.patch ];
prePatch = ''
patchShebangs po/sympa/add-lang.pl
'';
preInstall = ''
mkdir "$TMP/bin"
for i in chown chgrp chmod; do
echo '#!${stdenv.shell}' >> "$TMP/bin/$i"
chmod +x "$TMP/bin/$i"
done
PATH="$TMP/bin:$PATH"
'';
postInstall = ''
rm -rf "$TMP/bin"
'';
passthru.tests = {
inherit (nixosTests) sympa;
};
meta = with lib; {
description = "Open source mailing list manager";
homepage = "https://www.sympa.org";
license = licenses.gpl2;
maintainers = with maintainers; [ sorki mmilata ];
platforms = platforms.all;
};
}