From 55298ee276e4e40fb6c66fe0ccd1f859d2eeb572 Mon Sep 17 00:00:00 2001 From: Tee KOBAYASHI Date: Thu, 6 Jan 2022 06:45:50 +0900 Subject: [PATCH] new package: gpac --- packages/gpac/build.sh | 19 +++++++++ .../gpac/src-filters-in_dvb4linux.c.patch | 11 ++++++ packages/gpac/src-jsmods-core.c.patch | 11 ++++++ .../gpac/src-utils-os_config_init.c.patch | 39 +++++++++++++++++++ packages/gpac/src-utils-os_divers.c.patch | 11 ++++++ 5 files changed, 91 insertions(+) create mode 100644 packages/gpac/build.sh create mode 100644 packages/gpac/src-filters-in_dvb4linux.c.patch create mode 100644 packages/gpac/src-jsmods-core.c.patch create mode 100644 packages/gpac/src-utils-os_config_init.c.patch create mode 100644 packages/gpac/src-utils-os_divers.c.patch diff --git a/packages/gpac/build.sh b/packages/gpac/build.sh new file mode 100644 index 000000000..68aee8526 --- /dev/null +++ b/packages/gpac/build.sh @@ -0,0 +1,19 @@ +TERMUX_PKG_HOMEPAGE=https://gpac.wp.imt.fr/ +TERMUX_PKG_DESCRIPTION="An open-source multimedia framework focused on modularity and standards compliance" +TERMUX_PKG_LICENSE="LGPL-2.1" +TERMUX_PKG_MAINTAINER="@termux" +TERMUX_PKG_VERSION=1.0.1 +TERMUX_PKG_SRCURL=https://github.com/gpac/gpac/archive/v${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=3b0ffba73c68ea8847027c23f45cd81d705110ec47cf3c36f60e669de867e0af +TERMUX_PKG_DEPENDS="zlib" +TERMUX_PKG_EXTRA_MAKE_ARGS="STRIP=:" + +termux_step_pre_configure() { + CFLAGS+=" -fPIC" + for f in $CFLAGS $CPPFLAGS; do + TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --extra-cflags=$f" + done + for f in $LDFLAGS; do + TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --extra-ldflags=$f" + done +} diff --git a/packages/gpac/src-filters-in_dvb4linux.c.patch b/packages/gpac/src-filters-in_dvb4linux.c.patch new file mode 100644 index 000000000..5efc9a587 --- /dev/null +++ b/packages/gpac/src-filters-in_dvb4linux.c.patch @@ -0,0 +1,11 @@ +--- a/src/filters/in_dvb4linux.c ++++ b/src/filters/in_dvb4linux.c +@@ -126,7 +126,7 @@ + if (line[0]=='\n') continue; + + #ifndef GPAC_SIM_LINUX_DVB +- strncpy(chan_name_t, line, index(line, ':')-line); ++ strncpy(chan_name_t, line, strchr(line, ':')-line); + chan_name_t[254] = 0; + + if (strncmp(chan_name,chan_name_t,strlen(chan_name))==0) { diff --git a/packages/gpac/src-jsmods-core.c.patch b/packages/gpac/src-jsmods-core.c.patch new file mode 100644 index 000000000..1f4ba57ec --- /dev/null +++ b/packages/gpac/src-jsmods-core.c.patch @@ -0,0 +1,11 @@ +--- a/src/jsmods/core.c ++++ b/src/jsmods/core.c +@@ -719,7 +719,7 @@ + if (!res) res = (char *) gf_opts_get_key("General", "iOSDocumentsDir"); + #else + if (!res) res = getenv("HOME"); +- if (!res) res = "/home/"; ++ if (!res) res = "@TERMUX_HOME@/"; + #endif + return JS_NewString(ctx, res); + diff --git a/packages/gpac/src-utils-os_config_init.c.patch b/packages/gpac/src-utils-os_config_init.c.patch new file mode 100644 index 000000000..652589c96 --- /dev/null +++ b/packages/gpac/src-utils-os_config_init.c.patch @@ -0,0 +1,39 @@ +--- a/src/utils/os_config_init.c ++++ b/src/utils/os_config_init.c +@@ -383,22 +383,15 @@ + return 0; + } + /*installed or symlink on system, user user home directory*/ +- if (!strnicmp(app_path, "/usr/", 5) || !strnicmp(app_path, "/opt/", 5)) { ++ if (!strnicmp(app_path, "@TERMUX_PREFIX@/", strlen("@TERMUX_PREFIX@") + 1)) { + if (path_type==GF_PATH_SHARE) { + /*look in possible install dirs ...*/ +- if (check_file_exists("gui/gui.bt", "/usr/share/gpac", file_path)) return 1; +- if (check_file_exists("gui/gui.bt", "/usr/local/share/gpac", file_path)) return 1; +- if (check_file_exists("gui/gui.bt", "/opt/share/gpac", file_path)) return 1; +- if (check_file_exists("gui/gui.bt", "/opt/local/share/gpac", file_path)) return 1; ++ if (check_file_exists("gui/gui.bt", "@TERMUX_PREFIX@/share/gpac", file_path)) return 1; ++ if (check_file_exists("gui/gui.bt", "@TERMUX_PREFIX@/local/share/gpac", file_path)) return 1; + } else if (path_type==GF_PATH_MODULES) { + /*look in possible install dirs ...*/ +- if (check_file_exists(TEST_MODULE, "/usr/lib64/gpac", file_path)) return 1; +- if (check_file_exists(TEST_MODULE, "/usr/lib/gpac", file_path)) return 1; +- if (check_file_exists(TEST_MODULE, "/usr/local/lib/gpac", file_path)) return 1; +- if (check_file_exists(TEST_MODULE, "/opt/lib/gpac", file_path)) return 1; +- if (check_file_exists(TEST_MODULE, "/opt/local/lib/gpac", file_path)) return 1; +- if (check_file_exists(TEST_MODULE, "/usr/lib/x86_64-linux-gnu/gpac", file_path)) return 1; +- if (check_file_exists(TEST_MODULE, "/usr/lib/i386-linux-gnu/gpac", file_path)) return 1; ++ if (check_file_exists(TEST_MODULE, "@TERMUX_PREFIX@/lib/gpac", file_path)) return 1; ++ if (check_file_exists(TEST_MODULE, "@TERMUX_PREFIX@/local/lib/gpac", file_path)) return 1; + } + } + +@@ -615,7 +608,7 @@ + strcpy(szPath, "/system/fonts/"); + #else + //scan all /usr/share/fonts, not just /usr/share/fonts/truetype/ which does not exist in some distrros +- strcpy(szPath, "/usr/share/fonts/"); ++ strcpy(szPath, "@TERMUX_PREFIX@/share/fonts/"); + #endif + gf_cfg_set_key(cfg, "core", "font-dirs", szPath); + diff --git a/packages/gpac/src-utils-os_divers.c.patch b/packages/gpac/src-utils-os_divers.c.patch new file mode 100644 index 000000000..ebfdbebd2 --- /dev/null +++ b/packages/gpac/src-utils-os_divers.c.patch @@ -0,0 +1,11 @@ +--- a/src/utils/os_divers.c ++++ b/src/utils/os_divers.c +@@ -1955,7 +1955,7 @@ + #elif defined(GPAC_CONFIG_ANDROID) + strcpy(szCacheDir, "/data/data/com.gpac.Osmo4/cache"); + #else +- strcpy(szCacheDir, "/tmp"); ++ strcpy(szCacheDir, "@TERMUX_PREFIX@/tmp"); + #endif + + strcpy(root_tmp, szCacheDir);