# My Cantata port : help needed for compilation to succeed



## nadstaky (Jan 5, 2015)

Hello,

I'm new to FreeBSD. I use 10.1.

I've created a Makefile for cantata (QT musicpd player), here it is :


```
# $FreeBSD:$

PORTNAME= cantata
PORTVERSION= 1.4.2
CATEGORIES= audio
MASTER_SITES= https://code.google.com/p/cantata/

MAINTAINER= nobody@FreeBSD.org
COMMENT= Full featured QT client for musicpd

LICENSE= GPLv2

RUN_DEPENDS= mpg123:${PORTSDIR}/audio/mpg123 \
cdparanoia:${PORTSDIR}/audio/cdparanoia \
musicpd:${PORTSDIR}/audio/musicpd

LIB_DEPENDS= libmpd.so:${PORTSDIR}/audio/libmpd \
libmusicbrainz5.so:${PORTSDIR}/audio/libmusicbrainz5 \
libmtp.so:${PORTSDIR}/multimedia/libmtp \
libcddb.so:${PORTSDIR}/audio/libcddb \
libtag.so:${PORTSDIR}/audio/taglib

USE_QT5+= multimedia \
svg \
concurrent

USE_KDE4+= oxygen

USE_GTK2= hicolor-icon-theme

USES= cmake tar:bz2
CMAKE_ARGS= -DCMAKE_PREFIX=${PREFIX} \
-DCMAKE_BUILD_TYPE=Release \
-DENABLE_KDE=OFF \
-DENABLE_QT5=ON

MAKE_JOBS_UNSAFE=yes

INSTALLS_ICONS= yes

.include <bsd.port.mk>
```

But it fails with those errors :


