Merge pull request #227160 from treed/jinx-on-darwin

emacs.pkgs.jinx: use platform-specific library extension
This commit is contained in:
adisbladis 2023-04-21 18:07:19 +12:00 committed by GitHub
commit 1d01024c5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View file

@ -106,7 +106,9 @@ self: let
};
});
jinx = super.jinx.overrideAttrs (old: {
jinx = super.jinx.overrideAttrs (old: let
libExt = pkgs.stdenv.targetPlatform.extensions.sharedLibrary;
in {
dontUnpack = false;
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
@ -117,12 +119,12 @@ self: let
postBuild = ''
NIX_CFLAGS_COMPILE="$($PKG_CONFIG --cflags enchant-2) $NIX_CFLAGS_COMPILE"
$CC -shared -o jinx-mod.so jinx-mod.c -lenchant-2
$CC -shared -o jinx-mod${libExt} jinx-mod.c -lenchant-2
'';
postInstall = (old.postInstall or "") + "\n" + ''
outd=$out/share/emacs/site-lisp/elpa/jinx-*
install -m444 -t $outd jinx-mod.so
install -m444 -t $outd jinx-mod${libExt}
rm $outd/jinx-mod.c $outd/emacs-module.h
'';

View file

@ -314,7 +314,9 @@ let
ivy-rtags = fix-rtags super.ivy-rtags;
jinx = super.jinx.overrideAttrs (old: {
jinx = super.jinx.overrideAttrs (old: let
libExt = pkgs.stdenv.targetPlatform.extensions.sharedLibrary;
in {
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
pkgs.pkg-config
];
@ -324,14 +326,14 @@ let
postBuild = ''
pushd working/jinx
NIX_CFLAGS_COMPILE="$($PKG_CONFIG --cflags enchant-2) $NIX_CFLAGS_COMPILE"
$CC -shared -o jinx-mod.so jinx-mod.c -lenchant-2
$CC -shared -o jinx-mod${libExt} jinx-mod.c -lenchant-2
popd
'';
postInstall = (old.postInstall or "") + "\n" + ''
pushd source
outd=$(echo $out/share/emacs/site-lisp/elpa/jinx-*)
install -m444 --target-directory=$outd jinx-mod.so
install -m444 --target-directory=$outd jinx-mod${libExt}
rm $outd/jinx-mod.c $outd/emacs-module.h
popd
'';