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; dontUnpack = false;
nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
@ -117,12 +119,12 @@ self: let
postBuild = '' postBuild = ''
NIX_CFLAGS_COMPILE="$($PKG_CONFIG --cflags enchant-2) $NIX_CFLAGS_COMPILE" 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" + '' postInstall = (old.postInstall or "") + "\n" + ''
outd=$out/share/emacs/site-lisp/elpa/jinx-* 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 rm $outd/jinx-mod.c $outd/emacs-module.h
''; '';

View File

@ -314,7 +314,9 @@ let
ivy-rtags = fix-rtags super.ivy-rtags; 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 [ ]) ++ [ nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [
pkgs.pkg-config pkgs.pkg-config
]; ];
@ -324,14 +326,14 @@ let
postBuild = '' postBuild = ''
pushd working/jinx pushd working/jinx
NIX_CFLAGS_COMPILE="$($PKG_CONFIG --cflags enchant-2) $NIX_CFLAGS_COMPILE" 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 popd
''; '';
postInstall = (old.postInstall or "") + "\n" + '' postInstall = (old.postInstall or "") + "\n" + ''
pushd source pushd source
outd=$(echo $out/share/emacs/site-lisp/elpa/jinx-*) 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 rm $outd/jinx-mod.c $outd/emacs-module.h
popd popd
''; '';