```
[LIST=1]
[*][0m[ 96%] Built target cantata
[*][35m[1mScanning dependencies of target ebur128
[*][0m[ 97%] [32mBuilding C object 3rdparty/ebur128/CMakeFiles/ebur128.dir/ebur128.c.o
[*][0m[31m[1mLinking C static library libebur128.a
[*][0m[ 97%] Built target ebur128
[*][ 97%] [34m[1mGenerating moc_replaygain.cpp
[*][0m[ 98%] [34m[1mGenerating moc_trackscanner.cpp
[*][0m[ 98%] [34m[1mGenerating __/support/moc_thread.cpp
[*][0m[35m[1mScanning dependencies of target cantata-replaygain
[*][0m[ 98%] [32mBuilding CXX object replaygain/CMakeFiles/cantata-replaygain.dir/ffmpeginput.cpp.o
[*][0mIn file included from /usr/ports/audio/cantata/work/cantata-1.4.2/replaygain/ffmpeginput.cpp:31:
[*]In file included from /usr/local/include/qt5/QtCore/QFile:1:
[*]In file included from /usr/local/include/qt5/QtCore/qfile.h:45:
[*]In file included from /usr/local/include/qt5/QtCore/qfiledevice.h:45:
[*]In file included from /usr/local/include/qt5/QtCore/qiodevice.h:47:
[*]In file included from /usr/local/include/qt5/QtCore/qobject.h:49:
[*]In file included from /usr/local/include/qt5/QtCore/qstring.h:50:
[*]In file included from /usr/include/c++/v1/string:437:
[*][1m/usr/include/c++/v1/cstdio:143:9: [0m[0;1;31merror: [0m[1mno member named 'snprintf' in the
[*] global namespace[0m
[*]using ::snprintf;
[*][0;1;32m ~~^
[*][0m[1m/usr/include/c++/v1/cstdio:148:9: [0m[0;1;31merror: [0m[1mno member named 'vfscanf' in the global
[*] namespace; did you mean 'fscanf'?[0m
[*]using ::vfscanf;
[*][0;1;32m ~~^
[*][0m[1m/usr/include/stdio.h:248:6: [0m[0;1;30mnote: [0m'fscanf' declared here[0m
[*]int fscanf(FILE * __restrict, const char * __restrict, ...);
[*][0;1;32m  ^
[*][0mIn file included from /usr/ports/audio/cantata/work/cantata-1.4.2/replaygain/ffmpeginput.cpp:31:
[*]In file included from /usr/local/include/qt5/QtCore/QFile:1:
[*]In file included from /usr/local/include/qt5/QtCore/qfile.h:45:
[*]In file included from /usr/local/include/qt5/QtCore/qfiledevice.h:45:
[*]In file included from /usr/local/include/qt5/QtCore/qiodevice.h:47:
[*]In file included from /usr/local/include/qt5/QtCore/qobject.h:49:
[*]In file included from /usr/local/include/qt5/QtCore/qstring.h:50:
[*]In file included from /usr/include/c++/v1/string:437:
[*][1m/usr/include/c++/v1/cstdio:149:9: [0m[0;1;31merror: [0m[1mno member named 'vscanf' in the global
[*] namespace[0m
[*]using ::vscanf;
[*][0;1;32m ~~^
[*][0m[1m/usr/include/c++/v1/cstdio:150:9: [0m[0;1;31merror: [0m[1mno member named 'vsscanf' in the global
[*] namespace; did you mean 'sscanf'?[0m
[*]using ::vsscanf;
[*][0;1;32m ~~^
[*][0m[1m/usr/include/stdio.h:268:6: [0m[0;1;30mnote: [0m'sscanf' declared here[0m
[*]int sscanf(const char * __restrict, const char * __restrict, ...);
[*][0;1;32m  ^
[*][0mIn file included from /usr/ports/audio/cantata/work/cantata-1.4.2/replaygain/ffmpeginput.cpp:31:
[*]In file included from /usr/local/include/qt5/QtCore/QFile:1:
[*]In file included from /usr/local/include/qt5/QtCore/qfile.h:45:
[*]In file included from /usr/local/include/qt5/QtCore/qfiledevice.h:45:
[*]In file included from /usr/local/include/qt5/QtCore/qiodevice.h:47:
[*]In file included from /usr/local/include/qt5/QtCore/qobject.h:49:
[*]In file included from /usr/local/include/qt5/QtCore/qstring.h:50:
[*]In file included from /usr/include/c++/v1/string:437:
[*][1m/usr/include/c++/v1/cstdio:153:9: [0m[0;1;31merror: [0m[1mno member named 'vsnprintf' in the
[*] global namespace[0m
[*]using ::vsnprintf;
[*][0;1;32m ~~^
[*][0mIn file included from /usr/ports/audio/cantata/work/cantata-1.4.2/replaygain/ffmpeginput.cpp:31:
[*]In file included from /usr/local/include/qt5/QtCore/QFile:1:
[*]In file included from /usr/local/include/qt5/QtCore/qfile.h:45:
[*]In file included from /usr/local/include/qt5/QtCore/qfiledevice.h:45:
[*]In file included from /usr/local/include/qt5/QtCore/qiodevice.h:47:
[*]In file included from /usr/local/include/qt5/QtCore/qobject.h:49:
[*]In file included from /usr/local/include/qt5/QtCore/qstring.h:50:
[*]In file included from /usr/include/c++/v1/string:438:
[*]In file included from /usr/include/c++/v1/cwchar:107:
[*]In file included from /usr/include/c++/v1/cwctype:54:
[*][1m/usr/include/c++/v1/cctype:71:9: [0m[0;1;31merror: [0m[1mno member named 'isblank' in the global
[*] namespace[0m
[*]using ::isblank;
[*][0;1;32m ~~^
[*][0mIn file included from /usr/ports/audio/cantata/work/cantata-1.4.2/replaygain/ffmpeginput.cpp:31:
[*]In file included from /usr/local/include/qt5/QtCore/QFile:1:
[*]In file included from /usr/local/include/qt5/QtCore/qfile.h:45:
[*]In file included from /usr/local/include/qt5/QtCore/qfiledevice.h:45:
[*]In file included from /usr/local/include/qt5/QtCore/qiodevice.h:47:
[*]In file included from /usr/local/include/qt5/QtCore/qobject.h:49:
[*]In file included from /usr/local/include/qt5/QtCore/qstring.h:50:
[*]In file included from /usr/include/c++/v1/string:438:
[*][1m/usr/include/c++/v1/cwchar:132:9: [0m[0;1;31merror: [0m[1mno member named 'vfwscanf' in the
[*] global namespace; did you mean 'fwscanf'?[0m
[*]using ::vfwscanf;
[*][0;1;32m ~~^
[*][0m[1m/usr/include/wchar.h:113:5: [0m[0;1;30mnote: [0m'fwscanf' declared here[0m
[*]int  fwscanf(FILE * __restrict, const wchar_t * __restrict, ...);
[*][0;1;32m ^
[*][0mIn file included from /usr/ports/audio/cantata/work/cantata-1.4.2/replaygain/ffmpeginput.cpp:31:
[*]In file included from /usr/local/include/qt5/QtCore/QFile:1:
[*]In file included from /usr/local/include/qt5/QtCore/qfile.h:45:
[*]In file included from /usr/local/include/qt5/QtCore/qfiledevice.h:45:
[*]In file included from /usr/local/include/qt5/QtCore/qiodevice.h:47:
[*]In file included from /usr/local/include/qt5/QtCore/qobject.h:49:
[*]In file included from /usr/local/include/qt5/QtCore/qstring.h:50:
[*]In file included from /usr/include/c++/v1/string:438:
[*][1m/usr/include/c++/v1/cwchar:133:9: [0m[0;1;31merror: [0m[1mno member named 'vswscanf' in the
[*] global namespace; did you mean 'swscanf'?[0m
[*]using ::vswscanf;
[*][0;1;32m ~~^
[*][0m[1m/usr/include/wchar.h:126:5: [0m[0;1;30mnote: [0m'swscanf' declared here[0m
[*]int  swscanf(const wchar_t * __restrict, const wchar_t * __restrict, ...);
[*][0;1;32m ^
[*][0mIn file included from /usr/ports/audio/cantata/work/cantata-1.4.2/replaygain/ffmpeginput.cpp:31:
[*]In file included from /usr/local/include/qt5/QtCore/QFile:1:
[*]In file included from /usr/local/include/qt5/QtCore/qfile.h:45:
[*]In file included from /usr/local/include/qt5/QtCore/qfiledevice.h:45:
[*]In file included from /usr/local/include/qt5/QtCore/qiodevice.h:47:
[*]In file included from /usr/local/include/qt5/QtCore/qobject.h:49:
[*]In file included from /usr/local/include/qt5/QtCore/qstring.h:50:
[*]In file included from /usr/include/c++/v1/string:438:
[*][1m/usr/include/c++/v1/cwchar:134:9: [0m[0;1;31merror: [0m[1mno member named 'vwscanf' in the global
[*] namespace[0m
[*]using ::vwscanf;
[*][0;1;32m ~~^
[*][0m[1m/usr/include/c++/v1/cwchar:150:9: [0m[0;1;31merror: [0m[1mno member named 'wcstof' in the global
[*] namespace[0m
[*]using ::wcstof;
[*][0;1;32m ~~^
[*][0m[1m/usr/include/c++/v1/cwchar:151:9: [0m[0;1;31merror: [0m[1mno member named 'wcstold' in the global
[*] namespace[0m
[*]using ::wcstold;
[*][0;1;32m ~~^
[*][0m[1m/usr/include/c++/v1/cwchar:155:9: [0m[0;1;31merror: [0m[1mno member named 'wcstoll' in the global
[*] namespace[0m
[*]using ::wcstoll;
[*][0;1;32m ~~^
[*][0m[1m/usr/include/c++/v1/cwchar:159:9: [0m[0;1;31merror: [0m[1mno member named 'wcstoull' in the
[*] global namespace; did you mean 'wcstoul'?[0m
[*]using ::wcstoull;
[*][0;1;32m ~~^
[*][0m[1m/usr/include/wchar.h:161:3: [0m[0;1;30mnote: [0m'wcstoul' declared here[0m
[*]  wcstoul(const wchar_t * __restrict, wchar_t ** __restrict, int);
[*][0;1;32m  ^
[*][0m13 errors generated.
[*]*** Error code 1
[*]Stop.
[*]make[3]: stopped in /usr/ports/audio/cantata/work/cantata-1.4.2
[*]*** Error code 1
[*]Stop.
[*]make[2]: stopped in /usr/ports/audio/cantata/work/cantata-1.4.2
[*]*** Error code 1
[*]Stop.
[*]make[1]: stopped in /usr/ports/audio/cantata/work/cantata-1.4.2
[*]*** Error code 1
[*]Stop.
[*]make: stopped in /usr/ports/audio/cantata
[/LIST]
```

