summaryrefslogtreecommitdiff
path: root/media-libs/jpeg
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /media-libs/jpeg
reinit the tree, so we can have metadata
Diffstat (limited to 'media-libs/jpeg')
-rw-r--r--media-libs/jpeg/Manifest16
-rw-r--r--media-libs/jpeg/files/jpeg-7-maxmem_sysconf.patch49
-rw-r--r--media-libs/jpeg/files/jpeg-8d-CVE-2013-6629.patch17
-rw-r--r--media-libs/jpeg/jpeg-6b-r12.ebuild49
-rw-r--r--media-libs/jpeg/jpeg-8d-r1.ebuild70
-rw-r--r--media-libs/jpeg/jpeg-8d-r2.ebuild53
-rw-r--r--media-libs/jpeg/jpeg-9a.ebuild68
-rw-r--r--media-libs/jpeg/jpeg-9b.ebuild68
-rw-r--r--media-libs/jpeg/metadata.xml8
9 files changed, 398 insertions, 0 deletions
diff --git a/media-libs/jpeg/Manifest b/media-libs/jpeg/Manifest
new file mode 100644
index 000000000000..8e4b1c1e96a8
--- /dev/null
+++ b/media-libs/jpeg/Manifest
@@ -0,0 +1,16 @@
+AUX jpeg-7-maxmem_sysconf.patch 1313 SHA256 92d08b14ade2f42291d3de8074f5e4f9dd3c64dd9ec227bc770a0825187202de SHA512 42a3bccf20db20d1b0e9dee3b5a8b1733b81b5d3dcda83aae8e910d023af0fcbce920c010d11dc8b637935886eede05161393d8e594f48189f72a346f3f8fed8 WHIRLPOOL ac99c96457e83af5fe6a880701bb03312d08fac2dd38d5c0a7436a205f22bf3a8a3906162e6948f98f6af873b8a44e2b7674eec45ae939a400d6682df922527b
+AUX jpeg-8d-CVE-2013-6629.patch 459 SHA256 cffa57b0f23fa4c11127cc898b994b8a5ddb5fb9ab0f61766622ce2f31a1f7e8 SHA512 7a08085ebce49be6d14c4b52bfc06e67c7f46f6aea38ddf1475f041cc84010ba535394d85dae9a957074a39fe5d22ae60f228192e24795105009f189e7f9f4b0 WHIRLPOOL ef0878cec3dac302be2aa8ee4811ce00f526e20c33479d0d5f943e48d7e3809dc0f16044c4c95c18d3c004501686f1f505758a49707ac3b78026562d74882a96
+DIST jpeg-6b-patchset-1.tar.xz 2592 SHA256 533ef36e4ca8cdad81d0c931e486776983f60696779c07d11ed601febebec70d SHA512 6deb845a08f4ac6b88c47803b528842cedd145fb12295060d52553b8c803ba192478306496701a409c796c264ceaed0988575ae8f7717e2e7b24da5733bc9c2b WHIRLPOOL cdc42a1a68a090043ca95302f25979293197322f108f083cb16ba57c9bd20a56d21820590cd79f7c7f51836b133fc47a0948928d2d8f9e64bb270bf4ee11844a
+DIST jpegsrc.v6b.tar.gz 613261 SHA256 75c3ec241e9996504fe02a9ed4d12f16b74ade713972f3db9e65ce95cd27e35d SHA512 5d37d3695105fc345ca269ab98cd991472e5de72f702c9a8a652a7d114a40eb99670c69a87ecb24bf64e96318fc0ee2bcb44c497d9d3d2a67378c99e4eb348fe WHIRLPOOL ab649fd5ff29dfbcdf52f337b73c65e29d577c3fd0a1c910590177d83985115c8e8e4c392e196f7a497d6346072b40053999171f0cd74ee3325e74c005c5ba9b
+DIST jpegsrc.v8d.tar.gz 991456 SHA256 00029b1473f0f0ea72fbca3230e8cb25797fbb27e58ae2e46bb8bf5a806fe0b3 SHA512 7a8b4cff5b1caf6a7281c5dce4e1efa1b68360bd64dd2e619b60c9e1d49f22624bc8780b681bfab073e7b1d4b7f41008a464a58f0eeeacb0a40ff996d7eb5753 WHIRLPOOL 7489605809b43cfac02230b89013075806df32246b37eb12ac05ef890ee690f85744887e296f5a21fa64012570aa298d2aa54e4469066f4c21dd40141f3bd8a8
+DIST jpegsrc.v9a.tar.gz 1000034 SHA256 3a753ea48d917945dd54a2d97de388aa06ca2eb1066cbfdc6652036349fe05a7 SHA512 9b21cc115e22c68bea46db462263c5c7a0d10beb192a919ecccbd801a25982b518ce44d8c301dd582ecaba1850e0e0f20e322be82b0e24ae917b9949b4f10d3b WHIRLPOOL cd92fd028c8f55c653d74ee74d0c744ebded578bdc7f415a5e8321bed638300c908d08e4129ebb031a6ed19560a2610942ed23cb0a075cc1a34319b9ebaa2265
+DIST jpegsrc.v9b.tar.gz 1022609 SHA256 240fd398da741669bf3c90366f58452ea59041cacc741a489b99f2f6a0bad052 SHA512 74ea5af3545657d4ac03f8f7933913112cc2d982f0e379d0e5647f1acac21931468e53806297c30ebe180c7bcf84919a0ac20a4195afb03db03060d57904ef6c WHIRLPOOL ccf5a7cd3566a61d85c870cd562d81b20877f338b8158c4b2000f08a3b7b47a0f59b0b3b8d5839baadd9f0104e88ed8d789963d4dc622594f42d90b2a3a8ad42
+DIST libjpeg8_8d-1.debian.tar.gz 13676 SHA256 70ec6689b0ad85739802cf3ebbdcc12ea01e21edd8f931c614b25b44cf199057 SHA512 7def4f13524f0af3b9adf35a370027a18f43b9a635f56a17d5bb7883370db8b18b8a12737d0f0cb4b0287ccf8fb474eb5f754de6b398ffe7d522c54e5bf68040 WHIRLPOOL 94526c31d401eb14c9bf0f7115e13a27886ad58863e25d6653eba2b2f5ef260ec272368d2b9d9934bd75b1e5b5f1afc97230e540248efc24d6e85e5680399d27
+EBUILD jpeg-6b-r12.ebuild 1253 SHA256 2c2ec3b7109dd17a4a1e13ac8d6f4c992d02b1a0f6d58497b11e889722bc360d SHA512 cb3ec5945863b4bab44d32dbb14aaced20e3960ab64cfaf220cec225685d57ca617e01502364887d9f6925b60950bfd8f7e8dbe89e29d931aeb44ac918fa055b WHIRLPOOL 95c44dd7790127e165a14dc81f69ff587dc562e37649db2ec48291b3d11b6e456de37ba017a6d51b1ec9ec3ab9107d037b4b0acf096492080a28b900c37b1037
+EBUILD jpeg-8d-r1.ebuild 2081 SHA256 e2dc243129bded91a606bbe32a18e8fef9dd8c22a39068dfdaf7037c2261cc99 SHA512 95fbd07ae0c48084b9fb4f91aae37c504324f6f464865fca1d11897729a512b2e7006bd4a072824cedd14651419229b6511b86ce7935de23456584f8b1dfc142 WHIRLPOOL 31bf54f5e9a830ebd847eb1954c232e8d323508dac7ea37d0db82ecfa608f41e8cc926a4dfa4715f379c8ed9f0a963921ee63a62e482094b1ff7b70691898b2a
+EBUILD jpeg-8d-r2.ebuild 1544 SHA256 e3d8e9522f68f1ee6f63a873e0add71a42cc9139b8b5598210b9ca73aa61e564 SHA512 a4a4188f60f5eb6bf51a7cd729cf17c8dfafd27bd4beab13163ffdb8d60c09ba6bc25128c3e72bd75d2acb3d21f1e0364491d4a0af83468df15b91d1005b4430 WHIRLPOOL f48a680ae05bbca2e8523b86eb6647e926b383dafbcc7c33fc9bbf217dc06f7556c8b822cdd01b4dceca22cb6f301f3f55de7e3edc41032af1cbd93e4034b0e4
+EBUILD jpeg-9a.ebuild 2047 SHA256 2f17423cdd6f325c1a0a8761a8c15b334c1867635922c40e74e990b393aef353 SHA512 61a35aaba06ebe974823fe5cb5a6510b97831856f8fa53db731602a71b77fd513024541d4124f0ad8d0a0725e9ea2b71f775f2d98bd7e647a55411de92eea268 WHIRLPOOL 70027c4fe620f4c9e92f5c3683b5faa03e89cc7e1b12cd90ce0b02ca96d5e5fe2178efe9fe4cd8fc0816ddef4b129edc750bdf8bd183453c75dfad60f30b975a
+EBUILD jpeg-9b.ebuild 2047 SHA256 2f17423cdd6f325c1a0a8761a8c15b334c1867635922c40e74e990b393aef353 SHA512 61a35aaba06ebe974823fe5cb5a6510b97831856f8fa53db731602a71b77fd513024541d4124f0ad8d0a0725e9ea2b71f775f2d98bd7e647a55411de92eea268 WHIRLPOOL 70027c4fe620f4c9e92f5c3683b5faa03e89cc7e1b12cd90ce0b02ca96d5e5fe2178efe9fe4cd8fc0816ddef4b129edc750bdf8bd183453c75dfad60f30b975a
+MISC ChangeLog 2977 SHA256 489d04da656e62318722d533fa5d02b4d52d3a39aca3bfe236c6b2f24f548756 SHA512 9b850e6bde4bbc2bfe2c1eb4997508404f78aaf4d8fab9d76f7caa4e7009414aac98eef5d7c3db03ccade92aa0a4ab0c09a0a54349f2810d5d4f7334ae529a75 WHIRLPOOL 6dd6cd11bff11fd582b3f275f9004884bac14097aaef8b95346d5164b9e76943a84899c3eac254909ffe74f89ffe60df10a86e009a7c839c3dda9e51040148e2
+MISC ChangeLog-2015 20776 SHA256 1a99a0a0d5149c8636cf6bb32dc7b0fbc9a9a6cdec0bc8ca76bcefc27b21fa48 SHA512 98bd15716e982bf1888cb84ea02df85f3ba0a87c921448d52a3b0ec54595c61b4ed9b58178800c860b54e7ebd9b29a0199156fac67be51b4add829d2f1304e2f WHIRLPOOL 5f8254daac3ee9ef25a9ca69aaeacf60e490d6bd09c701d2ea8d121fd550e5b2540b46107447623315fcc7bac912e93e903250693c0babb4e3637ff9429a5e95
+MISC metadata.xml 255 SHA256 3e7137870fc49956d79719e3dfe029775cbaaa097e85748c139713c46fcd1798 SHA512 b7bc93530a1726c2d4dfbc71ae29cfbb57712fd9fdd2e76fd52f35ab4368cba0497b50145d1527a3b79e465d459a380821bb1371a01c2e915dc9adc6c7fafd5f WHIRLPOOL 392188d7e069f1720be9329edfb31b11b176bf0c411023b2ceeaeabef1cacf842d70657a2a14ac2ddabbdad70a304275f3b587e9bcdfe77be63a0092e370252c
diff --git a/media-libs/jpeg/files/jpeg-7-maxmem_sysconf.patch b/media-libs/jpeg/files/jpeg-7-maxmem_sysconf.patch
new file mode 100644
index 000000000000..9ea87d4fa399
--- /dev/null
+++ b/media-libs/jpeg/files/jpeg-7-maxmem_sysconf.patch
@@ -0,0 +1,49 @@
+# Make a reasonable guess about memory limits using sysconf().
+# includes 5% slop factor as suggested in documentation.
+
+--- jpeg-7/jmemansi.c
++++ jpeg-7/jmemansi.c
+@@ -12,6 +12,15 @@
+ * is shoved onto the user.
+ */
+
++#include <unistd.h>
++
++#ifdef __FreeBSD__
++# include <sys/types.h>
++# include <sys/sysctl.h>
++# include <sys/vmmeter.h>
++# include <vm/vm_param.h>
++#endif
++
+ #define JPEG_INTERNALS
+ #include "jinclude.h"
+ #include "jpeglib.h"
+@@ -157,7 +166,26 @@
+ GLOBAL(long)
+ jpeg_mem_init (j_common_ptr cinfo)
+ {
+- return DEFAULT_MAX_MEM; /* default for max_memory_to_use */
++#ifdef _SC_AVPHYS_PAGES
++ long phys_size;
++
++ if ((phys_size = sysconf(_SC_AVPHYS_PAGES)) == -1)
++ return DEFAULT_MAX_MEM; /* default for max_memory_to_use */
++ if ((phys_size *= sysconf(_SC_PAGESIZE)) < 0)
++ return DEFAULT_MAX_MEM;
++ return (long) (phys_size * 0.95);
++#elif defined(HAVE_SYSCTL) && defined(HW_PHYSMEM)
++ /* This works on *bsd and darwin. */
++ unsigned int physmem;
++ size_t len = sizeof physmem;
++ static int mib[2] = { CTL_HW, HW_PHYSMEM };
++
++ if (sysctl (mib, ARRAY_SIZE (mib), &physmem, &len, NULL, 0) == 0
++ && len == sizeof (physmem))
++ return (long) (physmem * 0.95);
++#endif
++
++ return DEFAULT_MAX_MEM;
+ }
+
+ GLOBAL(void)
diff --git a/media-libs/jpeg/files/jpeg-8d-CVE-2013-6629.patch b/media-libs/jpeg/files/jpeg-8d-CVE-2013-6629.patch
new file mode 100644
index 000000000000..a1535a79ffec
--- /dev/null
+++ b/media-libs/jpeg/files/jpeg-8d-CVE-2013-6629.patch
@@ -0,0 +1,17 @@
+http://bugs.gentoo.org/491152
+
+--- jdmarker.c
++++ jdmarker.c
+@@ -347,6 +347,12 @@
+
+ TRACEMS3(cinfo, 1, JTRC_SOS_COMPONENT, cc,
+ compptr->dc_tbl_no, compptr->ac_tbl_no);
++
++ /* This CSi (cc) should differ from the previous CSi */
++ for (ci = 0; ci < i; ci++) {
++ if (cinfo->cur_comp_info[ci] == compptr)
++ ERREXIT1(cinfo, JERR_BAD_COMPONENT_ID, cc);
++ }
+ }
+
+ /* Collect the additional scan parameters Ss, Se, Ah/Al. */
diff --git a/media-libs/jpeg/jpeg-6b-r12.ebuild b/media-libs/jpeg/jpeg-6b-r12.ebuild
new file mode 100644
index 000000000000..3555b6c14cf5
--- /dev/null
+++ b/media-libs/jpeg/jpeg-6b-r12.ebuild
@@ -0,0 +1,49 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+# this ebuild is only for the libjpeg.so.62 SONAME for ABI compat
+
+PATCH_VER=1
+inherit eutils libtool toolchain-funcs multilib-minimal
+
+DESCRIPTION="library to load, handle and manipulate images in the JPEG format (transition package)"
+HOMEPAGE="http://www.ijg.org/"
+SRC_URI="mirror://gentoo/jpegsrc.v${PV}.tar.gz
+ https://dev.gentoo.org/~ssuominen/${P}-patchset-${PATCH_VER}.tar.xz"
+
+LICENSE="IJG"
+SLOT="62"
+KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~ia64 m68k ~mips ~ppc ~ppc64 s390 sh ~sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux"
+IUSE=""
+
+DOCS=""
+
+RDEPEND="!>=media-libs/libjpeg-turbo-1.3.0-r2:0
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r5
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
+ epatch "${FILESDIR}"/${PN}-8d-CVE-2013-6629.patch
+ elibtoolize
+}
+
+multilib_src_configure() {
+ tc-export CC
+ ECONF_SOURCE=${S} \
+ econf \
+ --enable-shared \
+ --disable-static \
+ --enable-maxmem=64
+}
+
+multilib_src_compile() {
+ emake libjpeg.la
+}
+
+multilib_src_install() {
+ newlib.so .libs/libjpeg.so.62.0.0 libjpeg.so.62
+}
diff --git a/media-libs/jpeg/jpeg-8d-r1.ebuild b/media-libs/jpeg/jpeg-8d-r1.ebuild
new file mode 100644
index 000000000000..07c725027733
--- /dev/null
+++ b/media-libs/jpeg/jpeg-8d-r1.ebuild
@@ -0,0 +1,70 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils libtool toolchain-funcs multilib-minimal
+
+DESCRIPTION="Library to load, handle and manipulate images in the JPEG format"
+HOMEPAGE="http://jpegclub.org/ http://www.ijg.org/"
+SRC_URI="http://www.ijg.org/files/${PN}src.v${PV}.tar.gz
+ mirror://debian/pool/main/libj/lib${PN}8/lib${PN}8_8d-1.debian.tar.gz"
+
+LICENSE="IJG"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="static-libs"
+
+RDEPEND="!media-libs/libjpeg-turbo:0
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r5
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-7-maxmem_sysconf.patch \
+ "${FILESDIR}"/${P}-CVE-2013-6629.patch
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # Fix building against this library on eg. Solaris and DragonFly BSD, see:
+ # http://mail-index.netbsd.org/pkgsrc-bugs/2010/01/18/msg035644.html
+ local ldverscript=
+ [[ ${CHOST} == *-solaris* ]] && ldverscript="--disable-ld-version-script"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable static-libs static) \
+ --enable-maxmem=64 \
+ ${ldverscript}
+}
+
+multilib_src_compile() {
+ emake
+
+ if multilib_is_native_abi; then
+ # Build exifautotran and jpegexiforient
+ cd ../debian/extra
+ emake CC="$(tc-getCC)" CFLAGS="${LDFLAGS} ${CFLAGS}"
+ fi
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+
+ dodoc change.log example.c README *.txt
+
+ # Install exifautotran and jpegexiforient
+ newdoc ../debian/changelog changelog.debian
+ cd ../debian/extra
+ emake \
+ DESTDIR="${D}" prefix="${EPREFIX}"/usr \
+ INSTALL="install -m755" INSTALLDIR="install -d -m755" \
+ install
+ # Remove +x bits from man pages.
+ find "${ED}"/usr/share/man/ -type f -perm /1 -exec chmod a-x {} + || die
+}
diff --git a/media-libs/jpeg/jpeg-8d-r2.ebuild b/media-libs/jpeg/jpeg-8d-r2.ebuild
new file mode 100644
index 000000000000..3db4d866048a
--- /dev/null
+++ b/media-libs/jpeg/jpeg-8d-r2.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+
+# this ebuild is only for the libjpeg.so.8 SONAME for ABI compat
+
+inherit eutils libtool toolchain-funcs multilib-minimal
+
+DESCRIPTION="Library to load, handle and manipulate images in the JPEG format"
+HOMEPAGE="http://jpegclub.org/ http://www.ijg.org/"
+SRC_URI="http://www.ijg.org/files/${PN}src.v${PV}.tar.gz"
+
+LICENSE="IJG"
+SLOT="8"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE=""
+
+RDEPEND="!=media-libs/jpeg-8*:0
+ !<media-libs/libjpeg-turbo-1.3.0-r2
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r5
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+DEPEND="${RDEPEND}"
+
+DOCS=""
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${PN}-7-maxmem_sysconf.patch \
+ "${FILESDIR}"/${P}-CVE-2013-6629.patch
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # Fix building against this library on eg. Solaris and DragonFly BSD, see:
+ # http://mail-index.netbsd.org/pkgsrc-bugs/2010/01/18/msg035644.html
+ local ldverscript=
+ [[ ${CHOST} == *-solaris* ]] && ldverscript="--disable-ld-version-script"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ --disable-static \
+ --enable-maxmem=64 \
+ ${ldverscript}
+}
+
+multilib_src_compile() {
+ emake libjpeg.la
+}
+
+multilib_src_install() {
+ newlib.so .libs/libjpeg.so.8.4.0 libjpeg.so.8
+}
diff --git a/media-libs/jpeg/jpeg-9a.ebuild b/media-libs/jpeg/jpeg-9a.ebuild
new file mode 100644
index 000000000000..b03c0a95b9fb
--- /dev/null
+++ b/media-libs/jpeg/jpeg-9a.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils libtool toolchain-funcs multilib-minimal
+
+DESCRIPTION="Library to load, handle and manipulate images in the JPEG format"
+HOMEPAGE="http://jpegclub.org/ http://www.ijg.org/"
+SRC_URI="http://www.ijg.org/files/${PN}src.v${PV}.tar.gz
+ mirror://debian/pool/main/libj/lib${PN}8/lib${PN}8_8d-1.debian.tar.gz"
+
+LICENSE="IJG"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="static-libs"
+
+RDEPEND="!media-libs/libjpeg-turbo:0
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r5
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-7-maxmem_sysconf.patch
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # Fix building against this library on eg. Solaris and DragonFly BSD, see:
+ # http://mail-index.netbsd.org/pkgsrc-bugs/2010/01/18/msg035644.html
+ local ldverscript=
+ [[ ${CHOST} == *-solaris* ]] && ldverscript="--disable-ld-version-script"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable static-libs static) \
+ --enable-maxmem=64 \
+ ${ldverscript}
+}
+
+multilib_src_compile() {
+ emake
+
+ if multilib_is_native_abi; then
+ # Build exifautotran and jpegexiforient
+ cd ../debian/extra
+ emake CC="$(tc-getCC)" CFLAGS="${LDFLAGS} ${CFLAGS}"
+ fi
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+
+ dodoc change.log example.c README *.txt
+
+ # Install exifautotran and jpegexiforient
+ newdoc ../debian/changelog changelog.debian
+ cd ../debian/extra
+ emake \
+ DESTDIR="${D}" prefix="${EPREFIX}"/usr \
+ INSTALL="install -m755" INSTALLDIR="install -d -m755" \
+ install
+ # Remove +x bits from man pages.
+ find "${ED}"/usr/share/man/ -type f -perm /1 -exec chmod a-x {} + || die
+}
diff --git a/media-libs/jpeg/jpeg-9b.ebuild b/media-libs/jpeg/jpeg-9b.ebuild
new file mode 100644
index 000000000000..b03c0a95b9fb
--- /dev/null
+++ b/media-libs/jpeg/jpeg-9b.ebuild
@@ -0,0 +1,68 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils libtool toolchain-funcs multilib-minimal
+
+DESCRIPTION="Library to load, handle and manipulate images in the JPEG format"
+HOMEPAGE="http://jpegclub.org/ http://www.ijg.org/"
+SRC_URI="http://www.ijg.org/files/${PN}src.v${PV}.tar.gz
+ mirror://debian/pool/main/libj/lib${PN}8/lib${PN}8_8d-1.debian.tar.gz"
+
+LICENSE="IJG"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+IUSE="static-libs"
+
+RDEPEND="!media-libs/libjpeg-turbo:0
+ abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r5
+ !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-7-maxmem_sysconf.patch
+ elibtoolize
+}
+
+multilib_src_configure() {
+ # Fix building against this library on eg. Solaris and DragonFly BSD, see:
+ # http://mail-index.netbsd.org/pkgsrc-bugs/2010/01/18/msg035644.html
+ local ldverscript=
+ [[ ${CHOST} == *-solaris* ]] && ldverscript="--disable-ld-version-script"
+
+ ECONF_SOURCE=${S} \
+ econf \
+ $(use_enable static-libs static) \
+ --enable-maxmem=64 \
+ ${ldverscript}
+}
+
+multilib_src_compile() {
+ emake
+
+ if multilib_is_native_abi; then
+ # Build exifautotran and jpegexiforient
+ cd ../debian/extra
+ emake CC="$(tc-getCC)" CFLAGS="${LDFLAGS} ${CFLAGS}"
+ fi
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+}
+
+multilib_src_install_all() {
+ prune_libtool_files
+
+ dodoc change.log example.c README *.txt
+
+ # Install exifautotran and jpegexiforient
+ newdoc ../debian/changelog changelog.debian
+ cd ../debian/extra
+ emake \
+ DESTDIR="${D}" prefix="${EPREFIX}"/usr \
+ INSTALL="install -m755" INSTALLDIR="install -d -m755" \
+ install
+ # Remove +x bits from man pages.
+ find "${ED}"/usr/share/man/ -type f -perm /1 -exec chmod a-x {} + || die
+}
diff --git a/media-libs/jpeg/metadata.xml b/media-libs/jpeg/metadata.xml
new file mode 100644
index 000000000000..19bf1be2581e
--- /dev/null
+++ b/media-libs/jpeg/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="project">
+ <email>graphics@gentoo.org</email>
+ <name>Gentoo Graphics Project</name>
+</maintainer>
+</pkgmetadata>