From 597eb07e00d7173ec8f7287e54080715e608df4f Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 30 Oct 2021 11:53:03 +0100 Subject: [PATCH] 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. --- .../science/logic/yices/default.nix | 22 +++++-------------- .../logic/yices/linux-no-ldconfig.patch | 13 +++++++++++ 2 files changed, 19 insertions(+), 16 deletions(-) create mode 100644 pkgs/applications/science/logic/yices/linux-no-ldconfig.patch diff --git a/pkgs/applications/science/logic/yices/default.nix b/pkgs/applications/science/logic/yices/default.nix index c5fc3a738373..c81d5a9ca618 100644 --- a/pkgs/applications/science/logic/yices/default.nix +++ b/pkgs/applications/science/logic/yices/default.nix @@ -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"; diff --git a/pkgs/applications/science/logic/yices/linux-no-ldconfig.patch b/pkgs/applications/science/logic/yices/linux-no-ldconfig.patch new file mode 100644 index 000000000000..bad3da6ad4a2 --- /dev/null +++ b/pkgs/applications/science/logic/yices/linux-no-ldconfig.patch @@ -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