Skip to contentSkip to conversation

python-ranger: new package

PATCH Superseded Thijs Vermeir 2 participants 3 messages Oct 21, 2015 – Oct 23, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v4 1/1 python-ranger: new package

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

---
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
package/Config.in +1 -0
index 7392363..0e9c30c 100644
@@ -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
package/ranger/0001-colorscheme-check-for-compiled-python-files.patch new file +31 -0
new file mode 100644
index 0000000..bde3fee
@@ -0,0 +1,31 @@
+From 654e3116825c4d12340613196279fb13a5662113 Mon Sep 17 00:00:00 2001
+From: Thijs Vermeir <[email protected]>
+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 <[email protected]>
+---
+ 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
+
package/ranger/Config.in new file +15 -0
new file mode 100644
index 0000000..9a2c60c
@@ -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
package/ranger/ranger.hash new file +1 -0
new file mode 100644
index 0000000..989d76e
@@ -0,0 +1 @@
+sha256 80917c93396e46272b6de63816d925eb708291a9f7a559d49b24c571ea0eeeb3 ranger-1.7.2.tar.gz
package/ranger/ranger.mk new file +26 -0
new file mode 100644
index 0000000..46f318b
@@ -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))
Signature · 1 line
2.1.0
#1 lore raw

PATCH v4 1/1 python-ranger: new package

Quoted 7 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thijs" == Thijs Vermeir <[email protected]> writes:

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.

Quoted 7 lines

http://ranger.nongnu.org

---
Changes v3 -> v4:
- rename python-ranger -> ranger

But you forgot to change the subject ;)

package/ranger/Config.in line 13

Quoted 13 lines
package/ranger/Config.in new file +13 -0
+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.

Help text should be wrapped to ~72 chars so menuconfig displays correctly in a 80 chars window.

package/ranger/ranger.hash line 1

Quoted 9 lines
package/ranger/Config.in new file +2 -0
+
+	  http://ranger.nongnu.org
package/ranger/ranger.hash new file +1 -0
new file mode 100644
index 0000000..989d76e
@@ -0,0 +1 @@
+sha256 80917c93396e46272b6de63816d925eb708291a9f7a559d49b24c571ea0eeeb3 ranger-1.7.2.tar.gz

We normally add a comment explaining where the hash comes from (Locally calculated in this case).

Quoted 6 lines
package/ranger/ranger.mk new file +0 -0
new file mode 100644
index 0000000..46f318b

package/ranger/ranger.mk line 8

Quoted 8 lines
package/ranger/ranger.mk new file +8 -0
@@ -0,0 +1,26 @@
+################################################################################
+#
+# ranger
+#
+################################################################################
+
+RANGER_VERSION = 1.7.2
+RANGER_SITE = $(call github,hut,ranger,v$(RANGER_VERSION))

I see that there's tarballs with gpg signatures on ranger.nongnu.org, so I've changed to use that instead (and used the signature to validate the hash).

Committed with these fixes, thanks!

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw

PATCH v4 1/1 python-ranger: new package

Hi,

Quoted 4 lines · Peter Korsgaard
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thijs" == Thijs Vermeir <[email protected]> writes:

...

Committed with these fixes, thanks!

Thanks, for reviewing!

Gr,
Thijs