diff options
author | Brahmajit Das <brahmajit.xyz@gmail.com> | 2023-09-30 16:42:53 +0000 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2023-10-01 08:51:05 +0100 |
commit | 70bdf05c10196156f22d2a2c76b48755a995f08f (patch) | |
tree | c4ce9d99dc988cde6d9095c14f15e37fea3c9698 | |
parent | dev-libs/libgee: move vala_setup to src_configure (diff) | |
download | gentoo-70bdf05c10196156f22d2a2c76b48755a995f08f.tar.gz gentoo-70bdf05c10196156f22d2a2c76b48755a995f08f.tar.bz2 gentoo-70bdf05c10196156f22d2a2c76b48755a995f08f.zip |
x11-libs/fox: Fix C++17 does not allow register storage class
Closes: https://bugs.gentoo.org/898866
Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/31357
Signed-off-by: Sam James <sam@gentoo.org>
-rw-r--r-- | x11-libs/fox/files/fox-1.7.67-pthread_rwlock_prefer_writer_np-musl.patch | 24 | ||||
-rw-r--r-- | x11-libs/fox/fox-1.7.67-r2.ebuild | 118 |
2 files changed, 142 insertions, 0 deletions
diff --git a/x11-libs/fox/files/fox-1.7.67-pthread_rwlock_prefer_writer_np-musl.patch b/x11-libs/fox/files/fox-1.7.67-pthread_rwlock_prefer_writer_np-musl.patch new file mode 100644 index 000000000000..21d37687f44e --- /dev/null +++ b/x11-libs/fox/files/fox-1.7.67-pthread_rwlock_prefer_writer_np-musl.patch @@ -0,0 +1,24 @@ +https://bugs.gentoo.org/898866 +From: Brahmajit Das <brahmajit.xyz@gmail.com> +Date: Sat, 17 Jun 2023 15:32:10 +0000 +Subject: [PATCH 1/1] Fix building against musl C library + +PTHREAD_RWLOCK_PREFER_WRITER_NP isn't available in musl libc/non-glibc +systems. Checking for only __linux__ being defined isn't enough, +additional check of __GLIBC__ being defined is needed. + +Signed-off-by: Brahmajit Das <brahmajit.xyz@gmail.com> +--- a/lib/FXReadWriteLock.cpp ++++ b/lib/FXReadWriteLock.cpp +@@ -80,7 +80,7 @@ FXReadWriteLock::FXReadWriteLock(){ + FXASSERT(sizeof(data)>=sizeof(pthread_rwlock_t)); + pthread_rwlockattr_t rwlockatt; + pthread_rwlockattr_init(&rwlockatt); +-#if defined(__linux__) ++#if defined(__linux__) && defined(__GLIBC__) + pthread_rwlockattr_setkind_np(&rwlockatt,PTHREAD_RWLOCK_PREFER_WRITER_NP); + #endif + pthread_rwlock_init((pthread_rwlock_t*)data,&rwlockatt); +-- +2.41.0 + diff --git a/x11-libs/fox/fox-1.7.67-r2.ebuild b/x11-libs/fox/fox-1.7.67-r2.ebuild new file mode 100644 index 000000000000..14540fa95257 --- /dev/null +++ b/x11-libs/fox/fox-1.7.67-r2.ebuild @@ -0,0 +1,118 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit autotools + +DESCRIPTION="C++ Toolkit for developing Graphical User Interfaces easily and effectively" +HOMEPAGE="http://www.fox-toolkit.org/" +SRC_URI="ftp://ftp.fox-toolkit.org/pub/${P}.tar.gz" + +LICENSE="LGPL-2.1" +SLOT="1.7" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" +IUSE="+bzip2 +jpeg +opengl +png tiff +truetype +zlib debug doc profile tools" + +RDEPEND=" + x11-libs/fox-wrapper + x11-libs/libXcursor + x11-libs/libXrandr + bzip2? ( app-arch/bzip2 ) + jpeg? ( media-libs/libjpeg-turbo:= ) + opengl? ( virtual/glu virtual/opengl ) + png? ( media-libs/libpng:= ) + tiff? ( media-libs/tiff:= ) + truetype? ( + media-libs/freetype:2 + x11-libs/libXft + ) + zlib? ( sys-libs/zlib )" +DEPEND="${RDEPEND} + x11-base/xorg-proto + x11-libs/libXt" +BDEPEND="doc? ( app-doc/doxygen )" + +PATCHES=( + "${FILESDIR}"/"${PN}"-1.7.67-no-truetype.patch + "${FILESDIR}"/"${PN}"-1.7.67-pthread_rwlock_prefer_writer_np-musl.patch +) + +src_prepare() { + default + + sed -i '/#define REXDEBUG 1/d' lib/FXRex.cpp || die "Unable to remove spurious debug line." + sed -i -e "s:windows::" Makefile.am || die + sed -i -e 's/register //g' lib/*.cpp || die "Unable remove register keywords from sources under lib folder" + sed -i -e 's/register //g' shutterbug/*.cpp || die "Unable remove register keywords from sources under shutterbug folder" + sed -i -e 's/register //g' calculator/*.cpp || die "Unable remove register keywords from sources under calculator folder" + sed -i -e 's/register //g' glviewer/*.cpp || die "Unable remove register keywords from sources under glviewer folder" + sed -i -e 's/register //g' chart/*.cpp || die "Unable remove register keywords from sources under chart folder" + if ! use tools; then + local d + for d in adie calculator pathfinder shutterbug; do + sed -i -e "s:${d}::" Makefile.am || die + done + fi + + # Respect system CXXFLAGS + sed -i -e 's:CXXFLAGS=""::' configure.ac || die "Unable to force cxxflags." + + # don't strip binaries + sed -i -e '/LDFLAGS="-s ${LDFLAGS}"/d' configure.ac || die "Unable to prevent stripping." + + eautoreconf +} + +src_configure() { + econf \ + --disable-static \ + --enable-$(usex debug debug release) \ + $(use_enable bzip2 bz2lib) \ + $(use_enable jpeg) \ + $(use_with opengl) \ + $(use_enable png) \ + $(use_enable tiff) \ + $(use_with truetype xft) \ + $(use_enable zlib) \ + $(use_with profile profiling) +} + +src_compile() { + emake + use doc && emake -C doc docs +} + +src_install() { + emake install \ + DESTDIR="${D}" \ + htmldir="${EPREFIX}"/usr/share/doc/${PF}/html \ + artdir="${EPREFIX}"/usr/share/doc/${PF}/html/art \ + screenshotsdir="${EPREFIX}"/usr/share/doc/${PF}/html/screenshots + + local CP="${ED}"/usr/bin/ControlPanel + if [[ -f ${CP} ]]; then + mv "${CP}" "${ED}"/usr/bin/fox-ControlPanel-${SLOT} || \ + die "Failed to install ControlPanel" + fi + + dodoc ADDITIONS AUTHORS LICENSE_ADDENDUM README TRACING + + if use doc; then + # install class reference docs if USE=doc + docinto html + dodoc -r doc/ref + else + # remove documentation if USE=-doc + rm -rf "${ED}"/usr/share/doc/${PF}/html || die + fi + + # slot fox-config + if [[ -f ${ED}/usr/bin/fox-config ]] ; then + mv "${ED}"/usr/bin/fox-config "${ED}"/usr/bin/fox-${SLOT}-config \ + || die "failed to install fox-config" + fi + + # no static archives + find "${D}" -name '*.la' -delete || die +} |