From 5dfcdeeba9ded1bd4a6ddec14190f16c9428f3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= Date: Sat, 9 Sep 2023 22:29:10 +0200 Subject: [PATCH] kmix: update to 23.08.0. --- .../23.08.0--oss-version-detection.patch | 156 ++++++++++++++++++ srcpkgs/kmix/template | 4 +- 2 files changed, 158 insertions(+), 2 deletions(-) create mode 100644 srcpkgs/kmix/patches/23.08.0--oss-version-detection.patch diff --git a/srcpkgs/kmix/patches/23.08.0--oss-version-detection.patch b/srcpkgs/kmix/patches/23.08.0--oss-version-detection.patch new file mode 100644 index 00000000000..8e9792afa57 --- /dev/null +++ b/srcpkgs/kmix/patches/23.08.0--oss-version-detection.patch @@ -0,0 +1,156 @@ +From 917774de0d42632827671acc821888e15e87fc2b Mon Sep 17 00:00:00 2001 +From: Piotr Wójcik +Date: Sat, 9 Sep 2023 13:31:56 +0200 +Subject: oss-version-detection + + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ca9d7af..5c7c81d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -112,21 +112,21 @@ if (HAVE_SOUNDCARD_H OR HAVE_SYS_SOUNDCARD_H) + add_definitions(-DHAVE_SYS_SOUNDCARD_H) + endif () + +- # Running a program is hopefully more reliable than trying to +- # grep through header files to find a definition. Need try_run() +- # here so as to be able to read the output result. +- try_run(TEST_RUN_RESULT TEST_COMPILE_RESULT ++ # Comparing with preprocessor is hopefully more reliable than trying to ++ # grep through header files to find a definition. Unlike try_run(), ++ # causes no problem for cross-compilation. ++ try_compile(OSS3_COMPILE_RESULT + ${CMAKE_CURRENT_BINARY_DIR} +- SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/ossversion.c +- COMPILE_DEFINITIONS "${TEST_COMPILE_FLAGS}" +- RUN_OUTPUT_VARIABLE TEST_RESULT_VERSION) +- #message(STATUS "TEST_RUN_RESULT= ${TEST_RUN_RESULT}") +- #message(STATUS "TEST_COMPILE_RESULT= ${TEST_COMPILE_RESULT}") +- #message(STATUS "TEST_RESULT_VERSION= ${TEST_RESULT_VERSION}") +- +- if (${TEST_COMPILE_RESULT} AND (${TEST_RUN_RESULT} EQUAL 0)) +- message(STATUS "Detected OSS version ${TEST_RESULT_VERSION}") +- if (${TEST_RESULT_VERSION} GREATER_EQUAL 0x040000) ++ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/ossversion3.c ++ COMPILE_DEFINITIONS "${TEST_COMPILE_FLAGS}") ++ try_compile(OSS4_COMPILE_RESULT ++ ${CMAKE_CURRENT_BINARY_DIR} ++ SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/ossversion4.c ++ COMPILE_DEFINITIONS "${TEST_COMPILE_FLAGS}") ++ #message(STATUS "OSS3_COMPILE_RESULT= ${OSS3_COMPILE_RESULT}") ++ #message(STATUS "OSS4_COMPILE_RESULT= ${OSS4_COMPILE_RESULT}") ++ ++ if (${OSS4_COMPILE_RESULT}) + message(STATUS "Building with OSS 4 support") + set(HAVE_OSS_4 true) + add_definitions(-DHAVE_OSS_4) +@@ -137,20 +137,19 @@ if (HAVE_SOUNDCARD_H OR HAVE_SYS_SOUNDCARD_H) + # to have sys/soundcard.h and not soundcard.h installed. + check_struct_has_member(oss_mixerinfo devnode sys/soundcard.h HAVE_MIXERINFO_DEVNODE) + if (HAVE_MIXERINFO_DEVNODE) +- add_definitions(-DHAVE_MIXERINFO_DEVNODE) ++ add_definitions(-DHAVE_MIXERINFO_DEVNODE) + endif () +- else () ++ elseif (${OSS3_COMPILE_RESULT}) + message(STATUS "Building with OSS 3 support") + set(HAVE_OSS_3 true) + add_definitions(-DHAVE_OSS_3) + set(SUPPORTED_BACKENDS ${SUPPORTED_BACKENDS} "OSS") ++ else () ++ message(STATUS "Unable to get OSS version, assuming 3") ++ set(HAVE_OSS_3 true) ++ add_definitions(-DHAVE_OSS_3) ++ set(SUPPORTED_BACKENDS ${SUPPORTED_BACKENDS} "OSS") + endif () +- else () +- message(STATUS "Unable to get OSS version, assuming 3") +- set(HAVE_OSS_3 true) +- add_definitions(-DHAVE_OSS_3) +- set(SUPPORTED_BACKENDS ${SUPPORTED_BACKENDS} "OSS") +- endif () + endif () + + # PulseAudio, optional +diff --git a/ossversion.c b/cmake/ossversion3.c +similarity index 83% +rename from ossversion.c +rename to cmake/ossversion3.c +index 8ab612e..e3a5ff1 100644 +--- a/ossversion.c ++++ b/cmake/ossversion3.c +@@ -2,6 +2,7 @@ + * KMix -- KDE's full featured mini mixer + * + * Copyright (C) 2023 Jonathan Marten ++ * Copyright (C) 2023 Piotr Wójcik + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public +@@ -27,8 +28,14 @@ + #endif + #endif + ++ ++#if SOUND_VERSION < 0x030000 ++#error "SOUND_VERSION < 0x030000" ++#endif ++#if 0x040000 <= SOUND_VERSION ++#error "0x040000 <= SOUND_VERSION" ++#endif ++ + int main() + { +- printf("0x%06X", SOUND_VERSION); +- return (0); + } +diff --git a/cmake/ossversion4.c b/cmake/ossversion4.c +new file mode 100644 +index 0000000..637d894 +--- /dev/null ++++ b/cmake/ossversion4.c +@@ -0,0 +1,41 @@ ++/* ++ * KMix -- KDE's full featured mini mixer ++ * ++ * Copyright (C) 2023 Jonathan Marten ++ * Copyright (C) 2023 Piotr Wójcik ++ * ++ * This program is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Library General Public ++ * License as published by the Free Software Foundation; either ++ * version 2 of the License, or (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Library General Public License for more details. ++ * ++ * You should have received a copy of the GNU Library General Public ++ * License along with this program; if not, write to the Free ++ * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ++ */ ++ ++#include ++#ifdef HAVE_SOUNDCARD_H ++#include ++#else ++#ifdef HAVE_SYS_SOUNDCARD_H ++#include ++#endif ++#endif ++ ++ ++#if SOUND_VERSION < 0x040000 ++#error "SOUND_VERSION < 0x040000" ++#endif ++#if 0x050000 <= SOUND_VERSION ++#error "0x050000 <= SOUND_VERSION" ++#endif ++ ++int main() ++{ ++} +-- +2.41.0 + diff --git a/srcpkgs/kmix/template b/srcpkgs/kmix/template index 82d4319b9fd..25c5fbadb8f 100644 --- a/srcpkgs/kmix/template +++ b/srcpkgs/kmix/template @@ -1,6 +1,6 @@ # Template file for 'kmix' pkgname=kmix -version=23.04.3 +version=23.08.0 revision=1 build_style=cmake configure_args="-DSYSCONF_INSTALL_DIR=/etc -DDESKTOPTOJSON_EXECUTABLE=/usr/bin/desktoptojson" @@ -14,4 +14,4 @@ license="GPL-2.0-or-later, LGPL-2.0-or-later, GFDL-1.2-only" homepage="https://www.kde.org/applications/multimedia/kmix/" changelog="https://kde.org/announcements/changelogs/gear/${version}/#kmix" distfiles="${KDE_SITE}/release-service/${version}/src/kmix-${version}.tar.xz" -checksum=b247681b588773870bec1ae5b337231c05f60ed1c0a846c43715dee08dd2ee26 +checksum=13dd62562fbf3ebf45b6ce420c8a3b86e22bcb15e58d8625766d0f0a5ae77204