new package: libfinalcut

This commit is contained in:
Tee KOBAYASHI 2022-01-24 19:33:28 +09:00 committed by xtkoba
parent 21758313b9
commit 2d314e8f3c
8 changed files with 176 additions and 0 deletions

View File

@ -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
}

View File

@ -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

View File

@ -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;
}

View File

@ -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 <sys/kd.h>
+#else
+ #include <linux/kd.h>
+#endif
#endif
#include <array>

View File

@ -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);

View File

@ -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 <sys/io.h>
#endif // defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL)
#include <sys/kd.h>
+ #else /* __ANDROID__ */
+ #include <linux/kd.h>
+ #endif
#endif // defined(__linux__)
#include <sys/ioctl.h>
@@ -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__)

View File

@ -0,0 +1,18 @@
--- a/final/util/fstring.h
+++ b/final/util/fstring.h
@@ -227,9 +227,15 @@
FString& setNumber (lDouble, int = getPrecision<lDouble>());
template <typename NumT>
+#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);

View File

@ -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 <sys/io.h>
#endif // defined(__x86_64__) || defined(__i386) || defined(ARM_ISA_SYSCTL)
+ #endif /* __ANDROID__ */
#endif // defined(__linux__)