Source: cadabra Version: 1.46-6 Tags: patch upstream User: helm...@debian.org Usertags: rebootstrap
cadabra fails to cross build from source. For some reason, it calls pkg-config from Makefile.in. Specifically, the wrong pkg-config after ./configure detected the right one and thus it uses the wrong flags after ./configure detected the right ones. Instead, the values detected by ./configure should be propagated to the relevant Makefiles. It also runs the wrong strip. Stripping is generally a bad idea, because it breaks DEB_BUILD_OPTIONS=nostrip as well as generating -dbgsym packages beyond breaking cross compilation. The attached patch fixes both and should be upstreamable. Please consider applying it. Helmut
--- cadabra-1.46.orig/src/Makefile.in +++ cadabra-1.46/src/Makefile.in @@ -1,5 +1,9 @@ MACTEST= @MAC_OS_X@ +modglue_CFLAGS = @modglue_CFLAGS@ +modglue_LIBS = @modglue_LIBS@ +sigc_CFLAGS = @sigc_CFLAGS@ +sigc_LIBS = @sigc_LIBS@ .PHONY: all tests modules @@ -21,7 +25,7 @@ #modules/xperm_no_nests.o SRCS = `find . -name "*.cc"` -MCFLAGS = @CFLAGS@ --std=c++11 -I. -I@top_srcdir@/src `pkg-config modglue --cflags` $(CPPFLAGS) +MCFLAGS = @CFLAGS@ --std=c++11 -I. -I@top_srcdir@/src $(modglue_CFLAGS) $(CPPFLAGS) TIMESTAMP = -D"RELEASE=\"${RELEASE}\"" -D"DATETIME=\"`dpkg-parsechangelog -l../debian/changelog -SDate`\"" -DHOSTNAME=\"debian\" @@ -42,10 +46,10 @@ ifeq ($(strip $(MACTEST)),) cadabra: $(OBJS) $(MOBJS) - @CXX@ -o cadabra ${LDFLAGS} -Wl,--as-needed $+ `pkg-config modglue --libs` -lgmpxx -lpcrecpp -lgmp + @CXX@ -o cadabra ${LDFLAGS} -Wl,--as-needed $+ $(modglue_LIBS) -lgmpxx -lpcrecpp -lgmp else cadabra: $(OBJS) $(MOBJS) - @CXX@ -o cadabra ${LDFLAGS} -Wl,-dead_strip_dylibs $+ `pkg-config modglue --libs` -lgmpxx -lpcrecpp -lgmp + @CXX@ -o cadabra ${LDFLAGS} -Wl,-dead_strip_dylibs $+ $(modglue_LIBS) -lgmpxx -lpcrecpp -lgmp endif #`pkg-config glib-2.0 --libs` @@ -55,13 +59,13 @@ rm -f main.o @CXX@ -Wall -g ${MCFLAGS} ${TIMESTAMP} -DSTATICBUILD -c -o main.o main.cc ifeq ($(strip $(MACTEST)),) - @CXX@ -o cadabra -static $+ ${LDFLAGS} `pkg-config modglue --libs` -lmodglue \ + @CXX@ -o cadabra -static $+ ${LDFLAGS} $(modglue_LIBS) \ -lgmpxx -lgmp -lpcrecpp -lpcre \ - `pkg-config sigc++-2.0 --libs` -lsigc-2.0 -lutil + $(sigc_LIBS) -lutil else export MACOSX_DEPLOYMENT_TARGET=10.3 - @CXX@ -o cadabra $+ ${LDFLAGS} `pkg-config modglue --libs` \ + @CXX@ -o cadabra $+ ${LDFLAGS} $(modglue_LIBS) \ -lgmp -lgmpxx -lpcre++ -lpcre -lexpect endif @@ -81,9 +85,9 @@ test_lie: test_lie.o modules/lie.o ifeq ($(strip $(MACTEST)),) - @CXX@ -o test_lie test_lie.o modules/lie.o `pkg-config --libs modglue` + @CXX@ -o test_lie test_lie.o modules/lie.o $(modglue_LIBS) else - @CXX@ -o test_lie test_lie.o modules/lie.o `pkg-config --libs modglue` + @CXX@ -o test_lie test_lie.o modules/lie.o $(modglue_LIBS) endif tree_regression_tests: tree_regression_tests.o @@ -146,9 +150,6 @@ # Installation and cleanup. install: -ifeq ($(strip $(MACTEST)),) - strip cadabra -endif # strip -S cadabra #endif @INSTALL@ -m 0755 -d ${DESTDIR}@prefix@/bin --- cadabra-1.46.orig/gui/Makefile.in +++ cadabra-1.46/gui/Makefile.in @@ -2,14 +2,20 @@ .PHONY: all MACTEST= @MAC_OS_X@ +modglue_CFLAGS = @modglue_CFLAGS@ +modglue_LIBS = @modglue_LIBS@ +gtkmm_CFLAGS = @gtkmm_CFLAGS@ +gtkmm_LIBS = @gtkmm_LIBS@ +pango_CFLAGS = @pango_CFLAGS@ +xmlpp_LIBS = @xmlpp_LIBS@ all: xcadabra static: xcadabra_static OBJS = help.o widgets.o window.o main.o ../src/stopwatch.o -CFLAGS = -O2 -I. -I@top_srcdir@/include `pkg-config modglue --cflags` `pkg-config --cflags gtkmm-2.4` \ - `pkg-config --cflags pango` $(CPPFLAGS) +CFLAGS = -O2 -I. -I@top_srcdir@/include $(modglue_CFLAGS) $(gtkmm_CFLAGS) \ + $(pango_CFLAGS) $(CPPFLAGS) SRCS = `find . -name "*.cc"` TIMESTAMP = -D"RELEASE=\"${RELEASE}\"" -D"DATETIME=\"`date | sed -e 's/ / /'`\"" -DHOSTNAME=\"`hostname`\" @@ -19,20 +25,17 @@ main.o: $(OBJS) Makefile xcadabra: $(OBJS) - @CXX@ -o xcadabra $+ `pkg-config modglue --libs` `pkg-config --libs gtkmm-2.4` -lpcrecpp $(LDFLAGS) $(CPPFLAGS) + @CXX@ -o xcadabra $+ $(modglue_LIBS) $(gtkmm_LIBS) -lpcrecpp $(LDFLAGS) $(CPPFLAGS) xcadabra_static: $(OBJS) - @CXX@ -o xcadabra -static $+ -L@prefix@/lib `pkg-config modglue --libs` \ - `pkg-config --libs gtkmm-2.4` `pkg-config libxml++-2.6` \ + @CXX@ -o xcadabra -static $+ -L@prefix@/lib $(modglue_LIBS) \ + $(gtkmm_LIBS) $(xmlpp_LIBS) \ -lpthread -lexpat $(LDFLAGS) test_texit: texit.o test_texit.o - @CXX@ -o test_texit `pkg-config modglue --libs` `pkg-config --libs gtkmm-2.4` $+ + @CXX@ -o test_texit $(modglue_LIBS) $(gtkmm_LIBS) $+ install: -ifeq ($(strip $(MACTEST)),) - strip xcadabra -endif install -d ${DESTDIR}@prefix@/bin install -m 0755 xcadabra ${DESTDIR}@prefix@/bin install -d ${DESTDIR}@prefix@/share/texmf/tex/latex/cadabra --- cadabra-1.46.orig/configure.in +++ cadabra-1.46/configure.in @@ -140,6 +140,9 @@ PKG_CHECK_MODULES([sigc], [sigc++-2.0]) PKG_CHECK_MODULES([modglue], [modglue]) +PKG_CHECK_MODULES([pango], [pango]) +PKG_CHECK_MODULES([gtkmm], [gtkmm-2.4]) +PKG_CHECK_MODULES([xmlpp], [libxml++-2.6],[true],[true]) if test "$check_runtime_dependencies" == "yes" then AC_CHECK_PROG(PTYWRAP, ptywrap, yes, no) if test "${PTYWRAP}" == "no"