All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [RFC][PATCH v4] libav: set LICENSE according to PACKAGECONFIG options
Date: Thu, 17 Jul 2014 16:44:47 +0200	[thread overview]
Message-ID: <1405608287-10401-1-git-send-email-Matthieu.Crapet@ingenico.com> (raw)
In-Reply-To: <8672BB614B4CCA40A6B3BDD6FD82050BA8B280C6@COSNADEXC13.usr.ingenico.loc>

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

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

Reported-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Matthieu Crapet <Matthieu.Crapet@ingenico.com>
---
 meta/recipes-multimedia/libav/libav.inc | 35 +++++++++++++++++++++++++--------
 1 file changed, 27 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-multimedia/libav/libav.inc b/meta/recipes-multimedia/libav/libav.inc
index 1d617a2..de9770b 100644
--- a/meta/recipes-multimedia/libav/libav.inc
+++ b/meta/recipes-multimedia/libav/libav.inc
@@ -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 \
-- 
2.0.0



  parent reply	other threads:[~2014-07-17 14:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-30 14:23 [PATCH v2] libav: add PACKAGECONFIG for theora, libvorbis, speex and openssl Matthieu Crapet
2014-06-30 16:40 ` Martin Jansa
2014-07-01  7:31   ` Matthieu CRAPET
2014-07-11  6:36   ` Koen Kooi
2014-07-11 11:47     ` Matthieu CRAPET
2014-07-11 12:43       ` Andreas Oberritter
2014-07-15 14:38         ` Matthieu CRAPET
2014-07-15 14:54           ` [PATCH v3] libav: set LICENSE and LICENSE_FLAGS according to PACKAGECONFIG options Matthieu Crapet
2014-07-15 16:39             ` Andreas Oberritter
2014-07-16  6:43               ` Matthieu CRAPET
2014-07-16  8:31                 ` Andreas Oberritter
2014-07-16  8:42                   ` Andreas Oberritter
2014-07-16  9:05                     ` Matthieu CRAPET
2014-07-16 16:31                       ` Saul Wold
2014-07-17 14:44                       ` Matthieu Crapet [this message]
2014-07-17 14:50                         ` [RFC][PATCH v4] libav: set LICENSE " Matthieu CRAPET
2014-07-28 12:06                           ` [PATCH] libav: fix PACKAGECONFIG for theora and libvorbis Matthieu Crapet
2014-07-28 12:10                             ` Matthieu CRAPET

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1405608287-10401-1-git-send-email-Matthieu.Crapet@ingenico.com \
    --to=matthieu.crapet@ingenico.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.