Migrate weston/wayland-protocols out of here

- Remove the debian metadata for the packages. They're re-homed to new
repos.
- Remove all the rules from gpu.mk, replace with macro evaluations in
packages.mk

Change-Id: I0e27f6d689191ea8561840299762ebd75815b558
diff --git a/gpu.mk b/gpu.mk
index 726ae07..b79d230 100644
--- a/gpu.mk
+++ b/gpu.mk
@@ -4,40 +4,13 @@
 
 include $(ROOTDIR)/build/preamble.mk
 
-WAYLAND_PROTO_DIR := $(PRODUCT_OUT)/obj/WAYLAND_PROTO
-WESTON_DIR := $(PRODUCT_OUT)/obj/WESTON
 LIBDRM_DIR := $(PRODUCT_OUT)/obj/LIBDRM
 LIBDRM_DEBS := libdrm2_2.4.84+imx-0_arm64.deb libdrm-vivante_2.4.84+imx-0_arm64.deb
 LIBDRM_DEBS_DEV := libdrm-dev_2.4.84+imx-0_arm64.deb
 LIBDRM_TARGETS := $(addprefix $(PRODUCT_OUT)/, $(LIBDRM_DEBS)) $(addprefix $(PRODUCT_OUT)/dev/, $(LIBDRM_DEBS_DEV))
 
-wayland-protocols: $(PRODUCT_OUT)/wayland-protocols-imx_1.13-0_all.deb
-weston: $(PRODUCT_OUT)/weston-imx_3.0.0-0_arm64.deb
 libdrm-imx: $(LIBDRM_TARGETS)
