Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python wheels using rustc #5435

Merged
merged 49 commits into from
Oct 12, 2022
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
2efd1d5
python wheels using rustc: First attempt
th0ma7 Sep 20, 2022
307b053
spk.mk: Revert uneeded imported changes
th0ma7 Sep 20, 2022
017552c
python310: Temporary disabling pure python wheels
th0ma7 Sep 20, 2022
9d7df2a
rust: Use CARGO_TARGET* variables instead of RUSTFLAGS
th0ma7 Sep 20, 2022
9011821
rustc: Use target add as documented for isntall additional targets
th0ma7 Sep 24, 2022
2d7e6f3
Dockerfile: Migrate to Debian-11 Bullseye
th0ma7 Oct 1, 2022
0bb2c20
python310: Fix cffi build issue in crossenv
th0ma7 Oct 1, 2022
7e4b2de
tc.mk: Move cargo & rustup under /opt
th0ma7 Oct 1, 2022
a7f481f
native/python310: Link to ffi + ssl and install setuptools-rust
th0ma7 Oct 1, 2022
f24b9b5
Update mk/spksrc.tc.mk
th0ma7 Sep 29, 2022
bb8cf26
cross-rust-env.mk: Remvoe commented environment variables
th0ma7 Oct 1, 2022
710eec1
python310: Update setuptools-rust to v1.5.2
th0ma7 Oct 1, 2022
8cd13b2
python310: Enable latest cryptography in crossenv
th0ma7 Oct 2, 2022
f4e11cd
common.mk: Add cargo to default PATH
th0ma7 Oct 2, 2022
182ab17
tc.mk: Add SYSROOT environment variable for creation of crossenv
th0ma7 Oct 2, 2022
54f606c
wheel-env.mk: Bump default api to python 3.6
th0ma7 Oct 2, 2022
d3499cb
python310: Enable cryptography + bcrypt rust builds
th0ma7 Oct 2, 2022
1c93ca0
common.mk: Use export as ENV may double-set PATH and break
th0ma7 Oct 3, 2022
97c698e
cross/cryptography: Update to version 38.0.1 and build py36-abi3
th0ma7 Oct 6, 2022
79ee867
python-wheel.mk: Allow passing WHEELS_BUILD_ARGS for abi limited
th0ma7 Oct 6, 2022
5cafedb
spk.mk: Fix wheelclean target/**/wheelhouse cleanup
th0ma7 Oct 6, 2022
84f213c
python310: Test-bed all wheels
th0ma7 Oct 6, 2022
f8082a4
cryptography: Add a legacy version for python2 & python38
th0ma7 Oct 6, 2022
e1a156e
duply: Build fix & upgrade from v2.3.1 to v2.4.1
th0ma7 Oct 6, 2022
e7c66c2
duplicity: Build fix & update to v0.8.23 from pypi
th0ma7 Oct 6, 2022
08effeb
cryptography: Missing PYO3_CROSS exports
th0ma7 Oct 9, 2022
508bc35
python310: Add --ar flag part of the crossenv build
th0ma7 Oct 9, 2022
1b7e606
python310: Add env variables for cross-compiling cryptography
th0ma7 Oct 9, 2022
cf18ebc
python310: Multiple adjustments cryptography, numpy, pycryptodome
th0ma7 Oct 9, 2022
37a854e
python-wheel.mk: Fix building when host=target in crossenv
th0ma7 Oct 9, 2022
164d194
python310: Re-enable cross/cryptography to use x64 build fix
th0ma7 Oct 9, 2022
e85853f
python310: Add comments for numpy & pycryptodome(x)
th0ma7 Oct 9, 2022
993802b
python310: Fix += for various variables due to many wheels
th0ma7 Oct 9, 2022
bcd3400
python310: psutil 5.9.1 is last known to build on armv5/ppc
th0ma7 Oct 9, 2022
dd2f685
python310: Testing all wheels done, disabling except cryptography
th0ma7 Oct 10, 2022
09cdc1c
python310: Update from v3.10.6 to v3.10.7
th0ma7 Oct 10, 2022
e89377c
native/cmake: Update to latest stable
th0ma7 Oct 11, 2022
f19eff6
native/cmake-legacy: Provide a Debian 10 "Buster" version of cmake
th0ma7 Oct 11, 2022
72a3fe9
cmake.mk: Add CMAKE_LEGACY and fix exported PATH
th0ma7 Oct 11, 2022
a0c6d52
mysql-connector-c: Make usage of USE_NATIVE_CMAKE_LEGACY
th0ma7 Oct 11, 2022
1a97424
cmake.mk: For CMAKE_PATH to work from spk need to use $(WORK_DIR)
th0ma7 Oct 11, 2022
4d18244
python310: Enable mysqlclient wheel build using latest changes
th0ma7 Oct 11, 2022
e30710a
python310: Disable all optional wheels in perapration for release
th0ma7 Oct 11, 2022
b97a682
python310: Update from version 3.10.7 to 3.10.8
th0ma7 Oct 11, 2022
7b9f9f2
duplicity: Update from version 0.8.12 to 1.0.1
th0ma7 Oct 12, 2022
682807f
bcrypt >= 4.0 also requires PYO3_CROSS* variables
th0ma7 Oct 12, 2022
ca8bef3
duplicity: psutil==5.9.1 is last know working version on armv5/ppc
th0ma7 Oct 12, 2022
fe6bf2e
cross-cmake-env.mk: Fix typo and use $(WORK_DIR) for nasm def.
th0ma7 Oct 12, 2022
2dbf000
cross-cmake-env.mk: Forgot to re-export nasm using ENV variable
th0ma7 Oct 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions cross/cryptography-legacy/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
PKG_NAME = cryptography
PKG_VERS = 3.3.2
th0ma7 marked this conversation as resolved.
Show resolved Hide resolved
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://files.pythonhosted.org/packages/source/c/$(PKG_NAME)
PKG_DIR = $(PKG_NAME)-$(PKG_VERS)

