-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
30 changed files
with
527 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
include $(TOPDIR)/rules.mk | ||
|
||
GO_VERSION_MAJOR_MINOR:=1.21 | ||
GO_VERSION_PATCH:=3 | ||
GO_VERSION_PATCH:=4 | ||
|
||
PKG_NAME:=golang | ||
PKG_VERSION:=$(GO_VERSION_MAJOR_MINOR)$(if $(GO_VERSION_PATCH),.$(GO_VERSION_PATCH)) | ||
|
@@ -21,7 +21,7 @@ GO_SOURCE_URLS:=https://dl.google.com/go/ \ | |
|
||
PKG_SOURCE:=go$(PKG_VERSION).src.tar.gz | ||
PKG_SOURCE_URL:=$(GO_SOURCE_URLS) | ||
PKG_HASH:=186f2b6f8c8b704e696821b09ab2041a5c1ee13dcbc3156a13adcf75931ee488 | ||
PKG_HASH:=47b26a83d2b65a3c1c1bcace273b69bee49a7a7b5168a7604ded3d26a37bd787 | ||
|
||
PKG_MAINTAINER:=Jeffery To <[email protected]> | ||
PKG_LICENSE:=BSD-3-Clause | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# | ||
# Copyright (C) 2023 Jeffery To | ||
# | ||
# This is free software, licensed under the GNU General Public License v2. | ||
# See /LICENSE for more information. | ||
# | ||
|
||
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=pipx | ||
PKG_VERSION:=1.2.1 | ||
PKG_RELEASE:=1 | ||
|
||
PYPI_NAME:=pipx | ||
PKG_HASH:=698777c05a97cca81df4dc6a71d9ca4ece2184c6f91dc7a0e4802ac51d86d32a | ||
|
||
PKG_LICENSE:=MIT | ||
PKG_LICENSE_FILES:=LICENSE | ||
PKG_MAINTAINER:=Jeffery To <[email protected]> | ||
|
||
PKG_BUILD_DEPENDS:=python-hatchling/host | ||
|
||
include ../pypi.mk | ||
include $(INCLUDE_DIR)/package.mk | ||
include ../python3-package.mk | ||
|
||
define Package/pipx | ||
SECTION:=lang | ||
CATEGORY:=Languages | ||
SUBMENU:=Python | ||
TITLE:=Install/Run Python Applications in Isolated Environments | ||
URL:=https://github.com/pypa/pipx | ||
DEPENDS:= \ | ||
+python3-light \ | ||
+python3-logging \ | ||
+python3-urllib \ | ||
+python3-venv \ | ||
+python3-argcomplete \ | ||
+python3-packaging \ | ||
+python3-userpath | ||
endef | ||
|
||
define Package/pipx/description | ||
pipx is a tool to help you install and run end-user applications written | ||
in Python. It's roughly similar to macOS's brew, JavaScript's npx, and | ||
Linux's apt. | ||
|
||
It's closely related to pip. In fact, it uses pip, but is focused on | ||
installing and managing Python packages that can be run from the command | ||
line directly as applications. | ||
endef | ||
|
||
$(eval $(call Py3Package,pipx)) | ||
$(eval $(call BuildPackage,pipx)) | ||
$(eval $(call BuildPackage,pipx-src)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
[ "$1" = pipx ] || exit 0 | ||
|
||
pipx --version | grep -Fx "$PKG_VERSION" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# | ||
# Copyright (C) 2023 Jeffery To | ||
# | ||
# This is free software, licensed under the GNU General Public License v2. | ||
# See /LICENSE for more information. | ||
# | ||
|
||
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=python-argcomplete | ||
PKG_VERSION:=3.1.4 | ||
PKG_RELEASE:=1 | ||
|
||
PYPI_NAME:=argcomplete | ||
PKG_HASH:=72558ba729e4c468572609817226fb0a6e7e9a0a7d477b882be168c0b4a62b94 | ||
|
||
PKG_LICENSE:=Apache-2.0 | ||
PKG_LICENSE_FILES:=LICENSE.rst | ||
PKG_MAINTAINER:=Jeffery To <[email protected]> | ||
|
||
PKG_BUILD_DEPENDS:=python-setuptools-scm/host | ||
|
||
include ../pypi.mk | ||
include $(INCLUDE_DIR)/package.mk | ||
include ../python3-package.mk | ||
|
||
define Package/python3-argcomplete | ||
SECTION:=lang | ||
CATEGORY:=Languages | ||
SUBMENU:=Python | ||
TITLE:=Bash tab completion for argparse | ||
URL:=https://github.com/kislyuk/argcomplete | ||
DEPENDS:=+python3-light | ||
endef | ||
|
||
define Package/python3-argcomplete/description | ||
Argcomplete provides easy, extensible command line tab completion of | ||
arguments for your Python application. | ||
endef | ||
|
||
$(eval $(call Py3Package,python3-argcomplete)) | ||
$(eval $(call BuildPackage,python3-argcomplete)) | ||
$(eval $(call BuildPackage,python3-argcomplete-src)) |
9 changes: 9 additions & 0 deletions
9
lang/python/python-argcomplete/patches/001-unpin-setuptools.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- a/pyproject.toml | ||
+++ b/pyproject.toml | ||
@@ -1,5 +1,5 @@ | ||
[build-system] | ||
-requires = ["setuptools>=67.7.2", "setuptools_scm[toml]>=6.2"] | ||
+requires = ["setuptools", "setuptools_scm[toml]>=6.2"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
[ "$1" = python3-argcomplete ] || exit 0 | ||
|
||
python3 -c 'import argcomplete' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,11 +6,11 @@ | |
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=python-mako | ||
PKG_VERSION:=1.2.4 | ||
PKG_VERSION:=1.3.0 | ||
PKG_RELEASE:=1 | ||
|
||
PYPI_NAME:=Mako | ||
PKG_HASH:=d60a3903dc3bb01a18ad6a89cdbe2e4eadc69c0bc8ef1e3773ba53d44c3f7a34 | ||
PKG_HASH:=e3a9d388fd00e87043edbe8792f45880ac0114e9c4adc69f6e9bfb2c55e3b11b | ||
|
||
PKG_MAINTAINER:=Jeffery To <[email protected]> | ||
PKG_LICENSE:=MIT | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# | ||
# Copyright (C) 2023 Jeffery To | ||
# | ||
# This is free software, licensed under the GNU General Public License v2. | ||
# See /LICENSE for more information. | ||
# | ||
|
||
include $(TOPDIR)/rules.mk | ||
|
||
PKG_NAME:=python-userpath | ||
PKG_VERSION:=1.9.1 | ||
PKG_RELEASE:=1 | ||
|
||
PYPI_NAME:=userpath | ||
PKG_HASH:=ce8176728d98c914b6401781bf3b23fccd968d1647539c8788c7010375e02796 | ||
|
||
PKG_LICENSE:=MIT | ||
PKG_LICENSE_FILES:=LICENSE.txt | ||
PKG_MAINTAINER:=Jeffery To <[email protected]> | ||
|
||
PKG_BUILD_DEPENDS:=python-hatchling/host | ||
|
||
include ../pypi.mk | ||
include $(INCLUDE_DIR)/package.mk | ||
include ../python3-package.mk | ||
|
||
define Package/python3-userpath | ||
SECTION:=lang | ||
CATEGORY:=Languages | ||
SUBMENU:=Python | ||
TITLE:=Cross-platform tool for modifying a user's PATH | ||
URL:=https://github.com/ofek/userpath | ||
DEPENDS:=+python3-light +python3-click +python3-psutil | ||
endef | ||
|
||
define Package/python3-userpath/description | ||
This is a tool for modifying a user's PATH. | ||
endef | ||
|
||
$(eval $(call Py3Package,python3-userpath)) | ||
$(eval $(call BuildPackage,python3-userpath)) | ||
$(eval $(call BuildPackage,python3-userpath-src)) |
31 changes: 31 additions & 0 deletions
31
...python/python-userpath/patches/0001-Handle-OSErrors-when-running-show-path-commands.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
From 9175a0a97c7bc2eeb995e53d50a07be6a7e834f0 Mon Sep 17 00:00:00 2001 | ||
From: Jeffery To <[email protected]> | ||
Date: Thu, 9 Nov 2023 14:20:58 +0800 | ||
Subject: [PATCH] Handle OSErrors when running show path commands | ||
|
||
Bash may not always be installed, for example on OpenWrt, and attempting | ||
to call the show path commands for Bash will cause a FileNotFoundError | ||
to be raised. | ||
|
||
This wraps the subprocess call with a try statement and returns the | ||
empty string in the case of an OSError. | ||
--- | ||
userpath/utils.py | 7 +++++-- | ||
1 file changed, 5 insertions(+), 2 deletions(-) | ||
|
||
--- a/userpath/utils.py | ||
+++ b/userpath/utils.py | ||
@@ -30,8 +30,11 @@ def ensure_parent_dir_exists(path): | ||
|
||
|
||
def get_flat_output(command, sep=os.pathsep, **kwargs): | ||
- process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) | ||
- output = process.communicate()[0].decode(locale.getpreferredencoding(False)).strip() | ||
+ try: | ||
+ process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, **kwargs) | ||
+ output = process.communicate()[0].decode(locale.getpreferredencoding(False)).strip() | ||
+ except OSError: | ||
+ return '' | ||
|
||
# We do this because the output may contain new lines. | ||
lines = [line.strip() for line in output.splitlines()] |
89 changes: 89 additions & 0 deletions
89
lang/python/python-userpath/patches/0001-Use-Sh-as-base-class-for-Bash-and-Zsh.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
From dffcc1c5823bcce10b420467db41e42ec41f4702 Mon Sep 17 00:00:00 2001 | ||
From: Jeffery To <[email protected]> | ||
Date: Thu, 9 Nov 2023 17:48:50 +0800 | ||
Subject: [PATCH 1/2] Use Sh as base class for Bash and Zsh | ||
|
||
--- | ||
userpath/shells.py | 41 ++++++++++++++++++++++++++--------------- | ||
1 file changed, 26 insertions(+), 15 deletions(-) | ||
|
||
--- a/userpath/shells.py | ||
+++ b/userpath/shells.py | ||
@@ -12,24 +12,36 @@ class Shell(object): | ||
|
||
|
||
class Sh(Shell): | ||
- def config(self, location, front=True): | ||
+ name = 'sh' | ||
+ | ||
+ def _config_contents(self, location, front=True): | ||
head, tail = (location, '$PATH') if front else ('$PATH', location) | ||
new_path = '{}{}{}'.format(head, pathsep, tail) | ||
+ return 'export PATH="{}"'.format(new_path) | ||
+ | ||
+ def config(self, location, front=True): | ||
+ contents = self._config_contents(location, front=front) | ||
+ return {path.join(self.home, '.profile'): contents} | ||
|
||
- return {path.join(self.home, '.profile'): 'PATH="{}"'.format(new_path)} | ||
+ @classmethod | ||
+ def _interactive_show_path_command(cls): | ||
+ return [cls.name, '-i', '-c', 'echo $PATH'] | ||
+ | ||
+ @classmethod | ||
+ def _interactive_login_show_path_command(cls): | ||
+ return [cls.name, '-i', '-l', '-c', 'echo $PATH'] | ||
|
||
@classmethod | ||
def show_path_commands(cls): | ||
# TODO: Find out what file influences non-login shells. The issue may simply be our Docker setup. | ||
- return [['sh', '-i', '-l', '-c', 'echo $PATH']] | ||
+ return [cls._interactive_login_show_path_command()] | ||
|
||
|
||
-class Bash(Shell): | ||
- def config(self, location, front=True): | ||
- head, tail = (location, '$PATH') if front else ('$PATH', location) | ||
- new_path = '{}{}{}'.format(head, pathsep, tail) | ||
- contents = 'export PATH="{}"'.format(new_path) | ||
+class Bash(Sh): | ||
+ name = 'bash' | ||
|
||
+ def config(self, location, front=True): | ||
+ contents = self._config_contents(location, front=front) | ||
configs = {path.join(self.home, '.bashrc'): contents} | ||
|
||
# https://github.com/ofek/userpath/issues/3#issuecomment-492491977 | ||
@@ -50,7 +62,7 @@ class Bash(Shell): | ||
|
||
@classmethod | ||
def show_path_commands(cls): | ||
- return [['bash', '-i', '-c', 'echo $PATH'], ['bash', '-i', '-l', '-c', 'echo $PATH']] | ||
+ return [cls._interactive_show_path_command(), cls._interactive_login_show_path_command()] | ||
|
||
|
||
class Fish(Shell): | ||
@@ -88,18 +100,17 @@ class Xonsh(Shell): | ||
return [['xonsh', '-i', '-c', command], ['xonsh', '-i', '--login', '-c', command]] | ||
|
||
|
||
-class Zsh(Shell): | ||
- def config(self, location, front=True): | ||
- head, tail = (location, '$PATH') if front else ('$PATH', location) | ||
- new_path = '{}{}{}'.format(head, pathsep, tail) | ||
- contents = 'export PATH="{}"'.format(new_path) | ||
+class Zsh(Sh): | ||
+ name = 'zsh' | ||
|
||
+ def config(self, location, front=True): | ||
+ contents = self._config_contents(location, front=front) | ||
zdotdir = environ.get('ZDOTDIR', self.home) | ||
return {path.join(zdotdir, '.zshrc'): contents, path.join(zdotdir, '.zprofile'): contents} | ||
|
||
@classmethod | ||
def show_path_commands(cls): | ||
- return [['zsh', '-i', '-c', 'echo $PATH'], ['zsh', '-i', '-l', '-c', 'echo $PATH']] | ||
+ return [cls._interactive_show_path_command(), cls._interactive_login_show_path_command()] | ||
|
||
|
||
SHELLS = { |
Oops, something went wrong.