Skip to contentSkip to conversation

ffmpeg: use static package list

PATCH In review Andreas Oberritter 3 participants 7 messages Feb 16, 2017 – Feb 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ffmpeg: use static package list

Dynamic packaging isn't useful if every library needs to be listed manually.

---
 meta/recipes-multimedia/ffmpeg/ffmpeg_3.2.2.bb | 53 +++++++++-----------------
 1 file changed, 19 insertions(+), 34 deletions(-)
meta/recipes-multimedia/ffmpeg/ffmpeg_3.2.2.bb +19 -34
index e206222..52c266b 100644
@@ -107,7 +107,25 @@ do_configure() {
     ${S}/configure ${EXTRA_OECONF}
 }
 
-PACKAGES_DYNAMIC += "^lib(av(codec|device|filter|format|util|resample)|swscale|swresample|postproc).*"
+PACKAGES =+ "libavcodec \
+             libavdevice \
+             libavfilter \
+             libavformat \
+             libavresample \
+             libavutil \
+             libpostproc \
+             libswresample \
+             libswscale"
+
+FILES_libavcodec = "${libdir}/libavcodec${SOLIBS}"
+FILES_libavdevice = "${libdir}/libavdevice${SOLIBS}"
+FILES_libavfilter = "${libdir}/libavfilter${SOLIBS}"
+FILES_libavformat = "${libdir}/libavformat${SOLIBS}"
+FILES_libavresample = "${libdir}/libavresample${SOLIBS}"
+FILES_libavutil = "${libdir}/libavutil${SOLIBS}"
+FILES_libpostproc = "${libdir}/libpostproc${SOLIBS}"
+FILES_libswresample = "${libdir}/libswresample${SOLIBS}"
+FILES_libswscale = "${libdir}/libswscale${SOLIBS}"
 
 # ffmpeg disables PIC on some platforms (e.g. x86-32)
 INSANE_SKIP_${MLPREFIX}libavcodec = "textrel"
@@ -119,36 +137,3 @@ INSANE_SKIP_${MLPREFIX}libavresample = "textrel"
 INSANE_SKIP_${MLPREFIX}libswscale = "textrel"
 INSANE_SKIP_${MLPREFIX}libswresample = "textrel"
 INSANE_SKIP_${MLPREFIX}libpostproc = "textrel"
-
-python populate_packages_prepend() {
-    av_libdir = d.expand('${libdir}')
-    av_pkgconfig = d.expand('${libdir}/pkgconfig')
-
-    # Runtime package
-    do_split_packages(d, av_libdir, '^lib(.*)\.so\..*',
-                      output_pattern='lib%s',
-                      description='libav %s library',
-                      extra_depends='',
-                      prepend=True,
-                      allow_links=True)
-
-    # Development packages (-dev, -staticdev)
-    do_split_packages(d, av_libdir, '^lib(.*)\.so$',
-                      output_pattern='lib%s-dev',
-                      description='libav %s development package',
-                      extra_depends='${PN}-dev',
-                      prepend=True,
-                      allow_links=True)
-    do_split_packages(d, av_pkgconfig, '^lib(.*)\.pc$',
-                      output_pattern='lib%s-dev',
-                      description='libav %s development package',
-                      extra_depends='${PN}-dev',
-                      prepend=True)
-    do_split_packages(d, av_libdir, '^lib(.*)\.a$',
-                      output_pattern='lib%s-staticdev',
-                      description='libav %s development package - static library',
-                      extra_depends='${PN}-dev',
-                      prepend=True,
-                      allow_links=True)
-
-}
Signature · 1 line
2.7.4
#1 lore raw

PATCH 2/3 ffmpeg: Fix the license description

FFmpeg has complicated licensing options, so it should also have complicated license statements in its recipe.

---
 meta/recipes-multimedia/ffmpeg/ffmpeg_3.2.2.bb | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
meta/recipes-multimedia/ffmpeg/ffmpeg_3.2.2.bb +11 -1
index 52c266b..dc33bb4 100644
@@ -5,7 +5,17 @@ DESCRIPTION = "FFmpeg is the leading multimedia framework, able to decode, encod
 HOMEPAGE = "https://www.ffmpeg.org/"
 SECTION = "libs"
 
-LICENSE = "GPLv2+"
+LICENSE = "BSD & GPLv2+ & LGPLv2.1+ & MIT"
+LICENSE_${PN} = "GPLv2+"
+LICENSE_libavcodec = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavdevice = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavfilter = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavformat = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libpostproc = "GPLv2+"
+LICENSE_libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
 LICENSE_FLAGS = "commercial"
 
 LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
Signature · 1 line
2.7.4
#2 lore raw

Re: [PATCH 2/3] ffmpeg: Fix the license description

