Add MTK patches

- Add MTK alignment patch
- Disable things like introspection
- Lintian fixes

Change-Id: I7570da621d40a79109ea7abda031bdce51e55817
diff --git a/debian/changelog b/debian/changelog
index 62e2401..1fce05d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+gstreamer1.0 (1.10.4-1+mtk) mendel-chef; urgency=medium
+
+  * Add MTK patches
+
+ -- Coral <coral-support@google.com>  Thu, 08 Aug 2019 11:22:00 -0700
+
 gstreamer1.0 (1.10.4-1) unstable; urgency=medium
 
   * New upstream bugfix release
diff --git a/debian/control b/debian/control
index f9d0992..b62db90 100644
--- a/debian/control
+++ b/debian/control
@@ -6,7 +6,7 @@
            Sebastien Bacher <seb128@debian.org>,
            Sebastian Dröge <slomo@debian.org>,
            Sjoerd Simons <sjoerd@debian.org>
-Build-Depends: debhelper (>= 9),
+Build-Depends: debhelper (>= 10),
                cdbs (>= 0.4.93~),
                gnome-pkg-tools (>= 0.7),
                autotools-dev,
@@ -23,25 +23,9 @@
                bison (>= 1:2.4),
                flex (>= 2.5.34),
                dpkg-dev (>= 1.15.1),
-               perl-doc,
-               libgirepository1.0-dev (>= 0.9.12-4~),
-               gobject-introspection (>= 0.9.12-4~),
-               gir1.2-glib-2.0,
-               gir1.2-freedesktop,
+               perl-doc:all,
                libcap-dev [linux-any]
-Build-Depends-Indep: python (>= 2.2),
-                     gtk-doc-tools (>= 1.12),
-                     texlive-generic-recommended,
-                     transfig (>= 3.2.3.c),
-                     docbook-utils (>= 0.6.9),
-                     docbook-xml,
-                     docbook-xsl,
-                     xsltproc (>= 1.0.21),
-                     ghostscript,
-                     xmlto,
-                     netpbm,
-                     libglib2.0-doc
-Standards-Version: 3.9.3
+Standards-Version: 3.9.8
 Homepage: http://gstreamer.freedesktop.org
 
 Package: libgstreamer1.0-0
@@ -92,8 +76,7 @@
          pkg-config,
          libglib2.0-dev,
          ${shlibs:Depends},
-         ${misc:Depends},
-         gir1.2-gstreamer-1.0 (= ${binary:Version})
+         ${misc:Depends}
 Recommends: debhelper
 Suggests: gstreamer1.0-doc
 Description: GStreamer core development files
@@ -146,24 +129,3 @@
  .
  This package contains versioned command-line tools for GStreamer.
 
-Package: gir1.2-gstreamer-1.0
-Section: introspection
-Architecture: any
-Depends: ${gir:Depends},
-         ${shlibs:Depends},
-         ${misc:Depends},
-         ${gir:Depends}
-Description: GObject introspection data for the GStreamer library
- This package contains introspection data for the GStreamer streaming media
- framework.
- .
- GStreamer is a streaming media framework, based on graphs of filters
- which operate on media data.  Applications using this library can do
- anything from real-time sound processing to playing videos, and just
- about anything else media-related.  Its plugin-based architecture means
- that new data types or processing capabilities can be added simply by
- installing new plug-ins.
- .
- It can be used by packages using the GIRepository format to generate
- dynamic bindings.
-
diff --git a/debian/gstreamer1.0-doc.lintian-overrides b/debian/gstreamer1.0-doc.lintian-overrides
new file mode 100644
index 0000000..da7ac57
--- /dev/null
+++ b/debian/gstreamer1.0-doc.lintian-overrides
@@ -0,0 +1 @@
+gstreamer1.0-doc: doc-base-file-references-missing-file *
diff --git a/debian/gstreamer1.0-tools.lintian-overrides b/debian/gstreamer1.0-tools.lintian-overrides
new file mode 100644
index 0000000..82a1081
--- /dev/null
+++ b/debian/gstreamer1.0-tools.lintian-overrides
@@ -0,0 +1 @@
+gstreamer1.0-tools: manpage-has-errors-from-man *
diff --git a/debian/libgstreamer-dev.install b/debian/libgstreamer-dev.install
index 1f7959f..d6d0b15 100644
--- a/debian/libgstreamer-dev.install
+++ b/debian/libgstreamer-dev.install
@@ -2,7 +2,6 @@
 debian/tmp/usr/lib/*/*.so
 debian/tmp/usr/lib/*/pkgconfig
 debian/tmp/usr/share/aclocal
-debian/tmp/usr/share/gir-*
 debian/tmp/usr/bin/gst-codec-info-@GST_ABI@
 debian/dh_gstscancodecs usr/bin
 debian/tmp/usr/share/man/man1/dh_gstscancodecs.1
