maturin: Update to 1.3.0, build as Python (host-only) package 22393/head
authorJeffery To <jeffery.to@gmail.com>
Fri, 13 Oct 2023 17:51:09 +0000 (01:51 +0800)
committerJeffery To <jeffery.to@gmail.com>
Fri, 13 Oct 2023 17:51:09 +0000 (01:51 +0800)
Python packages that use maturin to build do not call the maturin
program directly; they use the maturin build backend[1]. This build
backend is a Python library provided with maturin that interfaces with
the maturin program.

This changes the maturin package to use the Python build process so that
the build backend is installed correctly.

This also renames the source package to python-maturin and moves it into
the lang/python directory.

[1]: https://www.maturin.rs/#source-distribution

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
lang/maturin/Makefile [deleted file]
lang/python/python-maturin/Makefile [new file with mode: 0644]

diff --git a/lang/maturin/Makefile b/lang/maturin/Makefile
deleted file mode 100644 (file)
index 220e31f..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-# SPDX-License-Identifier: GPL-2.0-only
-#
-# Copyright (C) 2023 Luca Barbato
-
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=maturin
-PKG_VERSION:=0.14.15
-PKG_RELEASE:=1
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
-PKG_SOURCE_URL:=https://codeload.github.com/PyO3/maturin/tar.gz/v$(PKG_VERSION)?
-PKG_HASH:=60cbf8ff73a36333c3f5483ca679a52169839db381f06683d8e61a6c00c28cf7
-
-PKG_MAINTAINER:=Luca Barbato <lu_zero@luminem.org>
-PKG_LICENSE:=Apache-2.0 MIT
-PKG_LICENSE_FILES:=license-apache license-mit
-
-HOST_BUILD_DEPENDS:=rust/host
-HOST_BUILD_PARALLEL:=1
-PKG_HOST_ONLY:=1
-
-include $(INCLUDE_DIR)/host-build.mk
-include $(INCLUDE_DIR)/package.mk
-include ../rust/rust-host-build.mk
-
-define Package/maturin
-  SECTION:=lang
-  CATEGORY:=Languages
-  SUBMENU:=Rust
-  TITLE:=Build and publish crates as python packages
-  DEPENDS:=$(RUST_ARCH_DEPENDS)
-  URL:=https://maturin.rs
-endef
-
-define Package/maturin/description
-  Build and publish crates with pyo3, rust-cpython, cffi and uniffi
-  bindings as well as rust binaries as python packages.
-endef
-
-$(eval $(call RustBinHostBuild))
-$(eval $(call HostBuild))
-$(eval $(call BuildPackage,maturin))
diff --git a/lang/python/python-maturin/Makefile b/lang/python/python-maturin/Makefile
new file mode 100644 (file)
index 0000000..67bb1e0
--- /dev/null
@@ -0,0 +1,51 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Copyright (C) 2023 Luca Barbato
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=python-maturin
+PKG_VERSION:=1.3.0
+PKG_RELEASE:=1
+
+PYPI_NAME:=maturin
+PKG_HASH:=f6c69bc7ae147a5effd55587447b35cab1ceb726ba244d08698bc7518b8688ac
+
+PKG_MAINTAINER:=Luca Barbato <lu_zero@luminem.org>
+PKG_LICENSE:=Apache-2.0 MIT
+PKG_LICENSE_FILES:=license-apache license-mit
+
+HOST_BUILD_DEPENDS:= \
+       python3/host \
+       python-build/host \
+       python-installer/host \
+       python-wheel/host \
+       python-setuptools-rust/host
+HOST_BUILD_PARALLEL:=1
+PKG_HOST_ONLY:=1
+
+include ../pypi.mk
+include $(INCLUDE_DIR)/host-build.mk
+include $(INCLUDE_DIR)/package.mk
+include ../python3-package.mk
+include ../python3-host-build.mk
+
+define Package/python3-maturin
+  SECTION:=lang
+  CATEGORY:=Languages
+  SUBMENU:=Python
+  TITLE:=Build and publish crates as python packages
+  DEPENDS:=$(RUST_ARCH_DEPENDS)
+  URL:=https://maturin.rs
+  BUILDONLY:=1
+endef
+
+define Package/python3-maturin/description
+  Build and publish crates with pyo3, rust-cpython, cffi and uniffi
+  bindings as well as rust binaries as python packages.
+endef
+
+$(eval $(call HostBuild))
+$(eval $(call Py3Package,python3-maturin))
+$(eval $(call BuildPackage,python3-maturin))
+$(eval $(call BuildPackage,python3-maturin-src))