Skip to content

Commit

Permalink
polyml,polyml{56,57}: fix build (#372200)
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 authored Jan 23, 2025
2 parents ae41002 + 80a7b41 commit 1bc6f84
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 20 deletions.
16 changes: 12 additions & 4 deletions pkgs/development/compilers/polyml/5.6.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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";
Expand Down
16 changes: 12 additions & 4 deletions pkgs/development/compilers/polyml/5.7.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -31,7 +39,7 @@ stdenv.mkDerivation rec {
gmp
];

nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin autoreconfHook;
nativeBuildInputs = [ autoreconfHook ];

configureFlags = [
"--enable-shared"
Expand Down
39 changes: 27 additions & 12 deletions pkgs/development/compilers/polyml/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{ lib
, stdenv
, fetchFromGitHub
, autoreconfHook
, gmp
, libffi
{
lib,
stdenv,
fetchFromGitHub,
autoreconfHook,
gmp,
libffi,
}:

stdenv.mkDerivation rec {
Expand All @@ -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"
Expand All @@ -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
];
};
}

0 comments on commit 1bc6f84

Please sign in to comment.