Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / rt / default.nix
blob59933570d7b15cec1e8d6137056d8ec8643f263d
1 { lib, stdenv, autoreconfHook, buildEnv, fetchFromGitHub, perl, perlPackages, makeWrapper, gnupg, openssl }:
3 stdenv.mkDerivation rec {
4   pname = "rt";
5   version = "5.0.5";
7   src = fetchFromGitHub {
8     repo = pname;
9     rev = "${pname}-${version}";
10     owner = "bestpractical";
11     hash = "sha256-4E6xEk1sIiNBKJT4jD+SNK8Fs+hX8EuTv+jD1U1g6qY=";
12   };
14   patches = [
15     ./dont-check-users_groups.patch  # needed for "make testdeps" to work in the build
16     ./override-generated.patch
17   ];
19   nativeBuildInputs = [
20     autoreconfHook
21     makeWrapper
22   ];
24   buildInputs = [
25     perl
26     (buildEnv {
27       name = "rt-perl-deps";
28       paths = with perlPackages; (requiredPerlModules [
29         ApacheSession
30         BusinessHours
31         CGIEmulatePSGI
32         CGIPSGI
33         CSSMinifierXS
34         CSSSquish
35         ConvertColor
36         CryptEksblowfish
37         CryptSSLeay
38         CryptX509
39         DBDPg
40         DBIxSearchBuilder
41         DataGUID
42         DataICal
43         DataPage
44         DataPagePageset
45         DateExtract
46         DateManip
47         DateTimeFormatNatural
48         DevelGlobalDestruction
49         EmailAddress
50         EmailAddressList
51         EncodeDetect
52         EncodeHanExtra
53         FCGI
54         FCGIProcManager
55         FileShareDir
56         FileWhich
57         GD
58         GDGraph
59         GnuPGInterface
60         GraphViz2
61         HTMLFormatExternal
62         HTMLFormatTextWithLinks
63         HTMLFormatTextWithLinksAndTables
64         HTMLGumbo
65         HTMLMason
66         HTMLMasonPSGIHandler
67         HTMLQuoted
68         HTMLRewriteAttributes
69         HTMLScrubber
70         IPCRun
71         IPCRun3
72         JSON
73         JavaScriptMinifierXS
74         LWP
75         LWPProtocolHttps
76         LocaleMaketextFuzzy
77         LocaleMaketextLexicon
78         LogDispatch
79         MIMETools
80         MIMETypes
81         MailTools
82         ModulePath
83         ModuleRefresh
84         ModuleVersionsReport
85         Moose
86         MooseXNonMoose
87         MooseXRoleParameterized
88         MozillaCA
89         NetCIDR
90         NetIP
91         ParallelForkManager
92         PathDispatcher
93         PerlIOeol
94         Plack
95         PodParser
96         RegexpCommon
97         RegexpCommonnetCIDR
98         RegexpIPv6
99         RoleBasic
100         ScopeUpper
101         Starlet
102         Starman
103         StringShellQuote
104         SymbolGlobalName
105         TermReadKey
106         TextPasswordPronounceable
107         TextQuoted
108         TextTemplate
109         TextWikiFormat
110         TextWordDiff
111         TextWrapper
112         TimeParseDate
113         TreeSimple
114         UNIVERSALrequire
115         WebMachine
116         XMLRSS
117         perlldap
118       ]);
119     })
120   ];
122   preAutoreconf = ''
123     echo rt-${version} > .tag
124   '';
125   preConfigure = ''
126     configureFlags="$configureFlags --with-web-user=$UID"
127     configureFlags="$configureFlags --with-web-group=$(id -g)"
128     configureFlags="$configureFlags --with-rt-group=$(id -g)"
129     configureFlags="$configureFlags --with-bin-owner=$UID"
130     configureFlags="$configureFlags --with-libs-owner=$UID"
131     configureFlags="$configureFlags --with-libs-group=$(id -g)"
132   '';
133   configureFlags = [
134     "--enable-graphviz"
135     "--enable-gd"
136     "--enable-gpg"
137     "--enable-smime"
138     "--with-db-type=Pg"
139   ];
141   buildPhase = ''
142     make testdeps
143   '';
145   postFixup = ''
146     for i in $(find $out/bin -type f); do
147       wrapProgram $i --prefix PERL5LIB ':' $PERL5LIB \
148         --prefix PATH ":" "${lib.makeBinPath [ openssl gnupg ]}"
149     done
151     rm -r $out/var
152     mkdir -p $out/var/data
153     ln -s /var/log/rt $out/var/log
154     ln -s /run/rt/mason_data $out/var/mason_data
155     ln -s /var/lib/rt/shredder $out/var/data/RT-Shredder
156     ln -s /var/lib/rt/smime $out/var/data/smime
157     ln -s /var/lib/rt/gpg $out/var/data/gpg
158   '';
160   meta = {
161     platforms = lib.platforms.unix;
162   };