Skip to content
Permalink
Browse files

p5-text-bibtex: remove blacklisting and add -std=c99 to compile flags

This is a better build fix for 10.6 and earlier.  In particular, gcc-4.2
does, in fact, support C99 but not by default as newer compilers do.

Thanks to @ryandesign and @jmroot for clarifying the issue.
  • Loading branch information
dbevans committed Apr 3, 2019
1 parent 958ecf2 commit 8c421de3ba58531c3c3599609b4ce8af7b5cf9e0
Showing with 21 additions and 8 deletions.
  1. +10 −8 perl/p5-text-bibtex/Portfile
  2. +11 −0 perl/p5-text-bibtex/files/patch-extra-flags.diff
@@ -1,11 +1,11 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0
PortGroup compiler_blacklist_versions 1.0
PortGroup perl5 1.0

perl5.branches 5.26 5.28
perl5.setup Text-BibTeX 0.86
revision 1
platforms darwin
maintainers nomaintainer
license {Artistic-1 GPL}
@@ -29,17 +29,19 @@ if {${perl5.major} != ""} {
depends_lib-append \
port:p${perl5.major}-unicode-normalize

# blacklist compilers that don't support C99
# btparse/tests/namebug.c:193: error: ‘for’ loop initial declaration used outside C99 mode
compiler.blacklist *gcc-3.* *gcc-4.* {clang < 300}

perl5.use_module_build

# in inc/MyBuilder.pm, copy_if_modified is called on binaries and libraries
# the libraries and binaries are then modified (install names changed)
# copy_if_modified, however, sets all files as read only
# see https://metacpan.org/pod/release/LEONT/Module-Build-0.4220/lib/Module/Build/API.pod#copy_if_modified
# see https://github.com/Perl-Toolchain-Gang/Module-Build/blob/master/lib/Module/Build/Base.pm#L5600
# patch temporarily makes the files writable before changing them
patchfiles-append patch-permissions.diff
patchfiles-append \
patch-permissions.diff \

# add -std=c99 to compile flags to fix build for default compilers on 10.6 and earlier
# btparse/tests/namebug.c:193: error: ‘for’ loop initial declaration used outside C99 mode
patchfiles-append \
patch-extra-flags.diff

perl5.use_module_build
}
@@ -0,0 +1,11 @@
--- inc/MyBuilder.pm.orig 2019-04-03 15:32:39.000000000 -0700
+++ inc/MyBuilder.pm 2019-04-03 15:36:49.000000000 -0700
@@ -17,7 +17,7 @@
use File::Path qw.mkpath.;
use Cwd 'abs_path';

-my @EXTRA_FLAGS = ();
+my @EXTRA_FLAGS = ("-std=c99");
my @BINARIES = qw(biblex bibparse dumpnames);

## debug

0 comments on commit 8c421de

Please sign in to comment.
You can’t perform that action at this time.