From a0c61aeb8d456c1ab528dd1746a08a6bb209eb85 Mon Sep 17 00:00:00 2001 From: awiouy Date: Mon, 5 Sep 2016 23:13:44 +0200 Subject: [PATCH 1/3] mc: initial package --- .../system-tools-depends/mc/package.mk | 63 +++++++++++++++++++ .../mc/patches/mc-01-netbsd-curses.patch | 50 +++++++++++++++ .../mc/patches/mc-02-netbsd-curses.patch | 27 ++++++++ 3 files changed, 140 insertions(+) create mode 100644 packages/addons/addon-depends/system-tools-depends/mc/package.mk create mode 100644 packages/addons/addon-depends/system-tools-depends/mc/patches/mc-01-netbsd-curses.patch create mode 100644 packages/addons/addon-depends/system-tools-depends/mc/patches/mc-02-netbsd-curses.patch diff --git a/packages/addons/addon-depends/system-tools-depends/mc/package.mk b/packages/addons/addon-depends/system-tools-depends/mc/package.mk new file mode 100644 index 0000000000..d1c5dcf6f8 --- /dev/null +++ b/packages/addons/addon-depends/system-tools-depends/mc/package.mk @@ -0,0 +1,63 @@ +################################################################################ +# This file is part of LibreELEC - https://libreelec.tv +# Copyright (C) 2016 Team LibreELEC +# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +PKG_NAME="mc" +PKG_VERSION="4.8.17" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="http://www.midnight-commander.org" +PKG_URL="http://ftp.midnight-commander.org/${PKG_NAME}-${PKG_VERSION}.tar.xz" +PKG_DEPENDS_TARGET="toolchain libtool:host gettext:host glib pcre netbsd-curses" +PKG_PRIORITY="optional" +PKG_SECTION="tools" +PKG_SHORTDESC="mc: visual file manager" +PKG_LONGDESC="mc is a visual file manager, licensed under GNU General Public License and therefore qualifies as Free Software. It's a feature rich full-screen text mode application that allows you to copy, move and delete files and whole directory trees, search for files and run commands in the subshell. Internal viewer and editor are included" + +PKG_AUTORECONF="yes" +PKG_IS_ADDON="no" + +PKG_CONFIGURE_OPTS_TARGET="--sysconfdir=/storage/.kodi/addons/virtual.system-tools/etc \ + --datadir=/storage/.kodi/addons/virtual.system-tools/data \ + --libdir=/storage/.kodi/addons/virtual.system-tools/mclib \ + --disable-mclib \ + --disable-aspell \ + --disable-vfs \ + --disable-doxygen-doc \ + --disable-doxygen-dot \ + --disable-doxygen-html \ + --with-sysroot=$SYSROOT_PREFIX \ + --with-screen=ncurses \ + --without-x \ + --with-gnu-ld \ + --without-libiconv-prefix \ + --without-libintl-prefix \ + --with-internal-edit \ + --without-diff-viewer \ + --with-subshell" + +pre_configure_target() { + export CFLAGS="$CFLAGS -I$SYSROOT_PREFIX/usr/include/ncurses" + export LDFLAGS="$(echo $LDFLAGS | sed -e "s|-Wl,--as-needed||") -ltermcap" +} + +post_makeinstall_target() { + rm -rf $INSTALL/storage/.kodi/addons/virtual.system-tools/data/locale + rm -rf $INSTALL/storage/.kodi/addons/virtual.system-tools/data/mc/help/mc.hlp.* +} diff --git a/packages/addons/addon-depends/system-tools-depends/mc/patches/mc-01-netbsd-curses.patch b/packages/addons/addon-depends/system-tools-depends/mc/patches/mc-01-netbsd-curses.patch new file mode 100644 index 0000000000..112ed0fe89 --- /dev/null +++ b/packages/addons/addon-depends/system-tools-depends/mc/patches/mc-01-netbsd-curses.patch @@ -0,0 +1,50 @@ +From 38d4c655d322837574e957b4a824f4a0d1bb3b86 Mon Sep 17 00:00:00 2001 +From: rofl0r +Date: Mon, 18 Jul 2016 22:19:56 +0100 +Subject: [PATCH] Ticket #3665: fix compatibility with netbsd curses. + +The code that manipulates the ncurses backend into changing +the key combination to generate SIGINT from CTRL-c to CTRL-g does +so by accessing undocumented internal ncurses data structures. +This breaks compilation with netbsd-curses[0], and could also break +when the ncurses author decides to change internal structures in a +future release. + +Fix it by using a portable approach that works everywhere using libc +primitives instead. + +[0] https://github.com/sabotage-linux/netbsd-curses + +Signed-off-by: Andrew Borodin +--- + lib/tty/tty-ncurses.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/lib/tty/tty-ncurses.c b/lib/tty/tty-ncurses.c +index efee8ec..76a21d2 100644 +--- a/lib/tty/tty-ncurses.c ++++ b/lib/tty/tty-ncurses.c +@@ -179,6 +179,7 @@ mc_tty_normalize_lines_char (const char *ch) + void + tty_init (gboolean mouse_enable, gboolean is_xterm) + { ++ struct termios mode; + initscr (); + + #ifdef HAVE_ESCDELAY +@@ -194,11 +195,12 @@ tty_init (gboolean mouse_enable, gboolean is_xterm) + ESCDELAY = 200; + #endif /* HAVE_ESCDELAY */ + ++ tcgetattr (STDIN_FILENO, &mode); + /* use Ctrl-g to generate SIGINT */ +- cur_term->Nttyb.c_cc[VINTR] = CTRL ('g'); /* ^g */ ++ mode.c_cc[VINTR] = CTRL ('g'); /* ^g */ + /* disable SIGQUIT to allow use Ctrl-\ key */ +- cur_term->Nttyb.c_cc[VQUIT] = NULL_VALUE; +- tcsetattr (cur_term->Filedes, TCSANOW, &cur_term->Nttyb); ++ mode.c_cc[VQUIT] = NULL_VALUE; ++ tcsetattr (STDIN_FILENO, TCSANOW, &mode); + + tty_start_interrupt_key (); + diff --git a/packages/addons/addon-depends/system-tools-depends/mc/patches/mc-02-netbsd-curses.patch b/packages/addons/addon-depends/system-tools-depends/mc/patches/mc-02-netbsd-curses.patch new file mode 100644 index 0000000000..eb09de4174 --- /dev/null +++ b/packages/addons/addon-depends/system-tools-depends/mc/patches/mc-02-netbsd-curses.patch @@ -0,0 +1,27 @@ +From 2da86f2595157c68c2d49e6c2b08a508750878ed Mon Sep 17 00:00:00 2001 +From: Andrew Borodin +Date: Tue, 9 Aug 2016 16:55:12 +0300 +Subject: [PATCH] Define NCURSES_CONST if curses library doesn't define it. + +Signed-off-by: Andrew Borodin +--- + lib/tty/tty-ncurses.h | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/lib/tty/tty-ncurses.h b/lib/tty/tty-ncurses.h +index 4f0e603..9962c7c 100644 +--- a/lib/tty/tty-ncurses.h ++++ b/lib/tty/tty-ncurses.h +@@ -20,6 +20,11 @@ + #include + #endif /* USE_NCURSESW */ + ++/* netbsd-libcurses doesn't define NCURSES_CONST */ ++#ifndef NCURSES_CONST ++#define NCURSES_CONST const ++#endif ++ + /*** typedefs(not structures) and defined constants **********************************************/ + + /*** enums ***************************************************************************************/ + From e72ef38de806cbc98c056e4cb8e9067793be58b1 Mon Sep 17 00:00:00 2001 From: awiouy Date: Mon, 5 Sep 2016 23:14:29 +0200 Subject: [PATCH 2/3] system-tools: add inotify-tools, mc --- packages/addons/tools/system-tools/changelog.txt | 3 +++ packages/addons/tools/system-tools/package.mk | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/packages/addons/tools/system-tools/changelog.txt b/packages/addons/tools/system-tools/changelog.txt index f8b4ca0a83..6d5a4b8c85 100644 --- a/packages/addons/tools/system-tools/changelog.txt +++ b/packages/addons/tools/system-tools/changelog.txt @@ -1,3 +1,6 @@ +8.0.102 +-Add inotify-tools, mc + 8.0.101 - mrxvt can be started from KODI - correct mrxvt terminal type diff --git a/packages/addons/tools/system-tools/package.mk b/packages/addons/tools/system-tools/package.mk index 5a6239abc9..dcb2c73116 100644 --- a/packages/addons/tools/system-tools/package.mk +++ b/packages/addons/tools/system-tools/package.mk @@ -18,7 +18,7 @@ PKG_NAME="system-tools" PKG_VERSION="" -PKG_REV="101" +PKG_REV="102" PKG_ARCH="any" PKG_LICENSE="GPL" PKG_SITE="" @@ -27,7 +27,7 @@ PKG_DEPENDS_TARGET="toolchain" PKG_PRIORITY="optional" PKG_SECTION="virtual" PKG_SHORTDESC="A bundle of system tools and programs" -PKG_LONGDESC="This bundle currently includes autossh, diffutils, dtach, efibootmgr, evtest, fdupes, file, getscancodes, hddtemp, hd-idle, hid_mapper, i2c-tools, jq, lm_sensors, lshw, mrxvt, mtpfs, p7zip, patch, pv, screen, strace, unrar and usb-modeswitch." +PKG_LONGDESC="This bundle currently includes autossh, diffutils, dtach, efibootmgr, evtest, fdupes, file, getscancodes, hddtemp, hd-idle, hid_mapper, i2c-tools, inotify-tools, jq, lm_sensors, lshw, mc, mrxvt, mtpfs, p7zip, patch, pv, screen, strace, unrar and usb-modeswitch." PKG_IS_ADDON="yes" PKG_ADDON_NAME="System Tools" @@ -50,9 +50,11 @@ PKG_DEPENDS_TARGET="toolchain \ hd-idle \ hid_mapper \ i2c-tools \ + inotify-tools \ jq \ lm_sensors \ lshw \ + mc \ mrxvt \ mtpfs \ p7zip \ @@ -112,6 +114,10 @@ addon() { cp -P $(get_build_dir i2c-tools)/tools/i2cset $ADDON_BUILD/$PKG_ADDON_ID/bin cp -P $(get_build_dir i2c-tools)/py-smbus/build/lib.linux-*/smbus.so $ADDON_BUILD/$PKG_ADDON_ID/lib + # inotify-tools + cp -P $(get_build_dir inotify-tools)/.$TARGET_NAME/src/inotifywait $ADDON_BUILD/$PKG_ADDON_ID/bin + cp -P $(get_build_dir inotify-tools)/.$TARGET_NAME/src/inotifywatch $ADDON_BUILD/$PKG_ADDON_ID/bin + # jq cp -P $(get_build_dir jq)/.$TARGET_NAME/jq $ADDON_BUILD/$PKG_ADDON_ID/bin @@ -121,6 +127,10 @@ addon() { # lshw cp -P $(get_build_dir lshw)/src/lshw $ADDON_BUILD/$PKG_ADDON_ID/bin + # mc + cp -Pa $(get_build_dir mc)/.install_pkg/usr/bin/* $ADDON_BUILD/$PKG_ADDON_ID/bin/ + cp -Pa $(get_build_dir mc)/.install_pkg/storage/.kodi/addons/virtual.system-tools/* $ADDON_BUILD/$PKG_ADDON_ID + # mrxvt cp -P $(get_build_dir mrxvt)/.$TARGET_NAME/src/mrxvt $ADDON_BUILD/$PKG_ADDON_ID/bin 2>/dev/null || : From 6c313c708c435f72208141ea2a76eaaf3bb3ca46 Mon Sep 17 00:00:00 2001 From: awiouy Date: Fri, 9 Sep 2016 21:07:58 +0200 Subject: [PATCH 3/3] inotify-tools: initial package --- .../inotify-tools/package.mk | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 packages/addons/addon-depends/system-tools-depends/inotify-tools/package.mk diff --git a/packages/addons/addon-depends/system-tools-depends/inotify-tools/package.mk b/packages/addons/addon-depends/system-tools-depends/inotify-tools/package.mk new file mode 100644 index 0000000000..2940079d2a --- /dev/null +++ b/packages/addons/addon-depends/system-tools-depends/inotify-tools/package.mk @@ -0,0 +1,39 @@ +################################################################################ +# This file is part of LibreELEC - http://www.libreelec.tv +# Copyright (C) 2016 Team LibreELEC +# +# LibreELEC is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 2 of the License, or +# (at your option) any later version. +# +# LibreELEC is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LibreELEC. If not, see . +################################################################################ + +PKG_NAME="inotify-tools" +PKG_VERSION="1df9af4" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="GPLv2" +PKG_SITE="http://wiki.github.com/rvoicilas/inotify-tools/" +PKG_URL="https://github.com/rvoicilas/$PKG_NAME/archive/$PKG_VERSION.tar.gz" +PKG_DEPENDS_TARGET="toolchain" +PKG_PRIORITY="optional" +PKG_SECTION="tools" +PKG_SHORTDESC="inotify-tools" +PKG_LONGDESC="a C library and a set of command-line programs for Linux providing a simple interface to inotify" +PKG_AUTORECONF="yes" + +PKG_IS_ADDON="no" + +PKG_CONFIGURE_OPTS_TARGET="--enable-static --disable-shared" + +makeinstall_target() { + : nothing to do +}