DEPENDS = cross/openssl cross/cffi

HOMEPAGE = https://github.com/pyca/cryptography
COMMENT = Provide cryptographic recipes and primitives to Python developers
LICENSE = BSD/ASL2

include ../../mk/spksrc.python-module.mk
Empty file added cross/cryptography-legacy/PLIST
Empty file.
3 changes: 3 additions & 0 deletions cross/cryptography-legacy/digests
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cryptography-3.3.2.tar.gz SHA1 eb8be696115458f9368432525e9cae11d0f6bebf
cryptography-3.3.2.tar.gz SHA256 5a60d3780149e13b7a6ff7ad6526b38846354d11a15e21068e57073e29e19bed
cryptography-3.3.2.tar.gz MD5 e2ce2ec8a63965fad351f36ed70fde4b
14 changes: 12 additions & 2 deletions cross/cryptography/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PKG_NAME = cryptography
PKG_VERS = 3.3.2
PKG_VERS = 38.0.1
PKG_EXT = tar.gz
PKG_DIST_NAME = $(PKG_NAME)-$(PKG_VERS).$(PKG_EXT)
PKG_DIST_SITE = https://files.pythonhosted.org/packages/source/c/$(PKG_NAME)
Expand All @@ -11,4 +11,14 @@ HOMEPAGE = https://github.com/pyca/cryptography
COMMENT = Provide cryptographic recipes and primitives to Python developers
LICENSE = BSD/ASL2

include ../../mk/spksrc.python-module.mk
###
### This cross/cryptography is needed to generate python-limited abi3 wheels
### Ref: https://github.com/pyca/cryptography/issues/7671
###

WHEELS_BUILD_ARGS = --py-limited-api=$(PYTHON_LIMITED_API)

ENV += PYO3_CROSS_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/
ENV += PYO3_CROSS_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/

