diff options
author | Pouria Rezaei <Pouria.rz@outlook.com> | 2024-07-26 11:43:15 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2024-07-26 11:46:39 +0700 |
commit | 9c17b14385f9372c257756050df82d615dcb391d (patch) | |
tree | 364e1c4ae0d58db08f2cf5dd68ce033c25200af0 /libraries | |
parent | a35e67b463e63612f98b67a87d743058f9ab3c5c (diff) |
libraries/liblastfm-qt5: Added (Qt C++ library for the Last.fm).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/liblastfm-qt5/README | 5 | ||||
-rw-r--r-- | libraries/liblastfm-qt5/fix-lastfm-options.patch | 269 | ||||
-rw-r--r-- | libraries/liblastfm-qt5/liblastfm-qt5.SlackBuild | 102 | ||||
-rw-r--r-- | libraries/liblastfm-qt5/liblastfm-qt5.info | 10 | ||||
-rw-r--r-- | libraries/liblastfm-qt5/slack-desc | 19 |
5 files changed, 405 insertions, 0 deletions
diff --git a/libraries/liblastfm-qt5/README b/libraries/liblastfm-qt5/README new file mode 100644 index 0000000000000..536d0929a4b14 --- /dev/null +++ b/libraries/liblastfm-qt5/README @@ -0,0 +1,5 @@ +liblastfm is a collection of libraries to help you integrate Last.fm +services into your rich desktop software. It is officially supported +software developed by Last.fm staff. + +By !red diff --git a/libraries/liblastfm-qt5/fix-lastfm-options.patch b/libraries/liblastfm-qt5/fix-lastfm-options.patch new file mode 100644 index 0000000000000..5cffead0363ef --- /dev/null +++ b/libraries/liblastfm-qt5/fix-lastfm-options.patch @@ -0,0 +1,269 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index be88967..c8bc89d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -20,6 +20,7 @@ option(BUILD_TESTS "Build liblastfm tests" ON) + + # installation dirs + include(GNUInstallDirs) ++include(FeatureSummary) + + #cmake module path + set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake/Modules") +@@ -27,20 +28,20 @@ set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake/Module + # setup qt stuff + set(CMAKE_AUTOMOC ON) + +-option(BUILD_WITH_QT4 "Build liblastfm with Qt4 no matter if Qt5 was found" OFF) ++option(BUILD_WITH_QT4 "Build liblastfm with Qt4" OFF) + +-if( NOT BUILD_WITH_QT4 ) +- # try Qt5 first, and prefer that if found +- find_package(Qt5Core QUIET) +-endif() ++if(NOT BUILD_WITH_QT4) ++ find_package(Qt5 REQUIRED COMPONENTS Core Network Xml CONFIG) ++ ++ if(BUILD_FINGERPRINT) ++ find_package(Qt5Sql REQUIRED CONFIG) ++ endif() + +-if(Qt5Core_DIR) + set(LASTFM_LIB_VERSION_SUFFIX 5) +- message(STATUS "Found Qt5! Please keep in mind, this is highly experimental and not our main development target..") +- include_directories(${Qt5Core_INCLUDE_DIRS}) + if(UNIX AND NOT APPLE) +- find_package(Qt5DBus REQUIRED) ++ find_package(Qt5DBus REQUIRED CONFIG) + endif() ++ include_directories(Qt5::Core Qt5::Network Qt5::Xml) + + # macro(qt_wrap_ui) + # qt5_wrap_ui(${ARGN}) +@@ -56,9 +57,6 @@ if(Qt5Core_DIR) + # endmacro() + else() + find_package(Qt4 COMPONENTS QtCore QtNetwork QtXml REQUIRED) +- +- macro(qt5_use_modules) +- endmacro() + endif() + + +@@ -97,3 +95,5 @@ if(BUILD_TESTS) + enable_testing() + add_subdirectory(tests) + endif() ++ ++feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 0f872fb..22ce506 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -3,16 +3,6 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/global.h.in ${CMAKE_CURRENT_BINARY_DI + + add_definitions(${QT_DEFINITIONS}) + include_directories(${QT_INCLUDES} ${CMAKE_CURRENT_BINARY_DIR}) +-set(liblastfm_LIBRARIES +- ${QT_QTCORE_LIBRARY} +- ${QT_QTNETWORK_LIBRARY} +- ${QT_QTXML_LIBRARY} +-) +- +-list(APPEND liblastfm_QT5_MODULES +- Xml +- Network +-) + + set(liblastfm_SOURCES + ws.cpp +@@ -49,15 +39,11 @@ if(WIN32) + if(NOT MINGW) + add_definitions("-D_ATL_DLL -D_CRT_SECURE_NO_WARNINGS") + +- list(APPEND liblastfm_SOURCES ++ set(liblastfm_SOURCES ${liblastfm_SOURCES} + win/WNetworkConnectionMonitor_win.cpp + win/WmiSink.cpp + win/NdisEvents.cpp + ) +- list(APPEND liblastfm_LIBRARIES +- winhttp +- wbemuuid +- ) + endif() + endif() + +@@ -67,30 +53,51 @@ if(APPLE) + #set(CMAKE_OSX_DEPLOYMENT_TARGET 10.5) + #set(CMAKE_OSX_SYSROOT "/Developer/SDKs/MacOSX${CMAKE_OSX_DEPLOYMENT_TARGET}.sdk") + +- list(APPEND liblastfm_SOURCES ++ set(liblastfm_SOURCES ${liblastfm_SOURCES} + mac/MNetworkConnectionMonitor_mac.cpp + ) +- +- find_library(SYSTEMCONFIGURATION_LIBRARY SystemConfiguration) +- find_library(COREFOUNDATION_LIBRARY CoreFoundation) +- list(APPEND liblastfm_LIBRARIES +- ${COREFOUNDATION_LIBRARY} +- ${SYSTEMCONFIGURATION_LIBRARY} +- ) + endif() + + if(UNIX AND NOT APPLE) +- list(APPEND liblastfm_SOURCES ++ set(liblastfm_SOURCES ${liblastfm_SOURCES} + linux/LNetworkConnectionMonitor_linux.cpp + ) +- list(APPEND liblastfm_LIBRARIES ${QT_QTDBUS_LIBRARY}) +- list(APPEND liblastfm_QT5_MODULES DBus) + endif() + + add_library(${LASTFM_LIB_TARGET_NAME} SHARED ${liblastfm_SOURCES}) +-qt5_use_modules(${LASTFM_LIB_TARGET_NAME} ${liblastfm_QT5_MODULES}) + +-target_link_libraries(${LASTFM_LIB_TARGET_NAME} ${liblastfm_LIBRARIES}) ++if(Qt5Core_DIR) ++ target_link_libraries(${LASTFM_LIB_TARGET_NAME} Qt5::Network Qt5::Xml) ++ if(UNIX AND NOT APPLE) ++ target_link_libraries(${LASTFM_LIB_TARGET_NAME} Qt5::DBus) ++ endif() ++else() ++ target_link_libraries(${LASTFM_LIB_TARGET_NAME} ++ ${QT_QTCORE_LIBRARY} ++ ${QT_QTNETWORK_LIBRARY} ++ ${QT_QTXML_LIBRARY} ++ ) ++ if(UNIX AND NOT APPLE) ++ target_link_libraries(${LASTFM_LIB_TARGET_NAME} ${QT_QTDBUS_LIBRARY}) ++ endif() ++endif() ++ ++if(WIN32 AND NOT MINGW) ++ target_link_libraries(${LASTFM_LIB_TARGET_NAME} ++ winhttp ++ wbemuuid ++ ) ++endif() ++ ++if(APPLE) ++ find_library(SYSTEMCONFIGURATION_LIBRARY SystemConfiguration) ++ find_library(COREFOUNDATION_LIBRARY CoreFoundation) ++ target_link_libraries(${LASTFM_LIB_TARGET_NAME} ++ ${COREFOUNDATION_LIBRARY} ++ ${SYSTEMCONFIGURATION_LIBRARY} ++ ) ++endif() ++ + set_target_properties(${LASTFM_LIB_TARGET_NAME} PROPERTIES + VERSION ${LASTFM_VERSION_STRING} + SOVERSION ${LASTFM_SOVERSION} +diff --git a/src/fingerprint/CMakeLists.txt b/src/fingerprint/CMakeLists.txt +index 126f8d9..4a74e0d 100644 +--- a/src/fingerprint/CMakeLists.txt ++++ b/src/fingerprint/CMakeLists.txt +@@ -26,21 +26,23 @@ set(lastfm_fingerprint_HEADERS + + add_library(${FINGERPRINT_LIB_TARGET_NAME} SHARED ${lastfm_fingerprint_SOURCES}) + +-target_link_libraries(${FINGERPRINT_LIB_TARGET_NAME} +- ${LASTFM_LIB_TARGET_NAME} +- ${QT_QTSQL_LIBRARY} +- ${QT_QTCORE_LIBRARY} +- ${LIBSAMPLERATE_LIBRARY} +- ${LIBFFTW3_LIBRARY} +-) +- + set_target_properties(${FINGERPRINT_LIB_TARGET_NAME} PROPERTIES + COMPILE_DEFINITIONS LASTFM_FINGERPRINT_LIB + VERSION ${LASTFM_VERSION_STRING} + SOVERSION ${LASTFM_SOVERSION} + ) + +-qt5_use_modules(${FINGERPRINT_LIB_TARGET_NAME} Network Sql Xml) ++target_link_libraries(${FINGERPRINT_LIB_TARGET_NAME} ++ ${LASTFM_LIB_TARGET_NAME} ++ ${LIBSAMPLERATE_LIBRARY} ++ ${LIBFFTW3_LIBRARY} ++) ++ ++if(Qt5Core_DIR) ++ target_link_libraries(${FINGERPRINT_LIB_TARGET_NAME} Qt5::Network Qt5::Sql Qt5::Xml) ++else() ++ target_link_libraries(${FINGERPRINT_LIB_TARGET_NAME} ${QT_QTCORE_LIBRARY} ${QT_QTSQL_LIBRARY}) ++endif() + + install(TARGETS ${FINGERPRINT_LIB_TARGET_NAME} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} +diff --git a/src/fingerprint/Fingerprint.cpp b/src/fingerprint/Fingerprint.cpp +index 55f77a4..3817fce 100644 +--- a/src/fingerprint/Fingerprint.cpp ++++ b/src/fingerprint/Fingerprint.cpp +@@ -94,7 +94,7 @@ lastfm::Fingerprint::data() const + + + void +-lastfm::Fingerprint::generate( FingerprintableSource* ms ) throw( Error ) ++lastfm::Fingerprint::generate( FingerprintableSource* ms ) + { + //TODO throw if we can't get required metadata from the track object + +@@ -306,7 +306,7 @@ lastfm::Fingerprint::submit() const + + + void +-lastfm::Fingerprint::decode( QNetworkReply* reply, bool* complete_fingerprint_requested ) throw( Error ) ++lastfm::Fingerprint::decode( QNetworkReply* reply, bool* complete_fingerprint_requested ) + { + // The response data will consist of a number and a string. + // The number is the fpid and the string is either FOUND or NEW +diff --git a/src/fingerprint/Fingerprint.h b/src/fingerprint/Fingerprint.h +index 537d08c..9ac0dbd 100644 +--- a/src/fingerprint/Fingerprint.h ++++ b/src/fingerprint/Fingerprint.h +@@ -71,7 +71,7 @@ namespace lastfm + }; + + /** This is CPU intensive, do it in a thread in your GUI application */ +- void generate( FingerprintableSource* ) throw( Error ); ++ void generate( FingerprintableSource* ); + + /** Submits the fingerprint data to Last.fm in order to get a FingerprintId + * back. You need to wait for the QNetworkReply to finish before you can +@@ -82,7 +82,7 @@ namespace lastfm + * will be valid. Otherwise we will throw. You always get a valid id + * or a throw. + */ +- void decode( QNetworkReply*, bool* lastfm_needs_a_complete_fingerprint = 0 ) throw( Error ); ++ void decode( QNetworkReply*, bool* lastfm_needs_a_complete_fingerprint = 0 ); + }; + + +diff --git a/tests/lastfm_add_test.cmake b/tests/lastfm_add_test.cmake +index a4a1686..2f0664d 100644 +--- a/tests/lastfm_add_test.cmake ++++ b/tests/lastfm_add_test.cmake +@@ -6,13 +6,15 @@ macro(lastfm_add_test test_class) + configure_file(Test${LASTFM_TEST_CLASS}.h Test${LASTFM_TEST_CLASS}.h) + add_executable(${LASTFM_TEST_CLASS}Test Test${LASTFM_TEST_CLASS}.cpp) + +- qt5_use_modules(${LASTFM_TEST_CLASS}Test Core Test Xml Network) +- +- target_link_libraries(${LASTFM_TEST_CLASS}Test +- ${LASTFM_LIB_TARGET_NAME} +- ${QT_QTTEST_LIBRARY} +- ${QT_QTCORE_LIBRARY} +- ) ++ if(Qt5Core_DIR) ++ target_link_libraries(${LASTFM_TEST_CLASS}Test Qt5::Core Qt5::Test Qt5::Xml Qt5::Network ++ ${LASTFM_LIB_TARGET_NAME} ++ ) ++ else() ++ target_link_libraries(${LASTFM_TEST_CLASS}Test ${QT_QTCORE_LIBRARY} ${QT_QTTEST_LIBRARY} ++ ${LASTFM_LIB_TARGET_NAME} ++ ) ++ endif() + + add_test(NAME ${LASTFM_TEST_CLASS}Test COMMAND ${LASTFM_TEST_CLASS}Test) + endmacro() diff --git a/libraries/liblastfm-qt5/liblastfm-qt5.SlackBuild b/libraries/liblastfm-qt5/liblastfm-qt5.SlackBuild new file mode 100644 index 0000000000000..4ffc750342580 --- /dev/null +++ b/libraries/liblastfm-qt5/liblastfm-qt5.SlackBuild @@ -0,0 +1,102 @@ +#!/bin/bash + +# Slackware build script for liblastfm-qt5 + +# Copyright 2019-2024 Pouria Rezaei <Pouria.rz@outlook.com> +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=liblastfm-qt5 +VERSION=${VERSION:-1.1.0} +SRCNAM=liblastfm +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" +else + SLKCFLAGS="-O2" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar -xvf $CWD/$SRCNAM-$VERSION.tar.gz + +cd $SRCNAM-$VERSION +# We'll make you work with Qt5, don't worry. +patch -p1 < "$CWD/fix-lastfm-options.patch" + +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +mkdir -p build +cd build +cmake .. \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DBUILD_TESTS=OFF +make +make install DESTDIR=$PKG +cd .. + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a COPYING README.md \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/libraries/liblastfm-qt5/liblastfm-qt5.info b/libraries/liblastfm-qt5/liblastfm-qt5.info new file mode 100644 index 0000000000000..14d1bfedf937b --- /dev/null +++ b/libraries/liblastfm-qt5/liblastfm-qt5.info @@ -0,0 +1,10 @@ +PRGNAM="liblastfm-qt5" +VERSION="1.1.0" +HOMEPAGE="https://github.com/lastfm/liblastfm" +DOWNLOAD="https://github.com/lastfm/liblastfm/archive/1.1.0/liblastfm-1.1.0.tar.gz" +MD5SUM="48271beff8dbbd5e4b81c1f03a09ed3d" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Pouria Rezaei" +EMAIL="Pouria.rz@outlook.com" diff --git a/libraries/liblastfm-qt5/slack-desc b/libraries/liblastfm-qt5/slack-desc new file mode 100644 index 0000000000000..450b87135ba51 --- /dev/null +++ b/libraries/liblastfm-qt5/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +liblastfm-qt5: liblastfm-qt5 (Qt5 C++ library of Last.fm webservices) +liblastfm-qt5: +liblastfm-qt5: liblastfm is a collection of libraries to help you integrate Last.fm +liblastfm-qt5: services into your rich desktop software. It is officially supported +liblastfm-qt5: software developed by Last.fm staff. +liblastfm-qt5: +liblastfm-qt5: +liblastfm-qt5: Homepage: https://github.com/lastfm/liblastfms +liblastfm-qt5: +liblastfm-qt5: +liblastfm-qt5: |