From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1440289-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 62C89158094
	for <garchives@archives.gentoo.org>; Wed, 28 Sep 2022 00:10:02 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 77176E0828;
	Wed, 28 Sep 2022 00:10:01 +0000 (UTC)
Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 568A2E0828
	for <gentoo-commits@lists.gentoo.org>; Wed, 28 Sep 2022 00:10:01 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 661E1341105
	for <gentoo-commits@lists.gentoo.org>; Wed, 28 Sep 2022 00:10:00 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id CAE4B5EE
	for <gentoo-commits@lists.gentoo.org>; Wed, 28 Sep 2022 00:09:58 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1664323781.c81b99f1d14ab1f640f3630f897a09a189d4c944.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/xv/
X-VCS-Repository: repo/gentoo
X-VCS-Files: media-gfx/xv/xv-3.10a-r20.ebuild
X-VCS-Directories: media-gfx/xv/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: c81b99f1d14ab1f640f3630f897a09a189d4c944
X-VCS-Branch: master
Date: Wed, 28 Sep 2022 00:09:58 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 7d159dd6-e8f9-4507-a5b0-37c9b12e3bcb
X-Archives-Hash: c4c18b74c6d08bde8336ecc9c0eeaf81

commit:     c81b99f1d14ab1f640f3630f897a09a189d4c944
Author:     orbea <orbea <AT> riseup <DOT> net>
AuthorDate: Sun Sep 25 05:09:09 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Sep 28 00:09:41 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c81b99f1

media-gfx/xv: Fix hardcoded /usr/lib

Bug: https://bugs.gentoo.org/731022
Closes: https://bugs.gentoo.org/731022
Closes: https://github.com/gentoo/gentoo/pull/27435
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-gfx/xv/xv-3.10a-r20.ebuild | 88 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 88 insertions(+)

diff --git a/media-gfx/xv/xv-3.10a-r20.ebuild b/media-gfx/xv/xv-3.10a-r20.ebuild
new file mode 100644
index 000000000000..2121127b27e1
--- /dev/null
+++ b/media-gfx/xv/xv-3.10a-r20.ebuild
@@ -0,0 +1,88 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit desktop flag-o-matic toolchain-funcs
+
+JUMBOV=20070520
+DESCRIPTION="Interactive image manipulation program supporting a wide variety of formats"
+HOMEPAGE="http://www.trilon.com/xv/index.html http://www.sonic.net/~roelofs/greg_xv.html"
+SRC_URI="mirror://sourceforge/png-mng/${P}-jumbo-patches-${JUMBOV}.tar.gz
+	ftp://ftp.cis.upenn.edu/pub/xv/${P}.tar.gz
+	mirror://gentoo/${P}.png.bz2"
+
+LICENSE="xv"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="jpeg tiff png"
+
+DEPEND="x11-libs/libXt
+	jpeg? ( virtual/jpeg:0 )
+	tiff? ( media-libs/tiff:0 )
+	png? ( >=media-libs/libpng-1.2:0= sys-libs/zlib )"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+	"${WORKDIR}/${P}-jumbo-fix-enh-patch-${JUMBOV}.txt"
+	"${FILESDIR}/${P}-osx-bsd-${JUMBOV}.patch"
+	"${FILESDIR}/${P}-vdcomp-osx-${JUMBOV}.patch"
+	"${FILESDIR}/${P}-disable-jp2k-${JUMBOV}.patch"
+	"${FILESDIR}/${P}-fix-wait-${JUMBOV}.patch"
+	"${FILESDIR}/${P}-add-ldflags-${JUMBOV}.patch"
+	"${FILESDIR}/${P}-libpng15-r1.patch"
+	"${FILESDIR}/${P}-wformat-security.patch"
+)
+
+src_prepare() {
+	default
+
+	append-cppflags -DUSE_GETCWD -DLINUX -DUSLEEP
+	use jpeg && append-cppflags -DDOJPEG
+	use png && append-cppflags -DDOPNG
+	use tiff && append-cppflags -DDOTIFF -DUSE_TILED_TIFF_BOTLEFT_FIX
+
+	# Link with various image libraries depending on use flags
+	IMAGE_LIBS=""
+	use jpeg && IMAGE_LIBS="${IMAGE_LIBS} -ljpeg"
+	use png && IMAGE_LIBS="${IMAGE_LIBS} -lz -lpng"
+	use tiff && IMAGE_LIBS="${IMAGE_LIBS} -ltiff"
+
+	sed -i \
+		-e 's/\(^JPEG.*\)/#\1/g' \
+		-e 's/\(^PNG.*\)/#\1/g' \
+		-e 's/\(^TIFF.*\)/#\1/g' \
+		-e "s/\(^LIBS = .*\)/\1${IMAGE_LIBS}/g" Makefile || die
+
+	# 731022
+	sed -i -e "s#lib -lz#$(get_libdir) -lz#" Makefile || die
+
+	# /usr/bin/gzip => /bin/gzip
+	sed -i -e 's#/usr\(/bin/gzip\)#'"${EPREFIX}"'\1#g' config.h || die
+
+	# Fix installation of ps docs
+	sed -i -e 's#$(DESTDIR)$(LIBDIR)#$(LIBDIR)#g' Makefile || die
+}
+
+src_compile() {
+	emake \
+		CC="$(tc-getCC)" CCOPTS="${CPPFLAGS} ${CFLAGS}" LDFLAGS="${LDFLAGS}" \
+		PREFIX="${EPREFIX}"/usr \
+		DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+		LIBDIR="${T}"
+}
+
+src_install() {
+	dodir /usr/bin
+	dodir /usr/share/man/man1
+
+	emake \
+		DESTDIR="${D}" \
+		PREFIX="${EPREFIX}"/usr \
+		DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+		LIBDIR="${T}" install
+
+	dodoc CHANGELOG BUGS IDEAS
+	newicon "${WORKDIR}"/${P}.png ${PN}.png
+	make_desktop_entry xv "" "" "Graphics;Viewer"
+}