[libcanberra] Control dependencies (#27314)

* Fix ltdl usage

* Control dependencies, trim patches

* Fix mingw

* Update versions

* Add license

* Restore explicit brew ltdl usage

* Update versions

* Replace deprecated function

* Update versions

* Print ltdl-dev dependency

* Update versions
This commit is contained in:
Kai Pastor 2022-10-25 02:09:22 +02:00 committed by GitHub
parent 0d1d5801c6
commit d9cb7bd068
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 106 additions and 87 deletions

View File

@ -0,0 +1,14 @@
diff --git a/src/sound-theme-spec.c b/src/sound-theme-spec.c
index 32affd0..371e380 100644
--- a/src/sound-theme-spec.c
+++ b/src/sound-theme-spec.c
@@ -28,6 +28,9 @@
#include <unistd.h>
#include <locale.h>
+#ifndef LC_MESSAGES
+#include <libintl.h>
+#endif
#include "sound-theme-spec.h"
#include "malloc.h"

View File

@ -0,0 +1,29 @@
diff --git a/configure.ac b/configure.ac
index f68602d..a4e24b3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -140,8 +140,12 @@ dnl We don't need any special variable for this though, since the user
dnl can give the proper place to find libltdl through the standard
dnl variables like LDFLAGS and CPPFLAGS.
+LTDL_INIT
+if test -n "$LTDL_LDFLAGS"; then
+ LDFLAGS="$LDFLAGS $LTDL_LDFLAGS"
+fi
AC_CHECK_HEADER([ltdl.h],
- [AC_CHECK_LIB([ltdl], [lt_dladvise_init], [LIBLTDL=-lltdl], [LIBLTDL=])],
+ [AC_CHECK_LIB([ltdl], [lt_dladvise_init], [LIBLTDL="-lltdl $LTDL_LDFLAGS $lt_cv_dlopen_libs"], [LIBLTDL=])],
[LIBLTDL=])
AS_IF([test "x$LIBLTDL" = "x"],
diff --git a/libcanberra.pc.in b/libcanberra.pc.in
index 0a5c7a1..a6a989b 100644
--- a/libcanberra.pc.in
+++ b/libcanberra.pc.in
@@ -7,5 +7,6 @@ Name: libcanberra
Description: Event Sound API
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lcanberra @PTHREAD_LIBS@
+Libs.private: @LIBLTDL@
Cflags: -D_REENTRANT -I${includedir}
Requires:

View File

@ -1,14 +0,0 @@
diff --git a/configure.ac b/configure.ac
index f68602d..1451747 100644
--- a/configure.ac
+++ b/configure.ac
@@ -115,8 +115,7 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
AC_SUBST([WARNINGFLAGS], $with_cflags)
CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\
- -Wl,--as-needed \
- -Wl,--gc-sections])
+])
AC_SUBST([GCLDFLAGS], $with_ldflags)
#### libtool stuff ####

View File

@ -1,12 +0,0 @@
diff --git a/libcanberra.pc.in b/libcanberra.pc.in
index 0a5c7a1..91a9e39 100644
--- a/libcanberra.pc.in
+++ b/libcanberra.pc.in
@@ -7,5 +7,7 @@ Name: libcanberra
Description: Event Sound API
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lcanberra @PTHREAD_LIBS@
+Libs.private: @LIBS_PRIVATE@
Cflags: -D_REENTRANT -I${includedir}
+Cflags.private: @CFLAGS_PRIVATE@
Requires:

View File

