Skip to contentSkip to conversation

libav: add PACKAGECONFIG for theora, libvorbis, speex and openssl

PATCH In review Matthieu Crapet 5 participants 18 messages Jun 30, 2014 – Jul 28, 2014

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 libav: add PACKAGECONFIG for theora, libvorbis, speex and openssl

Dropped libvorvis dependency because there is already a (better) builtin vorbis codec. Don't confuse codec names: "vorbis" (builtin) and "libvorbis" (using external library).

Changes:
- add --enable-nonfree when faac or openssl are used
- add DESCRIPTION
- sort PACKAGECONFIG entries

Tested with libav-0.8.11 & libav-9.13.

Note: Be sure to have a recent version of bitbake (2014-06-11 or better) including this:
http://cgit.openembedded.org/bitbake/commit/?id=2e742c03e8dfdfa67899e7f5d579ed14bd87e139
It affects behavior of bb.utils.contains_any

---
 meta/recipes-multimedia/libav/libav.inc | 30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)
meta/recipes-multimedia/libav/libav.inc +22 -8
index a05a2a6..1d617a2 100644
@@ -1,6 +1,12 @@
-SUMMARY = "A complete, cross-platform solution to record, convert and stream audio and video"
+SUMMARY = "Open source audio and video processing tools and librairies"
+DESCRIPTION = "Libav is a friendly and community-driven effort to provide its users \
+               with a set of portable, functional and high-performance libraries for \
+               dealing with multimedia formats of all sorts. It originates from the \
+               FFmpeg codebase, but goes its own way these days, providing its users \
+               with reliable releases and a clear vision how to go forward."
 HOMEPAGE = "http://libav.org/"
 SECTION = "libs"
+
 LICENSE = "GPLv2+"
 LICENSE_FLAGS = "commercial"
 
@@ -9,7 +15,7 @@ PROVIDES = "ffmpeg"
 
 ARM_INSTRUCTION_SET = "arm"
 
-DEPENDS = "zlib libogg libvorbis libtheora yasm-native"
+DEPENDS = "zlib libogg yasm-native"
 
 INC_PR = "r8"
 
@@ -23,21 +29,29 @@ BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"
 EXTRA_FFCONF_armv7a = "--cpu=cortex-a8"
 EXTRA_FFCONF ?= ""
 
-PACKAGECONFIG ??= "bzip2 x264 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
-PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
+PACKAGECONFIG ??= "bzip2 x264 theora ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
 PACKAGECONFIG[bzip2] = "--enable-bzlib,--disable-bzlib,bzip2"
-PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger"
+PACKAGECONFIG[faac] = "--enable-libfaac,--disable-libfaac,faac"
 PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm"
-PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
-PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
+PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
+PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis"
 PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame"
-PACKAGECONFIG[faac] = "--enable-libfaac,--disable-libfaac,faac"
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
+PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger"
+PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex"
+PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora"
+PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
 PACKAGECONFIG[x11] = "--enable-x11grab,--disable-x11grab,virtual/libx11 libxfixes libxext xproto virtual/libsdl"
+PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
+
+# Check codecs that require --enable-nonfree
+USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'faac', 'openssl' ], 'yes', '', d)}"
 
 EXTRA_OECONF = " \
     --enable-shared \
     --enable-pthreads \
     --enable-gpl \
+    ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \
     --enable-avfilter \
     \
     --cross-prefix=${TARGET_PREFIX} \
Signature · 1 line
2.0.0
#1 lore raw
Quoted 68 lines · Matthieu Crapet

Dropped libvorvis dependency because there is already a (better) builtin vorbis codec. Don't confuse codec names: "vorbis" (builtin) and "libvorbis" (using external library). Changes:
- add --enable-nonfree when faac or openssl are used
- add DESCRIPTION
- sort PACKAGECONFIG entries

Tested with libav-0.8.11 & libav-9.13.

Note: Be sure to have a recent version of bitbake (2014-06-11 or better) including this:
http://cgit.openembedded.org/bitbake/commit/?id=2e742c03e8dfdfa67899e7f5d579ed14bd87e139
It affects behavior of bb.utils.contains_any

---
 meta/recipes-multimedia/libav/libav.inc | 30 ++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)
meta/recipes-multimedia/libav/libav.inc +17 -8
index a05a2a6..1d617a2 100644
@@ -1,6 +1,12 @@
-SUMMARY = "A complete, cross-platform solution to record, convert and stream audio and video"
+SUMMARY = "Open source audio and video processing tools and librairies"
+DESCRIPTION = "Libav is a friendly and community-driven effort to provide its users \
+               with a set of portable, functional and high-performance libraries for \
+               dealing with multimedia formats of all sorts. It originates from the \
+               FFmpeg codebase, but goes its own way these days, providing its users \
+               with reliable releases and a clear vision how to go forward."
 HOMEPAGE = "http://libav.org/"
 SECTION = "libs"