Quoted 16 lines · Andreas Oberritter
meta/recipes-multimedia/ffmpeg/ffmpeg_3.2.2.bb +3 -0
+LICENSE = "BSD & GPLv2+ & LGPLv2.1+ & MIT"
+LICENSE_${PN} = "GPLv2+"
+LICENSE_libavcodec = "${@bb.utils.contains('PACKAGECONFIG', 'gpl',

'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavdevice = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavfilter = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavformat = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"

(quoted diff) +2 -0
+LICENSE_libpostproc = "GPLv2+"
+LICENSE_libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl',
Quoted 4 lines

'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"

Using a script to extract the pkgdata information, I see this license information in the runtime libraries.

libswscale-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
libswresample-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
libpostproc-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
libavutil-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
libavformat-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
libavfilter-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
libavdevice-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
libavcodec-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
libswscale: GPLv2+
libswresample: GPLv2+
libpostproc: GPLv2+
libavutil: GPLv2+
libavformat: GPLv2+
libavfilter: GPLv2+
libavdevice: GPLv2+
libavcodec: GPLv2+
ffmpeg-dbg: BSD & GPLv2+ & LGPLv2.1+ & MIT
ffmpeg-staticdev: BSD & GPLv2+ & LGPLv2.1+ & MIT
ffmpeg-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
ffmpeg-doc: BSD & GPLv2+ & LGPLv2.1+ & MIT
ffmpeg-locale: BSD & GPLv2+ & LGPLv2.1+ & MIT
ffmpeg: GPLv2+

It looks like the BSD/LGPL/MIT license statements don't end up in any packages which actually contain binaries. Is this correct?

Ross

#3 lore raw

Re: [PATCH 2/3] ffmpeg: Fix the license description

Quoted 50 lines · Ross
Quoted 16 lines · Andreas Oberritter
meta/recipes-multimedia/ffmpeg/ffmpeg_3.2.2.bb +3 -0
+LICENSE = "BSD & GPLv2+ & LGPLv2.1+ & MIT"
+LICENSE_${PN} = "GPLv2+"
+LICENSE_libavcodec = "${@bb.utils.contains('PACKAGECONFIG', 'gpl',

'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavdevice = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavfilter = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavformat = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libavutil = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"

(quoted diff) +2 -0
+LICENSE_libpostproc = "GPLv2+"
+LICENSE_libswresample = "${@bb.utils.contains('PACKAGECONFIG', 'gpl',
Quoted 4 lines

'GPLv2+', 'LGPLv2.1+', d)}"
+LICENSE_libswscale = "${@bb.utils.contains('PACKAGECONFIG', 'gpl', 'GPLv2+', 'LGPLv2.1+', d)}"

Using a script to extract the pkgdata information, I see this license information in the runtime libraries.

libswscale-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
libswresample-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
libpostproc-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
libavutil-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
libavformat-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
libavfilter-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
libavdevice-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
libavcodec-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
libswscale: GPLv2+
libswresample: GPLv2+
libpostproc: GPLv2+
libavutil: GPLv2+
libavformat: GPLv2+
libavfilter: GPLv2+
libavdevice: GPLv2+
libavcodec: GPLv2+
ffmpeg-dbg: BSD & GPLv2+ & LGPLv2.1+ & MIT
ffmpeg-staticdev: BSD & GPLv2+ & LGPLv2.1+ & MIT
ffmpeg-dev: BSD & GPLv2+ & LGPLv2.1+ & MIT
ffmpeg-doc: BSD & GPLv2+ & LGPLv2.1+ & MIT
ffmpeg-locale: BSD & GPLv2+ & LGPLv2.1+ & MIT
ffmpeg: GPLv2+

Quoted 2 lines

It looks like the BSD/LGPL/MIT license statements don't end up in any packages which actually contain binaries. Is this correct?

Yes, because LICENSE describes the source licenses, whereas LICENSE_.* describes licenses of binary packages [1].

The binary packages contain combined work. Quoted from FFmpeg's docs (LICENSE.md):

„Most files in FFmpeg 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 FFmpeg.“

If you disable the 'gpl' PACKAGECONFIG knob, the binary packages will get the LGPLv2+ license tag (except for libpostproc), and slightly reduced functionality.

Regards,
Andreas

[1]: http://www.yoctoproject.org/docs/current/ref-manual/ref-manual.html#var-LICENSE

#4 lore raw

PATCH 3/3 ffmpeg: Build libpostproc even if global gpl flag is unset

In reply to Andreas Oberritter

The libpostproc package has an explicit GPLv2+ license tag.

---
 ...figure-allow-libpostproc-without-gpl-flag.patch | 34 ++++++++++++++++++++++
 meta/recipes-multimedia/ffmpeg/ffmpeg_3.2.2.bb     |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/0002-configure-allow-libpostproc-without-gpl-flag.patch
