[librsvg/rustify-rsvg-convert] 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] rsvg-convert: remove the C code and add the rust one to the build
- Date: Sun, 17 Jan 2021 11:46:38 +0000 (UTC)
commit 1697022dee2376f649044dd7818863b085eb36c5
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 | 37 ++--
rsvg-c-srcs.mk | 2 -
rsvg-convert.c | 634 ---------------------------------------------------------
3 files changed, 14 insertions(+), 659 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index d64bdeb2..d1ed70f2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -17,8 +17,6 @@ _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
-
include rsvg-c-srcs.mk
librsvg_@RSVG_API_MAJOR_VERSION@_la_SOURCES = \
@@ -188,7 +186,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 +214,23 @@ 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
+bin_PROGRAMS = rsvg-convert$(EXEEXT)
-rsvg_convert_SOURCES = \
- $(rsvg_convert_srcs) \
- $(NULL)
+RSVG_CONVERT_BIN=$(CARGO_TARGET_DIR)/$(RUST_TARGET_SUBDIR)/rsvg-convert$(EXEEXT)
-rsvg_convert_CPPFLAGS = \
- -I$(top_srcdir)/include \
- -I$(top_builddir)/include \
- -DLIBRSVG_DATADIR="\"$(datadir)\"" \
- $(AM_CPPFLAGS)
+RSVG_CONVERT_SRC = src/bin/rsvg-convert/main.rs
-rsvg_convert_CFLAGS =\
- $(RSVG_CONVERT_CFLAGS) \
- $(AM_CFLAGS)
+$(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_LDFLAGS = $(AM_LDFLAGS)
+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 +241,7 @@ dist_doc_DATA = \
EXTRA_DIST = \
$(LIBRSVG_SRC) \
$(RUST_EXTRA) \
+ $(RSVG_CONVERT_SRC) \
librsvg.doap \
AUTHORS \
NEWS \
@@ -260,9 +254,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
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]