new package: gpac

This commit is contained in:
Tee KOBAYASHI 2022-01-06 06:45:50 +09:00 committed by Leonid Pliushch
parent 27e88a1953
commit 55298ee276
5 changed files with 91 additions and 0 deletions

19
packages/gpac/build.sh Normal file
View File

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

View File

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

View File

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

View File

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

View File

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