[packages/rpm-pld-macros] initial basic rust/cargo macros (2.003)

atler atler at pld-linux.org
Tue Mar 30 13:06:29 CEST 2021


commit 593b448d587953c0aa5cfb8484485fda26499d3c
Author: Jan Palus <atler at pld-linux.org>
Date:   Tue Mar 30 12:59:03 2021 +0200

    initial basic rust/cargo macros (2.003)

 macros.pld          | 17 +++++++++++++++++
 rpm-pld-macros.spec |  2 +-
 2 files changed, 18 insertions(+), 1 deletion(-)
---
diff --git a/rpm-pld-macros.spec b/rpm-pld-macros.spec
index b725d6c..cf37575 100644
--- a/rpm-pld-macros.spec
+++ b/rpm-pld-macros.spec
@@ -1,4 +1,4 @@
-%define		rpm_macros_rev	2.002
+%define		rpm_macros_rev	2.003
 %define		find_lang_rev	1.40
 # split into individual X_prov_ver if there is a reason to desync
 %define		prov_ver	4.15
diff --git a/macros.pld b/macros.pld
index 0b68337..f861af6 100644
--- a/macros.pld
+++ b/macros.pld
@@ -576,6 +576,23 @@ LC_ALL=C.UTF-8 %{__meson} \
 %ninja_install LC_ALL=C.UTF-8 DESTDIR=%{buildroot} %{__ninja} install %{__ninja_common_opts}
 %ninja_test LC_ALL=C.UTF-8 %{__ninja} test %{__ninja_common_opts}
 
+# rust/cargo
+%debuginforustflags	%{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1: -g}%{expand:%%undefine __dic_%{?_enable_debug_packages}}
+%rpmrustflags	%debuginforustflags
+
+%__cargo	/usr/bin/cargo
+%__cargo_common_opts	-v --offline
+%cargo_build { \
+	RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \
+	%{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \
+	%{__cargo} %{__cargo_common_opts} build %{!?debug:--release} \
+}
+%cargo_install { \
+	RUSTFLAGS="${RUSTFLAGS:-%rpmrustflags}" \
+	%{?__jobs:CARGO_BUILD_JOBS="${CARGO_BUILD_JOBS:-%{__jobs}}"} \
+	%{__cargo} %{__cargo_common_opts} install \
+}
+
 #----------------------------------------------------------------
 #%configure_cache 0
 %configure_cache_file	%{buildroot}.configure.cache
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-pld-macros.git/commitdiff/593b448d587953c0aa5cfb8484485fda26499d3c



More information about the pld-cvs-commit mailing list