include ../../mk/spksrc.python-wheel.mk
6 changes: 3 additions & 3 deletions cross/cryptography/digests
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
cryptography-3.3.2.tar.gz SHA1 eb8be696115458f9368432525e9cae11d0f6bebf
cryptography-3.3.2.tar.gz SHA256 5a60d3780149e13b7a6ff7ad6526b38846354d11a15e21068e57073e29e19bed
cryptography-3.3.2.tar.gz MD5 e2ce2ec8a63965fad351f36ed70fde4b
cryptography-38.0.1.tar.gz SHA1 1c8066340a44fc9aea9f96566c850e95f42930da
cryptography-38.0.1.tar.gz SHA256 1db3d807a14931fa317f96435695d9ec386be7b84b618cc61cfa5d08b0ae33d7
cryptography-38.0.1.tar.gz MD5 c47299bca4309cdda29626b0046d9229
2 changes: 1 addition & 1 deletion cross/duply/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PKG_NAME = duply
PKG_VERS = 2.3.1
PKG_VERS = 2.4.1
PKG_SHORT_VERS = $(word 1,$(subst ., ,$(PKG_VERS))).$(word 2,$(subst ., ,$(PKG_VERS)))
PKG_EXT = tgz
PKG_DIST_NAME = $(PKG_NAME)_$(PKG_VERS).$(PKG_EXT)
Expand Down
6 changes: 3 additions & 3 deletions cross/duply/digests
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
duply_2.3.1.tgz SHA1 fde26ede5b649457c8d12aed9423459d927a0a95
duply_2.3.1.tgz SHA256 f044f9d4b81891785212f856ace2064e8a08da19330587d580a5c233575a3091
duply_2.3.1.tgz MD5 6a1ed24829331d8cc064c94b8f6072d2
duply_2.4.1.tgz SHA1 98790dafb92f8441045ce430f4ad9ed80bd895f6
duply_2.4.1.tgz SHA256 03fd28b06206505edf0e0820d098208708842999f21b1d132461e34e2c0b6973
duply_2.4.1.tgz MD5 7d579e5a922c21b59e059a2dd4d2383b
19 changes: 9 additions & 10 deletions cross/duply/patches/001-adjust-default-python-path.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# Adjust path of bash and python
--- duply.org 2020-02-24 11:53:51.000000000 +0000
+++ duply 2020-04-28 23:39:36.695912643 +0000
@@ -531,7 +531,7 @@
DEFAULT_GPG='gpg'
DEFAULT_GPG_KEY='_KEY_ID_'
DEFAULT_GPG_PW='_GPG_PASSWORD_'
-DEFAULT_PYTHON='python2'
+DEFAULT_PYTHON='/var/packages/duplicity/target/env/bin/python'
--- ../duply_2.4.1-orig/duply 2022-09-09 12:46:13.000000000 +0000
+++ duply 2022-10-06 11:19:53.344470242 +0000
@@ -951,7 +951,7 @@ SOURCE='${DEFAULT_SOURCE}'

# function definitions ##########################
# override the python interpreter to execute duplicity, unset by default
# e.g. "python3" or "/usr/bin/python3.8"
-#PYTHON="python"
+PYTHON="/var/packages/duplicity/target/env/bin/python"

# exclude folders containing exclusion file (since duplicity 0.5.14)
# Uncomment the following two lines to enable this setting.
13 changes: 10 additions & 3 deletions cross/python310/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ CONFIGURE_ARGS += --with-system-expat
DEPENDS += cross/libffi
CONFIGURE_ARGS += --with-system-ffi

# PYO3 variable for cross-compiling
# cryptography through rustc
ENV += PYO3_CROSS_LIB_DIR=$(STAGING_INSTALL_PREFIX)/lib/
ENV += PYO3_CROSS_INCLUDE_DIR=$(STAGING_INSTALL_PREFIX)/include/


ADDITIONAL_CFLAGS = -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -L $(STAGING_INSTALL_PREFIX)/lib -I $(STAGING_INSTALL_PREFIX)/include

