[med-svn] [genometools] 01/08: use pkg-config for shared lib detection

Sascha Steinbiss sascha at steinbiss.name
Tue Mar 8 01:11:27 UTC 2016


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

sascha-guest pushed a commit to branch master
in repository genometools.

commit 793e425871dd01fc3a0c4ea0e0023a459120acaf
Author: Sascha Steinbiss <sascha at steinbiss.name>
Date:   Mon Mar 7 22:44:08 2016 +0000

    use pkg-config for shared lib detection
---
 debian/changelog             |   7 ++
 debian/patches/adding_soname |   6 +-
 debian/patches/libbam-fix    |   8 +-
 debian/patches/series        |   1 +
 debian/patches/use-mx32      |   2 +-
 debian/patches/use-pkgconfig | 244 +++++++++++++++++++++++++++++++++++++++++++
 debian/rules                 |   2 +
 7 files changed, 262 insertions(+), 8 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 9ea08c1..3262281 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+genometools (1.5.8-3) UNRELEASED; urgency=medium
+
+  * Make sure external headers are used for compilation.
+    Thanks to Justus Winter for the patch.
+
+ -- Sascha Steinbiss <sascha at steinbiss.name>  Wed, 02 Mar 2016 15:43:46 +0000
+
 genometools (1.5.8-2) unstable; urgency=medium
 
   * Document migration to Git in d/control
diff --git a/debian/patches/adding_soname b/debian/patches/adding_soname
index 5a30100..091e3e5 100644
--- a/debian/patches/adding_soname
+++ b/debian/patches/adding_soname
@@ -5,7 +5,7 @@ Description: add soname to linker call in Makefile
 Author: Sascha Steinbiss <steinbiss at zbh.uni-hamburg.de>
 --- a/Makefile
 +++ b/Makefile
-@@ -105,6 +105,7 @@
+@@ -137,6 +137,7 @@
    SHARED_OBJ_NAME_EXT:=.so
    SHARED:=-shared
  endif
@@ -13,7 +13,7 @@ Author: Sascha Steinbiss <steinbiss at zbh.uni-hamburg.de>
  
  # compiled executables
  GTMAIN_SRC:=src/gt.c src/gtr.c src/gtt.c src/interactive.c
-@@ -585,8 +586,9 @@
+@@ -618,8 +619,9 @@
  	@echo "[link $(@F)]"
  	@test -d $(@D) || mkdir -p $(@D)
  	@$(CC) $(EXP_LDFLAGS) $(VERSION_SCRIPT_PARAM) \
@@ -25,7 +25,7 @@ Author: Sascha Steinbiss <steinbiss at zbh.uni-hamburg.de>
  
  define PROGRAM_template
  $(1): $(2)
-@@ -944,7 +946,8 @@
+@@ -986,7 +988,8 @@
  	$(RANLIB) $(prefix)/lib/libgenometools.a
  endif
  ifneq ($(sharedlib),no)
diff --git a/debian/patches/libbam-fix b/debian/patches/libbam-fix
index 6d09fdf..fb2b2b9 100644
--- a/debian/patches/libbam-fix
+++ b/debian/patches/libbam-fix
@@ -5,7 +5,7 @@ Author: Sascha Steinbiss <steinbiss at zbh.uni-hamburg.de>
 
 --- a/Makefile
 +++ b/Makefile
-@@ -195,7 +195,7 @@
+@@ -228,7 +228,7 @@
  # add necessary shared lib dependencies then not building them ourselves
  ifeq ($(useshared),yes)
    DEPLIBS:=-lbz2 -lz -lexpat -llua5.1-lpeg -llua5.1 -llua5.1-md5 \
@@ -14,7 +14,7 @@ Author: Sascha Steinbiss <steinbiss at zbh.uni-hamburg.de>
  else
    DEPLIBS:=
  endif
-@@ -564,6 +564,10 @@
+@@ -597,6 +597,10 @@
  	@$(RANLIB) $@
  endif
  
@@ -25,7 +25,7 @@ Author: Sascha Steinbiss <steinbiss at zbh.uni-hamburg.de>
  lib/libgenometools.a: obj/gt_config.h  $(LIBGENOMETOOLS_OBJ)
  	@echo "[link $(@F)]"
  	@test -d $(@D) || mkdir -p $(@D)
-@@ -582,13 +586,14 @@
+@@ -615,13 +619,14 @@
                                            $(LIBGENOMETOOLS_OBJ) \
                                            $(ADDITIONAL_SO_DEPS) \
                                            $(ADDITIONAL_ZLIBS) \
