* [gentoo-commits] repo/gentoo:master commit in: media-gfx/potrace/, media-gfx/potrace/files/
@ 2024-03-12 0:26 Sam James
0 siblings, 0 replies; only message in thread
From: Sam James @ 2024-03-12 0:26 UTC (permalink / raw
To: gentoo-commits
commit: 544223720d50b2f2786bccfb32ab124e86782af4
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Mar 12 00:26:30 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Mar 12 00:26:30 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=54422372
media-gfx/potrace: fix build w/ lto on non-amd64
Closes: https://bugs.gentoo.org/868465
Signed-off-by: Sam James <sam <AT> gentoo.org>
media-gfx/potrace/files/potrace-1.16-lto.patch | 18 ++++++++++
media-gfx/potrace/potrace-1.16-r1.ebuild | 48 ++++++++++++++++++++++++++
2 files changed, 66 insertions(+)
diff --git a/media-gfx/potrace/files/potrace-1.16-lto.patch b/media-gfx/potrace/files/potrace-1.16-lto.patch
new file mode 100644
index 000000000000..a1704783f83e
--- /dev/null
+++ b/media-gfx/potrace/files/potrace-1.16-lto.patch
@@ -0,0 +1,18 @@
+https://git.altlinux.org/srpms/p/potrace.git?p=potrace.git;a=commitdiff;h=385f40d2d9827049f5f43f73d05e9fc7472e0da4
+https://bugs.gentoo.org/868465
+--- a/configure.ac
++++ b/configure.ac
+@@ -251,9 +251,10 @@ AC_CHECK_FUNC(strncasecmp, ,
+ dnl ----------------------------------------------------------------------
+ dnl Check whether we have i386 features
+ AC_MSG_CHECKING([for Intel 386])
+-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int x;
+- asm("bsf %1,%0\njnz 0f\nmovl $32,%0\n0:":"=r"(x):"r"(x));
+- return x; /* need this so that -O2 does not optimize the asm away */
++AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[int x = 1;
++ volatile asm("bsf %1,%0\njnz 0f\nmovl $32,%0\n0:":"=r"(x):"r"(x):"memory");
++ /* volatile and "memory" clobber ensures '-O2 -flto' does not optimize the asm away */
++ return x;
+ ]])],[AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_I386,, Can we use Intel 386 optimizations?)
+ ],[AC_MSG_RESULT(no)])
diff --git a/media-gfx/potrace/potrace-1.16-r1.ebuild b/media-gfx/potrace/potrace-1.16-r1.ebuild
new file mode 100644
index 000000000000..ac9fe7c8ddb2
--- /dev/null
+++ b/media-gfx/potrace/potrace-1.16-r1.ebuild
@@ -0,0 +1,48 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools toolchain-funcs
+
+DESCRIPTION="Transforming bitmaps into vector graphics"
+HOMEPAGE="https://potrace.sourceforge.net/"
+SRC_URI="https://potrace.sourceforge.net/download/${PV}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
+IUSE="metric"
+
+RDEPEND="sys-libs/zlib:="
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.16-lto.patch
+)
+
+src_prepare() {
+ default
+
+ # Needed for lto patch
+ eautoreconf
+}
+
+src_configure() {
+ tc-export CC # bug 610098
+ local myeconfargs=(
+ --disable-static
+ --enable-zlib
+ --with-libpotrace
+ $(use_enable metric a4)
+ $(use_enable metric)
+ )
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ default
+
+ # no static archives
+ find "${ED}" -name '*.la' -delete || die
+}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-03-12 0:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-12 0:26 [gentoo-commits] repo/gentoo:master commit in: media-gfx/potrace/, media-gfx/potrace/files/ Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox