Browse Source

nano: Update from 2.7.5 to 2.8.0

android-5
Fredrik Fornwall 8 years ago
parent
commit
b09d026816
  1. 12
      packages/nano/build.sh
  2. 35
      packages/nano/no_getpwent.patch
  3. 21
      packages/nano/src-files.c.patch

12
packages/nano/build.sh

@ -1,11 +1,15 @@
TERMUX_PKG_HOMEPAGE=https://www.nano-editor.org/
TERMUX_PKG_DESCRIPTION="Small, free and friendly text editor"
_MAJOR_VERSION=2.7
TERMUX_PKG_VERSION=${_MAJOR_VERSION}.5
_MAJOR_VERSION=2.8
TERMUX_PKG_VERSION=${_MAJOR_VERSION}.0
TERMUX_PKG_SRCURL=https://www.nano-editor.org/dist/v${_MAJOR_VERSION}/nano-${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=226be22f46359007aa76499623739f4a7d5fa294a2899c70b21bc09b8d81d907
TERMUX_PKG_SHA256=0b7b434805e5e343d2fef75804fc61c59323641d8c8e63d3027b4ac442689136
TERMUX_PKG_DEPENDS="libandroid-support, libandroid-glob, ncurses"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-utf8 --disable-libmagic"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="
--disable-libmagic
--enable-utf8
--with-wordbounds
"
TERMUX_PKG_RM_AFTER_INSTALL="bin/rnano share/man/man1/rnano.1 share/nano/man-html"
termux_step_pre_configure() {

35
packages/nano/no_getpwent.patch

@ -1,35 +0,0 @@
diff -u -r ../nano-2.2.6/src/files.c ./src/files.c
--- ../nano-2.2.6/src/files.c 2010-11-12 07:13:08.000000000 +0100
+++ ./src/files.c 2014-02-13 00:01:06.000000000 +0100
@@ -2237,6 +2237,7 @@
tilde_dir = mallocstrncpy(NULL, buf, i + 1);
tilde_dir[i] = '\0';
+#ifndef __ANDROID__
do {
userdata = getpwent();
} while (userdata != NULL && strcmp(userdata->pw_name,
@@ -2244,6 +2245,7 @@
endpwent();
if (userdata != NULL)
tilde_dir = mallocstrcpy(tilde_dir, userdata->pw_dir);
+#endif
}
retval = charalloc(strlen(tilde_dir) + strlen(buf + i) + 1);
@@ -2341,6 +2343,7 @@
*num_matches = 0;
+#ifndef __ANDROID__
while ((userdata = getpwent()) != NULL) {
if (strncmp(userdata->pw_name, buf + 1, buf_len - 1) == 0) {
/* Cool, found a match. Add it to the list. This makes a
@@ -2362,6 +2365,7 @@
}
}
endpwent();
+#endif
return matches;
}

21
packages/nano/src-files.c.patch

@ -0,0 +1,21 @@
diff -u -r ../nano-2.8.0/src/files.c ./src/files.c
--- ../nano-2.8.0/src/files.c 2017-03-24 18:58:22.000000000 +0000
+++ ./src/files.c 2017-04-02 08:55:48.207085424 +0000
@@ -2362,7 +2362,7 @@
get_homedir();
tilde_dir = mallocstrcpy(NULL, homedir);
} else {
-#ifdef HAVE_PWD_H
+#if defined(HAVE_PWD_H) && !defined(__ANDROID__)
const struct passwd *userdata;
tilde_dir = mallocstrncpy(NULL, buf, i + 1);
@@ -2473,7 +2473,7 @@
*num_matches = 0;
-#ifdef HAVE_PWD_H
+#if defined(HAVE_PWD_H) && !defined(__ANDROID__)
const struct passwd *userdata;
while ((userdata = getpwent()) != NULL) {
Loading…
Cancel
Save