+
 LICENSE = "GPLv2+"
 LICENSE_FLAGS = "commercial"
 
@@ -9,7 +15,7 @@ PROVIDES = "ffmpeg"
 
 ARM_INSTRUCTION_SET = "arm"
 
-DEPENDS = "zlib libogg libvorbis libtheora yasm-native"
+DEPENDS = "zlib libogg yasm-native"
 
 INC_PR = "r8"
 
@@ -23,21 +29,29 @@ BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"
 EXTRA_FFCONF_armv7a = "--cpu=cortex-a8"
 EXTRA_FFCONF ?= ""
 
-PACKAGECONFIG ??= "bzip2 x264 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
-PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
+PACKAGECONFIG ??= "bzip2 x264 theora ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
 PACKAGECONFIG[bzip2] = "--enable-bzlib,--disable-bzlib,bzip2"
-PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger"
+PACKAGECONFIG[faac] = "--enable-libfaac,--disable-libfaac,faac"
 PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm"
-PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
-PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
+PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
+PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis"
 PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame"
-PACKAGECONFIG[faac] = "--enable-libfaac,--disable-libfaac,faac"
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
+PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger"
+PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex"
+PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora"
+PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
 PACKAGECONFIG[x11] = "--enable-x11grab,--disable-x11grab,virtual/libx11 libxfixes libxext xproto virtual/libsdl"

meta/recipes-multimedia/libav/libav.inc BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}" · line 54

Quoted 10 lines
meta/recipes-multimedia/libav/libav.inc +5 -0
+PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
+
+# Check codecs that require --enable-nonfree
+USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'faac', 'openssl' ], 'yes', '', d)}"
 
 EXTRA_OECONF = " \
     --enable-shared \
     --enable-pthreads \
     --enable-gpl \
+    ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \

cannot you just pass --enable-nonfree in faac and openssl PACKAGECONFIG? In worse case when both are enabled the option will be added twice.

Quoted 11 lines
meta/recipes-multimedia/libav/libav.inc +0 -0
     --enable-avfilter \
     \
     --cross-prefix=${TARGET_PREFIX} \
Signature · 7 lines
2.0.0

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#2 lore raw

Hi,

To summarize the situation:

This v2 patch works fine with an "old" bitbake (keeping the default PACKAGECONFIG).

But if user change PACKAGECONFIG and adds "faac" or "openssl" (but not both), the USE_NONFREE test will fail, so there will be a configure error.

Maybe could I add a comment inside the recipe ?

Regards,
M

-----Message d'origine-----
De : Martin Jansa [mailto:[email protected]]
Envoyé : lundi 30 juin 2014 18:41
À : Matthieu CRAPET
Cc : [email protected]
Objet : Re: [OE-core] [PATCH v2] libav: add PACKAGECONFIG for theora, libvorbis, speex and openssl

Quoted 71 lines · Matthieu Crapet

Dropped libvorvis dependency because there is already a (better) builtin vorbis codec. Don't confuse codec names: "vorbis" (builtin) and "libvorbis" (using external library). Changes:
- add --enable-nonfree when faac or openssl are used
- add DESCRIPTION
- sort PACKAGECONFIG entries

Tested with libav-0.8.11 & libav-9.13.

Note: Be sure to have a recent version of bitbake (2014-06-11 or better) including this:
http://cgit.openembedded.org/bitbake/commit/?id=2e742c03e8dfdfa67899e7
f5d579ed14bd87e139 It affects behavior of bb.utils.contains_any

---
 meta/recipes-multimedia/libav/libav.inc | 30 
++++++++++++++++++++++--------
 1 file changed, 22 insertions(+), 8 deletions(-)
meta/recipes-multimedia/libav/libav.inc +18 -8
index a05a2a6..1d617a2 100644
@@ -1,6 +1,12 @@
-SUMMARY = "A complete, cross-platform solution to record, convert and stream audio and video"
+SUMMARY = "Open source audio and video processing tools and librairies"
+DESCRIPTION = "Libav is a friendly and community-driven effort to provide its users \
+               with a set of portable, functional and high-performance libraries for \
+               dealing with multimedia formats of all sorts. It originates from the \
+               FFmpeg codebase, but goes its own way these days, providing its users \
+               with reliable releases and a clear vision how to go forward."
 HOMEPAGE = "http://libav.org/"
 SECTION = "libs"
+
 LICENSE = "GPLv2+"
 LICENSE_FLAGS = "commercial"
 
@@ -9,7 +15,7 @@ PROVIDES = "ffmpeg"
 
 ARM_INSTRUCTION_SET = "arm"
 
-DEPENDS = "zlib libogg libvorbis libtheora yasm-native"
+DEPENDS = "zlib libogg yasm-native"
 
 INC_PR = "r8"
 
@@ -23,21 +29,29 @@ BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"
 EXTRA_FFCONF_armv7a = "--cpu=cortex-a8"
 EXTRA_FFCONF ?= ""
 
