make mp3 support optional

• Apr 25, 2015 - 15:31
Type
Functional
Severity
S5 - Suggestion
Status
closed
Project

In Fedora we don't have lame in official repos, only 3rd party (rpmfusion), so we want to have something like if lame not found - just disable mp3 support.


Comments

What do you meant make it optipnal? It *is* optional - no one forces you to use it. Unless I am misunderstanding something, Fedora is not special here - LAME isn't provided with Windows, MacOS, or other Linux distros either.

Status (old) needs info active

I mean that it requires headers from lame, otherwise it's failing to build. Making optional == allow building if no LAME headers found.

OK, but this also is no different than Windows (and presumably MacOS), where you need to install those headers - and potentially quite a few others - manually. I'm not sure we really need to support building of MuseScore in cases where there is no lame, portaudio, libsndfile, libvorbis, jack, or heck, even Qt. On the other hand, if it's easy to do this for LAME specifically, I guess there is no harm in it...

mp3 is optional but the build still fails in the cmake section if lame isn't installed.
Can this be taken care of with a cmake option w/o needing the patch?

If we were to upstream this and make mp3 optional via a new Makefile target, would that be acceptable?

E.g. `make --disable_non-free` or `make --no-mp3`

Would that be good enough for packaging with Fedora?

Edit: I see, it's a tiny change and is essentially already upstream.

Status (old) active patch (code needs review)

There is an implementation in PR 2153.

MP3 support is enabled by default but can be disabled by calling cmake with the option -DCMAKE_NON_FREE_LIBS="DISABLED". This can also be done from the top-level Makefile by overriding the Makefile variable NON_FREE with "DISABLED". (i.e. make NON_FREE="DISABLED" && make NON_FREE="DISABLED" install)

Status (old) patch (code needs review) fixed

Fixed in branch master, commit 198319231f

fix #57736 and improve Debian packaging to enable Ubuntu nightlies
- Flag unstable builds more obviously
- Add SUFFIX to filenames to prevent conflicts when installing multiple mscore versions in PATH.
- Update references to files with SUFFIX.
- Compress man page with highest gzip compression (Debian requirement)
- Display version in title bar of main window.
- fix #57736: enable/disable LAME mp3 support via Makefile option.
- Makefile option to not update MIME and icon cache on Linux.
- rename linux files for consistency with other CMake config files
- Label special builds in title bar (e.g. nightly builds).
- Create symlink aliases for mscore and man pages.
- Correct MimeType associations for nightlies in desktop file.
- Don't manually set RPATH, let CMake handle it automatically.
- Makefile option to not set RPATH at all (Debian requirement).

Fixed in branch master, commit 198319231f

fix #57736 and improve Debian packaging to enable Ubuntu nightlies
- Flag unstable builds more obviously
- Add SUFFIX to filenames to prevent conflicts when installing multiple mscore versions in PATH.
- Update references to files with SUFFIX.
- Compress man page with highest gzip compression (Debian requirement)
- Display version in title bar of main window.
- fix #57736: enable/disable LAME mp3 support via Makefile option.
- Makefile option to not update MIME and icon cache on Linux.
- rename linux files for consistency with other CMake config files
- Label special builds in title bar (e.g. nightly builds).
- Create symlink aliases for mscore and man pages.
- Correct MimeType associations for nightlies in desktop file.
- Don't manually set RPATH, let CMake handle it automatically.
- Makefile option to not set RPATH at all (Debian requirement).

The solution that has just been merged works slightly differently to the one proposed. lasconic requested I name the option "disable mp3 support" instead of "disable non-free" because mp3 is currently the only non-free component. Here is how you can use it.

By default LAME (i.e. mp3 support) is enabled. To disable mp3 support use:

make BUILD_LAME="OFF"
make BUILD_LAME="OFF" install

or call CMake like this:

cmake -DBUILD_LAME="OFF"

If other non-free components are added in the future then they will receive their own CMake options and a wider "disable non-free" option might then be justifiable.

Sorry for commenting again, but I thought most of you would find this useful. Since there are a few package maintainers in this thread I thought I'd point out this Package Maintainers' Wishlist I've made specifically for packaging-related feature requests. Ideally you should be able to package MuseScore without needing any patches. If you still have any patches please add them to the list for merging upstream, possibly with a link to more information that could be in the form of a bug report in the issue tracker (like this one). Thanks.

Package Maintainers' Wishlist: https://musescore.org/en/node/60131/

Fixed in branch 2.0.3, commit e063474317

fix #57736 and improve Debian packaging to enable Ubuntu nightlies
- Flag unstable builds more obviously
- Add SUFFIX to filenames to prevent conflicts when installing multiple mscore versions in PATH.
- Update references to files with SUFFIX.
- Compress man page with highest gzip compression (Debian requirement)
- Display version in title bar of main window.
- fix #57736: enable/disable LAME mp3 support via Makefile option.
- Makefile option to not update MIME and icon cache on Linux.
- rename linux files for consistency with other CMake config files
- Label special builds in title bar (e.g. nightly builds).
- Create symlink aliases for mscore and man pages.
- Correct MimeType associations for nightlies in desktop file.
- Don't manually set RPATH, let CMake handle it automatically.
- Makefile option to not set RPATH at all (Debian requirement).

Fixed in branch 2.0.3, commit e063474317

fix #57736 and improve Debian packaging to enable Ubuntu nightlies
- Flag unstable builds more obviously
- Add SUFFIX to filenames to prevent conflicts when installing multiple mscore versions in PATH.
- Update references to files with SUFFIX.
- Compress man page with highest gzip compression (Debian requirement)
- Display version in title bar of main window.
- fix #57736: enable/disable LAME mp3 support via Makefile option.
- Makefile option to not update MIME and icon cache on Linux.
- rename linux files for consistency with other CMake config files
- Label special builds in title bar (e.g. nightly builds).
- Create symlink aliases for mscore and man pages.
- Correct MimeType associations for nightlies in desktop file.
- Don't manually set RPATH, let CMake handle it automatically.
- Makefile option to not set RPATH at all (Debian requirement).