Skip to contentSkip to conversation

ympd: new package

PATCH New Eric Limpens 3 participants 4 messages Sep 23, 2014 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ympd: new package

---
 package/Config.in                                       |  1 +
 package/ympd/Config.in                                  |  9 +++++++++
 package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch | 12 ++++++++++++
 package/ympd/ympd.mk                                    | 10 ++++++++++
 4 files changed, 32 insertions(+)
 create mode 100644 package/ympd/Config.in
 create mode 100644 package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch
 create mode 100644 package/ympd/ympd.mk
package/Config.in +1 -0
index 2eefc3f..1578404 100644
@@ -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"
package/ympd/Config.in new file +9 -0
new file mode 100644
index 0000000..53f128e
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_YMPD
+	bool "ympd"
+	select BR2_PACKAGE_LIBMPDCLIENT #libmpdclient
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  ympd, Standalone MPD Web GUI written in C, utilizing Websockets and Bootstrap/JS
+
+comment "ympd needs a toolchain w/ threads"
+	depends on !(BR2_TOOLCHAIN_HAS_THREADS)
package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch new file +12 -0
new file mode 100644
index 0000000..55a29ee
@@ -0,0 +1,12 @@
+--- ympd-a98d760dddff4b0dd595d977c9077f34beff05c5/CMakeLists.txt	2014-05-24 15:25:47.000000000 +0200
++++ ympd-a98d760dddff4b0dd595d977c9077f34beff05c5-1/CMakeLists.txt	2014-09-23 20:04:55.491997850 +0200
+@@ -29,6 +29,7 @@
+ )
+ 
+-add_executable(mkdata htdocs/mkdata.c)
+-get_target_property(MKDATA_EXE mkdata LOCATION)
++#add_executable(mkdata htdocs/mkdata.c)
++#get_target_property(MKDATA_EXE mkdata LOCATION)
++set(MKDATA_EXE "./mkdata")
+ 
+ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/assets.c
package/ympd/ympd.mk new file +10 -0
new file mode 100644
index 0000000..22727a9
@@ -0,0 +1,10 @@
+YMPD_VERSION = a98d760dddff4b0dd595d977c9077f34beff05c5
+YMPD_SITE = $(call github,notandy,ympd,$(YMPD_VERSION))
+
+define YMPD_MAKE_HOST_TOOL
+        $(CC) -O2 $(@D)/htdocs/mkdata.c -o $(@D)/mkdata
+endef
+
+YMPD_PRE_BUILD_HOOKS += YMPD_MAKE_HOST_TOOL
+
+$(eval $(cmake-package))
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 ympd: new package

Dear Eric Limpens,

Thanks for your contribution! Below a few comments. Could you take them into account and resend an updated version? Thanks!

package/ympd/Config.in line 3

Quoted 9 lines · Eric Limpens
package/ympd/Config.in new file +3 -0
new file mode 100644
index 0000000..53f128e
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_YMPD
+	bool "ympd"
+	select BR2_PACKAGE_LIBMPDCLIENT #libmpdclient

Comment not needed.

package/ympd/Config.in line 6

Quoted 3 lines
package/ympd/Config.in new file +3 -0
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	help
+	  ympd, Standalone MPD Web GUI written in C, utilizing Websockets and Bootstrap/JS

Help text should be wrapped to a short length, and maybe made more explicit, like:

ympd is a standalone MPD Web GUI written in C, using Websockets and Bootstrap/JS.

package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch

Quoted 6 lines
package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch new file +0 -0
new file mode 100644
index 0000000..55a29ee
@@ -0,0 +1,12 @@

All patches must have a Signed-off-by line and a description. See
http://buildroot.org/downloads/manual/manual.html#_format_and_licensing_of_the_package_patches.

package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch line 9

Quoted 9 lines
package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch new file +9 -0
+--- ympd-a98d760dddff4b0dd595d977c9077f34beff05c5/CMakeLists.txt	2014-05-24 15:25:47.000000000 +0200
++++ ympd-a98d760dddff4b0dd595d977c9077f34beff05c5-1/CMakeLists.txt	2014-09-23 20:04:55.491997850 +0200
+@@ -29,6 +29,7 @@
+ )
+ 
+-add_executable(mkdata htdocs/mkdata.c)
+-get_target_property(MKDATA_EXE mkdata LOCATION)
++#add_executable(mkdata htdocs/mkdata.c)
++#get_target_property(MKDATA_EXE mkdata LOCATION)

We generally like to have a solution that can potentially be submitted upstream.

package/ympd/ympd.mk

Quoted 9 lines
package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch new file +3 -0
++set(MKDATA_EXE "./mkdata")
+ 
+ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/assets.c
package/ympd/ympd.mk new file +0 -0
new file mode 100644
index 0000000..22727a9
@@ -0,0 +1,10 @@

Missing comment header like all other packages have.

package/ympd/ympd.mk line 6

Quoted 6 lines
package/ympd/ympd.mk new file +6 -0
+YMPD_VERSION = a98d760dddff4b0dd595d977c9077f34beff05c5
+YMPD_SITE = $(call github,notandy,ympd,$(YMPD_VERSION))
+
+define YMPD_MAKE_HOST_TOOL
+        $(CC) -O2 $(@D)/htdocs/mkdata.c -o $(@D)/mkdata
+endef

