rt: 4.4.4 -> 5.0.1

This commit is contained in:
ajs124 2021-04-27 21:26:39 +02:00 committed by Jonathan Ringer
parent ac641ca67a
commit 590ff316eb
2 changed files with 134 additions and 61 deletions

View file

@ -1,46 +1,24 @@
{ lib, stdenv, buildEnv, fetchurl, perl, perlPackages, makeWrapper }: { lib, stdenv, autoreconfHook, buildEnv, fetchFromGitHub, perl, perlPackages, makeWrapper, gnupg, openssl }:
# This package isn't extremely useful as it is, but is getting close.
# After running:
#
# nix-build . -A rt
#
# I created a config file named myconfig.pm with:
#
# use utf8;
# Set($rtname, '127.0.0.1');
# # These dirs need to be pre-created:
# Set($MasonSessionDir, '/home/grahamc/foo/sessiondir/');
# Set($MasonDataDir, '/home/grahamc/foo/localstate/');
# Set($WebPort, 8080);
#
# Set($DatabaseType, "SQLite");
# Set( $DatabaseName, '/home/grahamc/projects/foo/my.db' );
#
# 1;
#
# and ran
#
# RT_SITE_CONFIG=$(pwd)/myconfig.pm ./result/bin/rt-setup-database --action init
#
# Then:
#
# RT_SITE_CONFIG=$(pwd)/myconfig.pm ./result/bin/rt-server
#
# Make sure to check out result/etc/RT_Config.pm
#
# Good luck.
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "rt"; pname = "rt";
version = "5.0.1";
version = "4.4.4"; src = fetchFromGitHub {
repo = pname;
src = fetchurl { rev = "${pname}-${version}";
url = "https://download.bestpractical.com/pub/rt/release/${pname}-${version}.tar.gz"; owner = "bestpractical";
sha256 = "1108jhz1gvalcfnbzgpbk7fkxzxkkc7m74a3bnwyjzldlyj1dhrl"; sha256 = "1qqh6w094x7dljz001va802v4s6mixs9lkhs2cs47lf5ph3vwq2q";
}; };
patches = [ ./override-generated.patch ]; patches = [
./dont-check-users_groups.patch # needed for "make testdeps" to work in the build
./override-generated.patch
];
nativeBuildInputs = [
autoreconfHook
];
buildInputs = [ buildInputs = [
makeWrapper makeWrapper
@ -48,28 +26,102 @@ stdenv.mkDerivation rec {
(buildEnv { (buildEnv {
name = "rt-perl-deps"; name = "rt-perl-deps";
paths = with perlPackages; (requiredPerlModules [ paths = with perlPackages; (requiredPerlModules [
ApacheSession BusinessHours CGIEmulatePSGI CGIPSGI ApacheSession
CSSMinifierXS CSSSquish ConvertColor CryptEksblowfish BusinessHours
CryptSSLeay DBDSQLite DBDmysql DBIxSearchBuilder DataGUID CGIEmulatePSGI
DataICal DataPagePageset DateExtract DateManip CGIPSGI
DateTimeFormatNatural DevelGlobalDestruction EmailAddress CSSMinifierXS
EmailAddressList FCGI FCGIProcManager FileShareDir FileWhich CSSSquish
GD GDGraph GnuPGInterface GraphViz HTMLFormatTextWithLinks ConvertColor
HTMLFormatTextWithLinksAndTables HTMLMason CryptEksblowfish
HTMLMasonPSGIHandler HTMLQuoted HTMLRewriteAttributes CryptSSLeay
HTMLScrubber IPCRun IPCRun3 JSON JavaScriptMinifierXS LWP CryptX509
LWPProtocolHttps LocaleMaketextFuzzy LocaleMaketextLexicon DBDPg
LogDispatch MIMETools MIMETypes MailTools ModuleRefresh DBIxSearchBuilder
ModuleVersionsReport MozillaCA NetCIDR NetIP PerlIOeol Plack DataGUID
RegexpCommon RegexpCommonnetCIDR RegexpIPv6 RoleBasic DataICal
ScopeUpper Starlet SymbolGlobalName TermReadKey DataPage
TextPasswordPronounceable TextQuoted TextTemplate DataPagePageset
TextWikiFormat TextWrapper TimeParseDate TreeSimple DateExtract
UNIVERSALrequire XMLRSS DateManip
DateTimeFormatNatural
DevelGlobalDestruction
EmailAddress
EmailAddressList
EncodeDetect
EncodeHanExtra
FCGI
FCGIProcManager
FileShareDir
FileWhich
GD
GDGraph
GnuPGInterface
GraphViz
HTMLFormatExternal
HTMLFormatTextWithLinks
HTMLFormatTextWithLinksAndTables
HTMLGumbo
HTMLMason
HTMLMasonPSGIHandler
HTMLQuoted
HTMLRewriteAttributes
HTMLScrubber
IPCRun
IPCRun3
JSON
JavaScriptMinifierXS
LWP
LWPProtocolHttps
LocaleMaketextFuzzy
LocaleMaketextLexicon
LogDispatch
MIMETools
MIMETypes
MailTools
ModulePath
ModuleRefresh
ModuleVersionsReport
Moose
MooseXNonMoose
MooseXRoleParameterized
MozillaCA
NetCIDR
NetIP
PathDispatcher
PerlIOeol
Plack
PodParser
RegexpCommon
RegexpCommonnetCIDR
RegexpIPv6
RoleBasic
ScopeUpper
Starlet
Starman
StringShellQuote
SymbolGlobalName
TermReadKey
TextPasswordPronounceable
TextQuoted
TextTemplate
TextWikiFormat
TextWordDiff
TextWrapper
TimeParseDate
TreeSimple
UNIVERSALrequire
WebMachine
XMLRSS
perlldap
]); ]);
}) })
]; ];
preAutoreconf = ''
substituteInPlace configure.ac \
--replace "rt-3.9.EXPORTED" "rt-${version}"
'';
preConfigure = '' preConfigure = ''
configureFlags="$configureFlags --with-web-user=$UID" configureFlags="$configureFlags --with-web-user=$UID"
configureFlags="$configureFlags --with-web-group=$(id -g)" configureFlags="$configureFlags --with-web-group=$(id -g)"
@ -82,18 +134,27 @@ stdenv.mkDerivation rec {
"--enable-graphviz" "--enable-graphviz"
"--enable-gd" "--enable-gd"
"--enable-gpg" "--enable-gpg"
"--with-db-type=SQLite" "--enable-smime"
"--with-db-type=Pg"
]; ];
buildPhase = '' buildPhase = ''
make testdeps | grep -i missing | sort make testdeps
''; '';
preFixup = '' postFixup = ''
for i in $(find $out/bin -type f; find $out/sbin -type f); do for i in $(find $out/bin -type f); do
wrapProgram $i \ wrapProgram $i --prefix PERL5LIB ':' $PERL5LIB \
--prefix PERL5LIB ':' $PERL5LIB --prefix PATH ":" "${lib.makeBinPath [ openssl gnupg ]}"
done done
rm -r $out/var
mkdir -p $out/var/data
ln -s /var/log/rt $out/var/log
ln -s /run/rt/mason_data $out/var/mason_data
ln -s /var/lib/rt/shredder $out/var/data/RT-Shredder
ln -s /var/lib/rt/smime $out/var/data/smime
ln -s /var/lib/rt/gpg $out/var/data/gpg
''; '';
meta = { meta = {

View file

@ -0,0 +1,12 @@
diff --git a/sbin/rt-test-dependencies.in b/sbin/rt-test-dependencies.in
index e51feb197..d75b1bc4e 100644
--- a/sbin/rt-test-dependencies.in
+++ b/sbin/rt-test-dependencies.in
@@ -423,6 +423,7 @@ sub check_perl_version {
}
sub check_users_groups {
+ return 0;
section("users / groups");
my $fails = 0;