Missing install rule and shared library


Looking forward packaging juce for debian and ubuntu:
Ubuntu bug report here:
My workspace here:

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:
Which generate the shared library by adding:

What do you think ?

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

Hope that helps.


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!


The following patch to juce_premake.lua:

Add two new configurations:

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

They generate the shared libraries:

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.


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.


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 ?


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


I noticed you distribute the following librairies along with juce sources, which are already packaged in Debian/Ubuntu:

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.


I’ve compiled juce with the packaged version of external libraries:
Here are the changes applied to juce 1.45:


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


[quote=“proppy”]I’ve compiled juce with the packaged version of external libraries:
Here are the changes applied to juce 1.45:

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…


I’ve submitted the current packaging to ubuntu for REVU.

This new tree should compile fine:

With the following patches applied:

I believe this one, can fix your error:


Thanks a lot!

[quote=“proppy”]I believe this one, can fix your error:

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


be sure to apply the following patches too:
to get the lastest version of CMakeLists.txt
for source to use installed header for 3rd party libraries instead of those supplied with juce sources.

Hope that helps.