[libmarpa-r2-perl] 03/07: Add patch 2001 to avoid internally build or link against libmarpa.

Jonas Smedegaard dr at jones.dk
Thu Jun 26 20:37:17 UTC 2014


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libmarpa-r2-perl.

commit 930748c0a4cf212ba7ffdb8abc9242733459668c
Author: Jonas Smedegaard <dr at jones.dk>
Date:   Thu Jun 26 20:59:38 2014 +0200

    Add patch 2001 to avoid internally build or link against libmarpa.
---
 debian/copyright                                   |  4 +
 .../patches/2001_libmarpa_external_linkage.patch   | 90 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 debian/rules                                       |  3 +-
 4 files changed, 96 insertions(+), 2 deletions(-)

diff --git a/debian/copyright b/debian/copyright
index 0a06032..03939f6 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -73,6 +73,10 @@ Files: debian/*
 Copyright: 2014, Jonas Smedegaard <dr at jones.dk>
 License: GPL-3+
 
+Files: debian/patches/*
+Copyright: 2014, Jonas Smedegaard <dr at jones.dk>
+License: LGPL-3+~Marpa
+
 License: LGPL-3+~Marpa
  This file is part of Marpa::R2.  Marpa::R2 is free software: you can
  redistribute it and/or modify it under the terms of the GNU Lesser
diff --git a/debian/patches/2001_libmarpa_external_linkage.patch b/debian/patches/2001_libmarpa_external_linkage.patch
new file mode 100644
index 0000000..274068f
--- /dev/null
+++ b/debian/patches/2001_libmarpa_external_linkage.patch
@@ -0,0 +1,90 @@
+Description: avoid internally build or link against libmarpa
+ Adapt build routines for Marpa::R2 build to treat libmarpa as an
+ independent library.
+ .
+ By default, libmarpa is expected to be already compiled as a static
+ library (i.e. passing "--with-pic --disable-shared" to configure, with
+ root directory as build directory.
+ .
+ Alternatively when build and test actions has "--libmarpa-shared=1" and
+ install action has "--libmarpa-shared", libmarpa is instead expected to
+ exist as a shared library (patched to not use -release versioning) at a
+ common ldconfig path (or overridden with LD_LIBRARY_PATH).
+Author: Jonas Smedegaard <dr at jones.dk>
+Last-Update: 2014-06-26
+License: Same as Marpa::R2 code
+
+--- a/inc/Marpa/R2/Build_Me.pm
++++ b/inc/Marpa/R2/Build_Me.pm
+@@ -249,7 +249,7 @@
+     # .c -> .o
+     my $v = $self->dist_version;
+     $self->verbose() and say "compiling $spec->{c_file}";
+-    my @new_ccflags = ( '-I', $libmarpa_build_dir, '-I', 'xs' );
++    my @new_ccflags = ( '-I', 'libmarpa_dist', '-I', 'xs' );
+ 
+     if ( $self->config('ccname') eq 'gcc' ) {
+         ## -W instead of -Wextra is case the GCC is pre 3.0.0
+@@ -284,31 +284,11 @@
+     my @extra_linker_flags = ();
+     my $libmarpa_build_directory = File::Spec->catdir(
+         $self->base_dir(),
+-        (   defined $self->args('libmarpa-shared')
+-            ? 'libmarpa_shared'
+-            : 'libmarpa_build'
+-        )
+     );
+ 
+     if ( defined $self->args('libmarpa-shared') ) {
+-        my $libmarpa_libs_dir;
+-        if ($Marpa::R2::USE_PERL_AUTOCONF) {
+-            $libmarpa_libs_dir =
+-                File::Spec->catdir( $libmarpa_build_directory,
+-                qw(blib_shared arch auto libmarpa) );
+-        }
+-        else {
+-            $libmarpa_libs_dir =
+-                File::Spec->catdir( $libmarpa_build_directory, '.libs' );
+-        }
+-        push @extra_linker_flags, '-L' . $libmarpa_libs_dir;
+-        my $version_file_name =
+-            File::Spec->catfile( $libmarpa_build_directory, 'LIB_VERSION' );
+-        my $libmarpa_version = $self->file_slurp($version_file_name);
+-        chomp $libmarpa_version;
+-        my @libmarpa_version = split /[.]/xms, $libmarpa_version;
+         push @extra_linker_flags,
+-            sprintf q{-lmarpa-} . ( join q{.}, @libmarpa_version );
++            q{-lmarpa};
+     } ## end if ( defined $self->args('libmarpa-shared') )
+     else {
+         my $libmarpa_archive;
+@@ -843,11 +823,6 @@
+             qw(pperl Marpa R2 Perl Version.pm) );
+     } ## end if ( not $self->up_to_date( [ $config_pm_filename, ...]))
+ 
+-    $self->do_libmarpa();
+-
+-    if ( defined $self->args('libmarpa-shared') ) {
+-        $self->blib('blib_shared');
+-    }
+     return $self->SUPER::ACTION_code;
+ } ## end sub ACTION_code
+ 
+--- a/libmarpa_dist/Makefile.am
++++ b/libmarpa_dist/Makefile.am
+@@ -17,7 +17,6 @@
+ 
+ AM_CFLAGS = $(WARNING_CFLAGS) $(MARPA_DEBUG_FLAG)
+ AM_CPPFLAGS = $(WARNING_CPPFLAGS)
+-RELEASE= $(MARPA_LIB_MAJOR_VERSION).$(MARPA_LIB_MINOR_VERSION).$(MARPA_LIB_MICRO_VERSION)
+ ACLOCAL_AMFLAGS = -I m4
+ lib_LTLIBRARIES = libmarpa.la
+ libmarpa_la_SOURCES = marpa.c marpa.h \
+@@ -30,7 +29,6 @@
+   win32/marpa.def Makefile.win32 win32/do_config_h.pl \
+   notes/shared_test.txt
+ libmarpa_la_LIBADD = $(LIBOBJS)
+-libmarpa_la_LDFLAGS = -release $(RELEASE)
+ include_HEADERS = marpa.h \
+   marpa_avl.h marpa_tavl.h marpa_ami.h \
+   marpa_slif.h marpa_obs.h
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..b3141a4
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+2001_libmarpa_external_linkage.patch
diff --git a/debian/rules b/debian/rules
index 043cea3..e4b6cb1 100755
--- a/debian/rules
+++ b/debian/rules
@@ -54,6 +54,7 @@ CDBS_BUILD_DEPENDS +=, $(bdeps), $(deps), $(deps-test), $(deps-test-opt)
 CDBS_DEPENDS_$(pkg) = $(deps)
 
 # put aside upstream-shipped autogenerated files and (re)generate during build
+basedir = libmarpa_dist
 makefiledirs = .
 files_autoconf_modern = $(auxdir)/compile
 DEB_UPSTREAM_CRUFT_MOVE = $(filter-out $(files_autoconf_modern),\
@@ -62,7 +63,6 @@ DEB_UPSTREAM_CRUFT_COPY = libmarpa_dist/LIB_VERSION
 makefile-clean::
 	rm -f $(files_autoconf_modern)
 # TODO: move below to CDBS autotools.mk snippet (if indeed generic)
-basedir = libmarpa_dist
 auxdir = $(basedir)
 macrodir = $(basedir)/m4
 autom4tedir = $(basedir)/autom4te.cache
@@ -90,7 +90,6 @@ clean::
 	test ! -d $(auxdir) || rmdir --ignore-fail-on-non-empty $(auxdir)
 
 # Use custom sourcedir for autotools (re)generation and make build
-#debian/stamp-autotools-files: DEB_SRCDIR = $(basedir)
 DEB_SRCDIR = $(basedir)
 DEB_PERL_SRCDIR = .
 DEB_BUILDDIR = .

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmarpa-r2-perl.git



More information about the Pkg-perl-cvs-commits mailing list