Hi,

cryptography is a python package that uses setuptools-rust to compile a module 
with rust/cargo.
This is the first one in PTXdist, but I think it will not be the last.
It is needed by python3-asyncua (OPC/UA) that I am trying to add.

While pure cargo packages already work well (I've tried few weeks ago), the 
python-setuptools scenario is not covered yet.

I am not that deep into PTXdist so I could send a patch. I hope someone can 
help.

My suggestion is to add a PKG_CARGO_LOCK variable that points to the Cargo.lock 
file.
If it exists ptxdist cargosync should use it and also CARGO_HOME should be set 
in env. 

PYTHON3_CRYPTOGRAPHY_CARGO_LOCK := 
$(PYTHON3_CRYPTOGRAPHY_DIR)/src/rust/Cargo.lock

BR,
Artur


On Monday, 27 March, 2023 16:09 CEST, Artur Wiebe <ar...@4wiebe.de> wrote:

> ---
>  rules/python3-cryptography.in   | 10 ++++++
>  rules/python3-cryptography.make | 56 +++++++++++++++++++++++++++++++++
>  2 files changed, 66 insertions(+)
>  create mode 100644 rules/python3-cryptography.in
>  create mode 100644 rules/python3-cryptography.make
> 
> diff --git a/rules/python3-cryptography.in b/rules/python3-cryptography.in
> new file mode 100644
> index 000000000..97187de02
> --- /dev/null
> +++ b/rules/python3-cryptography.in
> @@ -0,0 +1,10 @@
> +## SECTION=python3
> +
> +config PYTHON3_CRYPTOGRAPHY
> +     tristate
> +     select PYTHON3
> +     select HOST_PYTHON3_SETUPTOOLS_RUST
> +     prompt "cryptography"
> +     help
> +       Cryptography is a package which provides cryptographic recipes and 
> primitives to Python developers.
> +       Our goal is for it to be your “cryptographic standard library”
> diff --git a/rules/python3-cryptography.make b/rules/python3-cryptography.make
> new file mode 100644
> index 000000000..7c5ac9885
> --- /dev/null
> +++ b/rules/python3-cryptography.make
> @@ -0,0 +1,56 @@
> +# -*-makefile-*-
> +#
> +# Copyright (C) 2023 by Artur Wiebe <ar...@4wiebe.de>
> +#
> +# For further information about the PTXdist project and license conditions
> +# see the README file.
> +#
> +
> +#
> +# We provide this package
> +#
> +PACKAGES-$(PTXCONF_PYTHON3_CRYPTOGRAPHY) += python3-cryptography
> +
> +#
> +# Paths and names
> +#
> +PYTHON3_CRYPTOGRAPHY_VERSION         := 40.0.1
> +PYTHON3_CRYPTOGRAPHY_MD5             := 24dec990fce1d4a614ad86076c8e347f
> +PYTHON3_CRYPTOGRAPHY                 := 
> cryptography-$(PYTHON3_CRYPTOGRAPHY_VERSION)
> +PYTHON3_CRYPTOGRAPHY_SUFFIX          := tar.gz
> +PYTHON3_CRYPTOGRAPHY_URL             := $(call ptx/mirror-pypi, 
> cryptography, $(PYTHON3_CRYPTOGRAPHY).$(PYTHON3_CRYPTOGRAPHY_SUFFIX))
> +PYTHON3_CRYPTOGRAPHY_SOURCE          := 
> $(SRCDIR)/$(PYTHON3_CRYPTOGRAPHY).$(PYTHON3_CRYPTOGRAPHY_SUFFIX)
> +PYTHON3_CRYPTOGRAPHY_DIR             := $(BUILDDIR)/$(PYTHON3_CRYPTOGRAPHY)
> +PYTHON3_CRYPTOGRAPHY_LICENSE         := Apache-2.0 OR BSD-3-Clause
> +PYTHON3_CRYPTOGRAPHY_LICENSE_FILES   :=
> +
> +PYTHON3_CRYPTOGRAPHY_CARGO_LOCK              := 
> $(PYTHON3_CRYPTOGRAPHY_DIR)/src/rust/Cargo.lock
> +
> +
> +# 
> ----------------------------------------------------------------------------
> +# Prepare
> +# 
> ----------------------------------------------------------------------------
> +
> +PYTHON3_CRYPTOGRAPHY_CONF_TOOL       := python3
> +
> +# 
> ----------------------------------------------------------------------------
> +# Target-Install
> +# 
> ----------------------------------------------------------------------------
> +
> +$(STATEDIR)/python3-cryptography.targetinstall:
> +     @$(call targetinfo)
> +
> +     @$(call install_init, python3-cryptography)
> +     @$(call install_fixup, python3-cryptography,PRIORITY,optional)
> +     @$(call install_fixup, python3-cryptography,SECTION,base)
> +     @$(call install_fixup, python3-cryptography,AUTHOR,"Artur Wiebe 
> <ar...@4wiebe.de>")
> +     @$(call install_fixup, python3-cryptography,DESCRIPTION,missing)
> +
> +     @$(call install_glob, python3-cryptography, 0, 0, -, \
> +             $(PYTHON3_SITEPACKAGES),, *.py)
> +
> +     @$(call install_finish, python3-cryptography)
> +
> +     @$(call touch)
> +
> +# vim: syntax=make
> -- 
> 2.39.2
> 
>


Reply via email to