summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIonen Wolkens <ionen@gentoo.org>2024-12-24 19:16:13 -0500
committerIonen Wolkens <ionen@gentoo.org>2024-12-26 12:48:28 -0500
commitbf28418f30a122955e636dfba07d29cfa7447e75 (patch)
treed03ab8ee09442df1ad060eaebfbee8d4be21dad9 /x11-libs
parentx11-libs/fltk: add myself as a maintainer (diff)
downloadgentoo-bf28418f30a122955e636dfba07d29cfa7447e75.tar.gz
gentoo-bf28418f30a122955e636dfba07d29cfa7447e75.tar.bz2
gentoo-bf28418f30a122955e636dfba07d29cfa7447e75.zip
x11-libs/fltk: add 1.4.1
Brand new ebuild not really based on the old. Changes may or may not introduce some regressions, but will see to these as needed. Regardless of the ebuild, note some revdeps may be broken with fltk-1.4.x. "Often" it's just trivial like a missing include (IWYU) or an include needing different casing due to compatibility symlinks (e.g. Fl/Fl_file_chooser.H -> FL/Fl_File_Chooser.H>) being dropped. Upstream discourages re-enabling them and suggests fixing packages instead. Some revdeps may also be relying on X-specific things (e.g. including x.H and using fl_display), and may need to depend on fltk[X(+)] (have not really looked at if things work on wayland). x.H is also deprecated and due for removal, should use platform.H. I've fixed a few while updating revdeps for := and USE changes but haven't tried nor handled everything myself. That aside, overview of (some) notable ebuild differences vs old: * Use cmake Upstream plans to remove autotools support in 1.5.0, so. * Actually run some tests The old ebuild's src_test was just building tests and never running anything, so at least run (minor) "unittests --core" like upstream's CI does. * Add subslot Gets a new soname + ABI incompatible changes every 1.x versions, but <1.3 is so old that never got a subslot (see README.abi-version.txt). * Drop multilib Do not think this is worth keeping. At most old 32bit prebuilts can need 32bit fltk but they cannot use 1.4 due to soname/ABI changes. (*if* really needed could consider a fltk-compat:1.3 for these). Can revisit if a reason to. * Drop USE=games Not convinced that there is real interest in these example apps being installed, and they all have generic naming by default (e.g. previous was installing /usr/bin/sudoku) making it easy to conflict. They also need to be installed manually (no cmake option for this that I can see at the moment). Could revisit if there is actual users and it is not just for completeness. * Drop USE=xft Can use either pango or xft w/ USE=X with pango being preferred, and it is kind of bogus to disable both (breaks things in unexpected ways). So now USE=cairo will use pango (forced by build system if cairo is enabled, -DFLTK_USE_PANGO accomplishes little), and USE=-cairo uses xft only. Pango/cairo is not optional for wayland, and that's why USE=cairo is default enabled now (also because it supposedly renders better on X as well). * Drop USE=threads, always enabled Nothing special there, but requires adjusting some revdeps w/ (+) * Drop USE=xinerama and always depend on it if USE=X Could understand some users not wanting it, however, for some reason -DFLTK_USE_XINERAMA is ignored when USE="X wayland" (works if -wayland) and README.Wayland.txt says that xinerama is always required if X11 is enabled as well. *could* make it optional with -wayland but that felt messy and a req use of "wayland? ( X? ( xinerama ) )" seems confusing. Ultimately it was enabled by default before and it's a very small dep. May revisit only after the build system gets polished and if there's a demand. * Drop env.d file and -rpath hacks This doesn't install in /usr/lib*/fltk anymore and so no need for LDPATH, and if the FLTK_DOCDIR env var is unset it should fallback to the builtin path which points to /usr/share/doc/${PF}/html (albeit the in-app help browser renders these rather poorly right now, better use a real browser). * Misc notes Was tempted to drop USE=static-libs, but I believe there is a demand for this on this package, may revisit. Considered making fluid optional being a GUI app for developers, but it's also used at build time by some packages and it's not worth being conditional on Gentoo then. It may be possible to make dbus optional with USE=wayland, but build system has no switch for it (automagic-only), so hard-depend for now. For those trying to avoid X libs, hard libglvnd[X] is not a typo, USE="-X wayland opengl" still links with libGLX->libX11 at the moment. Like before, fltk-config --ldflags still gives a wall of unnecessary libraries (that libftlk.so is linked with, more than before w/ wayland) due to expecting static -- but otherwise appears fine despite generated by cmake. bug #494390: pdf build is explicitly disabled in this version, so it shouldn't be trying to use latex (build system also changed, if still into something please open a new bug). Closes: https://bugs.gentoo.org/494390 Closes: https://bugs.gentoo.org/946882 Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'x11-libs')
-rw-r--r--x11-libs/fltk/Manifest1
-rw-r--r--x11-libs/fltk/files/fltk-1.4.1-fltk-config.patch25
-rw-r--r--x11-libs/fltk/files/fltk-1.4.1-tests-odr.patch9
-rw-r--r--x11-libs/fltk/fltk-1.4.1.ebuild113
4 files changed, 148 insertions, 0 deletions
diff --git a/x11-libs/fltk/Manifest b/x11-libs/fltk/Manifest
index 3864bc146832..afcb53fdfabb 100644
--- a/x11-libs/fltk/Manifest
+++ b/x11-libs/fltk/Manifest
@@ -1,2 +1,3 @@
DIST fltk-1.3.5-source.tar.gz 5261324 BLAKE2B df05989d6581b570c689e29e9f31e5fc85fa91dee1296d70b5f5c3b4aab527749850ea78bec3ef5947151b21598c3bb04e52f78b5e6db179e7fd922627862b5e SHA512 db7ea7c5f3489195a48216037b9371a50f1119ae7692d66f71b6711e5ccf78814670581bae015e408dee15c4bba921728309372c1cffc90113cdc092e8540821
DIST fltk-1.3.8-source.tar.gz 5335306 BLAKE2B 8c2d2fca4243c0e7c5a8aa46083940f99c8b3e7873d39d6e590a4b66587876393f209e5e7e5eaf4a4cc13f0f97cb03671d97129853b0146eeab409aaf687935e SHA512 5c1cbfc156c49888e25b90dcb9b1ab86a03447e08e00864c3c7ae8a0e32cfbd9154ee630054235c9edfd29fd1d0371ae77eff7b78094fb660dbbdec5cecfc8fb
+DIST fltk-1.4.1-source.tar.bz2 8456879 BLAKE2B 0301cfa7f47cde892b390ccabc1724d055cee2544cec6afe60cb1d62fed644d0100865e1889b70c06b8c4169a1af4285500a746e4c82ecb4908567c5887fc084 SHA512 90b223f66e3a8eb23225a259cddfeb90f1f8744ff6a366f274923c1c34d251e028835755d1738efb53398ac7e45e362a71542978faef04fc3d84a87f7b722037
diff --git a/x11-libs/fltk/files/fltk-1.4.1-fltk-config.patch b/x11-libs/fltk/files/fltk-1.4.1-fltk-config.patch
new file mode 100644
index 000000000000..ee933b46b4df
--- /dev/null
+++ b/x11-libs/fltk/files/fltk-1.4.1-fltk-config.patch
@@ -0,0 +1,25 @@
+The "CFLAGS" variable here concatenates user's CFLAGS (unwanted in
+fltk-config's @CFLAGS@) and FLTK_CFLAGS a bit below (wanted).
+
+So prevent addition of CMAKE_C_FLAGS_* and keep the rest.
+
+CXXFLAGS not touched given it does set(CXXFLAGS "${CFLAGS}").
+
+Also drop @LDFLAGS@ as a precaution, it's not currently set by cmake
+but it's likely an oversight. @LARGEFILE@ (currently still in .in) and
+such are only used by autoconf (cmake appends into @CFLAGS@).
+--- a/CMake/variables.cmake
++++ b/CMake/variables.cmake
+@@ -139,6 +139 @@
+-string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_UPPER)
+-if(${BUILD_UPPER})
+- set(CFLAGS "${CMAKE_C_FLAGS_${BUILD_UPPER}} ${CFLAGS}")
+-endif(${BUILD_UPPER})
+-
+-set(CFLAGS "${FLTK_OPTION_OPTIM} ${CMAKE_C_FLAGS} ${CFLAGS}")
++set(CFLAGS "${FLTK_OPTION_OPTIM} ${CFLAGS}")
+--- a/fltk-config.in
++++ b/fltk-config.in
+@@ -38 +38 @@
+-LDFLAGS="@LDFLAGS@"
++LDFLAGS=""
diff --git a/x11-libs/fltk/files/fltk-1.4.1-tests-odr.patch b/x11-libs/fltk/files/fltk-1.4.1-tests-odr.patch
new file mode 100644
index 000000000000..7243efa21fcd
--- /dev/null
+++ b/x11-libs/fltk/files/fltk-1.4.1-tests-odr.patch
@@ -0,0 +1,9 @@
+We only use the unittests-shared example and this unused one has ODR
+violations. Skip building it for now rather than filter-lto w/ tests
+to avoid triggering -Werror=odr -flto CI (ideally would want to only
+build unittests and not have to worry about build time + quirks of
+all examples).
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -100 +99,0 @@
+-fl_create_example(coordinates coordinates.cxx fltk::fltk)
diff --git a/x11-libs/fltk/fltk-1.4.1.ebuild b/x11-libs/fltk/fltk-1.4.1.ebuild
new file mode 100644
index 000000000000..c783579112e2
--- /dev/null
+++ b/x11-libs/fltk/fltk-1.4.1.ebuild
@@ -0,0 +1,113 @@
+# Copyright 2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake edo xdg
+
+DESCRIPTION="Fast Light GUI Toolkit"
+HOMEPAGE="https://www.fltk.org/"
+SRC_URI="https://github.com/fltk/fltk/releases/download/release-${PV}/${P}-source.tar.bz2"
+
+LICENSE="FLTK LGPL-2 MIT ZLIB"
+SLOT="1/$(ver_cut 1-2)" # README.abi-version.txt
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux"
+IUSE="+X +cairo doc examples opengl static-libs test wayland"
+REQUIRED_USE="
+ || ( X wayland )
+ wayland? ( cairo )
+"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ media-libs/libjpeg-turbo:=
+ media-libs/libpng:=
+ sys-libs/zlib:=
+ X? (
+ x11-libs/libX11
+ x11-libs/libXcursor
+ x11-libs/libXfixes
+ x11-libs/libXinerama
+ !cairo? (
+ media-libs/fontconfig
+ x11-libs/libXft
+ x11-libs/libXrender
+ )
+ )
+ cairo? (
+ dev-libs/glib:2
+ x11-libs/cairo
+ x11-libs/pango[X?]
+ )
+ opengl? (
+ media-libs/glu
+ media-libs/libglvnd[X]
+ )
+ wayland? (
+ dev-libs/wayland
+ gui-libs/libdecor
+ sys-apps/dbus
+ x11-libs/libxkbcommon
+ )
+"
+DEPEND="
+ ${RDEPEND}
+ X? ( x11-base/xorg-proto )
+ wayland? ( dev-libs/wayland-protocols )
+"
+BDEPEND="
+ doc? ( app-text/doxygen )
+ wayland? ( dev-util/wayland-scanner )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.4.1-fltk-config.patch
+ "${FILESDIR}"/${PN}-1.4.1-tests-odr.patch
+)
+
+src_prepare() {
+ cmake_src_prepare
+
+ # fluid can optionally use html docs at runtime, adjust path
+ sed -i "s|\${FLTK_DOCDIR}/fltk|&-${PVR}/html|" CMake/export.cmake || die
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DFLTK_BACKEND_WAYLAND=$(usex wayland)
+ -DFLTK_BACKEND_X11=$(usex X)
+ -DFLTK_BUILD_FLUID=yes
+ -DFLTK_BUILD_FLUID_DOCS=no
+ -DFLTK_BUILD_GL=$(usex opengl)
+ -DFLTK_BUILD_HTML_DOCS=$(usex doc)
+ -DFLTK_BUILD_PDF_DOCS=no
+ -DFLTK_BUILD_SHARED_LIBS=yes
+ -DFLTK_BUILD_TEST=$(usex test)
+ -DFLTK_GRAPHICS_CAIRO=$(usex cairo)
+ -DFLTK_OPTION_STD=yes # will be removed & forced ON in fltk-1.5
+ )
+
+ cmake_src_configure
+}
+
+src_compile() {
+ cmake_src_compile all $(usev doc docs)
+}
+
+src_test() {
+ # same that upstream's CI does except with the shared version
+ edo "${BUILD_DIR}"/bin/test/unittests-shared --core
+}
+
+src_install() {
+ local DOCS=(
+ ANNOUNCEMENT CHANGES* CREDITS.txt README*
+ $(usev examples)
+ # simpler than using -DFLTK_INSTALL_HTML_DOCS for the location
+ $(usev doc "${BUILD_DIR}"/documentation/html)
+ )
+ cmake_src_install
+
+ # currently no option to disable building static libs
+ use static-libs || rm -- "${ED}"/usr/$(get_libdir)/*.a || die
+}