parent
b92078eee5
commit
e1ab69eff6
@ -1,21 +0,0 @@
|
|||||||
From 0aa82d22b00b4191ddff1e9ba9cb53686481f8ac Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
||||||
Date: Tue, 22 Feb 2022 11:28:52 +0100
|
|
||||||
Subject: [PATCH 1/2] Add comment about unused macro
|
|
||||||
|
|
||||||
---
|
|
||||||
data/macros.rust | 1 +
|
|
||||||
1 file changed, 1 insertion(+)
|
|
||||||
|
|
||||||
diff --git a/data/macros.rust b/data/macros.rust
|
|
||||||
index 0940d06485..3a9281849f 100644
|
|
||||||
--- a/data/macros.rust
|
|
||||||
+++ b/data/macros.rust
|
|
||||||
@@ -14,6 +14,7 @@
|
|
||||||
|
|
||||||
%__global_rustflags %{build_rustflags}
|
|
||||||
|
|
||||||
+# Currently unused, retained for backwards compatibility.
|
|
||||||
%__global_rustflags_toml [%{lua:
|
|
||||||
for arg in string.gmatch(rpm.expand("%{build_rustflags}"), "%S+") do
|
|
||||||
print('"' .. arg .. '", ')
|
|
@ -1,40 +0,0 @@
|
|||||||
From 1b14d44d5705e2c87bc52d56f9ea184994669da1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
||||||
Date: Tue, 22 Feb 2022 11:41:46 +0100
|
|
||||||
Subject: [PATCH 2/2] Allow easy overriding of the
|
|
||||||
opt-level/debuginfo/codegen-units flags
|
|
||||||
|
|
||||||
Some crates use debuginfo=0 or debuginfo=1 to reduce memory pressure during
|
|
||||||
builds. This should make this easy.
|
|
||||||
|
|
||||||
Fixes https://pagure.io/fedora-rust/rust2rpm/issue/181
|
|
||||||
---
|
|
||||||
data/macros.rust | 10 +++++++---
|
|
||||||
1 file changed, 7 insertions(+), 3 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/data/macros.rust b/data/macros.rust
|
|
||||||
index 3a9281849f..efa46a3212 100644
|
|
||||||
--- a/data/macros.rust
|
|
||||||
+++ b/data/macros.rust
|
|
||||||
@@ -1,14 +1,18 @@
|
|
||||||
%__rustc %{_bindir}/rustc
|
|
||||||
%__rustdoc %{_bindir}/rustdoc
|
|
||||||
|
|
||||||
+%rustflags_opt_level 3
|
|
||||||
+%rustflags_debuginfo 2
|
|
||||||
+%rustflags_codegen_units 1
|
|
||||||
+
|
|
||||||
# Enable optimization, debuginfo, and link hardening.
|
|
||||||
%build_rustflags %{shrink:
|
|
||||||
- -Copt-level=3
|
|
||||||
- -Cdebuginfo=2
|
|
||||||
+ -Copt-level=%rustflags_opt_level
|
|
||||||
+ -Cdebuginfo=%rustflags_debuginfo
|
|
||||||
+ -Ccodegen-units=%rustflags_codegen_units
|
|
||||||
-Clink-arg=-Wl,-z,relro
|
|
||||||
-Clink-arg=-Wl,-z,now
|
|
||||||
%{?_package_note_file:-Clink-arg=-Wl,-dT,%{_package_note_file}}
|
|
||||||
- -Ccodegen-units=1
|
|
||||||
--cap-lints=warn
|
|
||||||
}
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
|||||||
From b9e95b4d61739f21c2f64ee3df497d93272a67af Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
||||||
Date: Mon, 28 Feb 2022 14:01:20 +0100
|
|
||||||
Subject: [PATCH 2/3] Fix autodetection of rpmautospec
|
|
||||||
|
|
||||||
When store_true or store_false are used, the default default changes
|
|
||||||
from None to a boolean. I didn't know about this, and I wrote the code
|
|
||||||
to assume args.rpmautospec would be None. rpmautospec detection was
|
|
||||||
effectively always disabled.
|
|
||||||
---
|
|
||||||
rust2rpm/__main__.py | 2 ++
|
|
||||||
1 file changed, 2 insertions(+)
|
|
||||||
|
|
||||||
diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py
|
|
||||||
index 0f575ad12f..13dc26a313 100644
|
|
||||||
--- a/rust2rpm/__main__.py
|
|
||||||
+++ b/rust2rpm/__main__.py
|
|
||||||
@@ -360,8 +360,10 @@ def main():
|
|
||||||
parser.add_argument("-s", "--store-crate", action="store_true",
|
|
||||||
help="Store crate in current directory")
|
|
||||||
parser.add_argument("-a", "--rpmautospec", action="store_true",
|
|
||||||
+ default=None,
|
|
||||||
help="Use autorelease and autochangelog features")
|
|
||||||
parser.add_argument("--no-rpmautospec", action="store_false",
|
|
||||||
+ default=None,
|
|
||||||
help="Do not use rpmautospec")
|
|
||||||
parser.add_argument("--relative-license-paths", action="store_true",
|
|
||||||
help="Put all license files in main license directory")
|
|
||||||
--
|
|
||||||
2.35.1
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
|||||||
From 7d8c9a802866ef0a35ab4d67d8869f30c650827a Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
|
|
||||||
Date: Mon, 28 Feb 2022 10:32:10 +0100
|
|
||||||
Subject: [PATCH 3/3] Print information about written files
|
|
||||||
|
|
||||||
We already output some messages, but not the most important part: what
|
|
||||||
files were written.
|
|
||||||
---
|
|
||||||
rust2rpm/__main__.py | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/rust2rpm/__main__.py b/rust2rpm/__main__.py
|
|
||||||
index 13dc26a313..a011217443 100644
|
|
||||||
--- a/rust2rpm/__main__.py
|
|
||||||
+++ b/rust2rpm/__main__.py
|
|
||||||
@@ -515,10 +515,11 @@ def main():
|
|
||||||
with open(spec_file, "w") as fobj:
|
|
||||||
fobj.write(spec_contents)
|
|
||||||
fobj.write("\n")
|
|
||||||
+ print(f'Wrote {fobj.name}')
|
|
||||||
if patch_file is not None:
|
|
||||||
with open(patch_file, "w") as fobj:
|
|
||||||
fobj.writelines(diff)
|
|
||||||
-
|
|
||||||
+ print(f'Wrote {fobj.name}')
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
||||||
--
|
|
||||||
2.35.1
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
|||||||
From 98638813aa1e085e05092ebfcbcad7ce7fd00a44 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Fabio Valentini <decathorpe@gmail.com>
|
|
||||||
Date: Fri, 1 Jul 2022 19:29:56 +0200
|
|
||||||
Subject: [PATCH] macros.cargo: vacuum up Cargo.toml.orig in addition to
|
|
||||||
Cargo.lock
|
|
||||||
|
|
||||||
This fixes builds with cargo from Rust 1.62+, which now complains
|
|
||||||
and fails our builds if the Cargo.toml.orig file already exists.
|
|
||||||
---
|
|
||||||
data/macros.cargo | 1 +
|
|
||||||
1 file changed, 1 insertion(+)
|
|
||||||
|
|
||||||
diff --git a/data/macros.cargo b/data/macros.cargo
|
|
||||||
index 344b44e..206df14 100644
|
|
||||||
--- a/data/macros.cargo
|
|
||||||
+++ b/data/macros.cargo
|
|
||||||
@@ -44,6 +44,7 @@ registry = "https://crates.io"\
|
|
||||||
replace-with = "local-registry"\
|
|
||||||
EOF\
|
|
||||||
%{__rm} -f Cargo.lock \
|
|
||||||
+%{__rm} -f Cargo.toml.orig \
|
|
||||||
)
|
|
||||||
|
|
||||||
%__cargo_parse_opts(naf:) %{shrink:\
|
|
||||||
--
|
|
||||||
2.36.1
|
|
||||||
|
|
@ -1,81 +1,60 @@
|
|||||||
%bcond_without check
|
|
||||||
# https://pagure.io/koji/issue/659
|
|
||||||
%global debug_package %{nil}
|
|
||||||
|
|
||||||
Name: rust-packaging
|
Name: rust-packaging
|
||||||
Version: 21
|
Version: 24
|
||||||
Release: %autorelease
|
Release: %autorelease
|
||||||
Summary: RPM macros for building Rust packages
|
Summary: RPM macros and generators for building Rust packages
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://pagure.io/fedora-rust/rust2rpm
|
|
||||||
Source: https://pagure.io/fedora-rust/rust2rpm/archive/v%{version}/rust2rpm-v%{version}.tar.gz
|
|
||||||
|
|
||||||
Patch: 0001-Add-comment-about-unused-macro.patch
|
URL: https://pagure.io/fedora-rust/rust-packaging
|
||||||
Patch: 0002-Allow-easy-overriding-of-the-opt-level-debuginfo-cod.patch
|
Source: %{url}/archive/%{version}/rust-packaging-%{version}.tar.gz
|
||||||
Patch: 0003-Fix-autodetection-of-rpmautospec.patch
|
|
||||||
Patch: 0004-Print-information-about-written-files.patch
|
|
||||||
Patch: 0005-macros.cargo-vacuum-up-Cargo.toml.orig-in-addition-t.patch
|
|
||||||
|
|
||||||
ExclusiveArch: %{rust_arches}
|
BuildArch: noarch
|
||||||
|
|
||||||
# gawk is needed for stripping dev-deps in macro
|
|
||||||
Requires: gawk
|
|
||||||
Requires: python3-rust2rpm = %{?epoch:%{epoch}:}%{version}-%{release}
|
|
||||||
Requires: rust-srpm-macros >= 17
|
|
||||||
Requires: rust
|
|
||||||
Requires: cargo >= 1.41
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The package provides RPM macros for building Rust projects.
|
%{summary}.
|
||||||
|
|
||||||
Note that rust-srpm-macros is a seperate arch-independent package that
|
%package -n rust-srpm-macros
|
||||||
is also required to build Rust packages.
|
Summary: RPM macros for building Rust projects
|
||||||
|
|
||||||
%package -n python3-rust2rpm
|
%description -n rust-srpm-macros
|
||||||
Summary: Generate RPM spec files for Rust packages
|
RPM macros for building source packages for Rust projects.
|
||||||
BuildRequires: python3-devel
|
|
||||||
BuildRequires: python3-setuptools
|
%package -n cargo-rpm-macros
|
||||||
%if %{with check}
|
Summary: RPM macros for building projects with cargo
|
||||||
BuildRequires: python3-pytest
|
|
||||||
BuildRequires: cargo
|
# obsolete + provide rust-packaging (removed in Fedora 38)
|
||||||
%endif
|
Obsoletes: rust-packaging < 24
|
||||||
|
Provides: rust-packaging = %{version}-%{release}
|
||||||
|
|
||||||
Requires: cargo
|
Requires: cargo
|
||||||
Provides: rust2rpm = %{version}-%{release}
|
Requires: cargo2rpm >= 0.1.0
|
||||||
%{?python_provide:%python_provide python3-rust2rpm}
|
Requires: gawk
|
||||||
|
|
||||||
%description -n python3-rust2rpm
|
Requires: rust-srpm-macros = %{version}-%{release}
|
||||||
%{summary}.
|
|
||||||
|
%description -n cargo-rpm-macros
|
||||||
|
RPM macros for building projects with cargo.
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -n rust2rpm-v%{version} -p1
|
%autosetup -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%py3_build
|
# nothing to do
|
||||||
|
|
||||||
%install
|
%install
|
||||||
%py3_install
|
install -D -p -m 0644 -t %{buildroot}/%{_rpmmacrodir} macros.d/macros.cargo
|
||||||
install -D -p -m 0644 -t %{buildroot}%{_rpmmacrodir} data/macros.rust data/macros.cargo
|
install -D -p -m 0644 -t %{buildroot}/%{_rpmmacrodir} macros.d/macros.rust
|
||||||
install -D -p -m 0644 -t %{buildroot}%{_fileattrsdir} data/cargo.attr
|
install -D -p -m 0644 -t %{buildroot}/%{_rpmmacrodir} macros.d/macros.rust-srpm
|
||||||
|
install -D -p -m 0644 -t %{buildroot}/%{_fileattrsdir} fileattrs/cargo.attr
|
||||||
%if %{with check}
|
|
||||||
%check
|
|
||||||
py.test-%{python3_version} -vv test.py
|
|
||||||
%endif
|
|
||||||
|
|
||||||
%files
|
%files -n rust-srpm-macros
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%{_rpmmacrodir}/macros.rust
|
%{_rpmmacrodir}/macros.rust
|
||||||
%{_rpmmacrodir}/macros.cargo
|
%{_rpmmacrodir}/macros.rust-srpm
|
||||||
%{_fileattrsdir}/cargo.attr
|
|
||||||
|
|
||||||
%files -n python3-rust2rpm
|
%files -n cargo-rpm-macros
|
||||||
%license LICENSE
|
%license LICENSE
|
||||||
%doc NEWS
|
%{_rpmmacrodir}/macros.cargo
|
||||||
%{_bindir}/rust2rpm
|
%{_fileattrsdir}/cargo.attr
|
||||||
%{_bindir}/cargo-inspector
|
|
||||||
%{python3_sitelib}/rust2rpm-*.egg-info/
|
|
||||||
%{python3_sitelib}/rust2rpm/
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
%autochangelog
|
%autochangelog
|
||||||
|
@ -1 +1 @@
|
|||||||
SHA512 (rust2rpm-v21.tar.gz) = 50864eea0025d1c6d681e5e618f7e7dfe3aab576ec722134e07089459d73cb954e5886409578de7dd7d1a05dfbe7cc034af5f2b4d4e27db3310b0e0a2170869e
|
SHA512 (rust-packaging-24.tar.gz) = bd40ccc62786c7aa1799755ee3d4801d8df53b54edb625d4fe2f3e7fb932171b871355146f9cb226398aabdba733cf8c9e9a9d7f2f2891f623f5bc9bd703e5de
|
||||||
|
Loading…
Reference in new issue