nightingale-media-player / nightingale-hacking

Working tree for the community fork of Songbird, Nightingale. If building, use the sb-trunk-oldxul (development) branch, with the tag 1.12.1 tag for stable, for now. The master-xul-9.0.1 branch is the current progress in building Nightingale with XULRunner 9 and builds, but is broken. All help in terms of patches and pull requests is welcome.
https://getnightingale.com
GNU General Public License v2.0
185 stars 41 forks source link

Debian Package issues #330

Open freaktechnik opened 9 years ago

freaktechnik commented 9 years ago

This is kind of a metabug/milestone for all the issues we need to resolve with the current debian package.

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/6658141-debian-package-issues?utm_campaign=plugin&utm_content=tracker%2F230233&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F230233&utm_medium=issues&utm_source=github).
freaktechnik commented 9 years ago

We need to resolve #210. Also see #315 for other issues related to libraries.

darealshinji commented 9 years ago

libxul.so: libtheora can be solved by building xulrunner with --disable-ogg.

Warnings about images and jars in /usr/lib could be solved by adding this code to override_dh_install:

    cp -f debian/nightingale.links.in debian/nightingale.links
    prefix=debian/tmp/usr ;\
DIR=$$prefix/lib/nightingale/ ;\
\
files=$$(\
find $$DIR -name \*.png -printf '%p '; \
find $$DIR -name \*.gif -printf '%p '; \
find $$DIR -name \*.jpg -printf '%p '; \
find $$DIR -name \*.xpm -printf '%p '; \
find $$DIR -name \*.jar -printf '%p ';) ;\
\
for f in $$files; do \
in=$$(echo $$f | sed -e "s:$$prefix:/usr:") ;\
out=$$(echo $$f | sed -e "s:$$prefix/lib:$$prefix/share:") ;\
target=$$(echo $$out | sed -e "s:$$prefix:/usr:") ;\
mkdir -v -p $$(dirname $$out) ;\
mv -v $$f $$(dirname $$out) ;\
echo $$target'      '$$in | tee -a debian/nightingale.links ;\
done

It moves the files into /usr/share and creates symbolic links. You could also create a binary-independend nightingale-common package, which I did for my own PPA: https://launchpad.net/~djcj/+archive/ubuntu/nightingale/+packages

freaktechnik commented 9 years ago

Not to self: give @darealshinji a test case to test if the disabling of ogg potentially breaks things.

darealshinji commented 9 years ago

I've created a fork of nightingale-deps and removed everything that's not needed for package building on Debian systems or might not be conform with Debian guidelines: https://github.com/darealshinji/nightingale-deps/

Packaging files for the deps are here: https://github.com/darealshinji/nightingale-deps/tree/debian-packaging This package will then contain the .tar.lzma files in /usr/lib/nightingale-deps.

This package can then be used as a build dependency for the actual Nightingale package. Instead of running the build script, the tarball is instead extracted into the dependencies directory and the Makefile is used directly.

freaktechnik commented 9 years ago

I'd assume that's without ogg support for xulr? If yes, does https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XPCOM/Reference/Interface/nsISound#play%28%29 sill work? To test it run code similar to Components.classes["@mozilla.org/sound;1"].createInstance(Components.interfaces.nsISound).play("fille:///home/djcj/test.ogg") work and play the specified file?

darealshinji commented 9 years ago

Sorry for the question, but how do I test that code?

freaktechnik commented 9 years ago

Oh, I forgot the end of the sentence: run the code in the text field at the top of the error console (by pressing enter or the evaluate button).

darealshinji commented 9 years ago

I get this error:

Error: uncaught exception: [Exception... "Could not convert JavaScript argument arg 0 [nsISound.play]"  nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS frame :: javascript:%20Components.classes["@mozilla.org/sound;1"].createInstance(Components.interfaces.nsISound).play("file:///home/djcj/test.ogg") :: <TOP_LEVEL> :: line 1"  data: no]

The same happens with the 1.12.1 release.

But I don't see any problems with ogg support missing since it doesn't affect ogg vorbis playback for me.

freaktechnik commented 9 years ago

There is a difference between ogg playback in our mediacore and playback through gecko. Since some extensions use it, I want to make sure it's not broken. And I just realized that nsISound takes an nsIURL, so this'd look like Components.classes["@mozilla.org/sound;1"].createInstance(Components.interfaces.nsISound).play(Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI("file:///home/djcj/test.ogg", null, null))

Also, adjust the file path to actually lead to a valid ogg file.

darealshinji commented 9 years ago
Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISound.play]"  nsresult: "0x80004005 (NS_ERROR_FAILURE)"  location: "JS frame :: javascript:%20Components.classes["@mozilla.org/sound;1"].createInstance(Components.interfaces.nsISound).play(Components.classes["@mozilla.org/network/io-service;1"].getService(Components.interfaces.nsIIOService).newURI("file:///home/djcj/test.ogg",%20null,%20null)) :: <TOP_LEVEL> :: line 1"  data: no]
freaktechnik commented 9 years ago

Oh, one of the most descriptive errors, indicating that there was an error inside a wrapped object. So anywhere and anything.

darealshinji commented 9 years ago

I was working on building packages which are more Debian guidelines-friendly and use more system libraries. Most changes must be applied to the nightingale-deps stuff. I've created a fork and made quite some changes: https://github.com/darealshinji/nightingale-deps

A summary:

The dependencies are created as a separate Debian package, providing the tarball with sqlite, taglib and xulrunner. The NG package will use that package as a build-dependency. To prevent warnings about jars and images being stored in /usr/lib I'm moving some stuff to /usr/share and replace it with symbolic links. The only remaining Lintian tag is an error about the embedded sqlite library in sbDBEngine.so. I've tried linking it against the system's shared library which didn't really work. NG didn't even really start up, it just showed an error message about the database being currupted. With the embedded sqlite 3.8.8.2 it worked fine.

Here are the packaging files: https://github.com/darealshinji/nightingale-deps/tree/debian-packaging

freaktechnik commented 9 years ago

With Xulr8 there will be --with-system-ffi. From my research XULR doesn't actualy link against libogg until xulr2, which is weird, but there's very little information out there.