From 9647ad157ed95c628a054e2cbac5eded615e1182 Mon Sep 17 00:00:00 2001 From: Jerry James Date: Jun 03 2018 01:53:26 +0000 Subject: New upstream version. Also: - Drop upstreamed -lrs-system-fix and -gcc7 patches. - Add -no-hardening patch to fix FTBFS. - BR gmp-devel, ninja-build, perl(JSON), and permlib-devel. --- diff --git a/.gitignore b/.gitignore index 9bb5565..6b60bc1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1 @@ -/polymake-3.0r1.tar.bz2 -/polymake-3.0r2.tar.bz2 -/polymake-3.1.tar.bz2 +/polymake-*.tar.bz2 diff --git a/polymake-fedora.patch b/polymake-fedora.patch index 76da986..9d1a1ea 100644 --- a/polymake-fedora.patch +++ b/polymake-fedora.patch @@ -1,237 +1,257 @@ ---- bundled/cdd/configure.pl.orig 2017-03-28 03:30:14.000000000 -0600 -+++ bundled/cdd/configure.pl 2017-03-28 20:46:01.130083651 -0600 +--- bundled/cdd/support/configure.pl.orig 2018-02-16 03:27:51.000000000 -0700 ++++ bundled/cdd/support/configure.pl 2018-04-15 13:42:47.970012974 -0600 @@ -52,7 +52,6 @@ sub proceed { my $cdd_lib=Polymake::Configure::get_libdir($cdd_path, "cddgmp"); if (-f "$cdd_lib/libcddgmp.$Config::Config{so}" ) { - $LDflags = "-L$cdd_lib"; -- $LDflags .= " -Wl,-rpath,$cdd_lib" unless ($cdd_path eq "/usr"); + $LDFLAGS = "-L$cdd_lib"; +- $LDFLAGS .= " -Wl,-rpath,$cdd_lib" if $cdd_path ne "/usr"; } - if (!$CXXflags or !$LDflags) { + if (!$CFLAGS or !$LDFLAGS) { die "Invalid installation location of cddlib: header file cdd.h and/or library libcddgmp.$Config::Config{so} not found.\n", @@ -65,7 +64,6 @@ sub proceed { $cdd_path .= "include: $cdd_inc "; } if (defined ($cdd_lib=$options->{'cdd-lib'})) { -- $LDflags = "-L$cdd_lib -Wl,-rpath,$cdd_lib"; +- $LDFLAGS = "-L$cdd_lib -Wl,-rpath,$cdd_lib"; $cdd_path .= "lib: $cdd_lib"; } ---- bundled/libnormaliz/apps/polytope/src/Makefile.inc.orig 2017-03-28 03:30:14.000000000 -0600 -+++ bundled/libnormaliz/apps/polytope/src/Makefile.inc 2017-03-28 20:58:44.103003083 -0600 -@@ -1,4 +1,5 @@ --ExtraCXXFLAGS = -I$(ExtensionTop)/external/libnormaliz -+ExtraCXXFLAGS = -I/usr/include/libnormaliz -+LIBS += -lnormaliz - - # Local Variables: - # mode: Makefile ---- bundled/libnormaliz/apps/polytope/src/normaliz.cc.orig 2017-03-28 03:30:14.000000000 -0600 -+++ bundled/libnormaliz/apps/polytope/src/normaliz.cc 2017-03-28 20:52:15.183466846 -0600 -@@ -95,7 +95,7 @@ namespace libnormaliz { +--- bundled/libnormaliz/apps/polytope/src/libnormaliz_inst.cc.orig 2018-02-16 03:27:51.000000000 -0700 ++++ bundled/libnormaliz/apps/polytope/src/libnormaliz_inst.cc 2018-04-15 13:50:12.744485018 -0600 +@@ -135,7 +135,7 @@ inline bool int_quotient(long long& Quot #endif #endif -#include "libnormaliz/libnormaliz-all.cpp" +#include - #if defined(__GNUC__) && !defined(__clang__) - #pragma GCC diagnostic pop ---- bundled/lrs/configure.pl.orig 2017-03-28 03:30:14.000000000 -0600 -+++ bundled/lrs/configure.pl 2017-03-28 20:47:36.352644537 -0600 -@@ -42,7 +42,6 @@ sub proceed { - my $lrs_lib=Polymake::Configure::get_libdir($lrs_path, "lrs"); + #if defined(__GNUC__) + #if defined(__clang__) +--- bundled/libnormaliz/support/configure.pl.orig 2018-02-16 03:27:51.000000000 -0700 ++++ bundled/libnormaliz/support/configure.pl 2018-04-15 13:45:39.129423452 -0600 +@@ -136,6 +136,7 @@ int main (int argc, char *argv[]) + $message .= " [OpenMP support disabled]"; + } + } else { ++ $CXXFLAGS='-I/usr/include/libnormaliz'; + $LIBS="-lnormaliz"; + $message = "$nmz_version @ ".($nmz_path//"system") + } +--- bundled/lrs/support/configure.pl.orig 2018-02-16 03:27:51.000000000 -0700 ++++ bundled/lrs/support/configure.pl 2018-04-16 21:04:58.916451962 -0600 +@@ -45,11 +45,11 @@ sub proceed { + my $suppress_output=0; + + if (defined ($lrs_path=$options->{lrs}) and $lrs_path ne "bundled") { +- my $lrs_inc="$lrs_path/include"; ++ my $lrs_inc="$lrs_path/include/lrslib"; + my $lrs_lib=Polymake::Configure::get_libdir($lrs_path, "lrsgmp"); if (-f "$lrs_inc/lrslib.h" && -f "$lrs_lib/liblrsgmp.$Config::Config{so}" ) { - $CXXflags="-I$lrs_inc"; -- $LDflags="-L$lrs_lib -Wl,-rpath,$lrs_lib"; + $CFLAGS = "-I$lrs_inc"; +- $LDFLAGS = "-L$lrs_lib -Wl,-rpath,$lrs_lib"; ++ $LDFLAGS = "-L$lrs_lib"; } elsif (-f "$lrs_inc/lrslib.h" && -f "$lrs_lib/liblrsgmp.a" ) { - $CXXflags="-I$lrs_inc"; - $LDflags="-L$lrs_lib"; ---- bundled/nauty/apps/graph/src/Makefile.inc.orig 2017-03-28 03:30:14.000000000 -0600 -+++ bundled/nauty/apps/graph/src/Makefile.inc 2017-03-28 20:53:17.303208302 -0600 -@@ -1,13 +1,13 @@ - ifeq (${ImportedIntoExtension},) -- StaticLibs := nauty -+ # StaticLibs := nauty - - ifeq (${NautySrc},) - NautySrc := ${ExtensionTop}/external/nauty - endif - -- GraphIso$O : ExtraCXXFLAGS = -DBIGNAUTY -I${BuildDir}/staticlib/nauty -I${NautySrc} -+ GraphIso$O : ExtraCXXFLAGS = -DBIGNAUTY -I/usr/include/nauty - -- LIBS += ${BuildDir}/staticlib/nauty/libnauty$A -+ LIBS += -lnauty - endif - - # Local Variables: ---- bundled/nauty/staticlib/nauty/Makefile.inc.orig 2017-03-28 03:30:14.000000000 -0600 -+++ bundled/nauty/staticlib/nauty/Makefile.inc 2017-03-28 20:55:16.583711852 -0600 -@@ -1,10 +1,10 @@ --OwnLibrary := libnauty --LibModules := nauty naututil nautil nautinv naugraph rng naurng schreier nausparse nautaux --ifeq (${NautySrc},) -- src := ${ExtensionTop}/external/nauty --else -- src := ${NautySrc} --endif -+#OwnLibrary := libnauty -+#LibModules := nauty naututil nautil nautinv naugraph rng naurng schreier nausparse nautaux -+#ifeq (${NautySrc},) -+# src := ${ExtensionTop}/external/nauty -+#else -+# src := ${NautySrc} -+#endif - vpath %.c $(src) - - # We need to disable avx2 for some gcc versions as it produces invalid relocations -@@ -15,21 +15,21 @@ ifdef GCCversion - endif - endif - --ifeq "$(wildcard nauty.h)" "" -- override _system := $(shell uname -s) -- ifeq "$(_system)" "Darwin" -- override _hide := mv Makefile Makefile.hidden; -- override _restore := ;mv Makefile.hidden Makefile -- endif + $CFLAGS = "-I$lrs_inc"; + $LDFLAGS = "-L$lrs_lib"; +--- bundled/nauty/apps/graph/src/build_flags.pl.orig 2018-02-16 03:27:51.000000000 -0700 ++++ bundled/nauty/apps/graph/src/build_flags.pl 2018-04-18 18:51:41.461585057 -0600 +@@ -1,25 +1,11 @@ + # input for generate_ninja_targets.pl + +-my $foreign_src=$ConfigFlags{'bundled.nauty.NautySrc'}; +-my $nauty_src= $foreign_src ? '${bundled.nauty.NautySrc}' : '${root}/bundled/nauty/external/nauty'; +-my $generated_dir='${buildroot}/staticlib/nauty'; +-my @generated_headers=qw( nauty.h naututil.h gtools.h ); +-my @generated_in=map { /\.h$/; "$nauty_src/$`-h.in" } @generated_headers; +-my @generated_out=map { "$generated_dir/$_" } @generated_headers; +-my $include_generated= ($foreign_src && grep { -f "$foreign_src/$_" } @generated_headers) +- ? join(" ", map { "-include $_" } @generated_out) +- : "-I$generated_dir"; +- +-( CXXFLAGS => "-DBIGNAUTY -I$generated_dir -I$nauty_src", - -- override _dummy := $(shell ${_hide} CC=${CC} CFLAGS="${Cflags}" ${src}/configure --quiet 2>/dev/null; rm makefile ${_restore}) --endif -+#ifeq "$(wildcard nauty.h)" "" -+# override _system := $(shell uname -s) -+# ifeq "$(_system)" "Darwin" -+# override _hide := mv Makefile Makefile.hidden; -+# override _restore := ;mv Makefile.hidden Makefile -+# endif -+# -+# override _dummy := $(shell ${_hide} CC=${CC} CFLAGS="${Cflags}" ${src}/configure --quiet 2>/dev/null; rm makefile ${_restore}) -+#endif - - # force include nauty headers here on the command line to make sure that we pick - # up the newly generated ones instead (wrong?) ones from the original tarball - # (current directory of the source file is always searched first and -I- is deprecated) --ExtraCFLAGS := -DBIGNAUTY -I. -include $(CURDIR)/nauty.h -include $(CURDIR)/naututil.h -include $(CURDIR)/gtools.h -I${src} --ExtraCLEAN := nauty.h naututil.h gtools.h config.* -+ExtraCFLAGS := -DBIGNAUTY -I/usr/include/nauty -+#ExtraCLEAN := nauty.h naututil.h gtools.h config.* - - # Local Variables: - # mode: Makefile ---- bundled/ppl/configure.pl.orig 2017-03-28 03:30:14.000000000 -0600 -+++ bundled/ppl/configure.pl 2017-03-28 20:46:46.977872227 -0600 -@@ -35,7 +35,6 @@ sub proceed { - my $ppl_lib=Polymake::Configure::get_libdir($ppl_path, "ppl"); - if (-f "$ppl_inc/ppl.hh" && -f "$ppl_lib/libppl.$Config::Config{so}") { - $CXXflags.="-I$ppl_inc"; -- $LDflags="-L$ppl_lib -Wl,-rpath,$ppl_lib"; +- GENERATED => { +- out => "@generated_out", in => "@generated_in", +- command => "cd $generated_dir; CC=\"\${CC}\" CFLAGS=\"\${CFLAGS}\" $nauty_src/configure --quiet >/dev/null 2>/dev/null; rm -f makefile", +- }, +- +- staticlib => { +- SOURCEDIR => $nauty_src, +- SOURCES => [ qw(naugraph.c naurng.c nausparse.c nautaux.c nautil.c nautinv.c naututil.c nauty.c rng.c schreier.c) ], +- CFLAGS => "-DBIGNAUTY $include_generated -I$nauty_src", +- } ++( ++ $ConfigFlags{'bundled.nauty.UseBundled'} ++ ? ( staticlib => { ++ SOURCEDIR => '${root}/bundled/nauty/external/nauty', ++ SOURCES => [ qw(naugraph.c naurng.c nausparse.c nautaux.c nautil.c nautinv.c naututil.c nauty.c rng.c schreier.c) ], ++ CFLAGS => "-I/usr/include/nauty", ++ } ) ++ : () + ) +--- bundled/nauty/support/configure.pl.orig 2018-02-16 03:27:51.000000000 -0700 ++++ bundled/nauty/support/configure.pl 2018-04-17 20:54:14.055618022 -0600 +@@ -13,7 +13,7 @@ + # GNU General Public License for more details. + #------------------------------------------------------------------------------- + +-@conf_vars=qw( NautySrc ); ++@conf_vars=qw( UseBundled CFLAGS LDFLAGS LIBS ); + + sub allowed_options { + my ($allowed_options, $allowed_with)=@_; +@@ -28,24 +28,27 @@ sub usage { + " directory containing the nauty sources.\n"; + } + +-sub check_nauty { +- my $dir = @_ > 0 ? $_[0] : "bundled/nauty/external/nauty"; +- -e "$dir/nauty-h.in" ++sub check_bundled { ++ -e "bundled/nauty/external/nauty/nauty-h.in"; + } + + sub proceed { + my ($options)=@_; + my $nautysrc; ++ $UseBundled = 1; + if (defined ($nautysrc=$options->{"nauty-src"})) { +- check_nauty($nautysrc) or +- die "Specified nauty source directory invalid, could not find 'nauty-h.in'."; +- $NautySrc = $nautysrc; +- } elsif (!check_nauty()) { +- die "Bundled nauty directory seems to be missing, to use the nauty interface\n", +- "with the minimal tarball please specify a nauty source directory\n", +- "via --with-nauty-src=PATH."; ++ my $nauty_inc="$nautysrc/include/nauty"; ++ my $nauty_lib=Polymake::Configure::get_libdir($nautysrc, "nauty"); ++ if (-f "$nauty_inc/nauty.h") { ++ $CFLAGS="-I$nauty_inc"; ++ $LDFLAGS="-L$nauty_lib"; ++ $LIBS="-lnauty"; ++ $UseBundled = 0; ++ } else { ++ die "Could not locate a working nauty installation\n"; ++ } + } + +- return $NautySrc ? "$NautySrc" : "bundled"; ++ return $UseBundled ? "bundled" : ($nautysrc//"system"); + } + +--- bundled/ppl/support/configure.pl.orig 2018-02-16 03:27:51.000000000 -0700 ++++ bundled/ppl/support/configure.pl 2018-04-15 14:00:54.998296923 -0600 +@@ -55,7 +55,7 @@ sub proceed { + } + if ($ppl_lib) { + if (-f "$ppl_lib/libppl.$Config::Config{so}") { +- $LDFLAGS = "-L$ppl_lib -Wl,-rpath,$ppl_lib"; ++ $LDFLAGS = "-L$ppl_lib"; + } elsif ("$ppl_lib/libppl.a") { + die "PPL found at $ppl_path is built without shared libraries.\n"; } else { - die "Invalid installation location of libppl: header file ppl.hh and/or library libppl.$Config::Config{so} not found\n"; - } ---- bundled/singular/configure.pl.orig 2017-03-28 03:30:14.000000000 -0600 -+++ bundled/singular/configure.pl 2017-03-28 20:48:06.064507522 -0600 -@@ -40,7 +40,6 @@ sub singular_config_approach { +--- bundled/singular/support/configure.pl.orig 2018-02-16 03:27:51.000000000 -0700 ++++ bundled/singular/support/configure.pl 2018-04-15 14:02:08.374046937 -0600 +@@ -42,7 +42,7 @@ sub singular_config_approach { + # yes we need it twice ... chomp ($singular_prefix = `$singular_config --prefix`); chomp $singular_prefix; - $LDflags =~ s/ -l\w+//g; -- $LDflags =~ s/-L(\S+)/-L$1 -Wl,-rpath,$1/g; +- $LDFLAGS =~ s/-L(\S+)/-L$1 -Wl,-rpath,$1/g; ++ $LDFLAGS =~ s/-L(\S+)/-L$1/g; my $libdir = $1; # newer versions of singular need -lsingular_resources while older ones needed -lresources -@@ -63,9 +62,6 @@ sub pkg_config_approach { - chomp ($CXXflags=`$pkg_config --cflags Singular`); +@@ -65,9 +65,6 @@ sub pkg_config_approach { + chomp ($CXXFLAGS=`$pkg_config --cflags Singular`); die "$pkg_config failed: $!" if ($?); - chomp ($LDflags=`$pkg_config --libs-only-other --libs-only-L Singular`); + chomp ($LDFLAGS=`$pkg_config --libs-only-other --libs-only-L Singular`); - if (defined ($options->{singular})){ -- $LDflags =~ s/-L(\S+)/-L$1 -Wl,-rpath,$1/g; +- $LDFLAGS =~ s/-L(\S+)/-L$1 -Wl,-rpath,$1/g; - } - chomp ($Libs=`$pkg_config --libs-only-l Singular`); + chomp ($LIBS=`$pkg_config --libs-only-l Singular`); return $pc_singular_prefix; } ---- bundled/sympol/configure.pl.orig 2017-03-28 03:30:14.000000000 -0600 -+++ bundled/sympol/configure.pl 2017-03-28 20:47:05.905784941 -0600 -@@ -47,7 +47,6 @@ sub proceed { - my $sympol_lib=Polymake::Configure::get_libdir($sympol_path, "sympol"); - if (-f "$sympol_lib/libsympol.$Config::Config{so}" ) { - $LDflags = "-L$sympol_lib"; -- $LDflags .= " -Wl,-rpath,$sympol_lib" unless ($sympol_path eq "/usr"); - } - if (!$CXXflags or !$LDflags) { - die "Invalid installation location of sympol: header file symmetrycomputation.h and/or library libsympol.$Config::Config{so} not found.\n", -@@ -61,7 +60,6 @@ sub proceed { +--- bundled/sympol/apps/polytope/src/build_flags.pl.orig 2018-02-16 03:27:51.000000000 -0700 ++++ bundled/sympol/apps/polytope/src/build_flags.pl 2018-04-15 14:06:35.821171083 -0600 +@@ -10,7 +10,7 @@ if ($ConfigFlags{'bundled.sympol.UseBund + 'raycomputationcdd.cpp' => '-DGMPRATIONAL ${bundled.cdd.CFLAGS}', + 'raycomputationlrs.cpp' => '-DGMP ${bundled.lrs.CFLAGS}', + $ConfigFlags{ExternalHeaders} =~ /\bpermlib\b/ +- ? ( CXXFLAGS => '-I${root}/include/external/permlib' ) : (), ++ ? ( CXXFLAGS => '-I/usr/include/permlib' ) : (), + }, + ) + } else { +--- bundled/sympol/support/configure.pl.orig 2018-02-16 03:27:51.000000000 -0700 ++++ bundled/sympol/support/configure.pl 2018-04-15 14:05:52.837292506 -0600 +@@ -146,6 +146,7 @@ int main() { + undef $LIBS; + $CXXFLAGS = '-I${root}/bundled/sympol/external/sympol'; + } else { ++ $CXXFLAGS="-I/usr/include/sympol"; + $LIBS="-lsympol"; } - if (defined ($sympol_lib=$options->{'sympol-lib'})) { - $LDflags = " -L$sympol_lib"; -- $LDflags .= " -Wl,-rpath,$sympol_lib" unless ($sympol_lib =~ m#^/usr/lib#); - $sympol_path .= "lib: $sympol_lib"; - } - ---- bundled/sympol/staticlib/sympol/Makefile.inc.orig 2017-03-28 03:30:14.000000000 -0600 -+++ bundled/sympol/staticlib/sympol/Makefile.inc 2017-03-28 20:50:52.455811162 -0600 -@@ -4,10 +4,10 @@ src := ${ExtensionTop}/external/sympol/s - - vpath %.cpp $(src) - --ExtraCXXFLAGS := -I${ExtensionTop}/external/sympol/sympol ${LrsCflags} -DGMP -DLRS_QUIET ${CddCflags} -DGMPRATIONAL -+ExtraCXXFLAGS := -I/usr/include/sympol ${LrsCflags} -DGMP -DLRS_QUIET ${CddCflags} -DGMPRATIONAL - - ifneq ($(filter ${ExternalHeaders},permlib),) -- ExtraCXXFLAGS += -I${ProjectTop}/include/external/permlib -+ ExtraCXXFLAGS += -I$/usr/include/permlib - endif - # Local Variables: ---- perl/polymake-config.orig 2017-03-28 03:30:14.000000000 -0600 -+++ perl/polymake-config 2017-03-28 20:56:20.646445222 -0600 -@@ -127,9 +127,6 @@ while (defined ($_=shift)) { +--- perl/polymake-config.orig 2018-02-16 03:27:51.000000000 -0700 ++++ perl/polymake-config 2018-04-15 14:08:13.652894725 -0600 +@@ -130,9 +130,6 @@ while (defined ($_=shift)) { } elsif ($_ eq "--ldflags") { - my $ldflags=$conf{LDflags}; -- if ($ldflags !~ /(?:^|\s)-L$conf{InstallLib}(?:\s|$)/) { -- $ldflags="-L$conf{InstallLib} $ldflags"; + my $ldflags=$ConfigFlags{LDFLAGS}; +- if ($ldflags !~ /(?:^|\s)-L$ConfigFlags{InstallLib}(?:\s|$)/) { +- $ldflags="-L$ConfigFlags{InstallLib} $ldflags"; - } my $add_rpath=1; - open CF, ">$tmpfile.cc" or die "can't create temporary file $tmpfile.cc: $!\n"; - print CF "int main() { return 0; }\n"; -@@ -147,8 +144,6 @@ while (defined ($_=shift)) { + + # collect standard library paths of the C++ compiler and exclude them from the result +@@ -152,8 +149,6 @@ while (defined ($_=shift)) { close CC; if ($^O eq "darwin") { - $ldflags="$conf{ARCHFLAGS} $ldflags -flat_namespace"; + $ldflags="$ConfigFlags{ARCHFLAGS} $ldflags -flat_namespace"; - } elsif ($add_rpath) { -- $ldflags.=" -Wl,-rpath,$conf{InstallLib}"; +- $ldflags.=" -Wl,-rpath,$ConfigFlags{InstallLib}"; } $ldflags=~s/^\s+//; $ldflags=~s/\s+$//; $ldflags=~s/\s{2,}/ /g; if ($debug_asked=defined($debug)) { ---- support/configure.pl.orig 2017-03-28 03:30:14.000000000 -0600 -+++ support/configure.pl 2017-03-28 20:57:46.759165080 -0600 -@@ -442,7 +442,7 @@ if (defined($GCCversion) or defined($CLA - } +--- support/configure.pl.orig 2018-02-16 03:27:51.000000000 -0700 ++++ support/configure.pl 2018-04-15 14:10:02.468587338 -0600 +@@ -454,7 +454,7 @@ sub parse_command_line { + } + } - $PERL =$vars{PERL} || $^X; --$CXXOPT =$vars{CXXOPT} || "-O3"; -+$CXXOPT =$vars{CXXOPT} || "-O2"; - $CXXDEBUG =$vars{CXXDEBUG} || ""; - $Cflags =$vars{CFLAGS} || ""; - $CXXflags =$vars{CXXFLAGS} || $Cflags; -@@ -763,10 +763,6 @@ if (defined $GMP) { - $CXXflags .= " -I$GMP/include"; - my $libdir=get_libdir($GMP, "gmp"); - $LDflags .= " -L$libdir"; -- if (($^O ne "darwin" || $options{fink} eq ".none.") && exists $options{gmp}) { -- # non-standard location -- $LDflags .= " -Wl,-rpath,$libdir"; -- } - } +- $CXXOPT =$vars{CXXOPT} // "-O3"; ++ $CXXOPT =$vars{CXXOPT} // "-O2"; + $CXXDEBUG =$vars{CXXDEBUG} // ""; + $CFLAGS =$vars{CFLAGS} // ""; + $CXXFLAGS =$vars{CXXFLAGS} // $CFLAGS; +@@ -668,7 +668,7 @@ sub determine_cxx_library { + } + $CFLAGS .= " -I$options{toolchain}/include"; + $CXXFLAGS .= " -I$options{toolchain}/include"; +- $LDFLAGS .= " -L$libdir -Wl,-rpath,$libdir"; ++ $LDFLAGS .= " -L$libdir"; + } - my $MPFR=$options{mpfr}; -@@ -775,10 +771,6 @@ if (defined($MPFR) && $MPFR ne $GMP) { - $CXXflags .= " -I$MPFR/include"; - my $libdir=get_libdir($MPFR, "mpfr"); - $LDflags .= " -L$libdir"; -- if ($^O ne "darwin" || $options{fink} eq ".none.") { -- # non-standard location -- $LDflags .= " -Wl,-rpath,$libdir"; -- } - } + if ($options{libcxx} eq ".true.") { +@@ -993,10 +993,6 @@ sub locate_gmp_and_mpfr_libraries { + $CXXFLAGS .= " -I$GMP/include"; + my $libdir=get_libdir($GMP, "gmp"); + $LDFLAGS .= " -L$libdir"; +- if (!$FinkBase) { +- # non-standard location +- $LDFLAGS .= " -Wl,-rpath,$libdir"; +- } + } - if (defined($boost_path)) { + my $MPFR=$options{mpfr}; +@@ -1005,10 +1001,6 @@ sub locate_gmp_and_mpfr_libraries { + $CXXFLAGS .= " -I$MPFR/include"; + my $libdir=get_libdir($MPFR, "mpfr"); + $LDFLAGS .= " -L$libdir"; +- if (!$FinkBase) { +- # non-standard location +- $LDFLAGS .= " -Wl,-rpath,$libdir"; +- } + } elsif ($FinkBase) { + $MPFR=$FinkBase; + } diff --git a/polymake-gcc7.patch b/polymake-gcc7.patch deleted file mode 100644 index e9c0fca..0000000 --- a/polymake-gcc7.patch +++ /dev/null @@ -1,13 +0,0 @@ ---- lib/core/include/Graph.h.orig 2017-03-28 03:30:14.000000000 -0600 -+++ lib/core/include/Graph.h 2017-03-28 21:33:36.040286583 -0600 -@@ -709,8 +709,8 @@ public: - void swap(Table& t) - { - std::swap(R,t.R); -- std::swap(node_maps, t.node_maps); -- std::swap(edge_maps, t.edge_maps); -+ node_maps.swap(t.node_maps); -+ edge_maps.swap(t.edge_maps); - std::swap(n_nodes, t.n_nodes); - std::swap(free_node_id, t.free_node_id); - std::swap(free_edge_ids, t.free_edge_ids); diff --git a/polymake-latte.patch b/polymake-latte.patch index 60b2bc2..a601f37 100644 --- a/polymake-latte.patch +++ b/polymake-latte.patch @@ -1,5 +1,5 @@ ---- apps/polytope/rules/latte.rules.orig 2016-07-22 06:23:31.000000000 -0600 -+++ apps/polytope/rules/latte.rules 2017-01-21 12:12:56.453032113 -0700 +--- apps/polytope/rules/latte.rules.orig 2018-02-16 03:27:51.000000000 -0700 ++++ apps/polytope/rules/latte.rules 2018-04-15 14:44:53.015053208 -0600 @@ -23,7 +23,7 @@ CREDIT latte custom $latte_count; diff --git a/polymake-lrs-system-fix.patch b/polymake-lrs-system-fix.patch deleted file mode 100644 index e01b594..0000000 --- a/polymake-lrs-system-fix.patch +++ /dev/null @@ -1,61 +0,0 @@ ---- bundled/lrs/configure.pl.orig 2017-01-11 07:41:13.165154107 -0700 -+++ bundled/lrs/configure.pl 2017-01-11 08:16:04.631713597 -0700 -@@ -17,14 +17,16 @@ - - sub allowed_options { - my ($allowed_options, $allowed_with)=@_; -- @$allowed_with{ qw( lrs ) }=(); -+ @$allowed_with{ qw( lrs lrs-include lrs-lib) }=(); - } - - - sub usage { - print STDERR " --with-lrs=PATH Installation path of lrslib, if non-standard.\n", - " Uses the bundled lrslib (bundled/lrs/external/lrs) if it exists\n", -- " and either no path or 'bundled' is given as option.\n"; -+ " and either no path or 'bundled' is given as option.\n", -+ " --with-lrs-include=PATH Path to the folder containing lrslib.h. \n", -+ " --with-lrs-lib=PATH Path to the folder containing liblrsgmp.{a,so,dylib} \n"; - } - - sub check_bundled { -@@ -39,18 +41,32 @@ sub proceed { - - if (defined ($lrs_path=$options->{lrs}) and $lrs_path ne "bundled") { - my $lrs_inc="$lrs_path/include"; -- my $lrs_lib=Polymake::Configure::get_libdir($lrs_path, "lrs"); -- if (-f "$lrs_inc/lrslib.h" && -f "$lrs_lib/liblrsgmp.$Config::Config{so}" ) { -- $CXXflags="-I$lrs_inc"; -- } elsif (-f "$lrs_inc/lrslib.h" && -f "$lrs_lib/liblrsgmp.a" ) { -+ if (-f "$lrs_inc/lrslib.h") { - $CXXflags="-I$lrs_inc"; -- $LDflags="-L$lrs_lib"; -- } else { -- die "Invalid installation location of lrslib: header file lrslib.h and/or library liblrsgmp.$Config::Config{so} / liblrsgmp.a not found\n"; -+ } elsif (-f "$lrs_inc/lrslib/lrslib.h") { -+ # This is for fedora where the includes are moved to a subdirectory -+ $CXXflags = "-I$lrs_inc/lrslib"; -+ } -+ my $lrs_lib=Polymake::Configure::get_libdir($lrs_path, "lrsgmp"); -+ if (-f "$lrs_lib/liblrsgmp.$Config::Config{so}" ) { -+ $LDflags = "-L$lrs_lib"; -+ } -+ -+ if (!$CXXflags or !$LDflags) { -+ die "Invalid installation location of lrslib: header file lrslib.h and/or library liblrsgmp.$Config::Config{so} not found.\n", -+ "You might try to use --with-lrs-include and --with-lrs-lib.\n"; - } - $LrsCflags = $CXXflags; - } - -+ if (defined (my $lrs_inc=$options->{'lrs-include'})) { -+ $CXXflags="-I$lrs_inc"; -+ $cdd_path .= "include: $lrs_inc "; -+ } -+ if (defined ($cdd_lib=$options->{'lrs-lib'})) { -+ $cdd_path .= "lib: $lrs_lib"; -+ } -+ - if ($lrs_path ne "bundled") { - my $error=Polymake::Configure::build_test_program(<<'---', Libs => "-llrsgmp -lgmp", CXXflags => "$CXXflags", LDflags => "$LDflags"); - #include diff --git a/polymake-no-hardening.patch b/polymake-no-hardening.patch new file mode 100644 index 0000000..dff85d3 --- /dev/null +++ b/polymake-no-hardening.patch @@ -0,0 +1,37 @@ +--- support/configure.pl.orig 2018-04-15 14:10:02.468587338 -0600 ++++ support/configure.pl 2018-04-17 19:48:25.771585244 -0600 +@@ -918,6 +918,7 @@ int main() { + } + + $LDsharedFLAGS=$Config::Config{lddlflags}; ++ $LDsharedFLAGS =~ s/ -specs=\S+redhat-hardened-cc1//g; + + if ($^O eq "darwin") { + # MacOS magic again: remove multi-architecture options for fat binaries +@@ -947,6 +948,8 @@ int main() { + + if ($options{callable} ne ".none.") { + $LDcallableFLAGS="$LDsharedFLAGS $Config::Config{ldflags}"; ++ $LDcallableFLAGS =~ s/ -specs=\S+redhat-hardened-ld//g; ++ $LDcallableFLAGS =~ s/ -Wl,-z,now//g; + $LDsonameFLAGS = "-Wl,-soname,"; + } else { + $LDcallableFLAGS="none"; +@@ -1610,10 +1613,15 @@ sub write_perl_specific_configuration_fi + $no_warn .= " -Wno-literal-suffix"; + } + ++ my $GlueFLAGS=$Config::Config{ccflags}; ++ $GlueFLAGS =~ s/ -specs=\\S+redhat-hardened-cc1//g; ++ my $PerlFLAGS=$Config::Config{ccdlflags}; ++ $PerlFLAGS =~ s/ -specs=\\S+redhat-hardened-ld//g; ++ $PerlFLAGS =~ s/ -Wl,-z,now//g; + print $conf <<"---"; + PERL=$Config::Config{perlpath} +-CXXglueFLAGS=-I$Config::Config{archlibexp}/CORE $Config::Config{ccflags} -DPerlVersion=$PerlVersion $no_warn +-LIBperlFLAGS=-L$Config::Config{archlib}/CORE -lperl $Config::Config{ccdlflags} ++CXXglueFLAGS=-I$Config::Config{archlibexp}/CORE $GlueFLAGS -DPerlVersion=$PerlVersion $no_warn ++LIBperlFLAGS=-L$Config::Config{archlib}/CORE -lperl $PerlFLAGS + ExtUtils=$Config::Config{privlib}/ExtUtils + --- + diff --git a/polymake.spec b/polymake.spec index 7b81720..322a9d1 100644 --- a/polymake.spec +++ b/polymake.spec @@ -16,8 +16,8 @@ %bcond_with jreality Name: polymake -Version: 3.1 -Release: 12%{?dist} +Version: 3.2r3 +Release: 1%{?dist} %global polydir %{_libdir}/%{name} %global majver %(cut -dr -f1 <<< %{version}) @@ -33,12 +33,10 @@ Source1: %{name}.1 # against existing system libraries instead of building them from source, # and do not use -rpath. Patch0: %{name}-fedora.patch -# Properly detect lrs system bits -Patch1: %{name}-lrs-system-fix.patch +# Do not use the hardening flags. See above. +Patch1: %{name}-no-hardening.patch # Fix detection of LattE Patch2: %{name}-latte.patch -# Fix compilation error with gcc 7 -Patch3: %{name}-gcc7.patch %if %{with jreality} BuildRequires: ant @@ -48,6 +46,7 @@ BuildRequires: cddlib-devel BuildRequires: cmake BuildRequires: eigen3-static BuildRequires: gcc-c++ +BuildRequires: gmp-devel %if %{with jreality} BuildRequires: java-devel BuildRequires: jpackage-utils @@ -57,12 +56,14 @@ BuildRequires: libnormaliz-devel BuildRequires: libxml2-devel BuildRequires: lrslib-devel BuildRequires: mpfr-devel +BuildRequires: ninja-build BuildRequires: perl-devel BuildRequires: perl-generators BuildRequires: perl(Archive::Tar) BuildRequires: perl(ExtUtils::Embed) BuildRequires: perl(ExtUtils::MakeMaker) BuildRequires: perl(Gtk2) +BuildRequires: perl(JSON) BuildRequires: perl(Math::BigInt) BuildRequires: perl(Math::Trig) # Not available on all arches @@ -75,6 +76,7 @@ BuildRequires: perl(Term::ReadLine::Gnu) BuildRequires: perl(XML::LibXSLT) BuildRequires: perl(XML::SAX::Base) BuildRequires: perl(XML::Writer) +BuildRequires: permlib-devel BuildRequires: ppl-devel BuildRequires: sympol-devel BuildRequires: xhtml1-dtds @@ -115,15 +117,12 @@ Suggests: sketch # Add some provides the automatic generator missed Provides: perl(PolyDB::DatabaseCursor) -Provides: perl(Polymake::Background) +Provides: perl(Polymake::ConfigureStandalone) Provides: perl(Polymake::Core::RuleFilter) Provides: perl(Polymake::Core::ShellHelpers) Provides: perl(Polymake::Core::ShellMock) Provides: perl(Polymake::Namespaces) - -# These can be removed when Fedora 25 reaches EOL -Obsoletes: %{name}-devel < 3.0r2-5 -Provides: %{name}-devel = %{version}-%{release} +Provides: perl(Polymake::Test::Validation) # Don't expose private perl interfaces %global __provides_exclude perl\\\(Geomview.*\\\) @@ -132,6 +131,7 @@ Provides: %{name}-devel = %{version}-%{release} %global __provides_exclude %{__provides_exclude}|perl\\\(PerlIO.*\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(Postscript.*\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(Povray.*\\\) +%global __provides_exclude %{__provides_exclude}|perl\\\(Sage\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(Sketch.*\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(SplitsTree.*\\\) %global __provides_exclude %{__provides_exclude}|perl\\\(ThreeJS.*\\\) @@ -142,7 +142,6 @@ Provides: %{name}-devel = %{version}-%{release} # Exclude private perl interfaces that we don't Provide %global __requires_exclude perl\\\(Visual::Drawing\\\) -%global __requires_exclude %{__requires_exclude}|perl\\\(Polymake::Test::.*\\\) %global __requires_exclude %{__requires_exclude}|perl\\\(Polymake::file_utils\.pl\\\) %global __requires_exclude %{__requires_exclude}|perl\\\(Polymake::regex\.pl\\\) %global __requires_exclude %{__requires_exclude}|perl\\\(Polymake::utils\.pl\\\) @@ -184,7 +183,6 @@ This package contains documentation for %{name}. %patch0 -b .fedora %patch1 %patch2 -%patch3 fixtimestamp() { touch -r $1.orig $1 @@ -196,10 +194,6 @@ sed -i.orig "s|yal/||;s|symmetrygroupconstruction/||" \ bundled/sympol/apps/polytope/src/sympol_interface.cc fixtimestamp bundled/sympol/apps/polytope/src/sympol_interface.cc -# Turn off hardening flags derived from perl::Config. See above. -sed -e '/^\$LDsharedFlags=/a$LDsharedFlags =~ s/ -specs=\\S+//g;' \ - -i support/configure.pl - # Fix "error: -Wformat-security ignored without -Wformat" sed -i 's/ -Wno-format//' support/configure.pl @@ -208,17 +202,32 @@ sed -i.orig "/global variables/i\$ENV{'PATH'} = \"\$ENV{PATH}:%{_libdir}/4ti2/bi touch -r perl/polymake.orig perl/polymake rm perl/polymake.orig +# We do not want to use env +sed -i.orig 's,/usr/bin/env python3.*,/usr/bin/python3,' \ + resources/jupyter-polymake/setup.py +fixtimestamp resources/jupyter-polymake/setup.py + %ifarch %{arm} # The ARM builders almost always run out of memory while building polymake. # Reduce the optimization and debug levels for the problematic file in an # effort to avoid this. -sed -i '/Local Variables/irel_int_point$O : ExtraCXXFLAGS += -O1 -g1\n' \ - apps/polytope/src/Makefile.inc +cat > apps/polytope/build_flags.pl << EOF +# input for generate_ninja_targets.pl + +( 'rel_int_point.cc' => '-O1 -g', +) +EOF %endif +# Fix the path to xsubpp +sed -i 's,\${ExtUtils}/xsubpp,%{_bindir}/xsubpp,' support/rules.ninja + +# Build verbosely +sed -i 's,\${NINJA},& -v,' Makefile + %build export LC_ALL=C.UTF-8 -export CFLAGS="%{optflags} -I%{_includedir}/eigen3 -Wno-unused-local-typedefs -fno-delete-null-pointer-checks" +export CFLAGS="%{optflags} -I%{_includedir}/eigen3 -I%{_includedir}/nauty -Wno-unused-local-typedefs -fno-delete-null-pointer-checks" export CXXFLAGS="$CFLAGS" export LDFLAGS="$RPM_LD_FLAGS -Wl,--as-needed -ldl" if [ %{__isa_bits} = "32" ]; then @@ -231,10 +240,13 @@ export Arch=%{_arch} %if %{with singular} --with-singular=%{_prefix} \ %endif - --with-lrs-include=%{_includedir}/lrslib/ \ - --with-lrs-lib=%{_libdir} \ + --with-lrs=%{_prefix} \ --with-cdd-include=%{_includedir}/cddlib/ \ --with-cdd-lib=%{_libdir} \ + --with-permlib=%{_prefix} \ + --with-sympol-include=%{_includedir}/sympol/ \ + --with-sympol-lib=%{_libdir} \ + --with-nauty-src=%{_prefix} \ %if %{with jreality} --with-java=%{java_home} \ %else @@ -243,56 +255,43 @@ export Arch=%{_arch} --libexecdir=%{polydir} --without-javaview # No, really, we can't have the hardening flags on -sed -e 's| -Wl,-z,now||g' \ - -e 's| -specs=/usr/lib/rpm/redhat/redhat-hardened-ld||g' \ - -i build.%{_arch}/conf.make +sed -i 's| -Wl,-z,now -specs=.*redhat-hardened-ld||g' build.%{_arch}/config.ninja -# FIXME: infrequent failures with %%{?_smp_mflags} +# FIXME: infrequent failures with %%{?_smp_mflags}, plus memory is tight make all -# Help the debuginfo generator find generated files -cd build.%{_arch} -cp -p perlx-*linux-*/CPlusPlus.xxs lib/core/CPlusPlus.xxs -cp -p perlx-*linux-*/CPlusPlus.cc lib/core/CPlusPlus.cc -cp -p perlx-*linux-*/RuleGraph.xxs lib/core/RuleGraph.xxs -cp -p perlx-*linux-*/RuleGraph.cc lib/core/RuleGraph.cc -cp -p perlx-*linux-*/SchedulerHeap.xxs lib/core/SchedulerHeap.xxs -cp -p perlx-*linux-*/SchedulerHeap.cc lib/core/SchedulerHeap.cc - %install -# Don't recompile the main library with DESTDIR compiled in -sed -i "/conf\.make/d" support/corelib.make - -# The release-docs target copies docs to their installed locations export Arch=%{_arch} -make install release-docs DESTDIR=%{buildroot} +make install DESTDIR=%{buildroot} + +# Build the documentation +mkdir doc +ln -s build.%{_arch} build +perl/polymake --script generate_docs doc + +# Copy files, don't symlink to their position in the build directory +for fil in docstyle.css functions.js images style.css; do + rm -f doc/$fil + cp -a xml/documentation/$fil doc +done # Install the man page mkdir -p %{buildroot}%{_mandir}/man1 sed "s/@VERSION@/%{version}/" %{SOURCE1} > %{buildroot}%{_mandir}/man1/%{name}.1 touch -r %{SOURCE1} %{buildroot}%{_mandir}/man1/%{name}.1 -# We don't want the documentation in /usr/share/polymake -mv %{buildroot}%{_datadir}/%{name}/doc . - -# Remove stuff that shouldn't be installed -rm -fr %{buildroot}%{_datadir}/%{name}/apps/*/src \ - %{buildroot}%{polydir}/perlx/*/*/auto/Polymake/Ext/{.packlist,Ext.bs} -%if ! %{with jreality} -rm -fr %{buildroot}%{_datadir}/%{name}/java_build \ - %{buildroot}%{polydir}/lib/jreality -%endif +# Do not install app sources +rm -fr %{buildroot}%{_datadir}/%{name}/apps/*/src # Fix permissions chmod 0755 %{buildroot}%{_bindir}/* chmod 0755 %{buildroot}%{_libdir}/lib* +chmod 0755 %{buildroot}%{_datadir}/%{name}/resources/host-agent/bin/env +chmod 0755 %{buildroot}%{_datadir}/%{name}/resources/host-agent/server.pl +chmod 0755 %{buildroot}%{_datadir}/%{name}/resources/jupyter-polymake/setup.py +chmod 0755 %{buildroot}%{_datadir}/%{name}/resources/polymake-in-container.sh find %{buildroot}%{polydir} -name \*.so | xargs chmod 0755 -# Remove the buildroot from configuration files -for fil in %{buildroot}%{polydir}/bundled/*/conf.make; do - sed -i 's,%{buildroot},,' $fil -done - %ldconfig_scriptlets %files @@ -316,6 +315,12 @@ done %doc doc/* %changelog +* Sat Jun 2 2018 Jerry James - 3.2r3-1 +- New upstream version +- Drop upstreamed -lrs-system-fix and -gcc7 patches +- Add -no-hardening patch to fix FTBFS +- BR gmp-devel, ninja-build, perl(JSON), and permlib-devel + * Wed May 2 2018 Jerry James - 3.1-12 - Rebuild for perl 5.26.2 diff --git a/sources b/sources index edec019..4e0e8f9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (polymake-3.1.tar.bz2) = 51b72b605cd5654d1c8992c4125de01fcedd97685cf65dd50d9c3644960b16f9d3798257a10bf002a9568e92094ed9a034cd0652be44611f63431ca8eb428b7d +SHA512 (polymake-3.2r3.tar.bz2) = 4e135acb4dbbcae0d62b5dc58ab150d9e470a17dd6dd589a3aae63f263cb42255468e3fa0aa1e0e4e81a050438bee9989b17f53db01443d11eeb1755641501c8