From a64e151d26c7b1acb9ac45c46affb790ad32ca1d Mon Sep 17 00:00:00 2001 From: Weijia Wang <9713184+wegank@users.noreply.github.com> Date: Thu, 7 Jul 2022 09:59:39 +0200 Subject: [PATCH] lp_solve: fix build on aarch64-darwin --- .../science/math/lp_solve/default.nix | 35 ++++++++++++------- pkgs/top-level/all-packages.nix | 2 +- 2 files changed, 23 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/science/math/lp_solve/default.nix b/pkgs/applications/science/math/lp_solve/default.nix index 876222772e86..f4c117267d56 100644 --- a/pkgs/applications/science/math/lp_solve/default.nix +++ b/pkgs/applications/science/math/lp_solve/default.nix @@ -1,7 +1,12 @@ -{ lib, stdenv, fetchurl, cctools, fixDarwinDylibNames }: +{ lib +, stdenv +, fetchurl +, cctools +, fixDarwinDylibNames +, autoSignDarwinBinariesHook +}: stdenv.mkDerivation rec { - pname = "lp_solve"; version = "5.5.2.11"; @@ -13,20 +18,24 @@ stdenv.mkDerivation rec { nativeBuildInputs = lib.optionals stdenv.isDarwin [ cctools fixDarwinDylibNames + ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ + autoSignDarwinBinariesHook ]; dontConfigure = true; - buildPhase = let - ccc = if stdenv.isDarwin then "ccc.osx" else "ccc"; - in '' - runHook preBuild + buildPhase = + let + ccc = if stdenv.isDarwin then "ccc.osx" else "ccc"; + in + '' + runHook preBuild - (cd lpsolve55 && bash -x -e ${ccc}) - (cd lp_solve && bash -x -e ${ccc}) + (cd lpsolve55 && bash -x -e ${ccc}) + (cd lp_solve && bash -x -e ${ccc}) - runHook postBuild - ''; + runHook postBuild + ''; installPhase = '' runHook preInstall @@ -44,9 +53,9 @@ stdenv.mkDerivation rec { meta = with lib; { description = "A Mixed Integer Linear Programming (MILP) solver"; - homepage = "http://lpsolve.sourceforge.net"; - license = licenses.gpl2Plus; + homepage = "http://lpsolve.sourceforge.net"; + license = licenses.gpl2Plus; maintainers = with maintainers; [ smironov ]; - platforms = platforms.unix; + platforms = platforms.unix; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 5092e04fe974..2b2b9f4f77cd 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6137,7 +6137,7 @@ with pkgs; }; lp_solve = callPackage ../applications/science/math/lp_solve { - inherit (darwin) cctools; + inherit (darwin) cctools autoSignDarwinBinariesHook; }; fabric-installer = callPackage ../tools/games/minecraft/fabric-installer { };