x11-packages/fontforge-gtk

This commit is contained in:
termux-actions[bot]
2022-05-17 23:21:38 +00:00
parent 078f17f617
commit 46ac4e6bc9
6 changed files with 105 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
TERMUX_PKG_HOMEPAGE=https://fontforge.org/
TERMUX_PKG_DESCRIPTION="A free (libre) font editor"
TERMUX_PKG_LICENSE="GPL-3.0, BSD 3-Clause"
TERMUX_PKG_LICENSE_FILE="COPYING.gplv3, LICENSE"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=20220308
TERMUX_PKG_SRCURL=https://github.com/fontforge/fontforge/releases/download/${TERMUX_PKG_VERSION}/fontforge-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=01e4017f7a0ccecf436c74b8e1f6b374fc04a5283c1d68967996782e15618e59
TERMUX_PKG_DEPENDS="freetype, giflib, glib, gtk3, libc++, libcairo, libiconv, libjpeg-turbo, libpng, libtiff, libxml2, pango, readline, woff2, zlib"
TERMUX_PKG_CONFLICTS="fontforge"
TERMUX_PKG_REPLACES="fontforge"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
-DENABLE_PYTHON_SCRIPTING=OFF
-DENABLE_PYTHON_EXTENSION=OFF
-DENABLE_LIBSPIRO=OFF
-DENABLE_DOCS=OFF
-DMathLib_IS_BUILT_IN=ON
"
termux_step_pre_configure() {
LDFLAGS+=" -lm"
}

View File

@@ -0,0 +1,11 @@
--- a/fontforge/cvundoes.c
+++ b/fontforge/cvundoes.c
@@ -3875,7 +3875,7 @@
{
int idx = 0;
char filename[PATH_MAX];
- snprintf(filename, PATH_MAX, "/tmp/fontforge-undo-to-string.sfd");
+ snprintf(filename, PATH_MAX, "@TERMUX_PREFIX@/tmp/fontforge-undo-to-string.sfd");
FILE* f = fopen( filename, "w" );
SFDDumpUndo( f, sc, undo, "Undo", idx );
fclose(f);

View File

@@ -0,0 +1,11 @@
--- a/fontforgeexe/displayfonts.c
+++ b/fontforgeexe/displayfonts.c
@@ -228,7 +228,7 @@
int cnt;
char *bpt, *cpt;
- printcap = fopen("/etc/printcap","r");
+ printcap = fopen("@TERMUX_PREFIX@/etc/printcap","r");
if ( printcap==NULL ) {
tis = calloc(2,sizeof(GTextInfo));
tis[0].text = uc_copy("<default>");

View File

@@ -0,0 +1,11 @@
--- a/fontforgeexe/lookupui.c
+++ b/fontforgeexe/lookupui.c
@@ -4374,7 +4374,7 @@
oldsfd = SFDCreateUndoForLookup( sf, lookup_type );
if( DEBUG && oldsfd )
- GFileWriteAll( "/tmp/old-lookup-table.sfd", oldsfd );
+ GFileWriteAll( "@TERMUX_PREFIX@/tmp/old-lookup-table.sfd", oldsfd );
}
/* Then mark all the current things as unused */

View File

@@ -0,0 +1,12 @@
--- a/fontforgeexe/prefs.c
+++ b/fontforgeexe/prefs.c
@@ -585,6 +585,9 @@
#if __CygWin
b[i++] = uc_copy("/usr/share/fonts/");
b[i++] = uc_copy("/usr/share/X11/fonts/");
+#elif defined __ANDROID__
+ b[i++] = uc_copy("@TERMUX_PREFIX@/share/fonts/");
+ b[i++] = uc_copy("/system/fonts/");
#else
b[i++] = uc_copy("/usr/X11R6/lib/X11/fonts/");
#endif

View File

@@ -0,0 +1,38 @@
--- a/gutils/fsys.c
+++ b/gutils/fsys.c
@@ -167,6 +167,9 @@
if ( dir!=NULL )
return( copy(dir) );
+#ifdef __ANDROID__
+return( copy("@TERMUX_HOME@") );
+#else
uid = getuid();
while ( (pw=getpwent())!=NULL ) {
if ( pw->pw_uid==uid ) {
@@ -177,6 +180,7 @@
}
endpwent();
return( NULL );
+#endif /* __ANDROID__ */
#endif
}
@@ -887,6 +891,9 @@
if( home!=NULL )
return home;
+#ifdef __ANDROID__
+return( "@TERMUX_HOME@" );
+#else
uid = getuid();
while( (pw=getpwent())!=NULL ) {
if ( pw->pw_uid==uid ) {
@@ -897,6 +904,7 @@
}
endpwent();
return NULL;
+#endif /* __ANDROID__ */
#endif
}