libpng: upgraded package to upstream

Upgraded media-libs/libpng to version 1.6.37 on amd64, arm

BUG=chromium:1078861
TEST=Build Success

Change-Id: Ia34e39f38a8bd2b79dc01067e70c81f56e2d0d47
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/overlays/portage-stable/+/2185289
Tested-by: Victor Ding <victording@chromium.org>
Auto-Submit: Victor Ding <victording@chromium.org>
Commit-Queue: Victor Ding <victording@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/licenses/libpng2 b/licenses/libpng2
new file mode 100644
index 0000000..e0c5b53
--- /dev/null
+++ b/licenses/libpng2
@@ -0,0 +1,134 @@
+COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
+=========================================
+
+PNG Reference Library License version 2
+---------------------------------------
+
+ * Copyright (c) 1995-2019 The PNG Reference Library Authors.
+ * Copyright (c) 2018-2019 Cosmin Truta.
+ * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
+ * Copyright (c) 1996-1997 Andreas Dilger.
+ * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
+
+The software is supplied "as is", without warranty of any kind,
+express or implied, including, without limitation, the warranties
+of merchantability, fitness for a particular purpose, title, and
+non-infringement.  In no event shall the Copyright owners, or
+anyone distributing the software, be liable for any damages or
+other liability, whether in contract, tort or otherwise, arising
+from, out of, or in connection with the software, or the use or
+other dealings in the software, even if advised of the possibility
+of such damage.
+
+Permission is hereby granted to use, copy, modify, and distribute
+this software, or portions hereof, for any purpose, without fee,
+subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you
+    must not claim that you wrote the original software.  If you
+    use this software in a product, an acknowledgment in the product
+    documentation would be appreciated, but is not required.
+
+ 2. Altered source versions must be plainly marked as such, and must
+    not be misrepresented as being the original software.
+
+ 3. This Copyright notice may not be removed or altered from any
+    source or altered source distribution.
+
+
+PNG Reference Library License version 1 (for libpng 0.5 through 1.6.35)
+-----------------------------------------------------------------------
+
+libpng versions 1.0.7, July 1, 2000, through 1.6.35, July 15, 2018 are
+Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson, are
+derived from libpng-1.0.6, and are distributed according to the same
+disclaimer and license as libpng-1.0.6 with the following individuals
+added to the list of Contributing Authors:
+
+    Simon-Pierre Cadieux
+    Eric S. Raymond
+    Mans Rullgard
+    Cosmin Truta
+    Gilles Vollant
+    James Yu
+    Mandar Sahastrabuddhe
+    Google Inc.
+    Vadim Barkov
+
+and with the following additions to the disclaimer:
+
+    There is no warranty against interference with your enjoyment of
+    the library or against infringement.  There is no warranty that our
+    efforts or the library will fulfill any of your particular purposes
+    or needs.  This library is provided with all faults, and the entire
+    risk of satisfactory quality, performance, accuracy, and effort is
+    with the user.
+
+Some files in the "contrib" directory and some configure-generated
+files that are distributed with libpng have other copyright owners, and
+are released under other open source licenses.
+
+libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, are
+Copyright (c) 1998-2000 Glenn Randers-Pehrson, are derived from
+libpng-0.96, and are distributed according to the same disclaimer and
+license as libpng-0.96, with the following individuals added to the
+list of Contributing Authors:
+
+    Tom Lane
+    Glenn Randers-Pehrson
+    Willem van Schaik
+
+libpng versions 0.89, June 1996, through 0.96, May 1997, are
+Copyright (c) 1996-1997 Andreas Dilger, are derived from libpng-0.88,
+and are distributed according to the same disclaimer and license as
+libpng-0.88, with the following individuals added to the list of
+Contributing Authors:
+
+    John Bowler
+    Kevin Bracey
+    Sam Bushell
+    Magnus Holmgren
+    Greg Roelofs
+    Tom Tanner
+
+Some files in the "scripts" directory have other copyright owners,
+but are released under this license.
+
+libpng versions 0.5, May 1995, through 0.88, January 1996, are
+Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
+
+For the purposes of this copyright and license, "Contributing Authors"
+is defined as the following set of individuals:
+
+    Andreas Dilger
+    Dave Martindale
+    Guy Eric Schalnat
+    Paul Schmidt
+    Tim Wegner
+
+The PNG Reference Library is supplied "AS IS".  The Contributing
+Authors and Group 42, Inc. disclaim all warranties, expressed or
+implied, including, without limitation, the warranties of
+merchantability and of fitness for any purpose.  The Contributing
+Authors and Group 42, Inc. assume no liability for direct, indirect,
+incidental, special, exemplary, or consequential damages, which may
+result from the use of the PNG Reference Library, even if advised of
+the possibility of such damage.
+
+Permission is hereby granted to use, copy, modify, and distribute this
+source code, or portions hereof, for any purpose, without fee, subject
+to the following restrictions:
+
+ 1. The origin of this source code must not be misrepresented.
+
+ 2. Altered versions must be plainly marked as such and must not
+    be misrepresented as being the original source.
+
+ 3. This Copyright notice may not be removed or altered from any
+    source or altered source distribution.
+
+The Contributing Authors and Group 42, Inc. specifically permit,
+without fee, and encourage the use of this source code as a component
+to supporting the PNG file format in commercial products.  If you use
+this source code in a product, acknowledgment is not required but would
+be appreciated.
diff --git a/media-libs/libpng/Manifest b/media-libs/libpng/Manifest
index 684045a..cff7dca 100644
--- a/media-libs/libpng/Manifest
+++ b/media-libs/libpng/Manifest
@@ -1 +1,2 @@
-DIST libpng-1.6.27.tar.xz 984316 SHA256 fca2ffd97336356cdab9bfa8936b9d6dfd580a70205e5dfead3ac42cb054b57b SHA512 9dcf54147fa2637a72364246e8565c0a6d25e4313f26150689b166eabd4358177e1caf38ff622b04c71f3b7cfd550f7fd6ca87892c50203a63b92f365fc7c8d7 WHIRLPOOL 6f68c929ac7aa28d41bea26843f0028b447144e2c0c7a8958f44a7d3c62c9d17fa22d4e5ce709b0dbf5234f80829fb554023fc229a5397a97deb0fff17bf5895
+DIST libpng-1.6.37-apng.patch.gz 10334 BLAKE2B 98660f2c13a78c93f937adf2859447cb0e6fa014b2ef6f0571c910593d94cc0a50137d271dbded0b571a3bc0ce4e9f765be48130ee4ae89884fb7292a1b0cf6e SHA512 a9365257a33d67d7e7284494a37747bb1f3ab89f42a1730f2745c604538f59861828dc91d9bc1d08a5b79ab2f4eef1bb9e438dda1774b3548a1c56be77f8435f
+DIST libpng-1.6.37.tar.xz 1012272 BLAKE2B 48e8f48a88e0db6fcbc0c0f1a4d5bda6e6c8b03255bacdc60e353256ae41ccc01b5b2a7e0e7b0dea236c53a3b9d1dd89d4bb19445afbebc37bf0f92691452424 SHA512 59e8c1059013497ae616a14c3abbe239322d3873c6ded0912403fc62fb260561768230b6ab997e2cccc3b868c09f539fd13635616b9fa0dd6279a3f63ec7e074
diff --git a/media-libs/libpng/libpng-1.6.27.ebuild b/media-libs/libpng/libpng-1.6.37.ebuild
similarity index 60%
rename from media-libs/libpng/libpng-1.6.27.ebuild
rename to media-libs/libpng/libpng-1.6.37.ebuild
index ae789c2..30517a3 100644
--- a/media-libs/libpng/libpng-1.6.27.ebuild
+++ b/media-libs/libpng/libpng-1.6.37.ebuild
@@ -1,30 +1,28 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI=6
 