-PACKAGECONFIG ??= "bzip2 x264 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
-PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
+PACKAGECONFIG ??= "bzip2 x264 theora ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
 PACKAGECONFIG[bzip2] = "--enable-bzlib,--disable-bzlib,bzip2"
-PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger"
+PACKAGECONFIG[faac] = "--enable-libfaac,--disable-libfaac,faac"
 PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm"
-PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
-PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
+PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
+PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis"
 PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame"
-PACKAGECONFIG[faac] = "--enable-libfaac,--disable-libfaac,faac"
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
+PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger"
+PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex"
+PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora"
+PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
 PACKAGECONFIG[x11] = "--enable-x11grab,--disable-x11grab,virtual/libx11 libxfixes libxext xproto virtual/libsdl"
+PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"

meta/recipes-multimedia/libav/libav.inc BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}" · line 55

Quoted 10 lines
meta/recipes-multimedia/libav/libav.inc +5 -0
+
+# Check codecs that require --enable-nonfree USE_NONFREE = 
+"${@bb.utils.contains_any('PACKAGECONFIG', [ 'faac', 'openssl' ], 'yes', '', d)}"
 
 EXTRA_OECONF = " \
     --enable-shared \
     --enable-pthreads \
     --enable-gpl \
+    ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', 
+ '', d)} \

cannot you just pass --enable-nonfree in faac and openssl PACKAGECONFIG? In worse case when both are enabled the option will be added twice.

Quoted 11 lines
meta/recipes-multimedia/libav/libav.inc +0 -1
     --enable-avfilter \
     \
     --cross-prefix=${TARGET_PREFIX} \
--

2.0.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

Signature · 1 line
Martin 'JaMa' Jansa     jabber: [email protected]
#3 lore raw
In reply to Martin Jansa

Op 30 jun. 2014, om 18:40 heeft Martin Jansa <[email protected]> het volgende geschreven:

Quoted 74 lines · Matthieu Crapet
Quoted 73 lines

Dropped libvorvis dependency because there is already a (better) builtin vorbis codec. Don't confuse codec names: "vorbis" (builtin) and "libvorbis" (using external library). Changes:
- add --enable-nonfree when faac or openssl are used
- add DESCRIPTION
- sort PACKAGECONFIG entries

Tested with libav-0.8.11 & libav-9.13.

Note: Be sure to have a recent version of bitbake (2014-06-11 or better) including this:
http://cgit.openembedded.org/bitbake/commit/?id=2e742c03e8dfdfa67899e7f5d579ed14bd87e139
It affects behavior of bb.utils.contains_any

---
meta/recipes-multimedia/libav/libav.inc | 30 ++++++++++++++++++++++--------

1 file changed, 22 insertions(+), 8 deletions(-)
meta/recipes-multimedia/libav/libav.inc +6 -1
index a05a2a6..1d617a2 100644
@@ -1,6 +1,12 @@
-SUMMARY = "A complete, cross-platform solution to record, convert and stream audio and video"
+SUMMARY = "Open source audio and video processing tools and librairies"
+DESCRIPTION = "Libav is a friendly and community-driven effort to provide its users \
+               with a set of portable, functional and high-performance libraries for \
+               dealing with multimedia formats of all sorts. It originates from the \
+               FFmpeg codebase, but goes its own way these days, providing its users \
+               with reliable releases and a clear vision how to go forward."

HOMEPAGE = "http://libav.org/"
SECTION = "libs"
+
LICENSE = "GPLv2+"
LICENSE_FLAGS = "commercial"

meta/recipes-multimedia/libav/libav.inc +0 -0
@@ -9,7 +15,7 @@ PROVIDES = "ffmpeg"
 

ARM_INSTRUCTION_SET = "arm"

meta/recipes-multimedia/libav/libav.inc +1 -1
-DEPENDS = "zlib libogg libvorbis libtheora yasm-native"
+DEPENDS = "zlib libogg yasm-native"

INC_PR = "r8"

meta/recipes-multimedia/libav/libav.inc +0 -0
@@ -23,21 +29,29 @@ BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"

EXTRA_FFCONF_armv7a = "--cpu=cortex-a8"
EXTRA_FFCONF ?= ""

meta/recipes-multimedia/libav/libav.inc +1 -2
-PACKAGECONFIG ??= "bzip2 x264 ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
-PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
+PACKAGECONFIG ??= "bzip2 x264 theora ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"

PACKAGECONFIG[bzip2] = "--enable-bzlib,--disable-bzlib,bzip2"

meta/recipes-multimedia/libav/libav.inc +1 -1
-PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger"
+PACKAGECONFIG[faac] = "--enable-libfaac,--disable-libfaac,faac"

PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm"

meta/recipes-multimedia/libav/libav.inc +2 -2
-PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
-PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
+PACKAGECONFIG[jack] = "--enable-indev=jack,--disable-indev=jack,jack"
+PACKAGECONFIG[libvorbis] = "--enable-libvorbis,--disable-libvorbis,libvorbis"

