diff --git a/packages/libfinalcut/build.sh b/packages/libfinalcut/build.sh new file mode 100644 index 000000000..3801e45ec --- /dev/null +++ b/packages/libfinalcut/build.sh @@ -0,0 +1,13 @@ +TERMUX_PKG_HOMEPAGE=https://github.com/gansm/finalcut +TERMUX_PKG_DESCRIPTION="A C++ class library and widget toolkit for creating a text-based user interface" +TERMUX_PKG_LICENSE="LGPL-3.0" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=0.8.0 +TERMUX_PKG_SRCURL=https://github.com/gansm/finalcut/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=0bb4de87df2c466d5ba6513cadcb691a3387e60884c65c7bd158e8350f7f4829 +TERMUX_PKG_DEPENDS="libc++, ncurses" +TERMUX_PKG_BUILD_IN_SRC=true + +termux_step_pre_configure() { + autoreconf -fi +} diff --git a/packages/libfinalcut/examples-Makefile.am.patch b/packages/libfinalcut/examples-Makefile.am.patch new file mode 100644 index 000000000..e7e5906fe --- /dev/null +++ b/packages/libfinalcut/examples-Makefile.am.patch @@ -0,0 +1,18 @@ +--- a/examples/Makefile.am ++++ b/examples/Makefile.am +@@ -35,7 +35,6 @@ + termcap \ + timer \ + transparent \ +- treeview \ + ui \ + watch \ + windows +@@ -65,7 +64,6 @@ + termcap_SOURCES = termcap.cpp + timer_SOURCES = timer.cpp + transparent_SOURCES = transparent.cpp +-treeview_SOURCES = treeview.cpp + ui_SOURCES = ui.cpp + watch_SOURCES = watch.cpp + windows_SOURCES = windows.cpp diff --git a/packages/libfinalcut/examples-string-operations.cpp.patch b/packages/libfinalcut/examples-string-operations.cpp.patch new file mode 100644 index 000000000..a8b95ee7e --- /dev/null +++ b/packages/libfinalcut/examples-string-operations.cpp.patch @@ -0,0 +1,20 @@ +--- a/examples/string-operations.cpp ++++ b/examples/string-operations.cpp +@@ -76,6 +76,7 @@ + std::cout << " Locale: " << std::setlocale(LC_CTYPE, "") + << std::endl; + ++#ifndef __ANDROID__ + if ( isatty(1) && ! std::strcmp(nl_langinfo(CODESET), "ANSI_X3.4-1968") ) + { + // locale C -> switch from 7bit ascii -> latin1 +@@ -83,6 +84,9 @@ + } + + std::cout << " Codeset: " << nl_langinfo(CODESET) << std::endl; ++#else ++ std::cout << " Codeset: " << "UTF-8" << std::endl; ++#endif + std::cout << "--------------[ FString test ]-----------------" + << std::endl; + } diff --git a/packages/libfinalcut/final-font-unicodemap.h.patch b/packages/libfinalcut/final-font-unicodemap.h.patch new file mode 100644 index 000000000..edafadbfe --- /dev/null +++ b/packages/libfinalcut/final-font-unicodemap.h.patch @@ -0,0 +1,14 @@ +--- a/final/font/unicodemap.h ++++ b/final/font/unicodemap.h +@@ -8,7 +8,11 @@ + #endif + + #if defined(__linux__) ++#ifndef __ANDROID__ + #include ++#else ++ #include ++#endif + #endif + + #include diff --git a/packages/libfinalcut/final-output-tty-fterm.cpp.patch b/packages/libfinalcut/final-output-tty-fterm.cpp.patch new file mode 100644 index 000000000..e4a09dcfb --- /dev/null +++ b/packages/libfinalcut/final-output-tty-fterm.cpp.patch @@ -0,0 +1,41 @@ +--- a/final/output/tty/fterm.cpp ++++ b/final/output/tty/fterm.cpp +@@ -1263,8 +1263,10 @@ + { + // Init current locale + ++#ifndef __ANDROID__ + static const auto& data = FTermData::getInstance(); + const auto& termtype = data.getTermType(); ++#endif + const char* locale_name = std::setlocale (LC_ALL, ""); + std::setlocale (LC_NUMERIC, ""); + +@@ -1275,6 +1277,7 @@ + if ( locale_xterm ) + locale_name = std::setlocale (LC_ALL, locale_xterm); + ++#ifndef __ANDROID__ + // TeraTerm can not show UTF-8 character + if ( data.isTermType(FTermType::tera_term) + && ! std::strcmp(nl_langinfo(CODESET), "UTF-8") ) +@@ -1289,6 +1292,7 @@ + if ( termtype.substr(0, 3) == "sun" + && ! std::strcmp(nl_langinfo(CODESET), "UTF-8") ) + locale_name = std::setlocale (LC_ALL, "C"); ++#endif + + // Try to found a meaningful content for locale_name + if ( locale_name ) +@@ -1364,7 +1368,11 @@ + static const auto& fsys = FSystem::getInstance(); + + if ( fsys->isTTY(stdout_no) ++#ifndef __ANDROID__ + && ! std::strcmp(nl_langinfo(CODESET), "UTF-8") ) ++#else ++ ) ++#endif + { + data.setUTF8Console(true); + data.setTermEncoding (Encoding::UTF8); diff --git a/packages/libfinalcut/final-output-tty-ftermlinux.h.patch b/packages/libfinalcut/final-output-tty-ftermlinux.h.patch new file mode 100644 index 000000000..f0850be1b --- /dev/null +++ b/packages/libfinalcut/final-output-tty-ftermlinux.h.patch @@ -0,0 +1,37 @@ +--- a/final/output/tty/ftermlinux.h ++++ b/final/output/tty/ftermlinux.h +@@ -45,12 +45,16 @@ + #endif + #endif + ++ #ifndef __ANDROID__ + #if defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL) + #define ISA_SYSCTL_SUPPORT + #include + #endif // defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL) + + #include ++ #else /* __ANDROID__ */ ++ #include ++ #endif + #endif // defined(__linux__) + + #include +@@ -237,13 +241,17 @@ + #if defined(__linux__) + bool vga_font{}; + bool new_font{}; ++#ifndef __ANDROID__ + bool has_saved_palette{}; ++#endif + int framebuffer_bpp{-1}; + CursorStyle linux_console_cursor_style{}; + console_font_op screen_font{}; + unimapdesc screen_unicode_map{}; ++#ifndef __ANDROID__ + ColorMap saved_color_map{}; + ColorMap cmap{}; ++#endif + KeyMap key_map{}; + ModifierKey mod_key{}; + #endif // defined(__linux__) diff --git a/packages/libfinalcut/final-util-fstring.h.patch b/packages/libfinalcut/final-util-fstring.h.patch new file mode 100644 index 000000000..fbea793b1 --- /dev/null +++ b/packages/libfinalcut/final-util-fstring.h.patch @@ -0,0 +1,18 @@ +--- a/final/util/fstring.h ++++ b/final/util/fstring.h +@@ -227,9 +227,15 @@ + FString& setNumber (lDouble, int = getPrecision()); + + template ++#ifndef __ANDROID__ + FString& setFormatedNumber (NumT, char = nl_langinfo(THOUSEP)[0]); + FString& setFormatedNumber (sInt64, char = nl_langinfo(THOUSEP)[0]); + FString& setFormatedNumber (uInt64, char = nl_langinfo(THOUSEP)[0]); ++#else ++ FString& setFormatedNumber (NumT, char = '\0'); ++ FString& setFormatedNumber (sInt64, char = '\0'); ++ FString& setFormatedNumber (uInt64, char = '\0'); ++#endif + + const FString& insert (const FString&, int); + const FString& insert (const FString&, std::size_t); diff --git a/packages/libfinalcut/final-util-fsystemimpl.h.patch b/packages/libfinalcut/final-util-fsystemimpl.h.patch new file mode 100644 index 000000000..f74ab998e --- /dev/null +++ b/packages/libfinalcut/final-util-fsystemimpl.h.patch @@ -0,0 +1,15 @@ +--- a/final/util/fsystemimpl.h ++++ b/final/util/fsystemimpl.h +@@ -49,10 +49,12 @@ + #endif + #endif + ++ #ifndef __ANDROID__ + #if defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL) + #define ISA_SYSCTL_SUPPORT + #include + #endif // defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL) ++ #endif /* __ANDROID__ */ + + #endif // defined(__linux__) +