new package: rdrview (#8313)
This commit is contained in:
parent
1e9dcc01ff
commit
ffc534dae4
28
packages/rdrview/Makefile.patch
Normal file
28
packages/rdrview/Makefile.patch
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
--- a/Makefile
|
||||||
|
+++ b/Makefile
|
||||||
|
@@ -1,11 +1,11 @@
|
||||||
|
-SYSTEM = $(shell uname)
|
||||||
|
-CC = gcc
|
||||||
|
+SYSTEM = Linux
|
||||||
|
+CC ?= gcc
|
||||||
|
GIT_COMMIT = $(shell git rev-parse --short HEAD)
|
||||||
|
|
||||||
|
-CFLAGS = -DNDEBUG -O2 -Wall -Wextra -fno-strict-aliasing
|
||||||
|
-override CFLAGS += $(shell curl-config --cflags) $(shell xml2-config --cflags)
|
||||||
|
+CFLAGS += -DNDEBUG -Wall -Wextra -fno-strict-aliasing
|
||||||
|
+override CFLAGS += $(shell sh @TERMUX_PREFIX@/bin/curl-config --cflags) $(shell sh @TERMUX_PREFIX@/bin/xml2-config --cflags)
|
||||||
|
|
||||||
|
-LDLIBS = $(shell curl-config --libs) $(shell xml2-config --libs) -lm
|
||||||
|
+LDLIBS = $(shell sh @TERMUX_PREFIX@/bin/curl-config --libs) $(shell sh @TERMUX_PREFIX@/bin/xml2-config --libs) -lm
|
||||||
|
ifeq ($(SYSTEM), Linux)
|
||||||
|
LDLIBS += -lseccomp
|
||||||
|
else ifeq ($(SYSTEM), FreeBSD)
|
||||||
|
@@ -14,7 +14,7 @@
|
||||||
|
LDLIBS += -liconv
|
||||||
|
endif
|
||||||
|
|
||||||
|
-PREFIX = /usr/local
|
||||||
|
+PREFIX = @TERMUX_PREFIX@
|
||||||
|
BINDIR = $(DESTDIR)$(PREFIX)/bin
|
||||||
|
MANDIR = $(DESTDIR)$(PREFIX)/share/man/man1
|
||||||
|
|
19
packages/rdrview/build.sh
Normal file
19
packages/rdrview/build.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
TERMUX_PKG_HOMEPAGE=https://github.com/eafer/rdrview
|
||||||
|
TERMUX_PKG_DESCRIPTION="Command line tool to extract the main content from a webpage"
|
||||||
|
TERMUX_PKG_LICENSE="Apache-2.0"
|
||||||
|
TERMUX_PKG_MAINTAINER="@termux"
|
||||||
|
_COMMIT=9bde19f9e53562790b363bb2e3b15707c8c67676
|
||||||
|
TERMUX_PKG_VERSION=2021.09.12
|
||||||
|
TERMUX_PKG_SRCURL=https://github.com/eafer/rdrview.git
|
||||||
|
TERMUX_PKG_GIT_BRANCH=master
|
||||||
|
TERMUX_PKG_DEPENDS="libcurl, libiconv, libseccomp, libxml2"
|
||||||
|
TERMUX_PKG_BUILD_IN_SRC=true
|
||||||
|
|
||||||
|
termux_step_post_get_source() {
|
||||||
|
git fetch --unshallow
|
||||||
|
git checkout $_COMMIT
|
||||||
|
}
|
||||||
|
|
||||||
|
termux_step_pre_configure() {
|
||||||
|
LDFLAGS+=" -liconv"
|
||||||
|
}
|
24
packages/rdrview/src-rdrview.c.patch
Normal file
24
packages/rdrview/src-rdrview.c.patch
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
--- a/src/rdrview.c
|
||||||
|
+++ b/src/rdrview.c
|
||||||
|
@@ -143,7 +143,7 @@
|
||||||
|
char *envdir = getenv("TMPDIR");
|
||||||
|
|
||||||
|
if (!tmpdir) {
|
||||||
|
- dir_template = mkstring("%s/XXXXXX", envdir ? envdir : "/tmp");
|
||||||
|
+ dir_template = mkstring("%s/XXXXXX", envdir ? envdir : "@TERMUX_PREFIX@/tmp");
|
||||||
|
tmpdir = mkdtemp(dir_template);
|
||||||
|
if (!tmpdir)
|
||||||
|
fatal_errno();
|
||||||
|
@@ -571,9 +571,9 @@
|
||||||
|
{
|
||||||
|
static char *mailcap_paths[] = {
|
||||||
|
NULL, /* Placeholder for the user's mailcap */
|
||||||
|
- "/etc/mailcap",
|
||||||
|
- "/usr/share/etc/mailcap",
|
||||||
|
- "/usr/local/etc/mailcap",
|
||||||
|
+ "@TERMUX_PREFIX@/etc/mailcap",
|
||||||
|
+ "@TERMUX_PREFIX@/share/etc/mailcap",
|
||||||
|
+ "@TERMUX_PREFIX@/local/etc/mailcap",
|
||||||
|
};
|
||||||
|
char *homepath;
|
||||||
|
char *template = NULL;
|
Loading…
Reference in New Issue
Block a user