Expand Down Expand Up @@ -128,12 +133,14 @@ python310_install:
python310_post_install: $(WORK_DIR)/python-cc.mk
mkdir -p $(PYTHON_LIB_CROSS)
cp -R $(HOSTPYTHON_LIB_NATIVE) $(PYTHON_LIB_CROSS)/../
@$(RUN) $(PYTHON_NATIVE) -m crossenv $(STAGING_INSTALL_PREFIX)/bin/python$(PKG_VERS_MAJOR_MINOR) $(WORK_DIR)/crossenv/
@$(RUN) $(PYTHON_NATIVE) -m crossenv $(STAGING_INSTALL_PREFIX)/bin/python$(PKG_VERS_MAJOR_MINOR) --cc $${CC} --cxx $${CXX} --ar $${AR} --sysroot $${SYSROOT} --env LIBRARY_PATH= --manylinux manylinux2014 $(WORK_DIR)/crossenv/
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) wget https://bootstrap.pypa.io/get-pip.py
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) build-python get-pip.py "pip==22.2.2" --no-setuptools --no-wheel --disable-pip-version-check
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) build-pip --disable-pip-version-check install "setuptools==63.4.3" "setuptools-rust==1.5.1" "setuptools-scm==7.0.5" "wheel==0.37.1" "cffi==1.15.1" "cryptography==3.3.2" "poetry==1.1.14" "Cython==0.29.32" "flit==3.7.1"
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) python get-pip.py "pip==22.2.2" --no-setuptools --no-wheel --disable-pip-version-check
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) pip --disable-pip-version-check install "setuptools==63.4.3" "setuptools-rust==1.5.1" "setuptools-scm==7.0.5" "wheel==0.37.1" "cffi==1.15.1" "cryptography==3.3.2" "poetry==1.1.14" "Cython==0.29.32" "flit==3.7.1"
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) build-pip --disable-pip-version-check install "setuptools==63.4.3" "setuptools-rust==1.5.2" "setuptools-scm==7.0.5" "wheel==0.37.1"
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) pip --disable-pip-version-check install "setuptools==63.4.3" "setuptools-rust==1.5.2" "setuptools-scm==7.0.5" "wheel==0.37.1"
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) build-pip --disable-pip-version-check install "cffi==1.15.1" "poetry==1.1.14" "Cython==0.29.32" "flit==3.7.1" "cryptography==38.0.1"
. $(WORK_DIR)/crossenv/bin/activate && $(RUN) pip --disable-pip-version-check install "cffi==1.15.1" "poetry==1.1.14" "Cython==0.29.32" "flit==3.7.1" "cryptography==38.0.1"
ifneq ($(PYTHON_LIB_NATIVE),$(PYTHON_LIB_CROSS))
cp $(PYTHON_LIB_CROSS)/_sysconfigdata_*.py $(PYTHON_LIB_NATIVE)/_sysconfigdata.py
endif
Expand Down
3 changes: 3 additions & 0 deletions mk/spksrc.common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ MSG = echo "===> "
# Launch command in the working dir of the package source and the right environment
RUN = cd $(WORK_DIR)/$(PKG_DIR) && env $(ENV)

# Add cargo for rust compiler to default PATH
export PATH := /opt/cargo/bin:$(PATH)

# fallback by default to native/python*
PIP ?= pip

Expand Down
32 changes: 32 additions & 0 deletions mk/spksrc.cross-rust-env.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Configuration for rust compiler
#

RUST_TOOLCHAIN ?= stable

RUST_TARGET =
# map archs to rust targets
ifeq ($(findstring $(ARCH), $(x64_ARCHS)),$(ARCH))
RUST_TARGET = x86_64-unknown-linux-gnu
endif
ifeq ($(findstring $(ARCH), $(i686_ARCHS)),$(ARCH))
RUST_TARGET = i686-unknown-linux-gnu
endif
ifeq ($(findstring $(ARCH), $(ARMv5_ARCHS)),$(ARCH))
# may be not supported for cargo
RUST_TARGET = armv5te-unknown-linux-gnueabi
endif
ifeq ($(findstring $(ARCH), $(ARMv7_ARCHS)),$(ARCH))
RUST_TARGET = armv7-unknown-linux-gnueabihf
endif
ifeq ($(findstring $(ARCH), $(ARMv7L_ARCHS)),$(ARCH))
RUST_TARGET = armv7-unknown-linux-gnueabi
endif
ifeq ($(findstring $(ARCH), $(ARMv8_ARCHS)),$(ARCH))
RUST_TARGET = aarch64-unknown-linux-gnu
endif
ifeq ($(findstring $(ARCH), $(PPC_ARCHS)),$(ARCH))
RUST_TARGET = powerpc-unknown-linux-gnu
endif
ifeq ($(RUST_TARGET),)
$(error Arch $(ARCH) not supported)
endif
79 changes: 12 additions & 67 deletions mk/spksrc.cross-rust.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,93 +31,38 @@ TC = syno$(ARCH_SUFFIX)
endif

##### rust specific configurations
include ../../mk/spksrc.cross-rust-env.mk

# configure is used to install rust targets
CONFIGURE_TARGET = install_rust_target
CONFIGURE_TARGET = nop

# skip compile_target if not used by module
ifeq ($(strip $(COMPILE_TARGET)),)
COMPILE_TARGET = nop
COMPILE_TARGET = rust_build_target
endif

RUST_TOOLCHAIN ?= stable

