loksh: Bump to 7.2

This commit is contained in:
Tee KOBAYASHI 2022-11-21 16:41:55 +09:00 committed by xtkoba
parent 9677e46bea
commit 3d351ba8f8
5 changed files with 55 additions and 34 deletions

View File

@ -1,11 +0,0 @@
diff -uNr loksh-6.6/Makefile loksh-6.6.mod/Makefile
--- loksh-6.6/Makefile 2019-10-17 17:47:17.000000000 +0300
+++ loksh-6.6.mod/Makefile 2019-11-03 03:27:27.575357097 +0200
@@ -33,7 +33,6 @@
install: all
install -v -D -m 755 ksh $(DESTDIR)/$(BIN_DIR)/$(BIN_NAME)
install -v -D -m 644 ksh.1 $(DESTDIR)/$(MAN_DIR)/man1/$(BIN_NAME).1
- install -v -m 644 sh.1 $(DESTDIR)/$(MAN_DIR)/man1/sh.1
install -v -D -m 644 README.md $(DESTDIR)/$(DOC_DIR)/README.md
install -v -m 644 README $(DESTDIR)/$(DOC_DIR)/README
install -v -m 644 CONTRIBUTORS $(DESTDIR)/$(DOC_DIR)/CONTRIBUTORS

View File

@ -2,19 +2,29 @@ TERMUX_PKG_HOMEPAGE=https://github.com/dimkr/loksh
TERMUX_PKG_DESCRIPTION="A Linux port of OpenBSD's ksh"
TERMUX_PKG_LICENSE="Public Domain"
TERMUX_PKG_MAINTAINER="@termux"
# Versions >6.7 fail with lots errors in NDK headers.
#
# Example error:
#
# In file included from ../src/subprojects/lolibc/include/sys/types.h:5:
# /home/builder/.termux-build/_cache/android-r20-api-24-v3/bin/../sysroot/usr/include/time.h:96:1: error: unknown type name 'clock_t'
# clock_t clock(void);
# ^
# /home/builder/.termux-build/_cache/android-r20-api-24-v3/bin/../sysroot/usr/include/time.h:100:25: error: unknown type name 'pid_t'
# int clock_getcpuclockid(pid_t __pid, clockid_t* __clock) __INTRODUCED_IN(23);
TERMUX_PKG_VERSION=6.6
TERMUX_PKG_SRCURL=https://github.com/dimkr/loksh/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=97a020df82ceebe216c5a306e87360c5e3398d7403347aaff50978446ccb764d
#TERMUX_PKG_AUTO_UPDATE=true
TERMUX_PKG_VERSION=7.2
TERMUX_PKG_SRCURL=https://github.com/dimkr/loksh.git
TERMUX_PKG_GIT_BRANCH=$TERMUX_PKG_VERSION
TERMUX_PKG_DEPENDS="ncurses"
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_post_get_source() {
pushd subprojects/lolibc
mv include _include_lolibc
mkdir include
mv _include_lolibc include/lolibc
pushd include/lolibc
local _LOLIBC_HEADERS=$(find * -name '*.h')
popd
popd
local f
for f in $(find . -name '*.[ch]'); do
local h
for h in ${_LOLIBC_HEADERS}; do
sed -i "s:#include <${h//./\\.}>:#include <lolibc/${h}>:g" ${f}
done
done
cd subprojects/lolibc/include/lolibc
for f in ${_LOLIBC_HEADERS}; do
sed -i "s:#include_next :#include :g" ${f}
done
}

View File

@ -2,9 +2,9 @@ diff -uNr loksh-6.4/c_sh.c loksh-6.4.mod/c_sh.c
--- loksh-6.4/c_sh.c 2018-10-18 19:25:07.000000000 +0300
+++ loksh-6.4.mod/c_sh.c 2019-02-20 21:08:11.282582629 +0200
@@ -8,6 +8,7 @@
#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <lolibc/sys/resource.h>
#include <lolibc/sys/stat.h>
#include <lolibc/sys/time.h>
+#include <linux/time.h>
#include <ctype.h>
@ -14,19 +14,19 @@ diff -uNr loksh-6.4/mail.c loksh-6.4.mod/mail.c
+++ loksh-6.4.mod/mail.c 2019-02-20 21:08:16.325940697 +0200
@@ -7,6 +7,7 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <lolibc/sys/stat.h>
#include <lolibc/sys/time.h>
+#include <linux/time.h>
#include <string.h>
#include <lolibc/string.h>
#include <time.h>
diff -uNr loksh-6.4/var.c loksh-6.4.mod/var.c
--- loksh-6.4/var.c 2018-10-18 19:25:07.000000000 +0300
+++ loksh-6.4.mod/var.c 2019-02-20 21:08:21.149297670 +0200
@@ -2,6 +2,7 @@
#include <sys/stat.h>
#include <sys/time.h>
#include <lolibc/sys/stat.h>
#include <lolibc/sys/time.h>
+#include <linux/time.h>
#include <ctype.h>

View File

@ -0,0 +1,11 @@
--- a/meson.build
+++ b/meson.build
@@ -25,7 +25,7 @@
link_with: lolibc.get_variable('liblolibc'),
install: true)
-install_man('ksh.1', 'sh.1')
+install_man('ksh.1')
install_data('README.md',
'README',

View File

@ -0,0 +1,11 @@
--- a/misc.c
+++ b/misc.c
@@ -13,7 +13,7 @@
#include <lolibc/unistd.h>
#include "sh.h"
-#include "charclass.h"
+#include <lolibc/charclass.h>
short ctypes [UCHAR_MAX+1]; /* type bits for unsigned char */
static int dropped_privileges;