Skip to content

Commit

Permalink
python3: update using python updates as template
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
  • Loading branch information
commodo committed Jan 19, 2015
1 parent f05378e commit 8c057f3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
3 changes: 1 addition & 2 deletions lang/python/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,7 @@ define Build/InstallDev
$(PKG_INSTALL_DIR)/usr/lib/libpython$(PYTHON_VERSION).so* \
$(1)/usr/lib/
$(CP) \
$(STAGING_DIR_HOST)/lib/pkgconfig/python.pc \
$(STAGING_DIR_HOST)/lib/pkgconfig/python2.pc \
$(STAGING_DIR_HOST)/lib/pkgconfig/python3.pc \

This comment has been minimized.

Copy link
@shangjiyu

shangjiyu Jan 20, 2015

I got this error when i only chose python and python base

cp: cannot stat '/home/shangjiyu/dev/openwrt/trunk/staging_dir/host/lib/pkgconfig/python3.pc': No such file or directory

is this caused by this commit?

This comment has been minimized.

Copy link
@commodo

commodo Jan 20, 2015

Author Contributor

yep; I guess I screwed up a bit here;
sorry;

[edit] created this PR #801
I was doing things in a hurry yesterday; a lot of stuff has piled up.

Thanks for reporting this.

$(STAGING_DIR_HOST)/lib/pkgconfig/python-$(PYTHON_VERSION).pc \
$(1)/usr/lib/pkgconfig
$(CP) \
Expand Down
8 changes: 4 additions & 4 deletions lang/python3/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ HOST_BUILD_PARALLEL:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/Python-$(PKG_VERSION)
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/Python-$(PKG_VERSION)

PKG_BUILD_DEPENDS:=libffi/host python3/host
PKG_BUILD_DEPENDS:=python3/host

include $(INCLUDE_DIR)/host-build.mk
include $(INCLUDE_DIR)/package.mk
Expand All @@ -57,7 +57,7 @@ endef
define Package/python3-base
$(call Package/python3/Default)
TITLE:=Python $(PYTHON_VERSION) interpreter
DEPENDS:=+libpthread +zlib +libffi
DEPENDS:=+libpthread +zlib +libffi +libopenssl
endef

define Package/python3-base/description
Expand All @@ -67,7 +67,7 @@ endef

define Package/python3
$(call Package/python3/Default)
DEPENDS:=+python3-base +libncursesw +libbz2 +libgdbm +libsqlite3 +libdb47 +libopenssl
DEPENDS:=+python3-base +libncursesw +libbz2 +libgdbm +libsqlite3 +libdb47
endef

define Package/python3/description
Expand Down Expand Up @@ -170,9 +170,9 @@ endef
HOST_CONFIGURE_ARGS+= \
--without-cxx-main \
--without-pymalloc \
--without-ensurepip \
--with-threads \
--prefix=$(STAGING_DIR_HOST) \
--with-ensurepip=upgrade \
CONFIG_SITE= \
OPT="$(HOST_CFLAGS)"

Expand Down
15 changes: 12 additions & 3 deletions lang/python3/files/python3-package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ PYTHON3:=python$(PYTHON3_VERSION)
HOST_PYTHON3_LIB_DIR:=$(STAGING_DIR_HOST)/lib/python$(PYTHON3_VERSION)
HOST_PYTHON3_BIN:=$(STAGING_DIR_HOST)/bin/python3

PYTHON3PATH:=$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR)
PYTHON3PATH+=:$(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
PYTHON3PATH:=$(PYTHON3_LIB_DIR):$(STAGING_DIR)/$(PYTHON3_PKG_DIR):$(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)
define HostPython3
( export PYTHONPATH="$(PYTHON3PATH)"; \
export PYTHONOPTIMIZE=""; \
Expand All @@ -39,13 +38,22 @@ ifdef CONFIG_USE_MIPS16
endif

define Py3Package

# Add default PyPackage filespec none defined
ifndef Py3Package/$(1)/filespec
define Py3Package/$(1)/filespec
+|$(PYTHON3_PKG_DIR)
endef
endif

$(call shexport,Py3Package/$(1)/filespec)

define Package/$(1)/install
find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
@echo "$$$$$$$$$$(call shvar,Py3Package/$(1)/filespec)" | ( \
IFS='|'; \
while read fop fspec fperm; do \
fop=`echo "$$$$$$$$fop" | tr -d ' \t\n'`; \
if [ "$$$$$$$$fop" = "+" ]; then \
if [ ! -e "$(PKG_INSTALL_DIR)$$$$$$$$fspec" ]; then \
echo "File not found '$(PKG_INSTALL_DIR)$$$$$$$$fspec'"; \
Expand Down Expand Up @@ -90,11 +98,12 @@ define Build/Compile/Py3Mod
CFLAGS="$(TARGET_CFLAGS)" \
CPPFLAGS="$(TARGET_CPPFLAGS) -I$(PYTHON3_INC_DIR)" \
LDFLAGS="$(TARGET_LDFLAGS) -lpython$(PYTHON3_VERSION)" \
_PYTHON_HOST_PLATFORM="linux-$(ARCH)" \
_PYTHON_HOST_PLATFORM=linux2 \
__PYVENV_LAUNCHER__="/usr/bin/$(PYTHON3)" \
$(3) \
, \
./setup.py $(2) \
)
find $(PKG_INSTALL_DIR) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f
endef

0 comments on commit 8c057f3

Please sign in to comment.