PACKAGECONFIG[mp3lame] = "--enable-libmp3lame,--disable-libmp3lame,lame"

meta/recipes-multimedia/libav/libav.inc +5 -1
-PACKAGECONFIG[faac] = "--enable-libfaac,--disable-libfaac,faac"
+PACKAGECONFIG[openssl] = "--enable-openssl,--disable-openssl,openssl"
+PACKAGECONFIG[schroedinger] = "--enable-libschroedinger,--disable-libschroedinger,schroedinger"
+PACKAGECONFIG[speex] = "--enable-libspeex,--disable-libspeex,speex"
+PACKAGECONFIG[theora] = "--enable-libtheora,--disable-libtheora,libtheora"
+PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"

PACKAGECONFIG[x11] = "--enable-x11grab,--disable-x11grab,virtual/libx11 libxfixes libxext xproto virtual/libsdl"

meta/recipes-multimedia/libav/libav.inc +4 -0
+PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
+
+# Check codecs that require --enable-nonfree
+USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'faac', 'openssl' ], 'yes', '', d)}"
Quoted 8 lines
Quoted 5 lines
EXTRA_OECONF = " \
    --enable-shared \
    --enable-pthreads \
    --enable-gpl \

+ ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \

cannot you just pass --enable-nonfree in faac and openssl PACKAGECONFIG? In worse case when both are enabled the option will be added twice.

If you have nonfree enabled, you need to change the license as well, it won't be GPL anymore.

regards,

Koen

Quoted 20 lines
Quoted 12 lines
    --enable-avfilter \
    \
    --cross-prefix=${TARGET_PREFIX} \
Signature · 7 lines
2.0.0

-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
Signature · 6 lines
Martin 'JaMa' Jansa     jabber: [email protected]
-- 
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core
#4 lore raw

Hi Koen,

Something like this (in a small python function) would be acceptable?

d.setVar('LICENSE', 'CLOSED')

Regards,
Matthieu

-----Message d'origine-----
De : Koen Kooi [mailto:[email protected]]
Envoyé : vendredi 11 juillet 2014 08:37
À : Martin Jansa
Cc : Matthieu CRAPET; [email protected]
Objet : Re: [OE-core] [PATCH v2] libav: add PACKAGECONFIG for theora, libvorbis, speex and openssl

[...]

Quoted 10 lines
Quoted 9 lines

+# Check codecs that require --enable-nonfree USE_NONFREE = +"${@bb.utils.contains_any('PACKAGECONFIG', [ 'faac', 'openssl' ], 'yes', '', d)}"

EXTRA_OECONF = " \
    --enable-shared \
    --enable-pthreads \
    --enable-gpl \

+ ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree',
+ '', d)} \

Quoted 2 lines

cannot you just pass --enable-nonfree in faac and openssl PACKAGECONFIG? In worse case when both are enabled the option will be added twice.

If you have nonfree enabled, you need to change the license as well, it won't be GPL anymore.

regards,

Koen

#5 lore raw

Hi Matthieu,

I used a different approach, but could't test with master yet.

http://git.openembedded.org/openembedded-core-contrib/commit/?h=obi/daisy&id=1e3c64a768a5aeaf8d904609a14dd29e298821df

While at it, you may also take a look at this commit:

http://git.openembedded.org/openembedded-core-contrib/commit/?h=obi/daisy&id=1e39f95927b65c7943c8d6c36203b8b55c9b3cdf

Feel free to modify and submit as you like.

Regards,
Andreas

Quoted 38 lines · Matthieu CRAPET

Hi Koen,

Something like this (in a small python function) would be acceptable?

d.setVar('LICENSE', 'CLOSED')

Regards,
Matthieu

-----Message d'origine-----
De : Koen Kooi [mailto:[email protected]]
Envoyé : vendredi 11 juillet 2014 08:37
À : Martin Jansa
Cc : Matthieu CRAPET; [email protected]
Objet : Re: [OE-core] [PATCH v2] libav: add PACKAGECONFIG for theora, libvorbis, speex and openssl

[...]

Quoted 10 lines
Quoted 9 lines

+# Check codecs that require --enable-nonfree USE_NONFREE = +"${@bb.utils.contains_any('PACKAGECONFIG', [ 'faac', 'openssl' ], 'yes', '', d)}"

EXTRA_OECONF = " \
    --enable-shared \
    --enable-pthreads \
    --enable-gpl \

+ ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree',
+ '', d)} \

Quoted 2 lines

cannot you just pass --enable-nonfree in faac and openssl PACKAGECONFIG? In worse case when both are enabled the option will be added twice.

If you have nonfree enabled, you need to change the license as well, it won't be GPL anymore.

regards,

Koen

#6 lore raw

Hi Andreas,

Thanks for contribution. Your way is simple but user must know internal dependencies between codecs in licenses. I think we can drop the GPL v2/v3 case because it is only used with libopencore & libvo that we don't use them in our recipe.

