14 docutilsSupport ? false,
17 monotoneSupport ? false,
19 bazaarSupport ? false,
24 subversionSupport ? false,
26 mercurialSupport ? false,
31 stdenv.mkDerivation rec {
33 version = "3.20200202.3";
36 url = "mirror://debian/pool/main/i/ikiwiki/ikiwiki_${version}.orig.tar.xz";
37 sha256 = "0skrc8r4wh4mjfgw1c94awr5sacfb9nfsbm4frikanc9xsy16ksr";
40 nativeBuildInputs = [ makeWrapper ];
46 ++ (with perlPackages; [
70 ++ lib.optionals docutilsSupport [
71 (python.withPackages (pp: with pp; [ pygments ]))
74 ++ lib.optionals gitSupport [ git ]
75 ++ lib.optionals monotoneSupport [ monotone ]
76 ++ lib.optionals bazaarSupport [ breezy ]
77 ++ lib.optionals cvsSupport [
80 perlPackages.Filechdir
82 ++ lib.optionals subversionSupport [ subversion ]
83 ++ lib.optionals mercurialSupport [ mercurial ];
86 # A few markdown tests fail, but this is expected when using Text::Markdown
87 # instead of Text::Markdown::Discount.
88 ./remove-markdown-tests.patch
91 name = "Catch-up-to-highlight-4.0-API-change";
92 url = "http://source.ikiwiki.branchable.com/?p=source.git;a=patch;h=9ea3f9dfe7c0341f4e002b48728b8139293e19d0";
93 sha256 = "16s4wvsfclx0a5cm2awr69dvw2vsi8lpm0d7kyl5w0kjlmzfc7h9";
98 sed -i s@/usr/bin/perl@${perlPackages.perl}/bin/perl@ pm_filter mdwn2man
99 sed -i s@/etc/ikiwiki@$out/etc@ Makefile.PL
100 sed -i /ENV{PATH}/d ikiwiki.in
101 # State the gcc dependency, and make the cgi use our wrapper
102 sed -i -e 's@$0@"'$out/bin/ikiwiki'"@' \
103 -e "s@'cc'@'${stdenv.cc}/bin/gcc'@" IkiWiki/Wrapper.pm
104 # Without patched plugin shebangs, some tests like t/rst.t fail
105 # (with docutilsSupport enabled)
106 patchShebangs plugins/*
108 # Creating shared git repo fails when running tests in Nix sandbox.
109 # The error is: "fatal: Could not make /tmp/ikiwiki-test-git.2043/repo/branches/ writable by group".
110 # Hopefully, not many people use `ikiwiki-makerepo` to create locally shared repositories these days.
111 substituteInPlace ikiwiki-makerepo --replace "git --bare init --shared" "git --bare init"
114 configurePhase = "perl Makefile.PL PREFIX=$out";
117 for a in "$out/bin/"*; do
118 wrapProgram $a --suffix PERL5LIB : $PERL5LIB --prefix PATH : ${perlPackages.perl}/bin:$out/bin \
119 ${lib.optionalString gitSupport "--prefix PATH : ${git}/bin "} \
120 ${lib.optionalString monotoneSupport "--prefix PATH : ${monotone}/bin "} \
121 ${lib.optionalString bazaarSupport "--prefix PATH : ${breezy}/bin "} \
122 ${lib.optionalString cvsSupport "--prefix PATH : ${cvs}/bin "} \
123 ${lib.optionalString cvsSupport "--prefix PATH : ${cvsps}/bin "} \
124 ${lib.optionalString subversionSupport "--prefix PATH : ${subversion.out}/bin "} \
125 ${lib.optionalString mercurialSupport "--prefix PATH : ${mercurial}/bin "} \
126 ${lib.optionalString docutilsSupport ''--prefix PYTHONPATH : "$(toPythonPath ${docutils})" ''} \
127 ${lib.concatMapStrings (x: "--prefix PATH : ${x}/bin ") extraUtils}
132 # Git needs some help figuring this out during test suite run.
133 export EMAIL="nobody@example.org"
136 checkTarget = "test";
140 description = "Wiki compiler, storing pages and history in a RCS";
141 homepage = "http://ikiwiki.info/";
142 license = licenses.gpl2Plus;
143 platforms = platforms.linux;
144 maintainers = [ maintainers.wentasah ];