tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

librsvg as tool dependency and LIBRSVG_USE_RUST



Hello folks,
after the move of graphics/librsvg to graphics/librsvg-c and
introduction of LIBRSVG_USE_RUST it is no longer possible to honor
user's LIBRSVG_USE_RUST=no preference when librsvg is picked up via
BUILD_DEPENDS or TOOL_DEPENDS (e.g. graphics/adwaita-icon-theme).

At the moment the only package that was adjusted is x11/mate-desktop
that includes it via librsvg bl3.

Another pattern seen in the last days was the need of referring to
LIBRSVG_USE_RUST in other packages, e.g. devel/pango, fonts/harfbuzz
and misc/libreoffice (ATM PLATFORM_SUPPORTS_RUST is used instead in
those packages).

I would like to propose the following patch that address these problems
by introducing:

 - graphics/librsvg/available.mk: that just define LIBRSVG_USE_RUST (so
   devel/pango, fonts/harfbuzz, misc/libreoffice or any other package
   can just include it to check what is the preferred librsvg
   implementation to be used)
 - graphics/librsvg/tool.mk: that adds librsvg as a tool dependency by
   honoring LIBRSVG_USE_RUST user's preference.  In that way packages
   that needs librsvg instead of directly TOOL_DEPENDS will need to
   include graphics/librsvg/tool.mk.


Feedbacks and suggestions are welcomed!  If there are no negative
feedbacks I would like to commit it in the next days.
librsvg: Add available.mk and tool.mk mk fragments

Isolate the LIBRSVG_USE_RUST logic in available.mk mk fragments in
order that can be used by other librsvg mk (e.g. tool.mk) or by
other package to check the preferred librsvg implementation to be
used. (e.g. devel/pango, fonts/harfbuzz and misc/libreoffice).

Add a tool.mk mk fragment in order to be able to specify librsvg
as a tool dependency honoring user's LIBRSVG_USE_RUST.

Index: available.mk
===================================================================
RCS file: available.mk
diff -N available.mk
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ available.mk	5 Jun 2019 10:26:54 -0000
@@ -0,0 +1,24 @@
+# $NetBSD$
+#
+# This mk fragment define LIBRSVG_USE_RUST variable used in other librsvg mk
+# fragments.
+#
+# User-settable variables:
+#
+# LIBRSVG_USE_RUST
+#	Use librsvg implementation that requires Rust.
+#
+#	Possible values: yes no
+#	Default: yes on platforms were Rust is supported
+#
+
+.if !defined(LIBRSVG_AVAILABLE_MK)
+LIBRSVG_AVAILABLE_MK=	defined
+
+.include "../../mk/bsd.prefs.mk"
+
+# default to rust version on platforms where pkgsrc supports lang/rust
+.include "../../lang/rust/platform.mk"
+LIBRSVG_USE_RUST?=	${PLATFORM_SUPPORTS_RUST}
+
+.endif # LIBRSVG_AVAILABLE_MK
Index: buildlink3.mk
===================================================================
RCS file: /cvsroot/pkgsrc/graphics/librsvg/buildlink3.mk,v
retrieving revision 1.48
diff -u -p -r1.48 buildlink3.mk
--- buildlink3.mk	1 Jun 2019 13:55:31 -0000	1.48
+++ buildlink3.mk	5 Jun 2019 10:26:54 -0000
@@ -10,9 +10,7 @@ BUILDLINK_ABI_DEPENDS.librsvg+=		librsvg
 
 .include "../../mk/bsd.fast.prefs.mk"
 
-# default to rust version on platforms where pkgsrc supports lang/rust
-.include "../../lang/rust/platform.mk"
-LIBRSVG_USE_RUST?=	${PLATFORM_SUPPORTS_RUST}
+.include "../../graphics/librsvg/available.mk"
 
 .if ${LIBRSVG_USE_RUST} == "yes"
 BUILDLINK_PKGSRCDIR.librsvg?=		../../graphics/librsvg
Index: tool.mk
===================================================================
RCS file: tool.mk
diff -N tool.mk
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ tool.mk	5 Jun 2019 10:26:54 -0000
@@ -0,0 +1,18 @@
+# $NetBSD$
+#
+# This mk fragment can be included by all packages that needs librsvg as a tool
+# dependency (e.g. for rsvg-convert).
+#
+
+.if !defined(LIBRSVG_TOOL_MK)
+LIBRSVG_TOOL_MK=	defined
+
+.include "../../graphics/librsvg/available.mk"
+
+.if ${LIBRSVG_USE_RUST} == "yes"
+TOOL_DEPENDS+=	librsvg-[0-9]*:../../graphics/librsvg
+.else
+TOOL_DEPENDS+=	librsvg-[0-9]*:../../graphics/librsvg-c
+.endif
+
+.endif # LIBRSVG_TOOL_MK


Home | Main Index | Thread Index | Old Index