RUST_TARGET =
# map archs to rust targets
ifeq ($(findstring $(ARCH), $(x64_ARCHS)),$(ARCH))
RUST_TARGET=x86_64-unknown-linux-gnu
endif
ifeq ($(findstring $(ARCH), $(i686_ARCHS)),$(ARCH))
RUST_TARGET=i686-unknown-linux-gnu
endif
ifeq ($(findstring $(ARCH), $(ARMv5_ARCHS)),$(ARCH))
# may be not supported for cargo
RUST_TARGET=armv5te-unknown-linux-gnueabi
endif
ifeq ($(findstring $(ARCH), $(ARMv7_ARCHS)),$(ARCH))
RUST_TARGET=armv7-unknown-linux-gnueabihf
endif
ifeq ($(findstring $(ARCH), $(ARMv7L_ARCHS)),$(ARCH))
RUST_TARGET=armv7-unknown-linux-gnueabi
endif
ifeq ($(findstring $(ARCH), $(ARMv8_ARCHS)),$(ARCH))
RUST_TARGET=aarch64-unknown-linux-gnu
endif
ifeq ($(findstring $(ARCH), $(PPC_ARCHS)),$(ARCH))
RUST_TARGET=powerpc-unknown-linux-gnu
endif
ifeq ($(RUST_TARGET),)
$(error Arch $(ARCH) not supported)
endif

# Use distrib folder as cargo download cache
CARGO_HOME_PATH=/spksrc/distrib/cargo
ENV += CARGO_HOME=$(CARGO_HOME_PATH)
ENV += PATH=:$(CARGO_HOME_PATH)/bin/:$(PATH)
Copy link
Contributor Author

@th0ma7 th0ma7 Sep 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed but as the CARGO_HOME is being set to /usr/local/ therefore /usr/local/bin is automagically being in the default PATH.

This was reworked and now sits under /opt where cargo & rustup have independant directories. Theses values have been added in the default wide environment through spksrc.tc.mk and the /opt/cargo/bin to spksrc.common.mk


ifeq (,$(shell $(ENV) which rustup))
install_rustup:
@echo " ==> install rustup" ; \
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \
CARGO_HOME=$(CARGO_HOME_PATH) sh -s -- -y
else
install_rustup:
@echo " ==> rustup already installed" ;
ifeq ($(strip $(INSTALL_TARGET)),)
INSTALL_TARGET = rust_install_target
endif

install_rust_toolchain: install_rustup
@echo " ==> install rust toolchain [$(RUST_TOOLCHAIN)]" ; \
env $(ENV) rustup toolchain install $(RUST_TOOLCHAIN) ;
env $(ENV) rustup default $(RUST_TOOLCHAIN) ;

# Install rust target on demand:
install_rust_target: install_rust_toolchain
@echo " ==> install rust target [$(RUST_TARGET)]" ; \
env $(ENV) rustup target install $(RUST_TARGET) ;

# Set default RUST_SRC_DIR
ifeq ($(strip $(RUST_SRC_DIR)),)
RUST_SRC_DIR = $(WORK_DIR)/$(PKG_DIR)
endif

# Set linker environment variable
RUST_LINKER_ENV=CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_LINKER
CARGO_ENV=$(RUST_LINKER_ENV)=$(TC_PATH)$(TC_PREFIX)gcc

# Set the cargo parameters
CARGO_BUILD_ARGS += --target=$(RUST_TARGET)
CARGO_BUILD_ARGS += --path $(RUST_SRC_DIR)
CARGO_BUILD_ARGS += --root $(STAGING_INSTALL_PREFIX)


ifeq ($(strip $(INSTALL_TARGET)),)
INSTALL_TARGET = rust_build_and_install_target
endif
# Default rust build and installation with cargo
rust_build_target:
@echo " ==> Cargo build rust package $(PKG_NAME)"
$(ENV) cargo build $(CARGO_BUILD_ARGS)

# Default rust build and installation with cargo
rust_build_and_install_target:
rust_install_target:
@echo " ==> Cargo install rust package $(PKG_NAME)"
$(ENV) $(CARGO_ENV) cargo install $(CARGO_BUILD_ARGS)
$(ENV) cargo install $(CARGO_BUILD_ARGS)


#####
Expand Down Expand Up @@ -157,7 +102,7 @@ smart-clean:
rm -f $(WORK_DIR)/.$(COOKIE_PREFIX)*

