From 4de23efff21c7f12eb294660dd762fe237ab37f0 Mon Sep 17 00:00:00 2001 From: Liwei Ge Date: Mon, 26 Dec 2022 11:16:57 +0800 Subject: [PATCH] build: support loongarch64 --- ...efile-remove-lock-to-update-requires.patch | 57 +++++++++++++++++++ librsvg2.spec | 15 ++++- 2 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 0001-makefile-remove-lock-to-update-requires.patch diff --git a/0001-makefile-remove-lock-to-update-requires.patch b/0001-makefile-remove-lock-to-update-requires.patch new file mode 100644 index 0000000..c66090f --- /dev/null +++ b/0001-makefile-remove-lock-to-update-requires.patch @@ -0,0 +1,57 @@ +From bcb2aa2121d21773678b7ed0adb426431a4edf70 Mon Sep 17 00:00:00 2001 +From: rpm-build +Date: Mon, 26 Dec 2022 11:12:51 +0800 +Subject: [PATCH] makefile: remove lock to update requires + +--- + Makefile.am | 4 ++-- + Makefile.in | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Makefile.am b/Makefile.am +index 9cb3895..445300d 100644 +--- a/Makefile.am ++++ b/Makefile.am +@@ -174,7 +174,7 @@ check-local: + CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \ + LIBRSVG_BUILD_DIR=$(LIBRSVG_BUILD_DIR) \ + OUT_DIR=$(LIBRSVG_BUILD_DIR)/tests/output \ +- $(CARGO) --locked test $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) $(CARGO_RELEASE_ARGS) ++ $(CARGO) --offline test $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) $(CARGO_RELEASE_ARGS) + + clean-local: + cd $(top_srcdir) && \ +@@ -199,7 +199,7 @@ librsvg_c_api.la: $(librsvg_c_api_la_OBJECTS) $(LIBRSVG_INTERNALS_SRC) $(LIBRSVG + PKG_CONFIG_ALLOW_CROSS=1 \ + PKG_CONFIG='$(PKG_CONFIG)' \ + CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \ +- $(CARGO) --locked build $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) $(CARGO_RELEASE_ARGS) \ ++ $(CARGO) --offline build $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) $(CARGO_RELEASE_ARGS) \ + && cd $(LIBRSVG_BUILD_DIR) && $(LINK) $< && mv $(RUST_LIB) .libs/librsvg_c_api.a + + librsvg_@RSVG_API_MAJOR_VERSION@_la_CPPFLAGS = \ +diff --git a/Makefile.in b/Makefile.in +index 33b51ae..26912c9 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -1755,7 +1755,7 @@ check-local: + CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \ + LIBRSVG_BUILD_DIR=$(LIBRSVG_BUILD_DIR) \ + OUT_DIR=$(LIBRSVG_BUILD_DIR)/tests/output \ +- $(CARGO) --locked test $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) $(CARGO_RELEASE_ARGS) ++ $(CARGO) --offline test $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) $(CARGO_RELEASE_ARGS) + + clean-local: + cd $(top_srcdir) && \ +@@ -1780,7 +1780,7 @@ librsvg_c_api.la: $(librsvg_c_api_la_OBJECTS) $(LIBRSVG_INTERNALS_SRC) $(LIBRSVG + PKG_CONFIG_ALLOW_CROSS=1 \ + PKG_CONFIG='$(PKG_CONFIG)' \ + CARGO_TARGET_DIR=$(CARGO_TARGET_DIR) \ +- $(CARGO) --locked build $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) $(CARGO_RELEASE_ARGS) \ ++ $(CARGO) --offline build $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) $(CARGO_RELEASE_ARGS) \ + && cd $(LIBRSVG_BUILD_DIR) && $(LINK) $< && mv $(RUST_LIB) .libs/librsvg_c_api.a + + @HAVE_INTROSPECTION_TRUE@-include $(INTROSPECTION_MAKEFILE) +-- +2.27.0 + diff --git a/librsvg2.spec b/librsvg2.spec index 682492b..83db687 100644 --- a/librsvg2.spec +++ b/librsvg2.spec @@ -1,4 +1,4 @@ -%define anolis_release .0.1 +%define anolis_release .0.2 # https://github.com/rust-lang/rust/issues/47714 %undefine _strict_symbol_defs_build @@ -20,6 +20,8 @@ License: LGPLv2+ URL: https://wiki.gnome.org/Projects/LibRsvg Source0: https://download.gnome.org/sources/librsvg/2.50/librsvg-%{version}.tar.xz +Patch1000: 0001-makefile-remove-lock-to-update-requires.patch + BuildRequires: chrpath BuildRequires: gcc BuildRequires: git-core @@ -43,6 +45,9 @@ BuildRequires: vala %if 0%{?bundled_rust_deps} BuildRequires: cargo BuildRequires: rust +%ifarch loongarch64 +BuildRequires: cargo-vendored-libc +%endif %else BuildRequires: rust-packaging %endif @@ -74,6 +79,11 @@ This package provides extra utilities based on the librsvg library. %autosetup -n librsvg-%{version} -p1 -Sgit %if 0%{?bundled_rust_deps} # Use the bundled deps +%ifarch loongarch64 +rm -rf vendor/libc +rm -f Cargo.lock +ln -s %{_datadir}/cargo/vendor/libc vendor/ +%endif %else # No bundled deps rm -vrf vendor .cargo Cargo.lock @@ -138,6 +148,9 @@ rm -vrf %{buildroot}%{_datadir}/doc %{_mandir}/man1/rsvg-convert.1* %changelog +* Mon Dec 26 2022 Liwei Ge 2.50.7-1.0.2 +- Support loongarch64 + * Mon Dec 05 2022 Weitao Zhou 2.50.7-1.0.1 - Add git as build requirement for autosetup -- Gitee