[magics] 02/03: * Additional reproducibility: drop build paths fron config files * Add libMagPlus{Single, Double}.* back to Magics * Fix cmake so that its multi-arch safe, gives right results for metview

Alastair McKinstry mckinstry at moszumanska.debian.org
Thu Jul 23 06:16:21 UTC 2015


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

mckinstry pushed a commit to branch debian/master
in repository magics.

commit 046446a5222b3de8723ec75e7bef27f3c577261d
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Mon Jul 20 06:59:37 2015 +0100

    * Additional reproducibility: drop build paths fron config files
    * Add libMagPlus{Single,Double}.* back to Magics
    * Fix cmake so that its multi-arch safe, gives right results for metview
---
 debian/changelog                     |  7 +++-
 debian/control                       |  3 +-
 debian/libmagics++-dev.install       |  5 +--
 debian/libmagics++-dev.links.in      |  3 ++
 debian/libmagplus3.install           |  2 -
 debian/libmagplus3.install.in        |  1 +
 debian/libmagplus3.links.in          |  3 ++
 debian/magics++.install              |  8 +++-
 debian/patches/cmake-config.patch    | 13 +++++++
 debian/patches/drop-timestamps.patch | 26 -------------
 debian/patches/metview_fixes.patch   | 17 ---------
 debian/patches/reproducibility.patch | 72 ++++++++++++++++++++++++++++++++++++
 debian/patches/series                |  5 +--
 debian/rules                         | 63 ++++++++++++-------------------
 14 files changed, 132 insertions(+), 96 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 72933b4..54269b4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,11 @@
-magics++ (2.24.7-2) UNRELEASED; urgency=medium
+magics++ (2.24.7-2) unstable; urgency=medium
 
   * Drop timestamps from headers. Closes: #792824. 
+  * Add magics++ to dependencies for libmagics++-dev, add metgramx etc
+    as required by magics-config.cmake for metview
+  * Undo fixes from debian/rules for previously broken builds in 2.24.4
+  * Move cmake files to /usr/lib/$ARCH/cmake as arch-dependent,
+    and adjust paths in cmake files vi debian/rules
 
  -- Alastair McKinstry <mckinstry at debian.org>  Mon, 20 Jul 2015 01:57:50 +0100
 
diff --git a/debian/control b/debian/control
index d1f9b53..ee5b564 100644
--- a/debian/control
+++ b/debian/control
@@ -3,6 +3,7 @@ Section: science
 Priority: optional
 Maintainer: Alastair McKinstry <mckinstry at debian.org>
 Build-Depends: debhelper  (>= 9) , dh-buildinfo, gfortran, cmake, chrpath,
+ dh-python,
  libhdf5-serial-dev | libhdf5-dev, libnetcdf-dev, 
  libgl1-mesa-dev, libgd2-dev, 
  libemos-dev, 
@@ -45,7 +46,7 @@ Package: libmagics++-dev
 Section: libdevel
 Architecture: any
 Multi-Arch: same
-Depends: libmagplus3 ( = ${binary:Version} ), ${misc:Depends}, ${python:Depends}, libterralib-dev
+Depends: libmagplus3 ( = ${binary:Version} ), ${misc:Depends}, ${python:Depends}, libterralib-dev, magics++
 Recommends: pkg-config
 Description: Development files for ECMWF  plotting software MAGICS++
  Magics++ is the latest generation of the ECMWF's Meteorological plotting
diff --git a/debian/libmagics++-dev.install b/debian/libmagics++-dev.install
index b0b00e8..cd8abc3 100644
--- a/debian/libmagics++-dev.install
+++ b/debian/libmagics++-dev.install
@@ -1,9 +1,6 @@
-#debian/tmp/usr/lib/*/libMagPlusSingle.a 
-#debian/tmp/usr/lib/*/libMagPlusDouble.a 
-#debian/tmp/usr/lib/*/libMagPlus.a 
 debian/tmp/usr/include/magics usr/include
 debian/tmp/usr/bin/magics-config usr/bin
 debian/tmp/usr/lib/*/pkgconfig/magics.pc 
 debian/tmp/usr/bin/magicsCompatibilityChecker usr/bin
-
+debian/tmp/usr/lib/*/cmake
 
