[meta-freescale] [PATCH v3 20/43] fsl-eula: Extend EULA-based archive support

Tom Hochstein tom.hochstein at nxp.com
Tue Aug 7 08:42:12 PDT 2018


Define a common naming scheme and a common unpacking scheme.

Signed-off-by: Tom Hochstein <tom.hochstein at nxp.com>
---
 classes/fsl-eula-graphics.bbclass |  9 +++++++++
 classes/fsl-eula-unpack2.bbclass  | 36 ++++++++++++++++++++++++++++++++++++
 classes/fsl-eula.bbclass          | 29 +++++++++++++++++++++++++++++
 3 files changed, 74 insertions(+)
 create mode 100644 classes/fsl-eula-graphics.bbclass
 create mode 100644 classes/fsl-eula-unpack2.bbclass
 create mode 100644 classes/fsl-eula.bbclass

diff --git a/classes/fsl-eula-graphics.bbclass b/classes/fsl-eula-graphics.bbclass
new file mode 100644
index 0000000..1feb7bb
--- /dev/null
+++ b/classes/fsl-eula-graphics.bbclass
@@ -0,0 +1,9 @@
+# fsl-eula-graphics.bbclass extends the naming scheme in fsl-eula.bbclass
+# to allow for graphics-backend-specific archives.
+IMX_PACKAGE_NAME_APPEND = ""
+IMX_PACKAGE_NAME_APPEND_class-target = \
+    "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '-wayland', \
+        bb.utils.contains('DISTRO_FEATURES',     'x11',     '-x11', \
+                                                             '-fb', d), d)}"
+IMX_PACKAGE_NAME_append_class-target = "${IMX_PACKAGE_NAME_APPEND}"
+SRC_URI_NAME_append_class-target     = "${IMX_PACKAGE_NAME_APPEND}"
diff --git a/classes/fsl-eula-unpack2.bbclass b/classes/fsl-eula-unpack2.bbclass
new file mode 100644
index 0000000..4bd7b86
--- /dev/null
+++ b/classes/fsl-eula-unpack2.bbclass
@@ -0,0 +1,36 @@
+# fsl-eula-unpack2.bbclass provides a mechanism for a) unpacking certain
+# EULA-licensed archives downloaded by HTTP and b) handling the EULA
+# acceptance.
+
+inherit fsl-eula-unpack fsl-eula
+
+IMX_PACKAGE_VERSION = "${PV}"
+
+SRC_URI = "${FSL_MIRROR}${IMX_PACKAGE_NAME}.bin;name=${SRC_URI_NAME};fsl-eula=true"
+
+S = "${WORKDIR}/${IMX_PACKAGE_NAME}"
+
+# For native apps, insert the user-local sysroot path
+# For nativesdk apps, insert the correct distro folder
+D_SUBDIR                 = ""
+D_SUBDIR_class-native    = "${STAGING_DIR_NATIVE}"
+D_SUBDIR_class-nativesdk = "/opt/${DISTRO}"
+
+# SCR is the location and name of the Software Content Register file
+# relative to ${D}${D_SUBDIR}.
+SCR = "SCR.txt"
+
+do_install () {
+    install -d ${D}${D_SUBDIR}
+    cp -r ${S}/* ${D}${D_SUBDIR}
+    if [ -d "${D}/usr/lib" ] && [ "${D}/usr/lib" != "${D}${libdir}" ]; then
+        mv ${D}/usr/lib ${D}${libdir}
+    fi
+    rm ${D}${D_SUBDIR}/COPYING
+    if [ ! -f ${D}${D_SUBDIR}/${SCR} ]; then
+        bbfatal "Missing Software Content Register \"${D}${D_SUBDIR}/${SCR}\""
+    fi
+    rm ${D}${D_SUBDIR}/${SCR}
+}
+
+FILES_${PN} = "/"
diff --git a/classes/fsl-eula.bbclass b/classes/fsl-eula.bbclass
new file mode 100644
index 0000000..0e65ee8
--- /dev/null
+++ b/classes/fsl-eula.bbclass
@@ -0,0 +1,29 @@
+# fsl-eula.bbclass defines a common naming scheme used by the
+# packing and unpacking mechanisms defined in fsl-eula-pack.bbclass
+# and fsl-eula-unpack2.bbclass.
+#
+# Note that it is not necessary to inherit this class directly. It is
+# already inherited from fsl-eula-pack.bbclass and fsl-eula-unpack2.bbclass.
+#
+# The naming scheme takes into account the fact that a single software
+# package can create many archives based on the combinations of a) target
+# versus native/nativesdk components, and b) the target or native architecture.
+# The naming scheme can be extended through regular bitbake means to allow
+# configuration-specific archives, as can be seen in fsl-eula-graphics.bbclass.
+
+# The variable IMX_PACKAGE_NAME gives a unique name for every possible
+# archive. The variable is built from a combination of the package name ${PN},
+# the version ${IMX_PACKAGE_VERSION} and the target or native architecture,
+# ${TARGET_ARCH} or ${BUILD_ARCH}.
+IMX_PACKAGE_NAME                 = "${BPN}-${IMX_PACKAGE_VERSION}-${TARGET_ARCH}"
+IMX_PACKAGE_NAME_class-native    = "${PN}-${IMX_PACKAGE_VERSION}-${BUILD_ARCH}"
+IMX_PACKAGE_NAME_class-nativesdk = "${PN}-${IMX_PACKAGE_VERSION}-${BUILD_ARCH}"
+
+# The variable SRC_URI_NAME gives a unique SRC_URI name option for use in
+# unpacking recipes derived from fsl-eula-unpack2.bbclass. With this name,
+# a single unpacking recipe can handle all possible archives. The name is
+# built from with a combination of target or native architecture,
+# ${TARGET_ARCH} or ${BUILD_ARCH}, and a native or nativesdk designation.
+SRC_URI_NAME                 = "${TARGET_ARCH}"
+SRC_URI_NAME_class-native    = "${BUILD_ARCH}-native"
+SRC_URI_NAME_class-nativesdk = "${BUILD_ARCH}-nativesdk"
-- 
2.7.4



More information about the meta-freescale mailing list