Merge pull request #11872 from jefferyto/python3-makefile-cleanup

python3: Makefile cleanup
This commit is contained in:
Hannu Nyman 2020-04-20 20:05:07 +03:00 committed by GitHub
commit 6c2235253f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 294 additions and 314 deletions

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=nyx
PKG_VERSION:=2.1.0
PKG_RELEASE:=1
PKG_RELEASE:=2
PYPI_NAME:=nyx
PKG_HASH:=88521488d1c9052e457b9e66498a4acfaaa3adf3adc5a199892632f129a5390b
@ -21,7 +21,6 @@ define Package/nyx
URL:=https://nyx.torproject.org/
TITLE:=Terminal status monitor for Tor
DEPENDS:=+python3 +python3-stem
VARIANT:=python3
endef
define Package/nyx/description

View File

@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=asu
PKG_VERSION:=0.2.3
PKG_RELEASE=2
PKG_RELEASE:=3
PKG_LICENSE:=GPL-3.0
@ -37,7 +37,6 @@ define Package/asu
+gunicorn3 +python3-openssl +python3-pyodbc +python3-yaml \
+libustream-mbedtls +ca-certificates +gnupg
USERID:=asu:asu
VARIANT:=python3
endef
define Package/asu/description

View File

@ -2,7 +2,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=meson
PKG_VERSION:=0.54.0
PKG_RELEASE:=1
PKG_RELEASE:=2
PYPI_NAME:=meson
PKG_HASH:=dde5726d778112acbd4a67bb3633ab2ee75d33d1e879a6283a7b4a44c3363c27
@ -40,7 +40,6 @@ define Package/meson
TITLE:=meson
URL:=https://mesonbuild.com/
DEPENDS:=+ninja +python3-pkg-resources
VARIANT:=python3
endef
define Package/meson/description

View File

