nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1# Create a derivation that contains aspell and selected dictionaries.
2# Composition is done using `pkgs.buildEnv`.
3# Beware of that `ASPELL_CONF` used by this derivation is not always
4# respected by libaspell (#28815) and in some cases, when used as
5# dependency by another derivation, the passed dictionaries will be
6# missing. However, invoking aspell directly should be fine.
7
8{
9 aspell,
10 aspellDicts,
11 makeWrapper,
12 buildEnv,
13}:
14
15f:
16
17let
18 # Dictionaries we want
19 dicts = f aspellDicts;
20
21in
22buildEnv {
23 name = "aspell-env";
24 nativeBuildInputs = [ makeWrapper ];
25 paths = [ aspell ] ++ dicts;
26 postBuild = ''
27 # Construct wrappers in /bin
28 unlink "$out/bin"
29 mkdir -p "$out/bin"
30 pushd "${aspell}/bin"
31 for prg in *; do
32 if [ -f "$prg" ]; then
33 makeWrapper "${aspell}/bin/$prg" "$out/bin/$prg" --set ASPELL_CONF "dict-dir $out/lib/aspell; data-dir $out/share/aspell"
34 fi
35 done
36 popd
37 '';
38}