procps: use __progname for getting program name (#6777)

Autoconf macro for __progname taken from tmux, seems it is missing
from procps, code checks `ifdef HAVE__PROGNAME` so all we have to do
is to add the macro.

Fixes https://github.com/termux/termux-packages/issues/6768.
This commit is contained in:
Henrik Grimler 2021-05-08 21:51:15 +02:00 committed by GitHub
parent 5747fd1c87
commit d3d7dc805f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 30 deletions

View File

@ -0,0 +1,12 @@
--- ../procps-3.3.17/Makefile.am 2021-02-09 10:11:25.000000000 +0000
+++ ./Makefile.am 2021-05-08 19:17:42.013134502 +0000
@@ -160,7 +160,8 @@
top/top.c \
top/top_nls.h \
top/top_nls.c \
- lib/fileutils.c
+ lib/fileutils.c \
+ lib/strverscmp.c
if CYGWIN
top_top_SOURCES += lib/strverscmp.c

View File

@ -1,24 +0,0 @@
Bionic lacks strverscmp as well.
--- ./Makefile.in.orig 2021-02-09 10:11:25.000000000 +0000
+++ ./Makefile.in 2021-05-07 05:31:39.777034650 +0000
@@ -139,7 +139,7 @@
@WITH_NCURSES_TRUE@ watch.1 \
@WITH_NCURSES_TRUE@ top/top.1
-@CYGWIN_TRUE@@WITH_NCURSES_TRUE@am__append_20 = lib/strverscmp.c
+@WITH_NCURSES_TRUE@am__append_20 = lib/strverscmp.c
@CYGWIN_FALSE@@WITH_NCURSES_TRUE@am__append_21 = \
@CYGWIN_FALSE@@WITH_NCURSES_TRUE@ slabtop.1
@@ -367,8 +367,8 @@
tload_DEPENDENCIES = ./proc/libprocps.la $(am__DEPENDENCIES_2)
am__top_top_SOURCES_DIST = top/top.h top/top.c top/top_nls.h \
top/top_nls.c lib/fileutils.c lib/strverscmp.c
-@CYGWIN_TRUE@@WITH_NCURSES_TRUE@am__objects_1 = \
-@CYGWIN_TRUE@@WITH_NCURSES_TRUE@ lib/strverscmp.$(OBJEXT)
+@WITH_NCURSES_TRUE@am__objects_1 = \
+@WITH_NCURSES_TRUE@ lib/strverscmp.$(OBJEXT)
@WITH_NCURSES_TRUE@am_top_top_OBJECTS = top/top.$(OBJEXT) \
@WITH_NCURSES_TRUE@ top/top_nls.$(OBJEXT) \
@WITH_NCURSES_TRUE@ lib/fileutils.$(OBJEXT) $(am__objects_1)

View File

@ -3,25 +3,24 @@ TERMUX_PKG_DESCRIPTION="Utilities that give information about processes using th
TERMUX_PKG_LICENSE="LGPL-2.0"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION=3.3.17
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://fossies.org/linux/misc/procps-ng-$TERMUX_PKG_VERSION.tar.xz
TERMUX_PKG_SHA256=4518b3e7aafd34ec07d0063d250fd474999b20b200218c3ae56f5d2113f141b4
TERMUX_PKG_DEPENDS="ncurses"
TERMUX_PKG_BREAKS="procps-dev"
TERMUX_PKG_REPLACES="procps-dev"
TERMUX_PKG_ESSENTIAL=true
TERMUX_PKG_BUILD_IN_SRC=true
# error.h and stdio_ext.h in unified headers does
# not provide any functionality prior to android-23:
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
ac_cv_search_dlopen=
ac_cv_header_error_h=no
ac_cv_header_stdio_ext_h=no
--enable-sigwinch
--disable-modern-top
--enable-watch8bit
"
termux_step_pre_configure() {
autoreconf -fi
}
# About kill: https://bugs.launchpad.net/ubuntu/+source/coreutils/+bug/141168:
# "For compatibility between distributions, can we have /bin/kill made available from coreutils?"
# About top: The system top works better.

View File

@ -0,0 +1,25 @@
--- ../procps-3.3.17/configure.ac 2021-02-09 11:11:25.000000000 +0100
+++ ./configure.ac 2021-05-08 20:36:49.085413472 +0200
@@ -116,6 +116,22 @@
AC_CHECK_HEADERS(stdio_ext.h, [], [], AC_INCLUDES_DEFAULT)
+AC_MSG_CHECKING(for __progname)
+AC_LINK_IFELSE([AC_LANG_SOURCE(
+ [
+ #include <stdio.h>
+ #include <stdlib.h>
+ extern char *__progname;
+ int main(void) {
+ const char *cp = __progname;
+ printf("%s\n", cp);
+ exit(0);
+ }
+ ])],
+ AC_DEFINE(HAVE___PROGNAME, 1, [Define if __progname exists])
+ AC_MSG_RESULT(yes),
+ AC_MSG_RESULT(no))
+
AC_MSG_CHECKING(whether program_invocation_name is defined)
AC_TRY_COMPILE([#include <errno.h>],
[program_invocation_name = "test";],