1{ stdenv, unzip }:
2let
3 buildFreshRssExtension =
4 args@{
5 pname,
6 version,
7 src,
8 FreshRssExtUniqueId,
9 configurePhase ? ''
10 runHook preConfigure
11 runHook postConfigure
12 '',
13 buildPhase ? ''
14 runHook preBuild
15 runHook postBuild
16 '',
17 dontPatchELF ? true,
18 dontStrip ? true,
19 passthru ? { },
20 sourceRoot ? "source",
21 ...
22 }:
23 stdenv.mkDerivation (
24 (removeAttrs args [ "FreshRssExtUniqueId" ])
25 // {
26 pname = "freshrss-extension-${pname}";
27
28 inherit
29 version
30 src
31 configurePhase
32 buildPhase
33 dontPatchELF
34 dontStrip
35 sourceRoot
36 ;
37
38 installPrefix = "share/freshrss/extensions/xExtension-${FreshRssExtUniqueId}";
39
40 installPhase = ''
41 runHook preInstall
42
43 mkdir -p "$out/$installPrefix"
44 find . -mindepth 1 -maxdepth 1 | xargs -d'\n' mv -t "$out/$installPrefix/"
45
46 runHook postInstall
47 '';
48
49 passthru = passthru // {
50 inherit FreshRssExtUniqueId;
51 };
52 }
53 );
54in
55{
56 inherit buildFreshRssExtension;
57}