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 { 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
'';
}