I know nothing about programming, so I hope you will help me to make it build.

Regards,

Nad


----------



## nadstaky (Jan 5, 2015)

Take the sources here : https://code.google.com/p/cantata/wiki/Downloads?tm=2

I insist for version 1.4.2, earlier is buggy as hell...


----------



## bhughes (Jan 7, 2015)

We had a discussion IRC earlier today about this build error. Commenting out the 


```
#define _POSIX_C_SOURCE 1
```

at the top of both ffmpeginput.cpp and mpg123input.cpp helps fix the errors. I'm unsure if this should be considered a bug in the cstdio C++ include.

Did the build succeed? I'm curious


----------



## nadstaky (Jan 8, 2015)

Hello bhughes,

It compiles really well now 

But I have serious issues when Cantata is launched : there are a lot of buttons missing (play, pause and so on), IIRC no menu.
Cantata 1.4.2 don't use my GTK2 theme...

I've compiled Cantata 1.3.4, this time it uses my GTK2 theme but still unusable (missing buttons and so on).

Tonight I'll check the dependencies.

Thanks once again,
Nad


----------



## nadstaky (Jan 8, 2015)

bhughes, FreeBSD users,

If you see any missing dependencies in my Makefile,  feel free to inform me 

Nad


----------



## nadstaky (Jan 8, 2015)

