1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
--- a/configure.ac-old 2025-09-13 12:16:00.149332314 +0200
+++ b/configure.ac 2025-09-13 12:18:08.454597162 +0200
@@ -2909,10 +2909,28 @@
[Enables very experimental experiments.]),[
WITH_YRS=$withval
if test "x$withval" != "xno"; then
- BUILD_TYPE="${BUILD_TYPE} YRS"
+ if test "$with_system_yrs" = "yes"; then
+ SYSTEM_YRS=TRUE
+ else
+ BUILD_TYPE="${BUILD_TYPE} YRS"
+ fi
AC_DEFINE(ENABLE_YRS)
fi])
AC_SUBST(WITH_YRS)
+AC_SUBST(SYSTEM_YRS)
+
+# call it yrs even though the crate is built is yffi. But it's clearer
+# that way that it belongs to the above --with-yrs
+AC_ARG_WITH(system-yrs,
+ AS_HELP_STRING([--with-system-yrs],
+ [Use yrs/yffi crates already on system]),,
+ [with_system_yrs="$with_system_crates"])
+
+AC_ARG_WITH(system-crates,
+ AS_HELP_STRING([--without-system-crates],
+ [When building with --with-system-libs, also the needed crates are expected
+ on the system. Use this to disable that]),,
+ [with_system_crates="$with_system_libs"])
AC_ARG_WITH(perl-home,
AS_HELP_STRING([--with-perl-home=<abs. path to Perl 5 home>],
diff --git a/config_host.mk.in b/config_host.mk.in
index 9b7a7a747e2d..4e1fc5d128cc 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -732,6 +741,7 @@ SYSTEM_WPD=@SYSTEM_WPD@
SYSTEM_WPG=@SYSTEM_WPG@
SYSTEM_WPS=@SYSTEM_WPS@
SYSTEM_XMLSEC=@SYSTEM_XMLSEC@
+SYSTEM_YRS=@SYSTEM_YRS@
SYSTEM_ZLIB=@SYSTEM_ZLIB@
SYSTEM_ZSTD=@SYSTEM_ZSTD@
SYSTEM_ZMF=@SYSTEM_ZMF@
diff --git a/Makefile.fetch b/Makefile.fetch
index 239fcc01753f..1175e65cee70 100644
--- a/Makefile.fetch
+++ b/Makefile.fetch
@@ -252,8 +252,10 @@ $(WORKDIR)/download: $(BUILDDIR)/config_$(gb_Side).mk $(SRCDIR)/download.lst $(S
$(call fetch_Optional,OFFICEOTRON,OFFICEOTRON_JAR) \
,$(call fetch_Download_item,https://dev-www.libreoffice.org/extern,$(item)))
-@mkdir -p $(TARFILE_LOCATION)/cargo
+ $(if $(filter TRUE,$(SYSTEM_YRS)), \
$(if $(call fetch_Optional,YRS,1),\
- CARGO_HOME=$(TARFILE_LOCATION)/cargo cargo fetch $(if $(verbose),--verbose,) --locked --manifest-path $(SRCDIR)/external/y-crdt/Cargo.toml)
+ CARGO_HOME=$(TARFILE_LOCATION)/cargo cargo fetch $(if $(verbose),--verbose,) --locked --manifest-path $(SRCDIR)/external/y-crdt/Cargo.toml) \
+ )
@mkdir -p $(dir $@) && touch $@
@mkdir -p $(dir $@)/Executable
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index dce2138d1df2..a45fbea93f4a 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -4465,6 +4466,7 @@ endif
ifneq ($(WITH_YRS),)
+ifeq ($(SYSTEM_YRS),)
define gb_LinkTarget__use_yrs
$(call gb_LinkTarget_use_external_project,$(1),y-crdt)
$(call gb_LinkTarget_set_include,$(1),\
@@ -4476,6 +4478,16 @@ endef
else
+define gb_LinkTarget__use_yrs
+$(call gb_LinkTarget_set_include,$(1),\
+ $$(INCLUDE) \
+)
+$(call gb_LinkTarget_add_libs,$(1),$(SRC_ROOT)/debian/cargo_registry/yffi/target/$(DEB_HOST_RUST_TYPE)/$(CARGO_CHANNEL)/libyrs.a)
+endef
+endif
+
+else
+
gb_LinkTarget__use_yrs :=
endif
|