Use $(HOSTCC) $(HOST_CFLAGS) $(@D)/htdocs/mkdata.c -o $(@D)/mkdata

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

A message that is not in the archive (sent off-list or not yet received): CABGWzsQ5K=n4Cobck__oRkppK9Aq0uyV2Nn03tO1J2kYOqjqaQ@mail.gmail.com

#3 lore raw

PATCH 1/1 ympd: new package

Dear Eric Limpens,

Please keep the Buildroot list in Cc.

Quoted 2 lines · Eric Limpens

should I set the current patch to 'superseded' in patchwork? I'll send a
new/revised version.

We usually set the state to "Superseded" once a new patch has been sent. If we have requested some changes and we are fairly sure the submitter is going to submit an updated version, then we usually set the state to "Changes requested". But in fact, it doesn't make much difference, as in both cases, the patch is no longer in the "New" state, which means we no longer consider it as to be merged.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#4 lore raw

PATCH 1/1 ympd: new package

In reply to Eric Limpens

Hi Eric,

Quoted 44 lines · Eric Limpens
---
 package/Config.in                                       |  1 +
 package/ympd/Config.in                                  |  9 +++++++++
 package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch | 12 ++++++++++++
 package/ympd/ympd.mk                                    | 10 ++++++++++
 4 files changed, 32 insertions(+)
 create mode 100644 package/ympd/Config.in
 create mode 100644 package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch
 create mode 100644 package/ympd/ympd.mk
package/Config.in +1 -0
index 2eefc3f..1578404 100644
@@ -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"
package/ympd/Config.in new file +9 -0
new file mode 100644
index 0000000..53f128e
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_YMPD
+       bool "ympd"
+       select BR2_PACKAGE_LIBMPDCLIENT #libmpdclient
+       depends on BR2_TOOLCHAIN_HAS_THREADS
+       help
+         ympd, Standalone MPD Web GUI written in C, utilizing Websockets and Bootstrap/JS
+
+comment "ympd needs a toolchain w/ threads"
+       depends on !(BR2_TOOLCHAIN_HAS_THREADS)
package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch new file +0 -0
new file mode 100644
index 0000000..55a29ee

package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch line 10

Quoted 10 lines
package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch new file +10 -0
@@ -0,0 +1,12 @@
+--- ympd-a98d760dddff4b0dd595d977c9077f34beff05c5/CMakeLists.txt       2014-05-24 15:25:47.000000000 +0200
++++ ympd-a98d760dddff4b0dd595d977c9077f34beff05c5-1/CMakeLists.txt     2014-09-23 20:04:55.491997850 +0200
+@@ -29,6 +29,7 @@
+ )
+
+-add_executable(mkdata htdocs/mkdata.c)
+-get_target_property(MKDATA_EXE mkdata LOCATION)
++#add_executable(mkdata htdocs/mkdata.c)
++#get_target_property(MKDATA_EXE mkdata LOCATION)
++set(MKDATA_EXE "./mkdata")

This usually won't work.
The tricky thing is that the tool comes with the project itself, and is used during the build process of the project itself.

This kind of programs is usually not necessary on the target, but useful to generate source code and/or data for the target.

Building a tool, then trying to using it in the same build is a common mistake when the developers do not have cross-development in mind. So, this is not an issue specific to CMake (or any orther build-system).

To workaround this, there is a couple of solutions, depending on whether you can acheive the same job using standard programs (e.g.:
zip, dd ... whatever is needed/done) or not:
1) if the job can be done somehow else using standard programs, then you can try doing the job using these standard tools. It may require writing a script;
2) if the (host-)tool is simple enough, so that it can easily be built for the host, then you can build it manually (i.e. by by-passing the original build-system), before configuring the project for the target build, and feed its path in the configure phase of the target build;
3) otherwise, you can build a the package for the host, so you'll get the host tools installed in the Buildroot host directory, and feed its path in the configure phase of the target build.

In case you choose option 3), you may want to limit the host-build of the project to the needed host-tools. This may require patching the build system to support that, and/or patching the build-system to use a predefined tool when cross-compiling.

Quoted 8 lines
package/ympd/ympd-0001-CMake-cross-compile-mkdata.patch new file +2 -0
+
+ add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/assets.c
package/ympd/ympd.mk new file +0 -0
new file mode 100644
index 0000000..22727a9

package/ympd/ympd.mk line 7

Quoted 7 lines
package/ympd/ympd.mk new file +7 -0
@@ -0,0 +1,10 @@
+YMPD_VERSION = a98d760dddff4b0dd595d977c9077f34beff05c5
+YMPD_SITE = $(call github,notandy,ympd,$(YMPD_VERSION))
+
+define YMPD_MAKE_HOST_TOOL
+        $(CC) -O2 $(@D)/htdocs/mkdata.c -o $(@D)/mkdata
+endef
+

Instead of adding a set(MKDATA_EXE "....") in the cmake code itself, you can override it through the command line:

YMPD_CONF_OPT += -DMKDATA_EXE="$(@D)/mkdata"

(But you'll still need to disable the mkdata add_executable call).

Quoted 10 lines
package/ympd/ympd.mk new file +3 -1
+YMPD_PRE_BUILD_HOOKS += YMPD_MAKE_HOST_TOOL
+
+$(eval $(cmake-package))
--

1.9.1

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

Regards,

Signature · 1 line
Samuel