From 07c344f1a7572d18bf57911506b8252e25f74540 Mon Sep 17 00:00:00 2001 From: Hirokazu MORIKAWA Date: Tue, 4 Jun 2019 13:55:47 +0900 Subject: [PATCH] mg: update to 6.5 Signed-off-by: Hirokazu MORIKAWA --- utils/mg/Makefile | 9 +- .../patches/001-cross_compile_openwrt.patch | 82 +++++++++++++++---- 2 files changed, 69 insertions(+), 22 deletions(-) diff --git a/utils/mg/Makefile b/utils/mg/Makefile index 268c0e568..13c6d6443 100644 --- a/utils/mg/Makefile +++ b/utils/mg/Makefile @@ -5,12 +5,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=mg -PKG_VERSION:=20180927 -PKG_RELEASE:=2 +PKG_VERSION:=6.5 +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_SOURCE_URL:=https://codeload.github.com/ibara/mg/tar.gz/$(PKG_NAME)-$(PKG_VERSION)? +PKG_HASH:=c18ab048c192921b5f826885b4087f3e82ec4272dce2e7ed7cde051cd0acf375 +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_NAME)-$(PKG_VERSION) PKG_MAINTAINER:=Hirokazu MORIKAWA PKG_LICENSE:=PUBLICDOMAIN ISC BSD VARIOUS diff --git a/utils/mg/patches/001-cross_compile_openwrt.patch b/utils/mg/patches/001-cross_compile_openwrt.patch index cd33355a4..67c611682 100644 --- a/utils/mg/patches/001-cross_compile_openwrt.patch +++ b/utils/mg/patches/001-cross_compile_openwrt.patch @@ -1,7 +1,7 @@ diff -urN a/configure b/configure ---- a/configure 2018-09-28 01:38:31.000000000 +0900 -+++ b/configure 2019-05-22 15:17:05.722101952 +0900 -@@ -3,52 +3,7 @@ +--- a/configure 2019-03-03 22:17:03.000000000 +0900 ++++ b/configure 2019-06-04 13:08:41.418919319 +0900 +@@ -3,51 +3,21 @@ # This configure script written by Brian Callahan # and released into the Public Domain. @@ -50,12 +50,25 @@ diff -urN a/configure b/configure - fi - done - return 1 --} +cc="$CC" ++ ++fgetlncheck() { ++ cat << EOF > conftest.c ++#include ++int main(void){fgetln(NULL,NULL);return 0;} ++EOF ++ $cc $tflags -o conftest conftest.c > /dev/null 2>&1 ++ if [ $? -eq 0 ] ; then ++ rm -f conftest conftest.c ++ return 0 ++ else ++ rm -f conftest conftest.c ++ return 1 ++ fi + } - fgetlncheck() { - cat << EOF > conftest.c -@@ -162,18 +117,19 @@ + fparselncheck() { +@@ -211,18 +181,19 @@ fi } @@ -83,7 +96,7 @@ diff -urN a/configure b/configure fi } -@@ -241,53 +197,9 @@ +@@ -290,54 +261,9 @@ ldflags="${ldflags}-static" fi @@ -127,6 +140,7 @@ diff -urN a/configure b/configure - libs="$libs -lutil" - ;; - "xNetBSD") +- cflags="$cflags -D_OPENBSD_SOURCE" - libs="$libs -lutil" - ;; - "xDragonFly") @@ -135,24 +149,56 @@ diff -urN a/configure b/configure - ;; -esac +# OpenWrt -+libs='-lncurses -lpcre' ++libs='-lncurses -lpcreposix' +cflags="$cflags -D_GNU_SOURCE -D__dead=\"__attribute__((__noreturn__))\" -Dst_mtimespec=st_mtim" cat << EOF > config.h /* This file generated automatically by configure. */ -@@ -370,6 +282,15 @@ - echo "no" - fi +@@ -357,6 +283,15 @@ + + EOF -+printf "checking for futimens... " -+futimenscheck ++printf "checking for fgetln... " ++fgetlncheck +if [ $? -eq 0 ] ; then -+ echo "#define HAVE_FUTIMENS" >> config.h ++ echo "#define HAVE_FGETLN" >> config.h + echo "yes" +else + echo "no" +fi + - printf "creating Makefile... " - cat << EOF > Makefile - # This Makefile automatically generated by configure. + printf "checking for fparseln... " + fparselncheck + if [ $? -eq 0 ] ; then +diff -urN a/fparseln.c b/fparseln.c +--- a/fparseln.c 2019-03-03 22:17:03.000000000 +0900 ++++ b/fparseln.c 2019-06-04 13:05:38.815543338 +0900 +@@ -74,6 +74,8 @@ + #include "util.h" + #endif + ++#ifndef HAVE_FGETLN ++ + static char * + fgetln(FILE *fp, size_t *len) + { +@@ -119,6 +121,8 @@ + return buf; + } + ++#endif /* !HAVE_FGETLN */ ++ + static int isescaped(const char *, const char *, int); + + /* isescaped(): +diff -urN a/linux.h b/linux.h +--- a/linux.h 2019-03-03 22:17:03.000000000 +0900 ++++ b/linux.h 2019-06-04 13:45:21.787063324 +0900 +@@ -7,6 +7,7 @@ + #endif + #include + ++#include + #include + + /* Defines */