I'll post a v3 patch asap.

Regards,
Matthieu

-----Message d'origine-----
De : [email protected] [mailto:[email protected]] De la part de Andreas Oberritter Envoyé : vendredi 11 juillet 2014 14:44
À : [email protected]
Objet : Re: [OE-core] [PATCH v2] libav: add PACKAGECONFIG for theora, libvorbis, speex and openssl

Hi Matthieu,

I used a different approach, but could't test with master yet.

http://git.openembedded.org/openembedded-core-contrib/commit/?h=obi/daisy&id=1e3c64a768a5aeaf8d904609a14dd29e298821df

While at it, you may also take a look at this commit:

http://git.openembedded.org/openembedded-core-contrib/commit/?h=obi/daisy&id=1e39f95927b65c7943c8d6c36203b8b55c9b3cdf

Feel free to modify and submit as you like.

Regards,
Andreas

Quoted 29 lines · Matthieu CRAPET

Hi Koen,

Something like this (in a small python function) would be acceptable?

d.setVar('LICENSE', 'CLOSED')

Regards,
Matthieu

-----Message d'origine-----
De : Koen Kooi [mailto:[email protected]]
Envoyé : vendredi 11 juillet 2014 08:37 À : Martin Jansa Cc : Matthieu CRAPET; [email protected]
Objet : Re: [OE-core] [PATCH v2] libav: add PACKAGECONFIG for theora, libvorbis, speex and openssl

[...]

Quoted 10 lines
Quoted 9 lines

+# Check codecs that require --enable-nonfree USE_NONFREE = +"${@bb.utils.contains_any('PACKAGECONFIG', [ 'faac', 'openssl' ], 'yes', '', d)}"

EXTRA_OECONF = " \
    --enable-shared \
    --enable-pthreads \
    --enable-gpl \

+ ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree',
+ '', d)} \

Quoted 9 lines
Quoted 2 lines

cannot you just pass --enable-nonfree in faac and openssl PACKAGECONFIG? In worse case when both are enabled the option will be added twice.

If you have nonfree enabled, you need to change the license as well, it won't be GPL anymore.

regards,

Koen

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#7 lore raw

PATCH v3 1/1 libav: set LICENSE and LICENSE_FLAGS according to PACKAGECONFIG options

+ fix: drop unwanted --enable-libtheora & --enable-libvorbis in EXTRA_OECONF

---
 meta/recipes-multimedia/libav/libav.inc | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
meta/recipes-multimedia/libav/libav.inc +10 -7
index 1d617a2..cd5ac5f 100644
@@ -7,8 +7,7 @@ DESCRIPTION = "Libav is a friendly and community-driven effort to provide its us
 HOMEPAGE = "http://libav.org/"
 SECTION = "libs"
 
-LICENSE = "GPLv2+"
-LICENSE_FLAGS = "commercial"
+LICENSE = "GPLv2+ & LGPLv2.1+"
 
 # Provides ffmpeg compat, see http://libav.org/about.html
 PROVIDES = "ffmpeg"
@@ -44,14 +43,20 @@ PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
 PACKAGECONFIG[x11] = "--enable-x11grab,--disable-x11grab,virtual/libx11 libxfixes libxext xproto virtual/libsdl"
 PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
 
-# Check codecs that require --enable-nonfree
-USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'faac', 'openssl' ], 'yes', '', d)}"
+# Check codecs that trigger nonfree license
+python () {
+	pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split()
+	nonfree = [ 'faac', 'openssl' ]
+	if set(pkgconfig) & set(nonfree):
+		d.setVar('LICENSE', 'Proprietary')
+		d.setVar('LICENSE_FLAGS', 'commercial')
+}
 
 EXTRA_OECONF = " \
     --enable-shared \
     --enable-pthreads \
     --enable-gpl \
-    ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \
+    ${@bb.utils.contains('LICENSE', 'Proprietary', '--enable-nonfree', '', d)} \
     --enable-avfilter \
     \
     --cross-prefix=${TARGET_PREFIX} \
@@ -60,8 +65,6 @@ EXTRA_OECONF = " \
     --enable-avserver \
     --enable-avplay \
     --ld="${CCLD}" \
-    --enable-libtheora  \
-    --enable-libvorbis \
     --arch=${TARGET_ARCH} \
     --target-os="linux" \
     --enable-cross-compile \
Signature · 1 line
2.0.0
#8 lore raw

Re: [PATCH v3] libav: set LICENSE and LICENSE_FLAGS according to PACKAGECONFIG options

Hello Matthieu,

Quoted 13 lines · Matthieu Crapet

+ fix: drop unwanted --enable-libtheora & --enable-libvorbis in EXTRA_OECONF

---
 meta/recipes-multimedia/libav/libav.inc | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
meta/recipes-multimedia/libav/libav.inc +0 -0
index 1d617a2..cd5ac5f 100644

