nano: update version (#5142)

* nano: update version && delete old recipe

* Fix new version for gcc2

Courtesy of Begasus
This commit is contained in:
Emir Sarı
2020-07-02 15:40:45 +03:00
committed by GitHub
parent 85f0b7f487
commit d45b400864
4 changed files with 69 additions and 316 deletions

View File

@@ -1,62 +0,0 @@
SUMMARY="Pico clone with more functionality under the GPL license"
DESCRIPTION="nano is a simple text editor for Unix-like computing systems \
or operating environments using a command line interface. It emulates the \
Pico text editor, part of the Pine email client, and also provides additional \
functionality. Features include:
- Customizable key bindings
- 'soft' line wrapping
- Full undo/redo support
- Pager support (reading from stdin)
- Warnings for un-writable files
- More syntax highlighting samples (Fortran, objC, OCaml, Makefiles)"
HOMEPAGE="https://www.nano-editor.org/"
COPYRIGHT="1999-2018 Free Software Foundation, Inc."
LICENSE="GNU GPL v3"
REVISION="3"
SOURCE_URI="https://www.nano-editor.org/dist/v2.9/nano-$portVersion.tar.gz"
CHECKSUM_SHA256="07192c320b74c1fb78437021e9affa6a9d55b806ee012de601902392eaa03601"
PATCHES="nano-$portVersion.patchset"
ARCHITECTURES="x86_gcc2 x86 x86_64"
PROVIDES="
nano = $portVersion compat >= 2
cmd:nano = $portVersion compat >= 2
cmd:rnano = $portVersion compat >= 2
"
REQUIRES="
haiku
cmd:groff
lib:libncurses
"
BUILD_REQUIRES="
haiku_devel
devel:libncurses
"
BUILD_PREREQUIRES="
cmd:autoreconf
cmd:gcc
cmd:groff
cmd:ld
cmd:libtoolize
cmd:make
cmd:pkg_config
"
BUILD()
{
autoreconf
runConfigure ./configure
make $jobArgs
}
INSTALL()
{
make install
}
TEST()
{
make check
}

View File

@@ -1,69 +0,0 @@
SUMMARY="Pico clone with more functionality under the GPL license"
DESCRIPTION="nano is a simple text editor for Unix-like computing systems \
or operating environments using a command line interface. It emulates the \
Pico text editor, part of the Pine email client, and also provides additional \
functionality. Features include:
- Customizable key bindings
- 'soft' line wrapping
- Full undo/redo support
- Pager support (reading from stdin)
- Warnings for un-writable files
- More syntax highlighting samples (Fortran, objC, OCaml, Makefiles)"
HOMEPAGE="https://www.nano-editor.org/"
COPYRIGHT="1999-2020 Free Software Foundation, Inc."
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://www.nano-editor.org/dist/v4/nano-$portVersion.tar.xz"
CHECKSUM_SHA256="d8a25eea942ecee2d57b8e037eb4b28f030f818b78773b8fcb994ed5835d2ef6"
ARCHITECTURES="!x86_gcc2 x86 x86_64"
PROVIDES="
nano = $portVersion compat >= 2
cmd:nano = $portVersion compat >= 2
cmd:rnano = $portVersion compat >= 2
"
REQUIRES="
haiku
cmd:groff
lib:libintl
lib:libncurses
lib:libz
"
BUILD_REQUIRES="
haiku_devel
devel:libiconv
devel:libintl
devel:libncurses
devel:libz
"
BUILD_PREREQUIRES="
cmd:autoreconf
cmd:gcc
cmd:groff
cmd:ld
cmd:libtoolize
cmd:make
cmd:msgfmt
cmd:msgmerge
cmd:pkg_config
cmd:xgettext
"
BUILD()
{
autoreconf
runConfigure ./configure
make $jobArgs
}
INSTALL()
{
make install
}
TEST()
{
make check
}

View File

@@ -0,0 +1,69 @@
SUMMARY="Pico clone with more functionality under the GPL license"
DESCRIPTION="nano is a simple text editor for Unix-like computing systems \
using a command line interface. It closely emulates the Pico text editor, \
part of the Pine email client, while providing additional functionality. \
Features include:
- Full undo/redo support
- Syntax highlighting
- Customizable key bindings
- 'Soft' line wrapping
- Line numbers
- Pager support (reading from stdin)
- Warnings for unwritable files
- Localization"
HOMEPAGE="https://www.nano-editor.org/"
COPYRIGHT="1999-2020 Free Software Foundation, Inc."
LICENSE="GNU GPL v3"
REVISION="1"
SOURCE_URI="https://www.nano-editor.org/dist/v4/nano-$portVersion.tar.xz"
CHECKSUM_SHA256="6e3438f033a0ed07d3d74c30d0803cbda3d2366ba1601b7bbf9b16ac371f51b4"
ARCHITECTURES="!x86_gcc2 x86_64"
SECONDARY_ARCHITECTURES="x86"
commandSuffix=$secondaryArchSuffix
commandBinDir=$binDir
if [ "$targetArchitecture" = x86_gcc2 ]; then
commandSuffix=
commandBinDir=$prefix/bin
fi
PROVIDES="
nano$secondaryArchSuffix = $portVersion compat >= 2
cmd:nano$commandSuffix = $portVersion compat >= 2
cmd:rnano$commandSuffix = $portVersion compat >= 2
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libiconv$secondaryArchSuffix
lib:libintl$secondaryArchSuffix
lib:libncurses$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libiconv$secondaryArchSuffix
devel:libintl$secondaryArchSuffix
devel:libncurses$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:groff
cmd:ld$secondaryArchSuffix
cmd:libtoolize$secondaryArchSuffix
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
BUILD()
{
runConfigure --omit-dirs binDir ./configure --bindir=$commandBinDir
make $jobArgs
}
INSTALL()
{
make install
}

View File

@@ -1,185 +0,0 @@
From 8158628bb0ec27f5a44000efbe08be00a4f63aea Mon Sep 17 00:00:00 2001
From: fbrosson <fbrosson@localhost>
Date: Sat, 16 Jun 2018 21:07:34 +0000
Subject: C89 fixes for gcc2 compatibility
diff --git a/lib/glob.c b/lib/glob.c
index a5e4e93..d9c7c0f 100644
--- a/lib/glob.c
+++ b/lib/glob.c
@@ -141,8 +141,11 @@ convert_dirent (const struct dirent *source)
struct readdir_result result = { NULL, };
return result;
}
+ else
+ {
struct readdir_result result = READDIR_RESULT_INITIALIZER (source);
return result;
+ }
}
#ifndef COMPILE_GLOB64
@@ -497,6 +500,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
else
{
char *newp;
+ bool drive_root;
dirlen = filename - pattern;
#if defined __MSDOS__ || defined WINDOWS32
@@ -532,18 +536,19 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
++filename;
#if defined __MSDOS__ || defined WINDOWS32
- bool drive_root = (dirlen > 1
+ drive_root = (dirlen > 1
&& (dirname[dirlen - 1] == ':'
|| (dirlen > 2 && dirname[dirlen - 2] == ':'
&& dirname[dirlen - 1] == '/')));
#else
- bool drive_root = false;
+ drive_root = false;
#endif
if (filename[0] == '\0' && dirlen > 1 && !drive_root)
/* "pattern/". Expand "pattern", appending slashes. */
{
int orig_flags = flags;
+ int val;
if (!(flags & GLOB_NOESCAPE) && dirname[dirlen - 1] == '\\')
{
/* "pattern\\/". Remove the final backslash if it hasn't
@@ -557,7 +562,7 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
flags &= ~(GLOB_NOCHECK | GLOB_NOMAGIC);
}
}
- int val = glob (dirname, flags | GLOB_MARK, errfunc, pglob);
+ val = glob (dirname, flags | GLOB_MARK, errfunc, pglob);
if (val == 0)
pglob->gl_flags = ((pglob->gl_flags & ~GLOB_MARK)
| (flags & GLOB_MARK));
@@ -775,12 +780,11 @@ glob (const char *pattern, int flags, int (*errfunc) (const char *, int),
/* Look up specific user's home directory. */
{
struct passwd *p;
+ struct passwd pwbuf;
struct scratch_buffer pwtmpbuf;
scratch_buffer_init (&pwtmpbuf);
# if defined HAVE_GETPWNAM_R || defined _LIBC
- struct passwd pwbuf;
-
while (getpwnam_r (user_name, &pwbuf,
pwtmpbuf.data, pwtmpbuf.length, &p)
== ERANGE)
@@ -1400,7 +1404,8 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
while (1)
{
struct globnames *old = names;
- for (size_t i = 0; i < cur; ++i)
+ size_t i;
+ for (i = 0; i < cur; ++i)
free (names->name[i]);
names = names->next;
/* NB: we will not leak memory here if we exit without
@@ -1425,7 +1430,8 @@ glob_in_dir (const char *pattern, const char *directory, int flags,
while (1)
{
struct globnames *old = names;
- for (size_t i = 0; i < cur; ++i)
+ size_t i;
+ for (i = 0; i < cur; ++i)
new_gl_pathv[pglob->gl_offs + pglob->gl_pathc++]
= names->name[i];
names = names->next;
diff --git a/lib/malloc/scratch_buffer_set_array_size.c b/lib/malloc/scratch_buffer_set_array_size.c
index 4e43e7c..2cef316 100644
--- a/lib/malloc/scratch_buffer_set_array_size.c
+++ b/lib/malloc/scratch_buffer_set_array_size.c
@@ -29,6 +29,7 @@ __libc_scratch_buffer_set_array_size (struct scratch_buffer *buffer,
size_t nelem, size_t size)
{
size_t new_length = nelem * size;
+ char *new_ptr;
/* Avoid overflow check if both values are small. */
if ((nelem | size) >> (sizeof (size_t) * CHAR_BIT / 2) != 0
@@ -48,7 +49,7 @@ __libc_scratch_buffer_set_array_size (struct scratch_buffer *buffer,
/* Discard old buffer. */
scratch_buffer_free (buffer);
- char *new_ptr = malloc (new_length);
+ new_ptr = malloc (new_length);
if (new_ptr == NULL)
{
/* Buffer must remain valid to free. */
diff --git a/src/browser.c b/src/browser.c
index 1213361..ce3df39 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -224,6 +224,7 @@ char *do_browser(char *path)
} else if (func == to_last_file) {
selected = filelist_len - 1;
} else if (func == goto_dir_void) {
+ size_t j;
/* Ask for the directory to go to. */
int i = do_prompt(TRUE, FALSE, MGOTODIR, NULL, NULL,
/* TRANSLATORS: This is a prompt. */
@@ -258,7 +259,7 @@ char *do_browser(char *path)
/* In case the specified directory cannot be entered, select it
* (if it is in the current list) so it will be highlighted. */
- for (size_t j = 0; j < filelist_len; j++)
+ for (j = 0; j < filelist_len; j++)
if (strcmp(filelist[j], path) == 0)
selected = j;
diff --git a/src/global.c b/src/global.c
index fc5fad3..2bf3aa5 100644
--- a/src/global.c
+++ b/src/global.c
@@ -1374,7 +1374,8 @@ void shortcut_init(void)
/* Assign one function's shortcuts to another function. */
void replace_scs_for(void (*oldfunc)(void), void (*newfunc)(void))
{
- for (sc *s = sclist; s != NULL; s = s->next)
+ sc *s;
+ for (s = sclist; s != NULL; s = s->next)
if (s->func == oldfunc)
s->func = newfunc;
}
diff --git a/src/winio.c b/src/winio.c
index 281488a..686df45 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -290,7 +290,8 @@ void unget_kbinput(int kbinput, bool metakey)
/* Insert the given string into the keyboard buffer. */
void implant(const char *string)
{
- for (int i = strlen(string); i > 0; i--)
+ int i;
+ for (i = strlen(string); i > 0; i--)
put_back(string[i - 1]);
}
#endif
@@ -1267,6 +1268,7 @@ int arrow_from_abcd(int kbinput)
int parse_escape_sequence(WINDOW *win, int kbinput)
{
int retval, *sequence, length, consumed;
+ int i;
/* Put back the non-escape code, then grab at most five integers
* (the longest possible escape sequence) from the keybuffer and
@@ -1277,7 +1279,7 @@ int parse_escape_sequence(WINDOW *win, int kbinput)
retval = convert_sequence(sequence, length, &consumed);
/* If not all grabbed integers were consumed, put the leftovers back. */
- for (int i = length - 1; i >= consumed; i--)
+ for (i = length - 1; i >= consumed; i--)
put_back(sequence[i]);
free(sequence);
--
2.17.1