Here is a screenshot of 1.3.4 compiled with Qt5 (1.4.2 is the same crap, plus it does not apply my dark GTK2 theme)


----------



## nadstaky (Jan 8, 2015)




----------



## nadstaky (Jan 8, 2015)

Here is what it should look at:


----------



## protocelt (Jan 8, 2015)

Does it show the UI correctly using native Qt?


----------



## ljboiler (Jan 9, 2015)

I built the 1.5.1 version with Qt5, got the missing play/pause buttons by installing x11-themes/kde4-icons-oxygen and pointing to that icon theme in ~/.config/cantata/cantata.conf

```
[General]
iconTheme=oxygen
```


----------



## protocelt (Jan 9, 2015)

ljboiler said:


> I built the 1.5.1 version with Qt5, got the missing play/pause buttons by installing x11-themes/kde4-icons-oxygen and pointing to that icon theme in ~/.config/cantata/cantata.conf
> 
> ```
> [General]
> ...


Version 1.5.1 builds against devel/qt5 for me as well running 10-STABLE r276386. I haven't tried building it on a *-RELEASE version yet.


----------



## nadstaky (Jan 9, 2015)

Thanks all...

I've tried building 1.4.2 with Qt4, and I have no issues at all 

Will try your suggestions with Qt5 and the icons (that should have been installed if you have a look at my Makefile...)

I'll post my Qt4 Makefile tonight.

Cheers!

Nad


----------



## nadstaky (Jan 13, 2015)

Hello all, after some hours of work and help, here is a Qt4 1.5.1 that compiles fine.
The albums art are missing though -don’t know if I missed something- :


```
# $FreeBSD:$

PORTNAME=   cantata
PORTVERSION=   1.5.1
CATEGORIES=   audio
MASTER_SITES=   https://googledrive.com/host/
DISTNAME=   0Bzghs6gQWi60UktwaTRMTjRIUW8
EXTRACT_SUFX=

MAINTAINER=   ports@FreeBSD.org
COMMENT=   Full featured QT client for musicpd

LICENSE=   GPLv3

RUN_DEPENDS=   mpg123:${PORTSDIR}/audio/mpg123 \
     cdparanoia:${PORTSDIR}/audio/cdparanoia \
     musicpd:${PORTSDIR}/audio/musicpd  \
     taglib-extras-config:${PORTSDIR}/audio/taglib-extras
LIB_DEPENDS=   libavcodec0.so:${PORTSDIR}/multimedia/ffmpeg0 \
     libmpd.so:${PORTSDIR}/audio/libmpd \
     libmusicbrainz5.so:${PORTSDIR}/audio/libmusicbrainz5 \
     libmtp.so:${PORTSDIR}/multimedia/libmtp \
     libcddb.so:${PORTSDIR}/audio/libcddb \
     libsamplerate.so:${PORTSDIR}/audio/libsamplerate \
     libqjson.so:${PORTSDIR}/devel/qjson \
     libspeex.so:${PORTSDIR}/audio/speex

USES=     cmake:outsource tar:bzip2

USE_QT4+=   corelib \
     gui \
     network \
     multimedia \
     svg \
     moc_build \
     qmake_build \
     xml \
     dbus

USE_KDE4+=   oxygen

USE_GTK2=   hicolor-icon-theme

CMAKE_ARGS+=   -DENABLE_FFMPEG:BOOL=TRUE  \
     -DENABLE_KDE:BOOL=FALSE

CPPFLAGS+=   -I${LOCALBASE}/include

USE_LDCONFIG=   yes

MAKE_JOBS_UNSAFE=yes

WRKSRC=     ${WRKDIR}/${PORTNAME}-${PORTVERSION}

INSTALLS_ICONS=   yes

post-patch:
   ${REINPLACE_CMD} -e '11d' ${WRKSRC}/replaygain/mpg123input.cpp
   ${REINPLACE_CMD} -e '11d' ${WRKSRC}/replaygain/ffmpeginput.cpp

.include <bsd.port.mk>
```


----------

