Added new package: hexcurse

This commit is contained in:
Erik Wolf 2018-04-12 14:50:30 +02:00
parent 9bd599ee04
commit 8717e4cac2
3 changed files with 172 additions and 0 deletions

48
hexcurse/PKGBUILD Normal file
View File

@ -0,0 +1,48 @@
# Maintainer: 3mb3dw0rk5 <3mb3dw0rk5 at gmail dot com>
# PKGBUILD derived from original AUR PKGBUILD
# Contributor: SpepS <dreamspepser at yahoo dot it>, eric <eric@archlinux.org>
pkgname=hexcurse
pkgver=1.60.0
pkgrel=1
pkgdesc="Versatile ncurses-based hex editor."
arch=('i686' 'x86_64')
#url="http://directory.fsf.org/project/HexCurse/"
url="https://github.com/LonnyGomes/hexcurse"
license=('GPL')
depends=('ncurses')
options=('!makeflags')
source=("$pkgname-$pkgver.tgz::https://github.com/LonnyGomes/hexcurse/archive/v$pkgver.tar.gz")
md5sums=('cb24b564bea21a615a5c6a2ee30d6cad')
# Helper macros to help make tasks easier #
apply_patch_with_msg() {
for _fname in "$@"
do
msg2 "Applying ${_fname}"
patch -Nbp1 -i "${startdir}"/${_fname}
done
}
prepare() {
cd "$srcdir/$pkgname-$pkgver"
apply_patch_with_msg hexcurse-1.60.0-msys2-automake-version.diff \
hexcurse-1.60.0-msys2-getopt.diff
}
build() {
cd "$srcdir/$pkgname-$pkgver"
./configure \
--prefix=/usr \
--mandir=/usr/share/man
make
}
package() {
cd "$srcdir/$pkgname-$pkgver"
make DESTDIR="$pkgdir/" install
}

View File

@ -0,0 +1,31 @@
diff --git a/aclocal.m4 b/aclocal.m4
index f3018f6..d2cf854 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+# Copyright (C) 2002-2017 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -35,7 +35,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.15'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.15], [],
+m4_if([$1], [1.15.1], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -51,7 +51,7 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.15])dnl
+[AM_AUTOMAKE_VERSION([1.15.1])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])

View File

@ -0,0 +1,93 @@
diff --git a/include/hgetopt.h b/include/hgetopt.h
index 9a1c874..900d95c 100644
--- a/include/hgetopt.h
+++ b/include/hgetopt.h
@@ -28,6 +28,8 @@
#define APPLY_OPTVAR_REPLACEMENTS 1
#endif
+#define HAVE_OPTIND 1
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -38,7 +40,7 @@ extern "C" {
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
-extern char *optarg;
+extern char __declspec(dllimport) *optarg;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
@@ -52,16 +54,16 @@ extern char *optarg;
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
-extern int optind;
+extern int __declspec(dllimport) optind;
/* Callers store zero here to inhibit the error message `getopt' prints
for unrecognized options. */
-extern int opterr;
+extern int __declspec(dllimport) opterr;
/* Set to an option character which was unrecognized. */
-extern int optopt;
+extern int __declspec(dllimport) optopt;
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
diff --git a/src/getopt.c b/src/getopt.c
index 57326ac..1f9d74f 100644
--- a/src/getopt.c
+++ b/src/getopt.c
@@ -32,13 +32,13 @@
#undef optind
#ifdef HAVE_OPTIND
-extern char* optarg;
+extern char __declspec(dllimport) *optarg;
#else
char *optarg = 0;
#endif
#ifdef HAVE_OPTIND
-extern int optind;
+extern int __declspec(dllimport) optind;
#else
int optind = 0;
#endif
@@ -46,13 +46,13 @@ int optind = 0;
static char *nextchar;
#ifdef HAVE_OPTIND
-extern int opterr;
+extern int __declspec(dllimport) opterr;
#else
int opterr = 1;
#endif
#ifdef HAVE_OPTIND
-extern int optint;
+extern int __declspec(dllimport) optint;
#else
int optopt = '?';
#endif
diff --git a/src/hexcurse.c b/src/hexcurse.c
index e723ddc..b7d3625 100644
--- a/src/hexcurse.c
+++ b/src/hexcurse.c
@@ -173,8 +173,8 @@ void printDebug(hexList *head, long int loc)
\********************************************************/
off_t parseArgs(int argc, char *argv[])
{
- extern char *optarg; /* extern vars for */
- extern int optind, /*opterr,*/ optopt; /* getopt() */
+ extern char __declspec(dllimport) *optarg; /* extern vars for */
+ extern int __declspec(dllimport) optind, /*opterr,*/ optopt; /* getopt() */
int val; /* counters, etc. */