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

Bug#999937: tup: depends on obsolete pcre3 library



On Tue, Aug 29, 2023 at 03:18:26PM +0200, Bastian Germann wrote:
> On Tue, 31 Jan 2023 21:36:46 +0800 Bo YU <tsu.yubo@gmail.com> wrote:
> > The upstream has tried to switch pcre2[0], but the backporting is
> > not easy, so maybe waiting a new release is good iead.
> 
> I have started a backport in git but there is at least one linker
> flag missing.

That's right; the attached patch makes the build succeed for me but I
have not tested further (sorry for the patch noise; it's because I had
to "quilt refresh").
>From 2b6f55b4d9f476646072d2be197b4fc1defcf7ac Mon Sep 17 00:00:00 2001
From: Yavor Doganov <yavor@gnu.org>
Date: Thu, 21 Dec 2023 19:20:23 +0200
Subject: [PATCH] pcre2.patch: Add missing linker flag; refresh

---
 debian/patches/pcre2.patch | 81 +++++++++++++++++---------------------
 1 file changed, 37 insertions(+), 44 deletions(-)

diff --git a/debian/patches/pcre2.patch b/debian/patches/pcre2.patch
index 9d012bb..031b6a7 100644
--- a/debian/patches/pcre2.patch
+++ b/debian/patches/pcre2.patch
@@ -6,11 +6,9 @@ Subject: Update pcre 8.44 -> pcre2 10.42
 libpcre is no longer maintained, and was replaced by libpcre2. This
 requires some minor API changes.
 ---
-diff --git a/Tupfile b/Tupfile
-index 107c81cca..cc6ed1ce5 100644
---- a/Tupfile
-+++ b/Tupfile
-@@ -30,7 +30,7 @@ srcs += src/sqlite3/*.o
+--- tup.orig/Tupfile
++++ tup/Tupfile
+@@ -30,7 +30,7 @@
  endif
  
  ifeq ($(use_system_pcre),y)
@@ -19,11 +17,9 @@ index 107c81cca..cc6ed1ce5 100644
  else
  srcs += src/pcre/*.o
  endif
-diff --git a/Tuprules.tup b/Tuprules.tup
-index 3cdab0ffc..a7fd6cb66 100644
---- a/Tuprules.tup
-+++ b/Tuprules.tup
-@@ -99,7 +99,7 @@ else
+--- tup.orig/Tuprules.tup
++++ tup/Tuprules.tup
+@@ -89,7 +89,7 @@
  use_system_pcre = $(TUP_USE_SYSTEM_PCRE)
  endif
  ifeq ($(use_system_pcre),y)
@@ -32,11 +28,18 @@ index 3cdab0ffc..a7fd6cb66 100644
  else
  CFLAGS += -I$(TUP_CWD)/src/pcre
  CFLAGS += -DPCRE_STATIC
-diff --git a/build.sh b/build.sh
-index 7fecb8914..6ac7041e6 100755
---- a/build.sh
-+++ b/build.sh
-@@ -80,6 +80,7 @@ mkdir luabuiltin
+--- tup.orig/build.sh
++++ tup/build.sh
+@@ -27,7 +27,7 @@
+ 	echo "Error: invalid TUP_SERVER \"$server\"" 1>&2
+ 	exit 1
+ fi
+-LDFLAGS="$LDFLAGS -lm"
++LDFLAGS="$LDFLAGS -lm -lpcre2-8"
+ : ${CC:=gcc}
+ case "$os" in
+ 	Linux)
+@@ -80,6 +80,7 @@
  ./lua ../src/luabuiltin/xxd.lua builtin.lua luabuiltin/luabuiltin.h
  
  CFLAGS="$CFLAGS -DTUP_SERVER=\"$server\""
@@ -44,11 +47,9 @@ index 7fecb8914..6ac7041e6 100755
  CFLAGS="$CFLAGS -DHAVE_CONFIG_H"
  
  for i in ../src/tup/*.c ../src/tup/tup/main.c ../src/tup/monitor/null.c ../src/tup/flock/fcntl.c ../src/inih/ini.c ../src/pcre/*.c $plat_files; do
-diff --git a/src/tup/entry.c b/src/tup/entry.c
-index 90e1b80c0..96842bc4b 100644
---- a/src/tup/entry.c
-+++ b/src/tup/entry.c
-@@ -151,7 +151,7 @@ static int rm_entry(tupid_t tupid, int safe)
+--- tup.orig/src/tup/entry.c
++++ tup/src/tup/entry.c
+@@ -151,7 +151,7 @@
  		string_tree_rm(&tent->parent->entries, &tent->name);
  	}
  	if(tent->re) {
@@ -57,7 +58,7 @@ index 90e1b80c0..96842bc4b 100644
  	}
  	free_tent_tree(&tent->stickies);
  	free_tent_tree(&tent->group_stickies);
-@@ -504,11 +504,13 @@ static struct tup_entry *new_entry(tupid_t tupid, tupid_t dt,
+@@ -473,11 +473,13 @@
  	RB_INIT(&tent->entries);
  
  	if(tent->dt == exclusion_dt()) {
@@ -75,7 +76,7 @@ index 90e1b80c0..96842bc4b 100644
  			return NULL;
  		}
  	} else {
-@@ -795,14 +797,16 @@ int exclusion_match(FILE *f, struct tent_entries *exclusion_root, const char *s,
+@@ -767,14 +769,16 @@
  	*match = 0;
  	RB_FOREACH(tt, tent_entries, exclusion_root) {
  		int rc;
@@ -95,10 +96,8 @@ index 90e1b80c0..96842bc4b 100644
  			fprintf(f, "tup error: Regex failed to execute: %s\n", tt->tent->name.s);
  			return -1;
  		}
-diff --git a/src/tup/entry.h b/src/tup/entry.h
-index 332849842..1b37e077e 100644
---- a/src/tup/entry.h
-+++ b/src/tup/entry.h
+--- tup.orig/src/tup/entry.h
++++ tup/src/tup/entry.h
 @@ -26,9 +26,9 @@
  #include "string_tree.h"
  #include "db_types.h"
@@ -110,7 +109,7 @@ index 332849842..1b37e077e 100644
  
  struct variant;
  struct estring;
-@@ -51,7 +51,7 @@ struct tup_entry {
+@@ -51,7 +51,7 @@
  	_Atomic int refcount;
  
  	/* For exclusions */
