You are not logged in.
Hey everyone, I seem to be running into an issue with building Audacity using the ABS. It gets to a certain point and then fails, appears to be a typecasting error in import/ImportFLAC.cpp, however I'm unsure. Does this look to be an upstream issue? I couldn't find any reports on this issue and wanted to check here to see if it's worth reporting upstream or not. Below is the tail end of the build output using makepkg.
g++ -DHAVE_CONFIG_H -I. -Wno-deprecated-declarations -D__STDC_CONSTANT_MACROS -DLIBDIR=\"/usr/lib\" -I../lib-src/portaudio-v19/include -I../lib-src/lib-widget-extra -I/usr/lib/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -I../lib-src/libnyquist -I/usr/include/soundtouch -I../lib-src/twolame/libtwolame -I../lib-src/lv2/include -I../lib-src/lv2/include -march=native -O2 -pipe -fstack-protector-strong -Wall -I/usr/include/portsmf -I/usr/lib/wx/include/gtk2-unicode-3.0 -I/usr/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -pthread -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/libdrm -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wno-unused-local-typedefs -I../lib-src/portmixer/include -march=native -O2 -pipe -fstack-protector-strong -DwxDEBUG_LEVEL=0 -Wall -I../include -I../lib-src/FileDialog -MT import/audacity-ImportFLAC.o -MD -MP -MF import/.deps/audacity-ImportFLAC.Tpo -c -o import/audacity-ImportFLAC.o `test -f 'import/ImportFLAC.cpp' || echo './'`import/ImportFLAC.cpp
import/ImportFLAC.cpp: In member function ‘virtual void MyFLACFile::metadata_callback(const FLAC__StreamMetadata*)’:
import/ImportFLAC.cpp:183:11: warning: enumeration value ‘FLAC__MAX_METADATA_TYPE’ not handled in switch [-Wswitch]
switch (metadata->type)
^
import/ImportFLAC.cpp: In member function ‘virtual ImportFileHandle* FLACImportPlugin::Open(wxString)’:
import/ImportFLAC.cpp:299:14: error: cannot convert ‘bool’ to ‘ImportFileHandle*’ in return
return false; // File not found
^~~~~
import/ImportFLAC.cpp:316:14: error: cannot convert ‘bool’ to ‘ImportFileHandle*’ in return
return false;
^~~~~
make[2]: *** [Makefile:4739: import/audacity-ImportFLAC.o] Error 1
make[2]: Leaving directory '/home/steven/builds/audacity/src/audacity-Audacity-2.1.2/src'
make[1]: *** [Makefile:1355: all] Error 2
make[1]: Leaving directory '/home/steven/builds/audacity/src/audacity-Audacity-2.1.2/src'
make: *** [Makefile:726: all-recursive] Error 1
==> ERROR: A failure occurred in build().
Aborting...
Offline
Seems the problem is that GCC 6 is more strict when it comes to conversions. The functions return type is a pointer not bool.
If you look at the function you see that it returns NULL in line 34. I'm not sure but I think changing 'return false' to 'return NULL' could be a valid fix in this case.
patch
--- src/import/ImportFLAC.cpp.orig 2016-12-05 22:04:25.671127345 +0100
+++ src/import/ImportFLAC.cpp 2016-12-05 22:05:11.434008915 +0100
@@ -296,7 +296,7 @@
int cnt;
wxFile binaryFile;
if (!binaryFile.Open(filename)) {
- return false; // File not found
+ return NULL; // File not found
}
#ifdef USE_LIBID3TAG
@@ -313,7 +313,7 @@
if (cnt == wxInvalidOffset || strncmp(buf, FLAC_HEADER, 4) != 0) {
// File is not a FLAC file
- return false;
+ return NULL;
}
// Open the file for import
--- src/effects/vamp/LoadVamp.cpp.orig 2016-12-05 22:19:31.211844589 +0100
+++ src/effects/vamp/LoadVamp.cpp 2016-12-05 22:15:01.146156418 +0100
@@ -266,7 +266,7 @@
Plugin *vp = PluginLoader::getInstance()->loadPlugin(key, 48000); // rate doesn't matter here
if (!vp)
{
- return false;
+ return NULL;
}
// We limit the listed plugin outputs to those whose results can
EDIT:
Updated the patch, there was one more conversion error.
Regarding your question if it's an upstream issue, I would say yes...
Last edited by mis (2016-12-05 21:44:11)
Offline
I searched for "audacity import/ImportFLAC.cpp:299:14: error: cannot convert ‘bool’ to ‘ImportFileHandle*’" and found these:
https://bugs.debian.org/cgi-bin/bugrepo … bug=811671
https://github.com/audacity/audacity/commit/60f23220
Last edited by 2ManyDogs (2016-12-05 21:33:02)
Offline
Ah ok, they use nullptr. Looks like my patch... searching can save some work..
Offline
It appears that this is fixed in the git source, but not in the zip file that abs downloads. I have not tried to build the git source (don't want to install all the dependencies.)
Offline
Applying the patch to the sources of the stable version in ABS should work. Not tested yet, but should work works with this PKGBUILD ...
# $Id: PKGBUILD 266985 2016-05-05 21:59:07Z arojas $
# Maintainer: Eric Bélanger <eric@archlinux.org>
pkgname=audacity
pkgver=2.1.2
pkgrel=3
pkgdesc="A program that lets you manipulate digital audio waveforms"
arch=('i686' 'x86_64')
url="http://audacityteam.org"
license=('GPL')
depends=('libmad' 'libid3tag' 'wxgtk' 'lame' 'lilv' 'soundtouch'
'ffmpeg' 'vamp-plugin-sdk' 'sbsms' 'portsmf' 'desktop-file-utils')
makedepends=('cmake' 'python2')
options=('!makeflags')
source=(https://github.com/audacity/audacity/archive/Audacity-${pkgver}.zip
audacity-ffmpeg.patch
fix-build-errors.patch::https://github.com/audacity/audacity/commit/60f23220.patch)
sha1sums=('ced07f7401bef12d7ec0bc033409c9baa956c5c5'
'5f1733a3802bcec7d9b54cb3ec8d7d81fc38fc61'
'45992b65b3c2d5e4351991b9a2ec8c8de5ad25d4')
prepare() {
cd audacity-Audacity-${pkgver}
patch -p1 -i "${srcdir}/audacity-ffmpeg.patch"
# https://github.com/audacity/audacity/commit/60f23220
patch -p1 -i "${srcdir}/fix-build-errors.patch"
}
build() {
cd audacity-Audacity-${pkgver}
./configure --prefix=/usr --with-libsamplerate
make
}
package() {
cd audacity-Audacity-${pkgver}
make DESTDIR="${pkgdir}" install
}
Last edited by mis (2016-12-06 00:09:29)
Offline