diff --git a/recipes-graphics/ntk/files/0001-wscript-check-compile-instead-of-tun-check-datatype-.patch b/recipes-graphics/ntk/files/0001-wscript-check-compile-instead-of-tun-check-datatype-.patch new file mode 100644 index 0000000..a335bba --- /dev/null +++ b/recipes-graphics/ntk/files/0001-wscript-check-compile-instead-of-tun-check-datatype-.patch @@ -0,0 +1,81 @@ +From 281158892d69815f4f8c40467c9900d105fb7f9b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Andreas=20M=C3=BCller?= +Date: Fri, 30 Jun 2017 22:40:22 +0200 +Subject: [PATCH] wscript: check compile- instead of tun-check datatype sizes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When cross compiling run checks are a challenge if not impossible + +Upstream-Status: Submitted [1] + +[1] https://github.com/original-male/ntk/pull/9 + +Signed-off-by: Andreas Müller +--- + wscript | 42 +++++++++++++++++++++--------------------- + 1 file changed, 21 insertions(+), 21 deletions(-) + +diff --git a/wscript b/wscript +index 2b4e27d..3188af9 100644 +--- a/wscript ++++ b/wscript +@@ -72,6 +72,21 @@ def options(opt): + opt.add_option('--enable-test', action='store_true', default=False, dest='ENABLE_TEST', + help='Build test programs') + ++# inspired by: http://www.gnu.org/software/autoconf-archive/ax_compile_check_sizeof.html ++def check_ctype_size(conf, datatype, define_name): ++ for bytesize in [1, 2, 4, 8, 16]: ++ code="#include \nint main (int argc,char **argv) { switch (0) case 0: case (sizeof (%s) == %i):; }" % (datatype, bytesize) ++ try: ++ conf.check( ++ fragment=code, ++ execute = False, ++ msg='Checking for %s has size %i' % (datatype, bytesize), ++ mandatory=True) ++ conf.define(define_name, bytesize) ++ break ++ except: ++ pass ++ + def configure(conf): + conf.load('compiler_c') + conf.load('compiler_cxx') +@@ -170,27 +186,11 @@ def configure(conf): + + # print conf.env + +- conf.check( fragment='#include \n int main ( int argc, char **argv ) { printf("%u", (unsigned)sizeof(short)); return 0; }', +- execute=True, +- define_ret=True, +- quote=False, +- define_name='SIZEOF_SHORT', +- msg='Checking sizeof short', +- mandatory=True); +- +- conf.check( fragment='#include \n int main ( int argc, char **argv ) { printf("%u", (unsigned)sizeof(int)); return 0; }', +- execute=True, +- quote=False, +- define_ret=True, +- msg='Checking sizeof int', +- define_name='SIZEOF_INT', mandatory=True ); +- +- conf.check( fragment='#include \n int main ( int argc, char **argv ) { printf("%u", (unsigned)sizeof(long)); return 0; }', +- quote=False, +- execute=True, +- define_ret=True, +- msg='Checking sizeof long', +- define_name='SIZEOF_LONG', mandatory=True ); ++ check_ctype_size(conf, 'short', 'SIZEOF_SHORT') ++ ++ check_ctype_size(conf, 'int', 'SIZEOF_INT') ++ ++ check_ctype_size(conf, 'long', 'SIZEOF_LONG') + + if int(conf.get_define('SIZEOF_SHORT')) == 2: + conf.define( 'U16', 'unsigned short', quote=False ) +-- +2.9.4 + diff --git a/recipes-graphics/ntk/ntk_git.bb b/recipes-graphics/ntk/ntk_git.bb new file mode 100644 index 0000000..ceba5b5 --- /dev/null +++ b/recipes-graphics/ntk/ntk_git.bb @@ -0,0 +1,39 @@ +SUMMARY = "NTK is a fork of FLTK" +SECTION = "libs" +LICENSE = "LGPLv2 & FLTK" +LIC_FILES_CHKSUM = "file://COPYING;md5=f6b26344a24a941a01a5b0826e80b5ca" + +SRC_URI = " \ + git://github.com/original-male/${BPN}.git \ + file://0001-wscript-check-compile-instead-of-tun-check-datatype-.patch \ +" +SRCREV = "1e3f5106d404562902bed2983403301db24a3f78" +S = "${WORKDIR}/git" +PV_LAST_RELEASE = "1.3.1000" +PV = "${PV_LAST_RELEASE}" + +inherit waf pkgconfig + +DEPENDS = " \ + cairo \ + libpng \ + jpeg \ + zlib \ + libxft \ +" + +WAF_EXTRA_CONF = " \ + --libdir=${libdir} \ +" + +do_install_append() { + rm ${D}${libdir}/libntk.a + rm ${D}${libdir}/libntk.a.1 + mv ${D}${libdir}/libntk.a.${PV_LAST_RELEASE} ${D}${libdir}/libntk.a + + rm ${D}${libdir}/libntk_images.a + rm ${D}${libdir}/libntk_images.a.1 + mv ${D}${libdir}/libntk_images.a.${PV_LAST_RELEASE} ${D}${libdir}/libntk_images.a +} + +BBCLASSEXTEND = "native"