]>
Commit | Line | Data |
---|---|---|
a8ef1adb IB |
1 | { stdenv, fetchurl, callPackage |
2 | , varDir ? "/var/lib/phpbb" | |
3 | }: | |
4 | let | |
5 | allExts = { | |
6 | alfredoramos.markdown = callPackage ./extensions/markdown.nix {}; | |
7 | davidiq.mailinglist = callPackage ./extensions/mailinglist.nix {}; | |
8 | dmzx.mchat = callPackage ./extensions/mchat.nix {}; | |
9 | empteintesduweb.monitoranswers = callPackage ./extensions/monitoranswers.nix {}; | |
10 | lr94.autosubscribe = callPackage ./extensions/autosubscribe.nix {}; | |
11 | phpbbmodders.adduser = callPackage ./extensions/adduser.nix {}; | |
12 | }; | |
13 | allLangs = { | |
14 | fr = callPackage ./langs/fr.nix {}; | |
15 | }; | |
16 | toPassthru = pkg: { | |
17 | withLangs = withLangs pkg; | |
18 | withExts = withExts pkg; | |
19 | }; | |
20 | withExts = pkg: toExts: | |
21 | let | |
22 | exts = toExts allExts; | |
23 | toInstallExt = ext: "cp -r ${ext}/* $out/ext/"; | |
24 | newPhpBB = pkg.overrideAttrs(old: { | |
25 | installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallExt exts); | |
26 | passthru = toPassthru newPhpBB; | |
27 | }); | |
28 | in newPhpBB; | |
29 | withLangs = pkg: toLangs: | |
30 | let | |
31 | langs = toLangs allLangs; | |
32 | toInstallLang = lang: "cp -r ${lang}/*/ $out"; | |
33 | newPhpBB = pkg.overrideAttrs(old: { | |
34 | installPhase = old.installPhase + "\n" + builtins.concatStringsSep "\n" (map toInstallLang langs); | |
35 | passthru = toPassthru newPhpBB; | |
36 | }); | |
37 | in newPhpBB; | |
38 | phpBB = stdenv.mkDerivation rec { | |
39 | pname = "phpBB"; | |
40 | version = "3.3.0"; | |
41 | ||
42 | src = fetchurl { | |
43 | url = "https://download.phpbb.com/pub/release/3.3/${version}/${pname}-${version}.tar.bz2"; | |
44 | sha256 = "a6234ac9dcf9086c025ece29a0a235f997a92bb9a994eff0ddcf8917e841262f"; | |
45 | }; | |
46 | ||
47 | phases = [ "unpackPhase" "installPhase" ]; | |
48 | ||
49 | installPhase = '' | |
50 | cp -a . $out | |
51 | mkdir -p $out/vars | |
52 | mv $out/{cache,files,store,config.php} $out/vars | |
53 | ln -s ${varDir}/{cache,files,store,config.php} $out/ | |
54 | echo -e "core:\n allow_install_dir: true" >> $out/config/production/config.yml | |
55 | ''; | |
56 | ||
57 | passthru = toPassthru phpBB; | |
58 | }; | |
59 | in | |
60 | phpBB |