diff --git a/pkgs/development/libraries/science/math/faiss/default.nix b/pkgs/development/libraries/science/math/faiss/default.nix index 9b7b4d268197767..ac19356d1a73a06 100644 --- a/pkgs/development/libraries/science/math/faiss/default.nix +++ b/pkgs/development/libraries/science/math/faiss/default.nix @@ -63,6 +63,15 @@ stdenv.mkDerivation { }) ]; + postPatch = '' + # Remove the following substituteInPlace when updating + # to a release that contains change from PR + # https://github.com/facebookresearch/faiss/issues/3239 + # that fixes building faiss with swig 4.2.x + substituteInPlace faiss/python/swigfaiss.swig \ + --replace-fail '#ifdef SWIGWORDSIZE64' '#if (__SIZEOF_LONG__ == 8)' + ''; + buildInputs = [ blas swig diff --git a/pkgs/development/tools/misc/swig/4.nix b/pkgs/development/tools/misc/swig/4.nix index 6b6d1bc02db9895..bae53ad42f9d374 100644 --- a/pkgs/development/tools/misc/swig/4.nix +++ b/pkgs/development/tools/misc/swig/4.nix @@ -1,19 +1,19 @@ -{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, bison, pcre }: +{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, bison, pcre2 }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "swig"; - version = "4.0.2"; + version = "4.2.1"; src = fetchFromGitHub { owner = "swig"; repo = "swig"; - rev = "rel-${version}"; - sha256 = "12vlps766xvwck8q0i280s8yx21qm2dxl34710ybpmz3c1cfdjsc"; + rev = "v${finalAttrs.version}"; + hash = "sha256-VlUsiRZLScmbC7hZDzKqUr9481YXVwo0eXT/jy6Fda8="; }; - PCRE_CONFIG = "${pcre.dev}/bin/pcre-config"; + PCRE_CONFIG = "${pcre2.dev}/bin/pcre-config"; nativeBuildInputs = [ autoconf automake libtool bison ]; - buildInputs = [ pcre ]; + buildInputs = [ pcre2 ]; configureFlags = [ "--without-tcl" ]; @@ -26,12 +26,14 @@ stdenv.mkDerivation rec { ./autogen.sh ''; - meta = with lib; { - description = "SWIG, an interface compiler that connects C/C++ code to higher-level languages"; + meta = { + changelog = "https://github.com/swig/swig/blob/${finalAttrs.src.rev}/CHANGES.current"; + description = "Interface compiler that connects C/C++ code to higher-level languages"; homepage = "https://swig.org/"; - # Different types of licenses available: http://www.swig.org/Release/LICENSE . - license = licenses.gpl3Plus; - maintainers = with maintainers; [ orivej ]; - platforms = with platforms; linux ++ darwin; + # Different types of licenses available: https://www.swig.org/Release/LICENSE . + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ orivej ]; + mainProgram = "swig"; + platforms = with lib.platforms; linux ++ darwin; }; -} +})