[librsvg/rustify-rsvg-convert: 4/8] rsvg-convert: remove the C code and add the rust one to the build
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg/rustify-rsvg-convert: 4/8] rsvg-convert: remove the C code and add the rust one to the build
- Date: Sun, 17 Jan 2021 20:25:02 +0000 (UTC)
commit 4dc26f68a932d64913d61a8f8e7744553118c367
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 d64bdeb2..606cdbd9 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
@@ -188,7 +188,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)
@@ -216,28 +216,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 \
@@ -248,6 +246,7 @@ dist_doc_DATA = \
EXTRA_DIST = \
$(LIBRSVG_SRC) \
$(RUST_EXTRA) \
+ $(RSVG_CONVERT_SRC) \
librsvg.doap \
AUTHORS \
NEWS \
@@ -260,9 +259,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
@@ -301,7 +297,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]