@ -66,7 +66,7 @@ define Package/gunicorn3/install
$(PKG_INSTALL_DIR)/usr/bin/gunicorn \
$(1)/usr/bin/gunicorn3
$(LN) gunicorn3 $(1)/usr/bin/gunicorn
$(call Py3Shebang,$(1)/usr/bin/*)
$(call Python3/FixShebang,$(1)/usr/bin/*)
endef
$(eval $(call Py3Package,python3-gunicorn))

View File

@ -50,7 +50,7 @@ Python 3.3, Python 3.4, or PyPy.
endef
define Py3Build/Compile
$(call Build/Compile/Py3Mod,,\
$(call Python3/ModSetup,,\
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
)
endef

View File

@ -48,7 +48,7 @@ endef
TARGET_LDFLAGS += -lxml2 -lxslt -lexslt
define Py3Build/Compile
$(call Build/Compile/Py3Mod,, \
$(call Python3/ModSetup,, \
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
--static \
--single-version-externally-managed \

View File

@ -1,11 +1,6 @@
#!/bin/sh
set -e
[ -z "$SOURCE_DATE_EPOCH" ] || {
PYTHONHASHSEED="$SOURCE_DATE_EPOCH"
export PYTHONHASHSEED
}
process_filespec() {
local src_dir="$1"
local dst_dir="$2"
@ -40,56 +35,11 @@ process_filespec() {
)
}
delete_empty_dirs() {
local dst_dir="$1"
if [ -d "$dst_dir/usr" ] ; then
find "$dst_dir/usr" -empty -type d -delete
fi
}
ver="$1"
src_dir="$2"
dst_dir="$3"
python="$4"
mode="$5"
filespec="$6"
find "$src_dir" -name "*.exe" -delete
src_dir="$1"
dst_dir="$2"
filespec="$3"
process_filespec "$src_dir" "$dst_dir" "$filespec" || {
echo "process filespec error-ed"
exit 1
}
if [ "$mode" == "sources" ] ; then
# Copy only python source files
find "$dst_dir" -not -type d -not -name "*.py" -delete
delete_empty_dirs "$dst_dir"
exit 0
fi
if [ "$ver" == "3" ] ; then
legacy="-b"
fi
# default max recursion is 10
max_recursion_level=20
# XXX [So that you won't goof as I did]
# Note: Yes, I tried to use the -O & -OO flags here.
# However the generated byte-codes were not portable.
# So, we just stuck to un-optimized byte-codes,
# which is still way better/faster than running
# Python sources all the time.
$python -m compileall -r "$max_recursion_level" $legacy -d '/' "$dst_dir" || {
echo "python -m compileall err-ed"
exit 1
}
# Delete source files and pyc [ un-optimized bytecode files ]
# We may want to make this optimization thing configurable later, but not sure atm
find "$dst_dir" -type f -name "*.py" -delete
delete_empty_dirs "$dst_dir"
exit 0

View File

@ -49,7 +49,7 @@ documentation for more information on what is provided.
endef
define Host/Compile
$(call Build/Compile/HostPy3Mod,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
$(call HostPython3/ModSetup,,install --prefix="" --root="$(STAGING_DIR_HOSTPKG)")
endef
Host/Install:=

View File

@ -5,12 +5,9 @@
# See /LICENSE for more information.
#
# Note: include this after `include $(TOPDIR)/rules.mk in your package Makefile
# Note: include this file after `include $(TOPDIR)/rules.mk in your package Makefile
# if `python3-package.mk` is included, this will already be included
ifneq ($(__python3_host_mk_inc),1)
__python3_host_mk_inc=1
# For PYTHON3_VERSION
python3_mk_path:=$(dir $(lastword $(MAKEFILE_LIST)))
include $(python3_mk_path)python3-version.mk
@ -25,23 +22,7 @@ HOST_PYTHON3_BIN:=$(HOST_PYTHON3_DIR)/bin/python$(PYTHON3_VERSION)
HOST_PYTHON3PATH:=$(HOST_PYTHON3_LIB_DIR):$(HOST_PYTHON3_PKG_DIR)
define HostPython3
if [ "$(strip $(3))" == "HOST" ]; then \
export PYTHONPATH="$(HOST_PYTHON3PATH)"; \
export PYTHONDONTWRITEBYTECODE=0; \
else \
export PYTHONPATH="$(PYTHON3PATH)"; \
export PYTHONDONTWRITEBYTECODE=1; \
export _python_sysroot="$(STAGING_DIR)"; \
export _python_prefix="/usr"; \
export _python_exec_prefix="/usr"; \
fi; \
export PYTHONOPTIMIZE=""; \
$(1) \
$(HOST_PYTHON3_BIN) $(2);
endef
define host_python3_settings
HOST_PYTHON3_VARS = \
ARCH="$(HOST_ARCH)" \
CC="$(HOSTCC)" \
CCSHARED="$(HOSTCC) $(HOST_FPIC)" \
@ -51,30 +32,27 @@ define host_python3_settings
CFLAGS="$(HOST_CFLAGS)" \
CPPFLAGS="$(HOST_CPPFLAGS) -I$(HOST_PYTHON3_INC_DIR)" \
LDFLAGS="$(HOST_LDFLAGS) -lpython$(PYTHON3_VERSION) -Wl$(comma)-rpath=$(STAGING_DIR_HOSTPKG)/lib" \
_PYTHON_HOST_PLATFORM=linux2
endef
_PYTHON_HOST_PLATFORM=linux2 \
PYTHONPATH="$(HOST_PYTHON3PATH)" \
PYTHONDONTWRITEBYTECODE=0 \
PYTHONOPTIMIZE=""
# $(1) => commands to execute before running pythons script
# $(1) => directory of python script
# $(2) => python script and its arguments
# $(3) => additional variables
define Build/Compile/HostPy3RunHost
$(call HostPython3, \
$(if $(1),$(1);) \
$(call host_python3_settings) \
$(3) \
, \
$(2) \
, \
HOST \
)
define HostPython3/Run
cd "$(if $(strip $(1)),$(strip $(1)),.)" && \
$(HOST_PYTHON3_VARS) \
$(3) \
$(HOST_PYTHON3_BIN) $(2)
endef
# Note: I shamelessly copied this from Yousong's logic (from python-packages);
HOST_PYTHON3_PIP:=$(STAGING_DIR_HOSTPKG)/bin/pip$(PYTHON3_VERSION)
# $(1) => packages to install
define Build/Compile/HostPy3PipInstall
$(call host_python3_settings) \
define HostPython3/PipInstall
$(HOST_PYTHON3_VARS) \
$(HOST_PYTHON3_PIP) \
--disable-pip-version-check \
--cache-dir "$(DL_DIR)/pip-cache" \
@ -85,11 +63,9 @@ endef
# $(1) => build subdir
# $(2) => additional arguments to setup.py
# $(3) => additional variables
define Build/Compile/HostPy3Mod
$(call Build/Compile/HostPy3RunHost, \
cd $(HOST_BUILD_DIR)/$(strip $(1)), \
./setup.py $(2), \
define HostPython3/ModSetup
$(call HostPython3/Run, \
$(HOST_BUILD_DIR)/$(strip $(1)), \
setup.py $(2), \
$(3))
endef
endif # __python3_host_mk_inc

View File

@ -5,12 +5,12 @@
# See /LICENSE for more information.
#
# Note: include this after `include $(TOPDIR)/rules.mk in your package Makefile
# Note: include this file after `include $(TOPDIR)/rules.mk in your package Makefile
python3_mk_path:=$(dir $(lastword $(MAKEFILE_LIST)))
include $(python3_mk_path)python3-host.mk
PYTHON3_DIR:=$(STAGING_DIR)/usr
PYTHON3_BIN_DIR:=$(PYTHON3_DIR)/bin
PYTHON3_INC_DIR:=$(PYTHON3_DIR)/include/python$(PYTHON3_VERSION)
PYTHON3_LIB_DIR:=$(PYTHON3_DIR)/lib/python$(PYTHON3_VERSION)
@ -27,19 +27,106 @@ CONFIGURE_ARGS += \
_python_prefix="/usr" \
_python_exec_prefix="/usr"
PKG_USE_MIPS16:=0
# This is required in addition to PKG_USE_MIPS16:=0 because otherwise MIPS16
# flags are inherited from the Python base package (via sysconfig module)
ifdef CONFIG_USE_MIPS16
TARGET_CFLAGS += -mno-mips16 -mno-interlink-mips16
endif
PYTHON3_VARS = \
CC="$(TARGET_CC)" \
CCSHARED="$(TARGET_CC) $(FPIC)" \
CXX="$(TARGET_CXX)" \
LD="$(TARGET_CC)" \
LDSHARED="$(TARGET_CC) -shared" \
CFLAGS="$(TARGET_CFLAGS)" \
CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR)" \
LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON3_VERSION)" \
_PYTHON_HOST_PLATFORM=linux2 \
__PYVENV_LAUNCHER__="/usr/bin/$(PYTHON3)" \
PYTHONPATH="$(PYTHON3PATH)" \
PYTHONDONTWRITEBYTECODE=1 \
PYTHONOPTIMIZE="" \
_python_sysroot="$(STAGING_DIR)" \
_python_prefix="/usr" \
_python_exec_prefix="/usr"
define Py3Shebang
$(SED) "1"'!'"b;s,^#"'!'".*python.*,#"'!'"/usr/bin/python3," -i --follow-symlinks $(1)
# $(1) => directory of python script
# $(2) => python script and its arguments
# $(3) => additional variables
define Python3/Run
cd "$(if $(strip $(1)),$(strip $(1)),.)" && \
$(PYTHON3_VARS) \
$(3) \
$(HOST_PYTHON3_BIN) $(2)
endef
# $(1) => build subdir
# $(2) => additional arguments to setup.py
# $(3) => additional variables
define Python3/ModSetup
$(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
$(call Python3/Run, \
$(PKG_BUILD_DIR)/$(strip $(1)), \
setup.py $(2), \
$(3))
endef
define Python3/FixShebang
$(SED) "1"'!'"b;s,^#"'!'".*python.*,#"'!'"/usr/bin/python3," -i --follow-symlinks $(1)
endef
# default max recursion is 10
PYTHON3_COMPILEALL_MAX_RECURSION_LEVEL:=20
# $(1) => directory of python source files to compile
#
# XXX [So that you won't goof as I did]
# Note: Yes, I tried to use the -O & -OO flags here.
# However the generated byte-codes were not portable.
# So, we just stuck to un-optimized byte-codes,
# which is still way better/faster than running
# Python sources all the time.
#
# Setting a fixed hash seed value is less secure than using
# random seed values, but is necessary for reproducible builds
# (for now).
#
# Should revisit this when https://bugs.python.org/issue37596
# (and other related reproducibility issues) are fixed.
define Python3/CompileAll
$(call Python3/Run,, \
-m compileall -r "$(PYTHON3_COMPILEALL_MAX_RECURSION_LEVEL)" -b -d '/' $(1),
$(if $(SOURCE_DATE_EPOCH),PYTHONHASHSEED="$(SOURCE_DATE_EPOCH)")
)
endef
# $(1) => target directory
define Python3/DeleteSourceFiles
$(FIND) $(1) -type f -name '*.py' -delete
endef
# $(1) => target directory
define Python3/DeleteNonSourceFiles
$(FIND) $(1) -not -type d -not -name '*.py' -delete
endef
# $(1) => target directory
define Python3/DeleteEmptyDirs
$(FIND) $(1) -mindepth 1 -empty -type d -not -path '$(1)/CONTROL' -not -path '$(1)/CONTROL/*' -delete
endef
# Py3Package
define Py3Package/filespec/Default
+|$(PYTHON3_PKG_DIR)
endef
# $(1) => package name
# $(2) => src directory
# $(3) => dest directory
define Py3Package/ProcessFilespec
$(eval $(call shexport,Py3Package/$(1)/filespec))
$(SHELL) $(python3_mk_path)python-package-install.sh \
"$(2)" "$(3)" "$$$$$(call shvar,Py3Package/$(1)/filespec)"
endef
define Py3Package
define Package/$(1)-src
$(call Package/$(1))
DEPENDS:=
@ -52,8 +139,9 @@ define Py3Package
endef
define Package/$(1)-src/description
$(call Package/$(1)/description).
(Contains the Python3 sources for this package).
$$(call Package/$(1)/description)
This package contains the Python source files for $(1).
endef
define Package/$(1)-src/config
@ -61,73 +149,43 @@ define Py3Package
endef
# Add default PyPackage filespec none defined
ifndef Py3Package/$(1)/filespec
define Py3Package/$(1)/filespec
+|$(PYTHON3_PKG_DIR)
endef
ifeq ($(origin Py3Package/$(1)/filespec),undefined)
Py3Package/$(1)/filespec=$$(Py3Package/filespec/Default)
endif
ifndef Py3Package/$(1)/install
define Py3Package/$(1)/install
if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \
$(INSTALL_DIR) $$(1)/usr/bin ; \
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/ ; \
fi
if [ -d $(PKG_INSTALL_DIR)/usr/bin ]; then \
$(INSTALL_DIR) $$(1)/usr/bin ; \
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $$(1)/usr/bin/ ; \
fi
endef
endif
ifndef Package/$(1)/install
$(call shexport,Py3Package/$(1)/filespec)
define Package/$(1)/install
define Package/$(1)/install
$$(call Py3Package/$(1)/install,$$(1))
$(SHELL) $(python3_mk_path)python-package-install.sh "3" \
"$(PKG_INSTALL_DIR)" "$$(1)" \
"$(HOST_PYTHON3_BIN)" "$$(2)" \
"$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)" && \
if [ -d "$$(1)/usr/bin" ]; then \
$(call Py3Shebang,$$(1)/usr/bin/*) ; \
$$(call Py3Package/ProcessFilespec,$(1),$(PKG_INSTALL_DIR),$$(1))
$(FIND) $$(1) -name '*.exe' -delete
$$(call Python3/CompileAll,$$(1))
$$(call Python3/DeleteSourceFiles,$$(1))
$$(call Python3/DeleteEmptyDirs,$$(1))
if [ -d "$$(1)/usr/bin" ]; then \
$$(call Python3/FixShebang,$$(1)/usr/bin/*) ; \
fi
endef
endef
define Package/$(1)-src/install
$$(call Package/$(1)/install,$$(1),sources)
endef
define Package/$(1)-src/install
$$(call Py3Package/$(1)/install,$$(1))
$$(call Py3Package/ProcessFilespec,$(1),$(PKG_INSTALL_DIR),$$(1))
$$(call Python3/DeleteNonSourceFiles,$$(1))
$$(call Python3/DeleteEmptyDirs,$$(1))
endef
endif # Package/$(1)/install
endef
# $(1) => commands to execute before running pythons script
# $(2) => python script and its arguments
# $(3) => additional variables
define Build/Compile/HostPy3RunTarget
$(call HostPython3, \
$(if $(1),$(1);) \
CC="$(TARGET_CC)" \
CCSHARED="$(TARGET_CC) $(FPIC)" \
CXX="$(TARGET_CXX)" \
LD="$(TARGET_CC)" \
LDSHARED="$(TARGET_CC) -shared" \
CFLAGS="$(TARGET_CFLAGS)" \
CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR)" \
LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON3_VERSION)" \
_PYTHON_HOST_PLATFORM=linux2 \
__PYVENV_LAUNCHER__="/usr/bin/$(PYTHON3)" \
$(3) \
, \
$(2) \
)
endef
# $(1) => build subdir
# $(2) => additional arguments to setup.py
# $(3) => additional variables
define Build/Compile/Py3Mod
$(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
$(call Build/Compile/HostPy3RunTarget, \
cd $(PKG_BUILD_DIR)/$(strip $(1)), \
./setup.py $(2), \
$(3))
endef
# Py3Build
PYTHON3_PKG_SETUP_DIR ?=
PYTHON3_PKG_SETUP_GLOBAL_ARGS ?=
@ -136,9 +194,9 @@ PYTHON3_PKG_SETUP_VARS ?=
define Py3Build/Compile/Default
$(if $(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS),
$(call Build/Compile/HostPy3PipInstall,$(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS))
$(call HostPython3/PipInstall,$(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS))
)
$(call Build/Compile/Py3Mod, \
$(call Python3/ModSetup, \
$(PYTHON3_PKG_SETUP_DIR), \
$(PYTHON3_PKG_SETUP_GLOBAL_ARGS) \
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)" \
@ -149,8 +207,8 @@ endef
Py3Build/Compile=$(Py3Build/Compile/Default)
ifeq ($(BUILD_VARIANT),python3)
define Build/Compile
$(call Py3Build/Compile)
endef
endif # python3
PYTHON3_PKG_BUILD ?= 1
ifeq ($(strip $(PYTHON3_PKG_BUILD)),1)
Build/Compile=$(Py3Build/Compile)
endif

View File

@ -101,13 +101,13 @@ HOST_PYTHON3_PIP_INSTALL_CLEANUP:=$(call HOST_PYTHON3_PIP_INSTALL,$(PKG_INSTALL_
define Build/Compile
$(foreach pkg,$(CONFIG_PACKAGE_python3-packages-list-host),
$(call Build/Compile/HostPy3RunHost,,$(HOST_PYTHON3_PIP_INSTALL_HOST) $(pkg))
$(call HostPython3/Run,,$(HOST_PYTHON3_PIP_INSTALL_HOST) $(pkg))
)
$(foreach pkg,$(CONFIG_PACKAGE_python3-packages-list),
$(call Build/Compile/HostPy3RunTarget,,$(call HOST_PYTHON3_PIP_INSTALL_TARGET,$(pkg)) $(pkg),$(CONFIG_PACKAGE_python3-packages-envs))
$(call Python3/Run,,$(call HOST_PYTHON3_PIP_INSTALL_TARGET,$(pkg)) $(pkg),$(CONFIG_PACKAGE_python3-packages-envs))
)
$(foreach pkg,$(CONFIG_PACKAGE_python3-packages-list-cleanup),
$(call Build/Compile/HostPy3RunTarget,,$(HOST_PYTHON3_PIP_INSTALL_CLEANUP) $(pkg),$(CONFIG_PACKAGE_python3-packages-envs))
$(call Python3/Run,,$(HOST_PYTHON3_PIP_INSTALL_CLEANUP) $(pkg),$(CONFIG_PACKAGE_python3-packages-envs))
)
endef

View File

@ -7,15 +7,12 @@
include $(TOPDIR)/rules.mk
# The file included below defines PYTHON_VERSION
# The file included below defines PYTHON3_VERSION
include ../python3-version.mk
PYTHON_VERSION:=$(PYTHON3_VERSION)
PYTHON_VERSION_MICRO:=$(PYTHON3_VERSION_MICRO)
PKG_NAME:=python3
PKG_RELEASE:=2
PKG_VERSION:=$(PYTHON_VERSION).$(PYTHON_VERSION_MICRO)
PKG_VERSION:=$(PYTHON3_VERSION).$(PYTHON3_VERSION_MICRO)
PKG_SOURCE:=Python-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=https://www.python.org/ftp/python/$(PKG_VERSION)
@ -30,6 +27,7 @@ PKG_CPE_ID:=cpe:/a:python:python
include ../python3-host.mk
# For Py3Package
PYTHON3_PKG_BUILD:=0
include ../python3-package.mk
PKG_FIXUP:=autoreconf
@ -55,7 +53,7 @@ define Package/python3/Default
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
TITLE:=Python $(PYTHON_VERSION) programming language
TITLE:=Python $(PYTHON3_VERSION) programming language
URL:=https://www.python.org/
endef
@ -70,7 +68,7 @@ endef
define Package/python3-base
$(call Package/python3/Default)
TITLE:=Python $(PYTHON_VERSION) interpreter
TITLE:=Python $(PYTHON3_VERSION) interpreter
DEPENDS:=+libpthread +zlib
endef
@ -81,7 +79,7 @@ endef
define Package/python3-light
$(call Package/python3/Default)
TITLE:=Python $(PYTHON_VERSION) light installation
TITLE:=Python $(PYTHON3_VERSION) light installation
DEPENDS:=+python3-base +libffi +libbz2 +PYTHON3_BLUETOOTH_SUPPORT:bluez-libs +libuuid
endef
@ -108,8 +106,8 @@ define Py3BasePackage
define Py3Package/$(1)/filespec
ifneq ($(2),)
$(subst $(space),$(newline),$(foreach lib_file,$(2),+|$(lib_file)))
-|/usr/lib/python$(PYTHON_VERSION)/*/test
-|/usr/lib/python$(PYTHON_VERSION)/*/tests
-|/usr/lib/python$(PYTHON3_VERSION)/*/test
-|/usr/lib/python$(PYTHON3_VERSION)/*/tests
endif
endef
Py3Package/$(1)/install?=:
@ -144,7 +142,7 @@ endif
PYTHON_FOR_BUILD:= \
_PYTHON_PROJECT_BASE=$(PKG_BUILD_DIR) \
_PYTHON_HOST_PLATFORM=linux2 \
PYTHONPATH="$(PKG_BUILD_DIR)/Lib:$(PKG_BUILD_DIR)/build/lib.linux2-$(PYTHON_VERSION)" \
PYTHONPATH="$(PKG_BUILD_DIR)/Lib:$(PKG_BUILD_DIR)/build/lib.linux2-$(PYTHON3_VERSION)" \
_PYTHON_SYSCONFIGDATA_NAME=_sysconfigdata \
$(HOST_PYTHON3_BIN)
@ -218,72 +216,72 @@ define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib $(1)/usr/lib/pkgconfig
$(INSTALL_DIR) $(2)/bin
$(CP) \
$(PKG_INSTALL_DIR)/usr/include/python$(PYTHON_VERSION) \
$(PKG_INSTALL_DIR)/usr/include/python$(PYTHON3_VERSION) \
$(1)/usr/include/
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON_VERSION) \
$(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* \
$(PKG_INSTALL_DIR)/usr/lib/python$(PYTHON3_VERSION) \
$(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON3_VERSION).so* \
$(1)/usr/lib/
$(CP) \
$(PKG_INSTALL_DIR)/usr/lib/pkgconfig/python*.pc \
$(1)/usr/lib/pkgconfig
$(INSTALL_BIN) \
$(PKG_INSTALL_DIR)/usr/bin/python$(PYTHON_VERSION)-config \
$(PKG_INSTALL_DIR)/usr/bin/python$(PYTHON3_VERSION)-config \
$(2)/bin/
$(SED) \
's|^prefix_real=.*$$$$|prefix_real="$(PYTHON3_DIR)"|' \
$(2)/bin/python$(PYTHON_VERSION)-config
$(2)/bin/python$(PYTHON3_VERSION)-config
endef
PYTHON3_BASE_LIB_FILES:= \
/usr/lib/python$(PYTHON_VERSION)/encodings \
/usr/lib/python$(PYTHON_VERSION)/_collections_abc.py \
/usr/lib/python$(PYTHON_VERSION)/_sitebuiltins.py \
/usr/lib/python$(PYTHON_VERSION)/_sysconfigdata.py \
/usr/lib/python$(PYTHON_VERSION)/_weakrefset.py \
/usr/lib/python$(PYTHON_VERSION)/abc.py \
/usr/lib/python$(PYTHON_VERSION)/codecs.py \
/usr/lib/python$(PYTHON_VERSION)/genericpath.py \
/usr/lib/python$(PYTHON_VERSION)/io.py \
/usr/lib/python$(PYTHON_VERSION)/os.py \
/usr/lib/python$(PYTHON_VERSION)/posixpath.py \
/usr/lib/python$(PYTHON_VERSION)/site.py \
/usr/lib/python$(PYTHON_VERSION)/sysconfig.py \
/usr/lib/python$(PYTHON_VERSION)/stat.py
/usr/lib/python$(PYTHON3_VERSION)/encodings \
/usr/lib/python$(PYTHON3_VERSION)/_collections_abc.py \
/usr/lib/python$(PYTHON3_VERSION)/_sitebuiltins.py \
/usr/lib/python$(PYTHON3_VERSION)/_sysconfigdata.py \
/usr/lib/python$(PYTHON3_VERSION)/_weakrefset.py \
/usr/lib/python$(PYTHON3_VERSION)/abc.py \
/usr/lib/python$(PYTHON3_VERSION)/codecs.py \
/usr/lib/python$(PYTHON3_VERSION)/genericpath.py \
/usr/lib/python$(PYTHON3_VERSION)/io.py \
/usr/lib/python$(PYTHON3_VERSION)/os.py \
/usr/lib/python$(PYTHON3_VERSION)/posixpath.py \
/usr/lib/python$(PYTHON3_VERSION)/site.py \
/usr/lib/python$(PYTHON3_VERSION)/sysconfig.py \
/usr/lib/python$(PYTHON3_VERSION)/stat.py
PYTHON3_LIB_FILES_DEL+=$(PYTHON3_BASE_LIB_FILES)
define Py3Package/python3-base/filespec
+|/usr/bin/python$(PYTHON_VERSION)
+|/usr/bin/python$(PYTHON3_VERSION)
$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON3_BASE_LIB_FILES),+|$(lib_file)))
endef
define Py3Package/python3-light/filespec
+|/usr/lib/python$(PYTHON_VERSION)
-|/usr/lib/python$(PYTHON_VERSION)/distutils/cygwinccompiler.py
-|/usr/lib/python$(PYTHON_VERSION)/distutils/command/wininst*
-|/usr/lib/python$(PYTHON_VERSION)/ensurepip
-|/usr/lib/python$(PYTHON_VERSION)/idlelib
-|/usr/lib/python$(PYTHON_VERSION)/tkinter
-|/usr/lib/python$(PYTHON_VERSION)/turtledemo
-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/_test*.so
-|/usr/lib/python$(PYTHON_VERSION)/lib-dynload/readline*.so
-|/usr/lib/python$(PYTHON_VERSION)/pdb.doc
-|/usr/lib/python$(PYTHON_VERSION)/test
-|/usr/lib/python$(PYTHON_VERSION)/webbrowser.py
-|/usr/lib/python$(PYTHON_VERSION)/*/test
-|/usr/lib/python$(PYTHON_VERSION)/*/tests
-|/usr/lib/python$(PYTHON_VERSION)/_osx_support.py
+|/usr/lib/python$(PYTHON3_VERSION)
-|/usr/lib/python$(PYTHON3_VERSION)/distutils/cygwinccompiler.py
-|/usr/lib/python$(PYTHON3_VERSION)/distutils/command/wininst*
-|/usr/lib/python$(PYTHON3_VERSION)/ensurepip
-|/usr/lib/python$(PYTHON3_VERSION)/idlelib
-|/usr/lib/python$(PYTHON3_VERSION)/tkinter
-|/usr/lib/python$(PYTHON3_VERSION)/turtledemo
-|/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/_test*.so
-|/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/readline*.so
-|/usr/lib/python$(PYTHON3_VERSION)/pdb.doc
-|/usr/lib/python$(PYTHON3_VERSION)/test
-|/usr/lib/python$(PYTHON3_VERSION)/webbrowser.py
-|/usr/lib/python$(PYTHON3_VERSION)/*/test
-|/usr/lib/python$(PYTHON3_VERSION)/*/tests
-|/usr/lib/python$(PYTHON3_VERSION)/_osx_support.py
$(subst $(space),$(newline),$(foreach lib_file,$(PYTHON3_LIB_FILES_DEL),-|$(lib_file)))
endef
define Py3Package/python3-base/install
# Adding the lib-dynload folder (even just empty) suppresses 2 warnings when starting Python
$(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON_VERSION)/lib-dynload/
$(INSTALL_DIR) $(1)/usr/lib/python$(PYTHON3_VERSION)/lib-dynload/
$(INSTALL_DIR) $(1)/usr/bin
$(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python3
$(LN) python$(PYTHON_VERSION) $(1)/usr/bin/python
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* $(1)/usr/lib/
$(LN) python$(PYTHON3_VERSION) $(1)/usr/bin/python3
$(LN) python$(PYTHON3_VERSION) $(1)/usr/bin/python
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON3_VERSION).so* $(1)/usr/lib/
endef
Py3Package/python3-light/install:=:

View File

@ -15,12 +15,12 @@ define Py3Package/python3-dev/install
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/bin/python$(PYTHON3_VERSION)-config $(1)/usr/bin
$(LN) python$(PYTHON3_VERSION)-config $(1)/usr/bin/python3-config
$(LN) python$(PYTHON_VERSION)/config-$(PYTHON_VERSION)/libpython$(PYTHON3_VERSION).a $(1)/usr/lib/
$(LN) python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION)/libpython$(PYTHON3_VERSION).a $(1)/usr/lib/
endef
$(eval $(call Py3BasePackage,python3-dev, \
/usr/lib/python$(PYTHON_VERSION)/config-$(PYTHON_VERSION) \
/usr/include/python$(PYTHON_VERSION) \
/usr/lib/python$(PYTHON3_VERSION)/config-$(PYTHON3_VERSION) \
/usr/include/python$(PYTHON3_VERSION) \
/usr/lib/pkgconfig \
, \
DO_NOT_ADD_TO_PACKAGE_DEPENDS \

View File

@ -22,6 +22,7 @@ PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
PKG_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PYTHON3_PKG_BUILD:=0
include $(INCLUDE_DIR)/package.mk
include ../../lang/python/python3-package.mk

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=libsearpc
PKG_VERSION:=3.2.0
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/haiwen/libsearpc.git
@ -25,6 +25,7 @@ PKG_FIXUP:=autoreconf
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_SUBDIR)
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PYTHON3_PKG_BUILD:=0
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
@ -50,19 +51,21 @@ define Package/python3-searpc
SUBMENU:=Python
TITLE:=Python bindings for Searpc
DEPENDS:=+libsearpc +python3-light +python3-logging
VARIANT:=python3
endef
define Package/python3-searpc/description
$(call Package/libsearpc/description)
This package contains the Python bindings for Searpc.
This package contains Python bindings for Searpc.
endef
CONFIGURE_ARGS += \
--disable-compile-demo \
--disable-server-pkg
CONFIGURE_VARS += \
PYTHON="$(HOST_PYTHON3_BIN)"
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/{bin,include}
$(INSTALL_DIR) $(1)/usr/lib/pkgconfig
@ -77,13 +80,6 @@ define Package/libsearpc/install
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libsearpc.so* $(1)/usr/lib/
endef
define Py3Build/Compile
rm -rf $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/pysearpc
$(INSTALL_DIR) $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/pysearpc
$(INSTALL_DATA) $(PKG_BUILD_DIR)/pysearpc/*.py $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/pysearpc/
rm -f $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/pysearpc/{pygencode,test_pysearpc}.py
endef
Py3Package/python3-searpc/install:=:
$(eval $(call BuildPackage,libsearpc))

View File

@ -0,0 +1,8 @@
--- a/pysearpc/Makefile.am
+++ b/pysearpc/Makefile.am
@@ -1,4 +1,4 @@
pysearpcdir=${pyexecdir}/pysearpc
-pysearpc_PYTHON = __init__.py client.py common.py errors.py named_pipe.py server.py transport.py utils.py
+pysearpc_DATA = __init__.py client.py common.py errors.py named_pipe.py server.py transport.py utils.py

View File

@ -11,7 +11,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=newt
PKG_VERSION:=0.52.21
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://releases.pagure.org/newt
@ -24,6 +24,7 @@ PKG_CPE_ID:=cpe:/a:fedorahosted:newt
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PYTHON3_PKG_BUILD:=0
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
@ -73,7 +74,6 @@ $(call Package/newt/Default)
SUBMENU:=Python
TITLE+= module for Python
DEPENDS:=+libnewt +python3-light
VARIANT:=python3
endef
define Package/python3-newt/description
@ -93,8 +93,6 @@ CONFIGURE_VARS += $(if $(CONFIG_BUILD_NLS),ac_cv_lib_c_gettext=no)
MAKE_VARS+= PYTHON_CONFIG_PATH="$(STAGING_DIR)/host/bin"
Build/Compile=$(call Build/Compile/Default,)
define Build/InstallDev
$(INSTALL_DIR) $(1)/usr/include
$(CP) $(PKG_INSTALL_DIR)/usr/include/newt.h $(1)/usr/include/

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=youtube-dl
PKG_VERSION:=2020.3.24
PKG_RELEASE:=1
PKG_RELEASE:=2
PYPI_NAME:=youtube_dl
PKG_HASH:=4b03efe439f7cae26eba909821d1df00a9a4eb82741cb2e8b78fe29702bd4633
@ -35,7 +35,6 @@ define Package/youtube-dl
+python3-codecs \
+python3-ctypes \
+python3-setuptools
VARIANT:=python3
endef
define Package/youtube-dl/description

View File

@ -22,6 +22,7 @@ PKG_CPE_ID:=cpe:/a:freeradius:freeradius
PKG_BUILD_DIR:=$(BUILD_DIR)/freeradius-server-$(PKG_VERSION)
PKG_FIXUP:=autoreconf
PYTHON3_PKG_BUILD:=0
PKG_CONFIG_DEPENDS := \
FREERADIUS3_OPENSSL \
@ -30,7 +31,7 @@ PKG_CONFIG_DEPENDS := \
CFLAGS += $(FPIC)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk
include ../../lang/python/python3-package.mk
define Package/freeradius3/config
source "$(SOURCE)/Config.in"
@ -766,7 +767,6 @@ $(eval $(call BuildPlugin,freeradius3-mod-mschap,rlm_mschap,))
$(eval $(call BuildPlugin,freeradius3-mod-pap,rlm_pap,))
$(eval $(call BuildPlugin,freeradius3-mod-passwd,rlm_passwd,))
$(eval $(call BuildPlugin,freeradius3-mod-preprocess,rlm_preprocess,))
$(eval $(call Py3Package,freeradius3-mod-python3))
$(eval $(call BuildPlugin,freeradius3-mod-python3,rlm_python3,))
$(eval $(call BuildPlugin,freeradius3-mod-radutmp,rlm_radutmp,))
$(eval $(call BuildPlugin,freeradius3-mod-realm,rlm_realm,))

View File

@ -14,7 +14,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=nmap
PKG_VERSION:=7.80
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_MAINTAINER:=Nuno Goncalves <nunojpg@gmail.com>
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
@ -26,6 +26,7 @@ PKG_CPE_ID:=cpe:/a:nmap:nmap
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PYTHON3_PKG_BUILD:=0
include $(INCLUDE_DIR)/package.mk
include ../../lang/python/python3-package.mk
@ -100,7 +101,6 @@ endef
define Package/ndiff
$(call Package/nmap/default)
DEPENDS:=+python3-light +python3-xml
VARIANT:=python3
TITLE:=Utility to compare the results of Nmap scans
endef
@ -148,10 +148,10 @@ CONFIGURE_VARS += \
PYTHON3_PKG_SETUP_DIR:=ndiff
PYTHON3_PKG_SETUP_ARGS:=
ifeq ($(BUILD_VARIANT),python3)
Build/Configure:=:
Build/Install:=:
endif
define Build/Compile
$(call Build/Compile/Default,)
$(call Py3Build/Compile)
endef
define Package/nmap/install
$(INSTALL_DIR) $(1)/usr/bin

View File

@ -32,6 +32,7 @@ PKG_USE_MIPS16:=0
PKG_BUILD_PARALLEL:=1
PKG_FIXUP:=autoreconf
PKG_INSTALL:=1
PYTHON3_PKG_BUILD:=0
PKG_MAINTAINER:=Yousong Zhou <yszhou4tech@gmail.com>

View File

@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=radicale
PKG_VERSION:=1.1.6
PKG_RELEASE:=3
PKG_RELEASE:=4
PYPI_NAME:=Radicale
PKG_HASH:=c007198ea45ef797344672c681d4c13f8b4aa85c15c41a1156225767a405c92b
@ -37,7 +37,6 @@ define Package/radicale
+python3-xml
USERID:=radicale=5232:radicale=5232
PROVIDES:=radicale-py2 radicale-py3
VARIANT:=python3
endef
define Package/radicale/description

View File

@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=radicale2
PKG_VERSION:=2.1.11
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_LICENSE:=GPL-3.0
PKG_LICENSE_FILES:=COPYING
@ -31,7 +31,6 @@ $(call Package/radicale2/Default)
USERID:=radicale2=225:radicale2=225
DEPENDS:=+python3 +python3-dateutil +python3-vobject +python3-setuptools
CONFLICTS:=radicale
VARIANT:=python3
endef
define Package/radicale2-examples

View File

@ -33,13 +33,14 @@ PKG_CONFIG_DEPENDS:= \
CONFIG_PACKAGE_kmod-fs-btrfs \
CONFIG_PACKAGE_kmod-fs-xfs
PYTHON3_PKG_BUILD:=0
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/version.mk
include $(TOPDIR)/feeds/packages/lang/python/python3-host.mk
#include $(TOPDIR)/feeds/packages/lang/python/python-package.mk
include $(TOPDIR)/feeds/packages/lang/python/python3-package.mk
include ../../lang/python/python3-host.mk
include ../../lang/python/python3-package.mk
define Package/samba4/Default
SECTION:=net

View File

@ -37,7 +37,7 @@ define Package/scapy/description
endef
define Build/Compile
$(call Build/Compile/Py3Mod,., \
$(call Python3/ModSetup,., \
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)", \
)
endef

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=seafile-ccnet
PKG_VERSION:=7.1.3
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/haiwen/ccnet-server/tar.gz/v$(PKG_VERSION)-server?
@ -25,6 +25,7 @@ PKG_BUILD_DEPENDS:=vala/host
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PYTHON3_PKG_BUILD:=0
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
@ -58,7 +59,6 @@ define Package/python3-seafile-ccnet
SUBMENU:=Python
TITLE:=Python bindings for Seafile Ccnet
DEPENDS:=+seafile-ccnet +python3-light +python3-searpc
VARIANT:=python3
endef
define Package/python3-seafile-ccnet/description
@ -73,6 +73,9 @@ CONFIGURE_ARGS += \
--enable-python \
--with-mysql="$(STAGING_DIR)/usr/bin/mysql_config"
CONFIGURE_VARS += \
PYTHON="$(HOST_PYTHON3_BIN)"
define Package/seafile-ccnet/install
$(INSTALL_DIR) $(1)/usr/{lib,libexec}
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/libexec/
@ -88,12 +91,6 @@ define Build/InstallDev
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libccnet.{a,la,so*} $(1)/usr/lib/
endef
define Py3Build/Compile
rm -rf $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/ccnet
$(INSTALL_DIR) $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/ccnet
$(INSTALL_DATA) $(PKG_BUILD_DIR)/python/ccnet/*.py $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/ccnet/
endef
Py3Package/python3-seafile-ccnet/install:=:
$(eval $(call BuildPackage,seafile-ccnet))

View File

@ -0,0 +1,6 @@
--- a/python/ccnet/Makefile.am
+++ b/python/ccnet/Makefile.am
@@ -1,2 +1,2 @@
ccnetdir=${pyexecdir}/ccnet
-ccnet_PYTHON = __init__.py rpc.py
+ccnet_DATA = __init__.py rpc.py

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=seafile-seahub
PKG_VERSION:=7.1.3
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/haiwen/seahub/tar.gz/v$(PKG_VERSION)-server?
@ -24,6 +24,7 @@ PKG_BUILD_DIR:=$(BUILD_DIR)/seahub-$(PKG_VERSION)-server
HOST_PYTHON3_PACKAGE_BUILD_DEPENDS:="Django~=1.11"
PKG_BUILD_PARALLEL:=1
PYTHON3_PKG_BUILD:=0
include $(INCLUDE_DIR)/package.mk
include ../../lang/python/python3-package.mk
@ -57,7 +58,6 @@ define Package/seafile-seahub
+python3-requests-oauthlib \
+python3-seafile-ccnet \
+python3-searpc
VARIANT:=python3
endef
define Package/seafile-seahub/description
@ -75,10 +75,9 @@ MAKE_VARS += \
PYTHON="$(HOST_PYTHON3_BIN)" \
DJANGO_ADMIN_PY="$(STAGING_DIR_HOSTPKG)/bin/django-admin"
define Py3Build/Compile
$(call Build/Compile/HostPy3PipInstall,$(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS))
define Build/Compile
$(call HostPython3/PipInstall,$(HOST_PYTHON3_PACKAGE_BUILD_DEPENDS))
$(call Build/Compile/Default,locale)
$(INSTALL_DIR) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
endef
define Py3Package/seafile-seahub/install
@ -90,6 +89,8 @@ define Py3Package/seafile-seahub/install
mv $(1)/usr/share/seafile/seafile-server/seahub/media/avatars $(1)/usr/share/seafile/seafile-server/seahub/media/avatars_default
endef
Py3Package/seafile-seahub/filespec:=
$(eval $(call Py3Package,seafile-seahub))
$(eval $(call BuildPackage,seafile-seahub))
$(eval $(call BuildPackage,seafile-seahub-src))

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=seafile-server
PKG_VERSION:=7.1.3
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/haiwen/seafile-server/tar.gz/v$(PKG_VERSION)-server?
@ -25,6 +25,7 @@ PKG_BUILD_DEPENDS:=vala/host libevhtp
PKG_FIXUP:=autoreconf
PKG_BUILD_PARALLEL:=1
PKG_INSTALL:=1
PYTHON3_PKG_BUILD:=0
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/nls.mk
@ -111,7 +112,6 @@ define Package/python3-seafile-server
SUBMENU:=Python
TITLE:=Python bindings for Seafile server
DEPENDS:=+python3-light +python3-logging +python3-searpc +python3-seafile-ccnet
VARIANT:=python3
endef
define Package/python3-seafile-server/description
@ -126,10 +126,8 @@ CONFIGURE_ARGS += \
--enable-python \
--with-mysql="$(STAGING_DIR)/usr/bin/mysql_config"
# This is required as python3-package.mk overrides the default setting of having interlinking enabled
ifdef CONFIG_USE_MIPS16
TARGET_CFLAGS += -minterlink-mips16
endif
CONFIGURE_VARS += \
PYTHON="$(HOST_PYTHON3_BIN)"
ifdef CONFIG_GCC_LIBSSP
TARGET_LDFLAGS += -lssp
@ -199,13 +197,6 @@ define Build/InstallDev
$(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libseafile.pc $(1)/usr/lib/pkgconfig/
endef
define Py3Build/Compile
rm -rf $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/{seafile,seaserv}
$(INSTALL_DIR) $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/{seafile,seaserv}
$(INSTALL_DATA) $(PKG_BUILD_DIR)/python/seafile/*.py $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/seafile/
$(INSTALL_DATA) $(PKG_BUILD_DIR)/python/seaserv/*.py $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/seaserv/
endef
define Package/seafile-server-fuse/install
$(INSTALL_DIR) $(1)/usr/{bin,libexec}
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/seaf-fuse $(1)/usr/libexec/

View File

@ -0,0 +1,14 @@
--- a/python/seafile/Makefile.am
+++ b/python/seafile/Makefile.am
@@ -1,3 +1,3 @@
seafiledir=${pyexecdir}/seafile
-seafile_PYTHON = __init__.py rpcclient.py
+seafile_DATA = __init__.py rpcclient.py
--- a/python/seaserv/Makefile.am
+++ b/python/seaserv/Makefile.am
@@ -1,3 +1,3 @@
seaservdir=${pyexecdir}/seaserv
-seaserv_PYTHON = __init__.py service.py api.py
+seaserv_DATA = __init__.py service.py api.py

View File

@ -22,6 +22,7 @@ PKG_LICENSE_FILES:=LICENSE
CMAKE_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=swig/host
PYTHON3_PKG_BUILD:=0
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

View File

@ -9,6 +9,7 @@ PKG_SOURCE_URL=https://files.pythonhosted.org/packages/source/u/uwsgi/
PKG_HASH:=4972ac538800fb2d421027f49b4a1869b66048839507ccf0aa2fda792d99f583
PKG_BUILD_DIR:=$(BUILD_DIR)/uwsgi-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=python3/host
PYTHON3_PKG_BUILD:=0
PKG_LICENSE:=GPL-2.0-or-later
PKG_LICENSE_FILES:=LICENSE
@ -108,8 +109,8 @@ define Build/Compile
$(call Build/Compile/Default,plugin.logfile PROFILE=openwrt)
$(call Build/Compile/Default,plugin.syslog PROFILE=openwrt)
$(call Build/Compile/Default,plugin.cgi PROFILE=openwrt)
$(call Build/Compile/HostPy3RunTarget, \
cd $(PKG_BUILD_DIR), \
$(call Python3/Run, \
$(PKG_BUILD_DIR), \
uwsgiconfig.py --plugin plugins/python openwrt, \
CPP="$(TARGET_CROSS)cpp" \
LINUX_UNAME_VERSION=$(LINUX_UNAME_VERSION) \

View File

@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=bigclown-control-tool
PKG_VERSION:=0.2.0
PKG_RELEASE:=1
PKG_RELEASE:=2
PYPI_NAME:=bch
PKG_HASH:=4cd73b92757fce7275a4744baed411c867af2e671c521b90d6690b2320851d58
@ -32,7 +32,6 @@ define Package/bigclown-control-tool
+python3-pyserial \
+python3-yaml \
+python3-simplejson
VARIANT:=python3
endef
$(eval $(call Py3Package,bigclown-control-tool))

View File

@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=bigclown-firmware-tool
PKG_VERSION:=1.5.1
PKG_RELEASE:=1
PKG_RELEASE:=2
PYPI_NAME:=bcf
PKG_HASH:=50b0351b97e6b1b1d4cb4703491daa6102e7e5b3b750b47fa35182d9eb39ab9c
@ -34,7 +34,6 @@ define Package/bigclown-firmware-tool
+python3-requests \
+python3-click \
+python3-intelhex
VARIANT:=python3
endef
$(eval $(call Py3Package,bigclown-firmware-tool))

View File

@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=bigclown-gateway
PKG_VERSION:=1.16.2
PKG_RELEASE:=1
PKG_RELEASE:=2
PYPI_NAME:=bcg
PKG_HASH:=ce7f27f372551c0beb3f8929af2d779417d9dcd0feaa2fa2dc49e87b1416c536
@ -36,7 +36,6 @@ define Package/bigclown-gateway
+python3-simplejson \
+python3-schema \
+python3-appdirs
VARIANT:=python3
endef
define Py3Package/bigclown-gateway/install

View File

@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=bigclown-mqtt2influxdb
PKG_VERSION:=1.3.0
PKG_RELEASE:=1
PKG_RELEASE:=2
PYPI_NAME:=mqtt2influxdb
PKG_HASH:=1b4b3b13f5b2f092bcd27846d94e91ad6f05141b2daea5167a7d58b09a782639
@ -31,7 +31,6 @@ define Package/bigclown-mqtt2influxdb
+python3-influxdb \
+python3-jsonpath-ng \
+python3-schema
VARIANT:=python3
endef
define Py3Package/bigclown-mqtt2influxdb/install

View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=i2c-tools
PKG_VERSION:=4.1
PKG_RELEASE:=3
PKG_RELEASE:=4
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_SOURCE_URL:=@KERNEL/software/utils/i2c-tools
@ -20,13 +20,11 @@ PKG_LICENSE:=GPL-2.0-or-later LGPL-2.1-or-later
PKG_LICENSE_FILES:=COPYING COPYING.LGPL
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-i2c-tools-$(PKG_VERSION)
PYTHON3_PKG_BUILD:=0
include $(INCLUDE_DIR)/package.mk
include ../../lang/python/python3-package.mk
PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xJf $(DL_DIR)/$(PKG_SOURCE)
define Package/i2c/Default
URL:=https://i2c.wiki.kernel.org/index.php/I2C_Tools
TITLE:=I2C
@ -37,7 +35,6 @@ define Package/libi2c
SECTION:=libs
CATEGORY:=Libraries
TITLE+=library for i2c-tools
VARIANT:=bin
endef
define Package/i2c-tools
@ -46,7 +43,6 @@ define Package/i2c-tools
CATEGORY:=Utilities
TITLE+=tools for Linux
DEPENDS:=+libi2c
VARIANT:=bin
endef
define Package/python3-smbus
@ -56,7 +52,6 @@ define Package/python3-smbus
CATEGORY:=Languages
TITLE:=Python bindings for the SMBUS
DEPENDS:=+libi2c +python3-light
VARIANT:=python3
endef
define Package/libi2c/description
@ -72,7 +67,8 @@ define Package/python3-smbus/description
This package contain the Python3 bindings for Linux SMBus access through i2c-dev.
endef
ifeq ($(BUILD_VARIANT),bin)
PYTHON3_PKG_SETUP_ARGS:=
PYTHON3_PKG_SETUP_DIR:=py-smbus
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
@ -81,6 +77,7 @@ define Build/Compile
STAGING_DIR="$(STAGING_DIR)" \
LDFLAGS="$(TARGET_LDFLAGS)" \
CFLAGS="$(TARGET_CFLAGS)"
$(call Py3Build/Compile)
endef
define Build/InstallDev
@ -89,11 +86,6 @@ define Build/InstallDev
$(CP) $(PKG_BUILD_DIR)/lib/libi2c.{a,so*} $(1)/usr/lib/
endef
endif # ifeq
PYTHON3_PKG_SETUP_ARGS:=
PYTHON3_PKG_SETUP_DIR:=py-smbus
define Package/libi2c/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/lib/libi2c.so* $(1)/usr/lib/