@@ -119,11 +118,9 @@ index 332849842..1b37e077e 100644
  
  	/* For command strings */
  	char *flags;
-diff --git a/src/tup/parser.c b/src/tup/parser.c
-index ce057737f..71ee32c79 100644
---- a/src/tup/parser.c
-+++ b/src/tup/parser.c
-@@ -2288,6 +2288,7 @@ struct path_list *new_pl(struct tupfile *tf, const char *s, int len, struct bin_
+--- tup.orig/src/tup/parser.c
++++ tup/src/tup/parser.c
+@@ -2235,6 +2235,7 @@
  	pl->pel = NULL;
  	pl->bin = NULL;
  	pl->re = NULL;
@@ -131,7 +128,8 @@ index ce057737f..71ee32c79 100644
  	memcpy(pl->mem, s, len);
  	pl->mem[len] = 0;
  	pl->orderid = orderid;
-@@ -2316,13 +2317,16 @@ struct path_list *new_pl(struct tupfile *tf, const char *s, int len, struct bin_
+@@ -2262,14 +2263,17 @@
+ 		}
  	} else if(p[0] == '^') {
  		/* Exclusion */
 -		const char *error;
@@ -152,7 +150,7 @@ index ce057737f..71ee32c79 100644
  	} else {
  		/* Path */
  		if(strchr(p, '<') != NULL) {
-@@ -2544,7 +2548,8 @@ void del_pl(struct path_list *pl, struct path_list_head *head)
+@@ -2480,7 +2484,8 @@
  {
  	TAILQ_REMOVE(head, pl, list);
  	if(pl->re) {
@@ -162,7 +160,7 @@ index ce057737f..71ee32c79 100644
  	}
  	free_pel(pl->pel);
  	free(pl);
-@@ -2861,10 +2866,10 @@ static int nl_rm_exclusion(struct tupfile *tf, struct path_list *pl, struct name
+@@ -2787,10 +2792,10 @@
  	TAILQ_FOREACH_SAFE(nle, &nl->entries, list, tmp) {
  		int rc;
  
@@ -176,10 +174,8 @@ index ce057737f..71ee32c79 100644
  			fprintf(tf->f, "tup error: Regex failed to execute: %s\n", &pl->mem[1]);
  			return -1;
  		}
-diff --git a/src/tup/parser.h b/src/tup/parser.h
-index 66ada7b0e..220f9d29e 100644
---- a/src/tup/parser.h
-+++ b/src/tup/parser.h
+--- tup.orig/src/tup/parser.h
++++ tup/src/tup/parser.h
 @@ -26,7 +26,7 @@
  #include "timespan.h"
  #include "bin.h"
@@ -189,7 +185,7 @@ index 66ada7b0e..220f9d29e 100644
  
  #define TUPLUA_NOERROR 0
  #define TUPLUA_PENDINGERROR 1
-@@ -130,7 +130,8 @@ struct path_list {
+@@ -127,7 +127,8 @@
  	struct bin *bin;
  
  	/* For exclusions: */
@@ -199,11 +195,8 @@ index 66ada7b0e..220f9d29e 100644
  
  	/* Copy of the full string */
  	char mem[0];
-diff --git a/src/tup/tup_pcre.h b/src/tup/tup_pcre.h
-new file mode 100644
-index 000000000..37987f6eb
 --- /dev/null
-+++ b/src/tup/tup_pcre.h
++++ tup/src/tup/tup_pcre.h
 @@ -0,0 +1,28 @@
 +/* vim: set ts=8 sw=8 sts=8 noet tw=78:
 + *
-- 
2.43.0


Reply to: