Missing install rule and shared library


#1

Looking forward packaging juce for debian and ubuntu:
Ubuntu bug report here:
https://bugs.edge.launchpad.net/ubuntu/+bug/158605
My workspace here:
http://juce.aminche.com/

I’m missing a shared libjuce.so, and an install rule in the Makefile:
that install the library and the header in the appropriate directories.

I’ll be tying to patch the juce_premake.lua to implement this.

One alternative could be to switch to cmake.
I get my dirty hand on:
http://juce.aminche.com/juce-1.45/CMakeLists.txt
Which generate the shared library by adding:
SET(BUILD_SHARED_LIBS ON)

What do you think ?

Anyway I’ll get back to you with a patch for juce_premake.lua

Hope that helps.


#2

Cool. I’ve never done a package, so am not much help about that kind of thing, but look forward to seeing what you come up with!


#3

The following patch to juce_premake.lua:
http://hg.juce.aminche.com/rev/7ce48f47eda7

Add two new configurations:
ReleaseDll
DebugDll

When invoqued like this (on GNU/Linux):
make CONFIG=ReleaseDll
make CONFIG=DebugDll

They generate the shared libraries:
libjuce.so
libjuce_debug.so

Let me know if it works for others platforms (xcode/vs.net) ?

You may have to remove (by premake ifdef) “no-import-lib” from buildflags, on Win32.
It’s a bug of premake 3.4 (but fixed in svn trunk), that try to generate import .lib file under GNU/Linux.

And add “dylib” to buildflags on OSX if you want a dylib file instead of a Posix-style shared library

Can you consider adding this to the next release ?

I’ll now try to figure out how to add an install rule with premake.


#4

Hi jules,

Can you review my patch of juce_premake.lua ?
Do you consider it for inclusion in the next release ?

Let me know about this, because depending of if you ship or not a Makefile that generate an .so file on GNU/Linux, there is different packaging option I should consider.

Thanks in advance.


#5

If we want to package juce into debian:
Not only we need to generate a shared library (DLL).
But we also need to maintain a library version in SONAME


And bump it everytime binary compatibility is broken.
Like removing symbols or functions/methods for example.

I don’t know if premake permit to overwrite it ?

Maybe we can create a repository/branch with a GNU/Linux friendly patched version ?
And take care of merging changes from trunk here ?
What do you think ?


#6

I plan to use following cmake to build juce for the debian package I’m working on:

I hacked thomas’s (from this forum) CMakeLists.txt
to properly generate the shared library (including SONAME)
and install the headers and the lib respectivily in /usr/(local/)include/ and /usr/(local/)lib/.

Feel free to grab the file here: http://juce.aminche.com/CMakeLists.txt


#7

I noticed you distribute the following librairies along with juce sources, which are already packaged in Debian/Ubuntu:
libjpeg6b-6b
libogg-1.1.3
zlib-1.2.3.3.dfsg
flac-1.1.4
libpng-1.2.15~beta5

Looking forward inclusion of the juce in theses distributions: I will try to compile juce against already packaged libraries and add them as build and runtime dependencies.


#8

I’ve compiled juce with the packaged version of external libraries:
Here are the changes applied to juce 1.45:
http://juce.aminche.com/hg/juce_with_cmake_without_extern/


#9

Hi proppy, sorry I’ve been to busy to have a look at this and reply - I will do when I can!


#10

[quote=“proppy”]I’ve compiled juce with the packaged version of external libraries:
Here are the changes applied to juce 1.45:
http://juce.aminche.com/hg/juce_with_cmake_without_extern/[/quote]

I’m probably doing something wrong, but i can’t compile that.
I’ve downloaded your CMakeLists.txt file, copied it to the juce source directory, ran cmake . and ccmake . generated a makefile and finally ran make
And i’ve got such a compile error:

Building CXX object CMakeFiles/juce.dir/build/linux/platform_specific_code/juce_linux_Audio.o /home/ph/juce/build/linux/platform_specific_code/juce_linux_Audio.cpp: In function ‘void juce::getDeviceSampleRates(snd_pcm_t*, juce::Array<int, juce::DummyCriticalSection>&)’: /home/ph/juce/build/linux/platform_specific_code/juce_linux_Audio.cpp:74: error: ‘assert’ was not declared in this scope /home/ph/juce/build/linux/platform_specific_code/juce_linux_Audio.cpp: In function ‘void juce::getDeviceNumChannels(snd_pcm_t*, unsigned int*, unsigned int*)’: /home/ph/juce/build/linux/platform_specific_code/juce_linux_Audio.cpp:89: error: ‘assert’ was not declared in this scope /home/ph/juce/build/linux/platform_specific_code/juce_linux_Audio.cpp: In function ‘void juce::getDeviceProperties(const juce::String&, unsigned int&, unsigned int&, unsigned int&, unsigned int&, juce::Array<int, juce::DummyCriticalSection>&)’: /home/ph/juce/build/linux/platform_specific_code/juce_linux_Audio.cpp:110: error: ‘assert’ was not declared in this scope /home/ph/juce/build/linux/platform_specific_code/juce_linux_Audio.cpp: In member function ‘bool juce::ALSADevice::setParameters(unsigned int, int, int)’: /home/ph/juce/build/linux/platform_specific_code/juce_linux_Audio.cpp:177: error: ‘assert’ was not declared in this scope /home/ph/juce/build/linux/platform_specific_code/juce_linux_Audio.cpp:233: error: ‘assert’ was not declared in this scope /home/ph/juce/build/linux/platform_specific_code/juce_linux_Audio.cpp: In member function ‘virtual void juce::ALSAAudioIODeviceType::scanForDevices()’: /home/ph/juce/build/linux/platform_specific_code/juce_linux_Audio.cpp:874: error: ‘assert’ was not declared in this scope make[2]: *** [CMakeFiles/juce.dir/build/linux/platform_specific_code/juce_linux_Audio.o] Error 1 make[1]: *** [CMakeFiles/juce.dir/all] Error 2 make: *** [all] Error 2

When I disable alsa support in juce_Config.h it compiles just well – but i guess juce without sound is a kind of nonsence…


#11

I’ve submitted the current packaging to ubuntu for REVU.
http://revu.tauware.de/details.py?package=juce

This new tree should compile fine:
http://juce.aminche.com/hg/juce-debian/

With the following patches applied:
http://juce.aminche.com/hg/juce-debian/file/tip/debian/patches/

I believe this one, can fix your error:
http://juce.aminche.com/hg/juce-debian/file/tip/debian/patches/03-jassert.patch


#12

Thanks a lot!

[quote=“proppy”]I believe this one, can fix your error:
http://juce.aminche.com/hg/juce-debian/file/tip/debian/patches/03-jassert.patch[/quote]

Well, i’ve got no idea how to use that hg, so i just figured out that I should prepend the line

in the file juce_linux_Audio.cpp with

When I did that manually, everything compiled just fine (hm, with some warnings).

Now trying to compile at least jucedemo against that .so


#13

Hi,
be sure to apply the following patches too:
http://juce.aminche.com/hg/juce-debian/raw-file/tip/debian/patches/01-cmake-build-system.patch
to get the lastest version of CMakeLists.txt
http://juce.aminche.com/hg/juce-debian/raw-file/tip/debian/patches/02-fix-external-includes.patch
for source to use installed header for 3rd party libraries instead of those supplied with juce sources.

Hope that helps.


#14