blob: 815ac76b5c338e3b3e609c87fba264b59c99c339 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
{ stdenvNoCC
, formats
, runCommand
, writeScript
, lib
, platoSrc
, platoSettings ? {}
, platoCfg ? ""
, dictionaries ? []
, fonts ? []
, ... }:
with builtins // lib;
stdenvNoCC.mkDerivation (finalAttrs: {
name = "plato";
src = platoSrc;
dontFix = true;
dontPatch = true;
dontConfigure = true;
dontBuild = true;
installPhase = ''
mkdir -p $out
cp -rv . $out
# mkdir -p $out/.adds/plato/dictionaries
for d in ${concatMapStringsSep " " toString dictionaries}; do
find $d/share/dictd/ -type f -regex '.*\.\(dict\(\.dz\)?\|index\)' -exec cp -v {} $out/.adds/plato/dictionaries/ \;
done
for d in ${concatMapStringsSep " " toString fonts}; do
find $d/share/fonts/truetype/ -type f -regex '.*\.\(ttf\|otf\)' -exec cp -v {} $out/.adds/plato/fonts/ \;
done
${optionalString (platoSettings != {}) ''
cp -v ${(formats.toml {}).generate "Settings.toml" platoSettings} $out/.adds/plato/Settings.toml
''}
${optionalString (platoCfg != "") ''
cp -v ${writeScript "config.sh" platoCfg} $out/.adds/plato/config.sh
''}
''
;
})
|