-gpu-packages: weston wayland-protocols imx-gpu-viv libdrm-imx
-
-$(PRODUCT_OUT)/weston-imx_3.0.0-0_arm64.deb: $(ROOTDIR)/cache/arm64-builder.tar $(PRODUCT_OUT)/wayland-protocols-imx_1.13-0_all.deb
-	mkdir -p $(WESTON_DIR)/weston-imx-3.0.0
-	cp -r $(ROOTDIR)/weston-imx/* $(WESTON_DIR)/weston-imx-3.0.0
-	mkdir -p $(WESTON_DIR)/weston-imx-3.0.0/lib/systemd/system
-	cp $(ROOTDIR)/build/weston.service $(WESTON_DIR)/weston-imx-3.0.0/lib/systemd/system
-	tar -C $(WESTON_DIR) -cJf $(WESTON_DIR)/weston-imx_3.0.0.orig.tar.xz weston-imx-3.0.0
-	cp -r $(ROOTDIR)/build/weston-imx-debian $(WESTON_DIR)/weston-imx-3.0.0/debian
-	docker load -i $(ROOTDIR)/cache/arm64-builder.tar
-	docker run --rm --privileged --tty \
-	  -v $(PRODUCT_OUT):/out \
-	  -v $(WESTON_DIR):/weston arm64-builder \
-	  /bin/bash -c 'dpkg -i /out/wayland-protocols-imx_1.13-0_all.deb; \
-		cd /weston/weston-imx-3.0.0; dpkg-buildpackage -uc -us -tc'
-	mv $(WESTON_DIR)/weston-imx_3.0.0-0_arm64.deb $(PRODUCT_OUT)
-
-$(PRODUCT_OUT)/wayland-protocols-imx_1.13-0_all.deb:
-	mkdir -p $(WAYLAND_PROTO_DIR)/wayland-protocols-imx-1.13
-	cp -r $(ROOTDIR)/wayland-protocols-imx/* $(WAYLAND_PROTO_DIR)/wayland-protocols-imx-1.13
-	tar -C $(WAYLAND_PROTO_DIR) -cJf $(WAYLAND_PROTO_DIR)/wayland-protocols-imx_1.13.orig.tar.xz wayland-protocols-imx-1.13
-	cp -r $(ROOTDIR)/build/wayland-protocols-imx-debian $(WAYLAND_PROTO_DIR)/wayland-protocols-imx-1.13/debian
-	cd $(WAYLAND_PROTO_DIR)/wayland-protocols-imx-1.13; dpkg-buildpackage -uc -us -tc
-	mv $(WAYLAND_PROTO_DIR)/wayland-protocols-imx_1.13-0_all.deb $(PRODUCT_OUT)
+gpu-packages: libdrm-imx
 
 $(LIBDRM_TARGETS): $(ROOTDIR)/cache/arm64-builder.tar
 	mkdir -p $(PRODUCT_OUT)/dev
@@ -55,4 +28,4 @@
 	cp $(LIBDRM_DIR)/libdrm-vivante_2.4.84+imx-0_arm64.deb $(PRODUCT_OUT)
 	cp $(LIBDRM_DIR)/libdrm-dev_2.4.84+imx-0_arm64.deb $(PRODUCT_OUT)/dev
 
-.PHONY:: wayland-protocols-imx weston-imx gpu-packages
+.PHONY:: gpu-packages
diff --git a/gst.mk b/gst.mk
index c59ea1b..ba32112 100644
--- a/gst.mk
+++ b/gst.mk
@@ -5,7 +5,6 @@
 include $(ROOTDIR)/build/preamble.mk
 
 KERNEL_DEB := $(PRODUCT_OUT)/linux-image-4.9.51-aiy_1_arm64.deb
-WP_DEB := $(PRODUCT_OUT)/wayland-protocols-imx_1.13-0_all.deb
 
 GST_DIR := $(PRODUCT_OUT)/obj/GST
 
@@ -136,7 +135,7 @@
 	cp $(addprefix $(GST_DIR)/,$(GST_P_GOOD_DEBS)) $(PRODUCT_OUT)
 	cp $(addprefix $(GST_DIR)/,$(GST_P_GOOD_DEBS_AUX)) $(PRODUCT_OUT)/aux
 
-$(GST_P_BAD_TARGETS): $(LIBDRM_TARGETS) $(GST_P_BASE_TARGETS) $(KERNEL_DEB) $(WP_DEB) $(ROOTDIR)/cache/arm64-builder.tar
+$(GST_P_BAD_TARGETS): $(LIBDRM_TARGETS) $(GST_P_BASE_TARGETS) $(KERNEL_DEB) wayland-protocols-imx $(ROOTDIR)/cache/arm64-builder.tar
 ifeq ($(call stat_files,$(addprefix $(GST_DIR)/,$(GST_P_BAD_DEBS) $(GST_P_BAD_DEBS_DEV) $(GST_P_BAD_DEBS_AUX))),0)
 	$(info $@ already built, not rebuilding)
 else
diff --git a/packages.mk b/packages.mk
index 9432c0e..3e5d70b 100644
--- a/packages.mk
+++ b/packages.mk
@@ -114,6 +114,9 @@
 $(eval $(call make-pbuilder-package-target,imx-mkimage,tools/imx-mkimage))
 $(eval $(call make-pbuilder-package-target,uboot-imx,uboot-imx,imx-atf imx-firmware imx-mkimage))
 
+$(eval $(call make-pbuilder-package-target,wayland-protocols-imx,wayland-protocols-imx))
+$(eval $(call make-pbuilder-package-target,weston-imx,weston-imx,wayland-protocols-imx))
+
 packages:: $(foreach package,$(ALL_PACKAGE_NAMES),$(PRODUCT_OUT)/.$(package)) $(PBUILDER_TARGETS)
 
 .PHONY:: packages
diff --git a/rootfs.mk b/rootfs.mk
index 29f0042..e849657 100644
--- a/rootfs.mk
+++ b/rootfs.mk
@@ -87,8 +87,6 @@
                        $(ROOTDIR)/board/fstab.emmc \
                        $(ROOTDIR)/build/boot.mk \
                        $(PRODUCT_OUT)/linux-image-4.9.51-aiy_1_arm64.deb \
-                       $(PRODUCT_OUT)/wayland-protocols-imx_1.13-0_all.deb \
-                       $(PRODUCT_OUT)/weston-imx_3.0.0-0_arm64.deb \
                        | $(PRODUCT_OUT)/boot.img \
                          modules \
                          packages \
diff --git a/wayland-protocols-imx-debian/changelog b/wayland-protocols-imx-debian/changelog
deleted file mode 100644
index fa9f844..0000000
--- a/wayland-protocols-imx-debian/changelog
+++ /dev/null
@@ -1,5 +0,0 @@
-wayland-protocols-imx (1.13-0) unstable; urgency=medium
-
-  * Initial release
-
- -- AIY Projects <support-aiyprojects@google.com>  Mon, 08 Feb 2016 10:45:53 +0100
diff --git a/wayland-protocols-imx-debian/compat b/wayland-protocols-imx-debian/compat
deleted file mode 100644
index f599e28..0000000
--- a/wayland-protocols-imx-debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-10
diff --git a/wayland-protocols-imx-debian/control b/wayland-protocols-imx-debian/control
deleted file mode 100644
index 5ed5b90..0000000
--- a/wayland-protocols-imx-debian/control
+++ /dev/null
@@ -1,25 +0,0 @@
-Source: wayland-protocols-imx
-Section: x11
-Priority: optional
-Maintainer: AIY Projects <support-aiyprojects@google.com>
-Build-Depends:
- debhelper,
- libwayland-dev,
- pkg-config
-Standards-Version: 4.1.1
-Homepage: http://wayland.freedesktop.org/
-
-Package: wayland-protocols-imx
-Section: libdevel
-Architecture: all
-Priority: extra
-Depends:
- ${shlibs:Depends},
- ${misc:Depends}
-Multi-Arch: foreign
-Provides: wayland-protocols
-Description: wayland compositor protocols
- Wayland protocols that add functionality not available in the Wayland core
- protocol. Such protocols either add completely new functionality, or extend
- the functionality of some other protocol either in Wayland core, or some other
- protocol in wayland-protocols.
diff --git a/wayland-protocols-imx-debian/copyright b/wayland-protocols-imx-debian/copyright
deleted file mode 100644
index 4751573..0000000
--- a/wayland-protocols-imx-debian/copyright
+++ /dev/null
@@ -1,43 +0,0 @@
-Upstream-Name: wayland-protocols-imx
-Upstream-Contact: wayland-devel@lists.freedesktop.org
-Source: https://wayland.freedesktop.org/releases/
-
-Files: debian/*
-Copyright: © 2016 Héctor Orón Martínez <zumbi@debian.org>
-License: Expat
-
-Files: *
-Copyright: © 2008-2013 Kristian Høgsberg
-		   © 2010-2013 Intel Corporation
-		   © 2013      Rafael Antognolli
-		   © 2013      Jasper St. Pierre
-		   © 2014      Jonas Ådahl
-		   © 2014      Jason Ekstrand
-		   © 2014-2015 Collabora, Ltd.
-		   © 2015      Red Hat Inc.
-License: Expat
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice (including the next
-paragraph) shall be included in all copies or substantial portions of the
-Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-
----
-
-The above is the version of the MIT "Expat" License used by X.org:
-
-    http://cgit.freedesktop.org/xorg/xserver/tree/COPYING
diff --git a/wayland-protocols-imx-debian/rules b/wayland-protocols-imx-debian/rules
deleted file mode 100755
index 2d33f6a..0000000
--- a/wayland-protocols-imx-debian/rules
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/usr/bin/make -f
-
-%:
-	dh $@
diff --git a/wayland-protocols-imx-debian/source/format b/wayland-protocols-imx-debian/source/format
deleted file mode 100644
index 163aaf8..0000000
--- a/wayland-protocols-imx-debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/weston-imx-debian/changelog b/weston-imx-debian/changelog
deleted file mode 100644
index 9b80852..0000000
--- a/weston-imx-debian/changelog
+++ /dev/null
@@ -1,5 +0,0 @@
-weston-imx (3.0.0-0) unstable; urgency=medium
-
-  * Initial release
-
- -- AIY Projects <support-aiyprojects@google.com>  Wed, 04 Jul 2018 10:45:53 -0800
diff --git a/weston-imx-debian/compat b/weston-imx-debian/compat
deleted file mode 100644
index f599e28..0000000
--- a/weston-imx-debian/compat
+++ /dev/null
@@ -1 +0,0 @@
-10
diff --git a/weston-imx-debian/control b/weston-imx-debian/control
deleted file mode 100644
index bf98fbd..0000000
--- a/weston-imx-debian/control
+++ /dev/null
@@ -1,23 +0,0 @@
-Source: weston-imx
-Section: x11
-Priority: optional
-Maintainer: AIY Projects <support-aiyprojects@google.com>
-Build-Depends:
- debhelper (>=10),
- libwayland-dev,
- pkg-config
-Standards-Version: 4.1.1
-
-Package: weston-imx
-Section: libdevel
-Architecture: arm64
-Priority: extra
-Depends:
- libinput10,
- libxcb-shape0,
- libxcb-composite0,
- ${shlibs:Depends},
- ${misc:Depends}
-Multi-Arch: foreign
-Provides: weston
-Description: Weston compositor w/ IMX support.
diff --git a/weston-imx-debian/copyright b/weston-imx-debian/copyright
deleted file mode 100644
index 4751573..0000000
--- a/weston-imx-debian/copyright
+++ /dev/null
@@ -1,43 +0,0 @@
-Upstream-Name: wayland-protocols-imx
-Upstream-Contact: wayland-devel@lists.freedesktop.org
-Source: https://wayland.freedesktop.org/releases/
-
-Files: debian/*
-Copyright: © 2016 Héctor Orón Martínez <zumbi@debian.org>
-License: Expat
-
-Files: *
-Copyright: © 2008-2013 Kristian Høgsberg
-		   © 2010-2013 Intel Corporation
-		   © 2013      Rafael Antognolli
-		   © 2013      Jasper St. Pierre
-		   © 2014      Jonas Ådahl
-		   © 2014      Jason Ekstrand
-		   © 2014-2015 Collabora, Ltd.
-		   © 2015      Red Hat Inc.
-License: Expat
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice (including the next
-paragraph) shall be included in all copies or substantial portions of the
-Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
-DEALINGS IN THE SOFTWARE.
-
----
-
-The above is the version of the MIT "Expat" License used by X.org:
-
-    http://cgit.freedesktop.org/xorg/xserver/tree/COPYING
diff --git a/weston-imx-debian/rules b/weston-imx-debian/rules
deleted file mode 100755
index e74a8cc..0000000
--- a/weston-imx-debian/rules
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/usr/bin/make -f
-
-%:
-	dh $@
-
-override_dh_auto_configure:
-	        dh_auto_configure -- --disable-imxg2d
-
-override_dh_auto_test:
-	true
diff --git a/weston-imx-debian/source/format b/weston-imx-debian/source/format
deleted file mode 100644
index 163aaf8..0000000
--- a/weston-imx-debian/source/format
+++ /dev/null
@@ -1 +0,0 @@
-3.0 (quilt)
diff --git a/weston-imx-debian/weston-imx.install b/weston-imx-debian/weston-imx.install
deleted file mode 100644
index ca0f969..0000000
--- a/weston-imx-debian/weston-imx.install
+++ /dev/null
@@ -1 +0,0 @@
-lib /