Opened 15 years ago

Closed 15 years ago

#24340 closed defect (fixed)

libao: patch phase fails on 10.5 and earlier

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.8.2
Keywords: Cc: rmsfisher@…, lang@…, sinuhet.merlin@…, trek1s@…, yaseppochi (Stephen J. Turnbull), antra@…, dershow, markus.falb@…
Port: libao

Description

--->  Computing dependencies for libao
--->  Fetching libao
--->  Verifying checksum(s) for libao
--->  Extracting libao
--->  Applying patches to libao
Error: Target org.macports.patch returned: shell command " cd "/opt/local/var/macports/build/_Users_rschmidt_macports_dports_audio_libao/work/libao-1.0.0" && /usr/bin/patch -p0 < '/Users/rschmidt/macports/dports/audio/libao/files/patch-AU-src__plugins__macosx__ao_macosx.c'" returned error 1
Command output: patching file src/plugins/macosx/ao_macosx.c
Hunk #1 FAILED at 29.
Hunk #2 FAILED at 39.
Hunk #3 FAILED at 51.
Hunk #4 FAILED at 64.
4 out of 4 hunks FAILED -- saving rejects to file src/plugins/macosx/ao_macosx.c.rej

Error: Unable to upgrade port: 1

Change History (15)

comment:1 Changed 15 years ago by lang@…

Cc: lang@… added

Cc Me!

comment:2 Changed 15 years ago by sinuhet.merlin@…

the same here :-/

comment:3 Changed 15 years ago by sinuhet.merlin@…

Cc: sinuhet.merlin@… added

Cc Me!

comment:4 Changed 15 years ago by trek1s@…

Cc: trek1s@… added

Cc Me!

comment:5 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

It looks like ao_macosx.c used to use the deprecated version 1 Audio Unit interface (which was removed in 10.6), and our patchfile upgraded it to use the new version 2 interface. It looks like this patch has more or less been incorporated upstream. Or maybe we originally took it from upstream and then they changed the source further. It's difficult to evaluate the patch because in addition to tons of functional changes, it contains an infuriating amount of whitespace-only changes.

My first instinct is to simply remove the patchfile, but the build then fails on Tiger with:

ao_macosx.c:74: error: parse error before 'AudioComponentInstance'

I haven't tested Leopard yet.

The 1.0.0 source says "AudioComponentInstance outputAudioUnit;" whereas our patch used "AudioUnit outputAudioUnit;"

The 1.0.0 source does contain the comment "This plugin will only build on a 10.6 or later Mac (Darwin 9+)"; confused though this may be about Leopard vs. Snow Leopard, it suggests their version doesn't work on Tiger.

comment:6 in reply to:  5 Changed 15 years ago by yaseppochi (Stephen J. Turnbull)

Replying to ryandesign@…:

My first instinct is to simply remove the patchfile, but the build then fails on Tiger with:

ao_macosx.c:74: error: parse error before 'AudioComponentInstance'

I haven't tested Leopard yet.

Same thing happens on Leopard (10.5.8).

comment:7 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

comment:8 Changed 15 years ago by antra@…

Same error here.

comment:9 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: stephen@… antra@… added

We don't need any more "me too"s; we already know all users running 10.5 and earlier will be unable to install libao at this time. If nobody beats me to it, I can look into this in a few days when I have access to my pre-Snow Leopard machines again.

comment:10 Changed 15 years ago by yaseppochi (Stephen J. Turnbull)

For those who, like me, are in a big hurry, I downloaded the patch from the link "https://trac.xiph.org/attachment/ticket/1667/libao.patch" (same as above) to dports/audio/libao/files/libao.patch, and made the following change to dports/audio/libao/Portfile:

Index: Portfile
===================================================================
--- Portfile	(revision 66043)
+++ Portfile	(working copy)
@@ -32,7 +32,7 @@
 
 platform darwin {
     if {${os.major} < 10} {
-        patchfiles patch-AU-src__plugins__macosx__ao_macosx.c
+        patchfiles libao.patch
     }
     post-destroot {
         system "echo default_driver=macosx >> ${destroot}${prefix}/etc/libao.conf"

and was able to successfully upgrade using "sudo port -u upgrade libao" on 10.5.8. The Xiph bugreport cited above says that libao.patch worked on Mac OS X 10.4.11, so this should work for MacPorts on Tiger, too.

Thanks to ryandesign for the clue!

comment:11 in reply to:  10 ; Changed 15 years ago by sinuhet.merlin@…

Maybe I am an idiot, but I've made the exact modifications you sent here, and got another error:

--->  Computing dependencies for libao
--->  Applying patches to libao
Error: Target org.macports.patch returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_audio_libao/work/libao-1.0.0" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/release/ports/audio/libao/files/libao.patch'" returned error 1
Command output: can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -ru libao-1.0.0/src/plugins/macosx/ao_macosx.c libao-1.0.0-patched/src/plugins/macosx/ao_macosx.c
|--- libao-1.0.0/src/plugins/macosx/ao_macosx.c	2010-03-24 07:48:38.000000000 +0100
|+++ libao-1.0.0-patched/src/plugins/macosx/ao_macosx.c	2010-03-27 09:30:34.000000000 +0100
--------------------------
File to patch: 
Skip this patch? [y] 
Skipping patch.
5 out of 5 hunks ignored

Error: Unable to upgrade port: 1
Before reporting a bug, first run the command again with the -d flag to get complete output.

comment:12 Changed 15 years ago by dershow

Cc: dersh@… added

Cc Me!

comment:13 Changed 15 years ago by markus.falb@…

Cc: markus.falb@… added

Cc Me!

comment:14 in reply to:  11 Changed 15 years ago by macports-trac@…

I was able to get libao to configure and build by replacing the first three lines of libao.patch with the first two lines of the distribution's patch file. The file libao.patch encapsulates a diff from a directory layout that isn't the standard one in which macports applies patches.

comment:15 Changed 15 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: newclosed

The patch worked for me on Tiger Intel and Leopard PPC so I committed it in r66201. The upstream bug report also says they've committed the fix to their repository and will release version 1.0.1 incorporating this fix soon.

Note: See TracTickets for help on using tickets.