diff options
Diffstat (limited to 'vcpkg/ports/libcanberra')
| -rw-r--r-- | vcpkg/ports/libcanberra/03_onlyshowin_unity.patch | 19 | ||||
| -rw-r--r-- | vcpkg/ports/libcanberra/gtk_dont_assume_x11.patch | 70 | ||||
| -rw-r--r-- | vcpkg/ports/libcanberra/lc-messages.patch | 14 | ||||
| -rw-r--r-- | vcpkg/ports/libcanberra/ltdl.patch | 29 | ||||
| -rw-r--r-- | vcpkg/ports/libcanberra/portfile.cmake | 73 | ||||
| -rw-r--r-- | vcpkg/ports/libcanberra/undefined_reference.diff | 40 | ||||
| -rw-r--r-- | vcpkg/ports/libcanberra/vcpkg.json | 70 |
7 files changed, 315 insertions, 0 deletions
diff --git a/vcpkg/ports/libcanberra/03_onlyshowin_unity.patch b/vcpkg/ports/libcanberra/03_onlyshowin_unity.patch new file mode 100644 index 0000000..6e33ee1 --- /dev/null +++ b/vcpkg/ports/libcanberra/03_onlyshowin_unity.patch @@ -0,0 +1,19 @@ +Description: Play login sound in Unity too + if it's enabled (it's disabled by default in Ubuntu) +Author: Michael Terry <michael.terry@canonical.com> +Bug-Ubuntu: https://launchpad.net/bugs/803519 +Bug: https://bugs.freedesktop.org/show_bug.cgi?id=38883 + +Index: libcanberra/src/libcanberra-login-sound.desktop.in +=================================================================== +--- libcanberra.orig/src/libcanberra-login-sound.desktop.in 2011-07-01 15:02:59.870772598 +0100 ++++ libcanberra/src/libcanberra-login-sound.desktop.in 2011-07-01 15:03:03.554772637 +0100 +@@ -3,7 +3,7 @@ + Name=GNOME Login Sound + Comment=Plays a sound whenever you log in + Exec=@bindir@/canberra-gtk-play --id="desktop-login" --description="GNOME Login" +-OnlyShowIn=GNOME; ++OnlyShowIn=GNOME;Unity; + AutostartCondition=GSettings org.gnome.desktop.sound event-sounds + X-GNOME-Autostart-Phase=Application + X-GNOME-Provides=login-sound diff --git a/vcpkg/ports/libcanberra/gtk_dont_assume_x11.patch b/vcpkg/ports/libcanberra/gtk_dont_assume_x11.patch new file mode 100644 index 0000000..efbc153 --- /dev/null +++ b/vcpkg/ports/libcanberra/gtk_dont_assume_x11.patch @@ -0,0 +1,70 @@ +From c0620e432650e81062c1967cc669829dbd29b310 Mon Sep 17 00:00:00 2001 +From: Michael Meeks <michael.meeks@suse.com> +Date: Fri, 9 Nov 2012 16:16:40 +0000 +Subject: gtk: Don't assume all GdkDisplays are GdkX11Displays: + broadway/wayland + +--- + src/canberra-gtk-module.c | 15 +++++++++++++++ + src/canberra-gtk.c | 5 +++++ + 2 files changed, 20 insertions(+) + +diff --git a/src/canberra-gtk-module.c b/src/canberra-gtk-module.c +index 67791f0..c1532ab 100644 +--- a/src/canberra-gtk-module.c ++++ b/src/canberra-gtk-module.c +@@ -307,6 +307,11 @@ static gint window_get_desktop(GdkDisplay *d, GdkWindow *w) { + guchar *data = NULL; + gint ret = -1; + ++#ifdef GDK_IS_X11_DISPLAY ++ if (!GDK_IS_X11_DISPLAY(d)) ++ return 0; ++#endif ++ + if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), GDK_WINDOW_XID(w), + gdk_x11_get_xatom_by_name_for_display(d, "_NET_WM_DESKTOP"), + 0, G_MAXLONG, False, XA_CARDINAL, &type_return, +@@ -335,6 +340,11 @@ static gint display_get_desktop(GdkDisplay *d) { + guchar *data = NULL; + gint ret = -1; + ++#ifdef GDK_IS_X11_DISPLAY ++ if (!GDK_IS_X11_DISPLAY(d)) ++ return 0; ++#endif ++ + if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), DefaultRootWindow(GDK_DISPLAY_XDISPLAY(d)), + gdk_x11_get_xatom_by_name_for_display(d, "_NET_CURRENT_DESKTOP"), + 0, G_MAXLONG, False, XA_CARDINAL, &type_return, +@@ -365,6 +375,11 @@ static gboolean window_is_xembed(GdkDisplay *d, GdkWindow *w) { + gboolean ret = FALSE; + Atom xembed; + ++#ifdef GDK_IS_X11_DISPLAY ++ if (!GDK_IS_X11_DISPLAY(d)) ++ return FALSE; ++#endif ++ + /* Gnome Panel applets are XEMBED windows. We need to make sure we + * ignore them */ + +diff --git a/src/canberra-gtk.c b/src/canberra-gtk.c +index 34446f5..08cb668 100644 +--- a/src/canberra-gtk.c ++++ b/src/canberra-gtk.c +@@ -185,6 +185,11 @@ static gint window_get_desktop(GdkDisplay *d, GdkWindow *w) { + guchar *data = NULL; + gint ret = -1; + ++#ifdef GDK_IS_X11_DISPLAY ++ if (!GDK_IS_X11_DISPLAY(d)) ++ return 0; ++#endif ++ + if (XGetWindowProperty(GDK_DISPLAY_XDISPLAY(d), GDK_WINDOW_XID(w), + gdk_x11_get_xatom_by_name_for_display(d, "_NET_WM_DESKTOP"), + 0, G_MAXLONG, False, XA_CARDINAL, &type_return, +-- +cgit v0.12 + diff --git a/vcpkg/ports/libcanberra/lc-messages.patch b/vcpkg/ports/libcanberra/lc-messages.patch new file mode 100644 index 0000000..c6ef4aa --- /dev/null +++ b/vcpkg/ports/libcanberra/lc-messages.patch @@ -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" diff --git a/vcpkg/ports/libcanberra/ltdl.patch b/vcpkg/ports/libcanberra/ltdl.patch new file mode 100644 index 0000000..100c798 --- /dev/null +++ b/vcpkg/ports/libcanberra/ltdl.patch @@ -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: diff --git a/vcpkg/ports/libcanberra/portfile.cmake b/vcpkg/ports/libcanberra/portfile.cmake new file mode 100644 index 0000000..bf64042 --- /dev/null +++ b/vcpkg/ports/libcanberra/portfile.cmake @@ -0,0 +1,73 @@ +vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION}
+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 ltdl-dev\n\nThey can be installed with apt-get install automake libtool ltdl-dev")
+endif()
+
+vcpkg_download_distfile(ARCHIVE
+ URLS "http://0pointer.de/lennart/projects/${PORT}/${PORT}-${VERSION}.tar.xz"
+ FILENAME "${PORT}-${VERSION}.tar.xz"
+ SHA512 f7543582122256826cd01d0f5673e1e58d979941a93906400182305463d6166855cb51f35c56d807a56dc20b7a64f7ce4391368d24990c1b70782a7d0b4429c2
+)
+
+vcpkg_extract_source_archive(SOURCE_PATH
+ ARCHIVE "${ARCHIVE}"
+ 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
+)
+
+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()
+
+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
+ )
+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
+ --disable-udev
+ ${OPTIONS}
+)
+
+vcpkg_install_make()
+vcpkg_fixup_pkgconfig()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools") # empty folder
+
+file(INSTALL "${SOURCE_PATH}/LGPL" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
diff --git a/vcpkg/ports/libcanberra/undefined_reference.diff b/vcpkg/ports/libcanberra/undefined_reference.diff new file mode 100644 index 0000000..138fc19 --- /dev/null +++ b/vcpkg/ports/libcanberra/undefined_reference.diff @@ -0,0 +1,40 @@ +Description: Fix FTBFS with binutils-gold +Author: Bart Martens <bartm@debian.org> +Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=555081 + +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -341,6 +341,7 @@ libcanberra_gtk3_la_CFLAGS = \ + $(GTK3_CFLAGS) + libcanberra_gtk3_la_LIBADD = \ + $(GTK3_LIBS) \ ++ -lX11 \ + libcanberra.la + libcanberra_gtk3_la_LDFLAGS = \ + -export-dynamic -version-info $(LIBCANBERRA_GTK_VERSION_INFO) +@@ -351,6 +352,8 @@ libcanberra_gtk3_module_la_CFLAGS = \ + $(GTK3_CFLAGS) + libcanberra_gtk3_module_la_LIBADD = \ + $(GTK3_LIBS) \ ++ -lX11 \ ++ -lgmodule-2.0 \ + libcanberra.la \ + libcanberra-gtk3.la + libcanberra_gtk3_module_la_LDFLAGS = \ +@@ -379,6 +382,7 @@ libcanberra_gtk_la_CFLAGS = \ + $(GTK_CFLAGS) + libcanberra_gtk_la_LIBADD = \ + $(GTK_LIBS) \ ++ -lX11 \ + libcanberra.la + libcanberra_gtk_la_LDFLAGS = \ + -export-dynamic -version-info $(LIBCANBERRA_GTK_VERSION_INFO) +@@ -389,6 +393,8 @@ libcanberra_gtk_module_la_CFLAGS = \ + $(GTK_CFLAGS) + libcanberra_gtk_module_la_LIBADD = \ + $(GTK_LIBS) \ ++ -lX11 \ ++ -lgmodule-2.0 \ + libcanberra.la \ + libcanberra-gtk.la + libcanberra_gtk_module_la_LDFLAGS = \ diff --git a/vcpkg/ports/libcanberra/vcpkg.json b/vcpkg/ports/libcanberra/vcpkg.json new file mode 100644 index 0000000..5108619 --- /dev/null +++ b/vcpkg/ports/libcanberra/vcpkg.json @@ -0,0 +1,70 @@ +{ + "name": "libcanberra", + "version": "0.30", + "port-version": 4, + "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/", + "license": "LGPL-2.1-or-later", + "supports": "!windows | mingw", + "dependencies": [ + "gettext", + "libvorbis" + ], + "default-features": [ + "defaults" + ], + "features": { + "alsa": { + "description": "Enable optional ALSA support", + "dependencies": [ + "alsa" + ] + }, + "defaults": { + "description": "Default features", + "dependencies": [ + { + "name": "libcanberra", + "features": [ + "alsa" + ], + "platform": "linux" + }, + { + "name": "libcanberra", + "features": [ + "null" + ], + "platform": "!linux" + } + ] + }, + "gstreamer": { + "description": "Enable optional GStreamer support", + "dependencies": [ + { + "name": "gstreamer", + "default-features": false + } + ] + }, + "gtk3": { + "description": "Enable optional GTK3 support", + "dependencies": [ + { + "name": "gtk3", + "default-features": false + } + ] + }, + "null": { + "description": "Enable optional null output" + }, + "oss": { + "description": "Enable optional OSS support" + }, + "pulse": { + "description": "Enable optional PulseAudio support" + } + } +} |