clean:
rm -fr work work-*
rm -fr work work-* build-*.log

all: install plist

Expand Down
4 changes: 2 additions & 2 deletions mk/spksrc.python-wheel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ include ../../mk/spksrc.wheel-env.mk
build_python_wheel_target:
ifeq ($(strip $(CROSSENV)),)
# Python 2 way
@$(RUN) PYTHONPATH=$(PYTHONPATH) $(HOSTPYTHON) -c "import setuptools;__file__='setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" $(BUILD_ARGS) bdist_wheel -d $(WHEELHOUSE)
@$(RUN) PYTHONPATH=$(PYTHONPATH) $(HOSTPYTHON) -c "import setuptools;__file__='setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" $(BUILD_ARGS) bdist_wheel $(WHEELS_BUILD_ARGS) -d $(WHEELHOUSE)
else
# Python 3 case: using crossenv helper
@. $(CROSSENV) && $(RUN) PYTHONPATH=$(PYTHONPATH) python -c "import setuptools;__file__='setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" $(BUILD_ARGS) bdist_wheel -d $(WHEELHOUSE)
@. $(CROSSENV) && $(RUN) _PYTHON_HOST_PLATFORM=$(TC_TARGET) python3 setup.py $(BUILD_ARGS) bdist_wheel $(WHEELS_BUILD_ARGS) -d $(WHEELHOUSE)
endif
@$(RUN) echo "$(PKG_NAME)==$(PKG_VERS)" >> $(WHEELHOUSE)/$(WHEELS_CROSS_COMPILE)

Expand Down
7 changes: 5 additions & 2 deletions mk/spksrc.spk.mk
Original file line number Diff line number Diff line change
Expand Up @@ -438,19 +438,22 @@ spkclean:
work-*/.depend_done \
work-*/.icon_done \
work-*/.strip_done \
work-*/.wheel_done \
work-*/conf \
work-*/scripts \
work-*/staging \
work-*/tc_vars.mk \
work-*/tc_vars.cmake \
work-*/wheelhouse \
work-*/package.tgz \
work-*/INFO \
work-*/PLIST \
work-*/PACKAGE_ICON* \
work-*/WIZARD_UIFILES

wheelclean: spkclean
rm -fr work-*/.wheel_done \
work-*/wheelhouse \
work-*/install/var/packages/**/target/share/wheelhouse

all: package
ifneq ($(filter 1 on ON,$(PSTAT)),)
@$(MSG) MAKELEVEL: $(MAKELEVEL), PARALLEL_MAKE: $(PARALLEL_MAKE), ARCH: $(ARCH)-$(TCVERSION) >> $(PSTAT_LOG)
Expand Down
10 changes: 9 additions & 1 deletion mk/spksrc.tc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ TC_LOCAL_VARS_CMAKE = $(WORK_DIR)/tc_vars.cmake

RUN = cd $(WORK_DIR)/$(TC_TARGET) && env $(ENV)

include ../../mk/spksrc.cross-rust-env.mk

include ../../mk/spksrc.download.mk

