forked from mirrors/nixpkgs
Merge pull request #29465 from FRidh/aspell
aspellWithDicts: use a single env
This commit is contained in:
commit
4db4476536
|
@ -4,8 +4,7 @@
|
||||||
{ aspell
|
{ aspell
|
||||||
, aspellDicts
|
, aspellDicts
|
||||||
, makeWrapper
|
, makeWrapper
|
||||||
, symlinkJoin
|
, buildEnv
|
||||||
, runCommand
|
|
||||||
}:
|
}:
|
||||||
|
|
||||||
f:
|
f:
|
||||||
|
@ -14,22 +13,20 @@ let
|
||||||
# Dictionaries we want
|
# Dictionaries we want
|
||||||
dicts = f aspellDicts;
|
dicts = f aspellDicts;
|
||||||
|
|
||||||
# A tree containing the dictionaries
|
in buildEnv {
|
||||||
dictEnv = symlinkJoin {
|
name = "aspell-env";
|
||||||
name = "aspell-dicts";
|
|
||||||
paths = dicts;
|
|
||||||
};
|
|
||||||
|
|
||||||
in runCommand "aspell-env" {
|
|
||||||
buildInputs = [ makeWrapper ];
|
buildInputs = [ makeWrapper ];
|
||||||
} ''
|
paths = [ aspell ] ++ dicts;
|
||||||
# Construct wrappers in /bin
|
postBuild = ''
|
||||||
mkdir -p $out/bin
|
# Construct wrappers in /bin
|
||||||
pushd "${aspell}/bin"
|
unlink "$out/bin"
|
||||||
for prg in *; do
|
mkdir -p "$out/bin"
|
||||||
if [ -f "$prg" ]; then
|
pushd "${aspell}/bin"
|
||||||
makeWrapper "${aspell}/bin/$prg" "$out/bin/$prg" --set ASPELL_CONF "dict-dir ${dictEnv}/lib/aspell"
|
for prg in *; do
|
||||||
fi
|
if [ -f "$prg" ]; then
|
||||||
done
|
makeWrapper "${aspell}/bin/$prg" "$out/bin/$prg" --set ASPELL_CONF "dict-dir $out/lib/aspell"
|
||||||
popd
|
fi
|
||||||
''
|
done
|
||||||
|
popd
|
||||||
|
'';
|
||||||
|
}
|
Loading…
Reference in a new issue