diff --git a/pkgs/development/libraries/gsl/default.nix b/pkgs/development/libraries/gsl/default.nix index 7e3d11528a4f..2211f2d0d99f 100644 --- a/pkgs/development/libraries/gsl/default.nix +++ b/pkgs/development/libraries/gsl/default.nix @@ -1,16 +1,24 @@ -{ fetchurl, lib, stdenv }: +{ fetchurl, fetchpatch, lib, stdenv }: stdenv.mkDerivation rec { pname = "gsl"; - version = "2.7.1"; + version = "2.8"; outputs = [ "out" "dev" ]; src = fetchurl { url = "mirror://gnu/gsl/${pname}-${version}.tar.gz"; - sha256 = "sha256-3LD71DBIgyt1f/mUJpGo3XACbV2g/4VgHlJof23us0s="; + hash = "sha256-apnu7RVjLGNUiVsd1ULtWoVcDxXZrRMmxv4rLJ5CMZA="; }; + patches = [ + (fetchpatch { + url = "https://github.com/macports/macports-ports/raw/90be777d2ce451d3c23783cb2be0efab9732e4d0/math/gsl/files/patch-fix-linking.diff"; + extraPrefix = ""; + hash = "sha256-lweYndIxcM5+4ckIUubkD9XbJbqkfdK+y9c3aRzmq0M="; + }) + ]; + preConfigure = if (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11" && stdenv.isDarwin) then '' MACOSX_DEPLOYMENT_TARGET=10.16 '' else null; diff --git a/pkgs/development/python-modules/pygsl/default.nix b/pkgs/development/python-modules/pygsl/default.nix index c8e247f7d2d9..7726badc8197 100644 --- a/pkgs/development/python-modules/pygsl/default.nix +++ b/pkgs/development/python-modules/pygsl/default.nix @@ -20,6 +20,14 @@ buildPythonPackage rec { hash = "sha256-7agGgfDUgY6mRry7d38vGGNLJC4dFUniy2M/cnejDDs="; }; + # error: no member named 'n' in 'gsl_bspline_workspace' + postPatch = lib.optionalString (lib.versionAtLeast gsl.version "2.8") '' + substituteInPlace src/bspline/bspline.ic \ + --replace-fail "self->w->n" "self->w->ncontrol" + substituteInPlace swig_src/bspline_wrap.c \ + --replace-fail "self->w->n;" "self->w->ncontrol;" + ''; + nativeBuildInputs = [ gsl.dev swig