Bug#1014987: netsurf: FTBFS on the Hurd - refresh patch

2024-04-16 Thread João
X-Debbugs-CC: debian-hurd@lists.debian.org

Dear Maintainer,

Refreshing the patch fixing the FTBFS on the hurd to version 3.11 of netsurf.

I don't know if the framebuffer package should be built on the hurd. With the
attached patch the package builds, but when I try to run the program with the
SDL frontend, it crashes. But perhaps it is not expected to work.
In any case that would be the case for a separate bug report.

Many thanks,
João
--- netsurf-3.11.orig/netsurf/frontends/framebuffer/fetch.c
+++ netsurf-3.11/netsurf/frontends/framebuffer/fetch.c
@@ -48,13 +48,16 @@
  */
 static nsurl *get_resource_url(const char *path)
 {
-	char buf[PATH_MAX];
+	char *buf = NULL;
 	nsurl *url = NULL;
 
 	if (strcmp(path, "favicon.ico") == 0)
 		path = "favicon.png";
 
-	netsurf_path_to_nsurl(filepath_sfind(respaths, buf, path), );
+	buf = filepath_find(respaths, path);
+	netsurf_path_to_nsurl(buf, );
+ 
+	free(buf);
 
 	return url;
 }
--- netsurf-3.11.orig/netsurf/frontends/framebuffer/font_freetype.c
+++ netsurf-3.11/netsurf/frontends/framebuffer/font_freetype.c
@@ -120,15 +120,16 @@ fb_new_face(const char *option, const ch
 fb_faceid_t *newf;
 FT_Error error;
 FT_Face aface;
-	char buf[PATH_MAX];
+	char *buf = NULL;
 
 newf = calloc(1, sizeof(fb_faceid_t));
 
 if (option != NULL) {
 newf->fontfile = strdup(option);
 } else {
-		filepath_sfind(respaths, buf, fontname);
+		buf = filepath_find(respaths, fontname);
 newf->fontfile = strdup(buf);
+		free(buf);
 }
 
 error = FTC_Manager_LookupFace(ft_cmanager, (FTC_FaceID)newf, );
--- netsurf-3.11.orig/netsurf/frontends/gtk/fetch.c
+++ netsurf-3.11/netsurf/frontends/gtk/fetch.c
@@ -250,14 +250,16 @@ const char *fetch_filetype(const char *u
 
 static nsurl *nsgtk_get_resource_url(const char *path)
 {
-	char buf[PATH_MAX];
+	char *buf = NULL;
 	nsurl *url = NULL;
 
 	/* favicon.ico -> favicon.png */
 	if (strcmp(path, "favicon.ico") == 0) {
 		nsurl_create("resource:favicon.png", );
 	} else {
-		netsurf_path_to_nsurl(filepath_sfind(respaths, buf, path), );
+		buf = filepath_find(respaths, path);
+		netsurf_path_to_nsurl(buf, );
+		free(buf);
 	}
 
 	return url;
--- netsurf-3.11.orig/netsurf/frontends/gtk/gui.c
+++ netsurf-3.11/netsurf/frontends/gtk/gui.c
@@ -909,8 +909,8 @@ static nserror nsgtk_add_named_icons_to_
  */
 static nserror nsgtk_setup(int argc, char** argv, char **respath)
 {
-	char buf[PATH_MAX];
-	char *resource_filename;
+	char *buf = NULL;
+	char *resource_filename = NULL;
 	char *addr = NULL;
 	nsurl *url;
 	nserror res;
@@ -986,8 +986,9 @@ static nserror nsgtk_setup(int argc, cha
 		.pma = true,
 	});
 
-	filepath_sfinddef(respath, buf, "mime.types", "/etc/");
+	buf = filepath_sfinddef(respath, "mime.types", "/etc/");
 	gtk_fetch_filetype_init(buf);
+	free(buf);
 
 	save_complete_init();
 
--- netsurf-3.11.orig/netsurf/frontends/monkey/fetch.c
+++ netsurf-3.11/netsurf/frontends/monkey/fetch.c
@@ -36,10 +36,12 @@ extern char **respaths;
 
 static nsurl *gui_get_resource_url(const char *path)
 {
-	char buf[PATH_MAX];
+	char *buf = NULL;
 	nsurl *url = NULL;
 
-	netsurf_path_to_nsurl(filepath_sfind(respaths, buf, path), );
+	buf = filepath_find(respaths, path);
+	netsurf_path_to_nsurl(buf, );
+	free(buf);
 
 	return url;
 }
--- netsurf-3.11.orig/netsurf/frontends/monkey/main.c
+++ netsurf-3.11/netsurf/frontends/monkey/main.c
@@ -390,7 +390,7 @@ main(int argc, char **argv)
 {
 	char *messages;
 	char *options;
-	char buf[PATH_MAX];
+	char *buf = NULL;
 	nserror ret;
 	struct netsurf_table monkey_table = {
 		.misc = _misc_table,
@@ -452,8 +452,9 @@ main(int argc, char **argv)
 		die("NetSurf failed to initialise");
 	}
 
-	filepath_sfinddef(respaths, buf, "mime.types", "/etc/");
+	buf = filepath_sfinddef(respaths, "mime.types", "/etc/");
 	monkey_fetch_filetype_init(buf);
+	free(buf);
 
 	urldb_load(nsoption_charp(url_file));
 	urldb_load_cookies(nsoption_charp(cookie_file));
--- netsurf-3.11.orig/netsurf/frontends/windows/fetch.c
+++ netsurf-3.11/netsurf/frontends/windows/fetch.c
@@ -76,10 +76,12 @@ static const char *fetch_filetype(const
  */
 static nsurl *nsw32_get_resource_url(const char *path)
 {
-	char buf[PATH_MAX];
+	char *buf = NULL;
 	nsurl *url = NULL;
 
-	netsurf_path_to_nsurl(filepath_sfind(G_resource_pathv, buf, path), );
+	buf = filepath_find(G_resource_pathv, path);
+	netsurf_path_to_nsurl(buf, );
+	free(buf);
 
 	return url;
 }
--- netsurf-3.11.orig/netsurf/frontends/windows/main.c
+++ netsurf-3.11/netsurf/frontends/windows/main.c
@@ -171,12 +171,13 @@ static nserror set_defaults(struct nsopt
 	DWORD buf_bytes_size = sizeof(TCHAR) * buf_tchar_size;
 	char *ptr = NULL;
 	char *buf;
+	char *buftest;
 	char *fname;
 	HRESULT hres;
 	char dldir[] = "Downloads";
 
 	buf = malloc(buf_bytes_size);
-	if (buf== NULL) {
+	if (buf == NULL) {
 		return NSERROR_NOMEM;
 	}
 	buf[0] = '\0';
@@ -191,8 +192,9 @@ static nserror set_defaults(struct nsopt
 	if 

Bug#1069094: mariadb: FTBFS on hurd-i386

2024-04-16 Thread Svante Signell
Source: mariadb
Version: 10.11.7-4
Severity: important
Tags: patch
User: debian-hurd@lists.debian.org
Usertags: hurd
X-Debbugs-CC: debian-hurd@lists.debian.org

Hi,

mariadb FTBFS on hurd-i386. Attached are three patches enabling a
successful build:

- debian_rules.patch: 
override_dh_installsystemd: Install mariadb.service on Linux only.
override_dh_missing: Change dh_missing from fail to list on non-linux. 

- storage_connect_ioapi.h.patch:
Add Hurd to define __USE_FILE_OFFSET64 et al.

- plugin_disks_information_schema_disks.cc.patch:
Define PATH_MAX if not defined.

Unfortunately the build succeeds only with DEB_BUILD_OPTIONS=nocheck
since debian/rules override_dh_auto_test errors out with:
2024-04-16 11:09:38 0 [Note] Plugin 'INNODB_SYS_VIRTUAL' is disabled.
ERROR: 1017  Can't find file: '(temporary)' (errno: 1073741826 "No such
file or directory")
2024-04-16 11:09:38 0 [ERROR] Aborting

Additionally the file debian/unstable-tests.hurd should be linked to
unstable-tests.hurd-i386 (or equivalent) since
dpkg-architecture -qDEB_BUILD_ARCH results in hurd-i386.

Thanks!

--- a/debian/rules	2024-04-15 16:46:16.0 +0200
+++ b/debian/rules	2024-04-15 16:45:59.0 +0200
@@ -205,7 +205,14 @@
 	mv -v $(TMP)/usr/lib/mysql/plugin/qa_auth_client.so $(TMP)/usr/lib/$(DEB_HOST_MULTIARCH)/libmariadb3/plugin/
 
 override_dh_installsystemd:
+ifneq (,$(filter linux,$(DEB_HOST_ARCH_OS)))
 	dh_installsystemd -pmariadb-server mariadb.service
+endif
+
+override_dh_missing:
+ifneq (,$(filter linux,$(DEB_HOST_ARCH_OS)))
+	dh_missing --list-missing
+endif
 
 override_dh_installinit-arch:
 	dh_installinit --name=mariadb
Index: mariadb-10.11.7/plugin/disks/information_schema_disks.cc
===
--- mariadb-10.11.7.orig/plugin/disks/information_schema_disks.cc
+++ mariadb-10.11.7/plugin/disks/information_schema_disks.cc
@@ -32,6 +32,9 @@
 #include 
 #endif
 #endif
+#ifndef PATH_MAX
+#define PATH_MAX 4096
+#endif
 #include 
 #include 
 #include /* check_global_access() */
--- a/storage/connect/ioapi.h	2024-02-01 18:36:14.0 +0100
+++ b/storage/connect/ioapi.h	2024-04-14 17:29:57.0 +0200
@@ -21,9 +21,10 @@
 #ifndef _ZLIBIOAPI64_H
 #define _ZLIBIOAPI64_H
 
-#if defined(__linux__)
+#if defined(__linux__) || defined (__GNU__)
 
-  // Linux needs this to support file operation on files larger then 4+GB
+  // Linux and Hurd needs this to support file operation on files larger
+  // than 4+GB.
   // But might need better if/def to select just the platforms that needs them.
 
 #ifndef __USE_FILE_OFFSET64