Bug 194779 - audio/audacity build fails with SAMPLERATE=off and SOXR=off
Summary: audio/audacity build fails with SAMPLERATE=off and SOXR=off
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Thomas Zander
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-03 08:59 UTC by Thomas Zander
Modified: 2014-11-09 07:49 UTC (History)
1 user (show)

See Also:
riggs: maintainer-feedback? (xxjack12xx)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Zander freebsd_committer freebsd_triage 2014-11-03 08:59:42 UTC
There is a link error when no samplerate lib is selected:

[...]
audacity-AudioIO.o: In function `AudioIO::StartStream(WaveTrackArray, WaveTrackArray, TimeTrack*, double, double, double, AudioIOListener*, bool, double, double)':
AudioIO.cpp:(.text+0x3f7d): undefined reference to `Resample::Resample(bool, double, double)'
audacity-Mix.o: In function `Mixer::Mixer(int, WaveTrack**, TimeTrack*, double, double, int, int, bool, double, sampleFormat, bool, MixerSpec*)':
Mix.cpp:(.text+0x1191): undefined reference to `Resample::Resample(bool, double, double)'
Mix.cpp:(.text+0x11b4): undefined reference to `Resample::Resample(bool, double, double)'
audacity-WaveClip.o: In function `WaveClip::Resample(int, ProgressDialog*)':
WaveClip.cpp:(.text+0x3458): undefined reference to `Resample::Resample(bool, double, double)'
effects/audacity-ChangeSpeed.o: In function `EffectChangeSpeed::ProcessOne(WaveTrack*, long long, long long)':
effects/ChangeSpeed.cpp:(.text+0x6c8): undefined reference to `Resample::Resample(bool, double, double)'
effects/ChangeSpeed.cpp:(.text+0x74a): undefined reference to `Resample::Process(double, float*, int, bool, int*, float*, int)'
effects/ChangeSpeed.cpp:(.text+0x910): undefined reference to `Resample::~Resample()'
effects/ChangeSpeed.cpp:(.text+0x958): undefined reference to `Resample::~Resample()'
prefs/audacity-QualityPrefs.o: In function `QualityPrefs::GetNamesAndLabels()':
prefs/QualityPrefs.cpp:(.text+0xa1c): undefined reference to `Resample::GetNumMethods()'
prefs/QualityPrefs.cpp:(.text+0xa46): undefined reference to `Resample::GetMethodName(int)'
prefs/audacity-QualityPrefs.o: In function `QualityPrefs::PopulateOrExchange(ShuttleGui&)':
prefs/QualityPrefs.cpp:(.text+0xecd): undefined reference to `Resample::GetFastMethodKey()'
prefs/QualityPrefs.cpp:(.text+0xed2): undefined reference to `Resample::GetFastMethodDefault()'
prefs/QualityPrefs.cpp:(.text+0x10e0): undefined reference to `Resample::GetBestMethodKey()'
prefs/QualityPrefs.cpp:(.text+0x10e5): undefined reference to `Resample::GetBestMethodDefault()'
c++: error: linker command failed with exit code 1 (use -v to see invocation)
Makefile:1938: recipe for target 'audacity' failed
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2014-11-03 08:59:42 UTC
Maintainer CC'd
Comment 2 Jack 2014-11-03 09:11:46 UTC
The radio button is supposed to allow one and only 1 option to be selected, it shouldn't allow you to unselect. The default is soxr. Is there a way to force one option to be set before allowing to continue?
Comment 3 Thomas Zander freebsd_committer freebsd_triage 2014-11-03 12:03:47 UTC
(In reply to xxjack12xx from comment #2)
> The radio button is supposed to allow one and only 1 option to be selected,
> it shouldn't allow you to unselect. The default is soxr. Is there a way to
> force one option to be set before allowing to continue?

You are probably looking for OPTIONS_SINGLE + OPTIONS_DEFAULT.
Radio button also allows none to be selected:
See https://www.freebsd.org/doc/en/books/porters-handbook/makefile-options.html

Why did this become mandatory by the way? Previous versions were happy with a built-in resampler.
Comment 4 Jack 2014-11-04 10:09:43 UTC
Looking through the source code, it states:

// Resamplers:
// Exactly one resampler should be defined.
// Should build only one of libsoxr, libresample, or libsamplerate for resampling, 
// but if more than one are defined, priority is libresample over libsamplerate over libsoxr.
// We cannot release builds with libsamplerate, due to licensing.
// Standard configuration is to have only USE_LIBSOXR #defined.
Comment 5 Jack 2014-11-04 10:28:27 UTC
I used OPTIONS_RADIO and I'm not seeing a way to enforce 1 and only 1 option to be selected. Should something like that be added in the ports options?
Comment 6 Thomas Zander freebsd_committer freebsd_triage 2014-11-06 20:00:19 UTC
(In reply to xxjack12xx from comment #5)
> I used OPTIONS_RADIO and I'm not seeing a way to enforce 1 and only 1 option
> to be selected. Should something like that be added in the ports options?

Again:
You are probably looking for OPTIONS_SINGLE + OPTIONS_DEFAULT.
See https://www.freebsd.org/doc/en/books/porters-handbook/makefile-options.html
Comment 7 Jack 2014-11-07 19:35:33 UTC
I tried with the OPTIONS_SINGLE + OPTIONS_DEFAULT but that still allows you to unselect everything instead of enforce 1 and only 1 option to be selected.
Comment 8 Thomas Zander freebsd_committer freebsd_triage 2014-11-07 19:48:13 UTC
(In reply to xxjack12xx from comment #7)
> I tried with the OPTIONS_SINGLE + OPTIONS_DEFAULT but that still allows you
> to unselect everything instead of enforce 1 and only 1 option to be selected.

Yes, but after unselecting both it tells you that this is an invalid configuration and asks to do the configuration again.
Comment 9 Jack 2014-11-07 20:25:38 UTC
Ah, ok, I'll submit a new patch with that. Thanks.
Comment 10 Jack 2014-11-09 05:29:48 UTC
Here's a patch to enforce only 1 option to be selected.

Index: Makefile
===================================================================
--- Makefile    (revision 372338)
+++ Makefile    (working copy)
@@ -28,8 +28,8 @@
 
 OPTIONS_DEFINE=        DEBUG DOCS FFMPEG FLAC ID3TAG LADSPA LAME MAD MIDI NYQUIST \
                PORTMIXER SBSMS SOUNDTOUCH TWOLAME VAMP VORBIS
-OPTIONS_RADIO= SAMPLERATED
-OPTIONS_RADIO_SAMPLERATED=     SAMPLERATE SOXR
+OPTIONS_SINGLE=        SAMPLERATED
+OPTIONS_SINGLE_SAMPLERATED=    SAMPLERATE SOXR
 OPTIONS_DEFAULT=       FFMPEG FLAC ID3TAG LADSPA MAD MIDI NYQUIST \
                        PORTMIXER SBSMS SOUNDTOUCH SOXR TWOLAME VAMP VORBIS
Comment 11 commit-hook freebsd_committer freebsd_triage 2014-11-09 07:49:18 UTC
A commit references this bug:

Author: riggs
Date: Sun Nov  9 07:48:15 UTC 2014
New revision: 372340
URL: https://svnweb.freebsd.org/changeset/ports/372340

Log:
  Change OPTIONS to have exactly one out of SAMPLERATE, SOXR selected
  Bump PORTREVISION

  PR:		194779
  Submitted by:	riggs(report), maintainer(patch)

Changes:
  head/audio/audacity/Makefile
Comment 12 Thomas Zander freebsd_committer freebsd_triage 2014-11-09 07:49:59 UTC
Committed, thanks!