@ -1,19 +1,7 @@
set(VERSION 0.30)
set(PATCHES
pkgconfig.patch
undefined_reference.diff # https://sources.debian.org/patches/libcanberra/0.30-7/
gtk_dont_assume_x11.patch # likewise
03_onlyshowin_unity.patch # likewise
)
if(VCPKG_TARGET_IS_OSX)
list(APPEND PATCHES macos_fix.patch)
endif()
if(VCPKG_TARGET_IS_OSX)
message("${PORT} currently requires the following libraries from the system package manager:\n automake\n libtool\n\nThey can be installed with brew install automake libtool")
else()
message("${PORT} currently requires the following libraries from the system package manager:\n automake\n libtool\n\nThey can be installed with apt-get install automake libtool")
message("${PORT} currently requires the following libraries from the system package manager:\n automake\n libtool\n ltdl-dev\n\nThey can be installed with apt-get install automake libtool ltdl-dev")
endif()
vcpkg_download_distfile(ARCHIVE
@ -22,68 +10,60 @@ vcpkg_download_distfile(ARCHIVE
SHA512 f7543582122256826cd01d0f5673e1e58d979941a93906400182305463d6166855cb51f35c56d807a56dc20b7a64f7ce4391368d24990c1b70782a7d0b4429c2
)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
vcpkg_extract_source_archive(SOURCE_PATH
ARCHIVE "${ARCHIVE}"
REF ${VERSION}
PATCHES ${PATCHES}
PATCHES
ltdl.patch
undefined_reference.diff # https://sources.debian.org/patches/libcanberra/0.30-7/
gtk_dont_assume_x11.patch # likewise
03_onlyshowin_unity.patch # likewise
lc-messages.patch
)
set(EXTRA_CPPFLAGS)
set(EXTRA_LDFLAGS)
foreach(backend in oss pulse)
if("${backend}" IN_LIST FEATURES)
message(STATUS "Backend '${backend}' requires system libraries")
endif()
endforeach()
vcpkg_list(SET OPTIONS)
foreach(feature IN ITEMS alsa gstreamer gtk3 null oss pulse)
if("${feature}" IN_LIST FEATURES)
list(APPEND OPTIONS "--enable-${feature}")
else()
list(APPEND OPTIONS "--disable-${feature}")
endif()
endforeach()
#libltdl fixes
if(VCPKG_TARGET_IS_OSX)
execute_process(
COMMAND brew --prefix libtool
OUTPUT_VARIABLE BREW_LIBTOOL_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
vcpkg_list(APPEND OPTIONS
"CPPFLAGS=-I${BREW_LIBTOOL_PATH}/include"
"LTDL_LDFLAGS=-L${BREW_LIBTOOL_PATH}/lib"
cc_cv_LDFLAGS__Wl___as_needed=no
cc_cv_LDFLAGS__Wl___gc_sections=no
)
string(STRIP ${BREW_LIBTOOL_PATH} BREW_LIBTOOL_PATH)
set(LIBS_PRIVATE "-L${BREW_LIBTOOL_PATH}/lib -lltdl")
set(CFLAGS_PRIVATE "-I${BREW_LIBTOOL_PATH}/include")
set(EXTRA_LDFLAGS "LDFLAGS=${LIBS_PRIVATE}")
set(EXTRA_CPPFLAGS "CPPFLAGS=${CFLAGS_PRIVATE}")
else()
set(LIBS_PRIVATE "-lltdl")
endif()
if (NOT "alsa" IN_LIST FEATURES)
list(APPEND FEATURES_BACKENDS "--disable-alsa")
endif()
if (NOT "gstreamer" IN_LIST FEATURES)
list(APPEND FEATURES_BACKENDS "--disable-gstreamer")
endif()
if (NOT "null" IN_LIST FEATURES)
list(APPEND FEATURES_BACKENDS "--disable-null")
endif()
if (NOT "oss" IN_LIST FEATURES)
list(APPEND FEATURES_BACKENDS "--disable-oss")
endif()
if (NOT "pulse" IN_LIST FEATURES)
list(APPEND FEATURES_BACKENDS "--disable-pulse")
endif()
set(ENV{GTKDOCIZE} true)
vcpkg_configure_make(
AUTOCONFIG
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
--disable-gtk
--disable-gtk-doc
--disable-lynx
--disable-silent-rules
--disable-tdb
${FEATURES_BACKENDS}
${EXTRA_CPPFLAGS}
${EXTRA_LDFLAGS}
--disable-udev
${OPTIONS}
)
vcpkg_install_make()
configure_file("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${PORT}.pc" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${PORT}.pc" @ONLY)
configure_file("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${PORT}.pc" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${PORT}.pc" @ONLY)
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")

View File

@ -1,11 +1,13 @@
{
"name": "libcanberra",
"version": "0.30",
"port-version": 2,
"port-version": 3,
"description": "An implementation of the XDG Sound Theme and Name Specifications, for generating event sounds on free desktops",
"homepage": "http://0pointer.de/lennart/projects/libcanberra/",
"supports": "!(windows | uwp)",
"license": "LGPL-2.1-or-later",
"supports": "!windows | mingw",
"dependencies": [
"gettext",
"libvorbis"
],
"default-features": [
@ -13,7 +15,10 @@
],
"features": {
"alsa": {
"description": "Enable optional ALSA support"
"description": "Enable optional ALSA support",
"dependencies": [
"alsa"
]
},
"defaults": {
"description": "Default features",
@ -21,23 +26,35 @@
{
"name": "libcanberra",
"features": [
"null"
"alsa"
],
"platform": "osx"
"platform": "linux"
},
{
"name": "libcanberra",
"features": [
"alsa"
"null"
],
"platform": "linux"
"platform": "!linux"
}
]
},
"gstreamer": {
"description": "Enable optional GStreamer support",
"dependencies": [
"gstreamer"
{
"name": "gstreamer",
"default-features": false
}
]
},
"gtk3": {
"description": "Enable optional GTK3 support",
"dependencies": [
{
"name": "gtk3",
"default-features": false
}
]
},
"null": {

View File

@ -3594,7 +3594,7 @@
},
"libcanberra": {
"baseline": "0.30",
"port-version": 2
"port-version": 3
},
"libcbor": {
"baseline": "0.9.0",

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "3b2ba637761d93c1a71e356c0249c54933655b09",
"version": "0.30",
"port-version": 3
},
{
"git-tree": "30f433bae08d825ed5c8050194b7dd6a3009bf9a",
"version": "0.30",