figure002 / nextwall

A wallpaper rotator for the GNOME desktop.
GNU General Public License v3.0
7 stars 1 forks source link

Compiling on OS X fails #5

Open techhazard opened 7 years ago

techhazard commented 7 years ago

I wanted to compile this on OS X to be able to put my wallpapers in different folders based on their lightness.

I got as far as installing the dependencies with homebrew:

brew install autoconf automaker check homebrew/science/fann glib imagemagick libffi libmagic readline sqlite  

Compiling fails at database.c 😞 :

/Applications/Xcode.app/Contents/Developer/usr/bin/make  all-recursive
Making all in data
make[2]: Nothing to be done for `all'.
Making all in gnome-shell-extension
Making all in src
make[3]: Nothing to be done for `all'.
make[3]: Nothing to be done for `all-am'.
Making all in lib
gcc -DHAVE_CONFIG_H -I. -I../../lib -I..  -Wall -Werror -D_REENTRANT -I/usr/local/Cellar/glib/2.50.1/include/glib-2.0 -I/usr/local/Cellar/glib/2.50.1/lib/glib-2.0/include -I/usr/local/opt/gettext/include -I/usr/local/Cellar/pcre/8.39/include -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16 -I/usr/local/Cellar/imagemagick/6.9.6-2/include/ImageMagick-6    -MT database.o -MD -MP -MF .deps/database.Tpo -c -o database.o ../../lib/database.c
../../lib/database.c:80:9: error: variable 'mquery' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
    if (rc != SQLITE_OK)
        ^~~~~~~~~~~~~~~
../../lib/database.c:101:9: note: uninitialized use occurs here
    if (mquery)
        ^~~~~~
../../lib/database.c:80:5: note: remove the 'if' if its condition is always false
    if (rc != SQLITE_OK)
    ^~~~~~~~~~~~~~~~~~~~
../../lib/database.c:72:9: error: variable 'mquery' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized]
    if (rc != SQLITE_OK)
        ^~~~~~~~~~~~~~~
../../lib/database.c:101:9: note: uninitialized use occurs here
    if (mquery)
        ^~~~~~
../../lib/database.c:72:5: note: remove the 'if' if its condition is always false
    if (rc != SQLITE_OK)
    ^~~~~~~~~~~~~~~~~~~~
../../lib/database.c:62:25: note: initialize the variable 'mquery' to silence this warning
    char *query, *mquery;
                        ^
                         = NULL
../../lib/database.c:333:13: error: comparison of array 'real_base' equal to a null pointer is always false [-Werror,-Wtautological-pointer-compare]
        if (real_base == NULL)
            ^~~~~~~~~    ~~~~
3 errors generated.
make[2]: *** [database.o] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

I'm guessing that database.c is an external dependency, but I couldn't find the source. Could you perhaps check if the author has updated the code?

figure002 commented 7 years ago

Thanks for reporting this! I haven't tested the fix on OS X yet and those two warning categories don't exist in my version of gcc on Linux. Feel free to reopen this issue if compiling still fails.

techhazard commented 7 years ago

It still doesn't compile, though I've gotten a bit further.

I got the error that argp.h was missing so I installed it with brew install argp-standalone

After that I got errors about implicit declarations of strcmp, strcpy, strerr and strcat. This is fixed in #7 .

I now failed at:

In file included from ../../src/nextwall.c:42:
../../lib/cfgpath.h:49:2: error: cfgpath.h functions have not been implemented for your platform! Please send patches.
#error cfgpath.h functions have not been implemented for your platform!  Please send patches.
 ^

I tried to update cfgpath.h which now supports OS X, but it used functions that are deprecated since 10.8... (which cause errors) yay, apple. I will later go further down this rabbit hole. If I get it working on OS X you can expect another pull request. (instead of a lot of smaller ones 😉 )

(I also can't seem to reopen this issue)