diff --git a/packages/suite3270/Common-codepage.c.patch b/packages/suite3270/Common-codepage.c.patch new file mode 100644 index 000000000..216ef87b8 --- /dev/null +++ b/packages/suite3270/Common-codepage.c.patch @@ -0,0 +1,14 @@ +--- a/Common/codepage.c ++++ b/Common/codepage.c +@@ -105,7 +105,11 @@ + setlocale(LC_ALL, ""); + + /* Figure out the locale code set (character set encoding). */ ++#ifdef __ANDROID__ ++ codeset_name = "UTF-8"; ++#else + codeset_name = nl_langinfo(CODESET); ++#endif + # if defined(__CYGWIN__) /*[*/ + /* + * Cygwin's locale support is quite limited. If the locale diff --git a/packages/suite3270/Common-config.sub.patch b/packages/suite3270/Common-config.sub.patch new file mode 100644 index 000000000..8fdcc1074 --- /dev/null +++ b/packages/suite3270/Common-config.sub.patch @@ -0,0 +1,41 @@ +--- a/Common/config.sub ++++ b/Common/config.sub +@@ -238,10 +238,11 @@ + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ ++ | aarch64 \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ +- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ ++ | arc | arm | arm[bl]e | arme[lb] | armv* | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ +@@ -285,7 +286,7 @@ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ +- | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ ++ | x86 | x86_64 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; +@@ -314,6 +315,7 @@ + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ ++ | aarch64-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ +@@ -1235,7 +1237,7 @@ + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. +- -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ ++ -gnu* | -android* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ diff --git a/packages/suite3270/Common-pr3287-codepage.c.patch b/packages/suite3270/Common-pr3287-codepage.c.patch new file mode 100644 index 000000000..158cee3c7 --- /dev/null +++ b/packages/suite3270/Common-pr3287-codepage.c.patch @@ -0,0 +1,14 @@ +--- a/Common/pr3287/codepage.c ++++ b/Common/pr3287/codepage.c +@@ -78,7 +78,11 @@ + + #if !defined(_WIN32) /*[*/ + setlocale(LC_ALL, ""); ++#ifdef __ANDROID__ ++ codeset_name = "UTF-8"; ++#else + codeset_name = nl_langinfo(CODESET); ++#endif + # if defined(__CYGWIN__) /*[*/ + /* + * Cygwin's locale support is quite limited. If the locale diff --git a/packages/suite3270/b3270-Makefile.obj.in.patch b/packages/suite3270/b3270-Makefile.obj.in.patch new file mode 100644 index 000000000..980494b72 --- /dev/null +++ b/packages/suite3270/b3270-Makefile.obj.in.patch @@ -0,0 +1,11 @@ +--- a/b3270/Makefile.obj.in ++++ b/b3270/Makefile.obj.in +@@ -69,7 +69,7 @@ + ./mkfb -c -o $@ $(filter-out mkfb,$^) + + mkfb: mkfb.c +- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(filter %.c,$^) ++ $(CC_FOR_BUILD) $(XCPPFLAGS) -o $@ $(filter %.c,$^) + + b3270: $(OBJS1) $(DEP3270) $(DEP3270I) $(DEP32XX) $(DEP3270STUBS) + $(CC) -o $@ $(OBJS1) $(LDFLAGS) $(LD3270) $(LD3270I) $(LD32XX) $(LD3270STUBS) $(LIBS) diff --git a/packages/suite3270/build.sh b/packages/suite3270/build.sh new file mode 100644 index 000000000..2bb390504 --- /dev/null +++ b/packages/suite3270/build.sh @@ -0,0 +1,38 @@ +TERMUX_PKG_HOMEPAGE=http://x3270.bgp.nu/ +TERMUX_PKG_DESCRIPTION="A family of IBM 3270 terminal emulators and related tools" +TERMUX_PKG_LICENSE="BSD 3-Clause" +TERMUX_PKG_LICENSE_FILE="include/copyright.h" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=4.1ga11 +TERMUX_PKG_SRCURL=https://prdownloads.sourceforge.net/x3270/suite3270-${TERMUX_PKG_VERSION}-src.tgz +TERMUX_PKG_SHA256=c36d12fcf211cce48c7488b06d806b0194c71331abdce6da90953099acb1b0bf +TERMUX_PKG_DEPENDS="less, libexpat, libiconv, ncurses" +TERMUX_PKG_BUILD_IN_SRC=true +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +--disable-windows +--disable-x3270 +--disable-tcl3270 +ac_cv_path_LESSPATH=$TERMUX_PREFIX/bin/less +" + +termux_step_pre_configure() { + CPPFLAGS+=" -DNCURSES_WIDECHAR" + + find $TERMUX_PKG_SRCDIR -name '*.c' | xargs -n 1 sed -i \ + -e 's:"\(/bin/sh"\):"'$TERMUX_PREFIX'\1:g' \ + -e 's:"\(/tmp\):"'$TERMUX_PREFIX'\1:g' +} + +termux_step_post_configure() { + local bin=$TERMUX_PKG_BUILDDIR/_prefix/bin + mkdir -p $bin + pushd $TERMUX_PKG_SRCDIR/Common + $CC_FOR_BUILD mkicon.c -o mkicon + cp mkicon $bin/ + pushd c3270 + $CC_FOR_BUILD mkkeypad.c -o mkkeypad + cp mkkeypad $bin/ + popd + popd + PATH=$bin:$PATH +} diff --git a/packages/suite3270/c3270-Makefile.obj.in.patch b/packages/suite3270/c3270-Makefile.obj.in.patch new file mode 100644 index 000000000..39a39eb97 --- /dev/null +++ b/packages/suite3270/c3270-Makefile.obj.in.patch @@ -0,0 +1,17 @@ +--- a/c3270/Makefile.obj.in ++++ b/c3270/Makefile.obj.in +@@ -69,12 +69,12 @@ + ./mkfb -c -o $@ $(filter-out mkfb,$^) + + mkfb: mkfb.c +- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(filter %.c,$^) ++ $(CC_FOR_BUILD) $(XCPPFLAGS) -o $@ $(filter %.c,$^) + + keypad.o: compiled_keypad.h + + compiled_keypad.h: keypad.full keypad.labels keypad.map keypad.outline keypad.callbacks mkkeypad +- ./mkkeypad -I$(TOP)/Common/c3270 >$@ ++ mkkeypad -I$(TOP)/Common/c3270 >$@ + + c3270: $(OBJS1) $(DEP3270) $(DEP3270I) $(DEP32XX) $(DEP3270STUBS) $(DEP32XX) + $(CC) -o $@ $(OBJS1) $(LDFLAGS) $(LD3270) $(LD3270I) $(LD32XX) $(LD3270STUBS) $(LIBS) diff --git a/packages/suite3270/lib-3270-Makefile.obj.in.patch b/packages/suite3270/lib-3270-Makefile.obj.in.patch new file mode 100644 index 000000000..7784b79c8 --- /dev/null +++ b/packages/suite3270/lib-3270-Makefile.obj.in.patch @@ -0,0 +1,11 @@ +--- a/lib/3270/Makefile.obj.in ++++ b/lib/3270/Makefile.obj.in +@@ -57,7 +57,7 @@ + favicon.o: favicon.c + + favicon.c: favicon.ico mkicon +- ./mkicon $< >$@ ++ mkicon $< >$@ + + clean: + $(RM) *.o favicon.c mkicon diff --git a/packages/suite3270/s3270-Makefile.obj.in.patch b/packages/suite3270/s3270-Makefile.obj.in.patch new file mode 100644 index 000000000..24789150c --- /dev/null +++ b/packages/suite3270/s3270-Makefile.obj.in.patch @@ -0,0 +1,11 @@ +--- a/s3270/Makefile.obj.in ++++ b/s3270/Makefile.obj.in +@@ -69,7 +69,7 @@ + ./mkfb -c -o $@ $(filter-out mkfb,$^) + + mkfb: mkfb.c +- $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(filter %.c,$^) ++ $(CC_FOR_BUILD) $(XCPPFLAGS) -o $@ $(filter %.c,$^) + + s3270: $(OBJS1) $(DEP3270) $(DEP32XX) $(DEP3270STUBS) + $(CC) -o $@ $(OBJS1) $(LDFLAGS) $(LD3270) $(LD32XX) $(LD3270STUBS) $(LIBS)