diff --git a/debian/libmagics++-dev.links.in b/debian/libmagics++-dev.links.in
new file mode 100644
index 0000000..c4978d9
--- /dev/null
+++ b/debian/libmagics++-dev.links.in
@@ -0,0 +1,3 @@
+/usr/lib/@ARCH@/libMagPlus.so.3.0.0  /usr/lib/@ARCH@/libMagPlus.so
+/usr/lib/@ARCH@/libMagPlusSingle.so.3.0.0 /usr/lib/@ARCH@/libMagPlusSingle.so
+/usr/lib/@ARCH@/libMagPlusDouble.so.3.0.0 /usr/lib/@ARCH@/libMagPlusDouble.so
diff --git a/debian/libmagplus3.install b/debian/libmagplus3.install
deleted file mode 100644
index e88ebb5..0000000
--- a/debian/libmagplus3.install
+++ /dev/null
@@ -1,2 +0,0 @@
-debian/tmp/usr/lib/*/libMagPlus.so.3.0.0
-# debian/tmp/usr/lib/*/libMagPlusQt.so.3.0.0 
diff --git a/debian/libmagplus3.install.in b/debian/libmagplus3.install.in
new file mode 100644
index 0000000..b191ff6
--- /dev/null
+++ b/debian/libmagplus3.install.in
@@ -0,0 +1 @@
+debian/tmp/usr/lib/libMagPlus*.so.3.0.0 /usr/lib/@ARCH@/
diff --git a/debian/libmagplus3.links.in b/debian/libmagplus3.links.in
new file mode 100644
index 0000000..c2c3cd9
--- /dev/null
+++ b/debian/libmagplus3.links.in
@@ -0,0 +1,3 @@
+/usr/lib/@ARCH@/libMagPlus.so.3.0.0  /usr/lib/@ARCH@/libMagPlus.so.3
+/usr/lib/@ARCH@/libMagPlusSingle.so.3.0.0 /usr/lib/@ARCH@/libMagPlusSingle.so.3
+/usr/lib/@ARCH@/libMagPlusDouble.so.3.0.0 /usr/lib/@ARCH@/libMagPlusDouble.so.3
diff --git a/debian/magics++.install b/debian/magics++.install
index f1722eb..6a769dd 100644
--- a/debian/magics++.install
+++ b/debian/magics++.install
@@ -1,3 +1,7 @@
 usr/bin/magjson  
