From c9997c4e36c4193a883f555744adadad3692edc8 Mon Sep 17 00:00:00 2001 From: qbisi Date: Wed, 23 Oct 2024 08:24:45 +0800 Subject: [PATCH] mumps: remove unnecessary patch from coin-or-mumps The coin-or project ipopt use a thirdparty-mumps, this variant renames `libseq/mpi.h` to `libseq/mumps_mpi.h` to avoid conflicts when building in a MPI environment. See https://github.com/coin-or/Ipopt/blob/stable/3.14/ChangeLog.md?plain=1#L582. Nix packagers don't need to worry about this cause we build in a sandbox environment. For parrallel version of mumps built with mpi support, libseq is not needed and there will be no conflicts. --- pkgs/by-name/mu/mumps/package.nix | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/pkgs/by-name/mu/mumps/package.nix b/pkgs/by-name/mu/mumps/package.nix index 41894f9dcd0f..e031266cd857 100644 --- a/pkgs/by-name/mu/mumps/package.nix +++ b/pkgs/by-name/mu/mumps/package.nix @@ -18,25 +18,11 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-ZnIfAuvOBJDYqCtKGlWs0r39nG6X2lAVRuUmeIJenZw="; }; - patches = [ - # Compatibility with coin-or-mumps version - (fetchpatch { - url = "https://raw.githubusercontent.com/coin-or-tools/ThirdParty-Mumps/bd0bdf9baa3f3677bd34fb36ce63b2b32cc6cc7d/mumps_mpi.patch"; - hash = "sha256-70qZUKBVBpJOSRxYxng5Y6ct1fdCUQUGur3chDhGabQ="; - }) - ]; - - postPatch = - '' - # Compatibility with coin-or-mumps version - # https://github.com/coin-or-tools/ThirdParty-Mumps/blob/stable/3.0/get.Mumps#L66 - cp libseq/mpi.h libseq/mumps_mpi.h - '' - + lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace src/Makefile --replace-fail \ - "-Wl,\''$(SONAME),libmumps_common" \ - "-Wl,-install_name,$out/lib/libmumps_common" - ''; + postPatch = lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace src/Makefile --replace-fail \ + "-Wl,\''$(SONAME),libmumps_common" \ + "-Wl,-install_name,$out/lib/libmumps_common" + ''; configurePhase = '' cp Make.inc/Makefile.debian.SEQ ./Makefile.inc @@ -63,7 +49,7 @@ stdenv.mkDerivation (finalAttrs: { # Add some compatibility with coin-or-mumps ln -s $out/include $out/include/mumps - cp libseq/mumps_mpi.h $out/include + cp libseq/mpi.h $out/include/mumps_mpi.h ''; nativeBuildInputs = [ gfortran ];