File lmms.spec of Package lmms
#
# spec file for package lmms
#
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# Since 42.2 RPM creates a hard requirement on a build time library (libvstbase), the requirement is unnecessary and bad
%global __requires_exclude_from ^%{_libdir}/lmms/.*\\.so$
%bcond_without carla
%bcond_without crippled_stk
Name: lmms
Version: 1.1.3
Release: 0
Summary: Linux MultiMedia Studio
License: GPL-2.0+
Group: Productivity/Multimedia/Sound/Midi
ExclusiveArch: x86_64
Url: https://lmms.io/
Source0: https://github.com/LMMS/lmms/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM Fix wrong comparison logic (from upstream)
Patch1: lmms-1.1.3-fix-wrong-comparison-logic.patch
# PATCH-FIX-OPENSUSE Patch for providing proper return code in a function
Patch2: lmms-1.1.0-return.patch
# PATCH-FIX-OPENSUSE Some parts cannot be build because stk misses some files due to legal issues (bnc#761147)
Patch4: lmms-1.0.0-crippled_stk.patch
Patch5: lmms-carla.patch
Patch6: lmms-code-indent.patch
Patch7: lmms-code-min.patch
Patch8: lmms-code-macro.patch
Patch9: lmms-fix.patch
BuildRequires: cmake
BuildRequires: desktop-file-utils
BuildRequires: fdupes
BuildRequires: fltk-devel
BuildRequires: gcc-c++
BuildRequires: hicolor-icon-theme
BuildRequires: libstk-devel
BuildRequires: pkgconfig(QtCore) >= 4.3.0
BuildRequires: pkgconfig(QtGui)
BuildRequires: pkgconfig(QtXml)
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(fftw3f) >= 3.0.0
BuildRequires: pkgconfig(fluidsynth) >= 1.0.7
BuildRequires: pkgconfig(jack) >= 0.77
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(ogg)
BuildRequires: pkgconfig(samplerate) >= 0.1.8
BuildRequires: pkgconfig(shared-mime-info)
BuildRequires: pkgconfig(sndfile) >= 1.0.11
BuildRequires: pkgconfig(vorbis)
BuildRequires: pkgconfig(vorbisenc)
BuildRequires: pkgconfig(vorbisfile)
BuildRequires: pkgconfig(zlib)
%if %{with carla}
# to enable internal Carla plugin host
BuildRequires: pkgconfig(carla-standalone)
# also needed (contains libcarla_standalone2 library)
BuildRequires: carla
%endif
# VeSTige needs wineserver for using VST plugins
%ifarch %ix86
Requires: %{_bindir}/wineserver
Recommends: %{_bindir}/wine
BuildRequires: wine
BuildRequires: wine-devel
%endif
%ifarch x86_64
Requires: %{_bindir}/wineserver
Recommends: %{_bindir}/wine
BuildRequires: wine
%if 0%{?suse_version} == 1230
# Workaround for missing dependency in wine-devel-32bit
BuildRequires: wine-devel
%endif
BuildRequires: gcc-c++-32bit
BuildRequires: wine-devel-32bit
%endif
%description
LMMS is a free cross-platform music studio which allows you to produce music
with your computer. This includes the creation of melodies and beats, the
synthesis and mixing of sounds, and arranging of samples.
%package devel
Summary: Headers to create LMMS plugins
Group: Development/Libraries/C and C++
%description devel
Headers that provide access to the LMMS features. Install it if you plan to
create a LMMS plugin.
%prep
%setup -q
%patch1 -p1
%patch2 -p1
%if %{with crippled_stk}
%patch4 -p1
%endif
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%build
mkdir build
cd build
export CFLAGS="%{optflags} -fgnu89-inline -fPIC -fPIE"
export CXXFLAGS="%{optflags} -fPIC -fPIE"
cmake -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_INSTALL_LIBDIR=%{_lib} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXE_LINKER_FLAGS:STRING="-pie" \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
..
make %{?_smp_mflags}
%install
cd build
%make_install
cd ..
# Debian menu system
rm -r '%{buildroot}%{_datadir}/menu'
mkdir -p '%{buildroot}%{_defaultdocdir}/lmms/'
%fdupes -s %{buildroot}/%{_datadir}
%post
%icon_theme_cache_post
%mime_database_post
%desktop_database_post
%postun
%desktop_database_postun
%mime_database_postun
%icon_theme_cache_postun
%files
%defattr(-,root,root)
%doc AUTHORS COPYING README TODO
%{_bindir}/lmms
%{_mandir}/man1/lmms.1*
%{_libdir}/lmms/
%{_datadir}/lmms/
%{_datadir}/applications/lmms.desktop
%{_datadir}/pixmaps/lmms.png
%{_datadir}/mime/packages/lmms.xml
%files devel
%defattr(0644,root,root,0755)
%{_includedir}/lmms/
%changelog