-inherit eutils libtool multilib-minimal
+inherit libtool multilib-minimal
 
 DESCRIPTION="Portable Network Graphics library"
 HOMEPAGE="http://www.libpng.org/"
 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.xz
 	apng? ( mirror://sourceforge/apng/${P}-apng.patch.gz )"
 
-LICENSE="libpng"
+LICENSE="libpng2"
 SLOT="0/16"
 KEYWORDS="*"
-IUSE="apng neon static-libs"
+IUSE="apng cpu_flags_x86_sse neon static-libs"
 
-RDEPEND=">=sys-libs/zlib-1.2.8-r1:=[${MULTILIB_USEDEP}]
-	abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r1
-		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+RDEPEND=">=sys-libs/zlib-1.2.8-r1:=[${MULTILIB_USEDEP}]"
 DEPEND="${RDEPEND}
 	app-arch/xz-utils"
 
 src_prepare() {
 	default
 	if use apng; then
-		epatch "${WORKDIR}"/${PN}-*-apng.patch
+		eapply -p0 "${WORKDIR}"/${PN}-*-apng.patch
 		# Don't execute symbols check with apng patch wrt #378111
 		sed -i -e '/^check/s:scripts/symbols.chk::' Makefile.in || die
 	fi
@@ -32,13 +30,16 @@
 }
 
 multilib_src_configure() {
-	ECONF_SOURCE="${S}" econf \
-		$(use_enable static-libs static) \
+	local myeconfargs=(
+		$(use_enable cpu_flags_x86_sse intel-sse)
+		$(use_enable static-libs static)
 		--enable-arm-neon=$(usex neon)
+	)
+	ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
 }
 
 multilib_src_install_all() {
 	DOCS=( ANNOUNCE CHANGES libpng-manual.txt README TODO )
 	einstalldocs
-	prune_libtool_files --all
+	find "${ED}" -name '*.la' -delete || die
 }
diff --git a/metadata/md5-cache/media-libs/libpng-1.6.27 b/metadata/md5-cache/media-libs/libpng-1.6.27
deleted file mode 100644
index e0d9371..0000000
--- a/metadata/md5-cache/media-libs/libpng-1.6.27
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile configure install prepare test
-DEPEND=>=sys-libs/zlib-1.2.8-r1:=[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_ppc_32(-)?,abi_ppc_64(-)?,abi_s390_32(-)?,abi_s390_64(-)?,abi_arm_32(-)?,abi_arm_64(-)?] abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r1 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] ) app-arch/xz-utils >=app-portage/elt-patches-20170815
-DESCRIPTION=Portable Network Graphics library
-EAPI=5
-HOMEPAGE=http://www.libpng.org/
-IUSE=apng neon static-libs abi_x86_32 abi_x86_64 abi_x86_x32 abi_mips_n32 abi_mips_n64 abi_mips_o32 abi_ppc_32 abi_ppc_64 abi_s390_32 abi_s390_64 abi_arm_32 abi_arm_64
-KEYWORDS=*
-LICENSE=libpng
-RDEPEND=>=sys-libs/zlib-1.2.8-r1:=[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_ppc_32(-)?,abi_ppc_64(-)?,abi_s390_32(-)?,abi_s390_64(-)?,abi_arm_32(-)?,abi_arm_64(-)?] abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r1 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )
-SLOT=0/16
-SRC_URI=mirror://sourceforge/libpng/libpng-1.6.27.tar.xz apng? ( mirror://sourceforge/apng/libpng-1.6.27-apng.patch.gz )
-_eclasses_=eutils	06133990e861be0fe60c2b428fd025d9	libtool	f143db5a74ccd9ca28c1234deffede96	multibuild	40fe59465edacd730c644ec2bc197809	multilib	b2f01ad412baf81650c23fcf0975fa33	multilib-build	1979aa0ff4d356d32507ca4650d9f37d	multilib-minimal	8bddda43703ba94d8341f4e247f97566	toolchain-funcs	209edad4a5c4812e7b2f8021650974f0
-_md5_=b113079c70f26c2c6d66e79bc6661626
diff --git a/metadata/md5-cache/media-libs/libpng-1.6.37 b/metadata/md5-cache/media-libs/libpng-1.6.37
new file mode 100644
index 0000000..522a4ce
--- /dev/null
+++ b/metadata/md5-cache/media-libs/libpng-1.6.37
@@ -0,0 +1,13 @@
+DEFINED_PHASES=compile configure install prepare test
+DEPEND=>=sys-libs/zlib-1.2.8-r1:=[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_ppc_32(-)?,abi_ppc_64(-)?,abi_s390_32(-)?,abi_s390_64(-)?,abi_arm_32(-)?,abi_arm_64(-)?] app-arch/xz-utils >=app-portage/elt-patches-20170815
+DESCRIPTION=Portable Network Graphics library
+EAPI=6
+HOMEPAGE=http://www.libpng.org/
+IUSE=apng cpu_flags_x86_sse neon static-libs abi_x86_32 abi_x86_64 abi_x86_x32 abi_mips_n32 abi_mips_n64 abi_mips_o32 abi_ppc_32 abi_ppc_64 abi_s390_32 abi_s390_64 abi_arm_32 abi_arm_64
+KEYWORDS=*
+LICENSE=libpng2
+RDEPEND=>=sys-libs/zlib-1.2.8-r1:=[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_ppc_32(-)?,abi_ppc_64(-)?,abi_s390_32(-)?,abi_s390_64(-)?,abi_arm_32(-)?,abi_arm_64(-)?]
+SLOT=0/16
+SRC_URI=mirror://sourceforge/libpng/libpng-1.6.37.tar.xz apng? ( mirror://sourceforge/apng/libpng-1.6.37-apng.patch.gz )
+_eclasses_=libtool	f143db5a74ccd9ca28c1234deffede96	multibuild	40fe59465edacd730c644ec2bc197809	multilib	b2f01ad412baf81650c23fcf0975fa33	multilib-build	1979aa0ff4d356d32507ca4650d9f37d	multilib-minimal	8bddda43703ba94d8341f4e247f97566	toolchain-funcs	209edad4a5c4812e7b2f8021650974f0
+_md5_=dbe7b1f43649ed81d9a81ed3afb0bbb3