Merge pull request #25126 from grahamc/rt

RT: Improve Packaging
This commit is contained in:
Graham Christensen 2017-04-23 08:30:24 -04:00 committed by GitHub
commit 7ff2fde215
2 changed files with 198 additions and 10 deletions

View file

@ -1,5 +1,35 @@
{ stdenv, fetchurl, perl }:
{ stdenv, buildEnv, fetchurl, perl, perlPackages, makeWrapper }:
# 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 {
name = "rt-${version}";
@ -12,14 +42,58 @@ stdenv.mkDerivation rec {
patches = [ ./override-generated.patch ];
buildInputs = [ perl ];
buildInputs = [
makeWrapper
perl
(buildEnv {
name = "rt-perl-deps";
paths = (with perlPackages; [
ApacheSession BusinessHours CGIEmulatePSGI CGIPSGI
CSSMinifierXP CSSSquish ConvertColor CryptEksblowfish
CryptSSLeay DBDSQLite DBDmysql DBIxSearchBuilder DataGUID
DataICal DataPagePageset DateExtract DateManip
DateTimeFormatNatural DevelGlobalDestruction EmailAddress
EmailAddressList FCGI FCGIProcManager FileShareDir FileWhich
GD GDGraph GnuPGInterface GraphViz HTMLFormatTextWithLinks
HTMLFormatTextWithLinksAndTables HTMLMason
HTMLMasonPSGIHandler HTMLQuoted HTMLRewriteAttributes
HTMLScrubber IPCRun IPCRun3 JSON JavaScriptMinifierXS LWP
LWPProtocolHttps LocaleMaketextFuzzy LocaleMaketextLexicon
LogDispatch MIMETools MIMETypes MailTools ModuleRefresh
ModuleVersionsReport MozillaCA NetCIDR NetIP PerlIOeol Plack
RegexpCommon RegexpCommonnetCIDR RegexpIPv6 RoleBasic
ScopeUpper Starlet SymbolGlobalName TermReadKey
TextPasswordPronounceable TextQuoted TextTemplate
TextWikiFormat TextWrapper TimeParseDate TreeSimple
UNIVERSALrequire XMLRSS
]);
})
];
dontBuild = true;
preConfigure = ''
configureFlags="$configureFlags --with-web-user=$UID"
configureFlags="$configureFlags --with-web-group=$(id -g)"
configureFlags="$configureFlags --with-rt-group=$(id -g)"
configureFlags="$configureFlags --with-bin-owner=$UID"
configureFlags="$configureFlags --with-libs-owner=$UID"
configureFlags="$configureFlags --with-libs-group=$(id -g)"
'';
configureFlags = [
"--enable-graphviz"
"--enable-gd"
"--enable-gpg"
"--with-db-type=SQLite"
];
installPhase = ''
mkdir $out
cp -a {bin,docs,etc,lib,sbin,share} $out
find $out -name '*.in' -exec rm '{}' \;
buildPhase = ''
make testdeps | grep -i missing | sort
'';
preFixup = ''
for i in $(find $out/bin -type f; find $out/sbin -type f); do
wrapProgram $i \
--prefix PERL5LIB ':' $PERL5LIB
done
'';
meta = {

View file

@ -734,6 +734,19 @@ let self = _self // overrides; _self = with self; {
];
};
BusinessHours = buildPerlPackage rec {
name = "Business-Hours-0.12";
src = fetchurl {
url = "https://cpan.metacpan.org/authors/id/R/RU/RUZ/Business-Hours-0.12.tar.gz";
sha256 = "15c5g278m1x121blspf4bymxp89vysizr3z6s1g3sbpfdkrn4gyv";
};
buildInputs = [ TestPod TestPodCoverage ];
propagatedBuildInputs = [ SetIntSpan TimeLocal ];
meta = {
description = "Calculate business hours in a time period";
};
};
BusinessISBN = buildPerlPackage rec {
name = "Business-ISBN-2.09";
src = fetchurl {
@ -2777,6 +2790,18 @@ let self = _self // overrides; _self = with self; {
buildInputs = [ Clone ];
};
CSSMinifierXP = buildPerlPackage rec {
name = "CSS-Minifier-XS-0.09";
src = fetchurl {
url = "https://cpan.metacpan.org/authors/id/G/GT/GTERMARS/CSS-Minifier-XS-0.09.tar.gz";
sha256 = "1myswrmh0sqp5xjpp03x45z8arfmgkjx0srl3r6kjsyzl1zrk9l8";
};
meta = {
description = "XS based CSS minifier";
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
};
};
CSSSquish = buildPerlPackage {
name = "CSS-Squish-0.10";
src = fetchurl {
@ -2997,6 +3022,20 @@ let self = _self // overrides; _self = with self; {
propagatedBuildInputs = [TestException ClassAccessorChained];
};
DataPagePageset = buildPerlPackage rec {
name = "Data-Page-Pageset-1.02";
src = fetchurl {
url = "https://cpan.metacpan.org/authors/id/C/CH/CHUNZI/Data-Page-Pageset-1.02.tar.gz";
sha256 = "142isi8la383dbjxj7lfgcbmmrpzwckcc4wma6rdl8ryajsipb6f";
};
buildInputs = [ TestPod TestPodCoverage ];
propagatedBuildInputs = [ DataPage ];
meta = {
description = "change long page list to be shorter and well navigate";
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
};
};
DataPassword = buildPerlPackage {
name = "Data-Password-1.12";
src = fetchurl {
@ -5694,6 +5733,20 @@ let self = _self // overrides; _self = with self; {
makeMakerFlags = "--lib_png_path=${pkgs.libpng.out} --lib_jpeg_path=${pkgs.libjpeg.out} --lib_zlib_path=${pkgs.zlib.out} --lib_ft_path=${pkgs.freetype.out} --lib_fontconfig_path=${pkgs.fontconfig.lib} --lib_xpm_path=${pkgs.xorg.libXpm.out}";
};
GDGraph = buildPerlPackage rec {
name = "GDGraph-1.54";
src = fetchurl {
url = "https://cpan.metacpan.org/authors/id/R/RU/RUZ/GDGraph-1.54.tar.gz";
sha256 = "0kzsdc07ycxjainmz0dnsclb15w2j1y7g8b5mcb7vhannq85qvxr";
};
propagatedBuildInputs = [ GD GDText ];
buildInputs = [ TestException CaptureTiny ];
meta = {
description = "Graph Plotting Module for Perl 5";
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
};
};
GDSecurityImage = buildPerlPackage {
name = "GD-SecurityImage-1.72";
src = fetchurl {
@ -5707,6 +5760,18 @@ let self = _self // overrides; _self = with self; {
};
};
GDText = buildPerlPackage rec {
name = "GDTextUtil-0.86";
src = fetchurl {
url = "https://cpan.metacpan.org/authors/id/M/MV/MVERB/GDTextUtil-0.86.tar.gz";
sha256 = "1g0nc7fz4d672ag7brlrrcz7ibm98x49qs75bq9z957ybkwcnvl8";
};
propagatedBuildInputs = [ GD ];
meta = {
description = "Text utilities for use with GD";
};
};
GeoIP = buildPerlPackage rec {
name = "Geo-IP-1.45";
src = fetchurl {
@ -7136,6 +7201,20 @@ let self = _self // overrides; _self = with self; {
};
};
JavaScriptMinifierXS = buildPerlPackage rec {
name = "JavaScript-Minifier-XS-0.11";
src = fetchurl {
url = "https://cpan.metacpan.org/authors/id/G/GT/GTERMARS/JavaScript-Minifier-XS-0.11.tar.gz";
sha256 = "1vlyhckpjbrg2v4dy9szsxxl0q44n0y1xl763mg2y2ym9g5144hm";
};
propagatedBuildInputs = [ ];
meta = {
description = "XS based JavaScript minifier";
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
};
};
JSON = buildPerlPackage {
name = "JSON-2.90";
src = fetchurl {
@ -8225,6 +8304,29 @@ let self = _self // overrides; _self = with self; {
buildInputs = [ ProcWaitStat ];
};
MIMETools = buildPerlPackage rec {
name = "MIME-tools-5.509";
src = fetchurl {
url = "https://cpan.metacpan.org/authors/id/D/DS/DSKOLL/MIME-tools-5.509.tar.gz";
sha256 = "0wv9rzx5j1wjm01c3dg48qk9wlbm6iyf91j536idk09xj869ymv4";
};
propagatedBuildInputs = [
MailTools
FilePath
FileTemp
MIMEBase64
];
buildInputs = [
TestDeep
TestPod
TestPodCoverage
];
meta = {
description = "class for parsed-and-decoded MIME message";
license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
};
};
MIMELite = buildPerlPackage rec {
name = "MIME-Lite-3.030";
src = fetchurl {
@ -11468,6 +11570,18 @@ let self = _self // overrides; _self = with self; {
};
};
SetIntSpan = buildPerlPackage rec {
name = "Set-IntSpan-1.19";
src = fetchurl {
url = "https://cpan.metacpan.org/authors/id/S/SW/SWMCD/Set-IntSpan-1.19.tar.gz";
sha256 = "1l6znd40ylzvfwl02rlqzvakv602rmvwgm2xd768fpgc2fdm9dqi";
};
meta = {
description = "Manages sets of integers";
};
};
SetObject = buildPerlPackage {
name = "Set-Object-1.34";
src = fetchurl {