mg: add new package/microscopic emacs style editor
For Emacsian! You can use "Dired", which is Emacsian's favorite. You can also use "re-search". Signed-off-by: Hirokazu MORIKAWA <morikw2@gmail.com>
This commit is contained in:
parent
211d3d1a3e
commit
41b1b08115
4 changed files with 201 additions and 0 deletions
42
utils/mg/Makefile
Normal file
42
utils/mg/Makefile
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
# This is free software, licensed under the GNU General Public License v2.
|
||||||
|
# See /LICENSE for more information.
|
||||||
|
#
|
||||||
|
|
||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=mg
|
||||||
|
PKG_VERSION:=20180927
|
||||||
|
PKG_RELEASE:=1
|
||||||
|
|
||||||
|
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||||
|
PKG_SOURCE_URL:=https://github.com/ibara/mg/releases/download/mg-20180927
|
||||||
|
PKG_HASH:=99b2fd2cf9d6474153d6c5769c818dd5514c147b8a8ad660a5e114bc1ebd504d
|
||||||
|
|
||||||
|
PKG_MAINTAINER:=Hirokazu MORIKAWA <morikw2@gmail.com>
|
||||||
|
PKG_LICENSE:=PUBLICDOMAIN ISC BSD VARIOUS
|
||||||
|
PKG_LICENSE_FILES:=README.md
|
||||||
|
|
||||||
|
include $(INCLUDE_DIR)/package.mk
|
||||||
|
|
||||||
|
define Package/mg
|
||||||
|
SECTION:=utils
|
||||||
|
CATEGORY:=Utilities
|
||||||
|
DEPENDS:=+libncurses +libpcre
|
||||||
|
TITLE:=microscopic EMACS style editor
|
||||||
|
URL:=https://github.com/ibara/mg
|
||||||
|
SUBMENU:=Editors
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/mg/description
|
||||||
|
Mg is intended to be a small, fast, and portable editor for people who
|
||||||
|
can't (or don't want to) run emacs for one reason or another, or are not
|
||||||
|
familiar with the vi editor. It is compatible with emacs because there
|
||||||
|
shouldn't be any reason to learn more editor types than emacs or vi.
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/mg/install
|
||||||
|
$(INSTALL_DIR) $(1)/usr/bin
|
||||||
|
$(INSTALL_BIN) $(PKG_BUILD_DIR)/mg $(1)/usr/bin/
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,mg))
|
135
utils/mg/patches/001-cross_compile_openwrt.patch
Normal file
135
utils/mg/patches/001-cross_compile_openwrt.patch
Normal file
|
@ -0,0 +1,135 @@
|
||||||
|
--- a/configure
|
||||||
|
+++ b/configure
|
||||||
|
@@ -3,53 +3,6 @@
|
||||||
|
# This configure script written by Brian Callahan <bcallah@openbsd.org>
|
||||||
|
# and released into the Public Domain.
|
||||||
|
|
||||||
|
-cccheck() {
|
||||||
|
- if [ ! -z "$CC" ] ; then
|
||||||
|
-cat << EOF > conftest.c
|
||||||
|
-int main(void){return 0;}
|
||||||
|
-EOF
|
||||||
|
- $CC -o conftest conftest.c > /dev/null 2>&1
|
||||||
|
- if [ $? -eq 0 ] ; then
|
||||||
|
- ./conftest
|
||||||
|
- if [ $? -eq 0 ] ; then
|
||||||
|
- rm -f conftest conftest.c
|
||||||
|
- cc="$CC"
|
||||||
|
- return 0
|
||||||
|
- else
|
||||||
|
- echo "could not build working executables"
|
||||||
|
- echo "Please ensure your C compiler is a native compiler"
|
||||||
|
- exit 1
|
||||||
|
- fi
|
||||||
|
- else
|
||||||
|
- rm -f conftest conftest.c
|
||||||
|
- fi
|
||||||
|
- fi
|
||||||
|
-
|
||||||
|
- for compiler in cc clang pcc xlc gcc ; do
|
||||||
|
-cat << EOF > conftest.c
|
||||||
|
-int main(void){return 0;}
|
||||||
|
-EOF
|
||||||
|
-
|
||||||
|
- $compiler -o conftest conftest.c > /dev/null 2>&1
|
||||||
|
-
|
||||||
|
- if [ $? -eq 0 ] ; then
|
||||||
|
- ./conftest
|
||||||
|
- if [ $? -eq 0 ] ; then
|
||||||
|
- rm -f conftest conftest.c
|
||||||
|
- cc="$compiler"
|
||||||
|
- return 0
|
||||||
|
- else
|
||||||
|
- echo "could not build working executables"
|
||||||
|
- echo "Please ensure your C compiler is a native compiler"
|
||||||
|
- exit 1
|
||||||
|
- fi
|
||||||
|
- else
|
||||||
|
- rm -f conftest conftest.c
|
||||||
|
- fi
|
||||||
|
- done
|
||||||
|
- return 1
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
fgetlncheck() {
|
||||||
|
cat << EOF > conftest.c
|
||||||
|
#include <stdio.h>
|
||||||
|
@@ -162,21 +115,6 @@
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
-wflagcheck() {
|
||||||
|
- cat << EOF > conftest.c
|
||||||
|
-int main(void){return 0;}
|
||||||
|
-EOF
|
||||||
|
- $cc -w -o conftest conftest.c > /dev/null 2> conftest.err
|
||||||
|
- grep ':' conftest.err > /dev/null 2>&1
|
||||||
|
- if [ $? -eq 0 ] ; then
|
||||||
|
- rm -f conftest conftest.err conftest.c
|
||||||
|
- return 1
|
||||||
|
- else
|
||||||
|
- rm -f conftest conftest.err conftest.c
|
||||||
|
- return 0
|
||||||
|
- fi
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
# Option variables
|
||||||
|
if [ ! -z "$PREFIX" ] ; then
|
||||||
|
prefix="$PREFIX"
|
||||||
|
@@ -241,53 +179,9 @@
|
||||||
|
ldflags="${ldflags}-static"
|
||||||
|
fi
|
||||||
|
|
||||||
|
-printf "checking for C compiler... "
|
||||||
|
-cccheck
|
||||||
|
-if [ $? -ne 0 ] ; then
|
||||||
|
- echo "not found"
|
||||||
|
- echo "Please install a C compiler and re-run configure."
|
||||||
|
- exit 1
|
||||||
|
-else
|
||||||
|
- echo "$cc"
|
||||||
|
-fi
|
||||||
|
-
|
||||||
|
-printf "checking for -w compiler flag... "
|
||||||
|
-wflagcheck
|
||||||
|
-if [ $? -ne 0 ] ; then
|
||||||
|
- echo "no"
|
||||||
|
-else
|
||||||
|
- cflags="$cflags -w"
|
||||||
|
- echo "yes"
|
||||||
|
-fi
|
||||||
|
-
|
||||||
|
-printf "checking for OS... "
|
||||||
|
-libs='-lncurses'
|
||||||
|
-os=`uname -s`
|
||||||
|
-echo "$os"
|
||||||
|
-
|
||||||
|
-case "x$os" in
|
||||||
|
- "xLinux"|"xCYGWIN"*)
|
||||||
|
- cflags="$cflags -D_GNU_SOURCE -D__dead=\"__attribute__((__noreturn__))\" -Dst_mtimespec=st_mtim"
|
||||||
|
- ;;
|
||||||
|
- "xDarwin")
|
||||||
|
- cflags="$cflags -DMSG_NOSIGNAL=SO_NOSIGPIPE -DLOGIN_NAME_MAX=MAXLOGNAME"
|
||||||
|
- libs="$libs -lutil"
|
||||||
|
- ;;
|
||||||
|
- "xFreeBSD")
|
||||||
|
- cflags="$cflags -D__dead=__dead2 -DLOGIN_NAME_MAX=MAXLOGNAME"
|
||||||
|
- libs="$libs -lutil"
|
||||||
|
- ;;
|
||||||
|
- "xOpenBSD")
|
||||||
|
- libs="$libs -lutil"
|
||||||
|
- ;;
|
||||||
|
- "xNetBSD")
|
||||||
|
- libs="$libs -lutil"
|
||||||
|
- ;;
|
||||||
|
- "xDragonFly")
|
||||||
|
- cflags="$cflags -D__dead=__dead2 -DLOGIN_NAME_MAX=MAXLOGNAME"
|
||||||
|
- libs="$libs -lutil"
|
||||||
|
- ;;
|
||||||
|
-esac
|
||||||
|
+# OpenWrt
|
||||||
|
+libs='-lncurses -lpcre'
|
||||||
|
+cflags="$cflags -D_GNU_SOURCE -D__dead=\"__attribute__((__noreturn__))\" -Dst_mtimespec=st_mtim"
|
||||||
|
|
||||||
|
cat << EOF > config.h
|
||||||
|
/* This file generated automatically by configure. */
|
13
utils/mg/patches/900-musl_compatibility.patch
Normal file
13
utils/mg/patches/900-musl_compatibility.patch
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
--- a/fileio.c
|
||||||
|
+++ b/fileio.c
|
||||||
|
@@ -23,6 +23,10 @@
|
||||||
|
#include <string.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
+#ifndef DEFFILEMODE
|
||||||
|
+#define DEFFILEMODE (S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#include "def.h"
|
||||||
|
#include "kbd.h"
|
||||||
|
#include "pathnames.h"
|
11
utils/mg/patches/901-use_pcre.patch
Normal file
11
utils/mg/patches/901-use_pcre.patch
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
--- a/re_search.c
|
||||||
|
+++ b/re_search.c
|
||||||
|
@@ -16,7 +16,7 @@
|
||||||
|
#ifdef REGEX
|
||||||
|
#include <sys/queue.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
-#include <regex.h>
|
||||||
|
+#include <pcreposix.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
Loading…
Reference in a new issue