meta/recipes-multimedia/libav/libav.inc DESCRIPTION = "Libav is a friendly and community-driven effort to provide its us · line 10

Quoted 6 lines
meta/recipes-multimedia/libav/libav.inc +1 -2
@@ -7,8 +7,7 @@ DESCRIPTION = "Libav is a friendly and community-driven effort to provide its us
 HOMEPAGE = "http://libav.org/"
 SECTION = "libs"
 
-LICENSE = "GPLv2+"
-LICENSE_FLAGS = "commercial"
+LICENSE = "GPLv2+ & LGPLv2.1+"

I think this is wrong (if it means dual licensed). To quote from the LICENSE file:

"Most files in Libav are under the GNU Lesser General Public License version 2.1 or later (LGPL v2.1+). Read the file COPYING.LGPLv2.1 for details. Some other files have MIT/X11/BSD-style licenses. In combination the LGPL v2.1+ applies to Libav.

Some optional parts of Libav are licensed under the GNU General Public License version 2 or later (GPL v2+). See the file COPYING.GPLv2 for details. None of these parts are used by default, you have to explicitly pass --enable-gpl to configure to activate them. In this case, Libav's license changes to GPL v2+."

So with --enable-gpl hardcoded in EXTRA_OECONF, GPLv2+ was the right choice.

Quoted 7 lines
meta/recipes-multimedia/libav/libav.inc +0 -0
 # Provides ffmpeg compat, see http://libav.org/about.html
 PROVIDES = "ffmpeg"
@@ -44,14 +43,20 @@ PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
 PACKAGECONFIG[x11] = "--enable-x11grab,--disable-x11grab,virtual/libx11 libxfixes libxext xproto virtual/libsdl"
 PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
 

meta/recipes-multimedia/libav/libav.inc PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx" · line 53

Quoted 10 lines
meta/recipes-multimedia/libav/libav.inc +8 -2
-# Check codecs that require --enable-nonfree
-USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'faac', 'openssl' ], 'yes', '', d)}"
+# Check codecs that trigger nonfree license
+python () {
+	pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split()
+	nonfree = [ 'faac', 'openssl' ]
+	if set(pkgconfig) & set(nonfree):
+		d.setVar('LICENSE', 'Proprietary')
+		d.setVar('LICENSE_FLAGS', 'commercial')
+}

Do you think it would be feasible to add code which decides whether to set --enable-gpl or not? Because --enable-gpl forbids linking libav for programs with incompatible licenses.

While your approach is to set the license according to enabled codecs, my approach is to choose the license and then enable all possible codecs, because for me the license is more important than some codecs. I think libav would abort configuration anyway if it encountered incompatible flags.

Regards,
Andreas

#9 lore raw

Re: [PATCH v3] libav: set LICENSE and LICENSE_FLAGS according to PACKAGECONFIG options

Hi again,

Quoted 2 lines

Some optional parts of Libav are licensed under the GNU General Public License version 2 or later (GPL v2+). See the file COPYING.GPLv2 for details. None of these parts are used by default, you have to explicitly pass --enable-gpl to configure to activate them. In this case, Libav's license changes to GPL v2+."

I may misunderstood something here.

For example:
- libavfiler. It contains yadif code which is GPLv2+ and frei0r code is LGPLv2.1+. Libavfiler is clearly contaminated:
LICENSE_libavfilter = "GPLv2+"
- libavutils is 100% LGPL
LICENSE_libavutils = " LGPLv2.1+"

Giving --enable-gpl to configure does not convert pure 100% LGPL licensed library to GPL license. Am I wrong?

Quoted 1 line

Do you think it would be feasible to add code which decides whether to set --enable-gpl or not? Because --enable-gpl forbids linking libav for programs with incompatible licenses.

Yes it's possible.

Regards,
M

#10 lore raw

Re: [PATCH v3] libav: set LICENSE and LICENSE_FLAGS according to PACKAGECONFIG options

Quoted 9 lines · Matthieu CRAPET

Hi again,

Quoted 2 lines

Some optional parts of Libav are licensed under the GNU General Public License version 2 or later (GPL v2+). See the file COPYING.GPLv2 for details. None of these parts are used by default, you have to explicitly pass --enable-gpl to configure to activate them. In this case, Libav's license changes to GPL v2+."

I may misunderstood something here.

For example:
- libavfiler. It contains yadif code which is GPLv2+ and frei0r code is LGPLv2.1+. Libavfiler is clearly contaminated:

Yadif needs to be enabled explicitly with --enable-gpl. frei0r is disabled by default. If enabled, it's linked at runtime using dlopen. At least, this is what the 'configure' script suggests.

Quoted 5 lines

LICENSE_libavfilter = "GPLv2+"
- libavutils is 100% LGPL
LICENSE_libavutils = " LGPLv2.1+"

Giving --enable-gpl to configure does not convert pure 100% LGPL licensed library to GPL license. Am I wrong?

If you combine GPL'ed and LGPL'ed code, the resulting binary will be GPL'ed.