meta/recipes-multimedia/ffmpeg/ffmpeg/0002-configure-allow-libpostproc-without-gpl-flag.patch new file +34 -0
new file mode 100644
index 0000000..dc11f34
@@ -0,0 +1,34 @@
+Upstream-Status: inappropriate [distro-specific]
+
+Signed-off-by: Andreas Oberritter <[email protected]>
+
+From 9c28ed17d1184ee95819e4c576373c20fe2c3600 Mon Sep 17 00:00:00 2001
+From: Andreas Oberritter <[email protected]>
+Date: Sat, 11 Feb 2017 22:57:42 +0100
+Subject: [PATCH] configure: allow libpostproc without gpl flag
+
+There may be GPL'ed programs in a distribution which want libpostproc,
+while other GPL-incompatible programs use some of the other libraries
+provided by ffmpeg.
+
+Since we know the license of libpostproc, we mark the resulting binary
+package accordingly instead of refusing to build it.
+
+Signed-off-by: Andreas Oberritter <[email protected]>
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index d60ffd8..cd53e6c 100755
+--- a/configure
++++ b/configure
+@@ -3135,7 +3135,7 @@ avdevice_deps="avformat avcodec avutil"
+ avfilter_deps="avutil"
+ avformat_deps="avcodec avutil"
+ avresample_deps="avutil"
+-postproc_deps="avutil gpl"
++postproc_deps="avutil"
+ swresample_deps="avutil"
+ swscale_deps="avutil"
+ 
meta/recipes-multimedia/ffmpeg/ffmpeg_3.2.2.bb +1 -0
index dc33bb4..555c72b 100644
@@ -26,6 +26,7 @@ LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
 SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \
            file://mips64_cpu_detection.patch \
            file://0001-avutil-log-avoid-build-error-if-valgrind-was-removed.patch \
+           file://0002-configure-allow-libpostproc-without-gpl-flag.patch \
           "
 SRC_URI[md5sum] = "e34d1b92c5d844f2a3611c741a6dba18"
 SRC_URI[sha256sum] = "3f01bd1fe1a17a277f8c84869e5d9192b4b978cb660872aa2b54c3cc8a2fedfc"
Signature · 1 line
2.7.4
#5 lore raw

Re: [PATCH 3/3] ffmpeg: Build libpostproc even if global gpl flag is unset

Quoted 20 lines · Andreas Oberritter

The libpostproc package has an explicit GPLv2+ license tag.

---
 ...figure-allow-libpostproc-without-gpl-flag.patch | 34 ++++++++++++++++++++++
 meta/recipes-multimedia/ffmpeg/ffmpeg_3.2.2.bb     |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/0002-configure-allow-libpostproc-without-gpl-flag.patch
meta/recipes-multimedia/ffmpeg/ffmpeg/0002-configure-allow-libpostproc-without-gpl-flag.patch new file +5 -0
new file mode 100644
index 0000000..dc11f34
@@ -0,0 +1,34 @@
+Upstream-Status: inappropriate [distro-specific]
+
+Signed-off-by: Andreas Oberritter <[email protected]>
+
+From 9c28ed17d1184ee95819e4c576373c20fe2c3600 Mon Sep 17 00:00:00 2001

meta/recipes-multimedia/ffmpeg/ffmpeg/0002-configure-allow-libpostproc-without-gpl-flag.patch line 15

Quoted 10 lines
meta/recipes-multimedia/ffmpeg/ffmpeg/0002-configure-allow-libpostproc-without-gpl-flag.patch new file +10 -0
+From: Andreas Oberritter <[email protected]>
+Date: Sat, 11 Feb 2017 22:57:42 +0100
+Subject: [PATCH] configure: allow libpostproc without gpl flag
+
+There may be GPL'ed programs in a distribution which want libpostproc,
+while other GPL-incompatible programs use some of the other libraries
+provided by ffmpeg.
+
+Since we know the license of libpostproc, we mark the resulting binary
+package accordingly instead of refusing to build it.

this changes the documented behavior IMO we should discuss it upstream otherwise it will be hard to explain this to legal people.

Quoted 39 lines
meta/recipes-multimedia/ffmpeg/ffmpeg/0002-configure-allow-libpostproc-without-gpl-flag.patch new file +19 -0
+
+Signed-off-by: Andreas Oberritter <[email protected]>
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index d60ffd8..cd53e6c 100755
+--- a/configure
++++ b/configure
+@@ -3135,7 +3135,7 @@ avdevice_deps="avformat avcodec avutil"
+ avfilter_deps="avutil"
+ avformat_deps="avcodec avutil"
+ avresample_deps="avutil"
+-postproc_deps="avutil gpl"
++postproc_deps="avutil"
+ swresample_deps="avutil"
+ swscale_deps="avutil"
+
meta/recipes-multimedia/ffmpeg/ffmpeg_3.2.2.bb +1 -1
index dc33bb4..555c72b 100644
@@ -26,6 +26,7 @@ LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
 SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \
            file://mips64_cpu_detection.patch \
            file://0001-avutil-log-avoid-build-error-if-valgrind-was-removed.patch \
