diff --git a/.gitignore b/.gitignore index fab7372d..ed907fcd 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,10 @@ Thumbs.db *.rc /.qmake.cache /.qmake.stash +*.spec +*.nsi +*.plist +maketarball.sh # qtcreator generated files *.pro.user* diff --git a/cmake/Rpm.cmake b/cmake/Rpm.cmake index 2aca8ece..93c702e7 100644 --- a/cmake/Rpm.cmake +++ b/cmake/Rpm.cmake @@ -1,12 +1,28 @@ -set(RPMBUILD_DIR ~/rpmbuild CACHE STRING "Rpmbuild directory, for the rpm target") -set(MOCK_COMMAND mock CACHE STRING "Command to use for running mock") -set(MOCK_CHROOT suse-x86_64 CACHE STRING "Chroot to use when building an rpm with mock") -set(RPM_DISTRO suse CACHE STRING "Suffix of the rpm file") -set(RPM_ARCH x86_64 CACHE STRING "Architecture of the rpm file") - -add_custom_target(rpm - COMMAND ${CMAKE_SOURCE_DIR}/dist/scripts/maketarball.sh - COMMAND ${CMAKE_COMMAND} -E copy strawberry-${STRAWBERRY_VERSION_PACKAGE}.tar.xz ${RPMBUILD_DIR}/SOURCES/ - COMMAND rpmbuild -bs ${CMAKE_SOURCE_DIR}/dist/rpm/strawberry.spec - COMMAND rpmbuild -bb ${CMAKE_SOURCE_DIR}/dist/rpm/strawberry.spec +find_program(LSB_RELEASE_EXEC lsb_release) +execute_process(COMMAND ${LSB_RELEASE_EXEC} -is + OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT + OUTPUT_STRIP_TRAILING_WHITESPACE ) + +if (LSB_RELEASE_EXEC) + set(RPMBUILD_DIR ~/rpmbuild CACHE STRING "Rpmbuild directory, for the rpm target") + set(RPM_ARCH x86_64 CACHE STRING "Architecture of the rpm file") + if (${LSB_RELEASE_ID_SHORT} STREQUAL "openSUSE") + set(RPM_DISTRO opensuse CACHE STRING "Suffix of the rpm file") + add_custom_target(rpm + COMMAND ${CMAKE_SOURCE_DIR}/dist/scripts/maketarball.sh + COMMAND ${CMAKE_COMMAND} -E copy strawberry-${STRAWBERRY_VERSION_PACKAGE}.tar.xz ${RPMBUILD_DIR}/SOURCES/ + COMMAND rpmbuild -bs ${CMAKE_SOURCE_DIR}/dist/opensuse/strawberry.spec + COMMAND rpmbuild -bb ${CMAKE_SOURCE_DIR}/dist/opensuse/strawberry.spec + ) + endif() + if (${LSB_RELEASE_ID_SHORT} STREQUAL "Fedora") + set(RPM_DISTRO fedora CACHE STRING "Suffix of the rpm file") + add_custom_target(rpm + COMMAND ${CMAKE_SOURCE_DIR}/dist/scripts/maketarball.sh + COMMAND ${CMAKE_COMMAND} -E copy strawberry-${STRAWBERRY_VERSION_PACKAGE}.tar.xz ${RPMBUILD_DIR}/SOURCES/ + COMMAND rpmbuild -bs ${CMAKE_SOURCE_DIR}/dist/fedora/strawberry.spec + COMMAND rpmbuild -bb ${CMAKE_SOURCE_DIR}/dist/fedora/strawberry.spec + ) + endif() +endif() diff --git a/dist/CMakeLists.txt b/dist/CMakeLists.txt index 9cbef073..a8c7e7e3 100644 --- a/dist/CMakeLists.txt +++ b/dist/CMakeLists.txt @@ -1,9 +1,11 @@ set(ENV{LC_ALL} "en_US.utf8") execute_process(COMMAND date "+%a %b %d %Y" OUTPUT_VARIABLE RPM_DATE OUTPUT_STRIP_TRAILING_WHITESPACE) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/rpm/strawberry.spec.in ${CMAKE_CURRENT_SOURCE_DIR}/rpm/strawberry.spec @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/maketarball.sh.in ${CMAKE_CURRENT_SOURCE_DIR}/scripts/maketarball.sh @ONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/opensuse/strawberry.spec.in ${CMAKE_CURRENT_SOURCE_DIR}/opensuse/strawberry.spec @ONLY) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/fedora/strawberry.spec.in ${CMAKE_CURRENT_SOURCE_DIR}/fedora/strawberry.spec @ONLY) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/macos/Info.plist.in ${CMAKE_CURRENT_SOURCE_DIR}/macos/Info.plist) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/windows/strawberry.nsi.in ${CMAKE_CURRENT_SOURCE_DIR}/windows/strawberry.nsi @ONLY) if (UNIX AND NOT APPLE) install(FILES ../data/icons/48x48/strawberry.png DESTINATION share/icons/hicolor/48x48/apps/) diff --git a/dist/fedora/strawberry.spec.in b/dist/fedora/strawberry.spec.in new file mode 100644 index 00000000..5f04a552 --- /dev/null +++ b/dist/fedora/strawberry.spec.in @@ -0,0 +1,113 @@ +Name: strawberry +Version: @STRAWBERRY_VERSION_RPM_V@ +Release: @STRAWBERRY_VERSION_RPM_R@.@RPM_DISTRO@ +Summary: A audio player and music collection organiser + +Group: Applications/Multimedia +License: GPL-3.0+ +URL: http://www.strawbs.org/ +Source0: %{name}-@STRAWBERRY_VERSION_PACKAGE@.tar.xz + +BuildRequires: boost-devel +BuildRequires: cmake +BuildRequires: desktop-file-utils +BuildRequires: gcc-c++ +BuildRequires: hicolor-icon-theme +BuildRequires: liblastfm-qt5-devel +BuildRequires: make +BuildRequires: git +BuildRequires: pkgconfig +BuildRequires: pkgconfig(glib-2.0) +BuildRequires: pkgconfig(gio-2.0) +BuildRequires: pkgconfig(gio-unix-2.0) +BuildRequires: pkgconfig(gthread-2.0) +BuildRequires: pkgconfig(dbus-1) +BuildRequires: pkgconfig(alsa) +BuildRequires: pkgconfig(protobuf) +BuildRequires: pkgconfig(sqlite3) >= 3.7 +BuildRequires: pkgconfig(taglib) >= 1.11 +BuildRequires: pkgconfig(Qt5Core) +BuildRequires: pkgconfig(Qt5Gui) +BuildRequires: pkgconfig(Qt5Widgets) +BuildRequires: pkgconfig(Qt5Concurrent) +BuildRequires: pkgconfig(Qt5Sql) +BuildRequires: pkgconfig(Qt5Network) +BuildRequires: pkgconfig(Qt5Xml) +BuildRequires: pkgconfig(Qt5X11Extras) +BuildRequires: pkgconfig(Qt5DBus) +BuildRequires: pkgconfig(Qt5OpenGL) +BuildRequires: pkgconfig(gstreamer-1.0) +BuildRequires: pkgconfig(gstreamer-app-1.0) +BuildRequires: pkgconfig(gstreamer-audio-1.0) +BuildRequires: pkgconfig(gstreamer-base-1.0) +BuildRequires: pkgconfig(gstreamer-tag-1.0) +BuildRequires: pkgconfig(libpulse) +BuildRequires: pkgconfig(libcdio) +BuildRequires: pkgconfig(libchromaprint) +BuildRequires: pkgconfig(libgpod-1.0) +BuildRequires: pkgconfig(libmtp) +BuildRequires: pkgconfig(libnotify) +BuildRequires: pkgconfig(libudf) + +%description +Strawberry is a audio player and music collection organizer. +It is a fork of Clementine. The name is inspired by the band Strawbs. + +Features: + * Play and organize music + * Native desktop notifications + * Playlists in multiple formats + * Edit tags on music files + * Fetch tags from MusicBrainz + * Album cover art from Lastfm, Musicbrainz, Discogs and Amazon + * Transfer music to iPod, iPhone, MTP or mass-storage USB player + * Support for multiple backends + +%prep +%setup -qn %{name}-@STRAWBERRY_VERSION_PACKAGE@ + +%build + +%if 0%{?fedora} > 27 +# workaround FTBFS +export CXXFLAGS="%{optflags} -fpermissive" +%endif + +mkdir %{_target_platform} +pushd %{_target_platform} + +%{cmake} \ + -DBUILD_WERROR:BOOL=OFF \ + -DCMAKE_BUILD_TYPE:STRING=Release \ + .. +popd + +%make_build -C %{_target_platform} + +%install +make install DESTDIR=%{buildroot} -C %{_target_platform} + +%check +desktop-file-validate %{buildroot}%{_datadir}/applications/strawberry.desktop +pushd %{_target_platform} +popd + +%clean + +%files +%defattr(-,root,root,-) +%doc +%{_bindir}/strawberry +%{_bindir}/strawberry-tagreader +%{_datadir}/applications/strawberry.desktop +%{_datadir}/icons/hicolor/48x48/apps/strawberry.png +%{_datadir}/icons/hicolor/64x64/apps/strawberry.png +%{_datadir}/icons/hicolor/128x128/apps/strawberry.png +%{_datadir}/icons/hicolor/scalable/apps/strawberry.svg +%{_mandir}/man1/%{name}.1%{?ext_man} +%{_mandir}/man1/%{name}-tagreader.1%{?ext_man} + +%changelog +* @RPM_DATE@ Jonas Kvinge - @STRAWBERRY_VERSION_RPM_V@ +- Version @STRAWBERRY_VERSION_PACKAGE@ + diff --git a/dist/rpm/strawberry.spec.in b/dist/opensuse/strawberry.spec.in similarity index 97% rename from dist/rpm/strawberry.spec.in rename to dist/opensuse/strawberry.spec.in index c009a33a..ebb852ee 100644 --- a/dist/rpm/strawberry.spec.in +++ b/dist/opensuse/strawberry.spec.in @@ -9,7 +9,11 @@ URL: http://www.strawbs.org/ Source0: %{name}-@STRAWBERRY_VERSION_PACKAGE@.tar.xz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +%if 0%{?suse_version} > 1325 BuildRequires: libboost_headers-devel +%else +BuildRequires: boost-devel +%endif BuildRequires: cmake BuildRequires: desktop-file-utils BuildRequires: gcc-c++ @@ -99,3 +103,4 @@ make clean %changelog * @RPM_DATE@ Jonas Kvinge - @STRAWBERRY_VERSION_RPM_V@ - Version @STRAWBERRY_VERSION_PACKAGE@ + diff --git a/dist/windows/strawberry.nsi b/dist/windows/strawberry.nsi.in similarity index 98% rename from dist/windows/strawberry.nsi rename to dist/windows/strawberry.nsi.in index 5892c494..8caae0a9 100644 --- a/dist/windows/strawberry.nsi +++ b/dist/windows/strawberry.nsi.in @@ -1,10 +1,10 @@ !define PRODUCT_NAME "Strawberry" !define PRODUCT_PUBLISHER "Strawberry" -!define PRODUCT_VERSION_MAJOR 0 -!define PRODUCT_VERSION_MINOR 2 -!define PRODUCT_VERSION_PATCH 1 -!define PRODUCT_DISPLAY_VERSION "0.2.1" -!define PRODUCT_DISPLAY_VERSION_SHORT "0.2.1" +!define PRODUCT_VERSION_MAJOR @STRAWBERRY_VERSION_MAJOR@ +!define PRODUCT_VERSION_MINOR @STRAWBERRY_VERSION_MINOR@ +!define PRODUCT_VERSION_PATCH @STRAWBERRY_VERSION_PATCH@ +!define PRODUCT_DISPLAY_VERSION "@STRAWBERRY_VERSION_PACKAGE@" +!define PRODUCT_DISPLAY_VERSION_SHORT "@STRAWBERRY_VERSION_PACKAGE@" !define PRODUCT_WEB_SITE "http://www.strawbs.org/" !define PRODUCT_UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCT_NAME}" !define PRODUCT_UNINST_ROOT_KEY "HKLM" @@ -48,7 +48,7 @@ SetCompressor /SOLID lzma !insertmacro MUI_LANGUAGE "English" ;first language is the default language Name "${PRODUCT_NAME}" -OutFile "${PRODUCT_NAME}Setup-0.2.1.exe" +OutFile "${PRODUCT_NAME}Setup-${PRODUCT_DISPLAY_VERSION}.exe" InstallDir "${PRODUCT_INSTALL_DIR}" ; Get the path where Strawberry was installed previously and set it as default path diff --git a/src/analyzer/analyzerbase.cpp b/src/analyzer/analyzerbase.cpp old mode 100755 new mode 100644