[librsvg/rustify-rsvg-convert: 53/78] rsvg-convert: remove the C code and add the rust one to the build
- From: Sven Neumann <sneumann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/rustify-rsvg-convert: 53/78] rsvg-convert: remove the C code and add the rust one to the build
- Date: Wed, 3 Feb 2021 10:18:30 +0000 (UTC)
commit 3f9ac2a5f9e05d57d4fbec3965be41d29ed2ffcf
Author: Paolo Borelli <pborelli gnome org>
Date: Sun Jan 17 12:40:08 2021 +0100
rsvg-convert: remove the C code and add the rust one to the build
Makefile.am | 42 ++--
rsvg-c-srcs.mk | 2 -
rsvg-convert.c | 634 ---------------------------------------------------------
3 files changed, 19 insertions(+), 659 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index ad4c601c..20730380 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,7 +17,7 @@ _rsvg_dummy.c:
# See LIBRSVG_SRC below for the real list of Rust sources.
librsvg_c_api_la_SOURCES = _rsvg_dummy.c
-bin_PROGRAMS = rsvg-convert
+CLEANFILES = $(BUILT_SOURCES)
include rsvg-c-srcs.mk
@@ -187,7 +187,7 @@ librsvg_c_api.la: $(librsvg_c_api_la_OBJECTS) $(LIBRSVG_SRC)
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) --locked build $(CARGO_VERBOSE) $(CARGO_TARGET_ARGS) $(CARGO_RELEASE_ARGS) --lib \
&& cd $(LIBRSVG_BUILD_DIR) && $(LINK) $< && mv $(RUST_LIB) .libs/librsvg_c_api.a
librsvg_@RSVG_API_MAJOR_VERSION@_la_CPPFLAGS = $(AM_CPPFLAGS)
@@ -215,28 +215,26 @@ librsvg_@RSVG_API_MAJOR_VERSION@_la_LIBADD = \
librsvgincdir = $(includedir)/librsvg-$(RSVG_API_VERSION)/librsvg
librsvginc_HEADERS = $(librsvg_public_headers)
-dist_man_MANS = rsvg-convert.1
+# Use SCRIPTS instead of PROGRAMS since we build it on our own
+bin_SCRIPTS = rsvg-convert$(EXEEXT)
-rsvg_convert_SOURCES = \
- $(rsvg_convert_srcs) \
- $(NULL)
+CLEANFILES += $(bin_SCRIPTS)
-rsvg_convert_CPPFLAGS = \
- -I$(top_srcdir)/include \
- -I$(top_builddir)/include \
- -DLIBRSVG_DATADIR="\"$(datadir)\"" \
- $(AM_CPPFLAGS)
+RSVG_CONVERT_BIN=$(CARGO_TARGET_DIR)/$(RUST_TARGET_SUBDIR)/rsvg-convert$(EXEEXT)
-rsvg_convert_CFLAGS =\
- $(RSVG_CONVERT_CFLAGS) \
- $(AM_CFLAGS)
+RSVG_CONVERT_SRC = src/bin/rsvg-convert/main.rs
-rsvg_convert_LDFLAGS = $(AM_LDFLAGS)
+$(RSVG_CONVERT_BIN): $(RSVG_CONVERT_SRC)
+ +cd $(top_srcdir) && \
+ 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) --bin rsvg-convert
+
+rsvg-convert$(EXEEXT): $(RSVG_CONVERT_BIN)
+ cd $(LIBRSVG_BUILD_DIR) && mv $(RSVG_CONVERT_BIN) rsvg-convert
-rsvg_convert_LDADD = \
- $(top_builddir)/librsvg-@RSVG_API_MAJOR_VERSION@.la \
- $(RSVG_CONVERT_LIBS) \
- $(LIBM)
+dist_man_MANS = rsvg-convert.1
dist_doc_DATA = \
COMPILING.md \
@@ -247,6 +245,7 @@ dist_doc_DATA = \
EXTRA_DIST = \
$(LIBRSVG_SRC) \
$(RUST_EXTRA) \
+ $(RSVG_CONVERT_SRC) \
librsvg.doap \
AUTHORS \
NEWS \
@@ -259,9 +258,6 @@ EXTRA_DIST = \
tap-driver.sh \
tap-test
-## Put `exec' in the name because this should be installed by
-## `install-exec', not `install-data'.
-
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = librsvg-$(RSVG_API_VERSION).pc
@@ -300,7 +296,7 @@ nodist_gir_DATA = $(INTROSPECTION_GIRS)
typelibsdir = $(libdir)/girepository-1.0
nodist_typelibs_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
-CLEANFILES = $(BUILT_SOURCES) $(nodist_gir_DATA) $(nodist_typelibs_DATA)
+CLEANFILES += $(nodist_gir_DATA) $(nodist_typelibs_DATA)
if ENABLE_VAPIGEN
include $(VAPIGEN_MAKEFILE)
diff --git a/rsvg-c-srcs.mk b/rsvg-c-srcs.mk
index a9a06d4d..3c4756d9 100644
--- a/rsvg-c-srcs.mk
+++ b/rsvg-c-srcs.mk
@@ -8,5 +8,3 @@ librsvg_public_headers = \
librsvg_private_headers = \
include/librsvg/rsvg-css.h \
$(NULL)
-
-rsvg_convert_srcs = rsvg-convert.c
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]