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
|
||||
Version: 21
|
||||
Version: 24
|
||||
Release: %autorelease
|
||||
Summary: RPM macros for building Rust packages
|
||||
|
||||
Summary: RPM macros and generators for building Rust packages
|
||||
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
|
||||
Patch: 0002-Allow-easy-overriding-of-the-opt-level-debuginfo-cod.patch
|
||||
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
|
||||
URL: https://pagure.io/fedora-rust/rust-packaging
|
||||
Source: %{url}/archive/%{version}/rust-packaging-%{version}.tar.gz
|
||||
|
||||
ExclusiveArch: %{rust_arches}
|
||||
|
||||
# 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
|
||||
BuildArch: noarch
|
||||
|
||||
%description
|
||||
The package provides RPM macros for building Rust projects.
|
||||
|
||||
Note that rust-srpm-macros is a seperate arch-independent package that
|
||||
is also required to build Rust packages.
|
||||
|
||||
%package -n python3-rust2rpm
|
||||
Summary: Generate RPM spec files for Rust packages
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-setuptools
|
||||
%if %{with check}
|
||||
BuildRequires: python3-pytest
|
||||
BuildRequires: cargo
|
||||
%endif
|
||||
%{summary}.
|
||||
|
||||
%package -n rust-srpm-macros
|
||||
Summary: RPM macros for building Rust projects
|
||||
|
||||
%description -n rust-srpm-macros
|
||||
RPM macros for building source packages for Rust projects.
|
||||
|
||||
%package -n cargo-rpm-macros
|
||||
Summary: RPM macros for building projects with cargo
|
||||
|
||||
# obsolete + provide rust-packaging (removed in Fedora 38)
|
||||
Obsoletes: rust-packaging < 24
|
||||
Provides: rust-packaging = %{version}-%{release}
|
||||
|
||||
Requires: cargo
|
||||
Provides: rust2rpm = %{version}-%{release}
|
||||
%{?python_provide:%python_provide python3-rust2rpm}
|
||||
Requires: cargo2rpm >= 0.1.0
|
||||
Requires: gawk
|
||||
|
||||
%description -n python3-rust2rpm
|
||||
%{summary}.
|
||||
Requires: rust-srpm-macros = %{version}-%{release}
|
||||
|
||||
%description -n cargo-rpm-macros
|
||||
RPM macros for building projects with cargo.
|
||||
|
||||
%prep
|
||||
%autosetup -n rust2rpm-v%{version} -p1
|
||||
%autosetup -p1
|
||||
|
||||
%build
|
||||
%py3_build
|
||||
# nothing to do
|
||||
|
||||
%install
|
||||
%py3_install
|
||||
install -D -p -m 0644 -t %{buildroot}%{_rpmmacrodir} data/macros.rust data/macros.cargo
|
||||
install -D -p -m 0644 -t %{buildroot}%{_fileattrsdir} data/cargo.attr
|
||||
|
||||
%if %{with check}
|
||||
%check
|
||||
py.test-%{python3_version} -vv test.py
|
||||
%endif
|
||||
install -D -p -m 0644 -t %{buildroot}/%{_rpmmacrodir} macros.d/macros.cargo
|
||||
install -D -p -m 0644 -t %{buildroot}/%{_rpmmacrodir} macros.d/macros.rust
|
||||
install -D -p -m 0644 -t %{buildroot}/%{_rpmmacrodir} macros.d/macros.rust-srpm
|
||||
install -D -p -m 0644 -t %{buildroot}/%{_fileattrsdir} fileattrs/cargo.attr
|
||||
|
||||
%files
|
||||
%files -n rust-srpm-macros
|
||||
%license LICENSE
|
||||
%{_rpmmacrodir}/macros.rust
|
||||
%{_rpmmacrodir}/macros.cargo
|
||||
%{_fileattrsdir}/cargo.attr
|
||||
%{_rpmmacrodir}/macros.rust-srpm
|
||||
|
||||
%files -n python3-rust2rpm
|
||||
%files -n cargo-rpm-macros
|
||||
%license LICENSE
|
||||
%doc NEWS
|
||||
%{_bindir}/rust2rpm
|
||||
%{_bindir}/cargo-inspector
|
||||
%{python3_sitelib}/rust2rpm-*.egg-info/
|
||||
%{python3_sitelib}/rust2rpm/
|
||||
%{_rpmmacrodir}/macros.cargo
|
||||
%{_fileattrsdir}/cargo.attr
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
|
@ -1 +1 @@
|
||||
SHA512 (rust2rpm-v21.tar.gz) = 50864eea0025d1c6d681e5e618f7e7dfe3aab576ec722134e07089459d73cb954e5886409578de7dd7d1a05dfbe7cc034af5f2b4d4e27db3310b0e0a2170869e
|
||||
SHA512 (rust-packaging-24.tar.gz) = bd40ccc62786c7aa1799755ee3d4801d8df53b54edb625d4fe2f3e7fb932171b871355146f9cb226398aabdba733cf8c9e9a9d7f2f2891f623f5bc9bd703e5de
|
||||
|
Loading…
Reference in new issue