fltk: rework completely

* Use cmake as build system. Projects also using cmake and depending on fltk
  would not find all required components. Note that FindFLTK.cmake is part of
  cmake.
* Add a native recipe and split out common - we need fluid (Fast Light User
  Interface Designer) as working binary

Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
This commit is contained in:
Andreas Müller 2017-02-28 02:09:42 +01:00 committed by Martin Jansa
parent b6e7cc35d4
commit 2c78fa9134
6 changed files with 141 additions and 47 deletions

View File

@ -0,0 +1,16 @@
require ${BPN}.inc
DEPENDS = "zlib-native jpeg-native libpng-native libxext-native libxft-native"
inherit native
EXTRA_OECMAKE += " \
-DOPTION_BUILD_SHARED_LIBS=OFF \
-DOPTION_USE_THREADS=OFF \
-DOPTION_USE_XDBE=OFF \
-DOPTION_USE_XFT=OFF \
-DOPTION_BUILD_EXAMPLES=OFF \
-DOPTION_USE_XINERAMA=OFF \
-DOPTION_USE_XFIXES=OFF \
-DOPTION_USE_XCURSOR=OFF \
"

View File

@ -0,0 +1,34 @@
require ${BPN}.inc
DEPENDS = "alsa-lib zlib jpeg libpng libxext libxft ${BPN}-native"
inherit binconfig lib_package gtk-icon-cache mime
EXTRA_OECMAKE = " \
-DOPTION_BUILD_SHARED_LIBS=ON \
-DOPTION_USE_THREADS=ON \
-DOPTION_USE_XDBE=ON \
-DOPTION_USE_XFT=ON \
-DFLTK_CONFIG_PATH=${libdir}/cmake \
"
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)}"
PACKAGECONFIG[examples] = "-DOPTION_BUILD_EXAMPLES=ON,-DOPTION_BUILD_EXAMPLES=OFF,"
PACKAGECONFIG[opengl] = "-DOPTION_USE_GL=ON,-DOPTION_USE_GL=OFF,virtual/libgl"
PACKAGECONFIG[xinerama] = "-DOPTION_USE_XINERAMA=ON,-DOPTION_USE_XINERAMA=OFF,libxinerama"
PACKAGECONFIG[xfixes] = "-DOPTION_USE_XFIXES=ON,-DOPTION_USE_XFIXES=OFF,libxfixes"
PACKAGECONFIG[xcursor] = "-DOPTION_USE_XCURSOR=ON,-DOPTION_USE_XCURSOR=OFF,libxcursor"
do_install_append() {
sed -i -e 's,${STAGING_DIR_HOST},,g' ${D}${bindir}/fltk-config
}
python populate_packages_prepend () {
if (d.getVar('DEBIAN_NAMES')):
d.setVar('PKG_${BPN}', 'libfltk${PV}')
}
LEAD_SONAME = "libfltk.so"
FILES_${PN} += "${datadir}/mime"

View File

@ -0,0 +1,21 @@
SUMMARY = "FLTK is a cross-platform C++ GUI toolkit"
HOMEPAGE = "http://www.fltk.org"
SECTION = "libs"
LICENSE = "LGPLv2 & FLTK"
LIC_FILES_CHKSUM = "file://COPYING;md5=f6b26344a24a941a01a5b0826e80b5ca"
SRC_URI = " \
http://fltk.org/pub/fltk/1.3.4/${BP}-source.tar.gz \
file://disable_test.patch \
file://fltk-no-freetype-config.patch \
file://0001-Fl_Preferences.cxx-do-not-use-dlopen-in-case-glibc-s.patch \
file://0002-always-build-fluid-and-export-pointers.patch \
"
PV = "1.3.4-1"
SRC_URI[md5sum] = "d7fcd27ab928648e1a1366dd2e273970"
SRC_URI[sha256sum] = "7fb2c8882433ce694e6900c94fda505e8f4ed3fa9c7e597007098a33b85c53f4"
inherit cmake pkgconfig
TARGET_CC_ARCH += "${LDFLAGS} -DXFT_MAJOR=2"

View File

