Merge pull request #264588 from acowley/osx-dictionary

melpa-packages: build osx-dictionary helper executable

authored by adisbladis and committed by GitHub 0a040b6f 27a96b7a

+21
+21
pkgs/applications/editors/emacs/elisp-packages/melpa-packages.nix
··· 688 688 --replace '"mozc_emacs_helper"' '"${pkgs.ibus-engines.mozc}/lib/mozc/mozc_emacs_helper"' 689 689 ''; 690 690 }); 691 + 692 + # Build a helper executable that interacts with the macOS Dictionary.app 693 + osx-dictionary = 694 + if pkgs.stdenv.isDarwin 695 + then super.osx-dictionary.overrideAttrs (old: { 696 + buildInputs = 697 + old.buildInputs ++ 698 + (with pkgs.darwin.apple_sdk.frameworks; [CoreServices Foundation]); 699 + dontUnpack = false; 700 + buildPhase = (old.buildPhase or "") + '' 701 + cd source 702 + $CXX -O3 -framework CoreServices -framework Foundation osx-dictionary.m -o osx-dictionary-cli 703 + ''; 704 + postInstall = (old.postInstall or "") + "\n" + '' 705 + outd=$out/share/emacs/site-lisp/elpa/osx-dictionary-* 706 + mkdir -p $out/bin 707 + install -m444 -t $out/bin osx-dictionary-cli 708 + rm $outd/osx-dictionary.m 709 + ''; 710 + }) 711 + else super.osx-dictionary; 691 712 }; 692 713 693 714 in lib.mapAttrs (n: v: if lib.hasAttr n overrides then overrides.${n} else v) super);