https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License#Compatibility

Regards,
Andreas

#11 lore raw

Re: [PATCH v3] libav: set LICENSE and LICENSE_FLAGS according to PACKAGECONFIG options

Quoted 6 lines · Andreas Oberritter
Quoted 1 line · Matthieu CRAPET

Giving --enable-gpl to configure does not convert pure 100% LGPL licensed library to GPL license. Am I wrong?

If you combine GPL'ed and LGPL'ed code, the resulting binary will be GPL'ed.

https://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License#Compatibility

Sorry, I misunderstood that part of your question. If libavutils contains LGPL'ed code only, then there's no technical reason to automatically convert the license of libavutils to GPL, just because --enable-gpl was given on the comand-line. However, the libav 'LICENSE' clearly states that it's still the case anyway, but for non-technical reasons.

Regards,
Andreas

#12 lore raw

Re: [PATCH v3] libav: set LICENSE and LICENSE_FLAGS according to PACKAGECONFIG options

Quoted 1 line
Quoted 1 line

However, the libav 'LICENSE' clearly states that it's still the case anyway, but for non-technical reasons.

If so, I'll post a v4 patch asap.

Regards,
M

#13 lore raw

Re: [PATCH v3] libav: set LICENSE and LICENSE_FLAGS according to PACKAGECONFIG options

Quoted 4 lines · Matthieu CRAPET
Quoted 1 line
Quoted 1 line

However, the libav 'LICENSE' clearly states that it's still the case anyway, but for non-technical reasons.

If so, I'll post a v4 patch asap.

We also saw a build failure with this patch last night, please see this log file:

https://autobuilder.yoctoproject.org/main/builders/nightly-world/builds/164/steps/BuildImages/logs/stdio

Quoted 17 lines

You can also run generated qemu images with a command like 'runqemu qemux86'
Parsing recipes...done.
Parsing of 889 .bb files complete (0 cached, 889 parsed). 2154 targets, 166 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
ERROR: Nothing PROVIDES 'lib32-x264' (but virtual:multilib:lib32:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world/build/meta/recipes-multimedia/libav/libav_0.8.11.bb DEPENDS on or otherwise requires it)
ERROR: lib32-x264 was skipped: because it has a restricted license not whitelisted in LICENSE_FLAGS_WHITELIST
ERROR: Nothing PROVIDES 'x264' (but /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world/build/meta/recipes-multimedia/libav/libav_0.8.11.bb DEPENDS on or otherwise requires it)
ERROR: x264 was skipped: because it has a restricted license not whitelisted in LICENSE_FLAGS_WHITELIST
ERROR: Nothing RPROVIDES 'lib32-libav' (but virtual:multilib:lib32:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world/build/meta/recipes-multimedia/libav/libav_0.8.11.bb RDEPENDS on or otherwise requires it)
ERROR: No eligible RPROVIDERs exist for 'lib32-libav'
NOTE: Runtime target 'lib32-libav' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['lib32-libav']
ERROR: Nothing RPROVIDES 'lib32-libav-dev' (but virtual:multilib:lib32:/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world/build/meta/recipes-multimedia/libav/libav_0.8.11.bb RDEPENDS on or otherwise requires it)
ERROR: No eligible RPROVIDERs exist for 'lib32-libav-dev'
NOTE: Runtime target 'lib32-libav-dev' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['lib32-libav-dev']

Quoted 8 lines

ERROR: Nothing RPROVIDES 'libav' (but /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world/build/meta/recipes-multimedia/libav/libav_0.8.11.bb RDEPENDS on or otherwise requires it)
ERROR: No eligible RPROVIDERs exist for 'libav'
NOTE: Runtime target 'libav' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['libav']
ERROR: Nothing RPROVIDES 'libav-dev' (but /home/pokybuild/yocto-autobuilder/yocto-worker/nightly-world/build/meta/recipes-multimedia/libav/libav_0.8.11.bb RDEPENDS on or otherwise requires it)
ERROR: No eligible RPROVIDERs exist for 'libav-dev'
NOTE: Runtime target 'libav-dev' is unbuildable, removing...
Missing or unbuildable dependency chain was: ['libav-dev']

Please look into this failure as you work on your next version of the patch.

Sau!

Quoted 3 lines

Regards,
M

#14 lore raw

RFC PATCH v4 1/1 libav: set LICENSE according to PACKAGECONFIG options

In reply to Matthieu CRAPET

Experienced users can change license with 'gpl' and 'lic3' PACKAGECONFIG switches.

fix: drop unwanted --enable-libtheora & --enable-libvorbis in EXTRA_OECONF

---
 meta/recipes-multimedia/libav/libav.inc | 35 +++++++++++++++++++++++++--------
 1 file changed, 27 insertions(+), 8 deletions(-)
meta/recipes-multimedia/libav/libav.inc +27 -8
index 1d617a2..de9770b 100644
@@ -7,7 +7,7 @@ DESCRIPTION = "Libav is a friendly and community-driven effort to provide its us
 HOMEPAGE = "http://libav.org/"
 SECTION = "libs"
 
