mgieseki / dvisvgm

A fast DVI, EPS, and PDF to SVG converter
https://dvisvgm.de
GNU General Public License v3.0
312 stars 34 forks source link

TL build patch: potrace #259

Closed kberry closed 10 months ago

kberry commented 10 months ago

Hi Martin. For TL, we pulled the potrace library out into libs, since Luigi also wanted to use it. Here is a small patch for that. It's not supposed to affect non-TL builds.

--- dvisvgm-3.2/libs/Makefile.am        2024-01-03 02:50:11.000000000 -0800
+++ dvisvgm-src/libs/Makefile.am        2024-01-16 09:31:00.524974811 -0800
@@ -4,5 +4,9 @@
 ## Process this file with automake.

-SUBDIRS = boost clipper md5 potrace variant xxHash
+SUBDIRS = boost clipper md5 variant xxHash
+
+if !TEXLIVE_BUILD
+SUBDIRS += potrace
+endif

 if ENABLE_WOFF
--- dvisvgm-3.2/libs/defs.am    2024-01-03 02:50:11.000000000 -0800
+++ dvisvgm-src/libs/defs.am    2024-01-16 09:49:05.754922928 -0800
@@ -8,6 +8,9 @@

 if !HAVE_POTRACE
-POTRACE_CFLAGS = -I$(dvisvgm_srcdir)/libs/potrace
-POTRACE_LIBS = ../libs/potrace/libpotrace.a
+POTRACE_CFLAGS = $(POTRACE_INCLUDES)
+endif
+#
+if TEXLIVE_BUILD
+POTRACE_CFLAGS = $(POTRACE_INCLUDES)
 endif
mgieseki commented 10 months ago

Hi Karl, thanks for sending the patch. I adapted it a little so that it also works with non-TL builds. Could you please check if it still works with TL?

diff -r 9e4b9c2474b9 -r d94256099fa1 libs/Makefile.am
--- a/libs/Makefile.am  Tue Jan 16 10:39:07 2024 +0100
+++ b/libs/Makefile.am  Wed Jan 17 14:31:38 2024 +0100
@@ -3,7 +3,11 @@
 ##
 ## Process this file with automake.

-SUBDIRS = boost clipper md5 potrace variant xxHash
+SUBDIRS = boost clipper md5 variant xxHash
+
+if !TEXLIVE_BUILD
+SUBDIRS += potrace
+endif

 if ENABLE_WOFF
 SUBDIRS += brotli woff2
diff -r 9e4b9c2474b9 -r d94256099fa1 libs/defs.am
--- a/libs/defs.am  Tue Jan 16 10:39:07 2024 +0100
+++ b/libs/defs.am  Wed Jan 17 14:31:38 2024 +0100
@@ -6,10 +6,14 @@
 BROTLI_LIBS += ../libs/brotli/libbrotli.a
 endif

+if TEXLIVE_BUILD
+POTRACE_CFLAGS = $(POTRACE_INCLUDES)
+else
 if !HAVE_POTRACE
 POTRACE_CFLAGS = -I$(dvisvgm_srcdir)/libs/potrace
 POTRACE_LIBS = ../libs/potrace/libpotrace.a
-endif
+endif !HAVE_POTRACE
+endif !TEXLIVE_BUILD

 if !HAVE_WOFF2
 WOFF2_CFLAGS += -I$(dvisvgm_srcdir)/libs/woff2/include
kberry commented 10 months ago

Working fine. Thanks Martin.