Merge pull request #248635 from marsam/update-cminpack

cminpack: 1.3.6 -> 1.3.8

authored by Robert Scott and committed by GitHub ecaa0503 08d24204

+35 -18
+35 -18
pkgs/development/libraries/cminpack/default.nix
··· 1 - {lib, stdenv, fetchurl}: 1 + { lib 2 + , stdenv 3 + , cmake 4 + , darwin 5 + , fetchFromGitHub 6 + , fetchurl 7 + , withBlas ? true, blas 8 + }: 2 9 3 10 stdenv.mkDerivation rec { 4 11 pname = "cminpack"; 5 - version = "1.3.6"; 12 + version = "1.3.8"; 6 13 7 - src = fetchurl { 8 - url = "http://devernay.free.fr/hacks/cminpack/cminpack-${version}.tar.gz"; 9 - sha256 = "17yh695aim508x1kn9zf6g13jxwk3pi3404h5ix4g5lc60hzs1rw"; 14 + src = fetchFromGitHub { 15 + owner = "devernay"; 16 + repo = "cminpack"; 17 + rev = "v${version}"; 18 + hash = "sha256-eFJ43cHbSbWld+gPpMaNiBy1X5TIcN9aVxjh8PxvVDU="; 10 19 }; 11 20 12 - postPatch = '' 13 - substituteInPlace Makefile \ 14 - --replace '/usr/local' '${placeholder "out"}' \ 15 - --replace 'gcc' '${stdenv.cc.targetPrefix}cc' \ 16 - --replace 'ranlib -t' '${stdenv.cc.targetPrefix}ranlib' \ 17 - --replace 'ranlib' '${stdenv.cc.targetPrefix}ranlib' 18 - ''; 21 + strictDeps = true; 22 + 23 + nativeBuildInputs = [ 24 + cmake 25 + ]; 26 + 27 + buildInputs = lib.optionals withBlas [ 28 + blas 29 + ] ++ lib.optionals (withBlas && stdenv.isDarwin) [ 30 + darwin.apple_sdk.frameworks.Accelerate 31 + darwin.apple_sdk.frameworks.CoreGraphics 32 + darwin.apple_sdk.frameworks.CoreVideo 33 + ]; 19 34 20 - preInstall = '' 21 - mkdir -p $out/lib $out/include 22 - ''; 35 + cmakeFlags = [ 36 + "-DUSE_BLAS=${if withBlas then "ON" else "OFF"}" 37 + "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" 38 + ]; 23 39 24 40 meta = { 25 - homepage = "http://devernay.free.fr/hacks/cminpack/cminpack.html"; 41 + description = "Software for solving nonlinear equations and nonlinear least squares problems"; 42 + homepage = "http://devernay.free.fr/hacks/cminpack/"; 43 + changelog = "https://github.com/devernay/cminpack/blob/v${version}/README.md#history"; 26 44 license = lib.licenses.bsd3; 27 - description = "Software for solving nonlinear equations and nonlinear least squares problems"; 28 45 platforms = lib.platforms.all; 46 + maintainers = [ ]; 29 47 }; 30 - 31 48 }