From f5658c7bbb34bc5426800e6eaa2599a7798c7f9d Mon Sep 17 00:00:00 2001 From: Daichi Yamamoto Date: Mon, 19 Aug 2024 09:03:04 +0900 Subject: [PATCH 1/6] cargo: add support for GitLab Signed-off-by: Daichi Yamamoto --- pycargoebuild/cargo.py | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/pycargoebuild/cargo.py b/pycargoebuild/cargo.py index 65a5006..9aa8752 100644 --- a/pycargoebuild/cargo.py +++ b/pycargoebuild/cargo.py @@ -63,11 +63,29 @@ class GitCrate(Crate): @property def download_url(self) -> str: - return f"{self.repository}/archive/{self.commit}.tar.gz" + if self.repository.startswith("https://github.com/"): + return f"{self.repository}/archive/{self.commit}.tar.gz" + if self.repository.startswith("https://gitlab."): + return (f"{self.repository}/-/archive/{self.commit}/" + f"{self.repo_name}-{self.commit}.tar.gz") + raise RuntimeError(f"Unsupported git crate source: " + f"{self.repository}") @property def filename(self) -> str: - return f"{self.repository.rpartition('/')[2]}-{self.commit}.gh.tar.gz" + return f"{self.repo_name}-{self.commit}{self.repo_ext}.tar.gz" + + @property + def repo_ext(self) -> str: + if self.repository.startswith("https://github.com/"): + return ".gh" + if self.repository.startswith("https://gitlab.com/"): + return ".gl" + return "" + + @property + def repo_name(self) -> str: + return self.repository.rpartition("/")[2] @functools.cache def get_workspace_toml(self, distdir: Path) -> dict: @@ -117,7 +135,11 @@ def get_package_directory(self, distdir: Path) -> PurePath: def get_git_crate_entry(self, distdir: Path) -> str: subdir = (str(self.get_package_directory(distdir)) .replace(self.commit, "%commit%")) - return f"{self.repository};{self.commit};{subdir}" + if self.repo_ext: + crate_uri = self.repository + else: + crate_uri = self.download_url.replace(self.commit, "%commit%") + return f"{crate_uri};{self.commit};{subdir}" @functools.cache def get_root_directory(self, distdir: Path) -> typing.Optional[PurePath]: @@ -186,7 +208,8 @@ def get_crates(f: typing.BinaryIO) -> typing.Generator[Crate, None, None]: yield FileCrate(name=p["name"], version=p["version"], checksum=p["checksum"]) - elif p["source"].startswith("git+https://github.com/"): + elif (p["source"].startswith("git+https://github.com/") or + p["source"].startswith("git+https://gitlab.")): parsed_url = urllib.parse.urlsplit(p["source"]) if not parsed_url.fragment: raise RuntimeError( @@ -196,11 +219,12 @@ def get_crates(f: typing.BinaryIO) -> typing.Generator[Crate, None, None]: if repo.endswith(".git"): repo = repo[:-4] if repo.count("/") != 1: - raise RuntimeError(f"Invalid GitHub URL: {p['source']}") + raise RuntimeError("Invalid GitHub/GitLab URL: " + f"{p['source']}") yield GitCrate( name=p["name"], version=p["version"], - repository=f"https://github.com/{repo}", + repository=f"https://{parsed_url.netloc}/{repo}", commit=parsed_url.fragment) else: raise RuntimeError(f"Unsupported crate source: {p['source']}") From 037a7b89895f4bcbf983706fb4de9b7d90be455a Mon Sep 17 00:00:00 2001 From: Daichi Yamamoto Date: Mon, 4 Nov 2024 12:57:00 +0900 Subject: [PATCH 2/6] cargo: refactor GitLab support based on reviews Signed-off-by: Daichi Yamamoto --- pycargoebuild/cargo.py | 63 +++++++++++++++++++++++++++++------------- 1 file changed, 44 insertions(+), 19 deletions(-) diff --git a/pycargoebuild/cargo.py b/pycargoebuild/cargo.py index 9aa8752..a37bf2f 100644 --- a/pycargoebuild/cargo.py +++ b/pycargoebuild/cargo.py @@ -3,6 +3,7 @@ # SPDX-License-Identifier: GPL-2.0-or-later import dataclasses +import enum import functools import sys import tarfile @@ -56,36 +57,62 @@ def crate_entry(self) -> str: return f"{self.name}@{self.version}" +class GitHost(enum.Enum): + GITHUB = enum.auto() + GITLAB = enum.auto() + GITLAB_SELFHOSTED = enum.auto() + + @dataclasses.dataclass(frozen=True) class GitCrate(Crate): repository: str commit: str + def __post_init__(self) -> None: + self.repo_host # check for supported git hosts + @property - def download_url(self) -> str: + def repo_host(self) -> GitHost: if self.repository.startswith("https://github.com/"): - return f"{self.repository}/archive/{self.commit}.tar.gz" + return GitHost.GITHUB + if self.repository.startswith("https://gitlab.com/"): + return GitHost.GITLAB if self.repository.startswith("https://gitlab."): - return (f"{self.repository}/-/archive/{self.commit}/" - f"{self.repo_name}-{self.commit}.tar.gz") - raise RuntimeError(f"Unsupported git crate source: " + return GitHost.GITLAB_SELFHOSTED + raise RuntimeError("Unsupported git crate source: " f"{self.repository}") @property - def filename(self) -> str: - return f"{self.repo_name}-{self.commit}{self.repo_ext}.tar.gz" + def repo_name(self) -> str: + return self.repository.rpartition("/")[2] @property def repo_ext(self) -> str: - if self.repository.startswith("https://github.com/"): - return ".gh" - if self.repository.startswith("https://gitlab.com/"): - return ".gl" - return "" + """Used by cargo.eclass to abbreviate crate URI""" + match self.repo_host: + case GitHost.GITHUB: + return ".gh" + case GitHost.GITLAB: + return ".gl" + case GitHost.GITLAB_SELFHOSTED: + return "" + case _ as host: + typing.assert_never(host) @property - def repo_name(self) -> str: - return self.repository.rpartition("/")[2] + def download_url(self) -> str: + match self.repo_host: + case GitHost.GITHUB: + return f"{self.repository}/archive/{self.commit}.tar.gz" + case GitHost.GITLAB | GitHost.GITLAB_SELFHOSTED: + return (f"{self.repository}/-/archive/{self.commit}/" + f"{self.repo_name}-{self.commit}.tar.gz") + case _ as host: + typing.assert_never(host) + + @property + def filename(self) -> str: + return f"{self.repo_name}-{self.commit}{self.repo_ext}.tar.gz" @functools.cache def get_workspace_toml(self, distdir: Path) -> dict: @@ -136,9 +163,8 @@ def get_git_crate_entry(self, distdir: Path) -> str: subdir = (str(self.get_package_directory(distdir)) .replace(self.commit, "%commit%")) if self.repo_ext: - crate_uri = self.repository - else: - crate_uri = self.download_url.replace(self.commit, "%commit%") + return f"{self.repository};{self.commit};{subdir}" + crate_uri = self.download_url.replace(self.commit, "%commit%") return f"{crate_uri};{self.commit};{subdir}" @functools.cache @@ -208,8 +234,7 @@ def get_crates(f: typing.BinaryIO) -> typing.Generator[Crate, None, None]: yield FileCrate(name=p["name"], version=p["version"], checksum=p["checksum"]) - elif (p["source"].startswith("git+https://github.com/") or - p["source"].startswith("git+https://gitlab.")): + elif (p["source"].startswith("git+")): parsed_url = urllib.parse.urlsplit(p["source"]) if not parsed_url.fragment: raise RuntimeError( From 947e079b164a56141b4d2b0ed2351a263fb6b5a8 Mon Sep 17 00:00:00 2001 From: Daichi Yamamoto Date: Mon, 4 Nov 2024 14:09:16 +0900 Subject: [PATCH 3/6] drop py3.9 Signed-off-by: Daichi Yamamoto --- .github/workflows/ci.yaml | 2 +- pyproject.toml | 2 +- tox.ini | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 1918b52..d4becc5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -4,7 +4,7 @@ jobs: ci: strategy: matrix: - python-version: ["3.9", "3.10", "3.11", "3.12", "3.13-dev", "pypy-3.9", "pypy-3.10"] + python-version: ["3.10", "3.11", "3.12", "3.13-dev", "pypy-3.10"] suite: ["py", "integration"] fail-fast: false runs-on: ubuntu-latest diff --git a/pyproject.toml b/pyproject.toml index bae440d..6cee024 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ classifiers = [ ] dynamic = ["version", "description"] readme = "README.rst" -requires-python = ">=3.9" +requires-python = ">=3.10" dependencies = [ "license_expression", "tomli >= 1.2.3; python_version < '3.11'", diff --git a/tox.ini b/tox.ini index 55bccdf..ec25081 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = qa,py39,py310,py311,py312,py313,pypy{39,310} +envlist = qa,py310,py311,py312,py313,pypy310 isolated_build = True [testenv] From b577cbf84405e46895612ab72b38c341c1cddb12 Mon Sep 17 00:00:00 2001 From: Daichi Yamamoto Date: Mon, 4 Nov 2024 14:16:16 +0900 Subject: [PATCH 4/6] cargo: refactor again GitLab support Signed-off-by: Daichi Yamamoto --- pycargoebuild/cargo.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/pycargoebuild/cargo.py b/pycargoebuild/cargo.py index a37bf2f..a399dd9 100644 --- a/pycargoebuild/cargo.py +++ b/pycargoebuild/cargo.py @@ -71,7 +71,7 @@ class GitCrate(Crate): def __post_init__(self) -> None: self.repo_host # check for supported git hosts - @property + @functools.cached_property def repo_host(self) -> GitHost: if self.repository.startswith("https://github.com/"): return GitHost.GITHUB @@ -162,10 +162,14 @@ def get_package_directory(self, distdir: Path) -> PurePath: def get_git_crate_entry(self, distdir: Path) -> str: subdir = (str(self.get_package_directory(distdir)) .replace(self.commit, "%commit%")) - if self.repo_ext: - return f"{self.repository};{self.commit};{subdir}" - crate_uri = self.download_url.replace(self.commit, "%commit%") - return f"{crate_uri};{self.commit};{subdir}" + match self.repo_host: + case GitHost.GITHUB | GitHost.GITLAB: + return f"{self.repository};{self.commit};{subdir}" + case GitHost.GITLAB_SELFHOSTED: + crate_uri = self.download_url.replace(self.commit, "%commit%") + return f"{crate_uri};{self.commit};{subdir}" + case _ as host: + typing.assert_never(host) @functools.cache def get_root_directory(self, distdir: Path) -> typing.Optional[PurePath]: @@ -234,7 +238,7 @@ def get_crates(f: typing.BinaryIO) -> typing.Generator[Crate, None, None]: yield FileCrate(name=p["name"], version=p["version"], checksum=p["checksum"]) - elif (p["source"].startswith("git+")): + elif p["source"].startswith("git+"): parsed_url = urllib.parse.urlsplit(p["source"]) if not parsed_url.fragment: raise RuntimeError( From 28ee5bb79607032a314234948f62037995abbd12 Mon Sep 17 00:00:00 2001 From: Daichi Yamamoto Date: Wed, 6 Nov 2024 02:13:32 +0900 Subject: [PATCH 5/6] cargo: add GitLab integration_test Signed-off-by: Daichi Yamamoto --- integration_test/license-mapping.conf | 1 + integration_test/news_flash_gtk-0.0.0.ebuild | 545 +++++++++++++++++++ integration_test/test_integration.py | 8 + 3 files changed, 554 insertions(+) create mode 100644 integration_test/news_flash_gtk-0.0.0.ebuild diff --git a/integration_test/license-mapping.conf b/integration_test/license-mapping.conf index 6d63472..c5681ec 100644 --- a/integration_test/license-mapping.conf +++ b/integration_test/license-mapping.conf @@ -17,4 +17,5 @@ MIT = MIT MPL-2.0 = MPL-2.0 OFL-1.1 = OFL-1.1 Unicode-DFS-2016 = Unicode-DFS-2016 +Unlicense = Unlicense Zlib = ZLIB diff --git a/integration_test/news_flash_gtk-0.0.0.ebuild b/integration_test/news_flash_gtk-0.0.0.ebuild new file mode 100644 index 0000000..969c539 --- /dev/null +++ b/integration_test/news_flash_gtk-0.0.0.ebuild @@ -0,0 +1,545 @@ +# Copyright 2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# Autogenerated by pycargoebuild 0.13.4 + +EAPI=8 + +CRATES=" + addr2line@0.22.0 + adler@1.0.2 + aes@0.7.5 + aho-corasick@1.1.3 + aligned-vec@0.5.0 + alloc-no-stdlib@2.0.4 + alloc-stdlib@0.2.2 + ammonia@3.3.0 + android-tzdata@0.1.1 + android_system_properties@0.1.5 + anyhow@1.0.86 + arbitrary@1.3.2 + arc-swap@1.7.1 + arg_enum_proc_macro@0.3.4 + arrayvec@0.7.4 + ashpd@0.9.1 + async-broadcast@0.7.1 + async-channel@2.3.1 + async-compression@0.4.12 + async-executor@1.13.0 + async-fs@2.1.2 + async-io@2.3.3 + async-lock@3.4.0 + async-net@2.0.0 + async-process@2.2.3 + async-recursion@1.1.1 + async-signal@0.2.9 + async-task@4.7.1 + async-trait@0.1.81 + atomic-waker@1.1.2 + autocfg@1.3.0 + av1-grain@0.2.3 + avif-serialize@0.8.1 + backtrace@0.3.73 + base64@0.21.7 + base64@0.22.1 + bigdecimal@0.4.5 + bit_field@0.10.2 + bitflags@1.3.2 + bitflags@2.6.0 + bitstream-io@2.5.0 + block-buffer@0.10.4 + block-buffer@0.9.0 + block-modes@0.8.1 + block-padding@0.2.1 + block@0.1.6 + blocking@1.6.1 + brotli-decompressor@4.0.1 + brotli@6.0.0 + built@0.7.4 + bumpalo@3.16.0 + bytemuck@1.16.1 + byteorder-lite@0.1.0 + byteorder@1.5.0 + bytes@1.6.1 + bytesize@1.3.0 + cairo-rs@0.20.0 + cairo-sys-rs@0.20.0 + cc@1.1.7 + cfg-expr@0.15.8 + cfg-if@1.0.0 + cfg_aliases@0.2.1 + chrono@0.4.38 + cipher@0.3.0 + color-backtrace@0.6.1 + color_quant@1.1.0 + commafeed_api@0.2.1 + concurrent-queue@2.5.0 + cookie@0.18.1 + cookie_store@0.21.0 + core-foundation-sys@0.8.6 + core-foundation@0.9.4 + cpufeatures@0.2.12 + crc-any@2.5.0 + crc32fast@1.4.2 + crossbeam-channel@0.5.13 + crossbeam-deque@0.8.5 + crossbeam-epoch@0.9.18 + crossbeam-utils@0.8.20 + crunchy@0.2.2 + crypto-common@0.1.6 + darling@0.20.10 + darling_core@0.20.10 + darling_macro@0.20.10 + data-encoding@2.6.0 + debug-helper@0.3.13 + deranged@0.3.11 + derivative@2.2.0 + des@0.7.0 + destructure_traitobject@0.2.0 + diesel@2.2.2 + diesel_derives@2.2.2 + diesel_migrations@2.2.0 + diesel_table_macro_syntax@0.2.0 + diffus-derive@0.10.0 + diffus@0.10.0 + digest@0.10.7 + digest@0.9.0 + dirs-sys@0.4.1 + dirs@5.0.1 + dsl_auto_type@0.1.2 + either@1.13.0 + encoding_rs@0.8.34 + endi@1.1.0 + entities@1.0.1 + enum-as-inner@0.6.0 + enumflags2@0.7.10 + enumflags2_derive@0.7.10 + equivalent@1.0.1 + errno@0.3.9 + escaper@0.1.1 + event-listener-strategy@0.5.2 + event-listener@5.3.1 + exr@1.72.0 + eyre@0.6.12 + fastrand@2.1.0 + fdeflate@0.3.4 + feed-rs@2.1.0 + feedbin_api@0.3.0 + feedly_api@0.6.0 + fever_api@0.5.0 + field-offset@0.3.6 + flate2@1.0.30 + flume@0.11.0 + fnv@1.0.7 + foreign-types-shared@0.1.1 + foreign-types@0.3.2 + form_urlencoded@1.2.1 + futf@0.1.5 + futures-channel@0.3.30 + futures-core@0.3.30 + futures-executor@0.3.30 + futures-io@0.3.30 + futures-lite@2.3.0 + futures-macro@0.3.30 + futures-sink@0.3.30 + futures-task@0.3.30 + futures-util@0.3.30 + futures@0.3.30 + gdk-pixbuf-sys@0.20.0 + gdk-pixbuf@0.20.0 + gdk4-sys@0.9.0 + gdk4@0.9.0 + generic-array@0.14.7 + getrandom@0.2.15 + gettext-rs@0.7.0 + gettext-sys@0.21.3 + gif@0.13.1 + gimli@0.29.0 + gio-sys@0.20.0 + gio@0.20.0 + glib-macros@0.20.0 + glib-sys@0.20.0 + glib@0.20.0 + gobject-sys@0.20.0 + graphene-rs@0.20.0 + graphene-sys@0.20.0 + greader_api@0.5.0 + gsk4-sys@0.9.0 + gsk4@0.9.0 + gstreamer-sys@0.23.0 + gstreamer@0.23.0 + gtk4-macros@0.9.0 + gtk4-sys@0.9.0 + gtk4@0.9.0 + h2@0.4.5 + half@2.4.1 + hard-xml-derive@1.36.0 + hard-xml@1.36.0 + hashbrown@0.14.5 + heck@0.4.1 + heck@0.5.0 + hermit-abi@0.3.9 + hermit-abi@0.4.0 + hex@0.4.3 + hickory-proto@0.24.1 + hickory-resolver@0.24.1 + hostname@0.3.1 + html2pango@0.6.0 + html5ever@0.26.0 + http-body-util@0.1.2 + http-body@1.0.1 + http@1.1.0 + httparse@1.9.4 + humantime@2.1.0 + hyper-rustls@0.27.2 + hyper-tls@0.6.0 + hyper-util@0.1.6 + hyper@1.4.1 + iana-time-zone-haiku@0.1.2 + iana-time-zone@0.1.60 + ident_case@1.0.1 + idna@0.3.0 + idna@0.4.0 + idna@0.5.0 + image-webp@0.1.3 + image@0.25.2 + imgref@1.10.1 + indenter@0.3.3 + indexmap@2.2.6 + interpolate_name@0.2.4 + ipconfig@0.3.2 + ipnet@2.9.0 + ipnetwork@0.20.0 + itertools@0.10.5 + itertools@0.12.1 + itertools@0.13.0 + itoa@1.0.11 + javascriptcore6-sys@0.4.0 + javascriptcore6@0.4.0 + jetscii@0.5.3 + jobserver@0.1.32 + jpeg-decoder@0.3.1 + js-sys@0.3.69 + lazy_static@1.5.0 + lebe@0.5.2 + libadwaita-sys@0.7.0 + libadwaita@0.7.0 + libc@0.2.155 + libfuzzer-sys@0.4.7 + libm@0.2.8 + libredox@0.1.3 + libsqlite3-sys@0.29.0 + libxml@0.3.3 + linked-hash-map@0.5.6 + linkify@0.9.0 + linux-raw-sys@0.4.14 + locale_config@0.3.0 + lock_api@0.4.12 + log-mdc@0.1.0 + log4rs@1.3.0 + log@0.4.22 + loop9@0.1.5 + lru-cache@0.1.2 + mac@0.1.1 + magic-crypt@3.1.13 + malloc_buf@0.0.6 + maplit@1.0.2 + markup5ever@0.11.0 + markup5ever_rcdom@0.2.0 + match_cfg@0.1.0 + maybe-rayon@0.1.1 + md-5@0.9.1 + md5@0.7.0 + mediatype@0.19.18 + memchr@2.7.4 + memoffset@0.9.1 + migrations_internals@2.2.0 + migrations_macros@2.2.0 + mime@0.3.17 + mime_guess@2.0.5 + miniflux_api@0.7.1 + minimal-lexical@0.2.1 + miniz_oxide@0.7.4 + mio@1.0.1 + moka@0.12.8 + muldiv@1.0.1 + nanohtml2text@0.1.4 + native-tls@0.2.12 + new_debug_unreachable@1.0.6 + nextcloud_news_api@0.4.0 + nix@0.29.0 + nom@7.1.3 + noop_proc_macro@0.3.0 + num-bigint@0.4.6 + num-conv@0.1.0 + num-derive@0.4.2 + num-integer@0.1.46 + num-rational@0.4.2 + num-traits@0.2.19 + num_cpus@1.16.0 + obfstr@0.4.3 + objc-foundation@0.1.1 + objc@0.2.7 + objc_id@0.1.1 + object@0.36.2 + once_cell@1.19.0 + opaque-debug@0.3.1 + openssl-macros@0.1.1 + openssl-probe@0.1.5 + openssl-sys@0.9.103 + openssl@0.10.66 + opml@1.1.6 + option-ext@0.2.0 + option-operations@0.5.0 + ordered-float@2.10.1 + ordered-stream@0.2.0 + pango-sys@0.20.0 + pango@0.20.0 + parking@2.2.0 + parking_lot@0.12.3 + parking_lot_core@0.9.10 + paste@1.0.15 + percent-encoding@2.3.1 + phf@0.10.1 + phf_codegen@0.10.0 + phf_generator@0.10.0 + phf_shared@0.10.0 + pin-project-internal@1.1.5 + pin-project-lite@0.2.14 + pin-project@1.1.5 + pin-utils@0.1.0 + piper@0.2.3 + pkg-config@0.3.30 + png@0.17.13 + polling@3.7.2 + powerfmt@0.2.0 + ppv-lite86@0.2.17 + precomputed-hash@0.1.1 + proc-macro-crate@3.1.0 + proc-macro2@1.0.86 + profiling-procmacros@1.0.15 + profiling@1.0.15 + psl-types@2.0.11 + publicsuffix@2.2.3 + qoi@0.4.1 + quanta@0.12.3 + quick-error@1.2.3 + quick-error@2.0.1 + quick-xml@0.36.1 + quote@1.0.36 + r2d2@0.8.10 + rand@0.8.5 + rand_chacha@0.3.1 + rand_core@0.6.4 + random_color@0.8.0 + rav1e@0.7.1 + ravif@0.11.9 + raw-cpuid@11.1.0 + rayon-core@1.12.1 + rayon@1.10.0 + rc-writer@1.1.10 + redox_syscall@0.5.3 + redox_users@0.4.5 + regex-automata@0.4.7 + regex-syntax@0.8.4 + regex@1.10.5 + reqwest@0.12.5 + resolv-conf@0.7.0 + rgb@0.8.45 + ring@0.17.8 + rust-embed-impl@8.5.0 + rust-embed-utils@8.5.0 + rust-embed@8.5.0 + rustc-demangle@0.1.24 + rustc_version@0.4.0 + rustix@0.38.34 + rustls-pemfile@2.1.2 + rustls-pki-types@1.7.0 + rustls-webpki@0.102.6 + rustls@0.23.12 + ryu@1.0.18 + same-file@1.0.6 + sanitize-filename@0.5.0 + schannel@0.1.23 + scheduled-thread-pool@0.2.7 + scopeguard@1.2.0 + security-framework-sys@2.11.1 + security-framework@2.11.1 + semver@1.0.23 + serde-value@0.7.0 + serde@1.0.204 + serde_derive@1.0.204 + serde_json@1.0.121 + serde_repr@0.1.19 + serde_spanned@0.6.7 + serde_urlencoded@0.7.1 + serde_yaml@0.9.34+deprecated + sha1@0.10.6 + sha2@0.10.8 + sha2@0.9.9 + shellexpand@3.1.0 + signal-hook-registry@1.4.2 + simd-adler32@0.3.7 + simd_helpers@0.1.0 + siphasher@0.3.11 + siphasher@1.0.1 + slab@0.4.9 + smallvec@1.13.2 + socket2@0.5.7 + soup3-sys@0.7.0 + soup3@0.7.0 + spin@0.9.8 + static_assertions@1.1.0 + string_cache@0.8.7 + string_cache_codegen@0.5.2 + strsim@0.11.1 + subtle@2.6.1 + syn@1.0.109 + syn@2.0.72 + sync_wrapper@1.0.1 + system-configuration-sys@0.5.0 + system-configuration@0.5.1 + system-deps@6.2.2 + system-deps@7.0.1 + tagptr@0.2.0 + target-lexicon@0.12.15 + temp-dir@0.1.13 + tempfile@3.10.1 + tendril@0.4.3 + termcolor@1.4.1 + thiserror-impl@1.0.63 + thiserror@1.0.63 + thread-id@4.2.2 + tiff@0.9.1 + tiger@0.1.0 + time-core@0.1.2 + time-macros@0.2.18 + time@0.3.36 + tinyvec@1.8.0 + tinyvec_macros@0.1.1 + tokio-macros@2.4.0 + tokio-native-tls@0.3.1 + tokio-rustls@0.26.0 + tokio-socks@0.5.2 + tokio-util@0.7.11 + tokio@1.39.2 + toml@0.8.16 + toml_datetime@0.6.7 + toml_edit@0.21.1 + toml_edit@0.22.17 + tower-layer@0.3.2 + tower-service@0.3.2 + tower@0.4.13 + tracing-attributes@0.1.27 + tracing-core@0.1.32 + tracing@0.1.40 + triomphe@0.1.11 + try-lock@0.2.5 + typemap-ors@1.0.0 + typenum@1.17.0 + uds_windows@1.1.0 + unic-char-property@0.9.0 + unic-char-range@0.9.0 + unic-common@0.9.0 + unic-emoji-char@0.9.0 + unic-ucd-version@0.9.0 + unicase@2.7.0 + unicode-bidi@0.3.15 + unicode-ident@1.0.12 + unicode-normalization@0.1.23 + unsafe-any-ors@1.0.0 + unsafe-libyaml@0.2.11 + untrusted@0.9.0 + url@2.5.2 + utf-8@0.7.6 + uuid@1.10.0 + v_frame@0.3.8 + vcpkg@0.2.15 + version-compare@0.2.0 + version_check@0.9.5 + walkdir@2.5.0 + want@0.3.1 + wasi@0.11.0+wasi-snapshot-preview1 + wasm-bindgen-backend@0.2.92 + wasm-bindgen-futures@0.4.42 + wasm-bindgen-macro-support@0.2.92 + wasm-bindgen-macro@0.2.92 + wasm-bindgen-shared@0.2.92 + wasm-bindgen@0.2.92 + wasm-streams@0.4.0 + web-sys@0.3.69 + webkit6-sys@0.4.0 + webkit6@0.4.0 + weezl@0.1.8 + widestring@1.1.0 + winapi-i686-pc-windows-gnu@0.4.0 + winapi-util@0.1.8 + winapi-x86_64-pc-windows-gnu@0.4.0 + winapi@0.3.9 + windows-core@0.52.0 + windows-sys@0.48.0 + windows-sys@0.52.0 + windows-targets@0.48.5 + windows-targets@0.52.6 + windows_aarch64_gnullvm@0.48.5 + windows_aarch64_gnullvm@0.52.6 + windows_aarch64_msvc@0.48.5 + windows_aarch64_msvc@0.52.6 + windows_i686_gnu@0.48.5 + windows_i686_gnu@0.52.6 + windows_i686_gnullvm@0.52.6 + windows_i686_msvc@0.48.5 + windows_i686_msvc@0.52.6 + windows_x86_64_gnu@0.48.5 + windows_x86_64_gnu@0.52.6 + windows_x86_64_gnullvm@0.48.5 + windows_x86_64_gnullvm@0.52.6 + windows_x86_64_msvc@0.48.5 + windows_x86_64_msvc@0.52.6 + winnow@0.5.40 + winnow@0.6.16 + winreg@0.50.0 + winreg@0.52.0 + xdg-home@1.2.0 + xml-rs@0.8.20 + xml5ever@0.17.0 + xmlparser@0.13.6 + xmltree@0.10.3 + zbus@4.4.0 + zbus_macros@4.4.0 + zbus_names@3.0.0 + zeroize@1.8.1 + zune-core@0.4.12 + zune-inflate@0.2.54 + zune-jpeg@0.4.13 + zvariant@4.2.0 + zvariant_derive@4.2.0 + zvariant_utils@2.1.0 +" + +declare -A GIT_CRATES=( + [article_scraper]='https://gitlab.com/news-flash/article_scraper;b3ce28632dab8678ae04789aeae76262283b1bb0;article_scraper-%commit%/article_scraper' + [clapper-gtk-sys]='https://gitlab.gnome.org/JanGernert/clapper-rs/-/archive/%commit%/clapper-rs-%commit%.tar.gz;31161aa56fffe9cabd0a46159198949082f9d035;clapper-rs-%commit%/libclapper-gtk-rs/sys' + [clapper-gtk]='https://gitlab.gnome.org/JanGernert/clapper-rs/-/archive/%commit%/clapper-rs-%commit%.tar.gz;31161aa56fffe9cabd0a46159198949082f9d035;clapper-rs-%commit%/libclapper-gtk-rs' + [clapper-sys]='https://gitlab.gnome.org/JanGernert/clapper-rs/-/archive/%commit%/clapper-rs-%commit%.tar.gz;31161aa56fffe9cabd0a46159198949082f9d035;clapper-rs-%commit%/libclapper-rs/sys' + [clapper]='https://gitlab.gnome.org/JanGernert/clapper-rs/-/archive/%commit%/clapper-rs-%commit%.tar.gz;31161aa56fffe9cabd0a46159198949082f9d035;clapper-rs-%commit%/libclapper-rs' + [news-flash]='https://gitlab.com/news_flash/news_flash;2ec37e6fccac4e7ef295a76ffda97a0d71ed2e74;news_flash-%commit%' + [newsblur_api]='https://gitlab.com/news-flash/newsblur_api;1e2b41e52a19e28c41a981fca6823f9447d82df4;newsblur_api-%commit%' +) + +inherit cargo + +DESCRIPTION="Feed Reader written in GTK" +HOMEPAGE="" +SRC_URI=" + ${CARGO_CRATE_URIS} +" + +LICENSE="" +# Dependent crate licenses +LICENSE+=" + Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD GPL-3+ ISC MIT + MPL-2.0 Unicode-DFS-2016 Unlicense +" +SLOT="0" +KEYWORDS="~amd64" diff --git a/integration_test/test_integration.py b/integration_test/test_integration.py index 9136729..7bb7c85 100644 --- a/integration_test/test_integration.py +++ b/integration_test/test_integration.py @@ -150,6 +150,14 @@ class Package(typing.NamedTuple): checksum="52fd58ffd0865793eb96f4c959c971eb" "e724881863ab0dafca445baf89d21714", directories=["matrix_synapse-1.72.0/rust"]), + "news_flash_gtk-0.0.0.ebuild": Package( + url="https://gitlab.com/news-flash/news_flash_gtk/-/archive/" + "v.3.3.4/news_flash_gtk-v.3.3.4.tar.gz", + checksum="f408f4c2d1e1507008ef583868b84827" + "08d13269b86b8e22d2ba73da9c93a0ae", + directories=["news_flash_gtk-v.3.3.4"], + has_crates_without_license=True, + uses_license_file=True), } From 0517440807adf78ed0ff09198a70cf702a1517c4 Mon Sep 17 00:00:00 2001 From: Daichi Yamamoto Date: Thu, 7 Nov 2024 20:58:14 +0900 Subject: [PATCH 6/6] cargo: test_cargo.py: add GitLab Signed-off-by: Daichi Yamamoto --- test/test_cargo.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/test_cargo.py b/test/test_cargo.py index 88a58b6..eefc99b 100644 --- a/test/test_cargo.py +++ b/test/test_cargo.py @@ -58,6 +58,18 @@ version = "0.6.28" source = """git+https://github.com/01mf02/regex.git/?rev=90eebbd\\ #90eebbdb9396ca10510130327073a3d596674d04""" + + [[package]] + name = "virtiofsd" + version = "1.12.0" + source = """git+https://gitlab.com/virtio-fs/virtiofsd?tag=v1.12.0\\ + #af439fbf89f53e18021e8d01dbbb7f66ffd824c1""" + + [[package]] + name = "pipewire" + version = "0.8.0" + source = """git+https://gitlab.freedesktop.org/pipewire/pipewire-rs\\ + ?tag=v0.8.0#449bf53f5d5edc8d0be6c0c80bc19d882f712dd7""" ''' CRATES = [ @@ -70,6 +82,12 @@ GitCrate("regex-syntax", "0.6.28", "https://github.com/01mf02/regex", "90eebbdb9396ca10510130327073a3d596674d04"), + GitCrate("virtiofsd", "1.12.0", + "https://gitlab.com/virtio-fs/virtiofsd", + "af439fbf89f53e18021e8d01dbbb7f66ffd824c1"), + GitCrate("pipewire", "0.8.0", + "https://gitlab.freedesktop.org/pipewire/pipewire-rs", + "449bf53f5d5edc8d0be6c0c80bc19d882f712dd7"), ]