From 80a7b41060989f30015863490b6fc4d6ec44d1aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20van=20Br=C3=BCgge?= Date: Wed, 8 Jan 2025 18:30:48 +0000 Subject: [PATCH] polyml,polyml{56,57}: fix build --- pkgs/development/compilers/polyml/5.6.nix | 16 ++++++-- pkgs/development/compilers/polyml/5.7.nix | 16 ++++++-- pkgs/development/compilers/polyml/default.nix | 39 +++++++++++++------ 3 files changed, 51 insertions(+), 20 deletions(-) diff --git a/pkgs/development/compilers/polyml/5.6.nix b/pkgs/development/compilers/polyml/5.6.nix index 1601669673eb..d739f7666935 100644 --- a/pkgs/development/compilers/polyml/5.6.nix +++ b/pkgs/development/compilers/polyml/5.6.nix @@ -14,9 +14,17 @@ stdenv.mkDerivation { pname = "polyml"; inherit version; - prePatch = lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace configure.ac --replace stdc++ c++ - ''; + postPatch = + '' + substituteInPlace configure.ac \ + --replace-fail 'AC_FUNC_ALLOCA' "AC_FUNC_ALLOCA + AH_TEMPLATE([_Static_assert]) + AC_DEFINE([_Static_assert], [static_assert]) + " + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace configure.ac --replace-fail stdc++ c++ + ''; patches = [ # glibc 2.34 compat @@ -26,7 +34,7 @@ stdenv.mkDerivation { }) ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin autoreconfHook; + nativeBuildInputs = [ autoreconfHook ]; src = fetchurl { url = "mirror://sourceforge/polyml/polyml.${version}.tar.gz"; diff --git a/pkgs/development/compilers/polyml/5.7.nix b/pkgs/development/compilers/polyml/5.7.nix index 197a787594ea..c35a325ba01a 100644 --- a/pkgs/development/compilers/polyml/5.7.nix +++ b/pkgs/development/compilers/polyml/5.7.nix @@ -12,9 +12,17 @@ stdenv.mkDerivation rec { pname = "polyml"; version = "5.7.1"; - prePatch = lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace configure.ac --replace stdc++ c++ - ''; + postPatch = + '' + substituteInPlace configure.ac \ + --replace-fail 'AC_FUNC_ALLOCA' "AC_FUNC_ALLOCA + AH_TEMPLATE([_Static_assert]) + AC_DEFINE([_Static_assert], [static_assert]) + " + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace configure.ac --replace-fail stdc++ c++ + ''; patches = [ ./5.7-new-libffi-FFI_SYSV.patch @@ -31,7 +39,7 @@ stdenv.mkDerivation rec { gmp ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin autoreconfHook; + nativeBuildInputs = [ autoreconfHook ]; configureFlags = [ "--enable-shared" diff --git a/pkgs/development/compilers/polyml/default.nix b/pkgs/development/compilers/polyml/default.nix index 067bdd018f27..99b6889eb4d6 100644 --- a/pkgs/development/compilers/polyml/default.nix +++ b/pkgs/development/compilers/polyml/default.nix @@ -1,9 +1,10 @@ -{ lib -, stdenv -, fetchFromGitHub -, autoreconfHook -, gmp -, libffi +{ + lib, + stdenv, + fetchFromGitHub, + autoreconfHook, + gmp, + libffi, }: stdenv.mkDerivation rec { @@ -17,13 +18,24 @@ stdenv.mkDerivation rec { sha256 = "sha256-72wm8dt+Id59A5058mVE5P9TkXW5/LZRthZoxUustVA="; }; - prePatch = lib.optionalString stdenv.hostPlatform.isDarwin '' - substituteInPlace configure.ac --replace stdc++ c++ - ''; + postPatch = + '' + substituteInPlace configure.ac \ + --replace-fail 'AC_FUNC_ALLOCA' "AC_FUNC_ALLOCA + AH_TEMPLATE([_Static_assert]) + AC_DEFINE([_Static_assert], [static_assert]) + " + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + substituteInPlace configure.ac --replace-fail stdc++ c++ + ''; - buildInputs = [ libffi gmp ]; + buildInputs = [ + libffi + gmp + ]; - nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin autoreconfHook; + nativeBuildInputs = [ autoreconfHook ]; configureFlags = [ "--enable-shared" @@ -47,6 +59,9 @@ stdenv.mkDerivation rec { homepage = "https://www.polyml.org/"; license = licenses.lgpl21; platforms = with platforms; (linux ++ darwin); - maintainers = with maintainers; [ maggesi kovirobi ]; + maintainers = with maintainers; [ + maggesi + kovirobi + ]; }; }