yices: drop symlink hack, avoid ldconfig on linux

Reported by sternenseemann as a failure on darwin:
https://github.com/NixOS/nixpkgs/pull/141541#discussion_r739634263

Instead of emulating symlink creation in `.nix` file let's create
them in Makefile.build directly in a way that can be upstreamed.
This commit is contained in:
Sergei Trofimovich 2021-10-30 11:53:03 +01:00 committed by sterni
parent c5809ba048
commit 597eb07e00
2 changed files with 19 additions and 16 deletions

View file

@ -12,6 +12,12 @@ stdenv.mkDerivation rec {
sha256 = "1jx3854zxvfhxrdshbipxfgyq1yxb9ll9agjc2n0cj4vxkjyh9mn";
};
patches = [
# musl las no ldconfig, create symlinks explicitly
./linux-no-ldconfig.patch
];
postPatch = "patchShebangs tests/regress/check.sh";
nativeBuildInputs = [ autoreconfHook ];
buildInputs = [ cudd gmp-static gperf libpoly ];
configureFlags =
@ -23,22 +29,6 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
doCheck = true;
# Usual shenanigans
patchPhase = "patchShebangs tests/regress/check.sh";
# Includes a fix for the embedded soname being libyices.so.X.Y, but
# only installing the libyices.so.X.Y.Z file.
installPhase = let
ver_XdotY = lib.versions.majorMinor version;
in ''
make install LDCONFIG=true
# guard against packaging of unstable versions: they
# have a soname of hext (not current) release.
echo "Checking expected library version to be ${version}"
[ -f $out/lib/libyices.so.${version} ]
ln -sfr $out/lib/libyices.so.{${version},${ver_XdotY}}
'';
meta = with lib; {
description = "A high-performance theorem prover and SMT solver";
homepage = "http://yices.csl.sri.com";

View file

@ -0,0 +1,13 @@
--- a/Makefile.build
+++ b/Makefile.build
@@ -474,8 +474,9 @@ install-darwin: install-default
install-solaris: install-default
$(LDCONFIG) -n $(DESTDIR)$(libdir) && (cd $(DESTDIR)$(libdir) && $(LN_S) -f libyices.so.$(YICES_VERSION) libyices.so)
+# avoid ldconfig as it's not present on musl
install-linux install-unix: install-default
- $(LDCONFIG) -n $(DESTDIR)$(libdir) && (cd $(DESTDIR)$(libdir) && $(LN_S) -f libyices.so.$(YICES_VERSION) libyices.so)
+ (cd $(DESTDIR)$(libdir) && $(LN_S) -f libyices.so.$(YICES_VERSION) libyices.so.$(MAJOR).$(MINOR) && $(LN_S) -f libyices.so.$(MAJOR).$(MINOR) libyices.so)
# on FreeBSD: the library file is libyices.so.X.Y and ldconfig does not take -n
# TODO: fix this. We must also create a symbolic link: libyices.so.X in libdir