Merge pull request #264588 from acowley/osx-dictionary

melpa-packages: build osx-dictionary helper executable
This commit is contained in:
adisbladis
2023-11-01 11:14:48 +13:00
committed by GitHub
@@ -688,6 +688,27 @@ let
--replace '"mozc_emacs_helper"' '"${pkgs.ibus-engines.mozc}/lib/mozc/mozc_emacs_helper"'
'';
});
# Build a helper executable that interacts with the macOS Dictionary.app
osx-dictionary =
if pkgs.stdenv.isDarwin
then super.osx-dictionary.overrideAttrs (old: {
buildInputs =
old.buildInputs ++
(with pkgs.darwin.apple_sdk.frameworks; [CoreServices Foundation]);
dontUnpack = false;
buildPhase = (old.buildPhase or "") + ''
cd source
$CXX -O3 -framework CoreServices -framework Foundation osx-dictionary.m -o osx-dictionary-cli
'';
postInstall = (old.postInstall or "") + "\n" + ''
outd=$out/share/emacs/site-lisp/elpa/osx-dictionary-*
mkdir -p $out/bin
install -m444 -t $out/bin osx-dictionary-cli
rm $outd/osx-dictionary.m
'';
})
else super.osx-dictionary;
};
in lib.mapAttrs (n: v: if lib.hasAttr n overrides then overrides.${n} else v) super);