Control: tags -1 + patch

    - Make libfreetype6-dev M-A: same.
    - Error out on the use of the freetype-config --libtool option.
    - Don't add multiarch libdirs for freetype-config --libs.
    - Install the freetype2/freetype/config headers into the multiarch
      include path and provide an arch-independent header in /usr/include.

The approach here is to make the freetype-config binary architecture independent (from your point of view, it's obsolete anyway), and error out on the --libs option. The alternative would be to split out this binary into it's own package libfreetype6-bin.

The solution for the header ensures that the header is still found in the arch-independent include dir, and that you don't need to specify a second include dir.
    - Make libfreetype6-dev M-A: same.
    - Error out on the use of the freetype-config --libtool option.
    - Don't add multiarch libdirs for freetype-config --libs.
    - Install the freetype2/freetype/config headers into the multiarch
      include path and provide an arch-independent header in /usr/include.

diff -pruN 2.6.3-3/debian/control 2.6.3-3ubuntu1/debian/control
--- 2.6.3-3/debian/control	2016-04-28 20:08:35.000000000 +0000
+++ 2.6.3-3ubuntu1/debian/control	2016-04-28 20:08:36.000000000 +0000
@@ -48,6 +49,7 @@ Description: FreeType 2 font engine, sha
 
 Package: libfreetype6-dev
 Architecture: any
+Multi-Arch: same
 Section: libdevel
 Depends: libfreetype6 (= ${binary:Version}), libc6-dev | libc-dev, zlib1g-dev | libz-dev, libpng-dev, ${misc:Depends}
 Description: FreeType 2 font engine, development files
diff -pruN 2.6.3-3/debian/multiarch.h.in 2.6.3-3ubuntu1/debian/multiarch.h.in
--- 2.6.3-3/debian/multiarch.h.in	1970-01-01 00:00:00.000000000 +0000
+++ 2.6.3-3ubuntu1/debian/multiarch.h.in	2016-04-28 20:08:36.000000000 +0000
@@ -0,0 +1,79 @@
+#if defined(__linux__)
+# if defined(__x86_64__) && defined(__LP64__)
+#  include <x86_64-linux-gnu/@subdir@/@header@>
+# elif defined(__x86_64__) && defined(__ILP32__)
+#  include <x86_64-linux-gnux32/@subdir@/@header@>
+# elif defined(__i386__)
+#  include <i386-linux-gnu/@subdir@/@header@>
+# elif defined(__aarch64__) && defined(__AARCH64EL__)
+#  include <aarch64-linux-gnu/@subdir@/@header@>
+# elif defined(__alpha__)
+#  include <alpha-linux-gnu/@subdir@/@header@>
+# elif defined(__ARM_EABI__) && defined(__ARM_PCS_VFP)
+#  include <arm-linux-gnueabihf/@subdir@/@header@>
+# elif defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP)
+#  include <arm-linux-gnueabi/@subdir@/@header@>
+# elif defined(__hppa__)
+#  include <hppa-linux-gnu/@subdir@/@header@>
+# elif defined(__ia64__)
+#  include <ia64-linux-gnu/@subdir@/@header@>
+# elif defined(__m68k__) && !defined(__mcoldfire__)
+#  include <m68k-linux-gnu/@subdir@/@header@>
+# elif defined(__mips_hard_float) && defined(_MIPSEL)
+#  if _MIPS_SIM == _ABIO32
+#   include <mipsel-linux-gnu/@subdir@/@header@>
+#  elif _MIPS_SIM == _ABIN32
+#   include <mips64el-linux-gnuabin32/@subdir@/@header@>
+#  elif _MIPS_SIM == _ABI64
+#   include <mips64el-linux-gnuabi64/@subdir@/@header@>
+#  else
+#   error unknown multiarch location for @header@
+#  endif
+# elif defined(__mips_hard_float)
+#  if _MIPS_SIM == _ABIO32
+#   include <mips-linux-gnu/@subdir@/@header@>
+#  elif _MIPS_SIM == _ABIN32
+#   include <mips64-linux-gnuabin32/@subdir@/@header@>
+#  elif _MIPS_SIM == _ABI64
+#   include <mips64-linux-gnuabi64/@subdir@/@header@>
+#  else
+#   error unknown multiarch location for @header@
+#  endif
+# elif defined(__or1k__)
+#  include <or1k-linux-gnu/@subdir@/@header@>
+# elif defined(__powerpc__) && defined(__SPE__)
+#  include <powerpc-linux-gnuspe/@subdir@/@header@>
+# elif defined(__powerpc64__)
+#  if defined(__LITTLE_ENDIAN__)
+#    include <powerpc64le-linux-gnu/@subdir@/@header@>
+#  else
+#    include <powerpc64-linux-gnu/@subdir@/@header@>
+#  endif
+# elif defined(__powerpc__)
+#  include <powerpc-linux-gnu/@subdir@/@header@>
+# elif defined(__s390x__)
+#  include <s390x-linux-gnu/@subdir@/@header@>
+# elif defined(__s390__)
+#  include <s390-linux-gnu/@subdir@/@header@>
+# elif defined(__sh__) && defined(__LITTLE_ENDIAN__)
+#  include <sh4-linux-gnu/@subdir@/@header@>
+# elif defined(__sparc__) && defined(__arch64__)
+#  include <sparc64-linux-gnu/@subdir@/@header@>
+# elif defined(__sparc__)
+#  include <sparc-linux-gnu/@subdir@/@header@>
+# else
+#   error unknown multiarch location for @header@
+# endif
+#elif defined(__FreeBSD_kernel__)
+# if defined(__LP64__)
+#  include <x86_64-kfreebsd-gnu/@subdir@/@header@>
+# elif defined(__i386__)
+#  include <i386-kfreebsd-gnu/@subdir@/@header@>
+# else
+#   error unknown multiarch location for @header@
+# endif
+#elif defined(__gnu_hurd__)
+# include <i386-gnu/@subdir@/@header@>
+#else
+# error unknown multiarch location for @header@
+#endif
diff -pruN 2.6.3-3/debian/patches-freetype/freetype-config.diff 2.6.3-3ubuntu1/debian/patches-freetype/freetype-config.diff
--- 2.6.3-3/debian/patches-freetype/freetype-config.diff	1970-01-01 00:00:00.000000000 +0000
+++ 2.6.3-3ubuntu1/debian/patches-freetype/freetype-config.diff	2016-04-28 20:08:36.000000000 +0000
@@ -0,0 +1,35 @@
+Index: freetype-2.6.1/builds/unix/freetype-config.in
+===================================================================
+--- freetype-2.6.1.orig/builds/unix/freetype-config.in	2016-02-17 10:26:16.681010303 -0500
++++ freetype-2.6.1/builds/unix/freetype-config.in	2016-02-17 10:27:26.377806639 -0500
+@@ -16,7 +16,6 @@
+ exec_prefix="%exec_prefix%"
+ exec_prefix_set="no"
+ includedir="%includedir%"
+-libdir="%libdir%"
+ 
+ usage()
+ {
+@@ -88,6 +87,8 @@
+     ;;
+   --libtool)
+     echo_libtool=yes
++    echo 2>&1 "the use of the libfreetype6.la file is deprecated in Debian/Ubuntu"
++    exit 1
+     ;;
+   --static)
+     show_static=yes
+@@ -145,12 +146,7 @@
+   if test "$show_static" = "yes" ; then
+     libs="$staticlibs"
+   fi
+-  if test "${SYSROOT}$libdir" != "/usr/lib"  &&
+-     test "${SYSROOT}$libdir" != "/usr/lib64"; then
+-    echo -L${SYSROOT}$libdir $libs
+-  else
+-    echo $libs
+-  fi
++  echo $libs
+ fi
+ 
+ if test "$echo_libtool" = "yes" ; then
diff -pruN 2.6.3-3/debian/patches-freetype/series 2.6.3-3ubuntu1/debian/patches-freetype/series
--- 2.6.3-3/debian/patches-freetype/series	2016-04-28 20:08:35.000000000 +0000
+++ 2.6.3-3ubuntu1/debian/patches-freetype/series	2016-04-28 20:08:36.000000000 +0000
@@ -1,5 +1,7 @@
+0001-Revert-pcf-Signedness-fixes.patch
 no-uninitialized-bbox.patch
 freetype-2.1.7-backwards.compat.patch -p0
 enable-subpixel-rendering.patch
 enable-gxvalid-otvalid.patch
 verbose-libtool.patch
+freetype-config.diff
diff -pruN 2.6.3-3/debian/rules 2.6.3-3ubuntu1/debian/rules
--- 2.6.3-3/debian/rules	2016-04-28 20:08:35.000000000 +0000
+++ 2.6.3-3ubuntu1/debian/rules	2016-04-28 20:08:36.000000000 +0000
@@ -96,6 +96,14 @@ ifneq (,$(filter $(demospkg), $(shell dh
 		$(CURDIR)/debian/$(demospkg)/usr/bin/
 endif
 	sed -i -e'/dependency_libs/s/'.*'//' debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libfreetype.la
+	mkdir -p debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/freetype2/freetype/config
+	set -e; \
+	for i in debian/tmp/usr/include/freetype2/freetype/config/*.h; do \
+	  mv $$i debian/tmp/usr/include/$(DEB_HOST_MULTIARCH)/freetype2/freetype/config/.; \
+	  sed "s,@subdir@,freetype2/freetype/config,;s,@header@,$$(basename $$i)," \
+		debian/multiarch.h.in > $$i; \
+	done
+
 
 override_dh_install:
 	dh_install --fail-missing

Reply via email to