-LICENSE = "GPLv2+"
+LICENSE = "LGPLv2.1+"
 LICENSE_FLAGS = "commercial"
 
 # Provides ffmpeg compat, see http://libav.org/about.html
@@ -29,7 +29,7 @@ BUILD_OPTIMIZATION = "${FULL_OPTIMIZATION}"
 EXTRA_FFCONF_armv7a = "--cpu=cortex-a8"
 EXTRA_FFCONF ?= ""
 
-PACKAGECONFIG ??= "bzip2 x264 theora ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
+PACKAGECONFIG ??= "bzip2 gpl x264 theora ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}"
 PACKAGECONFIG[bzip2] = "--enable-bzlib,--disable-bzlib,bzip2"
 PACKAGECONFIG[faac] = "--enable-libfaac,--disable-libfaac,faac"
 PACKAGECONFIG[gsm] = "--enable-libgsm,--disable-libgsm,libgsm"
@@ -44,14 +44,35 @@ PACKAGECONFIG[vpx] = "--enable-libvpx,--disable-libvpx,libvpx"
 PACKAGECONFIG[x11] = "--enable-x11grab,--disable-x11grab,virtual/libx11 libxfixes libxext xproto virtual/libsdl"
 PACKAGECONFIG[x264] = "--enable-libx264,--disable-libx264,x264"
 
-# Check codecs that require --enable-nonfree
-USE_NONFREE = "${@bb.utils.contains_any('PACKAGECONFIG', [ 'faac', 'openssl' ], 'yes', '', d)}"
+# Licenses flags: allow to switch licence LGPL/GPL and v2/v3
+PACKAGECONFIG[gpl] = "--enable-gpl,--disable-gpl"
+PACKAGECONFIG[lic3] = "--enable-version3,--disable-version3"
+
+# Check codecs and license coherency
+python () {
+	pkgconfig = (d.getVar('PACKAGECONFIG', True) or "").split()
+	nonfree = [ 'faac', 'openssl' ]
+	gpl = [ 'x11', 'x264' ]
+	
+	if 'gpl' in pkgconfig:
+		if 'lic3' in pkgconfig:
+			d.setVar('LICENSE', 'GPLv3+')
+		else:
+			d.setVar('LICENSE', 'GPLv2+')
+	elif set(pkgconfig) & set(gpl):
+		raise bb.parse.SkipPackage("incompatible license, please add 'gpl' in PACKAGECONFIG")
+	elif 'lic3' in pkgconfig:
+		d.setVar('LICENSE', 'LGPLv3+')
+	
+	if set(pkgconfig) & set(nonfree):
+		d.setVar('LICENSE', 'Proprietary')
+		bb.note("Change LICENSE to 'Proprietary'")
+}
 
 EXTRA_OECONF = " \
     --enable-shared \
     --enable-pthreads \
-    --enable-gpl \
-    ${@bb.utils.contains('USE_NONFREE', 'yes', '--enable-nonfree', '', d)} \
+    ${@bb.utils.contains('LICENSE', 'Proprietary', '--enable-nonfree', '', d)} \
     --enable-avfilter \
     \
     --cross-prefix=${TARGET_PREFIX} \
@@ -60,8 +81,6 @@ EXTRA_OECONF = " \
     --enable-avserver \
     --enable-avplay \
     --ld="${CCLD}" \
-    --enable-libtheora  \
-    --enable-libvorbis \
     --arch=${TARGET_ARCH} \
     --target-os="linux" \
     --enable-cross-compile \
Signature · 1 line
2.0.0
#15 lore raw

Re: [RFC][PATCH v4] libav: set LICENSE according to PACKAGECONFIG options

Hi,

One more note. I've tested with 0.8.11 & 9.13 on OE-Core current git (master).
The only weak point is the use of python anonymous function which is called twice each time, is there a better solution ?

Regards,
Matt

#16 lore raw

PATCH 1/1 libav: fix PACKAGECONFIG for theora and libvorbis

Switches must not be in EXTRA_OECONF anymore.

---
 meta/recipes-multimedia/libav/libav.inc | 2 --
 1 file changed, 2 deletions(-)
meta/recipes-multimedia/libav/libav.inc +0 -2
index 1d617a2..5c327df 100644
@@ -60,8 +60,6 @@ EXTRA_OECONF = " \
     --enable-avserver \
     --enable-avplay \
     --ld="${CCLD}" \
-    --enable-libtheora  \
-    --enable-libvorbis \
     --arch=${TARGET_ARCH} \
     --target-os="linux" \
     --enable-cross-compile \
Signature · 1 line
2.0.0
#17 lore raw

Re: [PATCH] libav: fix PACKAGECONFIG for theora and libvorbis

Hi,

Please take this bugfix patch first, then we could arrange the LICENSE change issue later.

Regards,
Matthieu