From patchwork Wed Oct 21 19:09:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thijs Vermeir X-Patchwork-Id: 534009 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 47D4F14017E for ; Thu, 22 Oct 2015 06:10:24 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=S8jg2mGx; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5B4589CD3E; Wed, 21 Oct 2015 19:10:23 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pBbPMEsZegxU; Wed, 21 Oct 2015 19:10:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5A8FB95D63; Wed, 21 Oct 2015 19:10:21 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 635AD1C11BB for ; Wed, 21 Oct 2015 19:10:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 5E9FE8C401 for ; Wed, 21 Oct 2015 19:10:20 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TZ-fbzeQzKUD for ; Wed, 21 Oct 2015 19:10:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by whitealder.osuosl.org (Postfix) with ESMTPS id D26EA88D58 for ; Wed, 21 Oct 2015 19:10:15 +0000 (UTC) Received: by wijp11 with SMTP id p11so109713119wij.0 for ; Wed, 21 Oct 2015 12:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=n7zNr1WxDz5Nm47ZVeG/na6mgyXONJCIZd9zReY/1W8=; b=S8jg2mGxRlPLlf3My57KLJXS0+m3k+3vVZackqRVeaoLgU5BwPDh/Nw6kFb8UjXP+w t9lr2Dhn52NE/R6Ehbpsf5Tg2kysH755BqNDYQTS4ZU74NwUjTA5XKCe2ux0I9bI6f8O f4o1T9UVtmCH3ces7MnAQ7PBfhVVsr66w+2TcOnClJ52ttFsCGa3k+0CcBbjAG9WgIaT d7itMpgXkJ19AjziTK7v11L49/L91MbrxN+7HHraUPOiT9WiBpgRFTpPzDLGO1vJloax Z/sdpns+an8Xdobo2BF6prU8hDSX7qeIwFLFjQs88STJd+N9O+vo+sIrqNc/s2eLnCjh p6EQ== X-Received: by 10.180.186.98 with SMTP id fj2mr37307361wic.58.1445454614511; Wed, 21 Oct 2015 12:10:14 -0700 (PDT) Received: from localhost.localdomain (178-116-211-102.access.telenet.be. [178.116.211.102]) by smtp.gmail.com with ESMTPSA id wz5sm12157864wjc.20.2015.10.21.12.10.13 (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 21 Oct 2015 12:10:13 -0700 (PDT) From: Thijs Vermeir To: buildroot@buildroot.org Date: Wed, 21 Oct 2015 21:09:18 +0200 Message-Id: <1445454558-16326-1-git-send-email-thijsvermeir@gmail.com> X-Mailer: git-send-email 2.6.1 Subject: [Buildroot] [PATCH v4] python-ranger: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" ranger is a console file manager with VI key bindings. It provides a minimalistic and nice curses interface with a view on the directory hierarchy. It ships with "rifle", a file launcher that is good at automatically finding out which program to use for what file type. http://ranger.nongnu.org Signed-off-by: Thijs Vermeir --- Changes v3 -> v4: - rename python-ranger -> ranger - move to Shell and Utilities - select python3 if needed Changes v2 -> v3: - add LICENSE_FILES Changes v1 -> v2: - use upstream documented patch for detecting .pyc files - signed-off patches - select curses package depending on python version - documented post patch hook - remove host-python-package - add sha256 hash --- package/Config.in | 1 + ...lorscheme-check-for-compiled-python-files.patch | 31 ++++++++++++++++++++++ package/ranger/Config.in | 15 +++++++++++ package/ranger/ranger.hash | 1 + package/ranger/ranger.mk | 26 ++++++++++++++++++ 5 files changed, 74 insertions(+) create mode 100644 package/ranger/0001-colorscheme-check-for-compiled-python-files.patch create mode 100644 package/ranger/Config.in create mode 100644 package/ranger/ranger.hash create mode 100644 package/ranger/ranger.mk diff --git a/package/Config.in b/package/Config.in index 7392363..0e9c30c 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1456,6 +1456,7 @@ comment "Utilities" source "package/logrotate/Config.in" source "package/logsurfer/Config.in" source "package/pinentry/Config.in" + source "package/ranger/Config.in" source "package/screen/Config.in" source "package/sudo/Config.in" if BR2_PACKAGE_BUSYBOX_SHOW_OTHERS diff --git a/package/ranger/0001-colorscheme-check-for-compiled-python-files.patch b/package/ranger/0001-colorscheme-check-for-compiled-python-files.patch new file mode 100644 index 0000000..bde3fee --- /dev/null +++ b/package/ranger/0001-colorscheme-check-for-compiled-python-files.patch @@ -0,0 +1,31 @@ +From 654e3116825c4d12340613196279fb13a5662113 Mon Sep 17 00:00:00 2001 +From: Thijs Vermeir +Date: Tue, 20 Oct 2015 18:13:36 +0200 +Subject: [PATCH] colorscheme: check for compiled python files + +Some systems only provide *.pyc files + +Patch accepted upstream: +https://github.com/hut/ranger/commit/d69f1ed3207c785d1a39ddd2992f6abb021b7540 + +Signed-off-by: Thijs Vermeir +--- + ranger/gui/colorscheme.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/ranger/gui/colorscheme.py b/ranger/gui/colorscheme.py +index d6afcac..d2b3b2d 100644 +--- a/ranger/gui/colorscheme.py ++++ b/ranger/gui/colorscheme.py +@@ -86,7 +86,7 @@ def _colorscheme_name_to_class(signal): + usecustom = not ranger.arg.clean + + def exists(colorscheme): +- return os.path.exists(colorscheme + '.py') ++ return os.path.exists(colorscheme + '.py') or os.path.exists(colorscheme + '.pyc') + + def is_scheme(x): + try: +-- +2.6.1 + diff --git a/package/ranger/Config.in b/package/ranger/Config.in new file mode 100644 index 0000000..9a2c60c --- /dev/null +++ b/package/ranger/Config.in @@ -0,0 +1,15 @@ +config BR2_PACKAGE_RANGER + bool "ranger" + depends on BR2_USE_MMU # python3 + depends on BR2_TOOLCHAIN_HAS_THREADS # python3 + depends on !BR2_STATIC_LIBS # python3 + select BR2_PACKAGE_PYTHON3 if !BR2_PACKAGE_PYTHON + select BR2_PACKAGE_PYTHON_CURSES if BR2_PACKAGE_PYTHON + select BR2_PACKAGE_PYTHON3_CURSES if BR2_PACKAGE_PYTHON3 + help + ranger is a console file manager with VI key bindings. It provides a + minimalistic and nice curses interface with a view on the directory hierarchy. + It ships with "rifle", a file launcher that is good at automatically finding + out which program to use for what file type. + + http://ranger.nongnu.org diff --git a/package/ranger/ranger.hash b/package/ranger/ranger.hash new file mode 100644 index 0000000..989d76e --- /dev/null +++ b/package/ranger/ranger.hash @@ -0,0 +1 @@ +sha256 80917c93396e46272b6de63816d925eb708291a9f7a559d49b24c571ea0eeeb3 ranger-1.7.2.tar.gz diff --git a/package/ranger/ranger.mk b/package/ranger/ranger.mk new file mode 100644 index 0000000..46f318b --- /dev/null +++ b/package/ranger/ranger.mk @@ -0,0 +1,26 @@ +################################################################################ +# +# ranger +# +################################################################################ + +RANGER_VERSION = 1.7.2 +RANGER_SITE = $(call github,hut,ranger,v$(RANGER_VERSION)) +RANGER_SETUP_TYPE = distutils +RANGER_LICENSE = GPLv3 +RANGER_LICENSE_FILES = AUTHORS + +# The ranger script request python to be called with -O (optimize generated +# bytecode slightly; also PYTHONOPTIMIZE=x). This implicitly requires the python +# source files to be present. Therefore, the -O flag is removed when only the .pyc +# files are installed. + +define RANGER_DO_NOT_GENERATE_BYTECODE_AT_RUNTIME + $(SED) 's%/usr/bin/python -O%/usr/bin/python%g' $(@D)/scripts/ranger +endef + +ifeq ($(BR2_PACKAGE_PYTHON3_PYC_ONLY)$(BR2_PACKAGE_PYTHON_PYC_ONLY),y) +RANGER_POST_PATCH_HOOKS += RANGER_DO_NOT_GENERATE_BYTECODE_AT_RUNTIME +endif + +$(eval $(python-package))