Skip to content

NetBSD build problems #168

@0-wiz-0

Description

@0-wiz-0

qt 6.10 broke Guitar 1.3.0, so I've updated Guitar in pkgsrc to 1.3.1. I had a couple problems, all in filetype:

  • filetype/file-gcc/config.h unconditionally defines HAVE_USELOCALE to 1 - but NetBSD does not provide this
  • filetype/liboniguruma.pro defines HAVE_CONFIG_H=1 but there is none, or at least it's not in the default search path of the liboniguruma build
  • two files in oniguruma do not check HAVE_CONFIG_H before including config.h

pkgsrc provides packages for oniguruma and file, but I don't see how I can use them - that would avoid these problems. Can you please advise?

Here are the patches I'm using in pkgsrc for now, but only the last oniguruma ones should be applied:

--- filetype/file-gcc/config.h.orig     2025-11-13 22:15:18.574915697 +0000
+++ filetype/file-gcc/config.h
@@ -247,7 +247,7 @@
 #define HAVE_UNISTD_H 1

 /* Define to 1 if you have the `uselocale' function. */
-#define HAVE_USELOCALE 1
+/*#define HAVE_USELOCALE 1 */

 /* Define to 1 if you have the `utime' function. */
 #define HAVE_UTIME 1
--- filetype/liboniguruma.pro.orig      2025-10-31 14:38:04.000000000 +0000
+++ filetype/liboniguruma.pro
@@ -10,7 +10,6 @@ CONFIG -= app_bundle
 CONFIG -= qt

 DEFINES += ONIG_STATIC=1 USE_POSIX_API=1
-DEFINES += HAVE_CONFIG_H=1
 msvc:INCLUDEPATH += oniguruma-msvc

 HEADERS += \
--- filetype/oniguruma/src/regenc.h.orig        2025-11-13 22:03:27.734779409 +0000
+++ filetype/oniguruma/src/regenc.h
@@ -33,7 +33,9 @@
 #define ONIGURUMA_EXPORT
 #endif

+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif

 #ifndef ONIG_NO_STANDARD_C_HEADERS
 #include <stddef.h>
--- filetype/oniguruma/src/regposerr.c.orig     2025-11-13 22:03:53.758831992 +0000
+++ filetype/oniguruma/src/regposerr.c
@@ -34,7 +34,9 @@
 #define ONIGURUMA_EXPORT
 #endif

+#ifdef HAVE_CONFIG_H
 #include "config.h"
+#endif
 #include "onigposix.h"

 #undef regex_t

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions