diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3136d29e..87f3ac06b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -102,14 +102,14 @@ jobs: - name: Build RPM (Tumbleweed) if: matrix.opensuse_version == 'tumbleweed' working-directory: build - run: rpmbuild -ba ../dist/unix/strawberry.spec + run: rpmbuild -ba strawberry.spec - name: Build RPM (Leap) if: matrix.opensuse_version != 'tumbleweed' working-directory: build env: CC: gcc-13 CXX: g++-13 - run: rpmbuild -ba ../dist/unix/strawberry.spec + run: rpmbuild -ba strawberry.spec - name: Set subdir id: set-subdir run: echo "subdir=$(echo ${{matrix.opensuse_version}} | sed 's/leap:/lp/g' | sed 's/\.//g')" > $GITHUB_OUTPUT @@ -209,7 +209,7 @@ jobs: env: RPM_BUILD_NCPUS: "2" working-directory: build - run: rpmbuild -ba ../dist/unix/strawberry.spec + run: rpmbuild -ba strawberry.spec - name: Upload artifacts uses: actions/upload-artifact@v4 with: @@ -302,7 +302,7 @@ jobs: env: RPM_BUILD_NCPUS: "2" working-directory: build - run: rpmbuild -ba ../dist/unix/strawberry.spec + run: rpmbuild -ba strawberry.spec - name: Upload artifacts if: matrix.openmandriva_version != 'cooker' uses: actions/upload-artifact@v4 @@ -398,7 +398,7 @@ jobs: env: RPM_BUILD_NCPUS: "2" working-directory: build - run: rpmbuild -ba ../dist/unix/strawberry.spec + run: rpmbuild -ba strawberry.spec - name: Upload artifacts uses: actions/upload-artifact@v4 with: @@ -471,11 +471,10 @@ jobs: - name: Create Build Environment run: cmake -E make_directory build - name: Configure CMake - run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_WERROR=ON + run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_WERROR=ON - name: make deb - run: dpkg-buildpackage -b -d -uc -us -nc -j2 - - name: Copy deb - run: cp ../*.deb . + working-directory: build + run: dpkg-buildpackage -b -d -uc -us -nc -j4 - name: Upload artifacts uses: actions/upload-artifact@v4 with: @@ -549,11 +548,10 @@ jobs: - name: Create Build Environment run: cmake -E make_directory build - name: Configure CMake - run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_WERROR=ON + run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_WERROR=ON - name: make deb + working-directory: build run: dpkg-buildpackage -b -d -uc -us -nc -j2 - - name: Copy deb - run: cp ../*.deb ../*.ddeb . - name: Upload artifacts uses: actions/upload-artifact@v4 with: @@ -634,18 +632,17 @@ jobs: - name: Create Build Environment run: cmake -E make_directory build - name: Configure CMake - run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DBUILD_WERROR=ON - - name: Delete build directory - run: rm -rf build + run: cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_WERROR=ON - name: Import Ubuntu PPA GPG private key uses: crazy-max/ghaction-import-gpg@v6 with: gpg_private_key: ${{secrets.UBUNTU_PPA_GPG_PRIVATE_KEY}} - name: dpkg-buildpackage + working-directory: build run: dpkg-buildpackage -S -d -k573D197B5EA20EDF - name: Upload Unstable PPA if: github.event_name == 'push' - run: dput ppa:jonaski/strawberry-unstable ../*_source.changes + run: dput ppa:jonaski/strawberry-unstable *_source.changes - name: Upload Stable PPA if: github.event_name == 'release' run: dput ppa:jonaski/strawberry ../*_source.changes diff --git a/.gitignore b/.gitignore index a13825127..eaf876f18 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,3 @@ /out /CMakeSettings.json /dist/scripts/maketarball.sh -/dist/unix/strawberry.spec -/debian/changelog -/dist/macos/Info.plist diff --git a/CMakeLists.txt b/CMakeLists.txt index 0c7224cfa..9f222f18e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -387,7 +387,7 @@ add_executable(strawberry) if(APPLE) set_target_properties(strawberry PROPERTIES MACOSX_BUNDLE TRUE) - set_target_properties(strawberry PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/dist/macos/Info.plist") + set_target_properties(strawberry PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_BINARY_DIR}/dist/macos/Info.plist") endif() if(WIN32 AND NOT ENABLE_WIN32_CONSOLE) diff --git a/cmake/Deb.cmake b/cmake/Deb.cmake index 3d0a6dd6f..64acfa931 100644 --- a/cmake/Deb.cmake +++ b/cmake/Deb.cmake @@ -2,5 +2,5 @@ find_program(LSB_RELEASE_EXEC lsb_release) find_program(DPKG_BUILDPACKAGE dpkg-buildpackage) if (LSB_RELEASE_EXEC AND DPKG_BUILDPACKAGE) - add_custom_target(deb WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} COMMAND ${DPKG_BUILDPACKAGE} -b -d -uc -us) + add_custom_target(deb WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND ${DPKG_BUILDPACKAGE} -b -d -uc -us -nc -j4) endif() diff --git a/cmake/Dmg.cmake b/cmake/Dmg.cmake index 74dc55ace..7967d60ca 100644 --- a/cmake/Dmg.cmake +++ b/cmake/Dmg.cmake @@ -31,7 +31,7 @@ if(MACDEPLOYQT_EXECUTABLE) add_custom_target(deploy COMMAND mkdir -p ${CMAKE_BINARY_DIR}/strawberry.app/Contents/{Frameworks,Resources} - COMMAND cp -v ${CMAKE_SOURCE_DIR}/dist/macos/Info.plist ${CMAKE_BINARY_DIR}/strawberry.app/Contents/ + COMMAND cp -v ${CMAKE_BINARY_DIR}/dist/macos/Info.plist ${CMAKE_BINARY_DIR}/strawberry.app/Contents/ COMMAND cp -v ${CMAKE_SOURCE_DIR}/dist/macos/strawberry.icns ${CMAKE_BINARY_DIR}/strawberry.app/Contents/Resources/ COMMAND ${CMAKE_SOURCE_DIR}/dist/macos/macgstcopy.sh ${CMAKE_BINARY_DIR}/strawberry.app COMMAND ${MACDEPLOYQT_EXECUTABLE} strawberry.app -verbose=3 -executable=${CMAKE_BINARY_DIR}/strawberry.app/Contents/PlugIns/gst-plugin-scanner ${MACDEPLOYQT_CODESIGN} diff --git a/cmake/Rpm.cmake b/cmake/Rpm.cmake index c92c0e13f..a0e840128 100644 --- a/cmake/Rpm.cmake +++ b/cmake/Rpm.cmake @@ -64,7 +64,7 @@ if (LSB_RELEASE_EXEC AND RPMBUILD_EXEC) 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_EXEC} -ba ${CMAKE_SOURCE_DIR}/dist/unix/strawberry.spec + COMMAND ${RPMBUILD_EXEC} -ba ${CMAKE_BINARY_DIR}/strawberry.spec ) endif() diff --git a/debian/CMakeLists.txt b/debian/CMakeLists.txt index f7a9c2cf0..94ea62730 100644 --- a/debian/CMakeLists.txt +++ b/debian/CMakeLists.txt @@ -4,7 +4,11 @@ if(LSB_RELEASE_EXEC AND DPKG_BUILDPACKAGE) execute_process(COMMAND /bin/sh "-c" "${LSB_RELEASE_EXEC} -cs" OUTPUT_VARIABLE DEB_CODENAME OUTPUT_STRIP_TRAILING_WHITESPACE) if(DEB_CODENAME AND DEB_DATE) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/changelog.in ${CMAKE_CURRENT_SOURCE_DIR}/changelog) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/control ${CMAKE_CURRENT_BINARY_DIR}/control COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/rules ${CMAKE_CURRENT_BINARY_DIR}/rules COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/changelog.in ${CMAKE_CURRENT_BINARY_DIR}/changelog) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/copyright ${CMAKE_CURRENT_BINARY_DIR}/copyright COPYONLY) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/clean ${CMAKE_CURRENT_BINARY_DIR}/clean COPYONLY) endif() endif() diff --git a/debian/clean b/debian/clean new file mode 100644 index 000000000..c7e574c0e --- /dev/null +++ b/debian/clean @@ -0,0 +1,3 @@ +dist/scripts/maketarball.sh +CMakeCache.txt +CMakeFiles/ diff --git a/debian/compat b/debian/compat deleted file mode 100644 index b4de39476..000000000 --- a/debian/compat +++ /dev/null @@ -1 +0,0 @@ -11 diff --git a/debian/control b/debian/control index ca5757601..3b5352eb7 100644 --- a/debian/control +++ b/debian/control @@ -3,6 +3,7 @@ Section: sound Priority: optional Maintainer: Jonas Kvinge Build-Depends: debhelper (>= 11), + debhelper-compat (= 13), git, make, cmake, @@ -28,7 +29,7 @@ Build-Depends: debhelper (>= 11), libchromaprint-dev, libfftw3-dev, libebur128-dev -Standards-Version: 4.6.1 +Standards-Version: 4.7.0 Package: strawberry Architecture: any diff --git a/debian/rules b/debian/rules index 837eb055f..19a1234e1 100755 --- a/debian/rules +++ b/debian/rules @@ -1,17 +1,7 @@ #!/usr/bin/make -f +export DH_VERBOSE=1 +export DEB_BUILD_MAINT_OPTIONS = hardening=+all + %: - dh $@ --buildsystem=cmake -builddirectory=build - -override_dh_auto_clean: - rm -f dist/macos/Info.plist - rm -f dist/unix/strawberry.spec - rm -f dist/scripts/maketarball.sh - rm -f dist/windows/strawberry.nsi - rm -f src/translations/translations.pot - dh_auto_clean - -override_dh_installchangelogs: - dh_installchangelogs Changelog - -override_dh_auto_test: + dh $@ diff --git a/dist/CMakeLists.txt b/dist/CMakeLists.txt index 82982baa5..47876d443 100644 --- a/dist/CMakeLists.txt +++ b/dist/CMakeLists.txt @@ -1,7 +1,7 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/maketarball.sh.in ${CMAKE_CURRENT_SOURCE_DIR}/scripts/maketarball.sh @ONLY) if(RPM_DISTRO AND RPM_DATE) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/unix/strawberry.spec.in ${CMAKE_CURRENT_SOURCE_DIR}/unix/strawberry.spec @ONLY) -endif(RPM_DISTRO AND RPM_DATE) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/unix/strawberry.spec.in ${CMAKE_BINARY_DIR}/strawberry.spec @ONLY) +endif() if(APPLE) if(DEFINED ENV{MACOSX_DEPLOYMENT_TARGET}) @@ -9,13 +9,13 @@ if(APPLE) else() set(LSMinimumSystemVersion 12.0) endif() - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/macos/Info.plist.in ${CMAKE_CURRENT_SOURCE_DIR}/macos/Info.plist) -endif(APPLE) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/macos/Info.plist.in ${CMAKE_CURRENT_BINARY_DIR}/macos/Info.plist) +endif() if(WIN32) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/windows/windres.rc.in ${CMAKE_BINARY_DIR}/windres.rc) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/windows/strawberry.nsi.in ${CMAKE_BINARY_DIR}/strawberry.nsi @ONLY) -endif(WIN32) +endif() if(UNIX AND NOT APPLE) install(FILES ../data/icons/48x48/strawberry.png DESTINATION share/icons/hicolor/48x48/apps/) @@ -24,9 +24,9 @@ if(UNIX AND NOT APPLE) install(FILES unix/org.strawberrymusicplayer.strawberry.desktop DESTINATION share/applications) install(FILES unix/org.strawberrymusicplayer.strawberry.appdata.xml DESTINATION share/metainfo) install(FILES unix/strawberry.1 DESTINATION share/man/man1) -endif(UNIX AND NOT APPLE) +endif() if(APPLE) - install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/macos/Info.plist" DESTINATION "${CMAKE_BINARY_DIR}/strawberry.app/Contents") + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/macos/Info.plist" DESTINATION "${CMAKE_BINARY_DIR}/strawberry.app/Contents") install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/macos/strawberry.icns" DESTINATION "${CMAKE_BINARY_DIR}/strawberry.app/Contents/Resources") endif()