3
0
Fork 0
forked from mirrors/nixpkgs

Merge pull request #29465 from FRidh/aspell

aspellWithDicts: use a single env
This commit is contained in:
Frederik Rietdijk 2017-09-17 09:29:47 +02:00 committed by GitHub
commit 4db4476536

View file

@ -4,8 +4,7 @@
{ aspell
, aspellDicts
, makeWrapper
, symlinkJoin
, runCommand
, buildEnv
}:
f:
@ -14,22 +13,20 @@ let
# Dictionaries we want
dicts = f aspellDicts;
# A tree containing the dictionaries
dictEnv = symlinkJoin {
name = "aspell-dicts";
paths = dicts;
};
in runCommand "aspell-env" {
in buildEnv {
name = "aspell-env";
buildInputs = [ makeWrapper ];
} ''
# Construct wrappers in /bin
mkdir -p $out/bin
pushd "${aspell}/bin"
for prg in *; do
if [ -f "$prg" ]; then
makeWrapper "${aspell}/bin/$prg" "$out/bin/$prg" --set ASPELL_CONF "dict-dir ${dictEnv}/lib/aspell"
fi
done
popd
''
paths = [ aspell ] ++ dicts;
postBuild = ''
# Construct wrappers in /bin
unlink "$out/bin"
mkdir -p "$out/bin"
pushd "${aspell}/bin"
for prg in *; do
if [ -f "$prg" ]; then
makeWrapper "${aspell}/bin/$prg" "$out/bin/$prg" --set ASPELL_CONF "dict-dir $out/lib/aspell"
fi
done
popd
'';
}