-usr/bin/magmlx  
-# usr/bin/mapgen_clip
+usr/bin/magmlx
+usr/bin/magml
+usr/bin/magjsonx
+usr/bin/metgram
+usr/bin/metgramx
+tools/mapgen_clip usr/bin
diff --git a/debian/patches/cmake-config.patch b/debian/patches/cmake-config.patch
new file mode 100644
index 0000000..7c8d327
--- /dev/null
+++ b/debian/patches/cmake-config.patch
@@ -0,0 +1,13 @@
+Index: magics++-2.24.7/cmake/project-config.cmake.in
+===================================================================
+--- magics++-2.24.7.orig/cmake/project-config.cmake.in
++++ magics++-2.24.7/cmake/project-config.cmake.in
+@@ -17,7 +17,7 @@
+ 
+ get_filename_component(@PNAME at _CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+ 
+-set( @PNAME at _SELF_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@" )
++set( MAGICS_SELF_INCLUDE_DIRS "/usr/include/magics" )
+ set( @PNAME at _SELF_DEFINITIONS  "@CONF_DEFINITIONS@" )
+ set( @PNAME at _SELF_LIBRARIES    "@CONF_LIBRARIES@" )
+ 
diff --git a/debian/patches/drop-timestamps.patch b/debian/patches/drop-timestamps.patch
deleted file mode 100644
index a793189..0000000
--- a/debian/patches/drop-timestamps.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-Author: Alastair McKinstry <mckinstry at debian.org>
-Description: Don't put timestamps into header files.
-Bugs-Debian: https://bugs.debian.org/792824
-Last-Updated: 2015-07-20
-Forwarded: no
-
-Index: magics++-2.24.7/tools/xml2cc_new.pl
-===================================================================
---- magics++-2.24.7.orig/tools/xml2cc_new.pl
-+++ magics++-2.24.7/tools/xml2cc_new.pl
-@@ -164,7 +164,6 @@ foreach my $object (keys %{$info->{magic
-     This file is automatically generated.
-     Do Not Edit!
- 
--    Generated: $string
- */
-    
- 
-@@ -339,7 +338,6 @@ EOF
-     This file is automatically generated.
-     Do Not Edit!
-    
--    Generated: $string
- */    
- 
- #include "$object\Attributes.h"
diff --git a/debian/patches/metview_fixes.patch b/debian/patches/metview_fixes.patch
deleted file mode 100644
index fe53b59..0000000
--- a/debian/patches/metview_fixes.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Author: Alastair McKinstry <mckinstry at debian.org>
-Description: Link MagPlusQt.so against libdrivers, libMagPlus to resolve symbols
-Last-Updated: 2015-05-14
-Forwarded: not-needed
-
-Index: magics++-2.18.15/src/drivers/Makefile.am
-===================================================================
---- magics++-2.18.15.orig/src/drivers/Makefile.am	2013-12-14 13:56:56.000000000 +0000
-+++ magics++-2.18.15/src/drivers/Makefile.am	2013-12-14 14:00:13.000000000 +0000
-@@ -99,6 +99,7 @@
- libMagPlusQt_la_LDFLAGS		= $(QT_LIBS) -version-info $(MAGICS_LIBRARY_CURRENT):$(MAGICS_LIBRARY_REVISION):$(MAGICS_LIBRARY_AGE)
- libMagPlusQt_la_SOURCES		= $(QT_la_S)
- AM_CPPFLAGS 			+= -I$(METVIEW_HOME)/src/libUtil -I$(top_srcdir)/src/drivers/MgQ $(QT_CPPFLAGS)
-+libMagPlusQt_la_LIBADD		= libMagPlus.la libdrivers.la
- endif
- 
- BUILT_SOURCES	= $(QT_la_built)
diff --git a/debian/patches/reproducibility.patch b/debian/patches/reproducibility.patch
new file mode 100644
index 0000000..64495d7
--- /dev/null
+++ b/debian/patches/reproducibility.patch
@@ -0,0 +1,72 @@
+Author: Alastair McKinstry <mckinstry at debian.org>
+Description: Bit-identntical reproducibility fixes:
+ * Don't put timestamps into header files.
+ * Don't include random build path in config file.
+Bugs-Debian: https://bugs.debian.org/792824
+Last-Updated: 2015-07-20
+Forwarded: no
+
+Index: magics++-2.24.7/tools/xml2cc_new.pl
+===================================================================
+--- magics++-2.24.7.orig/tools/xml2cc_new.pl
++++ magics++-2.24.7/tools/xml2cc_new.pl
+@@ -164,7 +164,6 @@ foreach my $object (keys %{$info->{magic
+     This file is automatically generated.
+     Do Not Edit!
+ 
+-    Generated: $string
+ */
+    
+ 
+@@ -339,7 +338,6 @@ EOF
+     This file is automatically generated.
+     Do Not Edit!
+    
+-    Generated: $string
+ */    
+ 
+ #include "$object\Attributes.h"
+Index: magics++-2.24.7/cmake/project-config.cmake.in
+===================================================================
+--- magics++-2.24.7.orig/cmake/project-config.cmake.in
++++ magics++-2.24.7/cmake/project-config.cmake.in
+@@ -59,13 +59,7 @@ endif()
+ 
+ if( NOT @PROJECT_NAME at _BINARY_DIR )
+ 
+-	set( IS_BUILD_DIR_EXPORT @_is_build_dir_export@ )
+-
+-	if( IS_BUILD_DIR_EXPORT )
+-		include( "@TOP_PROJECT_TARGETS_FILE@" OPTIONAL )
+-	else()
+ 		include( "${@PNAME at _CMAKE_DIR}/@CMAKE_PROJECT_NAME at -targets.cmake" )
+-	endif()
+ 
+ endif()
+ 
+Index: magics++-2.24.7/tools/xml2cc.pl
+===================================================================
+--- magics++-2.24.7.orig/tools/xml2cc.pl
++++ magics++-2.24.7/tools/xml2cc.pl
+@@ -152,7 +152,7 @@ EOF
+     my $includes = {};
+     my @impl=split(/\//, $current->{attributes}->{implements});
+     my @interfaces = (split(/\//, $current->{attributes}->{interface}), @impl);
+-    foreach $i (@impl) 
++    foreach $i (sort(@impl))
+     {
+         
+         print "#include \"$i.h\"\n";
+Index: magics++-2.24.7/tools/xml2mv.pl
+===================================================================
+--- magics++-2.24.7.orig/tools/xml2mv.pl
++++ magics++-2.24.7/tools/xml2mv.pl
+@@ -180,7 +180,7 @@ my $includes = {};
+        $includes->{$to} = "find" unless $basetype{$to} || $to eq 'Colour' ;
+     }
+     
+-    foreach my $include (keys %{$includes} ) 
++    foreach my $include (sort(keys %{$includes} ))
+     {
+           print "#include \"$include\Wrapper.h\"\n"; 
+     }
diff --git a/debian/patches/series b/debian/patches/series
index f375483..ad57c0b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,4 +1,3 @@
-# metview_fixes.patch
 cve-2010-3393.patch
 terralib.patch
 gcc-4.7.patch
@@ -8,5 +7,5 @@ geotiff.patch
 soname-version.patch
 # qt5.patch
 grib-cmake.patch 
-drop-timestamps.patch
-
+reproducibility.patch
+cmake-config.patch
diff --git a/debian/rules b/debian/rules
index 99643f3..6f81ef9 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,7 +6,8 @@ BUILDDIR = $(CURDIR)/debian/build
 # DEB_BUILD_MAINT_OPTIONS:= hardening=+all,-pie
 CXXFLAGS:= -fPIC $(shell dpkg-buildflags --get CXXFLAGS)
 DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
-
+LIBDIR=/usr/lib/$(DEB_HOST_MULTIARCH)
+AUTOGENERATED:= libmagplus3.links libmagics++-dev.links libmagplus3.install
 # Uncomment this to turn on verbose mode.
 # export DH_VERBOSE=1
 export QT_SELECT=4
@@ -57,7 +58,7 @@ export extra_flags += \
 	-DENABLE_LARGE_FILE_SUPPORT=ON \
 	-DENABLE_PYTHON=ON \
 	-DBUILD_EXAMPLES=ON \
-        -DBUILD_SHARED_LIBS=ON \
+	-DBUILD_SHARED_LIBS=ON \
 	-DENABLE_TESTS=OFF \
 	-DENABLE_RPATHS=OFF \
 	-DENABLE_CAIRO=ON \
@@ -71,14 +72,10 @@ export extra_flags += \
 export LD_LIBRARY_PATH:=$(CURDIR)/debian/tmp/usr/lib:$(LD_LIBRARY_PATH)
 
 override_dh_auto_clean:
-	find . -type l -exec rm {} \;
-	find . \( -name '*.pyc' -o -name '*.o' -o -name '*.a' \)  -exec rm {} \;
-	find . -name '.libs' -exec rm -rf {} \;  || echo ".libs deleted already."
-	find test \( -name '*.ps' -o -name '*.pdf' -o -name '*.svg' -o -name '*.png' \
-	       -o -name '*.kmz' \)  -exec rm  {} \;
-	rm -f config.log src/params/*.h src/decoders/*Attributes.h
+	find . -type l -delete
+	rm -f src/params/*.h src/decoders/*Attributes.h
 	rm -rf share/magics/ttf src/terralib debian/build
-	$(MAKE) -k distclean || echo "Already distcleaned"
+	rm -f $(patsubst %, debian/%, ${AUTOGENERATED})
 
 override_dh_auto_configure:
 	# link for font for tesing.
@@ -86,20 +83,10 @@ override_dh_auto_configure:
 	ln -sf /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf share/fonts/truetype/ttf-dejavu/
 	# Link terralib
 	[ -e src/terralib ] || ln -sf  /usr/include/terralib src/terralib
+	for f in ${AUTOGENERATED} ; do \
+                sed -e 's%@ARCH@%${DEB_HOST_MULTIARCH}%g' < debian/$$f.in  > debian/$$f ; \
+                done
 	dh_auto_configure -- $(extra_flags)
-	# Some files are not autogenerated properly, do it here:
-	./tools/xml2cc_new.pl ./src/params/GribDecoder.xml > ./src/decoders/GribDecoderAttributes.h
-	./tools/xml2cc_new.pl ./src/params/GribLoop.xml > ./src/decoders/GribLoopAttributes.h
-	./tools/xml2cc_new.pl ./src/params/QtDriver.xml > ./src/params/QtDriverAttributes.h
-	./tools/xml2cc_new.pl ./src/params/GDDriver.xml > ./src/params/GDDriverAttributes.h
-	./tools/xml2mv.pl ./src/params/DateGribLoopStep.xml > ./src/params/DateGribLoopStepWrapper.h
-	./tools/xml2mv.pl ./src/params/GribLoopStep.xml > ./src/params/GribLoopStepWrapper.h
-	./tools/xml2mv.pl ./src/params/GribAddressMode.xml > ./src/params/GribAddressModeWrapper.h
-	./tools/xml2mv.pl ./src/params/GribAddressRecordMode.xml > ./src/params/GribAddressRecordModeWrapper.h
-	./tools/xml2mv.pl ./src/params/GribAddressByteMode.xml > ./src/params/GribAddressByteModeWrapper.h
-	cp ./src/params/*.h $(BUILDDIR)/src/params
-	cp ./src/decoders/*Attributes.h $(BUILDDIR)/src/decoders
-	cp ./src/decoders/*Attributes.h $(BUILDDIR)/src/params
 	(cd python/Magics && ln -s $(BUILDDIR)/python/Magics/Magics.i )
 
 override_dh_auto_test check:
@@ -107,26 +94,22 @@ override_dh_auto_test check:
 	# (ulimit -s 8192; export PYTHONPATH=$(shell pwd)/swig ; export MAGPLUS_HOME=$(shell pwd) ; $(MAKE) check )
 
 override_dh_auto_install:
-	# call configure to rebuild swig/Makefile with correct python version.
-# 			LDFLAGS="-fPIC $(LDFLAGS) -L$(shell pwd)/src/.libs -Wl,--as-needed" ; 
 	$(MAKE) -C debian/build/python/Magics clean install PYTHON_INCLUDE_DIR=/usr/include/python2.7 \
 			DESTDIR=$(CURDIR)/debian/python-magics++ \ MAGPLUS_HOME=$(CURDIR) 
 	dh_auto_install
-	mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)
-	cp -a debian/tmp/usr/lib/*.a debian/tmp/usr/lib/pkgconfig debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)
-	cp debian/tmp/usr/lib/libMagPlus.so debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libMagPlus.so.3.0.0
-	# cp tools/mapgen_clip debian/tmp/usr/bin
-	find debian -name '*.la' -delete
-	find debian -name '_Magics.so.0' -delete  # Bogus symlinks
-	# dh_python2
+	# Move lib stuff
+	mkdir -p debian/tmp/$(LIBDIR)
+	cp -a debian/tmp/usr/lib/*.a debian/tmp/usr/lib/pkgconfig debian/tmp/$(LIBDIR)
+	cp debian/tmp/usr/lib/libMagPlus.so debian/tmp/$(LIBDIR)/libMagPlus.so.3.0.0
+	# Fixup the cmake files.
+	mkdir -p debian/tmp/$(LIBDIR)/cmake/magics
+	cp -a debian/tmp/usr/share/magics/cmake/* debian/tmp/$(LIBDIR)/cmake/magics
+	sed -e 's%$${_IMPORT_PREFIX}/lib%$(LIBDIR)%' \
+		< debian/tmp/usr/share/magics/cmake/magics-targets-none.cmake \
+	| sed -e 's%$${_IMPORT_PREFIX}/bin%/usr/bin%' \
+		> debian/tmp/$(LIBDIR)/cmake/magics/magics-targets-none.cmake
+	rm -r debian/tmp/usr/share/magics/cmake
 	dh_python2 /usr/lib/python2.7/site-packages/Magics
 	dh_numpy -p python-magics++
-	# remove fonts that are present in dejavu-ttf
-	rm -rf debian/libmagics++-data/usr/share/magics/ttf
-	find debian -name '*.so*' -exec chrpath -d {} \;
-	find debian -name magmlx -exec chrpath -d {} \;
-	# Deal with links for Multi-Arch:
-	dh_link -p libmagics++-dev /usr/lib/$(DEB_HOST_MULTIARCH)/libMagPlus.so.3.0.0    /usr/lib/$(DEB_HOST_MULTIARCH)/libMagPlus.so
-	dh_link -p libmagplus3     /usr/lib/$(DEB_HOST_MULTIARCH)/libMagPlus.so.3.0.0    /usr/lib/$(DEB_HOST_MULTIARCH)/libMagPlus.so.3
-	mkdir -p debian/libmagics++-dev/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig
-	find debian -name '*.la' -delete 
+	find debian/tmp debian/python-magics++  -name '*.so*' -exec chrpath -d {} \;
+	find debian/tmp/usr/bin -type f  -exec chrpath -d {} \;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/magics.git



More information about the debian-science-commits mailing list