]> git.immae.eu Git - perso/Immae/Config/Nix.git/blame - flakes/mypackages/pkgs/webapps/mantisbt_2/default.nix
Mantisbt bump
[perso/Immae/Config/Nix.git] / flakes / mypackages / pkgs / webapps / mantisbt_2 / default.nix
CommitLineData
34c7b88e 1{ mantis_config ? "/etc/mantisbt/config_inc.php", stdenv, fetchurl, lib, callPackage}:
43dac87f 2let
60351295 3 pluginNames = [ "slack" "source-integration" "taskodrome" "mantis-kanban" "tasks" ];
34c7b88e
IB
4 allPlugins = lib.attrsets.genAttrs pluginNames
5 (name: callPackage (./plugins + "/${name}") {});
6 toPassthru = pkg: plugins: {
7 inherit plugins allPlugins;
1a64deeb 8 pluginNames = map (n: n.pluginName) plugins;
34c7b88e
IB
9 withPlugins = withPlugins pkg;
10 };
11 withPlugins = pkg: toPlugins:
12 let
13 plugins = toPlugins allPlugins;
14 toInstallPlugin = n:
15 if builtins.hasAttr "selector" n then
16 "ln -sf ${n}/${n.selector} $out/plugins/"
17 else
18 "ln -sf ${n} $out/plugins/${n.pluginName}";
19 newMantisbt = pkg.overrideAttrs(old: {
20 installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallPlugin plugins);
21 passthru = toPassthru newMantisbt (pkg.plugins ++ plugins);
22 });
23 in newMantisbt;
43dac87f
IB
24 package = stdenv.mkDerivation rec {
25 name = "mantisbt-${version}";
60351295 26 version = "2.26.1";
43dac87f
IB
27 src = fetchurl {
28 url = "https://downloads.sourceforge.net/project/mantisbt/mantis-stable/${version}/${name}.tar.gz";
60351295 29 sha256 = "sha256-poJCEjq+yB2RbA0k5go899mBGBXewjLZHGFmabrCYW4=";
43dac87f 30 };
60351295
IB
31 # FIXME: captcha for anonymous
32 #patches = [
33 # ./bug_report.php.diff
34 # ./bug_report_page.php.diff
35 # ./bugnote_add.php.diff
36 # ./bugnote_add_inc.php.diff
37 #];
43dac87f
IB
38 installPhase = ''
39 cp -a . $out
40 ln -s ${mantis_config} $out/config/config_inc.php
41 '';
42
34c7b88e 43 passthru = toPassthru package [];
43dac87f
IB
44 };
45in package