package/tvheadend: unbreak
PATCH v3 1/1 package/tvheadend: unbreak
From: "Yann E. MORIN" <[email protected]>
tvheadend tries to impersonate an autotools package, when it is not. This breaks the build.
tvheadend's ./configure tries to run compiled code. This breaks the build.
Switch tvheadend over to using the generic-package infrastructure, and provide carefully-crafted _CMDS for each steps.
We still keep a post-install hook to install our "DB" since it is not part of tvheadend, but an addition of our own packaging of tvheadend.
Fixes:
http://autobuild.buildroot.net/results/3ea/3eaa17b94975477263fe12e201eec9cbeeb2912c/ http://autobuild.buildroot.net/results/7c8/7c85db0dfab98808c97a5ef17dec9d1071dc0d49/
and a few others as well.
---
Changes v2->v3:
- use $(MAKE) not make (Thomas)
Changes v1->v2:
- add references to (some) autobuild failures
--- .../tvheadend-004-dont-run-compiled-code.patch | 21 +++++++++++++++++ package/tvheadend/tvheadend.mk | 27 ++++++++++++++++++---- 2 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 package/tvheadend/tvheadend-004-dont-run-compiled-code.patch
package/tvheadend/tvheadend-004-dont-run-compiled-code.patch new file +21 -0
@@ -0,0 +1,21 @@ +support: don't try to run compiled code + +When cross-compiling, we can't run the compiled code. + +Consider the compiler besing successfull as an indication +it is working. + +Signed-off-by: "Yann E. MORIN" <[email protected]> + +diff -durN tvheadend.orig/support/configure.inc tvheadend-c7d0335eb10d02b780423bef8e7c740e422fff13/support/configure.inc +--- tvheadend.orig/support/configure.inc 2013-12-01 01:24:26.000000000 +0100 ++++ tvheadend-c7d0335eb10d02b780423bef8e7c740e422fff13/support/configure.inc 2013-12-03 22:34:57.547762178 +0100 +@@ -265,8 +265,6 @@ + EOF + $CC $CFLAGS $LDFLAGS $TMPDIR/$$.c -o $TMPDIR/$$.bin $opt #&> /dev/null + RET=$? +- [ $RET -eq 0 ] && $TMPDIR/$$.bin +- RET=$? + rm -f $TMPDIR/$$.{c,bin} + return $RET + }
package/tvheadend/tvheadend.mk +23 -4
@@ -22,6 +22,28 @@ endif # scan files installed by the dvb-apps package TVHEADEND_DEPENDENCIES += dvb-apps +define TVHEADEND_CONFIGURE_CMDS + (cd $(@D); \ + $(TARGET_CONFIGURE_OPTS) \ + $(TARGET_CONFIGURE_ARGS) \ + ./configure \ + --prefix=/usr \ + --cc="$(TARGET_CC)" \ + --cflags="$(TARGET_CFLAGS)" \ + --arch="$(ARCH)" \ + --cpu="$(BR2_GCC_TARGET_CPU)" \ + --python="$(HOST_DIR)/usr/bin/python" \ + ) +endef + +define TVHEADEND_BUILD_CMDS + $(MAKE) -C $(@D) +endef + +define TVHEADEND_INSTALL_TARGET_CMDS + $(MAKE) -C $(@D) DESTDIR="$(TARGET_DIR)" install +endef + #---------------------------------------------------------------------------- # To run tvheadend, we need: # - a startup script, and its config file
@@ -43,7 +65,4 @@ define TVHEADEND_USERS tvheadend -1 tvheadend -1 * /home/tvheadend - video TVHeadend daemon endef -#---------------------------------------------------------------------------- -# tvheadend is not an autotools-based package, but it is possible to -# call its ./configure script as if it were an autotools one. -$(eval $(autotools-package)) +$(eval $(generic-package))
Signature · 1 line
1.8.1.2
PATCH v3 1/1 package/tvheadend: unbreak
Dear Yann E. MORIN,
package/tvheadend/tvheadend-004-dont-run-compiled-code.patch line 6
Quoted 12 lines · Yann E. MORIN
package/tvheadend/tvheadend-004-dont-run-compiled-code.patch new file +6
-0@@ -0,0 +1,21 @@ +support: don't try to run compiled code + +When cross-compiling, we can't run the compiled code. + +Consider the compiler besing successfull as an indication +it is working.
What does "the compiler being successful" means?
And also:
besing -> being
successfull -> successful
Thanks!
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH v3 1/1 package/tvheadend: unbreak
Thomas, All,
On 2013-12-04 08:45 +0100, Thomas Petazzoni spake thusly:
Quoted 16 lines · Yann E. MORIN
package/tvheadend/tvheadend-004-dont-run-compiled-code.patch line 6
Quoted 13 lines
package/tvheadend/tvheadend-004-dont-run-compiled-code.patch new file +6
-0@@ -0,0 +1,21 @@ +support: don't try to run compiled code + +When cross-compiling, we can't run the compiled code. + +Consider the compiler besing successfull as an indication +it is working.What does "the compiler being successful" means?
It means we are content with the compiler being able to compile.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v3 1/1 package/tvheadend: unbreak
In reply to Yann E. MORINQuoted 15 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
"Yann" == Yann E MORIN <[email protected]> writes:
From: "Yann E. MORIN" <[email protected]>
tvheadend tries to impersonate an autotools package, when it is not. This breaks the build.tvheadend's ./configure tries to run compiled code. This breaks the build.
Switch tvheadend over to using the generic-package infrastructure, and provide carefully-crafted
_CMDSfor each steps.We still keep a post-install hook to install our "DB" since it is not part of tvheadend, but an addition of our own packaging of tvheadend.
Quoted 7 lines
Fixes:
http://autobuild.buildroot.net/results/3ea/3eaa17b94975477263fe12e201eec9cbeeb2912c/ http://autobuild.buildroot.net/results/7c8/7c85db0dfab98808c97a5ef17dec9d1071dc0d49/and a few others as well.
Signed-off-by "Yann E. MORIN" <[email protected]>Cc Thomas Petazzoni <[email protected]>
Sorry, this was the one I committed, not v1 (with the patch commit message tweaked).
Signature · 1 line
Bye, Peter Korsgaard
PATCH v3 1/1 package/tvheadend: unbreak
In reply to Yann E. MORINpackage/tvheadend/tvheadend.mk endif · line 32
Quoted 2 lines · Yann E. MORIN
package/tvheadend/tvheadend.mk +2
-0+ --cc="$(TARGET_CC)" \ + --cflags="$(TARGET_CFLAGS)" \
It looks like the configure script is broken and fails if these
variables contain spaces (like e.g. when ccache is used).
From support/configure.inc:
function parse_args
{
local opt= val=
for opt do
val=${opt#*=}
opt=${opt%=*}
opt=${opt#*--}
case "$opt" in
cc|cflags|arch|cpu|platform|python)
eval "`toupper $opt`=$val"
;;Since the $val isn't quoted, a value with spaces will expand to e.g.:
eval "CC=ccache gcc"
which will execute
CC=ccache gcc
so it will try to run gcc...
In addition, parse_args is called from configure as:
parse_args $*
which will expand to:
parse_args --cc=ccache gcc --cflags=-DFOO -DBAR
so we only get the ccache and -DFOO in CC and CFLAGS. The unknown arguments gcc and -DBAR are ignored.
Two options:
- fix the scripts;
- don't use --cc and --cflags but just pass them in the environment (assuming that this works).
Regards,
Arnout
Signature · 6 lines
Arnout Vandecappelle arnout at mind be Senior Embedded Software Architect +32-16-286500 Essensium/Mind http://www.mind.be G.Geenslaan 9, 3001 Leuven, Belgium BE 872 984 063 RPR Leuven LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle GPG fingerprint: 7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
PATCH v3 1/1 package/tvheadend: unbreak
Arnout, All,
On 2013-12-05 16:14 +0100, Arnout Vandecappelle spake thusly:
Quoted 6 lines · Yann E. MORIN
package/tvheadend/tvheadend.mk endif · line 32
Quoted 2 lines
package/tvheadend/tvheadend.mk +2
-0+ --cc="$(TARGET_CC)" \ + --cflags="$(TARGET_CFLAGS)" \It looks like the configure script is broken and fails if these variables
contain spaces (like e.g. when ccache is used).
Doh... :-(
[--SNIP--]
Quoted 4 lines
Two options:
- fix the scripts;
- don't use --cc and --cflags but just pass them in the environment (assuming that this works).
I'll look what can be done with this. Thanks for the report.
Regards,
Yann e. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'