aboutsummaryrefslogtreecommitdiff
path: root/pkgs/webapps/mediagoblin
diff options
context:
space:
mode:
authorIsmaël Bouya <ismael.bouya@normalesup.org>2020-05-08 23:59:21 +0200
committerIsmaël Bouya <ismael.bouya@normalesup.org>2020-05-09 00:30:49 +0200
commit34c7b88e16d1768b1b9a0cfa6dd21ea5d9b1b308 (patch)
treeb0ace6db106ee8ce19ee17c4cc798dcccf5c77f9 /pkgs/webapps/mediagoblin
parentc4216ddb8bedd0b75149c039bd5dc86c3d6a9b7f (diff)
downloadNix-34c7b88e16d1768b1b9a0cfa6dd21ea5d9b1b308.tar.gz
Nix-34c7b88e16d1768b1b9a0cfa6dd21ea5d9b1b308.tar.zst
Nix-34c7b88e16d1768b1b9a0cfa6dd21ea5d9b1b308.zip
Use new withPlugin system
- dokuwiki - mantisbt - mediagoblin - roundcube - ttrss - yourls
Diffstat (limited to 'pkgs/webapps/mediagoblin')
-rw-r--r--pkgs/webapps/mediagoblin/default.nix35
1 files changed, 18 insertions, 17 deletions
diff --git a/pkgs/webapps/mediagoblin/default.nix b/pkgs/webapps/mediagoblin/default.nix
index c20bcb4..d348ce1 100644
--- a/pkgs/webapps/mediagoblin/default.nix
+++ b/pkgs/webapps/mediagoblin/default.nix
@@ -1,4 +1,4 @@
1{ makeWrapper, stdenv, writeScript, fetchurl, buildBowerComponents, mylibs, which, python36, gst_all_1, automake, autoconf, nodejs, nodePackages }: 1{ makeWrapper, stdenv, writeScript, fetchurl, buildBowerComponents, mylibs, which, python36, gst_all_1, automake, autoconf, nodejs, nodePackages, lib, callPackage }:
2let 2let
3 overridePython = let 3 overridePython = let
4 packageOverrides = self: super: { 4 packageOverrides = self: super: {
@@ -113,18 +113,22 @@ let
113 generated = ./bower-packages.nix; 113 generated = ./bower-packages.nix;
114 src = (mylibs.fetchedGit ./mediagoblin.json).src; 114 src = (mylibs.fetchedGit ./mediagoblin.json).src;
115 }; 115 };
116 withPlugins = plugins: package.overrideAttrs(old: { 116 pluginNames = [ "basicsearch" ];
117 name = "${old.name}-with-plugins"; 117 allPlugins = lib.attrsets.genAttrs pluginNames
118 postBuild = old.postBuild + ( 118 (name: callPackage (./plugins + "/${name}") {});
119 builtins.concatStringsSep "\n" ( 119 toPassthru = pkg: {
120 map (value: "ln -s ${value} mediagoblin/plugins/${value.pluginName}") plugins 120 inherit allPlugins;
121 ) 121 withPlugins = withPlugins pkg;
122 ); 122 };
123 passthru = old.passthru // { 123 withPlugins = pkg: toPlugins:
124 inherit plugins; 124 let
125 withPlugins = morePlugins: old.withPlugins (morePlugins ++ plugins); 125 plugins = toPlugins allPlugins;
126 }; 126 toBuildPlugin = n: "ln -s ${n} mediagoblin/plugins/${n.pluginName}";
127 }); 127 newMediagoblin = pkg.overrideAttrs(old: {
128 postBuild = old.postBuild + "\n" + builtins.concatStringsSep "\n" (map toBuildPlugin plugins);
129 passthru = toPassthru newMediagoblin;
130 });
131 in newMediagoblin;
128 package = stdenv.mkDerivation (mylibs.fetchedGit ./mediagoblin.json // rec { 132 package = stdenv.mkDerivation (mylibs.fetchedGit ./mediagoblin.json // rec {
129 preConfigure = '' 133 preConfigure = ''
130 # ./bootstrap.sh 134 # ./bootstrap.sh
@@ -173,9 +177,6 @@ let
173 ''; 177 '';
174 buildInputs = [ makeWrapper automake autoconf which nodePackages.bower nodejs python ]; 178 buildInputs = [ makeWrapper automake autoconf which nodePackages.bower nodejs python ];
175 propagatedBuildInputs = with gst_all_1; [ python gst-libav gst-plugins-good gst-plugins-bad gst-plugins-ugly gstreamer ]; 179 propagatedBuildInputs = with gst_all_1; [ python gst-libav gst-plugins-good gst-plugins-bad gst-plugins-ugly gstreamer ];
176 passthru = { 180 passthru = toPassthru package;
177 plugins = [];
178 inherit withPlugins;
179 };
180 }); 181 });
181in package 182in package