From d0b3033883e1226ab8d3a77c274037f4cca18105 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 9 Nov 2008 17:31:25 +0000 Subject: [PATCH] Add mg from #2398 git-svn-id: svn://svn.openwrt.org/openwrt/packages@13157 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- utils/mg/Makefile | 56 +++++++++++++++++++++++++++++++++++++++++++ utils/mg/patches/100-mg.patch | 30 +++++++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 utils/mg/Makefile create mode 100644 utils/mg/patches/100-mg.patch diff --git a/utils/mg/Makefile b/utils/mg/Makefile new file mode 100644 index 000000000..94366df43 --- /dev/null +++ b/utils/mg/Makefile @@ -0,0 +1,56 @@ +# +# Copyright (C) 2008 OpenWrt.org +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# +# $Id: $ + +include $(TOPDIR)/rules.mk + +PKG_NAME:=mg +PKG_VERSION:=20070529 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=http://www.xs4all.nl/~hanb/software/mg +PKG_MD5SUM:=e1eaef5a61143c12a66e23deaa369e76 + +include $(INCLUDE_DIR)/package.mk + +define Package/mg + SECTION:=utils + CATEGORY:=Utilities + DEPENDS:=+libncurses + TITLE:=microscopic GNU Emacs-style editor + URL:=http://www.xs4all.nl/~hanb/software/mg/ +endef + +define Package/mg/description + This program is intended to be a small, fast, and portable + editor for people who can't (or don't want to) run real + Emacs for one reason or another. It is compatible with GNU + because there shouldn't be any reason to learn more than + one Emacs flavor. +endef + +define Build/Configure + (cd $(PKG_BUILD_DIR); \ + $(TARGET_CONFIGURE_OPTS) \ + ./configure \ + ); +endef + +define Build/Compile + $(MAKE) -C $(PKG_BUILD_DIR) \ + LDFLAGS="$(TARGET_LDFLAGS) -lncurses" \ + CFLAGS="$(TARGET_CFLAGS) -I$(STAGING_DIR)/usr/include -I$(STAGING_DIR)/include" \ + CC=$(TARGET_CC) +endef + +define Package/mg/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_BUILD_DIR)/$(PKG_NAME) $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,mg)) diff --git a/utils/mg/patches/100-mg.patch b/utils/mg/patches/100-mg.patch new file mode 100644 index 000000000..c83ec3ea0 --- /dev/null +++ b/utils/mg/patches/100-mg.patch @@ -0,0 +1,30 @@ +--- mg-20070529.orig/sysdef.h 2006-08-01 16:34:08.000000000 -0700 ++++ mg-20070529/sysdef.h 2007-09-16 15:07:53.000000000 -0700 +@@ -20,9 +20,10 @@ + + /* necesarry to get asprintf & friends with glibc XXX doesn't work for some + * mysterious reason! */ +-/* #ifdef __GLIBC__ */ +-/* # define _GNU_SOURCE */ +-/* #endif */ ++#ifdef __GLIBC__ ++# define _GNU_SOURCE ++# define _USE_GNU ++#endif + #include + + #include +@@ -56,13 +57,6 @@ + extern size_t strlcat(char *, const char *, size_t); + #endif + +-/* Manpage says: #define _GNU_SOURCE, does that work? No! */ +-#ifdef __GLIBC__ +-extern int asprintf (char **, const char *, ...); +-extern int vasprintf (char **, const char *, _G_va_list); +-#endif +- +- + /* not provided by glibc stdio.h */ + #ifdef HAVE_NOFGETLN + extern char * fgetln(FILE *, size_t *); -- 2.11.0