Opened 6 years ago

Closed 19 months ago

#56196 closed defect (fixed)

fluxbox @1.3.7_1 does not compile on macOS High Sierra, Version 10.13.4, because it clock_gettime() and uses a pointer instead an int

Reported by: ballapete (Peter "Pete" Dyballa) Owned by: kencu (Ken)
Priority: Normal Milestone:
Component: ports Version: 2.4.2
Keywords: Cc:
Port: fluxbox

Description

First bug:

/usr/bin/clang++ -DHAVE_CONFIG_H -I.  -I/opt/local/include/freetype2 -I/opt/local/include/fribidi -I/opt/local/include/glib-2.0 -I/opt/local/lib/glib-2.0/include\
 -include ./config.h -I./src -I./src -I./nls -I/opt/local/include  -pipe -Os -stdlib=libc++ -arch x86_64  -MT src/FbTk/libFbTk_a-FbWindow.o -MD -MP -MF src/FbTk/\
.deps/libFbTk_a-FbWindow.Tpo -c -o src/FbTk/libFbTk_a-FbWindow.o `test -f 'src/FbTk/FbWindow.cc' || echo './'`src/FbTk/FbWindow.cc
src/FbTk/FbTime.cc:64:10: error: redefinition of '_mono'
uint64_t _mono() {
         ^
src/FbTk/FbTime.cc:33:10: note: previous definition is here
uint64_t _mono() {
         ^
1 error generated.

The cause it that configure finds clock_gettime() works correctly and therefore sets HAVE_CLOCK_GETTIME. This can be corrected with this patch, HighSierra-src_FbTK_FbTime.cc-clock_gettime.patch:

--- src/FbTk/FbTime.cc~ 2015-02-08 11:44:45.000000000 +0100                                                                                                       
+++ src/FbTk/FbTime.cc  2018-03-31 13:18:34.000000000 +0200                                                                                                       
@@ -25,7 +25,7 @@
 #include <sys/time.h>                                                                                                                                            
                                                                                                                                                                  
                                                                                                                                                                  
-#ifdef HAVE_CLOCK_GETTIME // linux|*bsd|solaris                                                                                                                  
+#if defined HAVE_CLOCK_GETTIME &&  __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 101300 // linux|*bsd|solaris                                                  
 #include <time.h>                                                                                                                                                
                                                                                                                                                                  
 namespace { 

Second failure is this:

/usr/bin/clang++ -DHAVE_CONFIG_H -I.  -include ./config.h -I./src/FbTk -I/opt/local/include  -pipe -Os -stdlib=libc++ -arch x86_64  -MT util/fluxbox_remote-fluxb\
ox-remote.o -MD -MP -MF util/.deps/fluxbox_remote-fluxbox-remote.Tpo -c -o util/fluxbox_remote-fluxbox-remote.o `test -f 'util/fluxbox-remote.cc' || echo './'`ut\
il/fluxbox-remote.cc
util/fluxbox-remote.cc:76:32: error: ordered comparison between pointer and zero ('unsigned char *' and 'int')
            && text_prop.value > 0
               ~~~~~~~~~~~~~~~ ^ ~

text_prop.value is the value member in this struct:

typedef struct {
    unsigned char *value;
    Atom encoding;
    int format;
    unsigned long nitems;
} XTextProperty;

A possible patch,HighSierra-util_fluxbox-remote.cc-nullptr.patch, is:

--- util/fluxbox-remote.cc~     2015-02-08 11:44:45.000000000 +0100                                                                                               
+++ util/fluxbox-remote.cc      2018-03-31 13:56:09.000000000 +0200                                                                                               
@@ -73,7 +73,7 @@
     if (strcmp(cmd, "result") == 0) {                                                                                                                            
         XTextProperty text_prop;                                                                                                                                 
         if (XGetTextProperty(disp, root, &text_prop, atom_result) != 0                                                                                           
-            && text_prop.value > 0                                                                                                                               
+            && text_prop.value != nullptr                                                                                                                        
             && text_prop.nitems > 0) {                                                                                                                           
                                                                                                                                                                  
             printf("%s", text_prop.value);                                                                                                                       

Attachments (3)

HighSierra-src_FbTK_FbTime.cc-clock_gettime.patch (360 bytes) - added by ballapete (Peter "Pete" Dyballa) 6 years ago.
HighSierra-util_fluxbox-remote.cc-nullptr.patch (455 bytes) - added by ballapete (Peter "Pete" Dyballa) 6 years ago.
HighSierra-Portfile.patch (408 bytes) - added by ballapete (Peter "Pete" Dyballa) 6 years ago.

Download all attachments as: .zip

Change History (11)

Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

Attachment: HighSierra-Portfile.patch added

comment:1 Changed 6 years ago by ballapete (Peter "Pete" Dyballa)

comment:2 in reply to:  1 Changed 5 years ago by willbprog127 (Will Brokenbourgh)

Replying to ballapete:

I opened a case: https://sourceforge.net/p/fluxbox/bugs/1171/.

Was about to file a new ticket and found this first.

I'm on macOS 10.14.6

Any progress on this? Upstream says a commit supposedly fixed this:

fixed via http://git.fluxbox.org/fluxbox.git/commit/?id=22866c4d30f5b289c429c5ca88d800200db4fc4f

comment:3 Changed 5 years ago by mf2k (Frank Schima)

This port has no maintainer and there is no ticket activity which means no one is working on this. If you want this fixed, it would be helpful if you submit a GitHub pull request with an update/fix.

comment:4 Changed 5 years ago by mf2k (Frank Schima)

Keywords: highsierra removed

comment:5 Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

The same error with the redefinition of '_mono' appears also in Catalina, macOS 10.15.7.

comment:6 Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

And the comparison of a pointer with an integer produces an error as well. The old patches still work.

comment:7 in reply to:  3 Changed 4 years ago by ballapete (Peter "Pete" Dyballa)

Replying to mf2k:

This port has no maintainer and there is no ticket activity which means no one is working on this. If you want this fixed, it would be helpful if you submit a GitHub pull request with an update/fix.

How can I perform this? I have no idea what a "GitHub pull request" is…

comment:8 Changed 19 months ago by kencu (Ken)

Owner: set to kencu
Resolution: fixed
Status: newclosed

In e0f38cec5c88ebaa17349ab4d641902a2e1991e1/macports-ports (master):

fluxbox: fix build errors on newer systems

closes: #56196

Note: See TracTickets for help on using tickets.