initial commit
This commit is contained in:
parent
3422559ad2
commit
0061672623
22
x11-packages/adwaita-icon-theme/build.sh
Normal file
22
x11-packages/adwaita-icon-theme/build.sh
Normal file
@ -0,0 +1,22 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=https://www.gnome.org
|
||||
TERMUX_PKG_DESCRIPTION="Freedesktop.org Hicolor icon theme"
|
||||
TERMUX_PKG_VERSION=3.28.0
|
||||
TERMUX_PKG_REVISION=2
|
||||
TERMUX_PKG_SRCURL=https://github.com/GNOME/adwaita-icon-theme/archive/${TERMUX_PKG_VERSION}.tar.gz
|
||||
TERMUX_PKG_SHA256=da3f00ac6abb4514d92d2b614388122eead82d079decee26b167aea956e312d9
|
||||
TERMUX_PKG_PLATFORM_INDEPENDENT=true
|
||||
TERMUX_PKG_DEPENDS="hicolor-icon-theme"
|
||||
|
||||
termux_step_pre_configure() {
|
||||
autoreconf -fvi
|
||||
}
|
||||
|
||||
termux_step_post_make_install() {
|
||||
# fix location of adwaita-icon-theme.pc
|
||||
if [ -f "${TERMUX_PREFIX}/share/pkgconfig/adwaita-icon-theme.pc" ]; then
|
||||
mkdir -p "${TERMUX_PREFIX}/lib/pkgconfig" || exit 1
|
||||
mv -f "${TERMUX_PREFIX}/share/pkgconfig/adwaita-icon-theme.pc" "${TERMUX_PREFIX}/lib/pkgconfig/adwaita-icon-theme.pc" || exit 1
|
||||
fi
|
||||
}
|
12
x11-packages/aterm/aterm-1.0.1_autoconf_Make.common.in.patch
Normal file
12
x11-packages/aterm/aterm-1.0.1_autoconf_Make.common.in.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr aterm-1.0.1/autoconf/Make.common.in aterm-1.0.1.mod/autoconf/Make.common.in
|
||||
--- aterm-1.0.1/autoconf/Make.common.in 2005-05-26 19:44:49.000000000 +0300
|
||||
+++ aterm-1.0.1.mod/autoconf/Make.common.in 2018-06-15 22:45:03.335372785 +0300
|
||||
@@ -41,7 +41,7 @@
|
||||
CP = @CP@
|
||||
SED = @SED@
|
||||
INSTALL = @INSTALL@
|
||||
-INSTALL_PROGRAM = @INSTALL@ -s -m 755
|
||||
+INSTALL_PROGRAM = @INSTALL@ -m 755
|
||||
INSTALL_DATA = @INSTALL@ -m 644
|
||||
|
||||
# Flags & libs
|
86
x11-packages/aterm/aterm-1.0.1_src_command.c.patch
Normal file
86
x11-packages/aterm/aterm-1.0.1_src_command.c.patch
Normal file
@ -0,0 +1,86 @@
|
||||
diff -uNr aterm-1.0.1/src/command.c aterm-1.0.1.mod/src/command.c
|
||||
--- aterm-1.0.1/src/command.c 2006-06-26 21:01:20.000000000 +0300
|
||||
+++ aterm-1.0.1.mod/src/command.c 2018-06-15 22:58:36.195350239 +0300
|
||||
@@ -552,20 +552,10 @@
|
||||
{
|
||||
int fd = -1;
|
||||
|
||||
-#if defined (__sgi)
|
||||
- ptydev = ttydev = _getpty(&fd, O_RDWR | O_NDELAY, 0622, 0);
|
||||
- if (ptydev == NULL)
|
||||
- goto Failed;
|
||||
-#elif defined (__svr4__) || defined(__CYGWIN32__) || defined(__lnx21__)
|
||||
- {
|
||||
extern char *ptsname();
|
||||
|
||||
/* open the STREAMS, clone device /dev/ptmx (master pty) */
|
||||
-#ifdef HAVE_GETPT
|
||||
- if ((fd = getpt()) < 0) {
|
||||
-#else
|
||||
if ((fd = open("/dev/ptmx", O_RDWR)) < 0) {
|
||||
-#endif
|
||||
goto Failed;
|
||||
} else {
|
||||
grantpt(fd); /* change slave permissions */
|
||||
@@ -573,61 +563,6 @@
|
||||
ptydev = ttydev = ptsname(fd); /* get slave's name */
|
||||
goto Found;
|
||||
}
|
||||
- }
|
||||
-#elif defined (_AIX)
|
||||
- if ((fd = open("/dev/ptc", O_RDWR)) < 0)
|
||||
- goto Failed;
|
||||
- else
|
||||
- ptydev = ttydev = ttyname(fd);
|
||||
-#elif defined(ALL_NUMERIC_PTYS) /* SCO OSr5 */
|
||||
- static char pty_name[] = "/dev/ptyp??\0\0\0";
|
||||
- static char tty_name[] = "/dev/ttyp??\0\0\0";
|
||||
- int len = strlen(tty_name);
|
||||
- char *c1, *c2;
|
||||
- int idx;
|
||||
-
|
||||
- ptydev = pty_name;
|
||||
- ttydev = tty_name;
|
||||
-
|
||||
- for (idx = 0; idx < 256; idx++) {
|
||||
- sprintf(ptydev, "%s%d", "/dev/ptyp", idx);
|
||||
- sprintf(ttydev, "%s%d", "/dev/ttyp", idx);
|
||||
-
|
||||
- if (access(ttydev, F_OK) < 0) {
|
||||
- idx = 256;
|
||||
- break;
|
||||
- }
|
||||
- if ((fd = open(ptydev, O_RDWR)) >= 0) {
|
||||
- if (access(ttydev, R_OK | W_OK) == 0)
|
||||
- goto Found;
|
||||
- close(fd);
|
||||
- }
|
||||
- }
|
||||
- goto Failed;
|
||||
-#else
|
||||
- static char pty_name[] = "/dev/pty??";
|
||||
- static char tty_name[] = "/dev/tty??";
|
||||
- int len = strlen(tty_name);
|
||||
- char *c1, *c2;
|
||||
-
|
||||
- ptydev = pty_name;
|
||||
- ttydev = tty_name;
|
||||
-
|
||||
-# define PTYCHAR1 "pqrstuvwxyz"
|
||||
-# define PTYCHAR2 "0123456789abcdefghijklmnopqrstuvwxyz"
|
||||
- for (c1 = PTYCHAR1; *c1; c1++) {
|
||||
- ptydev[len - 2] = ttydev[len - 2] = *c1;
|
||||
- for (c2 = PTYCHAR2; *c2; c2++) {
|
||||
- ptydev[len - 1] = ttydev[len - 1] = *c2;
|
||||
- if ((fd = open(ptydev, O_RDWR)) >= 0) {
|
||||
- if (access(ttydev, R_OK | W_OK) == 0)
|
||||
- goto Found;
|
||||
- close(fd);
|
||||
- }
|
||||
- }
|
||||
- }
|
||||
- goto Failed;
|
||||
-#endif
|
||||
|
||||
Found:
|
||||
fcntl(fd, F_SETFL, O_NDELAY);
|
12
x11-packages/aterm/aterm-1.0.1_src_rxvt.h.patch
Normal file
12
x11-packages/aterm/aterm-1.0.1_src_rxvt.h.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr aterm-1.0.1/src/rxvt.h aterm-1.0.1.mod/src/rxvt.h
|
||||
--- aterm-1.0.1/src/rxvt.h 2006-02-17 23:35:37.000000000 +0200
|
||||
+++ aterm-1.0.1.mod/src/rxvt.h 2018-06-15 22:51:02.295362829 +0300
|
||||
@@ -564,7 +564,7 @@
|
||||
# define OLD_WORD_SELECTION
|
||||
#endif
|
||||
|
||||
-#define DEFAULT_SHELL "/bin/bash"
|
||||
+#define DEFAULT_SHELL "@TERMUX_PREFIX@/bin/bash"
|
||||
|
||||
/* sort out conflicts in feature.h */
|
||||
#ifdef KANJI
|
15
x11-packages/aterm/build.sh
Normal file
15
x11-packages/aterm/build.sh
Normal file
@ -0,0 +1,15 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=http://aterm.sourceforge.net/
|
||||
TERMUX_PKG_DESCRIPTION="An xterm replacement with transparency support"
|
||||
TERMUX_PKG_VERSION=1.0.1
|
||||
TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/sourceforge/aterm/aterm-${TERMUX_PKG_VERSION}.tar.bz2
|
||||
TERMUX_PKG_SHA256=a161c3b2d9c7149130a41963899993af21eae92e8e362f4b5b3c7c4cb16760ce
|
||||
TERMUX_PKG_DEPENDS="libjpeg-turbo, librsvg, libxinerama, libxt"
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
|
||||
--enable-transparency=yes
|
||||
--enable-background-image
|
||||
--enable-fading
|
||||
--enable-menubar
|
||||
--enable-graphics
|
||||
"
|
15
x11-packages/desktop-file-utils/build.sh
Normal file
15
x11-packages/desktop-file-utils/build.sh
Normal file
@ -0,0 +1,15 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=https://www.freedesktop.org/wiki/Software/desktop-file-utils
|
||||
TERMUX_PKG_DESCRIPTION="Command line utilities for working with desktop entries"
|
||||
TERMUX_PKG_VERSION=0.23
|
||||
TERMUX_PKG_REVISION=7
|
||||
TERMUX_PKG_SRCURL=https://www.freedesktop.org/software/desktop-file-utils/releases/desktop-file-utils-${TERMUX_PKG_VERSION}.tar.xz
|
||||
TERMUX_PKG_SHA256=6c094031bdec46c9f621708f919084e1cb5294e2c5b1e4c883b3e70cb8903385
|
||||
TERMUX_PKG_DEPENDS="glib"
|
||||
|
||||
termux_step_create_debscripts() {
|
||||
cp "${TERMUX_PKG_BUILDER_DIR}/postinst" ./
|
||||
cp "${TERMUX_PKG_BUILDER_DIR}/postrm" ./
|
||||
cp "${TERMUX_PKG_BUILDER_DIR}/triggers" ./
|
||||
}
|
10
x11-packages/desktop-file-utils/postinst
Executable file
10
x11-packages/desktop-file-utils/postinst
Executable file
@ -0,0 +1,10 @@
|
||||
#!/data/data/com.termux/files/usr/bin/sh
|
||||
set -e
|
||||
|
||||
if [ -d "/data/data/com.termux/files/usr/share/applications" ]; then
|
||||
update-desktop-database -q
|
||||
fi
|
||||
|
||||
if [ "${1}" = "triggered" ]; then
|
||||
exit 0
|
||||
fi
|
12
x11-packages/desktop-file-utils/postrm
Executable file
12
x11-packages/desktop-file-utils/postrm
Executable file
@ -0,0 +1,12 @@
|
||||
#!/data/data/com.termux/files/usr/bin/sh
|
||||
set -e
|
||||
APPDIR="/data/data/com.termux/files/usr/share/applications"
|
||||
|
||||
if [ "${1}" = "remove" ]; then
|
||||
if [ -d "${APPDIR}" ]; then
|
||||
rm -f "${APPDIR}/mimeinfo.cache"
|
||||
if [ ! -L "${APPDIR}" ]; then
|
||||
rmdir --ignore-fail-on-non-empty "${APPDIR}"
|
||||
fi
|
||||
fi
|
||||
fi
|
1
x11-packages/desktop-file-utils/triggers
Normal file
1
x11-packages/desktop-file-utils/triggers
Normal file
@ -0,0 +1 @@
|
||||
interest-noawait /data/data/com.termux/files/usr/share/applications
|
10
x11-packages/dosbox/build.sh
Normal file
10
x11-packages/dosbox/build.sh
Normal file
@ -0,0 +1,10 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=http://dosbox.sourceforge.net/
|
||||
TERMUX_PKG_DESCRIPTION="Emulator with builtin DOS for running DOS Games"
|
||||
TERMUX_PKG_VERSION=0.74
|
||||
TERMUX_PKG_REVISION=6
|
||||
TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/dosbox/dosbox-${TERMUX_PKG_VERSION}.tar.gz
|
||||
TERMUX_PKG_SHA256=13f74916e2d4002bad1978e55727f302ff6df3d9be2f9b0e271501bd0a938e05
|
||||
TERMUX_PKG_DEPENDS="libc++, libsdl, libsdl-net"
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-dynamic-x86 --disable-fpu-x86 --disable-opengl"
|
15
x11-packages/feh/build.sh
Normal file
15
x11-packages/feh/build.sh
Normal file
@ -0,0 +1,15 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=https://feh.finalrewind.org/
|
||||
TERMUX_PKG_DESCRIPTION="Fast and light imlib2-based image viewer"
|
||||
TERMUX_PKG_VERSION=2.27.1
|
||||
TERMUX_PKG_SRCURL=https://feh.finalrewind.org/feh-${TERMUX_PKG_VERSION}.tar.bz2
|
||||
TERMUX_PKG_SHA256=6ec338f80c3f4c30d715f44780f1a09ebfbb99e92a1bb43316428744a839f383
|
||||
TERMUX_PKG_DEPENDS="imlib2, libandroid-shmem, libcurl, libexif, libxinerama, libxt"
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
TERMUX_PKG_EXTRA_MAKE_ARGS="exif=1 help=1 verscmp=0"
|
||||
|
||||
termux_step_pre_configure()
|
||||
{
|
||||
CFLAGS+=" -I${TERMUX_PREFIX}/include"
|
||||
}
|
12
x11-packages/feh/feh-2.25.1_src_Makefile.patch
Normal file
12
x11-packages/feh/feh-2.25.1_src_Makefile.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr feh-2.25.1/src/Makefile feh-2.25.1.mod/src/Makefile
|
||||
--- feh-2.25.1/src/Makefile 2018-03-07 18:53:33.000000000 +0200
|
||||
+++ feh-2.25.1.mod/src/Makefile 2018-06-21 17:32:38.113526904 +0300
|
||||
@@ -41,7 +41,7 @@
|
||||
I_DSTS = ${I_SRCS:.raw=.inc}
|
||||
|
||||
feh: deps.mk ${OBJECTS} ${I_DSTS}
|
||||
- ${CC} ${LDFLAGS} ${CFLAGS} -o $@ ${OBJECTS} ${LDLIBS}
|
||||
+ ${CC} ${LDFLAGS} ${CFLAGS} -o $@ ${OBJECTS} ${LDLIBS} -landroid-shmem
|
||||
|
||||
include deps.mk
|
||||
|
12
x11-packages/feh/feh-2.25.1_src_events.c.patch
Normal file
12
x11-packages/feh/feh-2.25.1_src_events.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr feh-2.25.1/src/events.c feh-2.25.1.mod/src/events.c
|
||||
--- feh-2.25.1/src/events.c 2018-03-07 18:53:33.000000000 +0200
|
||||
+++ feh-2.25.1.mod/src/events.c 2018-06-21 17:31:53.783526575 +0300
|
||||
@@ -124,7 +124,7 @@
|
||||
|
||||
free(confpath);
|
||||
|
||||
- if (!conf && ((conf = fopen("/etc/feh/buttons", "r")) == NULL))
|
||||
+ if (!conf && ((conf = fopen("/data/data/com.termux/files/usr/etc/feh/buttons", "r")) == NULL))
|
||||
return;
|
||||
|
||||
while (fgets(line, sizeof(line), conf)) {
|
12
x11-packages/feh/feh-2.25.1_src_filelist.c.patch
Normal file
12
x11-packages/feh/feh-2.25.1_src_filelist.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr feh-2.25.1/src/filelist.c feh-2.25.1.mod/src/filelist.c
|
||||
--- feh-2.25.1/src/filelist.c 2018-03-07 18:53:33.000000000 +0200
|
||||
+++ feh-2.25.1.mod/src/filelist.c 2018-06-21 17:31:53.786859909 +0300
|
||||
@@ -159,7 +159,7 @@
|
||||
{
|
||||
char buf[1024];
|
||||
size_t readsize;
|
||||
- char *sfn = estrjoin("_", "/tmp/feh_stdin", "XXXXXX", NULL);
|
||||
+ char *sfn = estrjoin("_", "/data/data/com.termux/files/usr/tmp/feh_stdin", "XXXXXX", NULL);
|
||||
int fd = mkstemp(sfn);
|
||||
FILE *outfile;
|
||||
|
31
x11-packages/feh/feh-2.25.1_src_imlib.c.patch
Normal file
31
x11-packages/feh/feh-2.25.1_src_imlib.c.patch
Normal file
@ -0,0 +1,31 @@
|
||||
diff --git a/src/imlib.c b/src/imlib.c
|
||||
index d9c5cd0..b91d8b2 100644
|
||||
--- a/src/imlib.c
|
||||
+++ b/src/imlib.c
|
||||
@@ -102,7 +102,7 @@ void init_imlib_fonts(void)
|
||||
{
|
||||
/* Set up the font stuff */
|
||||
imlib_add_path_to_font_path(".");
|
||||
- imlib_add_path_to_font_path(PREFIX "/share/feh/fonts");
|
||||
+ imlib_add_path_to_font_path("/data/data/com.termux/files/usr/share/feh/fonts");
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -320,7 +320,7 @@ static char *feh_magick_load_image(char *filename)
|
||||
else
|
||||
basename++;
|
||||
|
||||
- tmpname = feh_unique_filename("/tmp/", basename);
|
||||
+ tmpname = feh_unique_filename("/data/data/com.termux/files/usr/tmp/", basename);
|
||||
|
||||
if (strlen(tmpname) > (NAME_MAX-6))
|
||||
tmpname[NAME_MAX-7] = '\0';
|
||||
@@ -407,7 +407,7 @@ static char *feh_http_load_image(char *url)
|
||||
else
|
||||
path = "";
|
||||
} else
|
||||
- path = "/tmp/";
|
||||
+ path = "/data/data/com.termux/files/usr/tmp/";
|
||||
|
||||
curl = curl_easy_init();
|
||||
if (!curl) {
|
12
x11-packages/feh/feh-2.25.1_src_keyevents.c.patch
Normal file
12
x11-packages/feh/feh-2.25.1_src_keyevents.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr feh-2.25.1/src/keyevents.c feh-2.25.1.mod/src/keyevents.c
|
||||
--- feh-2.25.1/src/keyevents.c 2018-03-07 18:53:33.000000000 +0200
|
||||
+++ feh-2.25.1.mod/src/keyevents.c 2018-06-21 17:31:53.800193243 +0300
|
||||
@@ -226,7 +226,7 @@
|
||||
|
||||
free(confpath);
|
||||
|
||||
- if (!conf && ((conf = fopen("/etc/feh/keys", "r")) == NULL))
|
||||
+ if (!conf && ((conf = fopen("/data/data/com.termux/files/usr/etc/feh/keys", "r")) == NULL))
|
||||
return;
|
||||
|
||||
while (fgets(line, sizeof(line), conf)) {
|
21
x11-packages/feh/feh-2.25.1_src_options.c.patch
Normal file
21
x11-packages/feh/feh-2.25.1_src_options.c.patch
Normal file
@ -0,0 +1,21 @@
|
||||
diff -uNr feh-2.25.1/src/options.c feh-2.25.1.mod/src/options.c
|
||||
--- feh-2.25.1/src/options.c 2018-03-07 18:53:33.000000000 +0200
|
||||
+++ feh-2.25.1.mod/src/options.c 2018-06-21 17:31:53.803526576 +0300
|
||||
@@ -62,7 +62,7 @@
|
||||
opt.scroll_step = 20;
|
||||
opt.menu_font = estrdup(DEFAULT_MENU_FONT);
|
||||
opt.font = NULL;
|
||||
- opt.menu_bg = estrdup(PREFIX "/share/feh/images/menubg_default.png");
|
||||
+ opt.menu_bg = estrdup("/data/data/com.termux/files/usr/share/feh/images/menubg_default.png");
|
||||
opt.max_height = opt.max_width = UINT_MAX;
|
||||
|
||||
opt.start_list_at = NULL;
|
||||
@@ -159,7 +159,7 @@
|
||||
|
||||
free(oldrcpath);
|
||||
|
||||
- if (!fp && ((fp = fopen("/etc/feh/themes", "r")) == NULL))
|
||||
+ if (!fp && ((fp = fopen("/data/data/com.termux/files/usr/etc/feh/themes", "r")) == NULL))
|
||||
return;
|
||||
|
||||
/* Oooh. We have an options file :) */
|
12
x11-packages/feh/feh-2.25.1_src_slideshow.c.patch
Normal file
12
x11-packages/feh/feh-2.25.1_src_slideshow.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr feh-2.25.1/src/slideshow.c feh-2.25.1.mod/src/slideshow.c
|
||||
--- feh-2.25.1/src/slideshow.c 2018-03-07 18:53:33.000000000 +0200
|
||||
+++ feh-2.25.1.mod/src/slideshow.c 2018-06-21 17:31:53.803526576 +0300
|
||||
@@ -482,7 +482,7 @@
|
||||
if (filelist_tmppath != NULL) {
|
||||
strncat(ret, filelist_tmppath, sizeof(ret) - strlen(ret) - 1);
|
||||
} else {
|
||||
- filelist_tmppath = feh_unique_filename("/tmp/","filelist");
|
||||
+ filelist_tmppath = feh_unique_filename("/data/data/com.termux/files/usr/tmp/","filelist");
|
||||
feh_write_filelist(filelist, filelist_tmppath);
|
||||
strncat(ret, filelist_tmppath, sizeof(ret) - strlen(ret) - 1);
|
||||
}
|
17
x11-packages/fltk-editor/build.sh
Normal file
17
x11-packages/fltk-editor/build.sh
Normal file
@ -0,0 +1,17 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_DESCRIPTION="Simple text editor"
|
||||
TERMUX_PKG_DEPENDS="fltk, libc++"
|
||||
TERMUX_PKG_VERSION=1.0-termux
|
||||
TERMUX_PKG_REVISION=4
|
||||
|
||||
termux_step_make()
|
||||
{
|
||||
"${CXX}" ${CXXFLAGS} -I"${TERMUX_PREFIX}/include" "${TERMUX_PKG_BUILDER_DIR}/fltk-editor.cxx" -o fltk-editor ${LDFLAGS} -lfltk
|
||||
}
|
||||
|
||||
termux_step_make_install()
|
||||
{
|
||||
mkdir -p "${TERMUX_PREFIX}/bin"
|
||||
cp -f fltk-editor "${TERMUX_PREFIX}/bin/fltk-editor"
|
||||
}
|
818
x11-packages/fltk-editor/fltk-editor.cxx
Normal file
818
x11-packages/fltk-editor/fltk-editor.cxx
Normal file
@ -0,0 +1,818 @@
|
||||
//
|
||||
// "$Id: editor.cxx 9718 2012-11-13 13:03:20Z manolo $"
|
||||
//
|
||||
// A simple text editor program for the Fast Light Tool Kit (FLTK).
|
||||
//
|
||||
// This program is described in Chapter 4 of the FLTK Programmer's Guide.
|
||||
//
|
||||
// Copyright 1998-2010 by Bill Spitzak and others.
|
||||
//
|
||||
// This library is free software. Distribution and use rights are outlined in
|
||||
// the file "COPYING" which should have been included with this file. If this
|
||||
// file is missing or damaged, see the license at:
|
||||
//
|
||||
// http://www.fltk.org/COPYING.php
|
||||
//
|
||||
// Please report all bugs and problems on the following page:
|
||||
//
|
||||
// http://www.fltk.org/str.php
|
||||
//
|
||||
|
||||
//
|
||||
// compile with: g++ editor.cxx -o fltk_editor -lfltk
|
||||
//
|
||||
|
||||
//
|
||||
// Include necessary headers...
|
||||
//
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef __MWERKS__
|
||||
# define FL_DLL
|
||||
#endif
|
||||
|
||||
#include <FL/Fl.H>
|
||||
#include <FL/Fl_Group.H>
|
||||
#include <FL/Fl_Double_Window.H>
|
||||
#include <FL/fl_ask.H>
|
||||
#include <FL/Fl_Native_File_Chooser.H>
|
||||
#include <FL/Fl_Menu_Bar.H>
|
||||
#include <FL/Fl_Input.H>
|
||||
#include <FL/Fl_Button.H>
|
||||
#include <FL/Fl_Return_Button.H>
|
||||
#include <FL/Fl_Text_Buffer.H>
|
||||
#include <FL/Fl_Text_Editor.H>
|
||||
#include <FL/filename.H>
|
||||
|
||||
int changed = 0;
|
||||
char filename[FL_PATH_MAX] = "";
|
||||
char title[FL_PATH_MAX];
|
||||
Fl_Text_Buffer *textbuf = 0;
|
||||
|
||||
|
||||
// Syntax highlighting stuff...
|
||||
#define TS 14 // default editor textsize
|
||||
Fl_Text_Buffer *stylebuf = 0;
|
||||
Fl_Text_Display::Style_Table_Entry
|
||||
styletable[] = { // Style table
|
||||
{ FL_BLACK, FL_COURIER, TS }, // A - Plain
|
||||
{ FL_DARK_GREEN, FL_HELVETICA_ITALIC, TS }, // B - Line comments
|
||||
{ FL_DARK_GREEN, FL_HELVETICA_ITALIC, TS }, // C - Block comments
|
||||
{ FL_BLUE, FL_COURIER, TS }, // D - Strings
|
||||
{ FL_DARK_RED, FL_COURIER, TS }, // E - Directives
|
||||
{ FL_DARK_RED, FL_COURIER_BOLD, TS }, // F - Types
|
||||
{ FL_BLUE, FL_COURIER_BOLD, TS }, // G - Keywords
|
||||
};
|
||||
const char *code_keywords[] = { // List of known C/C++ keywords...
|
||||
"and",
|
||||
"and_eq",
|
||||
"asm",
|
||||
"bitand",
|
||||
"bitor",
|
||||
"break",
|
||||
"case",
|
||||
"catch",
|
||||
"compl",
|
||||
"continue",
|
||||
"default",
|
||||
"delete",
|
||||
"do",
|
||||
"else",
|
||||
"false",
|
||||
"for",
|
||||
"goto",
|
||||
"if",
|
||||
"new",
|
||||
"not",
|
||||
"not_eq",
|
||||
"operator",
|
||||
"or",
|
||||
"or_eq",
|
||||
"return",
|
||||
"switch",
|
||||
"template",
|
||||
"this",
|
||||
"throw",
|
||||
"true",
|
||||
"try",
|
||||
"while",
|
||||
"xor",
|
||||
"xor_eq"
|
||||
};
|
||||
const char *code_types[] = { // List of known C/C++ types...
|
||||
"auto",
|
||||
"bool",
|
||||
"char",
|
||||
"class",
|
||||
"const",
|
||||
"const_cast",
|
||||
"double",
|
||||
"dynamic_cast",
|
||||
"enum",
|
||||
"explicit",
|
||||
"extern",
|
||||
"float",
|
||||
"friend",
|
||||
"inline",
|
||||
"int",
|
||||
"long",
|
||||
"mutable",
|
||||
"namespace",
|
||||
"private",
|
||||
"protected",
|
||||
"public",
|
||||
"register",
|
||||
"short",
|
||||
"signed",
|
||||
"sizeof",
|
||||
"static",
|
||||
"static_cast",
|
||||
"struct",
|
||||
"template",
|
||||
"typedef",
|
||||
"typename",
|
||||
"union",
|
||||
"unsigned",
|
||||
"virtual",
|
||||
"void",
|
||||
"volatile"
|
||||
};
|
||||
|
||||
|
||||
//
|
||||
// 'compare_keywords()' - Compare two keywords...
|
||||
//
|
||||
|
||||
extern "C" {
|
||||
int
|
||||
compare_keywords(const void *a,
|
||||
const void *b) {
|
||||
return (strcmp(*((const char **)a), *((const char **)b)));
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// 'style_parse()' - Parse text and produce style data.
|
||||
//
|
||||
|
||||
void
|
||||
style_parse(const char *text,
|
||||
char *style,
|
||||
int length) {
|
||||
char current;
|
||||
int col;
|
||||
int last;
|
||||
char buf[255],
|
||||
*bufptr;
|
||||
const char *temp;
|
||||
|
||||
// Style letters:
|
||||
//
|
||||
// A - Plain
|
||||
// B - Line comments
|
||||
// C - Block comments
|
||||
// D - Strings
|
||||
// E - Directives
|
||||
// F - Types
|
||||
// G - Keywords
|
||||
|
||||
for (current = *style, col = 0, last = 0; length > 0; length --, text ++) {
|
||||
if (current == 'B' || current == 'F' || current == 'G') current = 'A';
|
||||
if (current == 'A') {
|
||||
// Check for directives, comments, strings, and keywords...
|
||||
if (col == 0 && *text == '#') {
|
||||
// Set style to directive
|
||||
current = 'E';
|
||||
} else if (strncmp(text, "//", 2) == 0) {
|
||||
current = 'B';
|
||||
for (; length > 0 && *text != '\n'; length --, text ++) *style++ = 'B';
|
||||
|
||||
if (length == 0) break;
|
||||
} else if (strncmp(text, "/*", 2) == 0) {
|
||||
current = 'C';
|
||||
} else if (strncmp(text, "\\\"", 2) == 0) {
|
||||
// Quoted quote...
|
||||
*style++ = current;
|
||||
*style++ = current;
|
||||
text ++;
|
||||
length --;
|
||||
col += 2;
|
||||
continue;
|
||||
} else if (*text == '\"') {
|
||||
current = 'D';
|
||||
} else if (!last && (islower((*text)&255) || *text == '_')) {
|
||||
// Might be a keyword...
|
||||
for (temp = text, bufptr = buf;
|
||||
(islower((*temp)&255) || *temp == '_') && bufptr < (buf + sizeof(buf) - 1);
|
||||
*bufptr++ = *temp++);
|
||||
|
||||
if (!islower((*temp)&255) && *temp != '_') {
|
||||
*bufptr = '\0';
|
||||
|
||||
bufptr = buf;
|
||||
|
||||
if (bsearch(&bufptr, code_types,
|
||||
sizeof(code_types) / sizeof(code_types[0]),
|
||||
sizeof(code_types[0]), compare_keywords)) {
|
||||
while (text < temp) {
|
||||
*style++ = 'F';
|
||||
text ++;
|
||||
length --;
|
||||
col ++;
|
||||
}
|
||||
|
||||
text --;
|
||||
length ++;
|
||||
last = 1;
|
||||
continue;
|
||||
} else if (bsearch(&bufptr, code_keywords,
|
||||
sizeof(code_keywords) / sizeof(code_keywords[0]),
|
||||
sizeof(code_keywords[0]), compare_keywords)) {
|
||||
while (text < temp) {
|
||||
*style++ = 'G';
|
||||
text ++;
|
||||
length --;
|
||||
col ++;
|
||||
}
|
||||
|
||||
text --;
|
||||
length ++;
|
||||
last = 1;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (current == 'C' && strncmp(text, "*/", 2) == 0) {
|
||||
// Close a C comment...
|
||||
*style++ = current;
|
||||
*style++ = current;
|
||||
text ++;
|
||||
length --;
|
||||
current = 'A';
|
||||
col += 2;
|
||||
continue;
|
||||
} else if (current == 'D') {
|
||||
// Continuing in string...
|
||||
if (strncmp(text, "\\\"", 2) == 0) {
|
||||
// Quoted end quote...
|
||||
*style++ = current;
|
||||
*style++ = current;
|
||||
text ++;
|
||||
length --;
|
||||
col += 2;
|
||||
continue;
|
||||
} else if (*text == '\"') {
|
||||
// End quote...
|
||||
*style++ = current;
|
||||
col ++;
|
||||
current = 'A';
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Copy style info...
|
||||
if (current == 'A' && (*text == '{' || *text == '}')) *style++ = 'G';
|
||||
else *style++ = current;
|
||||
col ++;
|
||||
|
||||
last = isalnum((*text)&255) || *text == '_' || *text == '.';
|
||||
|
||||
if (*text == '\n') {
|
||||
// Reset column and possibly reset the style
|
||||
col = 0;
|
||||
if (current == 'B' || current == 'E') current = 'A';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// 'style_init()' - Initialize the style buffer...
|
||||
//
|
||||
|
||||
void
|
||||
style_init(void) {
|
||||
char *style = new char[textbuf->length() + 1];
|
||||
char *text = textbuf->text();
|
||||
|
||||
memset(style, 'A', textbuf->length());
|
||||
style[textbuf->length()] = '\0';
|
||||
|
||||
if (!stylebuf) stylebuf = new Fl_Text_Buffer(textbuf->length());
|
||||
|
||||
style_parse(text, style, textbuf->length());
|
||||
|
||||
stylebuf->text(style);
|
||||
delete[] style;
|
||||
free(text);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// 'style_unfinished_cb()' - Update unfinished styles.
|
||||
//
|
||||
|
||||
void
|
||||
style_unfinished_cb(int, void*) {
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// 'style_update()' - Update the style buffer...
|
||||
//
|
||||
|
||||
void
|
||||
style_update(int pos, // I - Position of update
|
||||
int nInserted, // I - Number of inserted chars
|
||||
int nDeleted, // I - Number of deleted chars
|
||||
int /*nRestyled*/, // I - Number of restyled chars
|
||||
const char * /*deletedText*/,// I - Text that was deleted
|
||||
void *cbArg) { // I - Callback data
|
||||
int start, // Start of text
|
||||
end; // End of text
|
||||
char last, // Last style on line
|
||||
*style, // Style data
|
||||
*text; // Text data
|
||||
|
||||
|
||||
// If this is just a selection change, just unselect the style buffer...
|
||||
if (nInserted == 0 && nDeleted == 0) {
|
||||
stylebuf->unselect();
|
||||
return;
|
||||
}
|
||||
|
||||
// Track changes in the text buffer...
|
||||
if (nInserted > 0) {
|
||||
// Insert characters into the style buffer...
|
||||
style = new char[nInserted + 1];
|
||||
memset(style, 'A', nInserted);
|
||||
style[nInserted] = '\0';
|
||||
|
||||
stylebuf->replace(pos, pos + nDeleted, style);
|
||||
delete[] style;
|
||||
} else {
|
||||
// Just delete characters in the style buffer...
|
||||
stylebuf->remove(pos, pos + nDeleted);
|
||||
}
|
||||
|
||||
// Select the area that was just updated to avoid unnecessary
|
||||
// callbacks...
|
||||
stylebuf->select(pos, pos + nInserted - nDeleted);
|
||||
|
||||
// Re-parse the changed region; we do this by parsing from the
|
||||
// beginning of the previous line of the changed region to the end of
|
||||
// the line of the changed region... Then we check the last
|
||||
// style character and keep updating if we have a multi-line
|
||||
// comment character...
|
||||
start = textbuf->line_start(pos);
|
||||
// if (start > 0) start = textbuf->line_start(start - 1);
|
||||
end = textbuf->line_end(pos + nInserted);
|
||||
text = textbuf->text_range(start, end);
|
||||
style = stylebuf->text_range(start, end);
|
||||
if (start==end)
|
||||
last = 0;
|
||||
else
|
||||
last = style[end - start - 1];
|
||||
|
||||
// printf("start = %d, end = %d, text = \"%s\", style = \"%s\", last='%c'...\n",
|
||||
// start, end, text, style, last);
|
||||
|
||||
style_parse(text, style, end - start);
|
||||
|
||||
// printf("new style = \"%s\", new last='%c'...\n",
|
||||
// style, style[end - start - 1]);
|
||||
|
||||
stylebuf->replace(start, end, style);
|
||||
((Fl_Text_Editor *)cbArg)->redisplay_range(start, end);
|
||||
|
||||
if (start==end || last != style[end - start - 1]) {
|
||||
// printf("Recalculate the rest of the buffer style\n");
|
||||
// Either the user deleted some text, or the last character
|
||||
// on the line changed styles, so reparse the
|
||||
// remainder of the buffer...
|
||||
free(text);
|
||||
free(style);
|
||||
|
||||
end = textbuf->length();
|
||||
text = textbuf->text_range(start, end);
|
||||
style = stylebuf->text_range(start, end);
|
||||
|
||||
style_parse(text, style, end - start);
|
||||
|
||||
stylebuf->replace(start, end, style);
|
||||
((Fl_Text_Editor *)cbArg)->redisplay_range(start, end);
|
||||
}
|
||||
|
||||
free(text);
|
||||
free(style);
|
||||
}
|
||||
|
||||
|
||||
// Editor window functions and class...
|
||||
void save_cb();
|
||||
void saveas_cb();
|
||||
void find2_cb(Fl_Widget*, void*);
|
||||
void replall_cb(Fl_Widget*, void*);
|
||||
void replace2_cb(Fl_Widget*, void*);
|
||||
void replcan_cb(Fl_Widget*, void*);
|
||||
|
||||
class EditorWindow : public Fl_Double_Window {
|
||||
public:
|
||||
EditorWindow(int w, int h, const char* t);
|
||||
~EditorWindow();
|
||||
|
||||
Fl_Window *replace_dlg;
|
||||
Fl_Input *replace_find;
|
||||
Fl_Input *replace_with;
|
||||
Fl_Button *replace_all;
|
||||
Fl_Return_Button *replace_next;
|
||||
Fl_Button *replace_cancel;
|
||||
|
||||
Fl_Text_Editor *editor;
|
||||
char search[256];
|
||||
};
|
||||
|
||||
EditorWindow::EditorWindow(int w, int h, const char* t) : Fl_Double_Window(w, h, t) {
|
||||
replace_dlg = new Fl_Window(300, 105, "Replace");
|
||||
replace_find = new Fl_Input(80, 10, 210, 25, "Find:");
|
||||
replace_find->align(FL_ALIGN_LEFT);
|
||||
|
||||
replace_with = new Fl_Input(80, 40, 210, 25, "Replace:");
|
||||
replace_with->align(FL_ALIGN_LEFT);
|
||||
|
||||
replace_all = new Fl_Button(10, 70, 90, 25, "Replace All");
|
||||
replace_all->callback((Fl_Callback *)replall_cb, this);
|
||||
|
||||
replace_next = new Fl_Return_Button(105, 70, 120, 25, "Replace Next");
|
||||
replace_next->callback((Fl_Callback *)replace2_cb, this);
|
||||
|
||||
replace_cancel = new Fl_Button(230, 70, 60, 25, "Cancel");
|
||||
replace_cancel->callback((Fl_Callback *)replcan_cb, this);
|
||||
replace_dlg->end();
|
||||
replace_dlg->set_non_modal();
|
||||
editor = 0;
|
||||
*search = (char)0;
|
||||
}
|
||||
|
||||
EditorWindow::~EditorWindow() {
|
||||
delete replace_dlg;
|
||||
}
|
||||
|
||||
int check_save(void) {
|
||||
if (!changed) return 1;
|
||||
|
||||
int r = fl_choice("The current file has not been saved.\n"
|
||||
"Would you like to save it now?",
|
||||
"Cancel", "Save", "Don't Save");
|
||||
|
||||
if (r == 1) {
|
||||
save_cb(); // Save the file...
|
||||
return !changed;
|
||||
}
|
||||
|
||||
return (r == 2) ? 1 : 0;
|
||||
}
|
||||
|
||||
int loading = 0;
|
||||
void load_file(const char *newfile, int ipos) {
|
||||
loading = 1;
|
||||
int insert = (ipos != -1);
|
||||
changed = insert;
|
||||
if (!insert) strcpy(filename, "");
|
||||
int r;
|
||||
if (!insert) r = textbuf->loadfile(newfile);
|
||||
else r = textbuf->insertfile(newfile, ipos);
|
||||
changed = changed || textbuf->input_file_was_transcoded;
|
||||
if (r)
|
||||
fl_alert("Error reading from file \'%s\':\n%s.", newfile, strerror(errno));
|
||||
else
|
||||
if (!insert) strcpy(filename, newfile);
|
||||
loading = 0;
|
||||
textbuf->call_modify_callbacks();
|
||||
}
|
||||
|
||||
void save_file(const char *newfile) {
|
||||
if (textbuf->savefile(newfile))
|
||||
fl_alert("Error writing to file \'%s\':\n%s.", newfile, strerror(errno));
|
||||
else
|
||||
strcpy(filename, newfile);
|
||||
changed = 0;
|
||||
textbuf->call_modify_callbacks();
|
||||
}
|
||||
|
||||
void copy_cb(Fl_Widget*, void* v) {
|
||||
EditorWindow* e = (EditorWindow*)v;
|
||||
Fl_Text_Editor::kf_copy(0, e->editor);
|
||||
}
|
||||
|
||||
void cut_cb(Fl_Widget*, void* v) {
|
||||
EditorWindow* e = (EditorWindow*)v;
|
||||
Fl_Text_Editor::kf_cut(0, e->editor);
|
||||
}
|
||||
|
||||
void delete_cb(Fl_Widget*, void*) {
|
||||
textbuf->remove_selection();
|
||||
}
|
||||
|
||||
void find_cb(Fl_Widget* w, void* v) {
|
||||
EditorWindow* e = (EditorWindow*)v;
|
||||
const char *val;
|
||||
|
||||
val = fl_input("Search String:", e->search);
|
||||
if (val != NULL) {
|
||||
// User entered a string - go find it!
|
||||
strcpy(e->search, val);
|
||||
find2_cb(w, v);
|
||||
}
|
||||
}
|
||||
|
||||
void find2_cb(Fl_Widget* w, void* v) {
|
||||
EditorWindow* e = (EditorWindow*)v;
|
||||
if (e->search[0] == '\0') {
|
||||
// Search string is blank; get a new one...
|
||||
find_cb(w, v);
|
||||
return;
|
||||
}
|
||||
|
||||
int pos = e->editor->insert_position();
|
||||
int found = textbuf->search_forward(pos, e->search, &pos);
|
||||
if (found) {
|
||||
// Found a match; select and update the position...
|
||||
textbuf->select(pos, pos+strlen(e->search));
|
||||
e->editor->insert_position(pos+strlen(e->search));
|
||||
e->editor->show_insert_position();
|
||||
}
|
||||
else fl_alert("No occurrences of \'%s\' found!", e->search);
|
||||
}
|
||||
|
||||
void set_title(Fl_Window* w) {
|
||||
if (filename[0] == '\0') strcpy(title, "Untitled");
|
||||
else {
|
||||
char *slash;
|
||||
slash = strrchr(filename, '/');
|
||||
#ifdef WIN32
|
||||
if (slash == NULL) slash = strrchr(filename, '\\');
|
||||
#endif
|
||||
if (slash != NULL) strcpy(title, slash + 1);
|
||||
else strcpy(title, filename);
|
||||
}
|
||||
|
||||
if (changed) strcat(title, " (modified)");
|
||||
|
||||
w->label(title);
|
||||
}
|
||||
|
||||
void changed_cb(int, int nInserted, int nDeleted,int, const char*, void* v) {
|
||||
if ((nInserted || nDeleted) && !loading) changed = 1;
|
||||
EditorWindow *w = (EditorWindow *)v;
|
||||
set_title(w);
|
||||
if (loading) w->editor->show_insert_position();
|
||||
}
|
||||
|
||||
void new_cb(Fl_Widget*, void*) {
|
||||
if (!check_save()) return;
|
||||
|
||||
filename[0] = '\0';
|
||||
textbuf->select(0, textbuf->length());
|
||||
textbuf->remove_selection();
|
||||
changed = 0;
|
||||
textbuf->call_modify_callbacks();
|
||||
}
|
||||
|
||||
void open_cb(Fl_Widget*, void*) {
|
||||
if (!check_save()) return;
|
||||
Fl_Native_File_Chooser fnfc;
|
||||
fnfc.title("Open file");
|
||||
fnfc.type(Fl_Native_File_Chooser::BROWSE_FILE);
|
||||
if ( fnfc.show() ) return;
|
||||
load_file(fnfc.filename(), -1);
|
||||
|
||||
}
|
||||
|
||||
void insert_cb(Fl_Widget*, void *v) {
|
||||
Fl_Native_File_Chooser fnfc;
|
||||
fnfc.title("Insert file");
|
||||
fnfc.type(Fl_Native_File_Chooser::BROWSE_FILE);
|
||||
if ( fnfc.show() ) return;
|
||||
EditorWindow *w = (EditorWindow *)v;
|
||||
load_file(fnfc.filename(), w->editor->insert_position());
|
||||
}
|
||||
|
||||
void paste_cb(Fl_Widget*, void* v) {
|
||||
EditorWindow* e = (EditorWindow*)v;
|
||||
Fl_Text_Editor::kf_paste(0, e->editor);
|
||||
}
|
||||
|
||||
int num_windows = 0;
|
||||
|
||||
void close_cb(Fl_Widget*, void* v) {
|
||||
EditorWindow* w = (EditorWindow*)v;
|
||||
|
||||
if (num_windows == 1) {
|
||||
if (!check_save())
|
||||
return;
|
||||
}
|
||||
|
||||
w->hide();
|
||||
w->editor->buffer(0);
|
||||
textbuf->remove_modify_callback(style_update, w->editor);
|
||||
textbuf->remove_modify_callback(changed_cb, w);
|
||||
Fl::delete_widget(w);
|
||||
|
||||
num_windows--;
|
||||
if (!num_windows) exit(0);
|
||||
}
|
||||
|
||||
void quit_cb(Fl_Widget*, void*) {
|
||||
if (changed && !check_save())
|
||||
return;
|
||||
|
||||
exit(0);
|
||||
}
|
||||
|
||||
void replace_cb(Fl_Widget*, void* v) {
|
||||
EditorWindow* e = (EditorWindow*)v;
|
||||
e->replace_dlg->show();
|
||||
}
|
||||
|
||||
void replace2_cb(Fl_Widget*, void* v) {
|
||||
EditorWindow* e = (EditorWindow*)v;
|
||||
const char *find = e->replace_find->value();
|
||||
const char *replace = e->replace_with->value();
|
||||
|
||||
if (find[0] == '\0') {
|
||||
// Search string is blank; get a new one...
|
||||
e->replace_dlg->show();
|
||||
return;
|
||||
}
|
||||
|
||||
e->replace_dlg->hide();
|
||||
|
||||
int pos = e->editor->insert_position();
|
||||
int found = textbuf->search_forward(pos, find, &pos);
|
||||
|
||||
if (found) {
|
||||
// Found a match; update the position and replace text...
|
||||
textbuf->select(pos, pos+strlen(find));
|
||||
textbuf->remove_selection();
|
||||
textbuf->insert(pos, replace);
|
||||
textbuf->select(pos, pos+strlen(replace));
|
||||
e->editor->insert_position(pos+strlen(replace));
|
||||
e->editor->show_insert_position();
|
||||
}
|
||||
else fl_alert("No occurrences of \'%s\' found!", find);
|
||||
}
|
||||
|
||||
void replall_cb(Fl_Widget*, void* v) {
|
||||
EditorWindow* e = (EditorWindow*)v;
|
||||
const char *find = e->replace_find->value();
|
||||
const char *replace = e->replace_with->value();
|
||||
|
||||
find = e->replace_find->value();
|
||||
if (find[0] == '\0') {
|
||||
// Search string is blank; get a new one...
|
||||
e->replace_dlg->show();
|
||||
return;
|
||||
}
|
||||
|
||||
e->replace_dlg->hide();
|
||||
|
||||
e->editor->insert_position(0);
|
||||
int times = 0;
|
||||
|
||||
// Loop through the whole string
|
||||
for (int found = 1; found;) {
|
||||
int pos = e->editor->insert_position();
|
||||
found = textbuf->search_forward(pos, find, &pos);
|
||||
|
||||
if (found) {
|
||||
// Found a match; update the position and replace text...
|
||||
textbuf->select(pos, pos+strlen(find));
|
||||
textbuf->remove_selection();
|
||||
textbuf->insert(pos, replace);
|
||||
e->editor->insert_position(pos+strlen(replace));
|
||||
e->editor->show_insert_position();
|
||||
times++;
|
||||
}
|
||||
}
|
||||
|
||||
if (times) fl_message("Replaced %d occurrences.", times);
|
||||
else fl_alert("No occurrences of \'%s\' found!", find);
|
||||
}
|
||||
|
||||
void replcan_cb(Fl_Widget*, void* v) {
|
||||
EditorWindow* e = (EditorWindow*)v;
|
||||
e->replace_dlg->hide();
|
||||
}
|
||||
|
||||
void save_cb() {
|
||||
if (filename[0] == '\0') {
|
||||
// No filename - get one!
|
||||
saveas_cb();
|
||||
return;
|
||||
}
|
||||
else save_file(filename);
|
||||
}
|
||||
|
||||
void saveas_cb() {
|
||||
Fl_Native_File_Chooser fnfc;
|
||||
fnfc.title("Save File As?");
|
||||
fnfc.type(Fl_Native_File_Chooser::BROWSE_SAVE_FILE);
|
||||
if ( fnfc.show() ) return;
|
||||
save_file(fnfc.filename());
|
||||
}
|
||||
|
||||
Fl_Window* new_view();
|
||||
|
||||
void view_cb(Fl_Widget*, void*) {
|
||||
Fl_Window* w = new_view();
|
||||
w->show();
|
||||
}
|
||||
|
||||
Fl_Menu_Item menuitems[] = {
|
||||
{ "&File", 0, 0, 0, FL_SUBMENU },
|
||||
{ "&New File", 0, (Fl_Callback *)new_cb },
|
||||
{ "&Open File...", FL_COMMAND + 'o', (Fl_Callback *)open_cb },
|
||||
{ "&Insert File...", FL_COMMAND + 'i', (Fl_Callback *)insert_cb, 0, FL_MENU_DIVIDER },
|
||||
{ "&Save File", FL_COMMAND + 's', (Fl_Callback *)save_cb },
|
||||
{ "Save File &As...", FL_COMMAND + FL_SHIFT + 's', (Fl_Callback *)saveas_cb, 0, FL_MENU_DIVIDER },
|
||||
{ "New &View", FL_ALT
|
||||
#ifdef __APPLE__
|
||||
+ FL_COMMAND
|
||||
#endif
|
||||
+ 'v', (Fl_Callback *)view_cb, 0 },
|
||||
{ "&Close View", FL_COMMAND + 'w', (Fl_Callback *)close_cb, 0, FL_MENU_DIVIDER },
|
||||
{ "E&xit", FL_COMMAND + 'q', (Fl_Callback *)quit_cb, 0 },
|
||||
{ 0 },
|
||||
|
||||
{ "&Edit", 0, 0, 0, FL_SUBMENU },
|
||||
{ "Cu&t", FL_COMMAND + 'x', (Fl_Callback *)cut_cb },
|
||||
{ "&Copy", FL_COMMAND + 'c', (Fl_Callback *)copy_cb },
|
||||
{ "&Paste", FL_COMMAND + 'v', (Fl_Callback *)paste_cb },
|
||||
{ "&Delete", 0, (Fl_Callback *)delete_cb },
|
||||
{ 0 },
|
||||
|
||||
{ "&Search", 0, 0, 0, FL_SUBMENU },
|
||||
{ "&Find...", FL_COMMAND + 'f', (Fl_Callback *)find_cb },
|
||||
{ "F&ind Again", FL_COMMAND + 'g', find2_cb },
|
||||
{ "&Replace...", FL_COMMAND + 'r', replace_cb },
|
||||
{ "Re&place Again", FL_COMMAND + 't', replace2_cb },
|
||||
{ 0 },
|
||||
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
Fl_Window* new_view() {
|
||||
EditorWindow* w = new EditorWindow(660, 400, title);
|
||||
w->begin();
|
||||
Fl_Menu_Bar* m = new Fl_Menu_Bar(0, 0, 660, 30);
|
||||
m->copy(menuitems, w);
|
||||
w->editor = new Fl_Text_Editor(0, 30, 660, 370);
|
||||
w->editor->textfont(FL_COURIER);
|
||||
w->editor->textsize(TS);
|
||||
//w->editor->wrap_mode(Fl_Text_Editor::WRAP_AT_BOUNDS, 250);
|
||||
w->editor->buffer(textbuf);
|
||||
w->editor->highlight_data(stylebuf, styletable,
|
||||
sizeof(styletable) / sizeof(styletable[0]),
|
||||
'A', style_unfinished_cb, 0);
|
||||
textbuf->text();
|
||||
style_init();
|
||||
w->end();
|
||||
w->resizable(w->editor);
|
||||
w->callback((Fl_Callback *)close_cb, w);
|
||||
|
||||
textbuf->add_modify_callback(style_update, w->editor);
|
||||
textbuf->add_modify_callback(changed_cb, w);
|
||||
textbuf->call_modify_callbacks();
|
||||
num_windows++;
|
||||
return w;
|
||||
}
|
||||
|
||||
void cb(const char *fname) {
|
||||
load_file(fname, -1);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
textbuf = new Fl_Text_Buffer;
|
||||
//textbuf->transcoding_warning_action = NULL;
|
||||
style_init();
|
||||
fl_open_callback(cb);
|
||||
|
||||
Fl_Window* window = new_view();
|
||||
|
||||
window->show(1, argv);
|
||||
#ifndef __APPLE__
|
||||
if (argc > 1) load_file(argv[1], -1);
|
||||
#endif
|
||||
|
||||
return Fl::run();
|
||||
}
|
||||
|
||||
//
|
||||
// End of "$Id: editor.cxx 9718 2012-11-13 13:03:20Z manolo $".
|
||||
//
|
30
x11-packages/fltk/build.sh
Normal file
30
x11-packages/fltk/build.sh
Normal file
@ -0,0 +1,30 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=http://www.fltk.org/
|
||||
TERMUX_PKG_DESCRIPTION="Graphical user interface toolkit for X"
|
||||
TERMUX_PKG_VERSION=1.3.4
|
||||
TERMUX_PKG_REVISION=4
|
||||
TERMUX_PKG_SRCURL=http://fltk.org/pub/fltk/${TERMUX_PKG_VERSION}/fltk-${TERMUX_PKG_VERSION}-source.tar.gz
|
||||
TERMUX_PKG_SHA256=c8ab01c4e860d53e11d40dc28f98d2fe9c85aaf6dbb5af50fd6e66afec3dc58f
|
||||
TERMUX_PKG_DEPENDS="libc++, libjpeg-turbo, libxcursor, libxfixes, libxft, libxinerama, libxrender"
|
||||
TERMUX_PKG_REPLACES="fluid"
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
|
||||
--enable-shared
|
||||
--enable-threads
|
||||
--enable-xinerama
|
||||
--enable-xft
|
||||
--enable-xfixes
|
||||
--enable-xcursor
|
||||
--enable-xrender
|
||||
"
|
||||
|
||||
termux_step_pre_configure()
|
||||
{
|
||||
sed -i 's/class Fl_XFont_On_Demand/class FL_EXPORT Fl_XFont_On_Demand/' FL/x.H
|
||||
sed -i 's/x-fluid.desktop/fluid.desktop/' -i fluid/Makefile
|
||||
sed -i -e 's/$(LINKFLTK)/$(LINKSHARED)/' -e 's/$(LINKFLTKIMG)/$(LINKSHARED)/' test/Makefile
|
||||
|
||||
export LIBS="-L/data/data/com.termux/files/usr/lib"
|
||||
}
|
97
x11-packages/fltk/fltk-1.3.3_fltk-config.in.patch
Normal file
97
x11-packages/fltk/fltk-1.3.3_fltk-config.in.patch
Normal file
@ -0,0 +1,97 @@
|
||||
diff -Naur fltk-1.3.3-orig/fltk-config.in fltk-1.3.3/fltk-config.in
|
||||
--- fltk-1.3.3-orig/fltk-config.in 2014-12-31 15:43:07.203519633 -0500
|
||||
+++ fltk-1.3.3/fltk-config.in 2014-12-31 15:49:01.636277725 -0500
|
||||
@@ -54,21 +54,6 @@
|
||||
bindir="$selfdir/fluid"
|
||||
includedir="$selfdir"
|
||||
libdir="$selfdir/lib"
|
||||
-
|
||||
- if test -f "$libdir/libfltk_jpeg.a"; then
|
||||
- CFLAGS="-I$includedir/jpeg $CFLAGS"
|
||||
- CXXFLAGS="-I$includedir/jpeg $CXXFLAGS"
|
||||
- fi
|
||||
-
|
||||
- if test -f "$libdir/libfltk_z.a"; then
|
||||
- CFLAGS="-I$includedir/zlib $CFLAGS"
|
||||
- CXXFLAGS="-I$includedir/zlib $CXXFLAGS"
|
||||
- fi
|
||||
-
|
||||
- if test -f "$libdir/libfltk_png.a"; then
|
||||
- CFLAGS="-I$includedir/png $CFLAGS"
|
||||
- CXXFLAGS="-I$includedir/png $CXXFLAGS"
|
||||
- fi
|
||||
fi
|
||||
|
||||
if test -d $includedir/FL/images; then
|
||||
@@ -76,11 +61,6 @@
|
||||
CXXFLAGS="-I$includedir/FL/images $CXXFLAGS"
|
||||
fi
|
||||
|
||||
-if test -f "$libdir/libfltk_cairo.a"; then
|
||||
- CFLAGS="$CAIROFLAGS $CFLAGS"
|
||||
- CXXFLAGS="$CAIROFLAGS $CXXFLAGS"
|
||||
-fi
|
||||
-
|
||||
# libraries to link with:
|
||||
LIBNAME="@LIBNAME@"
|
||||
DSONAME="@DSONAME@"
|
||||
@@ -230,25 +210,20 @@
|
||||
fi
|
||||
|
||||
# Calculate needed libraries
|
||||
-LDSTATIC="$libdir/libfltk.a $LDLIBS"
|
||||
LDLIBS="-lfltk$SHAREDSUFFIX $LDLIBS"
|
||||
|
||||
if test x$use_forms = xyes; then
|
||||
LDLIBS="-lfltk_forms$SHAREDSUFFIX $LDLIBS"
|
||||
- LDSTATIC="$libdir/libfltk_forms.a $LDSTATIC"
|
||||
fi
|
||||
if test x$use_gl = xyes; then
|
||||
LDLIBS="-lfltk_gl$SHAREDSUFFIX @GLLIB@ $LDLIBS"
|
||||
- LDSTATIC="$libdir/libfltk_gl.a @GLLIB@ $LDSTATIC"
|
||||
fi
|
||||
if test x$use_images = xyes; then
|
||||
LDLIBS="-lfltk_images$SHAREDSUFFIX $IMAGELIBS $LDLIBS"
|
||||
- LDSTATIC="$libdir/libfltk_images.a $STATICIMAGELIBS $LDSTATIC"
|
||||
fi
|
||||
|
||||
if test x$use_cairo = xyes; then
|
||||
LDLIBS="-lfltk_cairo$SHAREDSUFFIX $CAIROLIBS $LDLIBS"
|
||||
- LDSTATIC="$libdir/libfltk_cairo.a $CAIROLIBS $LDSTATIC"
|
||||
fi
|
||||
|
||||
LDLIBS="$DSOLINK $LDFLAGS $libs $LDLIBS"
|
||||
@@ -359,26 +334,26 @@
|
||||
fi
|
||||
|
||||
if test "$echo_libs" = "yes"; then
|
||||
- USELIBS="$libdir/libfltk.a"
|
||||
+ USELIBS="$libdir/libfltk.so"
|
||||
|
||||
if test x$use_forms = xyes; then
|
||||
- USELIBS="$libdir/libfltk_forms.a $USELIBS"
|
||||
+ USELIBS="$libdir/libfltk_forms.so $USELIBS"
|
||||
fi
|
||||
|
||||
if test x$use_gl = xyes; then
|
||||
- USELIBS="$libdir/libfltk_gl.a $USELIBS"
|
||||
+ USELIBS="$libdir/libfltk_gl.so $USELIBS"
|
||||
fi
|
||||
|
||||
if test x$use_cairo = xyes; then
|
||||
- USELIBS="$libdir/libfltk_cairo.a $USELIBS"
|
||||
+ USELIBS="$libdir/libfltk_cairo.so $USELIBS"
|
||||
fi
|
||||
|
||||
if test x$use_images = xyes; then
|
||||
- USELIBS="$libdir/libfltk_images.a $USELIBS"
|
||||
+ USELIBS="$libdir/libfltk_images.so $USELIBS"
|
||||
|
||||
for lib in fltk_jpeg fltk_png fltk_z; do
|
||||
- if test -f $libdir/lib$lib.a; then
|
||||
- USELIBS="$libdir/lib$lib.a $USELIBS"
|
||||
+ if test -f $libdir/lib$lib.so; then
|
||||
+ USELIBS="$libdir/lib$lib.so $USELIBS"
|
||||
fi
|
||||
done
|
||||
fi
|
11
x11-packages/fltk/fltk-1.3.4_Makefile.patch
Normal file
11
x11-packages/fltk/fltk-1.3.4_Makefile.patch
Normal file
@ -0,0 +1,11 @@
|
||||
--- ./Makefile 2013-10-27 18:19:39.693208127 -0300
|
||||
+++ ./Makefile 2013-10-27 18:20:08.032136885 -0300
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
include makeinclude
|
||||
|
||||
-DIRS = $(IMAGEDIRS) src $(CAIRODIR) fluid test documentation
|
||||
+DIRS = $(IMAGEDIRS) src $(CAIRODIR) fluid documentation
|
||||
|
||||
all: makeinclude fltk-config
|
||||
for dir in $(DIRS); do\
|
@ -0,0 +1,14 @@
|
||||
diff -uNr fltk-1.3.4/fluid/ExternalCodeEditor_UNIX.cxx fltk-1.3.4.mod/fluid/ExternalCodeEditor_UNIX.cxx
|
||||
--- fltk-1.3.4/fluid/ExternalCodeEditor_UNIX.cxx 2016-08-16 23:42:22.000000000 +0300
|
||||
+++ fltk-1.3.4.mod/fluid/ExternalCodeEditor_UNIX.cxx 2017-12-10 15:15:58.522896625 +0200
|
||||
@@ -214,8 +214,8 @@
|
||||
// Returns pointer to static memory.
|
||||
//
|
||||
const char* ExternalCodeEditor::tmpdir_name() {
|
||||
- static char dirname[100];
|
||||
- snprintf(dirname, sizeof(dirname), "/tmp/.fluid-%ld", (long)getpid());
|
||||
+ static char dirname[100] = {0};
|
||||
+ snprintf(dirname, sizeof(dirname), "/data/data/com.termux/files/usr/tmp/.fluid-%ld", (long)getpid());
|
||||
return dirname;
|
||||
}
|
||||
|
24
x11-packages/fltk/fltk-1.3.4_src_Fl_File_Browser.cxx.patch
Normal file
24
x11-packages/fltk/fltk-1.3.4_src_Fl_File_Browser.cxx.patch
Normal file
@ -0,0 +1,24 @@
|
||||
diff -uNr fltk-1.3.4/src/Fl_File_Browser.cxx fltk-1.3.4.mod/src/Fl_File_Browser.cxx
|
||||
--- fltk-1.3.4/src/Fl_File_Browser.cxx 2016-10-19 08:55:03.000000000 +0300
|
||||
+++ fltk-1.3.4.mod/src/Fl_File_Browser.cxx 2017-12-10 15:19:04.555072795 +0200
|
||||
@@ -624,13 +624,16 @@
|
||||
// Open the file that contains a list of mounted filesystems...
|
||||
//
|
||||
|
||||
- mtab = fl_fopen("/etc/mnttab", "r"); // Fairly standard
|
||||
+ mtab = fl_fopen("/data/data/com.termux/files/usr/etc/mnttab", "r"); // Fairly standard
|
||||
if (mtab == NULL)
|
||||
- mtab = fl_fopen("/etc/mtab", "r"); // More standard
|
||||
+ mtab = fl_fopen("/data/data/com.termux/files/usr/etc/mtab", "r"); // More standard
|
||||
if (mtab == NULL)
|
||||
- mtab = fl_fopen("/etc/fstab", "r"); // Otherwise fallback to full list
|
||||
+ mtab = fl_fopen("/data/data/com.termux/files/usr/etc/fstab", "r"); // Otherwise fallback to full list
|
||||
if (mtab == NULL)
|
||||
- mtab = fl_fopen("/etc/vfstab", "r"); // Alternate full list file
|
||||
+ mtab = fl_fopen("/data/data/com.termux/files/usr/etc/vfstab", "r"); // Alternate full list file
|
||||
+
|
||||
+ if (mtab == NULL)
|
||||
+ mtab = fl_fopen("/proc/mounts", "r"); // Try to use /proc/mounts
|
||||
|
||||
if (mtab != NULL)
|
||||
{
|
107
x11-packages/fltk/fltk-1.3.4_src_Fl_File_Icon2.cxx.patch
Normal file
107
x11-packages/fltk/fltk-1.3.4_src_Fl_File_Icon2.cxx.patch
Normal file
@ -0,0 +1,107 @@
|
||||
diff -uNr fltk-1.3.4/src/Fl_File_Icon2.cxx fltk-1.3.4.mod/src/Fl_File_Icon2.cxx
|
||||
--- fltk-1.3.4/src/Fl_File_Icon2.cxx 2016-10-14 19:35:44.000000000 +0300
|
||||
+++ fltk-1.3.4.mod/src/Fl_File_Icon2.cxx 2017-12-10 15:33:40.275018367 +0200
|
||||
@@ -677,9 +677,9 @@
|
||||
if (!kdedir) {
|
||||
// Figure out where KDE is installed...
|
||||
if ((kdedir = getenv("KDEDIR")) == NULL) {
|
||||
- if (!access("/opt/kde", F_OK)) kdedir = "/opt/kde";
|
||||
- else if (!access("/usr/local/share/mimelnk", F_OK)) kdedir = "/usr/local";
|
||||
- else kdedir = "/usr";
|
||||
+ if (!access("/data/data/com.termux/files/usr/opt/kde", F_OK)) kdedir = "/data/data/com.termux/files/usr/opt/kde";
|
||||
+ else if (!access("/data/data/com.termux/files/usr/share/mimelnk", F_OK)) kdedir = "/data/data/com.termux/files/usr";
|
||||
+ else kdedir = "/data/data/com.termux/files/usr";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -715,66 +715,66 @@
|
||||
|
||||
snprintf(filename, sizeof(filename), "%s/share/mimelnk", kdedir);
|
||||
load_kde_icons(filename, icondir);
|
||||
- } else if (!access("/usr/share/icons/folder.xpm", F_OK)) {
|
||||
+ } else if (!access("/data/data/com.termux/files/usr/share/icons/folder.xpm", F_OK)) {
|
||||
// Load GNOME icons...
|
||||
icon = new Fl_File_Icon("*", Fl_File_Icon::PLAIN);
|
||||
- icon->load_image("/usr/share/icons/page.xpm");
|
||||
+ icon->load_image("/data/data/com.termux/files/usr/share/icons/page.xpm");
|
||||
|
||||
icon = new Fl_File_Icon("*", Fl_File_Icon::DIRECTORY);
|
||||
- icon->load_image("/usr/share/icons/folder.xpm");
|
||||
- } else if (!access("/usr/dt/appconfig/icons", F_OK)) {
|
||||
+ icon->load_image("/data/data/com.termux/files/usr/share/icons/folder.xpm");
|
||||
+ } else if (!access("/data/data/com.termux/files/usr/dt/appconfig/icons", F_OK)) {
|
||||
// Load CDE icons...
|
||||
icon = new Fl_File_Icon("*", Fl_File_Icon::PLAIN);
|
||||
- icon->load_image("/usr/dt/appconfig/icons/C/Dtdata.m.pm");
|
||||
+ icon->load_image("/data/data/com.termux/files/usr/dt/appconfig/icons/C/Dtdata.m.pm");
|
||||
|
||||
icon = new Fl_File_Icon("*", Fl_File_Icon::DIRECTORY);
|
||||
- icon->load_image("/usr/dt/appconfig/icons/C/DtdirB.m.pm");
|
||||
+ icon->load_image("/data/data/com.termux/files/usr/dt/appconfig/icons/C/DtdirB.m.pm");
|
||||
|
||||
icon = new Fl_File_Icon("core", Fl_File_Icon::PLAIN);
|
||||
- icon->load_image("/usr/dt/appconfig/icons/C/Dtcore.m.pm");
|
||||
+ icon->load_image("/data/data/com.termux/files/usr/dt/appconfig/icons/C/Dtcore.m.pm");
|
||||
|
||||
icon = new Fl_File_Icon("*.{bmp|bw|gif|jpg|pbm|pcd|pgm|ppm|png|ras|rgb|tif|xbm|xpm}", Fl_File_Icon::PLAIN);
|
||||
- icon->load_image("/usr/dt/appconfig/icons/C/Dtimage.m.pm");
|
||||
+ icon->load_image("/data/data/com.termux/files/usr/dt/appconfig/icons/C/Dtimage.m.pm");
|
||||
|
||||
icon = new Fl_File_Icon("*.{eps|pdf|ps}", Fl_File_Icon::PLAIN);
|
||||
- icon->load_image("/usr/dt/appconfig/icons/C/Dtps.m.pm");
|
||||
+ icon->load_image("/data/data/com.termux/files/usr/dt/appconfig/icons/C/Dtps.m.pm");
|
||||
|
||||
icon = new Fl_File_Icon("*.ppd", Fl_File_Icon::PLAIN);
|
||||
- icon->load_image("/usr/dt/appconfig/icons/C/DtPrtpr.m.pm");
|
||||
- } else if (!access("/usr/lib/filetype", F_OK)) {
|
||||
+ icon->load_image("/data/data/com.termux/files/usr/dt/appconfig/icons/C/DtPrtpr.m.pm");
|
||||
+ } else if (!access("/data/data/com.termux/files/usr/lib/filetype", F_OK)) {
|
||||
// Load SGI icons...
|
||||
icon = new Fl_File_Icon("*", Fl_File_Icon::PLAIN);
|
||||
- icon->load_fti("/usr/lib/filetype/iconlib/generic.doc.fti");
|
||||
+ icon->load_fti("/data/data/com.termux/files/usr/lib/filetype/iconlib/generic.doc.fti");
|
||||
|
||||
icon = new Fl_File_Icon("*", Fl_File_Icon::DIRECTORY);
|
||||
- icon->load_fti("/usr/lib/filetype/iconlib/generic.folder.closed.fti");
|
||||
+ icon->load_fti("/data/data/com.termux/files/usr/lib/filetype/iconlib/generic.folder.closed.fti");
|
||||
|
||||
icon = new Fl_File_Icon("core", Fl_File_Icon::PLAIN);
|
||||
- icon->load_fti("/usr/lib/filetype/default/iconlib/CoreFile.fti");
|
||||
+ icon->load_fti("/data/data/com.termux/files/usr/lib/filetype/default/iconlib/CoreFile.fti");
|
||||
|
||||
icon = new Fl_File_Icon("*.{bmp|bw|gif|jpg|pbm|pcd|pgm|ppm|png|ras|rgb|tif|xbm|xpm}", Fl_File_Icon::PLAIN);
|
||||
- icon->load_fti("/usr/lib/filetype/system/iconlib/ImageFile.fti");
|
||||
+ icon->load_fti("/data/data/com.termux/files/usr/lib/filetype/system/iconlib/ImageFile.fti");
|
||||
|
||||
- if (!access("/usr/lib/filetype/install/iconlib/acroread.doc.fti", F_OK)) {
|
||||
+ if (!access("/data/data/com.termux/files/usr/lib/filetype/install/iconlib/acroread.doc.fti", F_OK)) {
|
||||
icon = new Fl_File_Icon("*.{eps|ps}", Fl_File_Icon::PLAIN);
|
||||
- icon->load_fti("/usr/lib/filetype/system/iconlib/PostScriptFile.closed.fti");
|
||||
+ icon->load_fti("/data/data/com.termux/files/usr/lib/filetype/system/iconlib/PostScriptFile.closed.fti");
|
||||
|
||||
icon = new Fl_File_Icon("*.pdf", Fl_File_Icon::PLAIN);
|
||||
- icon->load_fti("/usr/lib/filetype/install/iconlib/acroread.doc.fti");
|
||||
+ icon->load_fti("/data/data/com.termux/files/usr/lib/filetype/install/iconlib/acroread.doc.fti");
|
||||
} else {
|
||||
icon = new Fl_File_Icon("*.{eps|pdf|ps}", Fl_File_Icon::PLAIN);
|
||||
- icon->load_fti("/usr/lib/filetype/system/iconlib/PostScriptFile.closed.fti");
|
||||
+ icon->load_fti("/data/data/com.termux/files/usr/lib/filetype/system/iconlib/PostScriptFile.closed.fti");
|
||||
}
|
||||
|
||||
- if (!access("/usr/lib/filetype/install/iconlib/html.fti", F_OK)) {
|
||||
+ if (!access("/data/data/com.termux/files/usr/lib/filetype/install/iconlib/html.fti", F_OK)) {
|
||||
icon = new Fl_File_Icon("*.{htm|html|shtml}", Fl_File_Icon::PLAIN);
|
||||
- icon->load_fti("/usr/lib/filetype/iconlib/generic.doc.fti");
|
||||
- icon->load_fti("/usr/lib/filetype/install/iconlib/html.fti");
|
||||
+ icon->load_fti("/data/data/com.termux/files/usr/lib/filetype/iconlib/generic.doc.fti");
|
||||
+ icon->load_fti("/data/data/com.termux/files/usr/lib/filetype/install/iconlib/html.fti");
|
||||
}
|
||||
|
||||
- if (!access("/usr/lib/filetype/install/iconlib/color.ps.idle.fti", F_OK)) {
|
||||
+ if (!access("/data/data/com.termux/files/usr/lib/filetype/install/iconlib/color.ps.idle.fti", F_OK)) {
|
||||
icon = new Fl_File_Icon("*.ppd", Fl_File_Icon::PLAIN);
|
||||
- icon->load_fti("/usr/lib/filetype/install/iconlib/color.ps.idle.fti");
|
||||
+ icon->load_fti("/data/data/com.termux/files/usr/lib/filetype/install/iconlib/color.ps.idle.fti");
|
||||
}
|
||||
} else {
|
||||
// Create the default icons...
|
@ -0,0 +1,11 @@
|
||||
--- ./src/Fl_Native_File_Chooser_GTK.cxx 2015-12-13 15:56:09.000000000 +0530
|
||||
+++ ../Fl_Native_File_Chooser_GTK.cxx 2017-04-30 12:20:01.391541825 +0530
|
||||
@@ -684,7 +684,7 @@
|
||||
return;
|
||||
}
|
||||
|
||||
- char *pc_dl_error; // used to report errors by the GET_SYM macro...
|
||||
+ const char *pc_dl_error; // used to report errors by the GET_SYM macro...
|
||||
// items we need from GLib
|
||||
GET_SYM(g_free, ptr_glib);
|
||||
GET_SYM(g_slist_nth_data, ptr_glib);
|
56
x11-packages/fltk/fltk-1.3.4_src_Fl_Preferences.cxx.patch
Normal file
56
x11-packages/fltk/fltk-1.3.4_src_Fl_Preferences.cxx.patch
Normal file
@ -0,0 +1,56 @@
|
||||
diff -uNr fltk-1.3.4/src/Fl_Preferences.cxx fltk-1.3.4.mod/src/Fl_Preferences.cxx
|
||||
--- fltk-1.3.4/src/Fl_Preferences.cxx 2015-04-25 00:25:30.000000000 +0300
|
||||
+++ fltk-1.3.4.mod/src/Fl_Preferences.cxx 2017-12-10 15:27:01.280525349 +0200
|
||||
@@ -963,7 +963,8 @@
|
||||
vendor_(0L),
|
||||
application_(0L) {
|
||||
|
||||
- char filename[ FL_PATH_MAX ]; filename[0] = 0;
|
||||
+ char filename[ FL_PATH_MAX ] = {0};
|
||||
+
|
||||
#ifdef WIN32
|
||||
# define FLPREFS_RESOURCE "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"
|
||||
# define FLPREFS_RESOURCEW L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders"
|
||||
@@ -1049,7 +1050,7 @@
|
||||
break;
|
||||
}
|
||||
case SYSTEM:
|
||||
- strcpy(filename, "/etc/fltk/");
|
||||
+ strcpy(filename, "/data/data/com.termux/files/usr/etc/fltk/");
|
||||
break;
|
||||
}
|
||||
snprintf(filename + strlen(filename), sizeof(filename) - strlen(filename),
|
||||
@@ -1162,20 +1163,6 @@
|
||||
fprintf( f, "; application: %s\n", application_ );
|
||||
prefs_->node->write( f );
|
||||
fclose( f );
|
||||
-#if !(defined(__APPLE__) || defined(WIN32))
|
||||
- // unix: make sure that system prefs are user-readable
|
||||
- if (strncmp(filename_, "/etc/fltk/", 10) == 0) {
|
||||
- char *p;
|
||||
- p = filename_ + 9;
|
||||
- do { // for each directory to the pref file
|
||||
- *p = 0;
|
||||
- fl_chmod(filename_, 0755); // rwxr-xr-x
|
||||
- *p = '/';
|
||||
- p = strchr(p+1, '/');
|
||||
- } while (p);
|
||||
- fl_chmod(filename_, 0644); // rw-r--r--
|
||||
- }
|
||||
-#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1191,12 +1178,6 @@
|
||||
if ( !s ) return 0;
|
||||
*s = 0;
|
||||
char ret = fl_make_path( path );
|
||||
-#if !(defined(__APPLE__) || defined(WIN32))
|
||||
- // unix: make sure that system prefs dir. is user-readable
|
||||
- if (strncmp(path, "/etc/fltk/", 10) == 0) {
|
||||
- fl_chmod(path, 0755); // rwxr-xr-x
|
||||
- }
|
||||
-#endif
|
||||
strcpy( s, "/" );
|
||||
return ret;
|
||||
}
|
15
x11-packages/fltk/fltk-1.3.4_src_Fl_x.cxx.patch
Normal file
15
x11-packages/fltk/fltk-1.3.4_src_Fl_x.cxx.patch
Normal file
@ -0,0 +1,15 @@
|
||||
diff -uNr fltk-1.3.4/src/Fl_x.cxx fltk-1.3.4.mod/src/Fl_x.cxx
|
||||
--- fltk-1.3.4/src/Fl_x.cxx 2016-10-14 19:35:44.000000000 +0300
|
||||
+++ fltk-1.3.4.mod/src/Fl_x.cxx 2017-12-10 15:13:22.701039128 +0200
|
||||
@@ -1481,9 +1481,9 @@
|
||||
if (!fl_selection_requestor) return 0;
|
||||
if (Fl::e_clipboard_type == Fl::clipboard_image) {
|
||||
if (bytesread == 0) return 0;
|
||||
- static char tmp_fname[21];
|
||||
+ static char tmp_fname[52] = {0};
|
||||
static Fl_Shared_Image *shared = 0;
|
||||
- strcpy(tmp_fname, "/tmp/clipboardXXXXXX");
|
||||
+ strcpy(tmp_fname, "/data/data/com.termux/files/usr/tmp/clipboardXXXXXX");
|
||||
int fd = mkstemp(tmp_fname);
|
||||
if (fd == -1) return 0;
|
||||
uchar *p = sn_buffer; ssize_t towrite = bytesread, written;
|
12
x11-packages/fltk/fltk-1.3.4_src_fl_open_uri.cxx.patch
Normal file
12
x11-packages/fltk/fltk-1.3.4_src_fl_open_uri.cxx.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr fltk-1.3.4/src/fl_open_uri.cxx fltk-1.3.4.mod/src/fl_open_uri.cxx
|
||||
--- fltk-1.3.4/src/fl_open_uri.cxx 2013-10-04 19:48:08.000000000 +0300
|
||||
+++ fltk-1.3.4.mod/src/fl_open_uri.cxx 2017-12-10 15:30:04.032588233 +0200
|
||||
@@ -275,7 +275,7 @@
|
||||
*end; // End of filename buffer
|
||||
|
||||
|
||||
- if ((path = getenv("PATH")) == NULL) path = "/bin:/usr/bin";
|
||||
+ if ((path = getenv("PATH")) == NULL) path = "/data/data/com.termux/files/usr/bin:/data/data/com.termux/files/usr/bin/applets:/system/xbin:/system/bin";
|
||||
|
||||
for (ptr = filename, end = filename + filesize - 1; *path; path ++) {
|
||||
if (*path == ':') {
|
30
x11-packages/fltk/fltk-1.3.4_src_print_panel.cxx.patch
Normal file
30
x11-packages/fltk/fltk-1.3.4_src_print_panel.cxx.patch
Normal file
@ -0,0 +1,30 @@
|
||||
diff -uNr fltk-1.3.4/src/print_panel.cxx fltk-1.3.4.mod/src/print_panel.cxx
|
||||
--- fltk-1.3.4/src/print_panel.cxx 2016-03-09 18:08:39.000000000 +0200
|
||||
+++ fltk-1.3.4.mod/src/print_panel.cxx 2017-12-10 15:35:28.436230747 +0200
|
||||
@@ -533,7 +533,7 @@
|
||||
|
||||
defname[0] = '\0';
|
||||
// get names of all printers and of default one
|
||||
- if ((lpstat = popen("LC_MESSAGES=C LANG=C /bin/sh -c '(lpstat -p -d ) 2>&-'", "r")) != NULL) { // try first with SystemV printing system
|
||||
+ if ((lpstat = popen("LC_MESSAGES=C LANG=C /data/data/com.termux/files/usr/bin/sh -c '(lpstat -p -d ) 2>&-'", "r")) != NULL) { // try first with SystemV printing system
|
||||
while (fgets(line, sizeof(line), lpstat)) {
|
||||
if (!strncmp(line, "printer ", 8) &&
|
||||
sscanf(line + 8, "%s", name) == 1) {
|
||||
@@ -550,7 +550,7 @@
|
||||
pclose(lpstat);
|
||||
}
|
||||
|
||||
- if (print_choice->size() == 2 && (lpstat = fopen("/etc/printcap", "r"))) { // try next with BSD printing system
|
||||
+ if (print_choice->size() == 2 && (lpstat = fopen("/data/data/com.termux/files/usr/etc/printcap", "r"))) { // try next with BSD printing system
|
||||
while (fgets(line, sizeof(line),lpstat)) { // get names of all known printers
|
||||
if (*line == '#' || (p = strchr(line, '|')) == NULL) continue;
|
||||
*p = 0;
|
||||
@@ -593,7 +593,7 @@
|
||||
status[0] = 0;
|
||||
if (print_choice->value()) {
|
||||
strcpy(status, "printer status unavailable");
|
||||
- snprintf(command, sizeof(command), "/bin/sh -c \"(lpstat -p '%s' ) 2>&-\" ", printer); // try first with SystemV printing system
|
||||
+ snprintf(command, sizeof(command), "/data/data/com.termux/files/usr/bin/sh -c \"(lpstat -p '%s' ) 2>&-\" ", printer); // try first with SystemV printing system
|
||||
if ((lpstat = popen(command, "r")) != NULL) {
|
||||
if (fgets(status, sizeof(status), lpstat) == 0) { // if no reply
|
||||
pclose(lpstat);
|
18
x11-packages/fluxbox/build.sh
Normal file
18
x11-packages/fluxbox/build.sh
Normal file
@ -0,0 +1,18 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=http://www.fluxbox.org
|
||||
TERMUX_PKG_DESCRIPTION="A lightweight and highly-configurable window manager"
|
||||
TERMUX_PKG_VERSION=1.3.7
|
||||
TERMUX_PKG_REVISION=2
|
||||
TERMUX_PKG_SRCURL=https://downloads.sourceforge.net/sourceforge/fluxbox/fluxbox-${TERMUX_PKG_VERSION}.tar.xz
|
||||
TERMUX_PKG_SHA256=fc8c75fe94c54ed5a5dd3fd4a752109f8949d6df67a48e5b11a261403c382ec0
|
||||
TERMUX_PKG_DEPENDS="feh, fribidi, imlib2, libandroid-support, libc++, libxft, libxinerama, libxpm, libxrandr, xorg-xmessage"
|
||||
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
|
||||
--enable-imlib2
|
||||
--enable-xft
|
||||
--enable-xinerama
|
||||
CFLAGS=-I${TERMUX_PREFIX}/include/libandroid-support
|
||||
"
|
||||
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
12
x11-packages/fluxbox/fluxbox-1.3.7_src_FbCommands.cc.patch
Normal file
12
x11-packages/fluxbox/fluxbox-1.3.7_src_FbCommands.cc.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr fluxbox-1.3.7/src/FbCommands.cc fluxbox-1.3.7.mod/src/FbCommands.cc
|
||||
--- fluxbox-1.3.7/src/FbCommands.cc 2015-02-08 12:44:45.353187009 +0200
|
||||
+++ fluxbox-1.3.7.mod/src/FbCommands.cc 2018-06-19 20:52:20.788391222 +0300
|
||||
@@ -153,7 +153,7 @@
|
||||
// this process exits immediately, so we don't have to worry about memleaks
|
||||
const char *shell = getenv("SHELL");
|
||||
if (!shell)
|
||||
- shell = "/bin/sh";
|
||||
+ shell = "@TERMUX_PREFIX@/bin/sh";
|
||||
|
||||
setsid();
|
||||
execl(shell, shell, "-c", m_cmd.c_str(), static_cast<void*>(NULL));
|
12
x11-packages/fluxbox/fluxbox-1.3.7_src_main.cc.patch
Normal file
12
x11-packages/fluxbox/fluxbox-1.3.7_src_main.cc.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr fluxbox-1.3.7/src/main.cc fluxbox-1.3.7.mod/src/main.cc
|
||||
--- fluxbox-1.3.7/src/main.cc 2015-02-08 12:44:45.377187009 +0200
|
||||
+++ fluxbox-1.3.7.mod/src/main.cc 2018-06-19 20:52:20.791724555 +0300
|
||||
@@ -270,7 +270,7 @@
|
||||
if (!restart_argument.empty()) {
|
||||
const char *shell = getenv("SHELL");
|
||||
if (!shell)
|
||||
- shell = "/bin/sh";
|
||||
+ shell = "@TERMUX_PREFIX@/bin/sh";
|
||||
|
||||
execlp(shell, shell, "-c", restart_argument.c_str(), (const char *) NULL);
|
||||
perror(restart_argument.c_str());
|
12
x11-packages/fluxbox/fluxbox-1.3.7_util_fbrun_FbRun.cc.patch
Normal file
12
x11-packages/fluxbox/fluxbox-1.3.7_util_fbrun_FbRun.cc.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr fluxbox-1.3.7/util/fbrun/FbRun.cc fluxbox-1.3.7.mod/util/fbrun/FbRun.cc
|
||||
--- fluxbox-1.3.7/util/fbrun/FbRun.cc 2015-02-08 12:44:45.377187009 +0200
|
||||
+++ fluxbox-1.3.7.mod/util/fbrun/FbRun.cc 2018-06-19 20:52:20.798391221 +0300
|
||||
@@ -131,7 +131,7 @@
|
||||
|
||||
const char *shell = getenv("SHELL");
|
||||
if (!shell)
|
||||
- shell = "/bin/sh";
|
||||
+ shell = "@TERMUX_PREFIX@/bin/sh";
|
||||
|
||||
setsid();
|
||||
execl(shell, shell, "-c", command.c_str(), static_cast<void*>(NULL));
|
@ -0,0 +1,12 @@
|
||||
diff -uNr fluxbox-1.3.7/util/fluxbox-generate_menu.in fluxbox-1.3.7.mod/util/fluxbox-generate_menu.in
|
||||
--- fluxbox-1.3.7/util/fluxbox-generate_menu.in 2015-02-08 12:44:45.377187009 +0200
|
||||
+++ fluxbox-1.3.7.mod/util/fluxbox-generate_menu.in 2018-06-19 20:52:20.801724555 +0300
|
||||
@@ -1509,7 +1509,7 @@
|
||||
your PATH or specify your favourite terminal-emulator with the -t option
|
||||
|
||||
EOF
|
||||
- DEFAULT_TERM=xterm
|
||||
+ DEFAULT_TERM=aterm
|
||||
fi
|
||||
|
||||
DEFAULT_TERMNAME=`echo $DEFAULT_TERM|awk '{print $1}'`
|
@ -0,0 +1,12 @@
|
||||
diff -uNr fluxbox-1.3.7/util/fluxbox-remote.cc fluxbox-1.3.7.mod/util/fluxbox-remote.cc
|
||||
--- fluxbox-1.3.7/util/fluxbox-remote.cc 2015-02-08 12:44:45.377187009 +0200
|
||||
+++ fluxbox-1.3.7.mod/util/fluxbox-remote.cc 2018-06-19 20:52:20.808391222 +0300
|
||||
@@ -73,7 +73,7 @@
|
||||
if (strcmp(cmd, "result") == 0) {
|
||||
XTextProperty text_prop;
|
||||
if (XGetTextProperty(disp, root, &text_prop, atom_result) != 0
|
||||
- && text_prop.value > 0
|
||||
+ && text_prop.value != NULL
|
||||
&& text_prop.nitems > 0) {
|
||||
|
||||
printf("%s", text_prop.value);
|
@ -0,0 +1,12 @@
|
||||
diff -uNr fluxbox-1.3.7/util/startfluxbox.in fluxbox-1.3.7.mod/util/startfluxbox.in
|
||||
--- fluxbox-1.3.7/util/startfluxbox.in 2015-02-08 12:44:45.381187009 +0200
|
||||
+++ fluxbox-1.3.7.mod/util/startfluxbox.in 2018-06-19 20:53:19.795060924 +0300
|
||||
@@ -33,7 +33,7 @@
|
||||
fi
|
||||
if [ ! -r "$startup" ]; then
|
||||
( cat << EOF
|
||||
-#!/bin/sh
|
||||
+#!@TERMUX_PREFIX@/bin/sh
|
||||
#
|
||||
# fluxbox startup-script:
|
||||
#
|
12
x11-packages/galculator/build.sh
Normal file
12
x11-packages/galculator/build.sh
Normal file
@ -0,0 +1,12 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=http://galculator.sourceforge.net/
|
||||
TERMUX_PKG_DESCRIPTION="GTK+ based scientific calculator"
|
||||
TERMUX_PKG_VERSION=2.1.4
|
||||
TERMUX_PKG_SRCURL=http://galculator.mnim.org/downloads/galculator-${TERMUX_PKG_VERSION}.tar.bz2
|
||||
TERMUX_PKG_SHA256=01cfafe6606e7ec45facb708ef85efd6c1e8bb41001a999d28212a825ef778ae
|
||||
TERMUX_PKG_DEPENDS="libgtk3"
|
||||
|
||||
termux_step_pre_configure() {
|
||||
export LIBS="-landroid-shmem"
|
||||
}
|
16
x11-packages/geany/build.sh
Normal file
16
x11-packages/geany/build.sh
Normal file
@ -0,0 +1,16 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=https://www.geany.org/
|
||||
TERMUX_PKG_DESCRIPTION="Fast and lightweight IDE"
|
||||
TERMUX_PKG_VERSION=1.33.0
|
||||
TERMUX_PKG_REVISION=1
|
||||
TERMUX_PKG_SRCURL=https://download.geany.org/geany-${TERMUX_PKG_VERSION/.0}.tar.bz2
|
||||
TERMUX_PKG_SHA256=66baaff43f12caebcf0efec9a5533044dc52837f799c73a1fd7312caa86099c2
|
||||
TERMUX_PKG_DEPENDS="libandroid-glob, libc++, libgtk3"
|
||||
TERMUX_PKG_RECOMMENDS="clang, make"
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-gtk3"
|
||||
TERMUX_PKG_RM_AFTER_INSTALL="share/icons/hicolor/icon-theme.cache"
|
||||
|
||||
termux_step_pre_configure() {
|
||||
export LIBS="-landroid-glob"
|
||||
}
|
12
x11-packages/geany/geany-1.33_ctags_main_routines.c.patch
Normal file
12
x11-packages/geany/geany-1.33_ctags_main_routines.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr geany-1.33/ctags/main/routines.c geany-1.33.mod/ctags/main/routines.c
|
||||
--- geany-1.33/ctags/main/routines.c 2018-02-25 15:02:21.000000000 +0200
|
||||
+++ geany-1.33.mod/ctags/main/routines.c 2018-06-23 23:56:00.892106491 +0300
|
||||
@@ -79,7 +79,7 @@
|
||||
* MACROS
|
||||
*/
|
||||
#ifndef TMPDIR
|
||||
-# define TMPDIR "/tmp"
|
||||
+# define TMPDIR "@TERMUX_PREFIX@/tmp"
|
||||
#endif
|
||||
|
||||
/* File type tests.
|
30
x11-packages/geany/geany-1.33_src_build.c.patch
Normal file
30
x11-packages/geany/geany-1.33_src_build.c.patch
Normal file
@ -0,0 +1,30 @@
|
||||
diff -uNr geany-1.33/src/build.c geany-1.33.mod/src/build.c
|
||||
--- geany-1.33/src/build.c 2018-02-25 15:02:21.000000000 +0200
|
||||
+++ geany-1.33.mod/src/build.c 2018-06-23 23:56:00.898773158 +0300
|
||||
@@ -725,7 +725,7 @@
|
||||
static void build_spawn_cmd(GeanyDocument *doc, const gchar *cmd, const gchar *dir)
|
||||
{
|
||||
GError *error = NULL;
|
||||
- gchar *argv[] = { "/bin/sh", "-c", NULL, NULL };
|
||||
+ gchar *argv[] = { "@TERMUX_PREFIX@/bin/sh", "-c", NULL, NULL };
|
||||
gchar *working_dir;
|
||||
gchar *utf8_working_dir;
|
||||
gchar *cmd_string;
|
||||
@@ -879,7 +879,7 @@
|
||||
if (vc->skip_run_script)
|
||||
vte_cmd = g_strconcat(run_cmd, "\n", NULL);
|
||||
else
|
||||
- vte_cmd = g_strconcat("\n/bin/sh ", run_cmd, "\n", NULL);
|
||||
+ vte_cmd = g_strconcat("\n@TERMUX_PREFIX@/bin/sh ", run_cmd, "\n", NULL);
|
||||
|
||||
vte_cwd(working_dir, TRUE);
|
||||
if (! vte_send_cmd(vte_cmd))
|
||||
@@ -1107,7 +1107,7 @@
|
||||
|
||||
escaped_dir = g_shell_quote(working_dir);
|
||||
str = g_strdup_printf(
|
||||
- "#!/bin/sh\n\nrm $0\n\ncd %s\n\n%s\n\necho \"\n\n------------------\n(program exited with code: $?)\" \
|
||||
+ "#!@TERMUX_PREFIX@/bin/sh\n\nrm $0\n\ncd %s\n\n%s\n\necho \"\n\n------------------\n(program exited with code: $?)\" \
|
||||
\n\n%s\n", escaped_dir, cmd, (autoclose) ? "" :
|
||||
"\necho \"Press return to continue\"\n#to be more compatible with shells like "
|
||||
"dash\ndummy_var=\"\"\nread dummy_var");
|
30
x11-packages/geany/geany-1.33_src_keyfile.c.patch
Normal file
30
x11-packages/geany/geany-1.33_src_keyfile.c.patch
Normal file
@ -0,0 +1,30 @@
|
||||
diff -uNr geany-1.33/src/keyfile.c geany-1.33.mod/src/keyfile.c
|
||||
--- geany-1.33/src/keyfile.c 2018-02-25 15:02:21.000000000 +0200
|
||||
+++ geany-1.33.mod/src/keyfile.c 2018-06-23 23:56:38.088775072 +0300
|
||||
@@ -79,7 +79,7 @@
|
||||
#elif defined(__APPLE__)
|
||||
#define GEANY_DEFAULT_TOOLS_TERMINAL "open -a terminal %c"
|
||||
#else
|
||||
-#define GEANY_DEFAULT_TOOLS_TERMINAL "xterm -e \"/bin/sh %c\""
|
||||
+#define GEANY_DEFAULT_TOOLS_TERMINAL "aterm -e @TERMUX_PREFIX@/bin/sh %c"
|
||||
#endif
|
||||
#ifdef __APPLE__
|
||||
#define GEANY_DEFAULT_TOOLS_BROWSER "open -a safari"
|
||||
@@ -866,7 +866,7 @@
|
||||
{
|
||||
StashGroup *group;
|
||||
struct passwd *pw = getpwuid(getuid());
|
||||
- const gchar *shell = (pw != NULL) ? pw->pw_shell : "/bin/sh";
|
||||
+ const gchar *shell = (pw != NULL) ? pw->pw_shell : "@TERMUX_PREFIX@/bin/sh";
|
||||
|
||||
#ifdef __APPLE__
|
||||
/* Geany is started using launchd on OS X and we don't get any environment variables
|
||||
@@ -938,7 +938,7 @@
|
||||
else
|
||||
cmd = g_strconcat(cmd, " %c", NULL);
|
||||
#else
|
||||
- cmd = g_strconcat(cmd, " -e \"/bin/sh %c\"", NULL);
|
||||
+ cmd = g_strconcat(cmd, " -e @TERMUX_PREFIX@/bin/sh %c", NULL);
|
||||
#endif
|
||||
g_free(tmp_string);
|
||||
}
|
12
x11-packages/geany/geany-1.33_src_printing.c.patch
Normal file
12
x11-packages/geany/geany-1.33_src_printing.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr geany-1.33/src/printing.c geany-1.33.mod/src/printing.c
|
||||
--- geany-1.33/src/printing.c 2018-02-25 15:02:21.000000000 +0200
|
||||
+++ geany-1.33.mod/src/printing.c 2018-06-23 23:56:00.908773158 +0300
|
||||
@@ -604,7 +604,7 @@
|
||||
/* /bin/sh -c emulates the system() call and makes complex commands possible
|
||||
* but only on non-win32 systems due to the lack of win32's shell capabilities */
|
||||
#ifdef G_OS_UNIX
|
||||
- gchar *argv[] = { "/bin/sh", "-c", cmdline, NULL };
|
||||
+ gchar *argv[] = { "@TERMUX_PREFIX@/bin/sh", "-c", cmdline, NULL };
|
||||
|
||||
if (!spawn_async(NULL, NULL, argv, NULL, NULL, &error))
|
||||
#else
|
36
x11-packages/geoip2-database/build.sh
Normal file
36
x11-packages/geoip2-database/build.sh
Normal file
@ -0,0 +1,36 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=https://dev.maxmind.com/geoip/geoip2/geolite2/
|
||||
TERMUX_PKG_DESCRIPTION="GeoLite2 IP geolocation databases compiled by MaxMind"
|
||||
TERMUX_PKG_PLATFORM_INDEPENDENT=true
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
|
||||
## Version is DB modification date. Use script 'check-last-modified.sh'
|
||||
## to view last modification date.
|
||||
TERMUX_PKG_VERSION=20180906
|
||||
|
||||
_TERMUX_PKG_SRCURL=('https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz'
|
||||
'https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz'
|
||||
'https://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN.tar.gz')
|
||||
|
||||
_TERMUX_PKG_FILE=('GeoLite2-City.tar.gz'
|
||||
'GeoLite2-Country.tar.gz'
|
||||
'GeoLite2-ASN.tar.gz')
|
||||
|
||||
## If these checksums becomes invalid - it's time to update package.
|
||||
_TERMUX_PKG_SHA256=('c68df20de81f738f047d2ff235c51bae09fc0e83e856aa4a4729b482dd420c5c'
|
||||
'e5acb422d3a09c3ccbd55b98a0bf926e402dd9cd086d9b70f5d5f7524a8f3676'
|
||||
'6e6fb278dc0bc04937d45f7730f921828d6d796ed81501955eee9024a6deb3e5')
|
||||
|
||||
termux_step_make_install() {
|
||||
for i in {0..2}; do
|
||||
termux_download "${_TERMUX_PKG_SRCURL[i]}" "${_TERMUX_PKG_FILE[i]}" "${_TERMUX_PKG_SHA256[i]}"
|
||||
done
|
||||
|
||||
for _db in GeoLite2-{City,Country,ASN}; do
|
||||
tar --strip-components=1 -xf $_db.tar.gz --wildcards "*/$_db.mmdb"
|
||||
done
|
||||
|
||||
install -d "${TERMUX_PREFIX}/share/GeoIP"
|
||||
install -m644 -t "${TERMUX_PREFIX}/share/GeoIP" GeoLite2-{City,Country,ASN}.mmdb
|
||||
}
|
25
x11-packages/geoip2-database/check-last-modified.sh
Executable file
25
x11-packages/geoip2-database/check-last-modified.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash -e
|
||||
## This script was obtained from https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/geoip2-database
|
||||
|
||||
# Unicode characters taken from pactree.c
|
||||
UNICODE_IS_FUN="\u2514\u2500"
|
||||
|
||||
verbose=0
|
||||
if [[ $1 == -v ]]; then
|
||||
verbose=1
|
||||
fi
|
||||
|
||||
URLS=(http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz
|
||||
http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz
|
||||
http://geolite.maxmind.com/download/geoip/database/GeoLite2-ASN.tar.gz)
|
||||
|
||||
for url in ${URLS[@]}; do
|
||||
last_mod=$(curl -sI $url | grep -i ^Last-Modified: | cut -d' ' -f2- | tr -d '\r')
|
||||
echo "$last_mod (${url##*/})"
|
||||
|
||||
if ((verbose)); then
|
||||
build_id=$(curl -s $url | gzip -cd | grep -aoE '[0-9]{8} Build [0-9]*')
|
||||
echo -e "${UNICODE_IS_FUN}$build_id"
|
||||
fi
|
||||
done
|
||||
|
8
x11-packages/giflib/build.sh
Normal file
8
x11-packages/giflib/build.sh
Normal file
@ -0,0 +1,8 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=http://sourceforge.net/projects/giflib/
|
||||
TERMUX_PKG_DESCRIPTION="A library for reading and writing gif images"
|
||||
TERMUX_PKG_VERSION=5.1.4
|
||||
TERMUX_PKG_REVISION=2
|
||||
TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/sourceforge/giflib/giflib-${TERMUX_PKG_VERSION}.tar.gz
|
||||
TERMUX_PKG_SHA256=34a7377ba834397db019e8eb122e551a49c98f49df75ec3fcc92b9a794a4f6d1
|
17
x11-packages/giflib/egif_lib.c.patch
Normal file
17
x11-packages/giflib/egif_lib.c.patch
Normal file
@ -0,0 +1,17 @@
|
||||
--- src/lib/egif_lib.c.orig 2017-12-09 15:46:41.761228962 +0000
|
||||
+++ src/lib/egif_lib.c 2017-12-09 15:47:16.631668749 +0000
|
||||
@@ -25,6 +25,14 @@
|
||||
#include "gif_lib.h"
|
||||
#include "gif_lib_private.h"
|
||||
|
||||
+#ifndef S_IREAD
|
||||
+#define S_IREAD 00400
|
||||
+#endif
|
||||
+
|
||||
+#ifndef S_IWRITE
|
||||
+#define S_IWRITE 00200
|
||||
+#endif
|
||||
+
|
||||
/* Masks given codes to BitsPerPixel, to make sure all codes are in range: */
|
||||
/*@+charint@*/
|
||||
static const GifPixelType CodeMask[] = {
|
11
x11-packages/hicolor-icon-theme/build.sh
Normal file
11
x11-packages/hicolor-icon-theme/build.sh
Normal file
@ -0,0 +1,11 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=https://www.freedesktop.org/wiki/Software/icon-theme/
|
||||
TERMUX_PKG_DESCRIPTION="Freedesktop.org Hicolor icon theme"
|
||||
TERMUX_PKG_VERSION=0.17
|
||||
TERMUX_PKG_REVISION=5
|
||||
TERMUX_PKG_PLATFORM_INDEPENDENT=true
|
||||
|
||||
termux_step_make_install() {
|
||||
install -Dm644 "${TERMUX_PKG_BUILDER_DIR}/index.theme" "${TERMUX_PREFIX}/share/icons/hicolor/index.theme"
|
||||
}
|
3805
x11-packages/hicolor-icon-theme/index.theme
Normal file
3805
x11-packages/hicolor-icon-theme/index.theme
Normal file
File diff suppressed because one or more lines are too long
18
x11-packages/i3/build.sh
Normal file
18
x11-packages/i3/build.sh
Normal file
@ -0,0 +1,18 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=https://i3wm.org/
|
||||
TERMUX_PKG_DESCRIPTION="An improved dynamic tiling window manager"
|
||||
TERMUX_PKG_VERSION=4.15
|
||||
TERMUX_PKG_REVISION=4
|
||||
TERMUX_PKG_SRCURL=https://i3wm.org/downloads/i3-${TERMUX_PKG_VERSION}.tar.bz2
|
||||
TERMUX_PKG_SHA256=217d524d1fbc85ae346b25f6848d1b7bcd2c23184ec88d29114bf5a621385326
|
||||
TERMUX_PKG_DEPENDS="i3status, libandroid-glob, libcairo-x, libev, libposix-shm, libxkbcommon, pango, pcre, perl, startup-notification, xcb-util-cursor, xcb-util-keysyms, xcb-util-wm, xcb-util-xrm, yajl"
|
||||
|
||||
TERMUX_PKG_CONFFILES="
|
||||
i3/config
|
||||
i3/config.keycodes
|
||||
"
|
||||
|
||||
termux_step_pre_configure() {
|
||||
export LIBS="-lposix-shm -landroid-glob -landroid-shmem"
|
||||
}
|
21
x11-packages/i3/i3-4.15_i3-dmenu-desktop.patch
Normal file
21
x11-packages/i3/i3-4.15_i3-dmenu-desktop.patch
Normal file
@ -0,0 +1,21 @@
|
||||
diff -uNr i3-4.15/i3-dmenu-desktop i3-4.15.mod/i3-dmenu-desktop
|
||||
--- i3-4.15/i3-dmenu-desktop 2018-03-10 19:29:14.000000000 +0200
|
||||
+++ i3-4.15.mod/i3-dmenu-desktop 2018-06-21 19:51:57.966922177 +0300
|
||||
@@ -111,7 +111,7 @@
|
||||
! -d $xdg_data_home;
|
||||
|
||||
my $xdg_data_dirs = $ENV{XDG_DATA_DIRS};
|
||||
-$xdg_data_dirs = '/usr/local/share/:/usr/share/' if
|
||||
+$xdg_data_dirs = '@TERMUX_PREFIX@/local/share/:@TERMUX_PREFIX@/share/' if
|
||||
!defined($xdg_data_dirs) ||
|
||||
$xdg_data_dirs eq '';
|
||||
|
||||
@@ -454,7 +454,7 @@
|
||||
my ($fh, $filename) = tempfile();
|
||||
binmode($fh, ':utf8');
|
||||
say $fh <<EOT;
|
||||
-#!/bin/sh
|
||||
+#!@TERMUX_PREFIX@/bin/sh
|
||||
rm $filename
|
||||
exec $exec
|
||||
EOT
|
12
x11-packages/i3/i3-4.15_i3-dump-log_main.c.patch
Normal file
12
x11-packages/i3/i3-4.15_i3-dump-log_main.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr i3-4.15/i3-dump-log/main.c i3-4.15.mod/i3-dump-log/main.c
|
||||
--- i3-4.15/i3-dump-log/main.c 2018-03-10 19:29:14.000000000 +0200
|
||||
+++ i3-4.15.mod/i3-dump-log/main.c 2018-06-21 19:48:29.556920631 +0300
|
||||
@@ -27,6 +27,8 @@
|
||||
#include <sys/stat.h>
|
||||
#include <signal.h>
|
||||
|
||||
+#include <posix-shm.h>
|
||||
+
|
||||
#include "libi3.h"
|
||||
#include "shmlog.h"
|
||||
#include <i3/ipc.h>
|
23
x11-packages/i3/i3-4.15_i3-nagbar_main.c.patch
Normal file
23
x11-packages/i3/i3-4.15_i3-nagbar_main.c.patch
Normal file
@ -0,0 +1,23 @@
|
||||
diff -uNr i3-4.15/i3-nagbar/main.c i3-4.15.mod/i3-nagbar/main.c
|
||||
--- i3-4.15/i3-nagbar/main.c 2018-03-10 19:29:14.000000000 +0200
|
||||
+++ i3-4.15.mod/i3-nagbar/main.c 2018-06-21 19:48:29.560253964 +0300
|
||||
@@ -172,7 +172,7 @@
|
||||
warn("Could not fdopen() temporary script to store the nagbar command");
|
||||
return;
|
||||
}
|
||||
- fprintf(script, "#!/bin/sh\nrm %s\n%s", script_path, button->action);
|
||||
+ fprintf(script, "#!@TERMUX_PREFIX@/bin/sh\nrm %s\n%s", script_path, button->action);
|
||||
/* Also closes fd */
|
||||
fclose(script);
|
||||
|
||||
@@ -343,8 +343,8 @@
|
||||
unlink(argv[0]);
|
||||
cmd = sstrdup(argv[0]);
|
||||
*(cmd + argv0_len - strlen(".nagbar_cmd")) = '\0';
|
||||
- execl("/bin/sh", "/bin/sh", cmd, NULL);
|
||||
- err(EXIT_FAILURE, "execv(/bin/sh, /bin/sh, %s)", cmd);
|
||||
+ execl("@TERMUX_PREFIX@/bin/sh", "@TERMUX_PREFIX@/bin/sh", cmd, NULL);
|
||||
+ err(EXIT_FAILURE, "execv(@TERMUX_PREFIX@/bin/sh, @TERMUX_PREFIX@/bin/sh, %s)", cmd);
|
||||
}
|
||||
|
||||
argv0 = argv[0];
|
12
x11-packages/i3/i3-4.15_i3bar_src_main.c.patch
Normal file
12
x11-packages/i3/i3-4.15_i3bar_src_main.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr i3-4.15/i3bar/src/main.c i3-4.15.mod/i3bar/src/main.c
|
||||
--- i3-4.15/i3bar/src/main.c 2018-03-10 19:29:14.000000000 +0200
|
||||
+++ i3-4.15.mod/i3bar/src/main.c 2018-06-21 19:48:29.546920631 +0300
|
||||
@@ -96,7 +96,7 @@
|
||||
if (socket_path != NULL) {
|
||||
socket_path = sstrdup(socket_path);
|
||||
}
|
||||
- char *i3_default_sock_path = "/tmp/i3-ipc.sock";
|
||||
+ char *i3_default_sock_path = "@TERMUX_PREFIX@/tmp/i3-ipc.sock";
|
||||
|
||||
/* Initialize the standard config to use 0 as default */
|
||||
memset(&config, '\0', sizeof(config_t));
|
24
x11-packages/i3/i3-4.15_libi3_get_exe_path.c.patch
Normal file
24
x11-packages/i3/i3-4.15_libi3_get_exe_path.c.patch
Normal file
@ -0,0 +1,24 @@
|
||||
diff -uNr i3-4.15/libi3/get_exe_path.c i3-4.15.mod/libi3/get_exe_path.c
|
||||
--- i3-4.15/libi3/get_exe_path.c 2018-03-10 19:29:14.000000000 +0200
|
||||
+++ i3-4.15.mod/libi3/get_exe_path.c 2018-06-21 22:17:26.293653511 +0300
|
||||
@@ -73,12 +73,7 @@
|
||||
/* Fall back to searching $PATH (or _CS_PATH in absence of $PATH). */
|
||||
char *path = getenv("PATH");
|
||||
if (path == NULL) {
|
||||
- /* _CS_PATH is typically something like "/bin:/usr/bin" */
|
||||
- while (confstr(_CS_PATH, tmp, tmp_size) > tmp_size) {
|
||||
- tmp_size = tmp_size * 2;
|
||||
- tmp = srealloc(tmp, tmp_size);
|
||||
- }
|
||||
- sasprintf(&path, ":%s", tmp);
|
||||
+ path = sstrdup("@TERMUX_PREFIX@/bin:@TERMUX_PREFIX@/bin/applets");
|
||||
} else {
|
||||
path = sstrdup(path);
|
||||
}
|
||||
@@ -103,5 +98,5 @@
|
||||
free(tmp);
|
||||
|
||||
/* Last resort: maybe it’s in /usr/bin? */
|
||||
- return sstrdup("/usr/bin/i3-nagbar");
|
||||
+ return sstrdup("@TERMUX_PREFIX@/bin/i3-nagbar");
|
||||
}
|
12
x11-packages/i3/i3-4.15_libi3_get_process_filename.c.patch
Normal file
12
x11-packages/i3/i3-4.15_libi3_get_process_filename.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr i3-4.15/libi3/get_process_filename.c i3-4.15.mod/libi3/get_process_filename.c
|
||||
--- i3-4.15/libi3/get_process_filename.c 2018-03-10 19:29:14.000000000 +0200
|
||||
+++ i3-4.15.mod/libi3/get_process_filename.c 2018-06-21 19:48:29.566920631 +0300
|
||||
@@ -48,7 +48,7 @@
|
||||
* /tmp/i3-<user>.XXXXXX */
|
||||
struct passwd *pw = getpwuid(getuid());
|
||||
const char *username = pw ? pw->pw_name : "unknown";
|
||||
- sasprintf(&dir, "/tmp/i3-%s.XXXXXX", username);
|
||||
+ sasprintf(&dir, "@TERMUX_PREFIX@/tmp/i3-%s.XXXXXX", username);
|
||||
/* mkdtemp modifies dir */
|
||||
if (mkdtemp(dir) == NULL) {
|
||||
perror("mkdtemp()");
|
12
x11-packages/i3/i3-4.15_libi3_ipc_connect.c.patch
Normal file
12
x11-packages/i3/i3-4.15_libi3_ipc_connect.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr i3-4.15/libi3/ipc_connect.c i3-4.15.mod/libi3/ipc_connect.c
|
||||
--- i3-4.15/libi3/ipc_connect.c 2018-03-10 19:29:14.000000000 +0200
|
||||
+++ i3-4.15.mod/libi3/ipc_connect.c 2018-06-21 19:48:29.570253964 +0300
|
||||
@@ -38,7 +38,7 @@
|
||||
}
|
||||
|
||||
if (path == NULL) {
|
||||
- path = sstrdup("/tmp/i3-ipc.sock");
|
||||
+ path = sstrdup("@TERMUX_PREFIX@/tmp/i3-ipc.sock");
|
||||
}
|
||||
|
||||
int sockfd = socket(AF_LOCAL, SOCK_STREAM, 0);
|
12
x11-packages/i3/i3-4.15_src_log.c.patch
Normal file
12
x11-packages/i3/i3-4.15_src_log.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr i3-4.15/src/log.c i3-4.15.mod/src/log.c
|
||||
--- i3-4.15/src/log.c 2018-03-10 19:29:14.000000000 +0200
|
||||
+++ i3-4.15.mod/src/log.c 2018-06-21 19:48:29.573587298 +0300
|
||||
@@ -24,6 +24,8 @@
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
|
||||
+#include <posix-shm.h>
|
||||
+
|
||||
#include "util.h"
|
||||
#include "log.h"
|
||||
#include "i3.h"
|
12
x11-packages/i3/i3-4.15_src_main.c.patch
Normal file
12
x11-packages/i3/i3-4.15_src_main.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr i3-4.15/src/main.c i3-4.15.mod/src/main.c
|
||||
--- i3-4.15/src/main.c 2018-03-10 19:29:14.000000000 +0200
|
||||
+++ i3-4.15.mod/src/main.c 2018-06-21 19:48:29.576920631 +0300
|
||||
@@ -21,6 +21,8 @@
|
||||
#include <libgen.h>
|
||||
#include "shmlog.h"
|
||||
|
||||
+#include <posix-shm.h>
|
||||
+
|
||||
#ifdef I3_ASAN_ENABLED
|
||||
#include <sanitizer/lsan_interface.h>
|
||||
#endif
|
12
x11-packages/i3/i3-4.15_src_sighandler.c.patch
Normal file
12
x11-packages/i3/i3-4.15_src_sighandler.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr i3-4.15/src/sighandler.c i3-4.15.mod/src/sighandler.c
|
||||
--- i3-4.15/src/sighandler.c 2018-03-10 19:29:14.000000000 +0200
|
||||
+++ i3-4.15.mod/src/sighandler.c 2018-06-21 19:48:29.580253965 +0300
|
||||
@@ -56,7 +56,7 @@
|
||||
static int sighandler_backtrace(void) {
|
||||
char *tmpdir = getenv("TMPDIR");
|
||||
if (tmpdir == NULL)
|
||||
- tmpdir = "/tmp";
|
||||
+ tmpdir = "@TERMUX_PREFIX@/tmp";
|
||||
|
||||
pid_t pid_parent = getpid();
|
||||
|
22
x11-packages/i3status/build.sh
Normal file
22
x11-packages/i3status/build.sh
Normal file
@ -0,0 +1,22 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=https://i3wm.org/i3status/
|
||||
TERMUX_PKG_DESCRIPTION="Generates status bar to use with i3bar"
|
||||
TERMUX_PKG_VERSION=2.12
|
||||
TERMUX_PKG_SRCURL=https://i3wm.org/i3status/i3status-${TERMUX_PKG_VERSION}.tar.bz2
|
||||
TERMUX_PKG_SHA256=6fc6881536043391ab4bed369d956f99d1088965d8bcebed18d1932de3ba791a
|
||||
TERMUX_PKG_DEPENDS="libconfuse, libnl, libpulseaudio, yajl"
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
TERMUX_PKG_CONFFILES="etc/i3status.conf"
|
||||
|
||||
termux_step_pre_configure() {
|
||||
## Not working on Android
|
||||
rm -f src/print_battery_info.c
|
||||
|
||||
## No ALSA available in Termux
|
||||
rm -f src/print_volume.c
|
||||
|
||||
## 1. getloadavg() is not available on Android
|
||||
## 2. /proc/loadavg is not accessible on Android 8.0 (Oreo)
|
||||
rm -f src/print_load.c
|
||||
}
|
45
x11-packages/i3status/i3status-2.12_Makefile.patch
Normal file
45
x11-packages/i3status/i3status-2.12_Makefile.patch
Normal file
@ -0,0 +1,45 @@
|
||||
diff -uNr i3status-2.12/Makefile i3status-2.12.mod/Makefile
|
||||
--- i3status-2.12/Makefile 2018-05-11 12:10:46.000000000 +0300
|
||||
+++ i3status-2.12.mod/Makefile 2018-06-21 19:33:34.403580664 +0300
|
||||
@@ -1,21 +1,17 @@
|
||||
TOPDIR=$(shell pwd)
|
||||
|
||||
ifndef PREFIX
|
||||
- PREFIX=/usr
|
||||
+ PREFIX=@TERMUX_PREFIX@
|
||||
endif
|
||||
ifndef MANPREFIX
|
||||
MANPREFIX=$(PREFIX)
|
||||
endif
|
||||
ifndef SYSCONFDIR
|
||||
- ifeq ($(PREFIX),/usr)
|
||||
- SYSCONFDIR=/etc
|
||||
- else
|
||||
- SYSCONFDIR=$(PREFIX)/etc
|
||||
- endif
|
||||
+ SYSCONFDIR=@TERMUX_PREFIX@/etc
|
||||
endif
|
||||
|
||||
PKG_CONFIG ?= pkg-config
|
||||
-CFLAGS+=-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare
|
||||
+CFLAGS+=-Wall -Wshadow -Wpointer-arith -Wcast-qual -Wsign-compare -DLINUX
|
||||
CFLAGS+=-g
|
||||
CFLAGS+=-std=gnu99
|
||||
CFLAGS+=-pedantic
|
||||
@@ -26,7 +22,7 @@
|
||||
LIBS+=-lyajl
|
||||
LIBS+=-lpulse
|
||||
LIBS+=-lm
|
||||
-LIBS+=-lpthread
|
||||
+LIBS+=-landroid-glob
|
||||
|
||||
ifeq ($(wildcard .git),)
|
||||
# not in git repository
|
||||
@@ -43,7 +39,6 @@
|
||||
CPPFLAGS+=-D_GNU_SOURCE
|
||||
CFLAGS += $(shell $(PKG_CONFIG) --cflags libnl-genl-3.0)
|
||||
LIBS += $(shell $(PKG_CONFIG) --libs libnl-genl-3.0)
|
||||
-LIBS+=-lasound
|
||||
endif
|
||||
|
||||
ifeq ($(OS),GNU/kFreeBSD)
|
127
x11-packages/i3status/i3status-2.12_i3status.c.patch
Normal file
127
x11-packages/i3status/i3status-2.12_i3status.c.patch
Normal file
@ -0,0 +1,127 @@
|
||||
diff -uNr i3status-2.12/i3status.c i3status-2.12.mod/i3status.c
|
||||
--- i3status-2.12/i3status.c 2018-05-11 12:10:46.000000000 +0300
|
||||
+++ i3status-2.12.mod/i3status.c 2018-06-21 19:33:34.400247331 +0300
|
||||
@@ -363,26 +363,6 @@
|
||||
CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
|
||||
CFG_END()};
|
||||
|
||||
- cfg_opt_t battery_opts[] = {
|
||||
- CFG_STR("format", "%status %percentage %remaining", CFGF_NONE),
|
||||
- CFG_STR("format_down", "No battery", CFGF_NONE),
|
||||
- CFG_STR("status_chr", "CHR", CFGF_NONE),
|
||||
- CFG_STR("status_bat", "BAT", CFGF_NONE),
|
||||
- CFG_STR("status_unk", "UNK", CFGF_NONE),
|
||||
- CFG_STR("status_full", "FULL", CFGF_NONE),
|
||||
- CFG_STR("path", "/sys/class/power_supply/BAT%d/uevent", CFGF_NONE),
|
||||
- CFG_INT("low_threshold", 30, CFGF_NONE),
|
||||
- CFG_STR("threshold_type", "time", CFGF_NONE),
|
||||
- CFG_BOOL("last_full_capacity", false, CFGF_NONE),
|
||||
- CFG_BOOL("integer_battery_capacity", false, CFGF_NONE),
|
||||
- CFG_BOOL("hide_seconds", false, CFGF_NONE),
|
||||
- CFG_CUSTOM_ALIGN_OPT,
|
||||
- CFG_CUSTOM_COLOR_OPTS,
|
||||
- CFG_CUSTOM_MIN_WIDTH_OPT,
|
||||
- CFG_CUSTOM_SEPARATOR_OPT,
|
||||
- CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
|
||||
- CFG_END()};
|
||||
-
|
||||
cfg_opt_t time_opts[] = {
|
||||
CFG_STR("format", "%Y-%m-%d %H:%M:%S", CFGF_NONE),
|
||||
CFG_CUSTOM_ALIGN_OPT,
|
||||
@@ -410,17 +390,6 @@
|
||||
CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
|
||||
CFG_END()};
|
||||
|
||||
- cfg_opt_t load_opts[] = {
|
||||
- CFG_STR("format", "%1min %5min %15min", CFGF_NONE),
|
||||
- CFG_STR("format_above_threshold", NULL, CFGF_NONE),
|
||||
- CFG_FLOAT("max_threshold", 5, CFGF_NONE),
|
||||
- CFG_CUSTOM_ALIGN_OPT,
|
||||
- CFG_CUSTOM_COLOR_OPTS,
|
||||
- CFG_CUSTOM_MIN_WIDTH_OPT,
|
||||
- CFG_CUSTOM_SEPARATOR_OPT,
|
||||
- CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
|
||||
- CFG_END()};
|
||||
-
|
||||
cfg_opt_t usage_opts[] = {
|
||||
CFG_STR("format", "%usage", CFGF_NONE),
|
||||
CFG_STR("format_above_threshold", NULL, CFGF_NONE),
|
||||
@@ -461,19 +430,6 @@
|
||||
CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
|
||||
CFG_END()};
|
||||
|
||||
- cfg_opt_t volume_opts[] = {
|
||||
- CFG_STR("format", "♪: %volume", CFGF_NONE),
|
||||
- CFG_STR("format_muted", "♪: 0%%", CFGF_NONE),
|
||||
- CFG_STR("device", "default", CFGF_NONE),
|
||||
- CFG_STR("mixer", "Master", CFGF_NONE),
|
||||
- CFG_INT("mixer_idx", 0, CFGF_NONE),
|
||||
- CFG_CUSTOM_ALIGN_OPT,
|
||||
- CFG_CUSTOM_COLOR_OPTS,
|
||||
- CFG_CUSTOM_MIN_WIDTH_OPT,
|
||||
- CFG_CUSTOM_SEPARATOR_OPT,
|
||||
- CFG_CUSTOM_SEP_BLOCK_WIDTH_OPT,
|
||||
- CFG_END()};
|
||||
-
|
||||
cfg_opt_t opts[] = {
|
||||
CFG_STR_LIST("order", "{}", CFGF_NONE),
|
||||
CFG_SEC("general", general_opts, CFGF_NONE),
|
||||
@@ -481,15 +437,12 @@
|
||||
CFG_SEC("path_exists", path_exists_opts, CFGF_TITLE | CFGF_MULTI),
|
||||
CFG_SEC("wireless", wireless_opts, CFGF_TITLE | CFGF_MULTI),
|
||||
CFG_SEC("ethernet", ethernet_opts, CFGF_TITLE | CFGF_MULTI),
|
||||
- CFG_SEC("battery", battery_opts, CFGF_TITLE | CFGF_MULTI),
|
||||
CFG_SEC("cpu_temperature", temp_opts, CFGF_TITLE | CFGF_MULTI),
|
||||
CFG_SEC("disk", disk_opts, CFGF_TITLE | CFGF_MULTI),
|
||||
- CFG_SEC("volume", volume_opts, CFGF_TITLE | CFGF_MULTI),
|
||||
CFG_SEC("ipv6", ipv6_opts, CFGF_NONE),
|
||||
CFG_SEC("time", time_opts, CFGF_NONE),
|
||||
CFG_SEC("tztime", tztime_opts, CFGF_TITLE | CFGF_MULTI),
|
||||
CFG_SEC("ddate", ddate_opts, CFGF_NONE),
|
||||
- CFG_SEC("load", load_opts, CFGF_NONE),
|
||||
CFG_SEC("cpu_usage", usage_opts, CFGF_NONE),
|
||||
CFG_END()};
|
||||
|
||||
@@ -694,12 +647,6 @@
|
||||
SEC_CLOSE_MAP;
|
||||
}
|
||||
|
||||
- CASE_SEC_TITLE("battery") {
|
||||
- SEC_OPEN_MAP("battery");
|
||||
- print_battery_info(json_gen, buffer, (strcasecmp(title, "all") == 0 ? -1 : atoi(title)), cfg_getstr(sec, "path"), cfg_getstr(sec, "format"), cfg_getstr(sec, "format_down"), cfg_getstr(sec, "status_chr"), cfg_getstr(sec, "status_bat"), cfg_getstr(sec, "status_unk"), cfg_getstr(sec, "status_full"), cfg_getint(sec, "low_threshold"), cfg_getstr(sec, "threshold_type"), cfg_getbool(sec, "last_full_capacity"), cfg_getbool(sec, "integer_battery_capacity"), cfg_getbool(sec, "hide_seconds"));
|
||||
- SEC_CLOSE_MAP;
|
||||
- }
|
||||
-
|
||||
CASE_SEC_TITLE("run_watch") {
|
||||
SEC_OPEN_MAP("run_watch");
|
||||
print_run_watch(json_gen, buffer, title, cfg_getstr(sec, "pidfile"), cfg_getstr(sec, "format"), cfg_getstr(sec, "format_down"));
|
||||
@@ -718,12 +665,6 @@
|
||||
SEC_CLOSE_MAP;
|
||||
}
|
||||
|
||||
- CASE_SEC("load") {
|
||||
- SEC_OPEN_MAP("load");
|
||||
- print_load(json_gen, buffer, cfg_getstr(sec, "format"), cfg_getstr(sec, "format_above_threshold"), cfg_getfloat(sec, "max_threshold"));
|
||||
- SEC_CLOSE_MAP;
|
||||
- }
|
||||
-
|
||||
CASE_SEC("time") {
|
||||
SEC_OPEN_MAP("time");
|
||||
print_time(json_gen, buffer, NULL, cfg_getstr(sec, "format"), NULL, NULL, NULL, tv.tv_sec);
|
||||
@@ -742,16 +683,6 @@
|
||||
SEC_CLOSE_MAP;
|
||||
}
|
||||
|
||||
- CASE_SEC_TITLE("volume") {
|
||||
- SEC_OPEN_MAP("volume");
|
||||
- print_volume(json_gen, buffer, cfg_getstr(sec, "format"),
|
||||
- cfg_getstr(sec, "format_muted"),
|
||||
- cfg_getstr(sec, "device"),
|
||||
- cfg_getstr(sec, "mixer"),
|
||||
- cfg_getint(sec, "mixer_idx"));
|
||||
- SEC_CLOSE_MAP;
|
||||
- }
|
||||
-
|
||||
CASE_SEC_TITLE("cpu_temperature") {
|
||||
SEC_OPEN_MAP("cpu_temperature");
|
||||
print_cpu_temperature_info(json_gen, buffer, atoi(title), cfg_getstr(sec, "path"), cfg_getstr(sec, "format"), cfg_getstr(sec, "format_above_threshold"), cfg_getint(sec, "max_threshold"));
|
51
x11-packages/i3status/i3status-2.12_i3status.conf.patch
Normal file
51
x11-packages/i3status/i3status-2.12_i3status.conf.patch
Normal file
@ -0,0 +1,51 @@
|
||||
diff -uNr i3status-2.12/i3status.conf i3status-2.12.mod/i3status.conf
|
||||
--- i3status-2.12/i3status.conf 2018-05-11 12:10:46.000000000 +0300
|
||||
+++ i3status-2.12.mod/i3status.conf 2018-06-21 19:34:01.046914197 +0300
|
||||
@@ -7,41 +7,18 @@
|
||||
# If the above line is not correctly displayed, fix your editor first!
|
||||
|
||||
general {
|
||||
- colors = true
|
||||
- interval = 5
|
||||
+ colors = true
|
||||
+ interval = 5
|
||||
}
|
||||
|
||||
-order += "ipv6"
|
||||
-order += "disk /"
|
||||
-order += "wireless _first_"
|
||||
-order += "ethernet _first_"
|
||||
-order += "battery all"
|
||||
-order += "load"
|
||||
+order += "disk /data"
|
||||
order += "tztime local"
|
||||
|
||||
-wireless _first_ {
|
||||
- format_up = "W: (%quality at %essid) %ip"
|
||||
- format_down = "W: down"
|
||||
-}
|
||||
-
|
||||
-ethernet _first_ {
|
||||
- # if you use %speed, i3status requires root privileges
|
||||
- format_up = "E: %ip (%speed)"
|
||||
- format_down = "E: down"
|
||||
-}
|
||||
-
|
||||
-battery all {
|
||||
- format = "%status %percentage %remaining"
|
||||
+disk "/data" {
|
||||
+ format = "/data (%avail avail)"
|
||||
}
|
||||
|
||||
tztime local {
|
||||
- format = "%Y-%m-%d %H:%M:%S"
|
||||
+ format = "%Y-%m-%d %H:%M:%S"
|
||||
}
|
||||
|
||||
-load {
|
||||
- format = "%1min"
|
||||
-}
|
||||
-
|
||||
-disk "/" {
|
||||
- format = "%avail"
|
||||
-}
|
20
x11-packages/i3status/i3status-2.12_include_i3status.h.patch
Normal file
20
x11-packages/i3status/i3status-2.12_include_i3status.h.patch
Normal file
@ -0,0 +1,20 @@
|
||||
diff -uNr i3status-2.12/include/i3status.h i3status-2.12.mod/include/i3status.h
|
||||
--- i3status-2.12/include/i3status.h 2018-05-11 12:10:46.000000000 +0300
|
||||
+++ i3status-2.12.mod/include/i3status.h 2018-06-21 19:33:34.403580664 +0300
|
||||
@@ -212,7 +212,6 @@
|
||||
|
||||
void print_ipv6_info(yajl_gen json_gen, char *buffer, const char *format_up, const char *format_down);
|
||||
void print_disk_info(yajl_gen json_gen, char *buffer, const char *path, const char *format, const char *format_below_threshold, const char *format_not_mounted, const char *prefix_type, const char *threshold_type, const double low_threshold);
|
||||
-void print_battery_info(yajl_gen json_gen, char *buffer, int number, const char *path, const char *format, const char *format_down, const char *status_chr, const char *status_bat, const char *status_unk, const char *status_full, int low_threshold, char *threshold_type, bool last_full_capacity, bool integer_battery_capacity, bool hide_seconds);
|
||||
void print_time(yajl_gen json_gen, char *buffer, const char *title, const char *format, const char *tz, const char *locale, const char *format_time, time_t t);
|
||||
void print_ddate(yajl_gen json_gen, char *buffer, const char *format, time_t t);
|
||||
const char *get_ip_addr(const char *interface, int family);
|
||||
@@ -222,8 +221,6 @@
|
||||
void print_cpu_temperature_info(yajl_gen json_gen, char *buffer, int zone, const char *path, const char *format, const char *format_above_threshold, int);
|
||||
void print_cpu_usage(yajl_gen json_gen, char *buffer, const char *format, const char *format_above_threshold, const char *format_above_degraded_threshold, const char *path, const float max_threshold, const float degraded_threshold);
|
||||
void print_eth_info(yajl_gen json_gen, char *buffer, const char *interface, const char *format_up, const char *format_down);
|
||||
-void print_load(yajl_gen json_gen, char *buffer, const char *format, const char *format_above_threshold, const float max_threshold);
|
||||
-void print_volume(yajl_gen json_gen, char *buffer, const char *fmt, const char *fmt_muted, const char *device, const char *mixer, int mixer_idx);
|
||||
bool process_runs(const char *path);
|
||||
int volume_pulseaudio(uint32_t sink_idx, const char *sink_name);
|
||||
bool pulse_initialize(void);
|
@ -0,0 +1,12 @@
|
||||
diff -uNr i3status-2.12/src/print_disk_info.c i3status-2.12.mod/src/print_disk_info.c
|
||||
--- i3status-2.12/src/print_disk_info.c 2018-05-11 12:10:46.000000000 +0300
|
||||
+++ i3status-2.12.mod/src/print_disk_info.c 2018-06-21 19:33:34.403580664 +0300
|
||||
@@ -144,7 +144,7 @@
|
||||
char *sanitized = sstrdup(path);
|
||||
if (strlen(sanitized) > 1 && sanitized[strlen(sanitized) - 1] == '/')
|
||||
sanitized[strlen(sanitized) - 1] = '\0';
|
||||
- FILE *mntentfile = setmntent("/etc/mtab", "r");
|
||||
+ FILE *mntentfile = setmntent("/proc/self/mounts", "r");
|
||||
struct mntent *m;
|
||||
|
||||
while ((m = getmntent(mntentfile)) != NULL) {
|
10
x11-packages/imlib2/build.sh
Normal file
10
x11-packages/imlib2/build.sh
Normal file
@ -0,0 +1,10 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=http://sourceforge.net/projects/enlightenment/
|
||||
TERMUX_PKG_DESCRIPTION="Library that does image file loading and saving as well as rendering, manipulation, arbitrary polygon support"
|
||||
TERMUX_PKG_VERSION=1.4.10
|
||||
TERMUX_PKG_REVISION=2
|
||||
TERMUX_PKG_SRCURL=http://downloads.sourceforge.net/enlightenment/imlib2-${TERMUX_PKG_VERSION}.tar.gz
|
||||
TERMUX_PKG_SHA256=39907c9a62814e8bff05bafe3760db6b7993bb3803832bcaad54e79b75423e5e
|
||||
TERMUX_PKG_DEPENDS="freetype, giflib, libandroid-shmem, libbz2, libid3tag, libjpeg-turbo, libpng, libtiff, libxext"
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="LIBS=-landroid-shmem"
|
@ -0,0 +1,12 @@
|
||||
diff -uNr imlib2-1.4.10/src/modules/loaders/loader_bz2.c imlib2-1.4.10.mod/src/modules/loaders/loader_bz2.c
|
||||
--- imlib2-1.4.10/src/modules/loaders/loader_bz2.c 2016-02-09 18:53:49.000000000 +0200
|
||||
+++ imlib2-1.4.10.mod/src/modules/loaders/loader_bz2.c 2017-11-27 14:13:24.631355071 +0200
|
||||
@@ -52,7 +52,7 @@
|
||||
ImlibLoader *loader;
|
||||
FILE *fp;
|
||||
int dest, res;
|
||||
- char *file, *p, *q, tmp[] = "/tmp/imlib2_loader_bz2-XXXXXX";
|
||||
+ char *file, *p, *q, tmp[] = "/data/data/com.termux/files/usr/tmp/imlib2_loader_bz2-XXXXXX";
|
||||
char *real_ext;
|
||||
|
||||
assert(im);
|
@ -0,0 +1,12 @@
|
||||
diff -uNr imlib2-1.4.10/src/modules/loaders/loader_id3.c imlib2-1.4.10.mod/src/modules/loaders/loader_id3.c
|
||||
--- imlib2-1.4.10/src/modules/loaders/loader_id3.c 2017-03-25 08:48:49.000000000 +0200
|
||||
+++ imlib2-1.4.10.mod/src/modules/loaders/loader_id3.c 2017-11-27 14:13:30.241355067 +0200
|
||||
@@ -507,7 +507,7 @@
|
||||
|
||||
if (loader)
|
||||
{
|
||||
- char *ofile, tmp[] = "/tmp/imlib2_loader_id3-XXXXXX";
|
||||
+ char *ofile, tmp[] = "/data/data/com.termux/files/usr/tmp/imlib2_loader_id3-XXXXXX";
|
||||
int dest;
|
||||
|
||||
if ((dest = mkstemp(tmp)) < 0)
|
@ -0,0 +1,18 @@
|
||||
diff -uNr imlib2-1.4.10/src/modules/loaders/loader_xpm.c imlib2-1.4.10.mod/src/modules/loaders/loader_xpm.c
|
||||
--- imlib2-1.4.10/src/modules/loaders/loader_xpm.c 2017-03-25 08:48:49.000000000 +0200
|
||||
+++ imlib2-1.4.10.mod/src/modules/loaders/loader_xpm.c 2017-11-27 14:14:02.991355044 +0200
|
||||
@@ -51,11 +51,11 @@
|
||||
}
|
||||
/* look in rgb txt database */
|
||||
if (!rgb_txt)
|
||||
- rgb_txt = fopen("/usr/share/X11/rgb.txt", "r");
|
||||
+ rgb_txt = fopen("/data/data/com.termux/files/usr/share/X11/rgb.txt", "r");
|
||||
if (!rgb_txt)
|
||||
- rgb_txt = fopen("/usr/X11R6/lib/X11/rgb.txt", "r");
|
||||
+ rgb_txt = fopen("/data/data/com.termux/files/usr/X11R6/lib/X11/rgb.txt", "r");
|
||||
if (!rgb_txt)
|
||||
- rgb_txt = fopen("/usr/openwin/lib/X11/rgb.txt", "r");
|
||||
+ rgb_txt = fopen("/data/data/com.termux/files/usr/openwin/lib/X11/rgb.txt", "r");
|
||||
if (!rgb_txt)
|
||||
return;
|
||||
fseek(rgb_txt, 0, SEEK_SET);
|
@ -0,0 +1,12 @@
|
||||
diff -uNr imlib2-1.4.10/src/modules/loaders/loader_zlib.c imlib2-1.4.10.mod/src/modules/loaders/loader_zlib.c
|
||||
--- imlib2-1.4.10/src/modules/loaders/loader_zlib.c 2016-02-09 18:52:49.000000000 +0200
|
||||
+++ imlib2-1.4.10.mod/src/modules/loaders/loader_zlib.c 2017-11-27 14:13:27.571355069 +0200
|
||||
@@ -44,7 +44,7 @@
|
||||
{
|
||||
ImlibLoader *loader;
|
||||
int src, dest, res;
|
||||
- char *file, *p, *q, tmp[] = "/tmp/imlib2_loader_zlib-XXXXXX";
|
||||
+ char *file, *p, *q, tmp[] = "/data/data/com.termux/files/usr/tmp/imlib2_loader_zlib-XXXXXX";
|
||||
char *real_ext;
|
||||
struct stat st;
|
||||
|
10
x11-packages/libatk/build.sh
Normal file
10
x11-packages/libatk/build.sh
Normal file
@ -0,0 +1,10 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=https://www.gtk.org
|
||||
TERMUX_PKG_DESCRIPTION="The interface definitions of accessibility infrastructure"
|
||||
_major=2.28
|
||||
_minor=1
|
||||
TERMUX_PKG_VERSION=${_major}.${_minor}
|
||||
TERMUX_PKG_SRCURL=http://ftp.gnome.org/pub/gnome/sources/atk/${_major}/atk-${TERMUX_PKG_VERSION}.tar.xz
|
||||
TERMUX_PKG_SHA256=cd3a1ea6ecc268a2497f0cd018e970860de24a6d42086919d6bf6c8e8d53f4fc
|
||||
TERMUX_PKG_DEPENDS="glib, libandroid-support"
|
25
x11-packages/libcairo-x/build.sh
Normal file
25
x11-packages/libcairo-x/build.sh
Normal file
@ -0,0 +1,25 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=https://cairographics.org
|
||||
TERMUX_PKG_DESCRIPTION="Cairo 2D vector graphics library (with X)"
|
||||
TERMUX_PKG_VERSION=1.14.12
|
||||
TERMUX_PKG_REVISION=3
|
||||
TERMUX_PKG_SHA256=8c90f00c500b2299c0a323dd9beead2a00353752b2092ead558139bd67f7bf16
|
||||
TERMUX_PKG_SRCURL=https://cairographics.org/releases/cairo-${TERMUX_PKG_VERSION}.tar.xz
|
||||
|
||||
TERMUX_PKG_DEPENDS="fontconfig, freetype, glib, libandroid-shmem, libandroid-support, liblzo, libpixman, libpng, librsvg, libx11, libxcb, libxext, libxrender, poppler"
|
||||
TERMUX_PKG_PROVIDES="libcairo, libcairo-gobject"
|
||||
TERMUX_PKG_REPLACES="${TERMUX_PKG_PROVIDES}"
|
||||
TERMUX_PKG_CONFLICTS="${TERMUX_PKG_PROVIDES}, libcairo-dev"
|
||||
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
|
||||
--disable-gtk-doc-html
|
||||
--disable-gl
|
||||
--enable-gobject
|
||||
--enable-pdf
|
||||
--enable-svg
|
||||
--enable-ps
|
||||
LIBS=-landroid-shmem
|
||||
"
|
||||
|
||||
TERMUX_PKG_RM_AFTER_INSTALL="share/gtk-doc/html"
|
12
x11-packages/libcairo-x/cairo-script-operators.c.patch
Normal file
12
x11-packages/libcairo-x/cairo-script-operators.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr cairo-1.14.12/util/cairo-script/cairo-script-operators.c cairo-1.14.12.mod/util/cairo-script/cairo-script-operators.c
|
||||
--- cairo-1.14.12/util/cairo-script/cairo-script-operators.c 2017-12-05 00:26:25.000000000 +0200
|
||||
+++ cairo-1.14.12.mod/util/cairo-script/cairo-script-operators.c 2017-12-17 13:41:14.964072343 +0200
|
||||
@@ -1719,7 +1719,7 @@
|
||||
static void *
|
||||
_mmap_bytes (const struct mmap_vec *vec, int count)
|
||||
{
|
||||
- char template[] = "/tmp/csi-font.XXXXXX";
|
||||
+ char template[] = "/data/data/com.termux/files/usr/tmp/csi-font.XXXXXX";
|
||||
void *ptr;
|
||||
int fd;
|
||||
int num_bytes;
|
12
x11-packages/libcairo-x/fdr.c.patch
Normal file
12
x11-packages/libcairo-x/fdr.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr cairo-1.14.12/util/cairo-fdr/fdr.c cairo-1.14.12.mod/util/cairo-fdr/fdr.c
|
||||
--- cairo-1.14.12/util/cairo-fdr/fdr.c 2017-12-05 00:24:46.000000000 +0200
|
||||
+++ cairo-1.14.12.mod/util/cairo-fdr/fdr.c 2017-12-17 13:40:14.062948088 +0200
|
||||
@@ -67,7 +67,7 @@
|
||||
cairo_device_t *ctx;
|
||||
int n;
|
||||
|
||||
- ctx = DLCALL (cairo_script_create, "/tmp/fdr.trace");
|
||||
+ ctx = DLCALL (cairo_script_create, "/data/data/com.termux/files/usr/tmp/fdr.trace");
|
||||
|
||||
for (n = fdr_position; n < RINGBUFFER_SIZE; n++)
|
||||
fdr_replay_to_script (fdr_ringbuffer[n], ctx);
|
19
x11-packages/libdrm/build.sh
Normal file
19
x11-packages/libdrm/build.sh
Normal file
@ -0,0 +1,19 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=http://dri.freedesktop.org
|
||||
TERMUX_PKG_DESCRIPTION="Userspace interface to kernel DRM services"
|
||||
TERMUX_PKG_VERSION=2.4.92
|
||||
TERMUX_PKG_SRCURL=https://dri.freedesktop.org/libdrm/libdrm-${TERMUX_PKG_VERSION}.tar.bz2
|
||||
TERMUX_PKG_SHA256=e9e48fdb4de139dc4d9880aa1473158a16ff6aff63d14341367bd30a51ff39fa
|
||||
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
|
||||
--disable-intel
|
||||
--disable-radeon
|
||||
--disable-amdgpu
|
||||
--disable-nouveau
|
||||
--disable-vmwgfx
|
||||
"
|
||||
|
||||
termux_step_pre_configure () {
|
||||
CFLAGS="${CFLAGS} -DANDROID"
|
||||
}
|
14
x11-packages/libepoxy/build.sh
Normal file
14
x11-packages/libepoxy/build.sh
Normal file
@ -0,0 +1,14 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=https://github.com/anholt/libepoxy
|
||||
TERMUX_PKG_DESCRIPTION="Library handling OpenGL function pointer management"
|
||||
TERMUX_PKG_VERSION=1.5.2
|
||||
TERMUX_PKG_REVISION=1
|
||||
TERMUX_PKG_SRCURL=https://github.com/anholt/libepoxy/releases/download/${TERMUX_PKG_VERSION}/libepoxy-${TERMUX_PKG_VERSION}.tar.xz
|
||||
TERMUX_PKG_SHA256=a9562386519eb3fd7f03209f279f697a8cba520d3c155d6e253c3e138beca7d8
|
||||
TERMUX_PKG_DEPENDS="libmesa"
|
||||
|
||||
termux_step_pre_configure () {
|
||||
export EGL_CFLAGS=${CFLAGS}
|
||||
export EGL_LIBS="-L${TERMUX_STANDALONE_TOOLCHAIN}/sysroot/lib -lEGL"
|
||||
}
|
9
x11-packages/libepoxy/libepoxy-1.5.2_epoxy.pc.in.patch
Normal file
9
x11-packages/libepoxy/libepoxy-1.5.2_epoxy.pc.in.patch
Normal file
@ -0,0 +1,9 @@
|
||||
diff -uNr libepoxy-1.5.2/epoxy.pc.in libepoxy-1.5.2.mod/epoxy.pc.in
|
||||
--- libepoxy-1.5.2/epoxy.pc.in 2018-02-23 18:05:50.000000000 +0200
|
||||
+++ libepoxy-1.5.2.mod/epoxy.pc.in 2018-06-22 19:48:58.384419880 +0300
|
||||
@@ -13,4 +13,4 @@
|
||||
Cflags: -I${includedir}
|
||||
Libs: -L${libdir} -lepoxy
|
||||
Libs.private: @DLOPEN_LIBS@
|
||||
-Requires.private: @GL_REQS@
|
||||
+Requires.private: gl
|
@ -0,0 +1,12 @@
|
||||
diff -uNr libepoxy-1.5.2/src/dispatch_common.c libepoxy-1.5.2.mod/src/dispatch_common.c
|
||||
--- libepoxy-1.5.2/src/dispatch_common.c 2018-05-14 14:49:17.000000000 +0300
|
||||
+++ libepoxy-1.5.2.mod/src/dispatch_common.c 2018-06-22 19:50:14.587757143 +0300
|
||||
@@ -177,7 +177,7 @@
|
||||
#define GLX_LIB "/opt/X11/lib/libGL.1.dylib"
|
||||
#define OPENGL_LIB "/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL"
|
||||
#elif defined(__ANDROID__)
|
||||
-#define GLX_LIB "libGLESv2.so"
|
||||
+#define GLX_LIB "libGL.so"
|
||||
#else
|
||||
#define GLVND_GLX_LIB "libGLX.so.1"
|
||||
#define GLX_LIB "libGL.so.1"
|
10
x11-packages/libfontenc/build.sh
Normal file
10
x11-packages/libfontenc/build.sh
Normal file
@ -0,0 +1,10 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=https://xorg.freedesktop.org/
|
||||
TERMUX_PKG_DESCRIPTION="X11 font encoding library"
|
||||
TERMUX_PKG_VERSION=1.1.3
|
||||
TERMUX_PKG_REVISION=2
|
||||
TERMUX_PKG_SRCURL=https://xorg.freedesktop.org/releases/individual/lib/libfontenc-${TERMUX_PKG_VERSION}.tar.bz2
|
||||
TERMUX_PKG_SHA256=70588930e6fc9542ff38e0884778fbc6e6febf21adbab92fd8f524fe60aefd21
|
||||
TERMUX_PKG_BUILD_DEPENDS="xorgproto"
|
||||
TERMUX_PKG_DEVPACKAGE_DEPENDS="xorgproto"
|
36
x11-packages/libgtk2/build.sh
Normal file
36
x11-packages/libgtk2/build.sh
Normal file
@ -0,0 +1,36 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=http://www.gtk.org/
|
||||
TERMUX_PKG_DESCRIPTION="GObject-based multi-platform GUI toolkit (legacy)"
|
||||
TERMUX_PKG_VERSION=2.24.32
|
||||
TERMUX_PKG_REVISION=2
|
||||
TERMUX_PKG_SRCURL=https://github.com/GNOME/gtk/archive/${TERMUX_PKG_VERSION}.tar.gz
|
||||
TERMUX_PKG_SHA256=961678c64ad986029befd7bdd8ed3e3849e2c5e54d24affbc7d49758245c87fa
|
||||
TERMUX_PKG_DEPENDS="adwaita-icon-theme, coreutils, desktop-file-utils, glib-bin, gtk-update-icon-cache, libatk, libcairo-x, librsvg, libxcomposite, libxcursor, libxdamage, libxi, libxinerama, libxrandr, pango-x, shared-mime-info"
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
|
||||
--enable-shm
|
||||
--enable-xkb
|
||||
--enable-xinerama
|
||||
--disable-glibtest
|
||||
--disable-cups
|
||||
--disable-papi
|
||||
--enable-introspection=no
|
||||
"
|
||||
|
||||
## provided by libgtk3's sub package
|
||||
TERMUX_PKG_RM_AFTER_INSTALL="bin/gtk-update-icon-cache"
|
||||
|
||||
termux_step_pre_configure() {
|
||||
NOCONFIGURE=1 ./autogen.sh
|
||||
export LIBS="-landroid-shmem"
|
||||
export LDFLAGS="${LDFLAGS} -landroid-shmem"
|
||||
}
|
||||
|
||||
termux_step_create_debscripts()
|
||||
{
|
||||
cp "${TERMUX_PKG_BUILDER_DIR}/postinst" ./
|
||||
cp "${TERMUX_PKG_BUILDER_DIR}/postrm" ./
|
||||
cp "${TERMUX_PKG_BUILDER_DIR}/triggers" ./
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
diff -uNr gtk-2.24.32/demos/testpixbuf-color.c gtk-2.24.32.mod/demos/testpixbuf-color.c
|
||||
--- gtk-2.24.32/demos/testpixbuf-color.c 2018-01-08 23:35:39.000000000 +0200
|
||||
+++ gtk-2.24.32.mod/demos/testpixbuf-color.c 2018-06-23 17:45:29.427628521 +0300
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
-#define ICC_PROFILE "/usr/share/color/icc/bluish.icc"
|
||||
+#define ICC_PROFILE "@TERMUX_PREFIX@/share/color/icc/bluish.icc"
|
||||
#define ICC_PROFILE_SIZE 3966
|
||||
|
||||
static gboolean
|
12
x11-packages/libgtk2/gtk-2.24.32_docs_tools_widgets.c.patch
Normal file
12
x11-packages/libgtk2/gtk-2.24.32_docs_tools_widgets.c.patch
Normal file
@ -0,0 +1,12 @@
|
||||
diff -uNr gtk-2.24.32/docs/tools/widgets.c gtk-2.24.32.mod/docs/tools/widgets.c
|
||||
--- gtk-2.24.32/docs/tools/widgets.c 2018-01-08 23:35:39.000000000 +0200
|
||||
+++ gtk-2.24.32.mod/docs/tools/widgets.c 2018-06-23 17:46:59.147633140 +0300
|
||||
@@ -492,7 +492,7 @@
|
||||
picker = gtk_file_chooser_button_new ("File Chooser Button",
|
||||
GTK_FILE_CHOOSER_ACTION_OPEN);
|
||||
gtk_widget_set_size_request (picker, 150, -1);
|
||||
- gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (picker), "/etc/yum.conf");
|
||||
+ gtk_file_chooser_set_filename (GTK_FILE_CHOOSER (picker), "@TERMUX_PREFIX@/etc/yum.conf");
|
||||
gtk_container_add (GTK_CONTAINER (align), picker);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2), align, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (vbox2),
|
14
x11-packages/libgtk2/gtk-2.24.32_gtk_gtkfilesel.c.patch
Normal file
14
x11-packages/libgtk2/gtk-2.24.32_gtk_gtkfilesel.c.patch
Normal file
@ -0,0 +1,14 @@
|
||||
diff -uNr gtk-2.24.32/gtk/gtkfilesel.c gtk-2.24.32.mod/gtk/gtkfilesel.c
|
||||
--- gtk-2.24.32/gtk/gtkfilesel.c 2018-01-08 23:35:39.000000000 +0200
|
||||
+++ gtk-2.24.32.mod/gtk/gtkfilesel.c 2018-06-23 16:48:53.527453676 +0300
|
||||
@@ -26,6 +26,10 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
+#ifdef HAVE_PWD_H
|
||||
+#undef HAVE_PWD_H
|
||||
+#endif
|
||||
+
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
@ -0,0 +1,35 @@
|
||||
diff -uNr gtk-2.24.32/gtk/tests/filechooser.c gtk-2.24.32.mod/gtk/tests/filechooser.c
|
||||
--- gtk-2.24.32/gtk/tests/filechooser.c 2018-01-08 23:35:39.000000000 +0200
|
||||
+++ gtk-2.24.32.mod/gtk/tests/filechooser.c 2018-06-23 18:07:24.157696216 +0300
|
||||
@@ -258,13 +258,13 @@
|
||||
#if 0
|
||||
#define FILE_NAME "/nonexistent"
|
||||
#define FILE_NAME_2 "/nonexistent2"
|
||||
-#define FOLDER_NAME "/etc"
|
||||
-#define FOLDER_NAME_2 "/usr"
|
||||
+#define FOLDER_NAME "@TERMUX_PREFIX@/etc"
|
||||
+#define FOLDER_NAME_2 "@TERMUX_PREFIX@"
|
||||
#else
|
||||
-#define FILE_NAME "/etc/passwd"
|
||||
-#define FILE_NAME_2 "/etc/group"
|
||||
-#define FOLDER_NAME "/etc"
|
||||
-#define FOLDER_NAME_2 "/usr"
|
||||
+#define FILE_NAME "@TERMUX_PREFIX@/etc/passwd"
|
||||
+#define FILE_NAME_2 "@TERMUX_PREFIX@/etc/group"
|
||||
+#define FOLDER_NAME "@TERMUX_PREFIX@/etc"
|
||||
+#define FOLDER_NAME_2 "@TERMUX_PREFIX@"
|
||||
#endif
|
||||
|
||||
#define CURRENT_NAME "parangaricutirimicuaro.txt"
|
||||
@@ -1859,9 +1859,9 @@
|
||||
gboolean passed = TRUE;
|
||||
|
||||
/* first test for a file we know will always exist */
|
||||
- passed = passed && test_confirm_overwrite_for_path ("/etc/passwd", FALSE);
|
||||
+ passed = passed && test_confirm_overwrite_for_path ("@TERMUX_PREFIX@/etc/passwd", FALSE);
|
||||
g_assert (passed);
|
||||
- passed = passed && test_confirm_overwrite_for_path ("/etc/resolv.conf", TRUE);
|
||||
+ passed = passed && test_confirm_overwrite_for_path ("@TERMUX_PREFIX@/etc/resolv.conf", TRUE);
|
||||
g_assert (passed);
|
||||
}
|
||||
#endif
|
@ -0,0 +1,12 @@
|
||||
diff -uNr gtk-2.24.32/modules/printbackends/cups/gtkprintbackendcups.c gtk-2.24.32.mod/modules/printbackends/cups/gtkprintbackendcups.c
|
||||
--- gtk-2.24.32/modules/printbackends/cups/gtkprintbackendcups.c 2018-01-08 23:35:39.000000000 +0200
|
||||
+++ gtk-2.24.32.mod/modules/printbackends/cups/gtkprintbackendcups.c 2018-06-23 18:15:19.251054007 +0300
|
||||
@@ -3519,7 +3519,7 @@
|
||||
|
||||
/* Ordering matters for default preference */
|
||||
static const char *lpoptions_locations[] = {
|
||||
- "/etc/cups/lpoptions",
|
||||
+ "@TERMUX_PREFIX@/etc/cups/lpoptions",
|
||||
".lpoptions",
|
||||
".cups/lpoptions"
|
||||
};
|
@ -0,0 +1,12 @@
|
||||
diff -uNr gtk-2.24.32/tests/testfilechooser.c gtk-2.24.32.mod/tests/testfilechooser.c
|
||||
--- gtk-2.24.32/tests/testfilechooser.c 2018-01-08 23:35:39.000000000 +0200
|
||||
+++ gtk-2.24.32.mod/tests/testfilechooser.c 2018-06-23 17:45:58.347630010 +0300
|
||||
@@ -632,7 +632,7 @@
|
||||
/* Shortcuts */
|
||||
|
||||
gtk_file_chooser_add_shortcut_folder_uri (GTK_FILE_CHOOSER (dialog),
|
||||
- "file:///usr/share/pixmaps",
|
||||
+ "file://@TERMUX_PREFIX@/share/pixmaps",
|
||||
NULL);
|
||||
|
||||
/* Initial filename or folder */
|
18
x11-packages/libgtk2/postinst
Executable file
18
x11-packages/libgtk2/postinst
Executable file
@ -0,0 +1,18 @@
|
||||
#!/data/data/com.termux/files/usr/bin/sh
|
||||
set -e
|
||||
PREFIX="/data/data/com.termux/files/usr"
|
||||
|
||||
gtk-query-immodules-2.0 --update-cache || true
|
||||
for i in $(find "${PREFIX}/share/icons" -type f -iname index.theme); do
|
||||
gtk-update-icon-cache --force --quiet $(dirname "${i}") || true
|
||||
done
|
||||
unset i
|
||||
|
||||
## Usually, glib and gdk-pixbuf should have own triggers
|
||||
## but in Termux they don't have.
|
||||
glib-compile-schemas "${PREFIX}/share/glib-2.0/schemas" || true
|
||||
gdk-pixbuf-query-loaders --update-cache || true
|
||||
|
||||
if [ "${1}" = "triggered" ]; then
|
||||
exit 0
|
||||
fi
|
8
x11-packages/libgtk2/postrm
Executable file
8
x11-packages/libgtk2/postrm
Executable file
@ -0,0 +1,8 @@
|
||||
#!/data/data/com.termux/files/usr/bin/sh
|
||||
set -e
|
||||
PREFIX="/data/data/com.termux/files/usr"
|
||||
|
||||
if [ -d "${PREFIX}/lib/gtk-2.0/2.10.0" ]; then
|
||||
rm -f "${PREFIX}/lib/gtk-2.0/2.10.0/immodules.cache"
|
||||
rmdir -p --ignore-fail-on-non-empty "${PREFIX}/lib/gtk-2.0/2.10.0"
|
||||
fi
|
3
x11-packages/libgtk2/triggers
Normal file
3
x11-packages/libgtk2/triggers
Normal file
@ -0,0 +1,3 @@
|
||||
interest-noawait /data/data/com.termux/files/usr/lib/gtk-2.0/2.10.0
|
||||
interest-noawait /data/data/com.termux/files/usr/share/glib-2.0/schemas
|
||||
interest-noawait /data/data/com.termux/files/usr/share/icons
|
15
x11-packages/libgtk2/xid-collision-debug.patch
Normal file
15
x11-packages/libgtk2/xid-collision-debug.patch
Normal file
@ -0,0 +1,15 @@
|
||||
--- gtk+-2.18.3/gdk/x11/gdkxid.c 2009-06-19 04:59:18.000000000 +0200
|
||||
+++ gtk+-2.18.3/gdk/x11/gdkxid.c.new 2009-07-22 11:30:12.000000000 +0200
|
||||
@@ -56,10 +56,10 @@
|
||||
if (!display_x11->xid_ht)
|
||||
display_x11->xid_ht = g_hash_table_new ((GHashFunc) gdk_xid_hash,
|
||||
(GEqualFunc) gdk_xid_equal);
|
||||
-
|
||||
+/*
|
||||
if (g_hash_table_lookup (display_x11->xid_ht, xid))
|
||||
g_warning ("XID collision, trouble ahead");
|
||||
-
|
||||
+*/
|
||||
g_hash_table_insert (display_x11->xid_ht, xid, data);
|
||||
}
|
||||
|
27
x11-packages/libgtk3/build.sh
Normal file
27
x11-packages/libgtk3/build.sh
Normal file
@ -0,0 +1,27 @@
|
||||
TERMUX_PKG_MAINTAINER="Leonid Plyushch <leonid.plyushch@gmail.com> @xeffyr"
|
||||
|
||||
TERMUX_PKG_HOMEPAGE=http://www.gtk.org/
|
||||
TERMUX_PKG_DESCRIPTION="GObject-based multi-platform GUI toolkit"
|
||||
TERMUX_PKG_VERSION=3.22.30
|
||||
TERMUX_PKG_REVISION=6
|
||||
TERMUX_PKG_SRCURL=https://github.com/GNOME/gtk/archive/${TERMUX_PKG_VERSION}.tar.gz
|
||||
TERMUX_PKG_SHA256=27bc650dc0ed7adbedc211d86262abfafa43586d3c307c500340a67267699190
|
||||
TERMUX_PKG_DEPENDS="adwaita-icon-theme, coreutils, desktop-file-utils, gdk-pixbuf, glib, glib-bin, gtk-update-icon-cache, libatk, libcairo-x, libepoxy, libxcomposite, libxcursor, libxdamage, libxfixes, libxi, libxinerama, libxrandr, pango-x, shared-mime-info"
|
||||
TERMUX_PKG_BUILD_DEPENDS="xorgproto"
|
||||
TERMUX_PKG_DEVPACKAGE_DEPENDS="xorgproto"
|
||||
TERMUX_PKG_BUILD_IN_SRC=true
|
||||
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-introspection --enable-xinerama --enable-xfixes --enable-xcomposite --enable-xdamage"
|
||||
TERMUX_PKG_RM_AFTER_INSTALL="share/glib-2.0/schemas/gschemas.compiled"
|
||||
|
||||
termux_step_pre_configure()
|
||||
{
|
||||
# prevent permission denied on build scripts
|
||||
find . -type f | xargs chmod u+x
|
||||
}
|
||||
|
||||
termux_step_create_debscripts()
|
||||
{
|
||||
cp "${TERMUX_PKG_BUILDER_DIR}/postinst" ./
|
||||
cp "${TERMUX_PKG_BUILDER_DIR}/postrm" ./
|
||||
cp "${TERMUX_PKG_BUILDER_DIR}/triggers" ./
|
||||
}
|
1383
x11-packages/libgtk3/gtk-3.22.30_ABOUT-NLS.patch
Normal file
1383
x11-packages/libgtk3/gtk-3.22.30_ABOUT-NLS.patch
Normal file
File diff suppressed because it is too large
Load Diff
372
x11-packages/libgtk3/gtk-3.22.30_INSTALL.patch
Normal file
372
x11-packages/libgtk3/gtk-3.22.30_INSTALL.patch
Normal file
@ -0,0 +1,372 @@
|
||||
diff -uNr gtk-3.22.30/INSTALL gtk-3.22.30.mod/INSTALL
|
||||
--- gtk-3.22.30/INSTALL 1970-01-01 03:00:00.000000000 +0300
|
||||
+++ gtk-3.22.30.mod/INSTALL 2018-06-22 20:55:46.571292921 +0300
|
||||
@@ -0,0 +1,368 @@
|
||||
+Installation Instructions
|
||||
+*************************
|
||||
+
|
||||
+ Copyright (C) 1994-1996, 1999-2002, 2004-2016 Free Software
|
||||
+Foundation, Inc.
|
||||
+
|
||||
+ Copying and distribution of this file, with or without modification,
|
||||
+are permitted in any medium without royalty provided the copyright
|
||||
+notice and this notice are preserved. This file is offered as-is,
|
||||
+without warranty of any kind.
|
||||
+
|
||||
+Basic Installation
|
||||
+==================
|
||||
+
|
||||
+ Briefly, the shell command './configure && make && make install'
|
||||
+should configure, build, and install this package. The following
|
||||
+more-detailed instructions are generic; see the 'README' file for
|
||||
+instructions specific to this package. Some packages provide this
|
||||
+'INSTALL' file but do not implement all of the features documented
|
||||
+below. The lack of an optional feature in a given package is not
|
||||
+necessarily a bug. More recommendations for GNU packages can be found
|
||||
+in *note Makefile Conventions: (standards)Makefile Conventions.
|
||||
+
|
||||
+ The 'configure' shell script attempts to guess correct values for
|
||||
+various system-dependent variables used during compilation. It uses
|
||||
+those values to create a 'Makefile' in each directory of the package.
|
||||
+It may also create one or more '.h' files containing system-dependent
|
||||
+definitions. Finally, it creates a shell script 'config.status' that
|
||||
+you can run in the future to recreate the current configuration, and a
|
||||
+file 'config.log' containing compiler output (useful mainly for
|
||||
+debugging 'configure').
|
||||
+
|
||||
+ It can also use an optional file (typically called 'config.cache' and
|
||||
+enabled with '--cache-file=config.cache' or simply '-C') that saves the
|
||||
+results of its tests to speed up reconfiguring. Caching is disabled by
|
||||
+default to prevent problems with accidental use of stale cache files.
|
||||
+
|
||||
+ If you need to do unusual things to compile the package, please try
|
||||
+to figure out how 'configure' could check whether to do them, and mail
|
||||
+diffs or instructions to the address given in the 'README' so they can
|
||||
+be considered for the next release. If you are using the cache, and at
|
||||
+some point 'config.cache' contains results you don't want to keep, you
|
||||
+may remove or edit it.
|
||||
+
|
||||
+ The file 'configure.ac' (or 'configure.in') is used to create
|
||||
+'configure' by a program called 'autoconf'. You need 'configure.ac' if
|
||||
+you want to change it or regenerate 'configure' using a newer version of
|
||||
+'autoconf'.
|
||||
+
|
||||
+ The simplest way to compile this package is:
|
||||
+
|
||||
+ 1. 'cd' to the directory containing the package's source code and type
|
||||
+ './configure' to configure the package for your system.
|
||||
+
|
||||
+ Running 'configure' might take a while. While running, it prints
|
||||
+ some messages telling which features it is checking for.
|
||||
+
|
||||
+ 2. Type 'make' to compile the package.
|
||||
+
|
||||
+ 3. Optionally, type 'make check' to run any self-tests that come with
|
||||
+ the package, generally using the just-built uninstalled binaries.
|
||||
+
|
||||
+ 4. Type 'make install' to install the programs and any data files and
|
||||
+ documentation. When installing into a prefix owned by root, it is
|
||||
+ recommended that the package be configured and built as a regular
|
||||
+ user, and only the 'make install' phase executed with root
|
||||
+ privileges.
|
||||
+
|
||||
+ 5. Optionally, type 'make installcheck' to repeat any self-tests, but
|
||||
+ this time using the binaries in their final installed location.
|
||||
+ This target does not install anything. Running this target as a
|
||||
+ regular user, particularly if the prior 'make install' required
|
||||
+ root privileges, verifies that the installation completed
|
||||
+ correctly.
|
||||
+
|
||||
+ 6. You can remove the program binaries and object files from the
|
||||
+ source code directory by typing 'make clean'. To also remove the
|
||||
+ files that 'configure' created (so you can compile the package for
|
||||
+ a different kind of computer), type 'make distclean'. There is
|
||||
+ also a 'make maintainer-clean' target, but that is intended mainly
|
||||
+ for the package's developers. If you use it, you may have to get
|
||||
+ all sorts of other programs in order to regenerate files that came
|
||||
+ with the distribution.
|
||||
+
|
||||
+ 7. Often, you can also type 'make uninstall' to remove the installed
|
||||
+ files again. In practice, not all packages have tested that
|
||||
+ uninstallation works correctly, even though it is required by the
|
||||
+ GNU Coding Standards.
|
||||
+
|
||||
+ 8. Some packages, particularly those that use Automake, provide 'make
|
||||
+ distcheck', which can by used by developers to test that all other
|
||||
+ targets like 'make install' and 'make uninstall' work correctly.
|
||||
+ This target is generally not run by end users.
|
||||
+
|
||||
+Compilers and Options
|
||||
+=====================
|
||||
+
|
||||
+ Some systems require unusual options for compilation or linking that
|
||||
+the 'configure' script does not know about. Run './configure --help'
|
||||
+for details on some of the pertinent environment variables.
|
||||
+
|
||||
+ You can give 'configure' initial values for configuration parameters
|
||||
+by setting variables in the command line or in the environment. Here is
|
||||
+an example:
|
||||
+
|
||||
+ ./configure CC=c99 CFLAGS=-g LIBS=-lposix
|
||||
+
|
||||
+ *Note Defining Variables::, for more details.
|
||||
+
|
||||
+Compiling For Multiple Architectures
|
||||
+====================================
|
||||
+
|
||||
+ You can compile the package for more than one kind of computer at the
|
||||
+same time, by placing the object files for each architecture in their
|
||||
+own directory. To do this, you can use GNU 'make'. 'cd' to the
|
||||
+directory where you want the object files and executables to go and run
|
||||
+the 'configure' script. 'configure' automatically checks for the source
|
||||
+code in the directory that 'configure' is in and in '..'. This is known
|
||||
+as a "VPATH" build.
|
||||
+
|
||||
+ With a non-GNU 'make', it is safer to compile the package for one
|
||||
+architecture at a time in the source code directory. After you have
|
||||
+installed the package for one architecture, use 'make distclean' before
|
||||
+reconfiguring for another architecture.
|
||||
+
|
||||
+ On MacOS X 10.5 and later systems, you can create libraries and
|
||||
+executables that work on multiple system types--known as "fat" or
|
||||
+"universal" binaries--by specifying multiple '-arch' options to the
|
||||
+compiler but only a single '-arch' option to the preprocessor. Like
|
||||
+this:
|
||||
+
|
||||
+ ./configure CC="gcc -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
+ CXX="g++ -arch i386 -arch x86_64 -arch ppc -arch ppc64" \
|
||||
+ CPP="gcc -E" CXXCPP="g++ -E"
|
||||
+
|
||||
+ This is not guaranteed to produce working output in all cases, you
|
||||
+may have to build one architecture at a time and combine the results
|
||||
+using the 'lipo' tool if you have problems.
|
||||
+
|
||||
+Installation Names
|
||||
+==================
|
||||
+
|
||||
+ By default, 'make install' installs the package's commands under
|
||||
+'/usr/local/bin', include files under '/usr/local/include', etc. You
|
||||
+can specify an installation prefix other than '/usr/local' by giving
|
||||
+'configure' the option '--prefix=PREFIX', where PREFIX must be an
|
||||
+absolute file name.
|
||||
+
|
||||
+ You can specify separate installation prefixes for
|
||||
+architecture-specific files and architecture-independent files. If you
|
||||
+pass the option '--exec-prefix=PREFIX' to 'configure', the package uses
|
||||
+PREFIX as the prefix for installing programs and libraries.
|
||||
+Documentation and other data files still use the regular prefix.
|
||||
+
|
||||
+ In addition, if you use an unusual directory layout you can give
|
||||
+options like '--bindir=DIR' to specify different values for particular
|
||||
+kinds of files. Run 'configure --help' for a list of the directories
|
||||
+you can set and what kinds of files go in them. In general, the default
|
||||
+for these options is expressed in terms of '${prefix}', so that
|
||||
+specifying just '--prefix' will affect all of the other directory
|
||||
+specifications that were not explicitly provided.
|
||||
+
|
||||
+ The most portable way to affect installation locations is to pass the
|
||||
+correct locations to 'configure'; however, many packages provide one or
|
||||
+both of the following shortcuts of passing variable assignments to the
|
||||
+'make install' command line to change installation locations without
|
||||
+having to reconfigure or recompile.
|
||||
+
|
||||
+ The first method involves providing an override variable for each
|
||||
+affected directory. For example, 'make install
|
||||
+prefix=/alternate/directory' will choose an alternate location for all
|
||||
+directory configuration variables that were expressed in terms of
|
||||
+'${prefix}'. Any directories that were specified during 'configure',
|
||||
+but not in terms of '${prefix}', must each be overridden at install time
|
||||
+for the entire installation to be relocated. The approach of makefile
|
||||
+variable overrides for each directory variable is required by the GNU
|
||||
+Coding Standards, and ideally causes no recompilation. However, some
|
||||
+platforms have known limitations with the semantics of shared libraries
|
||||
+that end up requiring recompilation when using this method, particularly
|
||||
+noticeable in packages that use GNU Libtool.
|
||||
+
|
||||
+ The second method involves providing the 'DESTDIR' variable. For
|
||||
+example, 'make install DESTDIR=/alternate/directory' will prepend
|
||||
+'/alternate/directory' before all installation names. The approach of
|
||||
+'DESTDIR' overrides is not required by the GNU Coding Standards, and
|
||||
+does not work on platforms that have drive letters. On the other hand,
|
||||
+it does better at avoiding recompilation issues, and works well even
|
||||
+when some directory options were not specified in terms of '${prefix}'
|
||||
+at 'configure' time.
|
||||
+
|
||||
+Optional Features
|
||||
+=================
|
||||
+
|
||||
+ If the package supports it, you can cause programs to be installed
|
||||
+with an extra prefix or suffix on their names by giving 'configure' the
|
||||
+option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'.
|
||||
+
|
||||
+ Some packages pay attention to '--enable-FEATURE' options to
|
||||
+'configure', where FEATURE indicates an optional part of the package.
|
||||
+They may also pay attention to '--with-PACKAGE' options, where PACKAGE
|
||||
+is something like 'gnu-as' or 'x' (for the X Window System). The
|
||||
+'README' should mention any '--enable-' and '--with-' options that the
|
||||
+package recognizes.
|
||||
+
|
||||
+ For packages that use the X Window System, 'configure' can usually
|
||||
+find the X include and library files automatically, but if it doesn't,
|
||||
+you can use the 'configure' options '--x-includes=DIR' and
|
||||
+'--x-libraries=DIR' to specify their locations.
|
||||
+
|
||||
+ Some packages offer the ability to configure how verbose the
|
||||
+execution of 'make' will be. For these packages, running './configure
|
||||
+--enable-silent-rules' sets the default to minimal output, which can be
|
||||
+overridden with 'make V=1'; while running './configure
|
||||
+--disable-silent-rules' sets the default to verbose, which can be
|
||||
+overridden with 'make V=0'.
|
||||
+
|
||||
+Particular systems
|
||||
+==================
|
||||
+
|
||||
+ On HP-UX, the default C compiler is not ANSI C compatible. If GNU CC
|
||||
+is not installed, it is recommended to use the following options in
|
||||
+order to use an ANSI C compiler:
|
||||
+
|
||||
+ ./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
|
||||
+
|
||||
+and if that doesn't work, install pre-built binaries of GCC for HP-UX.
|
||||
+
|
||||
+ HP-UX 'make' updates targets which have the same time stamps as their
|
||||
+prerequisites, which makes it generally unusable when shipped generated
|
||||
+files such as 'configure' are involved. Use GNU 'make' instead.
|
||||
+
|
||||
+ On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
|
||||
+parse its '<wchar.h>' header file. The option '-nodtk' can be used as a
|
||||
+workaround. If GNU CC is not installed, it is therefore recommended to
|
||||
+try
|
||||
+
|
||||
+ ./configure CC="cc"
|
||||
+
|
||||
+and if that doesn't work, try
|
||||
+
|
||||
+ ./configure CC="cc -nodtk"
|
||||
+
|
||||
+ On Solaris, don't put '/usr/ucb' early in your 'PATH'. This
|
||||
+directory contains several dysfunctional programs; working variants of
|
||||
+these programs are available in '/usr/bin'. So, if you need '/usr/ucb'
|
||||
+in your 'PATH', put it _after_ '/usr/bin'.
|
||||
+
|
||||
+ On Haiku, software installed for all users goes in '/boot/common',
|
||||
+not '/usr/local'. It is recommended to use the following options:
|
||||
+
|
||||
+ ./configure --prefix=/boot/common
|
||||
+
|
||||
+Specifying the System Type
|
||||
+==========================
|
||||
+
|
||||
+ There may be some features 'configure' cannot figure out
|
||||
+automatically, but needs to determine by the type of machine the package
|
||||
+will run on. Usually, assuming the package is built to be run on the
|
||||
+_same_ architectures, 'configure' can figure that out, but if it prints
|
||||
+a message saying it cannot guess the machine type, give it the
|
||||
+'--build=TYPE' option. TYPE can either be a short name for the system
|
||||
+type, such as 'sun4', or a canonical name which has the form:
|
||||
+
|
||||
+ CPU-COMPANY-SYSTEM
|
||||
+
|
||||
+where SYSTEM can have one of these forms:
|
||||
+
|
||||
+ OS
|
||||
+ KERNEL-OS
|
||||
+
|
||||
+ See the file 'config.sub' for the possible values of each field. If
|
||||
+'config.sub' isn't included in this package, then this package doesn't
|
||||
+need to know the machine type.
|
||||
+
|
||||
+ If you are _building_ compiler tools for cross-compiling, you should
|
||||
+use the option '--target=TYPE' to select the type of system they will
|
||||
+produce code for.
|
||||
+
|
||||
+ If you want to _use_ a cross compiler, that generates code for a
|
||||
+platform different from the build platform, you should specify the
|
||||
+"host" platform (i.e., that on which the generated programs will
|
||||
+eventually be run) with '--host=TYPE'.
|
||||
+
|
||||
+Sharing Defaults
|
||||
+================
|
||||
+
|
||||
+ If you want to set default values for 'configure' scripts to share,
|
||||
+you can create a site shell script called 'config.site' that gives
|
||||
+default values for variables like 'CC', 'cache_file', and 'prefix'.
|
||||
+'configure' looks for 'PREFIX/share/config.site' if it exists, then
|
||||
+'PREFIX/etc/config.site' if it exists. Or, you can set the
|
||||
+'CONFIG_SITE' environment variable to the location of the site script.
|
||||
+A warning: not all 'configure' scripts look for a site script.
|
||||
+
|
||||
+Defining Variables
|
||||
+==================
|
||||
+
|
||||
+ Variables not defined in a site shell script can be set in the
|
||||
+environment passed to 'configure'. However, some packages may run
|
||||
+configure again during the build, and the customized values of these
|
||||
+variables may be lost. In order to avoid this problem, you should set
|
||||
+them in the 'configure' command line, using 'VAR=value'. For example:
|
||||
+
|
||||
+ ./configure CC=/usr/local2/bin/gcc
|
||||
+
|
||||
+causes the specified 'gcc' to be used as the C compiler (unless it is
|
||||
+overridden in the site shell script).
|
||||
+
|
||||
+Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an
|
||||
+Autoconf limitation. Until the limitation is lifted, you can use this
|
||||
+workaround:
|
||||
+
|
||||
+ CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash
|
||||
+
|
||||
+'configure' Invocation
|
||||
+======================
|
||||
+
|
||||
+ 'configure' recognizes the following options to control how it
|
||||
+operates.
|
||||
+
|
||||
+'--help'
|
||||
+'-h'
|
||||
+ Print a summary of all of the options to 'configure', and exit.
|
||||
+
|
||||
+'--help=short'
|
||||
+'--help=recursive'
|
||||
+ Print a summary of the options unique to this package's
|
||||
+ 'configure', and exit. The 'short' variant lists options used only
|
||||
+ in the top level, while the 'recursive' variant lists options also
|
||||
+ present in any nested packages.
|
||||
+
|
||||
+'--version'
|
||||
+'-V'
|
||||
+ Print the version of Autoconf used to generate the 'configure'
|
||||
+ script, and exit.
|
||||
+
|
||||
+'--cache-file=FILE'
|
||||
+ Enable the cache: use and save the results of the tests in FILE,
|
||||
+ traditionally 'config.cache'. FILE defaults to '/dev/null' to
|
||||
+ disable caching.
|
||||
+
|
||||
+'--config-cache'
|
||||
+'-C'
|
||||
+ Alias for '--cache-file=config.cache'.
|
||||
+
|
||||
+'--quiet'
|
||||
+'--silent'
|
||||
+'-q'
|
||||
+ Do not print messages saying which checks are being made. To
|
||||
+ suppress all normal output, redirect it to '/dev/null' (any error
|
||||
+ messages will still be shown).
|
||||
+
|
||||
+'--srcdir=DIR'
|
||||
+ Look for the package's source code in directory DIR. Usually
|
||||
+ 'configure' can determine that directory automatically.
|
||||
+
|
||||
+'--prefix=DIR'
|
||||
+ Use DIR as the installation prefix. *note Installation Names:: for
|
||||
+ more details, including other options available for fine-tuning the
|
||||
+ installation locations.
|
||||
+
|
||||
+'--no-create'
|
||||
+'-n'
|
||||
+ Run the configure checks, but stop before creating any output
|
||||
+ files.
|
||||
+
|
||||
+'configure' also accepts some other, not widely useful, options. Run
|
||||
+'configure --help' for more details.
|
1238
x11-packages/libgtk3/gtk-3.22.30_Makefile.in.patch
Normal file
1238
x11-packages/libgtk3/gtk-3.22.30_Makefile.in.patch
Normal file
File diff suppressed because it is too large
Load Diff
1803
x11-packages/libgtk3/gtk-3.22.30_aclocal.m4.patch
Normal file
1803
x11-packages/libgtk3/gtk-3.22.30_aclocal.m4.patch
Normal file
File diff suppressed because it is too large
Load Diff
10657
x11-packages/libgtk3/gtk-3.22.30_autom4te.cache_output.0.patch
Normal file
10657
x11-packages/libgtk3/gtk-3.22.30_autom4te.cache_output.0.patch
Normal file
File diff suppressed because it is too large
Load Diff
32421
x11-packages/libgtk3/gtk-3.22.30_autom4te.cache_output.1.patch
Normal file
32421
x11-packages/libgtk3/gtk-3.22.30_autom4te.cache_output.1.patch
Normal file
File diff suppressed because it is too large
Load Diff
32421
x11-packages/libgtk3/gtk-3.22.30_autom4te.cache_output.2.patch
Normal file
32421
x11-packages/libgtk3/gtk-3.22.30_autom4te.cache_output.2.patch
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user