Bug 196427

Summary: [PATCH] fix audio/portaudio, audio/portaudio2 libraries detection
Product: Ports & Packages Reporter: Pawel Pekala <pawel>
Component: Individual Port(s)Assignee: Pawel Pekala <pawel>
Status: Closed FIXED    
Severity: Affects Only Me CC: danfe, db, hamradio, hselasky, koalative, marcus, multimedia, ninjin, nivit, stephen
Priority: --- Flags: bugzilla: maintainer-feedback? (koalative)
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
liportaudio-cleanup none

Description Pawel Pekala freebsd_committer freebsd_triage 2015-01-01 22:06:18 UTC
Created attachment 151198 [details]
liportaudio-cleanup

Hello maintainers of ports depending on portaudio libs.

Right now we have 2 portaudio ports, this patch fixes detection of
installed portaudio libraries before building. audio/portaudio and
audio/portaudio2 provide library with the same name: libportaudio.so
The only difference is in ABI version:

audio/portaudio => libportaudio.so.0
audio/portaudio2 => libportaudio.so.2

In your ports detection looks something like this:
libportaudio:${PORTVERSION}/audio/portaudio[2] which means that both
ports pass this test. When building from ports this can lead to
false library detection and build failures or wrong linking depending on
which library is already installed on user system.

Please review changes to your ports. If there no objections I plan to
commit this in standard two weeks.

Thanks
Comment 1 Bugzilla Automation freebsd_committer freebsd_triage 2015-01-01 22:06:18 UTC
Maintainer CC'd
Comment 2 Hans Petter Selasky freebsd_committer freebsd_triage 2015-01-02 08:26:42 UTC
How do the packages know which library to use if both are installed? Do you need to update some .pc files aswell?

--HPS
Comment 3 Hans Petter Selasky freebsd_committer freebsd_triage 2015-01-02 08:30:40 UTC
Else patch looks good.

--HPS
Comment 4 Dave Shar 2015-01-02 10:11:08 UTC
(In reply to Hans Petter Selasky from comment #3)
> Else patch looks good.
> 
> --HPS

The other ports that need portaudio should explicitly specify a version. 

Thanks,

David
Comment 5 Dave Shar 2015-01-02 10:11:56 UTC
(In reply to Pawel Pekala from comment #0)
.
.
.
> 
> Please review changes to your ports. If there no objections I plan to
> commit this in standard two weeks.
> 
> Thanks

Patch is good, please commit.

Thanks,

David
Comment 6 Pawel Pekala freebsd_committer freebsd_triage 2015-01-02 10:21:22 UTC
> How do the packages know which library to use if both are installed? Do you
> need to update some .pc files aswell?

With audio/portaudio2 this should be easy as long you follow what
pkgconfig gives you, there are separate directories for includes and 
library: /usr/local/include/portaudio2 /usr/local/lib/portaudio2.
audio/portaudio is a mixed bag depending on upstream configure scripts as
there is no pkgconfig pc file for this port.
Comment 7 Stephen Montgomery-Smith freebsd_committer freebsd_triage 2015-01-04 00:34:16 UTC
I'm good with this patch.  Thanks.
Comment 8 Joe Marcus Clarke freebsd_committer freebsd_triage 2015-01-04 14:35:26 UTC
Looks okay from my standpoint.
Comment 9 Diane Bruce freebsd_committer freebsd_triage 2015-01-04 15:12:30 UTC
(In reply to Pawel Pekala from comment #6)
The problem has always been portaudio 1 sits in /usr/local where all the other ports needed for a build live, upstream ports blithely insert /usr/local/lib into their Makefiles without ensuring /usr/local/portaudio2/lib is inserted first. If I make a suggestion, move portaudio1 to under /usr/local/portaudio1 or some such. This would mean rebuilding all ports depending on portaudio1 as well as portaudio2 but would help in making less work for porters in the future.
Comment 10 Pawel Pekala freebsd_committer freebsd_triage 2015-01-04 18:25:23 UTC
> The problem has always been portaudio 1 sits in /usr/local where all the other > ports needed for a build live, upstream ports blithely insert /usr/local/lib
> into their Makefiles without ensuring /usr/local/portaudio2/lib is inserted
> first. If I make a suggestion, move portaudio1 to under /usr/local/portaudio1
> or some such. This would mean rebuilding all ports depending on portaudio1 as
> well as portaudio2 but would help in making less work for porters in the
> future.

Yes this could be done as suggested after this PR is committed. I didn't looked
at it but I suspect that moving files in audio/portaudio would require to
modify all consumers to take notice otherwise there will be a lot of
failed builds. Big task IMHO.
Comment 11 Diane Bruce freebsd_committer freebsd_triage 2015-01-04 23:53:08 UTC
(In reply to Pawel Pekala from comment #10)

grep portaudio-18 INDEX-*|wc -l 
     554
grep portaudio2-19 INDEX-*|wc -l
      53

*sigh* yes it would be.
Comment 12 commit-hook freebsd_committer freebsd_triage 2015-01-25 00:46:26 UTC
A commit references this bug:

Author: pawel
Date: Sun Jan 25 00:46:16 UTC 2015
New revision: 377845
URL: https://svnweb.freebsd.org/changeset/ports/377845

Log:
  Fix detection of libportaudio libraries

  PR:		196427
  Submitted by:	myself
  Approved by:	hselasky, stephen, marcus, maintainer timeout from others

Changes:
  head/audio/denemo/Makefile
  head/audio/jack/Makefile
  head/audio/listener/Makefile
  head/audio/mhwaveedit/Makefile
  head/audio/mixxx/Makefile
  head/audio/musescore/Makefile
  head/audio/py-fastaudio/Makefile
  head/audio/rezound/Makefile
  head/audio/zynaddsubfx/Makefile
  head/comms/linrad/Makefile
  head/comms/quisk/Makefile
  head/emulators/hatari/Makefile
  head/math/freemat/Makefile
  head/math/octave-forge-ltfat/Makefile
  head/net/wireshark/Makefile
Comment 13 Pawel Pekala freebsd_committer freebsd_triage 2015-01-25 00:47:51 UTC
Committed, thanks for reviews!