checksum: download
Expand Down Expand Up @@ -108,6 +110,7 @@ endif
.PHONY: tc_vars
tc_vars:
@echo TC_ENV := ; \
echo TC_ENV += SYSROOT=\"$(WORK_DIR)/$(TC_TARGET)/$(TC_SYSROOT)\" ; \
for tool in $(TOOLS) ; \
do \
target=$$(echo $${tool} | sed 's/\(.*\):\(.*\)/\1/') ; \
Expand All @@ -121,6 +124,11 @@ tc_vars:
echo TC_ENV += CPPFLAGS=\"$(CPPFLAGS) $$\(ADDITIONAL_CPPFLAGS\)\" ; \
echo TC_ENV += CXXFLAGS=\"$(CXXFLAGS) $$\(ADDITIONAL_CXXFLAGS\)\" ; \
echo TC_ENV += LDFLAGS=\"$(LDFLAGS) $$\(ADDITIONAL_LDFLAGS\)\" ; \
th0ma7 marked this conversation as resolved.
Show resolved Hide resolved
echo TC_ENV += CARGO_HOME=\"/opt/cargo\" ; \
echo TC_ENV += RUSTUP_HOME=\"/opt/rustup\" ; \
echo TC_ENV += CARGO_BUILD_TARGET=\"$(RUST_TARGET)\" ; \
echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_AR=\"$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)ar\" ; \
echo TC_ENV += CARGO_TARGET_$(shell echo $(RUST_TARGET) | tr - _ | tr a-z A-Z)_LINKER=\"$(WORK_DIR)/$(TC_TARGET)/bin/$(TC_PREFIX)gcc\" ; \
echo TC_CONFIGURE_ARGS := --host=$(TC_TARGET) --build=i686-pc-linux ; \
echo TC_TYPE := $(TC_TYPE) ; \
echo TC_TARGET := $(TC_TARGET) ; \
Expand All @@ -130,8 +138,8 @@ tc_vars:
echo CPPFLAGS := $(CPPFLAGS) $$\(ADDITIONAL_CPPFLAGS\) ; \
echo CXXFLAGS := $(CXXFLAGS) $$\(ADDITIONAL_CXXFLAGS\) ; \
echo LDFLAGS := $(LDFLAGS) $$\(ADDITIONAL_LDFLAGS\) ; \
echo TC_LIBRARY := $(TC_LIBRARY) ; \
echo TC_INCLUDE := $(TC_INCLUDE) ; \
echo TC_LIBRARY := $(TC_LIBRARY) ; \
echo TC_EXTRA_CFLAGS := $(TC_EXTRA_CFLAGS) ; \
echo TC_VERS := $(TC_VERS) ; \
echo TC_BUILD := $(TC_BUILD) ; \
Expand Down
4 changes: 2 additions & 2 deletions mk/spksrc.wheel-env.mk
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ WHEELS_DEFAULT_REQUIREMENT = $(WHEELS_CROSSENV_COMPILE)
endif

# For generating abi3 wheels with limited
# python API (e.g cp35 = Python 3.5)
# python API (e.g cp36 = Python 3.6)
ifeq ($(strip $(PYTHON_LIMITED_API)),)
PYTHON_LIMITED_API = cp35
PYTHON_LIMITED_API = cp36
endif

#
Expand Down
6 changes: 5 additions & 1 deletion native/python310/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ CONFIGURE_ARGS += --without-static-libpython
CONFIGURE_ARGS += --without-ensurepip
# test modules are required for optimization only
CONFIGURE_ARGS += --disable-test-modules
# Uses system default libffi-dev
CONFIGURE_ARGS += --with-system-ffi
# Uses system default libssl-dev
CONFIGURE_ARGS += --with-ssl-default-suites=openssl

COMPILE_MAKE_OPTIONS += all

Expand All @@ -33,7 +37,7 @@ python310_native_post_install: $(WORK_DIR)/python-native.mk
@$(RUN) wget https://bootstrap.pypa.io/get-pip.py
@$(RUN) $(PYTHON) get-pip.py "pip==22.2.2" --no-setuptools --no-wheel --disable-pip-version-check
@$(MSG) Installing setuptools, wheel, cffi and cross env
@$(PIP) --disable-pip-version-check install "setuptools==63.4.3" "wheel==0.37.1" "cffi==1.15.1" "crossenv==1.3.0"
@$(PIP) --disable-pip-version-check install "setuptools==63.4.3" "setuptools-rust==1.5.2" "wheel==0.37.1" "cffi==1.15.1" "crossenv==1.3.0"

$(WORK_DIR)/python-native.mk:
@echo PIP=$(PIP_NATIVE) >> $@
6 changes: 3 additions & 3 deletions spk/duplicity/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SPK_NAME = duplicity
SPK_VERS = 0.8.21
SPK_REV = 8
SPK_VERS = 0.8.23
SPK_REV = 9
SPK_ICON = src/duplicity.png

BUILD_DEPENDS = cross/python310
Expand All @@ -25,7 +25,7 @@ MAINTAINER = SynoCommunity
DESCRIPTION = Encrypted bandwidth-efficient backup using the rsync algorithm. Also contains duply wrapper script (duply is supported only for DSM >= 6.0).
STARTABLE = no
DISPLAY_NAME = Duplicity
CHANGELOG = "1. Update duplicity to v0.8.21 and duply to v2.3.1<br/>2. Update to Python 3.10<br/>3. Update supported backend libraries"
CHANGELOG = "1. Update duplicity to v0.8.23 and duply to v2.4.1"

HOMEPAGE = https://duplicity.gitlab.io/duplicity-web/
LICENSE = GPLv2
Expand Down
Loading