@ -0,0 +1,39 @@
From e76a062338063615c069fedc5a143cc38c34d9b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
Date: Tue, 28 Feb 2017 01:00:21 +0100
Subject: [PATCH] Fl_Preferences.cxx: do not use dlopen in case glibc's headers
are missing
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
| /home/work/x86_64-linux/fltk-native/1.3.4-1-r0/fltk-1.3.4-1/src/Fl_Preferences.cxx: In static member function static int Fl_Plugin_Manager::load(const char*):
| /home/work/x86_64-linux/fltk-native/1.3.4-1-r0/fltk-1.3.4-1/src/Fl_Preferences.cxx:1741:27: error: RTLD_LAZY was not declared in this scope
| dl = dlopen(filename, RTLD_LAZY);
| ^~~~~~~~~
| /home/work/x86_64-linux/fltk-native/1.3.4-1-r0/fltk-1.3.4-1/src/Fl_Preferences.cxx:1741:36: error: dlopen was not declared in this scope
| dl = dlopen(filename, RTLD_LAZY);
| ^
| src/CMakeFiles/fltk.dir/build.make:1217: recipe for target 'src/CMakeFiles/fltk.dir/Fl_Preferences.cxx.o' failed
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
src/Fl_Preferences.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/Fl_Preferences.cxx b/src/Fl_Preferences.cxx
index 1233bb1..7857b9b 100644
--- a/src/Fl_Preferences.cxx
+++ b/src/Fl_Preferences.cxx
@@ -1737,7 +1737,7 @@ int Fl_Plugin_Manager::load(const char *filename) {
HMODULE dl = LoadLibrary(filename);
#else
void * dl = NULL;
-# if HAVE_DLSYM
+# if HAVE_DLSYM && HAVE_DLFCN_H
dl = dlopen(filename, RTLD_LAZY);
# endif
#endif
--
2.9.3

View File

@ -0,0 +1,31 @@
From 16010cb1a69ea2326d8102b7f1e34b65aca4b278 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com>
Date: Tue, 28 Feb 2017 01:20:42 +0100
Subject: [PATCH] always build fluid and export pointers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Upstream-Status: Inappropriate [embedded specific]
Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com>
---
CMake/export.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMake/export.cmake b/CMake/export.cmake
index 968186a..95e04eb 100644
--- a/CMake/export.cmake
+++ b/CMake/export.cmake
@@ -21,7 +21,7 @@
# final config and export
#######################################################################
# Set the fluid executable path
-if(CMAKE_CROSSCOMPILING)
+if(FALSE)
find_file(FLUID_PATH
NAMES fluid fluid.exe
PATHS ENV PATH
--
2.9.3

View File

@ -1,47 +0,0 @@
SUMMARY = "FLTK is a cross-platform C++ GUI toolkit"
HOMEPAGE = "http://www.fltk.org"
SECTION = "libs"
LICENSE = "LGPLv2 & FLTK"
LIC_FILES_CHKSUM = "file://COPYING;md5=f6b26344a24a941a01a5b0826e80b5ca"
DEPENDS = "alsa-lib zlib jpeg libpng libxext libxft"
SRC_URI = " \
http://fltk.org/pub/fltk/1.3.4/${BP}-source.tar.gz \
file://disable_test.patch \
file://fltk-no-freetype-config.patch \
"
SRC_URI[md5sum] = "d7fcd27ab928648e1a1366dd2e273970"
SRC_URI[sha256sum] = "7fb2c8882433ce694e6900c94fda505e8f4ed3fa9c7e597007098a33b85c53f4"
inherit autotools-brokensep binconfig pkgconfig lib_package
EXTRA_AUTORECONF = "--exclude=autopoint,autoheader"
TARGET_CC_ARCH += "${LDFLAGS} -DXFT_MAJOR=2"
EXTRA_OECONF = "--enable-shared \
--enable-threads \
--enable-xdbe \
--enable-xft \
"
PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'opengl', d)}"
PACKAGECONFIG[opengl] = "--enable-gl,--disable-gl,virtual/libgl"
PACKAGECONFIG[xinerama] = "--enable-xinerama,--disable-xinerama,libxinerama"
PACKAGECONFIG[xfixes] = "--enable-xfixes,--disable-xfixes,libxfixes"
PACKAGECONFIG[xcursor] = "--enable-xcursor,--disable-xcursor,libxcursor"
do_install_append_class-target() {
sed -i -e 's,${STAGING_DIR_HOST},,g' ${D}${bindir}/fltk-config
}
python populate_packages_prepend () {
if (d.getVar('DEBIAN_NAMES')):
d.setVar('PKG_${BPN}', 'libfltk${PV}')
}
LEAD_SONAME = "libfltk.so"