Signed-off-by: Artur Wiebe <ar...@4wiebe.de> --- patches/setuptools-rust-1.5.2/series | 1 + .../use-Literal-from-typing.patch | 53 +++++++++++++++++++ rules/host-python3-setuptools-rust.in | 7 +++ rules/host-python3-setuptools-rust.make | 33 ++++++++++++ 4 files changed, 94 insertions(+) create mode 100644 patches/setuptools-rust-1.5.2/series create mode 100644 patches/setuptools-rust-1.5.2/use-Literal-from-typing.patch create mode 100644 rules/host-python3-setuptools-rust.in create mode 100644 rules/host-python3-setuptools-rust.make
diff --git a/patches/setuptools-rust-1.5.2/series b/patches/setuptools-rust-1.5.2/series new file mode 100644 index 000000000..b69a0d2bb --- /dev/null +++ b/patches/setuptools-rust-1.5.2/series @@ -0,0 +1 @@ +use-Literal-from-typing.patch diff --git a/patches/setuptools-rust-1.5.2/use-Literal-from-typing.patch b/patches/setuptools-rust-1.5.2/use-Literal-from-typing.patch new file mode 100644 index 000000000..186a0279e --- /dev/null +++ b/patches/setuptools-rust-1.5.2/use-Literal-from-typing.patch @@ -0,0 +1,53 @@ +From b3ac96d620caae2834770f5a744db507846868c6 Mon Sep 17 00:00:00 2001 +From: Artur Wiebe <ar...@4wiebe.de> +Date: Mon, 27 Mar 2023 14:49:44 +0200 +Subject: [PATCH] use Literal from typing + +--- + setuptools_rust/build.py | 2 +- + setuptools_rust/extension.py | 2 +- + setuptools_rust/setuptools_ext.py | 2 +- + 3 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/setuptools_rust/build.py b/setuptools_rust/build.py +index 21c1975..ff94cb0 100644 +--- a/setuptools_rust/build.py ++++ b/setuptools_rust/build.py +@@ -23,7 +23,7 @@ import pkg_resources + from setuptools.command.build import build as CommandBuild # type: ignore[import] + from setuptools.command.build_ext import build_ext as CommandBuildExt + from setuptools.command.build_ext import get_abi3_suffix +-from typing_extensions import Literal ++from typing import Literal + + from ._utils import format_called_process_error + from .command import RustCommand +diff --git a/setuptools_rust/extension.py b/setuptools_rust/extension.py +index f7a09d1..537a8db 100644 +--- a/setuptools_rust/extension.py ++++ b/setuptools_rust/extension.py +@@ -9,7 +9,7 @@ from functools import lru_cache + from typing import Any, Dict, List, NewType, Optional, Sequence, Union, cast + + from semantic_version import SimpleSpec +-from typing_extensions import Literal ++from typing import Literal + + from ._utils import format_called_process_error + +diff --git a/setuptools_rust/setuptools_ext.py b/setuptools_rust/setuptools_ext.py +index 8ce281e..943b2e9 100644 +--- a/setuptools_rust/setuptools_ext.py ++++ b/setuptools_rust/setuptools_ext.py +@@ -11,7 +11,7 @@ from setuptools.command.install_lib import install_lib + from setuptools.command.install_scripts import install_scripts + from setuptools.command.sdist import sdist + from setuptools.dist import Distribution +-from typing_extensions import Literal ++from typing import Literal + + from .extension import RustBin, RustExtension + +-- +2.39.2 + diff --git a/rules/host-python3-setuptools-rust.in b/rules/host-python3-setuptools-rust.in new file mode 100644 index 000000000..37af602f3 --- /dev/null +++ b/rules/host-python3-setuptools-rust.in @@ -0,0 +1,7 @@ +## SECTION=hosttools_noprompt + +config HOST_PYTHON3_SETUPTOOLS_RUST + tristate + default y if ALLYES + select HOST_PYTHON3_SETUPTOOLS + select HOST_PYTHON3_SEMANTIC_VERSION diff --git a/rules/host-python3-setuptools-rust.make b/rules/host-python3-setuptools-rust.make new file mode 100644 index 000000000..6414ac062 --- /dev/null +++ b/rules/host-python3-setuptools-rust.make @@ -0,0 +1,33 @@ +# -*-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 +# +HOST_PACKAGES-$(PTXCONF_HOST_PYTHON3_SETUPTOOLS_RUST) += host-python3-setuptools-rust + +# +# Paths and names +# +HOST_PYTHON3_SETUPTOOLS_RUST_VERSION := 1.5.2 +HOST_PYTHON3_SETUPTOOLS_RUST_MD5 := fd3412ca77ffd6e06e2e83d0e9636084 +HOST_PYTHON3_SETUPTOOLS_RUST := setuptools-rust-$(HOST_PYTHON3_SETUPTOOLS_RUST_VERSION) +HOST_PYTHON3_SETUPTOOLS_RUST_SUFFIX := tar.gz +HOST_PYTHON3_SETUPTOOLS_RUST_URL := $(call ptx/mirror-pypi, setuptools-rust, $(HOST_PYTHON3_SETUPTOOLS_RUST).$(HOST_PYTHON3_SETUPTOOLS_RUST_SUFFIX)) +HOST_PYTHON3_SETUPTOOLS_RUST_SOURCE := $(SRCDIR)/$(HOST_PYTHON3_SETUPTOOLS_RUST).$(HOST_PYTHON3_SETUPTOOLS_RUST_SUFFIX) +HOST_PYTHON3_SETUPTOOLS_RUST_DIR := $(HOST_BUILDDIR)/$(HOST_PYTHON3_SETUPTOOLS_RUST) +HOST_PYTHON3_SETUPTOOLS_RUST_LICENSE := MIT +HOST_PYTHON3_SETUPTOOLS_RUST_LICENSE_FILES := file://LICENSE;md5=011cd92e702dd9e6b1a26157b6fd53f5 + +# ---------------------------------------------------------------------------- +# Prepare +# ---------------------------------------------------------------------------- + +HOST_PYTHON3_SETUPTOOLS_RUST_CONF_TOOL := python3 + +# vim: syntax=make -- 2.40.0