diff --git a/debian/libgstreamer1.0-0.lintian-overrides b/debian/libgstreamer1.0-0.lintian-overrides
new file mode 100644
index 0000000..a893d3d
--- /dev/null
+++ b/debian/libgstreamer1.0-0.lintian-overrides
@@ -0,0 +1 @@
+libgstreamer1.0-0: package-name-doesnt-match-sonames *
diff --git a/debian/libgstreamer1.0-dev.lintian-overrides b/debian/libgstreamer1.0-dev.lintian-overrides
new file mode 100644
index 0000000..72c5743
--- /dev/null
+++ b/debian/libgstreamer1.0-dev.lintian-overrides
@@ -0,0 +1 @@
+libgstreamer1.0-dev: manpage-has-bad-whatis-entry *
diff --git a/debian/patches/0001-mtk.patch b/debian/patches/0001-mtk.patch
new file mode 100644
index 0000000..208ab09
--- /dev/null
+++ b/debian/patches/0001-mtk.patch
@@ -0,0 +1,17 @@
+diff --git a/gst/gstallocator.c b/gst/gstallocator.c
+index 367fc2a9..ee78caf1 100644
+--- a/gst/gstallocator.c
++++ b/gst/gstallocator.c
+@@ -591,6 +591,12 @@ _priv_gst_allocator_initialize (void)
+   GST_CAT_DEBUG (GST_CAT_MEMORY, "memory alignment: %" G_GSIZE_FORMAT,
+       gst_memory_alignment);
+ 
++  if (gst_memory_alignment < 127) {
++    gst_memory_alignment = 127;
++  }
++  GST_CAT_DEBUG (GST_CAT_MEMORY, "Adjusted memory alignment: %" G_GSIZE_FORMAT,
++      gst_memory_alignment);
++
+   _sysmem_allocator = g_object_new (gst_allocator_sysmem_get_type (), NULL);
+ 
+   gst_allocator_register (GST_ALLOCATOR_SYSMEM,
diff --git a/debian/patches/series b/debian/patches/series
index e69de29..5a5022b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -0,0 +1 @@
+0001-mtk.patch
diff --git a/debian/rules b/debian/rules
index 688a171..b87f00a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,6 +8,7 @@
 
 export HOME=$(CURDIR)/fake-home
 
+DEB_BUILD_PARALLEL = 1
 DEB_DH_AUTORECONF_ARGS += --as-needed
 
 CFLAGS += -Wno-error
@@ -57,34 +58,9 @@
 	debian/$(gst_pkgname)-tools.install \
 	debian/$(gst_pkgname)-tools.links \
 	debian/$(gst_pkgname)-tools.manpages \
-	debian/gir1.2-gstreamer-$(gst_abi).install
 
-# Let's decide the package name and url depending on the distribution
-DISTRO = "$(shell dpkg-vendor --query vendor)"
 
-GST_PACKAGE_NAME := "GStreamer (unknown Debian derivative)"
-GST_PACKAGE_ORIGIN="http://packages.qa.debian.org/gstreamer$(gst_abi)"
-
-ifeq ($(DISTRO),"Debian")
-GST_PACKAGE_NAME := "GStreamer (Debian)"
-GST_PACKAGE_ORIGIN="http://packages.qa.debian.org/gstreamer$(gst_abi)"
-endif
-
-ifeq ($(DISTRO),"Ubuntu")
-GST_PACKAGE_NAME := "GStreamer (Ubuntu)"
-GST_PACKAGE_ORIGIN="https://launchpad.net/distros/ubuntu/+source/gstreamer$(gst_abi)"
-endif
-
-debian/control:: debian/control.in debian/rules
-	rm -f $@
-	cat $< | \
-		sed 's/@GST_VERSION@/$(gst_version)/g' | \
-		sed 's/@GST_PKGNAME@/$(gst_pkgname)/g' | \
-		sed 's/@GST_ABI@/$(gst_abi)/g' | \
-		sed 's/@GST_LIB_PREFIX@/$(gst_lib_prefix)/g' | \
-		sed 's/@GST_LIB@/$(gst_lib)/g' | \
-		sed 's/@GST_LIB_DEV@/$(gst_lib_dev)/g' \
-		> $@
+GST_PACKAGE_NAME := "GStreamer"
 
 debian/$(gst_lib).dirs: debian/libgstreamer.dirs debian/rules
 	rm -f $@
@@ -113,10 +89,6 @@
 		sed 's/@GST_ABI@/$(gst_abi)/g' \
 		> $@
 
-debian/gir1.2-gstreamer-$(gst_abi).install: debian/gir1.2-gstreamer.install debian/rules
-	rm -f $@
-	cp -v $< $@
-
 debian/$(gst_lib_dev).install: debian/libgstreamer-dev.install debian/rules
 	rm -f $@
 	cat $< | \
@@ -204,7 +176,7 @@
 	--libdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) \
 	--libexecdir=\$${prefix}/lib/$(DEB_HOST_MULTIARCH)/gstreamer$(gst_abi) \
 	--with-package-name=$(GST_PACKAGE_NAME) \
-	--with-package-origin=$(GST_PACKAGE_ORIGIN)
+
 
 ifeq ($(DEB_HOST_ARCH_OS),linux)
 common_conf_flags += --with-ptp-helper-permissions=capabilities
@@ -241,7 +213,7 @@
 DEB_SHLIBDEPS_INCLUDE += debian/$(gst_lib)/usr/lib/$(DEB_HOST_MULTIARCH)
 
 install/$(gst_lib_dev)::
-	gcc -o debian/tmp/usr/bin/gst-codec-info-1.0 debian/gst-codec-info.c $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `pkg-config --libs --cflags glib-2.0 gthread-2.0 gmodule-no-export-2.0 gobject-2.0` debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libgstreamer-1.0.so -Idebian/tmp/usr/include/gstreamer-1.0 -Idebian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/gstreamer-1.0/include
+	$(DEB_HOST_GNU_TYPE)-gcc -o debian/tmp/usr/bin/gst-codec-info-1.0 debian/gst-codec-info.c $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) `$(DEB_HOST_GNU_TYPE)-pkg-config --libs --cflags glib-2.0 gthread-2.0 gmodule-no-export-2.0 gobject-2.0` debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libgstreamer-1.0.so -Idebian/tmp/usr/include/gstreamer-1.0 -Idebian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/gstreamer-1.0/include
 	perldoc -o man debian/dh_gstscancodecs > debian/tmp/usr/share/man/man1/dh_gstscancodecs.1
 
 .PHONY: maint