+           file://0002-configure-allow-libpostproc-without-gpl-flag.patch \
           "
 SRC_URI[md5sum] = "e34d1b92c5d844f2a3611c741a6dba18"
 SRC_URI[sha256sum] = "3f01bd1fe1a17a277f8c84869e5d9192b4b978cb660872aa2b54c3cc8a2fedfc"
--

2.7.4

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

#6 lore raw

Re: [PATCH 3/3] ffmpeg: Build libpostproc even if global gpl flag is unset

Quoted 28 lines · On Thu, 16 Feb 2017 07:39:17 -0800 Khem Raj <[email protected]> wrote:
Quoted 26 lines · Andreas Oberritter

The libpostproc package has an explicit GPLv2+ license tag.

---
 ...figure-allow-libpostproc-without-gpl-flag.patch | 34 ++++++++++++++++++++++
 meta/recipes-multimedia/ffmpeg/ffmpeg_3.2.2.bb     |  1 +
 2 files changed, 35 insertions(+)
 create mode 100644 meta/recipes-multimedia/ffmpeg/ffmpeg/0002-configure-allow-libpostproc-without-gpl-flag.patch
meta/recipes-multimedia/ffmpeg/ffmpeg/0002-configure-allow-libpostproc-without-gpl-flag.patch new file +11 -0
new file mode 100644
index 0000000..dc11f34
@@ -0,0 +1,34 @@
+Upstream-Status: inappropriate [distro-specific]
+
+Signed-off-by: Andreas Oberritter <[email protected]>
+
+From 9c28ed17d1184ee95819e4c576373c20fe2c3600 Mon Sep 17 00:00:00 2001
+From: Andreas Oberritter <[email protected]>
+Date: Sat, 11 Feb 2017 22:57:42 +0100
+Subject: [PATCH] configure: allow libpostproc without gpl flag
+
+There may be GPL'ed programs in a distribution which want libpostproc,
+while other GPL-incompatible programs use some of the other libraries
Quoted 8 lines

meta/recipes-multimedia/ffmpeg/ffmpeg/0002-configure-allow-libpostproc-without-gpl-flag.patch line 15

Quoted 4 lines
meta/recipes-multimedia/ffmpeg/ffmpeg/0002-configure-allow-libpostproc-without-gpl-flag.patch new file +4 -0
+provided by ffmpeg.
+
+Since we know the license of libpostproc, we mark the resulting binary
+package accordingly instead of refusing to build it.  

this changes the documented behavior IMO we should discuss it upstream otherwise it will be hard to explain this to legal people.

Really? I don't see why. There's no difference to any other GPL package we build. The documentation says libpostroc is GPL'ed. The recipe does the same. No surprises for legal people involved.

I'm not going to annoy upstream with this, because this change is not suitable for upstream. That's why it carries the 'inappropriate' tag.

Regards,
Andreas

Quoted 40 lines
Quoted 40 lines
meta/recipes-multimedia/ffmpeg/ffmpeg/0002-configure-allow-libpostproc-without-gpl-flag.patch new file +19 -0
+
+Signed-off-by: Andreas Oberritter <[email protected]>
+---
+ configure | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index d60ffd8..cd53e6c 100755
+--- a/configure
++++ b/configure
+@@ -3135,7 +3135,7 @@ avdevice_deps="avformat avcodec avutil"
+ avfilter_deps="avutil"
+ avformat_deps="avcodec avutil"
+ avresample_deps="avutil"
+-postproc_deps="avutil gpl"
++postproc_deps="avutil"
+ swresample_deps="avutil"
+ swscale_deps="avutil"
+
meta/recipes-multimedia/ffmpeg/ffmpeg_3.2.2.bb +1 -1
index dc33bb4..555c72b 100644
@@ -26,6 +26,7 @@ LIC_FILES_CHKSUM = "file://COPYING.GPLv2;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
 SRC_URI = "https://www.ffmpeg.org/releases/${BP}.tar.xz \
            file://mips64_cpu_detection.patch \
            file://0001-avutil-log-avoid-build-error-if-valgrind-was-removed.patch \
+           file://0002-configure-allow-libpostproc-without-gpl-flag.patch \
           "
 SRC_URI[md5sum] = "e34d1b92c5d844f2a3611c741a6dba18"
 SRC_URI[sha256sum] = "3f01bd1fe1a17a277f8c84869e5d9192b4b978cb660872aa2b54c3cc8a2fedfc"
--

2.7.4

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