@@ -41,7 +41,7 @@ Author: Sascha Steinbiss <steinbiss at zbh.uni-hamburg.de>
  
  define PROGRAM_template
  $(1): $(2)
-@@ -601,46 +606,55 @@
+@@ -634,46 +639,55 @@
  
  $(eval $(call PROGRAM_template, bin/gt, $(GTMAIN_OBJ) $(TOOLS_OBJ) \
                                          lib/libgenometools.a \
diff --git a/debian/patches/series b/debian/patches/series
index 692e2de..47c4757 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,5 +1,6 @@
 spelling
 remove_png_timestamps
+use-pkgconfig
 adding_soname
 libbam-fix
 remove-gitignores
diff --git a/debian/patches/use-mx32 b/debian/patches/use-mx32
index dc922a2..005b988 100644
--- a/debian/patches/use-mx32
+++ b/debian/patches/use-mx32
@@ -1,7 +1,7 @@
 Description: Use mx32
 --- a/Makefile
 +++ b/Makefile
-@@ -327,17 +327,19 @@
+@@ -360,17 +360,19 @@
    endif
  endif
  
diff --git a/debian/patches/use-pkgconfig b/debian/patches/use-pkgconfig
new file mode 100644
index 0000000..5a55300
--- /dev/null
+++ b/debian/patches/use-pkgconfig
@@ -0,0 +1,244 @@
+From afaed82084071e9d11663b7ce593fa83e6eabbe5 Mon Sep 17 00:00:00 2001
+From: Justus Winter <justus at gnupg.org>
+Date: Fri, 19 Feb 2016 14:06:41 +0100
+Subject: [PATCH 1/6] Makefile: Drop spurious '$(3)'
+
+* Makefile: Drop spurious '$(3)', likely a left-over from copying
+'COMPILE_template'.
+---
+ Makefile | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/Makefile
++++ b/Makefile
+@@ -16,17 +16,7 @@
+ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ #
+ 
+-INCLUDEOPT:=-I$(CURDIR)/src -I$(CURDIR)/obj \
+-            -I$(CURDIR)/src/external/zlib-1.2.8 \
+-            -I$(CURDIR)/src/external/md5-1.1.2/src \
+-            -I$(CURDIR)/src/external/lua-5.1.5/src \
+-            -I$(CURDIR)/src/external/luafilesystem-1.5.0/src \
+-            -I$(CURDIR)/src/external/lpeg-0.10.2 \
+-            -I$(CURDIR)/src/external/expat-2.0.1/lib \
+-            -I$(CURDIR)/src/external/bzip2-1.0.6 \
+-            -I$(CURDIR)/src/external/samtools-0.1.18 \
+-            -I$(CURDIR)/src/external/sqlite-3.8.7.1 \
+-            -I$(CURDIR)/src/external/tre/include/tre
++INCLUDEOPT:=-I$(CURDIR)/src -I$(CURDIR)/obj
+ 
+ ifeq ($(shell pkg-config --version > /dev/null 2> /dev/null; echo $$?),0)
+   HAS_PKGCONFIG:=yes
+@@ -37,6 +27,48 @@
+   HAS_PKGCONFIG:=no
+ endif
+ 
++# add necessary shared lib dependencies instead of building them ourselves
++ifeq ($(useshared),yes)
++  ifeq ($(HAS_PKGCONFIG),yes)
++    DEPLIBS:=-lbz2 \
++             $(shell $(OVERRIDE_PC_PATH) pkg-config --libs zlib) \
++             $(shell $(OVERRIDE_PC_PATH) pkg-config --libs expat) \
++             $(shell $(OVERRIDE_PC_PATH) pkg-config --libs lua-5.1) \
++             $(shell $(OVERRIDE_PC_PATH) pkg-config --libs lua5.1-lpeg) \
++             $(shell $(OVERRIDE_PC_PATH) pkg-config --libs lua5.1-md5) \
++             $(shell $(OVERRIDE_PC_PATH) pkg-config --libs lua5.1-filesystem) \
++             $(shell $(OVERRIDE_PC_PATH) pkg-config --libs lua5.1-des56) \
++             -lbam \
++             $(shell $(OVERRIDE_PC_PATH) pkg-config --libs tre) \
++             -lm -lpthread
++    INCLUDEOPT+=$(shell $(OVERRIDE_PC_PATH) pkg-config --cflags zlib) \
++                $(shell $(OVERRIDE_PC_PATH) pkg-config --cflags expat) \
++                $(shell $(OVERRIDE_PC_PATH) pkg-config --cflags lua-5.1) \
++                $(shell $(OVERRIDE_PC_PATH) pkg-config --cflags lua5.1-lpeg) \
++                $(shell $(OVERRIDE_PC_PATH) pkg-config --cflags lua5.1-md5) \
++                $(shell $(OVERRIDE_PC_PATH) pkg-config --cflags lua5.1-filesystem) \
++                $(shell $(OVERRIDE_PC_PATH) pkg-config --cflags lua5.1-des56) \
++                $(shell $(OVERRIDE_PC_PATH) pkg-config --cflags tre)
++  else
++    # Requested the use of shared libraries without having pkg-config.
++    # You are on your own.  Good luck.
++    DEPLIBS:=-lbz2 -lz -lexpat -llua5.1-lpeg -llua5.1 -llua5.1-md5 \
++             -llua5.1-filesystem -llua5.1-des56 -lbam -ltre -lm -lpthread
++  endif
++else
++  DEPLIBS:=
++  INCLUDEOPT+=-I$(CURDIR)/src/external/zlib-1.2.8 \
++              -I$(CURDIR)/src/external/md5-1.1.2/src \
++              -I$(CURDIR)/src/external/lua-5.1.5/src \
++              -I$(CURDIR)/src/external/luafilesystem-1.5.0/src \
++              -I$(CURDIR)/src/external/lpeg-0.10.2 \
++              -I$(CURDIR)/src/external/expat-2.0.1/lib \
++              -I$(CURDIR)/src/external/bzip2-1.0.6 \
++              -I$(CURDIR)/src/external/samtools-0.1.18 \
++              -I$(CURDIR)/src/external/sqlite-3.8.7.1 \
++              -I$(CURDIR)/src/external/tre/include
++endif
++
+ ifneq ($(cairo),no)
+   # XXX: check for existence of packages, and emit warning and disable cairo
+   # if packages are not available
+@@ -125,6 +157,7 @@
+ LIBEXPAT_DEP:=$(LIBEXPAT_SRC:%.c=obj/%.d)
+ 
+ TRE_DIR:=src/external/tre/lib
++TRE_CPPFLAGS=-I$(CURDIR)/src/external/tre/include/tre
+ LIBTRE_SRC:=$(TRE_DIR)/regcomp.c $(TRE_DIR)/regerror.c $(TRE_DIR)/regexec.c \
+             $(TRE_DIR)/tre-ast.c $(TRE_DIR)/tre-compile.c \
+             $(TRE_DIR)/tre-filter.c $(TRE_DIR)/tre-match-backtrack.c \
+@@ -743,6 +776,15 @@
+ 	@$(CC) -c $< -o $(@:.o=.d) -DHAVE_MALLOC_USABLE_SIZE $(EXP_CPPFLAGS) \
+ 	  $(GT_CPPFLAGS) $(3) -MM -MP -MT $@ $(FPIC)
+ 
++# TRE needs special attention
++obj/$(TRE_DIR)/%.o: $(TRE_DIR)/%.c
++	$(V_ECHO) "[compile $(@F)]"
++	$(V_DO)test -d $(@D) || mkdir -p $(@D)
++	$(V_DO)$(CC) -c $< -o $@ $(EXP_CPPFLAGS) \
++	  $(GT_CPPFLAGS) $(EXP_CFLAGS) $(TRE_CPPFLAGS) $(FPIC)
++	$(V_DO)$(CC) -c $< -o $(@:.o=.d) $(EXP_CPPFLAGS) \
++	  $(GT_CPPFLAGS)  $(TRE_CPPFLAGS) -MM -MP -MT $@ $(FPIC)
++
+ define COMPILE_template
+ $(1): $(2)
+ 	@echo "[compile $$(@F)]"
+@@ -1001,10 +1043,10 @@
+ 	src_check src/ltr/*
+ 
+ splintclean:
+-	find obj -name '*.splint' | xargs rm -f
++	find obj -name '*.splint' -delete
+ 
+ sbclean:
+-	find obj -name '*.sb' | xargs rm -f
++	find obj -name '*.sb' -delete
+ 
+ obj/%.sb: src/match/%.c
+ 	@echo "scan-build $<"
+@@ -1070,7 +1112,7 @@
+ headercheck:${ALLHEADER}
+ 
+ headerclean:
+-	find obj -name '*.check' | xargs rm -f
++	find obj -name '*.check' -delete
+ 
+ obj/%.check: ${CURDIR}/src/match/%.h
+ 	@echo "check include $<"
+@@ -1139,7 +1181,7 @@
+ 
+ clean:
+ 	rm -rf lib
+-	find obj -name '*.o' |xargs rm -f
++	find obj -name '*.o' -delete
+ 	rm -f obj/amalgamation.c
+ 	rm -rf testsuite/stest_testsuite testsuite/stest_stest_tests
+ 	$(MAKE) -s -C $(CURDIR)/doc/devguide clean
+--- a/src/core/grep.c
++++ b/src/core/grep.c
+@@ -23,7 +23,7 @@
+ #include "core/ma.h"
+ #include "core/str.h"
+ #include "core/unused_api.h"
+-#include "tre.h"
++#include <tre/tre.h>
+ 
+ static void grep_error(int errcode, regex_t *matcher, GtError *err)
+ {
+--- a/src/extended/rcr.c
++++ b/src/extended/rcr.c
+@@ -48,7 +48,7 @@
+ #include "extended/sam_alignment.h"
+ #include "extended/sam_query_name_iterator.h"
+ #include "extended/samfile_iterator.h"
+-#include "sam.h"
++#include <samtools/sam.h>
+ 
+ #define BAMBASEA 1
+ #define BAMBASEC 2
+--- a/src/extended/sam_alignment.c
++++ b/src/extended/sam_alignment.c
+@@ -16,7 +16,7 @@
+   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+ 
+-#include <sam.h>
++#include <samtools/sam.h>
+ #include "core/alphabet_api.h"
+ #include "core/ensure.h"
+ #include "core/ma_api.h"
+--- a/src/extended/sam_alignment_rep.h
++++ b/src/extended/sam_alignment_rep.h
+@@ -23,7 +23,7 @@
+ /* The contents of this file is to be considered private implementation detail.
+ */
+ 
+-#include <sam.h>
++#include <samtools/sam.h>
+ #include "core/alphabet_api.h"
+ 
+ struct GtSamAlignment{
+--- a/src/extended/samfile_iterator.c
++++ b/src/extended/samfile_iterator.c
+@@ -15,7 +15,7 @@
+   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+ 
+-#include <sam.h>
++#include <samtools/sam.h>
+ #include "core/cstr_api.h"
+ #include "core/ensure.h"
+ #include "core/error_api.h"
+--- /dev/null
++++ b/src/external/lpeg-0.10.2/lua-lpeg.h
+@@ -0,0 +1,39 @@
++/*
++** $Id: lpeg.h,v 1.1 2009/12/23 16:15:36 roberto Exp $
++** LPeg - PEG pattern matching for Lua
++** Copyright 2009, Lua.org & PUC-Rio  (see 'lpeg.html' for license)
++** written by Roberto Ierusalimschy
++*/
++
++#ifndef lpeg_h
++#define lpeg_h
++
++#include "lua.h"
++
++int luaopen_lpeg (lua_State *L);
++
++#define KEYNEWPATT	"lpeg.newpf"
++
++
++/*
++** type of extension functions that define new "patterns" for LPEG
++** It should return the new current position or NULL if match fails
++*/
++typedef const char *(*PattFunc) (const char *s,  /* current position */
++                                 const char *e,  /* string end */
++                                 const char *o,  /* string start */
++                                 const void *ud);  /* user data */
++
++/*
++** function to create new patterns based on 'PattFunc' functions.
++** This function is available at *registry[KEYNEWPATT]. (Notice
++** the extra indirection; the userdata at the registry points to
++** a variable that points to the function. In ANSI C a void* cannot
++** point to a function.)
++*/
++typedef void (*Newpf) (lua_State *L,
++                       PattFunc f,  /* pattern */
++                       const void *ud,  /* (user) data to be passed to 'f' */
++                       size_t l);  /* size of data to be passed to 'f' */
++
++#endif
+--- a/src/gtr.c
++++ b/src/gtr.c
+@@ -24,7 +24,7 @@
+ #include "lauxlib.h"
+ #include "lualib.h"
+ #include "lfs.h"
+-#include "lpeg.h"
++#include "lua-lpeg.h"
+ #include "md5.h"
+ #include "ldes56.h"
+ #include "core/compat.h"
diff --git a/debian/rules b/debian/rules
index 6234ade..8a4f38e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -31,6 +31,7 @@ endif
 	dh $@ --with python2
 
 override_dh_auto_clean:
+	mkdir obj
 	$(MAKE) cleanup
 	cd doc/manuals; $(MAKE) cleanup
 	# should be deleted inside doc/manuals/Makefile
@@ -50,6 +51,7 @@ override_dh_auto_clean:
 	      www/genometools.org/htdocs/libgenometools.html \
 	      www/genometools.org/htdocs/tools/gt.html
 	rm -rf gtpython/build
+	rm -rf obj
 
 override_dh_auto_build:
 	$(FAKETIME) dh_auto_build -- useshared=yes x32=$(X32) 64bit=$(64BIT) errorcheck=no all docs manuals

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/genometools.git



More information about the debian-med-commit mailing list