GNOME Bugzilla – Bug 352750
GStreamer: alsa-plugin test is 32-bit specific
Last modified: 2006-08-27 11:42:47 UTC
On my x86_64 system, the alsa plugin tests in t/GstPlugin.t are skipped: SKIP: { my $so = "/usr/lib/gstreamer-0.10/libgstalsa.so"; skip "alsa plugin tests", 1 unless -r $so; $plugin = GStreamer::Plugin::load_file($so); isa_ok($plugin, "GStreamer::Plugin"); } Note the value of $so; but on 64-bit systems this library is typically at /usr/lib64/gstreamer-0.10/libgstalsa.so. Changing $so to "/usr/lib64..." allows the test to execute (and pass) but is clearly a non-optimal solution :)
Perhaps the test could use `pkg-config --variable=libdir correct-pc-name-for-the-alsa-plugin` to look for the .so? I have neither gstreamer-0.10 or the gstalsa plugin on my system, but: homie:~/cvs$ pkg-config --variable=libdir gstreamer-plugins-0.8 /home/muppet/sandboxes/gnome2/lib Does that style command return some value containing lib64 for you? If so, we should be able to concatenate the filename to the path and do a -f test... We should be reasonably well guaranteed that pkg-config is available since we're running as part of the build system. It looks like we could also use the ExtUtils::PkgConfig module instead of calling the command directly: # warning, totally untested code $pkg = ExtUtils::PkgConfig->find ($correct_package_name); if (-f File::Spec->catfile ($pkg->libdir, 'libgstalsa.so')) { ... }
That sounds like a good solution; it should handle both arch-specific issues and the cases where people decided to install gstreamer in funky locations.
Good idea indeed. The gstreamer-0.10 pkg-config contains a variable pluginsdir which is perfect. Patch attached.
Created attachment 71670 [details] [review] Try harder to find the alsa plugin file
Not sure how much you want to be concerned with the possibility that EU::PkgConfig->variable() could return undef if the variable isn't there, which would indicate a broken or missing .pc file. Otherwise, it looks fine.
File::Spec::catfile seems to handle undef gracefully. Patch committed.