Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polyml,polyml{56,57}: fix build #372200

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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++
'';
prePatch =
lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace configure.ac --replace stdc++ c++
''
+ ''
substituteInPlace configure.ac \
--replace-fail 'AC_FUNC_ALLOCA' "AC_FUNC_ALLOCA
AH_TEMPLATE([_Static_assert])
AC_DEFINE([_Static_assert], [static_assert])
"
'';

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++
'';
prePatch =
lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace configure.ac --replace stdc++ c++
''
+ ''
substituteInPlace configure.ac \
--replace-fail 'AC_FUNC_ALLOCA' "AC_FUNC_ALLOCA
AH_TEMPLATE([_Static_assert])
AC_DEFINE([_Static_assert], [static_assert])
"
'';

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++
'';
prePatch =
lib.optionalString stdenv.hostPlatform.isDarwin ''
substituteInPlace configure.ac --replace-fail stdc++ c++
''
+ ''
substituteInPlace configure.ac \
--replace-fail 'AC_FUNC_ALLOCA' "AC_FUNC_ALLOCA
AH_TEMPLATE([_Static_assert])
AC_DEFINE([_Static_assert], [static_assert])
"
'';

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
];
};
}