diff options
author | Alexey Dokuchaev <danfe@FreeBSD.org> | 2016-01-31 07:14:37 +0000 |
---|---|---|
committer | Alexey Dokuchaev <danfe@FreeBSD.org> | 2016-01-31 07:14:37 +0000 |
commit | 7a747491ebdca84ce544ea1d82c5a7e13d68ac3d (patch) | |
tree | db56651f196717a43824a7baa3e5417724c56f76 /audio/deadbeef-quick-search-plugin | |
parent | 6b61eebefea435dd313de95ba24aa4c9dce0d8e2 (diff) |
Notes
Diffstat (limited to 'audio/deadbeef-quick-search-plugin')
-rw-r--r-- | audio/deadbeef-quick-search-plugin/Makefile | 39 | ||||
-rw-r--r-- | audio/deadbeef-quick-search-plugin/distinfo | 2 | ||||
-rw-r--r-- | audio/deadbeef-quick-search-plugin/files/patch-Makefile | 37 | ||||
-rw-r--r-- | audio/deadbeef-quick-search-plugin/files/patch-main.c | 59 | ||||
-rw-r--r-- | audio/deadbeef-quick-search-plugin/pkg-descr | 3 |
5 files changed, 140 insertions, 0 deletions
diff --git a/audio/deadbeef-quick-search-plugin/Makefile b/audio/deadbeef-quick-search-plugin/Makefile new file mode 100644 index 000000000000..400342b5dc9e --- /dev/null +++ b/audio/deadbeef-quick-search-plugin/Makefile @@ -0,0 +1,39 @@ +# Created by: Alexey Dokuchaev <danfe@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= deadbeef-quick-search-plugin +DISTVERSION= 0.0.2016.01.02 +CATEGORIES= audio + +MAINTAINER= danfe@FreeBSD.org +COMMENT= Quick playlist search bar plugin for DeaDBeeF audio player + +BUILD_DEPENDS= ${LOCALBASE}/include/deadbeef/deadbeef.h:${PORTSDIR}/audio/deadbeef +RUN_DEPENDS:= ${BUILD_DEPENDS} + +USE_GITHUB= yes +GH_ACCOUNT= cboxdoerfer +GH_PROJECT= ddb_quick_search +GH_TAGNAME= 332e994 + +USES= gmake pkgconfig + +OPTIONS_DEFINE= GTK2 GTK3 +OPTIONS_DEFAULT= GTK2 + +.for v in 2 3 +GTK${v}_USE= GNOME=gtk${v}0 + +GTK${v}_ALL_TARGET= gtk${v} +GTK${v}_PLIST_FILES= lib/deadbeef/ddb_misc_quick_search_GTK${v}.so + +do-install-GTK${v}-on: + @${MKDIR} ${STAGEDIR}${PREFIX}/lib/deadbeef + ${INSTALL_LIB} ${WRKSRC}/gtk${v}/ddb_misc_quick_search_GTK${v}.so \ + ${STAGEDIR}${PREFIX}/lib/deadbeef +.endfor + +do-install: + @${DO_NADA} + +.include <bsd.port.mk> diff --git a/audio/deadbeef-quick-search-plugin/distinfo b/audio/deadbeef-quick-search-plugin/distinfo new file mode 100644 index 000000000000..596da11ef1fc --- /dev/null +++ b/audio/deadbeef-quick-search-plugin/distinfo @@ -0,0 +1,2 @@ +SHA256 (cboxdoerfer-ddb_quick_search-0.0.2016.01.02-332e994_GH0.tar.gz) = b46a825b500759fe440d2ba5521d94793f67b5437cdd736d37d1c0d1f9b3bd1d +SIZE (cboxdoerfer-ddb_quick_search-0.0.2016.01.02-332e994_GH0.tar.gz) = 8114 diff --git a/audio/deadbeef-quick-search-plugin/files/patch-Makefile b/audio/deadbeef-quick-search-plugin/files/patch-Makefile new file mode 100644 index 000000000000..149baaab9232 --- /dev/null +++ b/audio/deadbeef-quick-search-plugin/files/patch-Makefile @@ -0,0 +1,37 @@ +--- Makefile.orig 2016-01-02 12:26:07 UTC ++++ Makefile +@@ -26,7 +26,7 @@ GTK2_LIBS?=`pkg-config --libs gtk+-2.0` + GTK3_LIBS?=`pkg-config --libs gtk+-3.0` + + CC?=gcc +-CFLAGS+=-Wall -g -O2 -fPIC -std=c99 -D_GNU_SOURCE ++CFLAGS+=-Wall -fPIC -std=c99 -D_GNU_SOURCE + LDFLAGS+=-shared + + GTK2_DIR?=gtk2 +@@ -65,21 +65,21 @@ mkdir_gtk3: + + $(GTK2_DIR)/$(OUT_GTK2): $(OBJ_GTK2) + @echo "Linking GTK+2 version" +- @$(call link, $(OBJ_GTK2), $(GTK2_LIBS)) ++ $(call link, $(OBJ_GTK2), $(GTK2_LIBS)) + @echo "Done!" + + $(GTK3_DIR)/$(OUT_GTK3): $(OBJ_GTK3) + @echo "Linking GTK+3 version" +- @$(call link, $(OBJ_GTK3), $(GTK3_LIBS)) ++ $(call link, $(OBJ_GTK3), $(GTK3_LIBS)) + @echo "Done!" + + $(GTK2_DIR)/%.o: %.c + @echo "Compiling $(subst $(GTK2_DIR)/,,$@)" +- @$(call compile, $(GTK2_CFLAGS)) ++ $(call compile, $(GTK2_CFLAGS)) + + $(GTK3_DIR)/%.o: %.c + @echo "Compiling $(subst $(GTK3_DIR)/,,$@)" +- @$(call compile, $(GTK3_CFLAGS)) ++ $(call compile, $(GTK3_CFLAGS)) + + clean: + @echo "Cleaning files from previous build..." diff --git a/audio/deadbeef-quick-search-plugin/files/patch-main.c b/audio/deadbeef-quick-search-plugin/files/patch-main.c new file mode 100644 index 000000000000..77937aafd083 --- /dev/null +++ b/audio/deadbeef-quick-search-plugin/files/patch-main.c @@ -0,0 +1,59 @@ +--- main.c.orig 2016-01-02 12:26:07 UTC ++++ main.c +@@ -101,9 +101,17 @@ check_dir (const char *dir, mode_t mode) + static int + make_cache_dir (char *path, int size) + { ++#if (DDB_API_LEVEL >= 8) + const char *cache_dir = deadbeef->get_system_dir (DDB_SYS_DIR_CACHE); ++#else ++ const char *cache_dir = getenv ("HOME"); ++#endif + if (cache_dir) { +- const int sz = snprintf (path, size, cache_dir ? "%s/quick_search/" : "%s/.cache/deadbeef/quick_search/", cache_dir ? cache_dir : getenv ("HOME")); ++#if (DDB_API_LEVEL >= 8) ++ const int sz = snprintf (path, size, "%s/quick_search/", cache_dir); ++#else ++ const int sz = snprintf (path, size, "%s/.cache/deadbeef/quick_search/", cache_dir); ++#endif + if (!check_dir (path, 0755)) { + return 0; + } +@@ -432,14 +440,13 @@ on_searchentry_activate ( + DB_playItem_t *it = deadbeef->plt_get_first (plt, PL_MAIN); + while (it) { + if (deadbeef->pl_is_selected (it)) { ++ int idx = deadbeef->plt_get_item_idx(plt, it, PL_MAIN); ++ deadbeef->sendmessage (DB_EV_PLAY_NUM, 0, idx, 0); + break; + } + DB_playItem_t *next = deadbeef->pl_get_next (it, PL_MAIN); + deadbeef->pl_item_unref (it); + it = next; +- if (!it) { +- deadbeef->sendmessage (DB_EV_PLAY_NUM, 0, 0, 0); +- } + } + if (it) { + deadbeef->pl_item_unref (it); +@@ -541,9 +548,9 @@ on_searchentry_key_press_event + gpointer user_data) + { + #if GTK_CHECK_VERSION(3,0,0) +- if (event->keyval == GDK_KEY_Return) { ++ if (event->keyval == GDK_KEY_Return || event->keyval == GDK_KEY_KP_Enter) { + #else +- if (event->keyval == GDK_Return) { ++ if (event->keyval == GDK_Return || event->keyval == GDK_KP_Enter) { + #endif + if (!config_autosearch) { + GtkEntry *entry = GTK_ENTRY (widget); +@@ -1010,7 +1017,7 @@ quick_search_disconnect (void) + // define plugin interface + static DB_misc_t plugin = { + .plugin.api_vmajor = 1, +- .plugin.api_vminor = 8, ++ .plugin.api_vminor = 5, + .plugin.version_major = 0, + .plugin.version_minor = 1, + #if GTK_CHECK_VERSION(3,0,0) diff --git a/audio/deadbeef-quick-search-plugin/pkg-descr b/audio/deadbeef-quick-search-plugin/pkg-descr new file mode 100644 index 000000000000..0498203f8744 --- /dev/null +++ b/audio/deadbeef-quick-search-plugin/pkg-descr @@ -0,0 +1,3 @@ +This is a quick playlist search bar plugin for DeaDBeeF audio player. + +WWW: https://github.com/cboxdoerfer/ddb_quick_search |