lnav: Bump to 0.11.1

This commit is contained in:
Tee KOBAYASHI 2022-11-23 03:20:23 +09:00 committed by xtkoba
parent 8905a6ad92
commit 594af1e5b5
7 changed files with 115 additions and 24 deletions

View File

@ -4,8 +4,8 @@
ACLOCAL_AMFLAGS = -I .
-SUBDIRS = src test
+SUBDIRS = src
-SUBDIRS = tools src test
+SUBDIRS = tools src
noinst_SCRIPTS = TESTS_ENVIRONMENT

View File

@ -2,19 +2,23 @@ TERMUX_PKG_HOMEPAGE=https://lnav.org/
TERMUX_PKG_DESCRIPTION="An advanced log file viewer for the small-scale"
TERMUX_PKG_LICENSE="BSD 2-Clause"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=0.10.1
TERMUX_PKG_VERSION=0.11.1
TERMUX_PKG_SRCURL=https://github.com/tstack/lnav/archive/refs/tags/v${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=4af855a463493105ae0746fc0da80304a689b5394eb6abfeede4dd843127c8bc
TERMUX_PKG_DEPENDS="libandroid-glob, libarchive, libbz2, libcurl, ncurses, pcre, readline, sqlite, zlib"
TERMUX_PKG_SHA256=7d73ceeeae0fdc61cffce0f8a7a3435aa91b401b67d233ffaa018faab00d7d3f
TERMUX_PKG_DEPENDS="libandroid-execinfo, libandroid-glob, libarchive, libbz2, libc++, libcurl, libsqlite, ncurses, pcre2, readline, zlib"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--disable-system-paths
ac_cv_header_execinfo_h=no
--disable-static
--with-pcre2=$TERMUX_PREFIX
"
termux_step_post_get_source() {
cp $TERMUX_PKG_BUILDER_DIR/sys_time.c src/
}
termux_step_pre_configure() {
autoreconf -fi
CPPFLAGS+=" -D_PATH_VARTMP=\\\"$TERMUX_PREFIX/tmp\\\""
LDFLAGS+=" -landroid-glob"
}

View File

@ -0,0 +1,10 @@
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -460,6 +460,7 @@
sql_commands.cc \
sql_util.cc \
state-extension-functions.cc \
+ sys_time.c \
sysclip.cc \
textfile_highlighters.cc \
textview_curses.cc \

View File

@ -1,11 +1,11 @@
--- a/src/grep_proc.cc
+++ b/src/grep_proc.cc
@@ -163,7 +163,7 @@
if (setvbuf(stdout, outbuf, _IOFBF, BUFSIZ * 2) < 0) {
@@ -172,7 +172,7 @@
perror("setvbuf");
}
- lnav_log_file = make_optional_from_nullable(fopen("/tmp/lnav.grep.err", "a"));
+ lnav_log_file = make_optional_from_nullable(fopen("@TERMUX_PREFIX@/tmp/lnav.grep.err", "a"));
lnav_log_file
- = make_optional_from_nullable(fopen("/tmp/lnav.grep.err", "a"));
+ = make_optional_from_nullable(fopen("@TERMUX_PREFIX@/tmp/lnav.grep.err", "a"));
line_value.reserve(BUFSIZ * 2);
while (!this->gp_queue.empty()) {
LineType start_line = this->gp_queue.front().first;

View File

@ -1,23 +1,23 @@
--- a/src/lnav.cc
+++ b/src/lnav.cc
@@ -149,7 +149,7 @@
#include "archive_manager.hh"
@@ -163,7 +163,7 @@
#include "yajlpp/yajlpp.hh"
#ifndef SYSCONFDIR
-#define SYSCONFDIR "/usr/etc"
+#define SYSCONFDIR "@TERMUX_PREFIX@/etc"
-# define SYSCONFDIR "/usr/etc"
+# define SYSCONFDIR "@TERMUX_PREFIX@/etc"
#endif
using namespace std;
@@ -2098,7 +2098,7 @@
#endif
using namespace std::literals::chrono_literals;
@@ -2406,7 +2406,7 @@
lnav_data.ld_config_paths.insert(lnav_data.ld_config_paths.begin(),
SYSCONFDIR "/lnav");
lnav_data.ld_config_paths.insert(lnav_data.ld_config_paths.begin(),
- "/etc/lnav");
+ "@TERMUX_PREFIX@/etc/lnav");
lnav_data.ld_debug_log_name = "/dev/null";
- lnav_data.ld_config_paths.emplace_back("/etc/lnav");
+ lnav_data.ld_config_paths.emplace_back("@TERMUX_PREFIX@/etc/lnav");
lnav_data.ld_config_paths.emplace_back(SYSCONFDIR "/lnav");
lnav_data.ld_config_paths.emplace_back(lnav::paths::dotlnav());
while ((c = getopt(argc, argv, "hHarRCc:I:iuf:d:nNqtw:vVW")) != -1) {
if (lnav_data.ld_debug_log_name != DEFAULT_DEBUG_LOG) {
lnav_log_level = lnav_log_level_t::TRACE;
@@ -2363,7 +2363,7 @@
* so that it will try the default path.
*/

View File

@ -0,0 +1,15 @@
--- a/src/piper_proc.cc
+++ b/src/piper_proc.cc
@@ -41,6 +41,12 @@
#include <sys/wait.h>
#include <unistd.h>
+#if defined __ANDROID__ && __ANDROID_API__ < 26
+extern "C" {
+int futimes(int, const struct timeval[2]);
+}
+#endif
+
#include "base/fs_util.hh"
#include "base/lnav_log.hh"
#include "config.h"

62
packages/lnav/sys_time.c Normal file
View File

@ -0,0 +1,62 @@
/*
* Copyright (C) 2013 The Android Open Source Project
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
#if defined __ANDROID__ && __ANDROID_API__ < 26
#include <sys/time.h>
#include <errno.h>
#include <fcntl.h>
#include <sys/stat.h>
#pragma GCC visibility push(hidden)
int timespec_from_timeval(struct timespec* ts, const struct timeval tv) {
// Whole seconds can just be copied.
ts->tv_sec = tv.tv_sec;
// But we might overflow when converting microseconds to nanoseconds.
if (tv.tv_usec >= 1000000 || tv.tv_usec < 0) {
return 0;
}
ts->tv_nsec = tv.tv_usec * 1000;
return 1;
}
int futimes(int fd, const struct timeval tv[2]) {
struct timespec ts[2];
if (tv && (!timespec_from_timeval(&ts[0], tv[0]) || !timespec_from_timeval(&ts[1], tv[1]))) {
errno = EINVAL;
return -1;
}
return futimens(fd, tv ? ts : NULL);
}
#pragma GCC visibility pop
#endif