ympd: new package
authorEric Limpens <limpens@gmail.com>
Sun, 28 Sep 2014 12:04:02 +0000 (14:04 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sat, 4 Oct 2014 12:39:03 +0000 (14:39 +0200)
[Thomas:
 - Add the package to package/Config.in
 - Add dependency on largefile
 - Add new patch to CMakeLists.txt to remove the unused C++ dependency
 - Change the existing CMakeLists.txt patch to simply remove the
   problematic code, and reword the explanation.]

Signed-off-by: Eric Limpens <limpens@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/Config.in
package/ympd/Config.in [new file with mode: 0644]
package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch [new file with mode: 0644]
package/ympd/ympd-0002-only-c-language.patch [new file with mode: 0644]
package/ympd/ympd.mk [new file with mode: 0644]

index 1021d4c84ac17a7d7a7fcf0d0d77542be0e4b996..7f8faff8870863e6a21873a143dbdfe58aefa7c1 100644 (file)
@@ -35,6 +35,7 @@ menu "Audio and video applications"
        source "package/wavpack/Config.in"
        source "package/xbmc/Config.in"
        source "package/yavta/Config.in"
+       source "package/ympd/Config.in"
 endmenu
 
 menu "Compressors and decompressors"
diff --git a/package/ympd/Config.in b/package/ympd/Config.in
new file mode 100644 (file)
index 0000000..0223af7
--- /dev/null
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_YMPD
+       bool "ympd"
+       select BR2_PACKAGE_LIBMPDCLIENT
+       depends on BR2_TOOLCHAIN_HAS_THREADS
+       depends on BR2_LARGEFILE
+       help
+         ympd, a standalone MPD Web GUI written in C, utilizing
+         Websockets and Bootstrap/JS
+
+comment "ympd needs a toolchain w/ threads, largefile"
+       depends on !BR2_TOOLCHAIN_HAS_THREADS || !BR2_LARGEFILE
diff --git a/package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch b/package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch
new file mode 100644 (file)
index 0000000..0bd29c1
--- /dev/null
@@ -0,0 +1,24 @@
+Do not build the mkdata tool
+
+The mkdata tool is needed on the host, during the build, so building
+it for the target does not work when cross-compiling. Buildroot will
+manually build mkdata before starting the ympd build.
+
+Upstream is looking into a proper solution.
+
+Signed-off-by: Eric Limpens <Limpens@Gmail.com>
+
+Index: b/CMakeLists.txt
+===================================================================
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -28,9 +28,6 @@
+       htdocs/index.html
+ )
+-add_executable(mkdata htdocs/mkdata.c)
+-get_target_property(MKDATA_EXE mkdata LOCATION)
+-
+ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/assets.c
+     COMMAND ${MKDATA_EXE} ${RESOURCES} > ${PROJECT_BINARY_DIR}/assets.c
+     WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
diff --git a/package/ympd/ympd-0002-only-c-language.patch b/package/ympd/ympd-0002-only-c-language.patch
new file mode 100644 (file)
index 0000000..df5734c
--- /dev/null
@@ -0,0 +1,21 @@
+ympd is implemented only in C
+
+By default, CMake assumes that the project is using both C and C++. By
+explicitly passing 'C' as argument of the project() macro, we tell
+CMake that only C is used, which prevents CMake from checking if a C++
+compiler exists.
+
+Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
+
+Index: b/CMakeLists.txt
+===================================================================
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ cmake_minimum_required(VERSION 2.6)
+-project (ympd)
++project (ympd C)
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake/")
+ set(CPACK_PACKAGE_VERSION_MAJOR "1")
+ set(CPACK_PACKAGE_VERSION_MINOR "2")
diff --git a/package/ympd/ympd.mk b/package/ympd/ympd.mk
new file mode 100644 (file)
index 0000000..fc4be4d
--- /dev/null
@@ -0,0 +1,21 @@
+################################################################################
+#
+# ympd
+#
+################################################################################
+
+YMPD_VERSION = a98d760dddff4b0dd595d977c9077f34beff05c5
+YMPD_SITE = $(call github,notandy,ympd,$(YMPD_VERSION))
+YMPD_LICENSE = GPLv2
+YMPD_LICENSE_FILE = LICENSE
+YMPD_DEPENDENCIES = libmpdclient
+
+define YMPD_MAKE_HOST_TOOL
+        $(HOSTCC) $(HOST_CFLAGS) $(@D)/htdocs/mkdata.c -o $(@D)/mkdata
+endef
+
+YMPD_PRE_BUILD_HOOKS += YMPD_MAKE_HOST_TOOL
+
+YMPD_CONF_OPT += -DMKDATA_EXE=$(@D)/mkdata
+
+$(eval $(cmake-package))