├── .github └── workflows │ └── backport.yaml ├── .gitignore ├── LICENSE ├── README ├── conf ├── distro │ ├── fsl-framebuffer.conf │ ├── fsl-wayland.conf │ ├── fsl-xwayland.conf │ ├── fslc-framebuffer.conf │ ├── fslc-wayland.conf │ ├── fslc-x11.conf │ ├── fslc-xwayland.conf │ └── include │ │ ├── fsl-base.inc │ │ └── fslc-base.inc └── layer.conf ├── recipes-devtools ├── half │ └── half_2.1.0.bb └── stb │ └── stb_git.bb ├── recipes-fsl ├── fsl-rc-local │ ├── fsl-rc-local.bb │ └── fsl-rc-local │ │ ├── LICENSE │ │ ├── rc.local.etc │ │ └── rc.local.init ├── images │ ├── fsl-image-machine-test.bb │ ├── fsl-image-multimedia-full.bb │ ├── fsl-image-multimedia.bb │ └── fsl-image-network-full-cmdline.bb └── packagegroups │ ├── packagegroup-fsl-gstreamer1.0-commercial.bb │ ├── packagegroup-fsl-gstreamer1.0-full.bb │ ├── packagegroup-fsl-gstreamer1.0.bb │ ├── packagegroup-fsl-network.bb │ ├── packagegroup-fsl-tools-benchmark.bb │ ├── packagegroup-fsl-tools-gpu-external.bb │ ├── packagegroup-fsl-tools-gpu.bb │ ├── packagegroup-fsl-tools-testapps.bb │ └── packagegroup-imx-tools-audio.bb ├── recipes-graphics ├── devil │ └── devil_1.8.0.bb ├── gli │ └── gli_0.8.4.0.bb ├── glm │ └── glm_%.bbappend ├── imx-gpu-sdk │ ├── imx-gpu-sdk-src.inc │ ├── imx-gpu-sdk_6.1.1.bb │ └── libxdg-shell.bb ├── rapidopencl │ └── rapidopencl_1.1.0.1.bb ├── rapidopenvx │ └── rapidopenvx_1.1.0.bb ├── rapidvulkan │ └── rapidvulkan_1.2.162.0.bb └── vulkan │ ├── assimp │ ├── 0001-assimp-remove-shared-lib-from-_IMPORT_CHECK_TARGETS.patch │ ├── 0001-closes-https-github.com-assimp-assimp-issues-2733-up.patch │ └── use-GNUInstallDirs-where-possible.patch │ └── assimp_5.0.1.bb └── recipes-multimedia └── gstreamer └── gst-variable-rtsp-server_1.0.bb /.github/workflows/backport.yaml: -------------------------------------------------------------------------------- 1 | name: Backport labeled merged pull requests 2 | on: 3 | pull_request_target: 4 | types: [closed] 5 | jobs: 6 | build: 7 | name: Create backport PRs 8 | runs-on: ubuntu-latest 9 | # Only run when pull request is merged 10 | # or when a comment containing `/backport` is created 11 | if: github.event.pull_request.merged 12 | steps: 13 | - uses: actions/checkout@v2 14 | with: 15 | # Required to find all branches 16 | fetch-depth: 0 17 | - name: Create backport PRs 18 | # Should be kept in sync with `version` 19 | uses: zeebe-io/backport-action@v0.0.4 20 | with: 21 | # Required 22 | # Version of the backport-action 23 | # Must equal the version in `uses` 24 | # Recommended: latest tag or `master` 25 | version: v0.0.4 26 | 27 | github_token: ${{ secrets.GITHUB_TOKEN }} 28 | github_workspace: ${{ github.workspace }} 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | *.bak 3 | *.orig 4 | *.rej 5 | *.swp 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | # License Information for meta-freescale-distro Layer 2 | 3 | This file lists all the licenses used by the recipes in this layer. 4 | 5 | ## MIT License 6 | - recipes-devtools/half/half_2.1.0.bb 7 | - recipes-devtools/stb/stb_git.bb 8 | - recipes-fsl/images/fsl-image-machine-test.bb 9 | - recipes-fsl/images/fsl-image-multimedia.bb 10 | - recipes-fsl/packagegroups/packagegroup-fsl-gstreamer1.0-commercial.bb 11 | - recipes-fsl/packagegroups/packagegroup-fsl-gstreamer1.0-full.bb 12 | - recipes-fsl/packagegroups/packagegroup-fsl-network.bb 13 | - recipes-fsl/packagegroups/packagegroup-fsl-tools-benchmark.bb 14 | - recipes-fsl/packagegroups/packagegroup-fsl-tools-gpu-external.bb 15 | - recipes-fsl/packagegroups/packagegroup-fsl-tools-gpu.bb 16 | - recipes-fsl/packagegroups/packagegroup-fsl-tools-testapps.bb 17 | - recipes-fsl/packagegroups/packagegroup-imx-tools-audio.bb 18 | - recipes-graphics/gli/gli_0.8.4.0.bb 19 | 20 | ## LGPL-2.0-only License 21 | - recipes-fsl/fsl-rc-local/fsl-rc-local.bb 22 | 23 | ## LGPL-2.1-only License 24 | - recipes-graphics/devil/devil_1.8.0.bb 25 | 26 | ## BSD-3-Clause License 27 | - recipes-graphics/imx-gpu-sdk/imx-gpu-sdk_6.1.1.bb 28 | - recipes-graphics/imx-gpu-sdk/libxdg-shell.bb 29 | - recipes-graphics/rapidopencl/rapidopencl_1.1.0.1.bb 30 | - recipes-graphics/rapidopenvx/rapidopenvx_1.1.0.bb 31 | - recipes-graphics/vulkan/assimp_5.0.1.bb 32 | 33 | ## GPL-3.0-only License 34 | - recipes-multimedia/gstreamer/gst-variable-rtsp-server_1.0.bb 35 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | OpenEmbedded/Yocto layer for Freescale's Distribution images 2 | ============================================================= 3 | 4 | This layer provides support for Freescale's Demonstration images for 5 | use with OpenEmbedded and/or Yocto Freescale's BSP layer. 6 | 7 | This layer depends on: 8 | 9 | URI: git://git.openembedded.org/openembedded-core 10 | branch: master 11 | revision: HEAD 12 | 13 | URI: git://git.openembedded.org/meta-openembedded 14 | branch: master 15 | revision: HEAD 16 | 17 | URI: git://git.yoctoproject.org/meta-freescale 18 | branch: master 19 | revision: HEAD 20 | 21 | Contributing 22 | ------------ 23 | 24 | Please submit any patches against the `meta-freescale-distro` layer by 25 | using the GitHub pull-request feature. Fork the repo, make a branch, 26 | do the work, rebase from upstream, create the pull request. 27 | 28 | For some useful guidelines to be followed when submitting patches, 29 | please refer to: 30 | http://openembedded.org/wiki/Commit_Patch_Message_Guidelines 31 | 32 | Pull requests will be discussed within the GitHub pull-request 33 | infrastructure. If you want to get informed on new PRs and the 34 | follow-up discussions please use GitHub's notification system. 35 | 36 | Mailing list: 37 | 38 | https://lists.yoctoproject.org/listinfo/meta-freescale 39 | 40 | Source code: 41 | 42 | https://github.com/Freescale/meta-freescale-distro 43 | -------------------------------------------------------------------------------- /conf/distro/fsl-framebuffer.conf: -------------------------------------------------------------------------------- 1 | # FSL Distro for FrameBuffer graphical backend. 2 | 3 | require conf/distro/include/fsl-base.inc 4 | 5 | DISTRO = "fsl-framebuffer" 6 | DISTRO_NAME = "FSL FrameBuffer" 7 | 8 | # Remove conflicting backends. 9 | DISTRO_FEATURES:remove = "x11 wayland directfb vulkan " 10 | -------------------------------------------------------------------------------- /conf/distro/fsl-wayland.conf: -------------------------------------------------------------------------------- 1 | # FSL Distro for Wayland. 2 | 3 | require conf/distro/include/fsl-base.inc 4 | 5 | DISTRO = "fsl-wayland" 6 | DISTRO_NAME = "FSL Wayland" 7 | 8 | # Define Init System 9 | INIT_MANAGER = "systemd" 10 | 11 | # Remove conflicting backends 12 | DISTRO_FEATURES:remove = "directfb x11" 13 | DISTRO_FEATURES:append = " wayland pam" 14 | -------------------------------------------------------------------------------- /conf/distro/fsl-xwayland.conf: -------------------------------------------------------------------------------- 1 | # FSL Distro for Wayland with XWayland. 2 | 3 | require conf/distro/include/fsl-base.inc 4 | 5 | DISTRO = "fsl-xwayland" 6 | DISTRO_NAME = "FSL Wayland with XWayland" 7 | 8 | # Define Init System 9 | INIT_MANAGER = "systemd" 10 | 11 | # Remove conflicting backends 12 | DISTRO_FEATURES:remove = "directfb" 13 | DISTRO_FEATURES:append = " x11 wayland pam" 14 | -------------------------------------------------------------------------------- /conf/distro/fslc-framebuffer.conf: -------------------------------------------------------------------------------- 1 | # FSLC Distro for FrameBuffer graphical backend. 2 | 3 | require conf/distro/include/fslc-base.inc 4 | 5 | DISTRO = "fslc-framebuffer" 6 | DISTRO_NAME = "FSLC FrameBuffer" 7 | 8 | # Remove conflicting backends. 9 | DISTRO_FEATURES:remove = "x11 wayland directfb vulkan" 10 | -------------------------------------------------------------------------------- /conf/distro/fslc-wayland.conf: -------------------------------------------------------------------------------- 1 | # FSLC Distro for Wayland. 2 | 3 | require conf/distro/include/fslc-base.inc 4 | 5 | DISTRO = "fslc-wayland" 6 | DISTRO_NAME = "FSLC Wayland" 7 | 8 | # Define Init System 9 | INIT_MANAGER = "systemd" 10 | 11 | # Remove conflicting backends 12 | DISTRO_FEATURES:remove = "directfb x11" 13 | DISTRO_FEATURES:append = " wayland pam" 14 | -------------------------------------------------------------------------------- /conf/distro/fslc-x11.conf: -------------------------------------------------------------------------------- 1 | # FSLC Distro for X11 without wayland. 2 | 3 | require conf/distro/include/fslc-base.inc 4 | 5 | DISTRO = "fslc-x11" 6 | DISTRO_NAME = "FSLC X11" 7 | 8 | # Remove conflicting backends. 9 | DISTRO_FEATURES:remove = "wayland " 10 | 11 | # These are X11 specific 12 | DISTRO_FEATURES:append = " x11" 13 | -------------------------------------------------------------------------------- /conf/distro/fslc-xwayland.conf: -------------------------------------------------------------------------------- 1 | # FSLC Distro for Wayland with XWayland. 2 | 3 | require conf/distro/include/fslc-base.inc 4 | 5 | DISTRO = "fslc-xwayland" 6 | DISTRO_NAME = "FSLC Wayland with XWayland" 7 | 8 | # Define Init System 9 | INIT_MANAGER = "systemd" 10 | 11 | # Remove conflicting backends 12 | DISTRO_FEATURES:remove = "directfb" 13 | DISTRO_FEATURES:append = " x11 wayland pam" 14 | -------------------------------------------------------------------------------- /conf/distro/include/fsl-base.inc: -------------------------------------------------------------------------------- 1 | require conf/distro/include/fslc-base.inc 2 | 3 | DISTRO = "fsl-base" 4 | DISTRO_NAME = "FSL Distro Base" 5 | SDK_VENDOR = "-fslsdk" 6 | 7 | MAINTAINER = "Freescale Semiconductors " 8 | 9 | TARGET_VENDOR = "-fsl" 10 | 11 | DISTROOVERRIDES = "fsl" 12 | 13 | # Use NXP BSP and u-boot for default 14 | IMX_DEFAULT_BSP = "nxp" 15 | IMX_DEFAULT_BOOTLOADER = "u-boot-imx" 16 | 17 | # The following set the providers to components supported by NXP 18 | # Use i.MX Kernel and Gstreamer 1.0 providers 19 | PREFERRED_PROVIDER_virtual/kernel:mx6-nxp-bsp = "linux-imx" 20 | PREFERRED_PROVIDER_virtual/kernel:mx7-nxp-bsp = "linux-imx" 21 | PREFERRED_PROVIDER_virtual/kernel:mx8-nxp-bsp = "linux-imx" 22 | PREFERRED_PROVIDER_virtual/kernel:mx9-nxp-bsp = "linux-imx" 23 | 24 | MACHINE_GSTREAMER_1_0_PLUGIN:mx6-nxp-bsp = "imx-gst1.0-plugin" 25 | MACHINE_GSTREAMER_1_0_PLUGIN:mx7-nxp-bsp = "imx-gst1.0-plugin" 26 | MACHINE_GSTREAMER_1_0_PLUGIN:mx8-nxp-bsp = "imx-gst1.0-plugin" 27 | MACHINE_GSTREAMER_1_0_PLUGIN:mx9-nxp-bsp = "imx-gst1.0-plugin" 28 | 29 | PREFERRED_VERSION_ffmpeg = "4.4.1" 30 | 31 | # GStreamer forked recipes 32 | PREFERRED_VERSION_gstreamer1.0 ??= "1.24.7.imx" 33 | PREFERRED_VERSION_gstreamer1.0-plugins-bad ??= "1.24.7.imx" 34 | PREFERRED_VERSION_gstreamer1.0-plugins-base ??= "1.24.7.imx" 35 | PREFERRED_VERSION_gstreamer1.0-plugins-good ??= "1.24.7.imx" 36 | 37 | # GStreamer copied recipes 38 | PREFERRED_VERSION_gst-devtools ??= "1.24.0.imx" 39 | PREFERRED_VERSION_gstreamer1.0-libav ??= "1.24.0.imx" 40 | PREFERRED_VERSION_gstreamer1.0-plugins-ugly ??= "1.24.0.imx" 41 | PREFERRED_VERSION_gstreamer1.0-python ??= "1.24.0.imx" 42 | PREFERRED_VERSION_gstreamer1.0-rtsp-server ??= "1.24.0.imx" 43 | PREFERRED_VERSION_gstreamer1.0-vaapi ??= "1.24.0.imx" 44 | 45 | # Enable allow-autospawn-for-root as default 46 | PACKAGECONFIG:append:pn-pulseaudio = " autospawn-for-root" 47 | -------------------------------------------------------------------------------- /conf/distro/include/fslc-base.inc: -------------------------------------------------------------------------------- 1 | require conf/distro/poky.conf 2 | 3 | DISTRO = "fslc-base" 4 | DISTRO_NAME = "FSLC Distro Base" 5 | DISTRO_VERSION = "5.0-snapshot-${DATE}" 6 | 7 | SDK_VENDOR = "-fslcsdk" 8 | 9 | MAINTAINER = "FSL Community Team " 10 | 11 | TARGET_VENDOR = "-fslc" 12 | 13 | DISTROOVERRIDES = "fslc" 14 | 15 | # This function changes the default tune for machines which are based on armv7a 16 | # to use common tune value 17 | def arm_tune_handler(d): 18 | features = d.getVar('TUNE_FEATURES', True).split() 19 | if 'armv7a' in features or 'armv7ve' in features: 20 | tune = 'armv7athf' 21 | if 'bigendian' in features: 22 | tune += 'b' 23 | if 'vfpv3' in features: 24 | tune += '-vfpv3' 25 | if 'vfpv3d16' in features: 26 | tune += '-vfpv3d16' 27 | if 'neon' in features: 28 | tune += '-neon' 29 | if 'vfpv4' in features: 30 | tune += '-vfpv4' 31 | else: 32 | tune = d.getVar('DEFAULTTUNE', True) 33 | return tune 34 | 35 | DEFAULTTUNE:fslc := "${@arm_tune_handler(d)}" 36 | 37 | PACKAGECONFIG:remove:pn-xserver-xorg:armv5 = "dri" 38 | 39 | # Log information on images and packages 40 | INHERIT += "buildhistory" 41 | BUILDHISTORY_COMMIT ?= "1" 42 | -------------------------------------------------------------------------------- /conf/layer.conf: -------------------------------------------------------------------------------- 1 | # We have a conf and classes directory, add to BBPATH 2 | BBPATH .= ":${LAYERDIR}" 3 | 4 | # We have a packages directory, add to BBFILES 5 | BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ 6 | ${LAYERDIR}/recipes-*/*/*.bbappend" 7 | 8 | BBFILE_COLLECTIONS += "freescale-distro" 9 | BBFILE_PATTERN_freescale-distro := "^${LAYERDIR}/" 10 | BBFILE_PRIORITY_freescale-distro = "4" 11 | 12 | LAYERDEPENDS_freescale-distro = "core yocto" 13 | 14 | LAYERSERIES_COMPAT_freescale-distro = "styhead walnascar" 15 | -------------------------------------------------------------------------------- /recipes-devtools/half/half_2.1.0.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "C++ library for half precision floating point arithmetics" 2 | DESCRIPTION = "half is a C++ header-only library to provide an IEEE-754 conformant \ 3 | half-precision floating point type along with corresponding arithmetic operators, \ 4 | type conversions and common mathematical functions." 5 | 6 | LICENSE = "MIT" 7 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=813a6278831975d26c115ed6f9c21831" 8 | 9 | SRC_URI = "https://sourceforge.net/projects/half/files/half/${PV}/${BP}.zip" 10 | SRC_URI[sha256sum] = "ad1788afe0300fa2b02b0d1df128d857f021f92ccf7c8bddd07812685fa07a25" 11 | 12 | UNPACKDIR = "${S}" 13 | 14 | do_install () { 15 | install -d ${D}${includedir} 16 | cp -r ${S}/include/* ${D}${includedir} 17 | } 18 | 19 | ALLOW_EMPTY:${PN} = "1" 20 | -------------------------------------------------------------------------------- /recipes-devtools/stb/stb_git.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "single-file public domain (or MIT licensed) libraries for C/C++" 2 | LICENSE = "MIT" 3 | LIC_FILES_CHKSUM = "file://stb.h;beginline=14418;endline=14433;md5=b10975d4c8155af1811ab611586f01d2" 4 | 5 | PV = "0.0+git${SRCPV}" 6 | 7 | SRCREV = "f67165c2bb2af3060ecae7d20d6f731173485ad0" 8 | SRC_URI = "git://github.com/nothings/stb.git;protocol=https;branch=master" 9 | 10 | S = "${WORKDIR}/git" 11 | 12 | do_install() { 13 | install -d ${D}${includedir} 14 | for hdr in ${S}/*.h; do 15 | install -m 0644 $hdr ${D}${includedir} 16 | done 17 | } 18 | 19 | # This is a header-only library, so the main package will be empty. 20 | ALLOW_EMPTY:${PN} = "1" 21 | -------------------------------------------------------------------------------- /recipes-fsl/fsl-rc-local/fsl-rc-local.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012 O.S. Systems Software LTDA. 2 | 3 | DESCRIPTION = "Extra files for fsl-gui-image" 4 | LICENSE = "LGPL-2.0-only" 5 | LIC_FILES_CHKSUM = "file://LICENSE;md5=39ec502560ab2755c4555ee8416dfe42" 6 | 7 | SRC_URI = "file://rc.local.etc \ 8 | file://rc.local.init \ 9 | file://LICENSE" 10 | 11 | UNPACKDIR = "${S}" 12 | 13 | inherit update-rc.d 14 | 15 | INITSCRIPT_NAME = "rc.local" 16 | INITSCRIPT_PARAMS = "start 99 2 3 4 5 ." 17 | 18 | do_install () { 19 | install -d ${D}/${sysconfdir}/init.d 20 | install -m 755 ${S}/rc.local.etc ${D}/${sysconfdir}/rc.local 21 | install -m 755 ${S}/rc.local.init ${D}/${sysconfdir}/init.d/rc.local 22 | 23 | } 24 | -------------------------------------------------------------------------------- /recipes-fsl/fsl-rc-local/fsl-rc-local/LICENSE: -------------------------------------------------------------------------------- 1 | All content inside fsl-rc-local package are distributed under GPLv2 license 2 | -------------------------------------------------------------------------------- /recipes-fsl/fsl-rc-local/fsl-rc-local/rc.local.etc: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | # 3 | # rc.local 4 | # 5 | # This script is executed at the end of each multiuser runlevel. 6 | # Make sure that the script will "exit 0" on success or any other 7 | # value on error. 8 | # 9 | # In order to enable or disable this script just change the execution 10 | # bits. 11 | # 12 | # By default this script does nothing. 13 | 14 | exit 0 15 | -------------------------------------------------------------------------------- /recipes-fsl/fsl-rc-local/fsl-rc-local/rc.local.init: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | ### BEGIN INIT INFO 3 | # Provides: rc.local 4 | # Required-Start: $all 5 | # Required-Stop: 6 | # Default-Start: 2 3 4 5 7 | # Default-Stop: 8 | # Short-Description: Run /etc/rc.local if it exist 9 | ### END INIT INFO 10 | 11 | PATH=/sbin:/usr/sbin:/bin:/usr/bin 12 | 13 | do_start() { 14 | if [ -x /etc/rc.local ]; then 15 | echo -n "Running local boot scripts (/etc/rc.local)" 16 | /etc/rc.local 17 | [ $? = 0 ] && echo "." || echo "error" 18 | return $ES 19 | fi 20 | } 21 | 22 | case "$1" in 23 | start) 24 | do_start 25 | ;; 26 | restart|reload|force-reload) 27 | echo "Error: argument '$1' not supported" >&2 28 | exit 3 29 | ;; 30 | stop) 31 | ;; 32 | *) 33 | echo "Usage: $0 start|stop" >&2 34 | exit 3 35 | ;; 36 | esac 37 | -------------------------------------------------------------------------------- /recipes-fsl/images/fsl-image-machine-test.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "A console-only image that includes gstreamer packages, \ 2 | Freescale's multimedia packages (VPU and GPU) when available, and \ 3 | test and benchmark applications." 4 | 5 | IMAGE_FEATURES += " \ 6 | ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '', \ 7 | bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11-base', \ 8 | '', d), d)} \ 9 | debug-tweaks \ 10 | tools-testapps \ 11 | tools-profile \ 12 | " 13 | 14 | LICENSE = "MIT" 15 | 16 | inherit core-image 17 | 18 | CORE_IMAGE_EXTRA_INSTALL += " \ 19 | packagegroup-fsl-gstreamer1.0 \ 20 | packagegroup-fsl-gstreamer1.0-full \ 21 | packagegroup-fsl-tools-gpu \ 22 | packagegroup-fsl-tools-gpu-external \ 23 | packagegroup-fsl-tools-testapps \ 24 | packagegroup-fsl-tools-benchmark \ 25 | ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', \ 26 | 'firmwared', '', d)} \ 27 | ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', \ 28 | 'weston weston-init', '', d)} \ 29 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', \ 30 | 'weston-xwayland xterm', '', d)} \ 31 | " 32 | -------------------------------------------------------------------------------- /recipes-fsl/images/fsl-image-multimedia-full.bb: -------------------------------------------------------------------------------- 1 | # This image extends fsl-image-multimedia with additional 2 | # gstreamer plugins 3 | 4 | require fsl-image-multimedia.bb 5 | 6 | CORE_IMAGE_EXTRA_INSTALL += " \ 7 | packagegroup-fsl-gstreamer1.0-full \ 8 | " 9 | -------------------------------------------------------------------------------- /recipes-fsl/images/fsl-image-multimedia.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "A console-only image that includes gstreamer packages and \ 2 | Freescale's multimedia packages (VPU and GPU) when available for the specific \ 3 | machine." 4 | 5 | IMAGE_FEATURES += "\ 6 | ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'weston', \ 7 | bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11-base', \ 8 | '', d), d)} \ 9 | " 10 | 11 | LICENSE = "MIT" 12 | 13 | inherit core-image 14 | 15 | CORE_IMAGE_EXTRA_INSTALL += " \ 16 | packagegroup-fsl-tools-gpu \ 17 | packagegroup-fsl-gstreamer1.0 \ 18 | packagegroup-imx-tools-audio \ 19 | ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', \ 20 | 'weston weston-init weston-examples \ 21 | gtk+3-demo', '', d)} \ 22 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', \ 23 | 'weston-xwayland xterm', '', d)} \ 24 | " 25 | 26 | PACKAGE_IMX_TO_REMOVE = "" 27 | PACKAGE_IMX_TO_REMOVE:imxgpu2d = "gtk+3-demo" 28 | PACKAGE_IMX_TO_REMOVE:imxgpu3d = "" 29 | 30 | CORE_IMAGE_EXTRA_INSTALL:remove = "${PACKAGE_IMX_TO_REMOVE}" 31 | -------------------------------------------------------------------------------- /recipes-fsl/images/fsl-image-network-full-cmdline.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "A console-only image that includes full cmdline and \ 2 | Freescale's networking packages (QorIQ DPAA/DPAA2) when available." 3 | 4 | IMAGE_FEATURES += " \ 5 | debug-tweaks \ 6 | tools-profile \ 7 | " 8 | 9 | LICENSE = "MIT" 10 | 11 | CORE_IMAGE_EXTRA_INSTALL:append = "\ 12 | packagegroup-core-boot \ 13 | packagegroup-core-full-cmdline \ 14 | packagegroup-fsl-network \ 15 | " 16 | 17 | # SPI Nor-Flash 18 | NETWORK_TOOLS:append:fsl-lsch3 = "\ 19 | mtd-utils \ 20 | " 21 | 22 | inherit core-image 23 | -------------------------------------------------------------------------------- /recipes-fsl/packagegroups/packagegroup-fsl-gstreamer1.0-commercial.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "Package group used by FSL Community to provide audio and video plugins \ 2 | that are subject to restricted licensing and/or royalties and thus require \ 3 | the 'commercial' license whitelist flag" 4 | SUMMARY = "FSL Community package group - set of GStreamer 1.0 plugins with commercial licence flag" 5 | LICENSE_FLAGS = "commercial" 6 | 7 | inherit packagegroup 8 | 9 | RDEPENDS:${PN} = " \ 10 | packagegroup-fsl-gstreamer1.0 \ 11 | " 12 | 13 | # Plugins from the -ugly collection which require the "commercial" flag in LICENSE_FLAGS_ACCEPTED to be set 14 | RDEPENDS:${PN} = " \ 15 | gstreamer1.0-plugins-ugly-asf \ 16 | gstreamer1.0-libav \ 17 | " 18 | -------------------------------------------------------------------------------- /recipes-fsl/packagegroups/packagegroup-fsl-gstreamer1.0-full.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "Package group used by FSL Community to provide all GStreamer plugins from the \ 2 | base, good, and bad packages, as well as the ugly and libav ones if commercial packages \ 3 | are whitelisted, and plugins for the required hardware acceleration (if supported by the SoC)." 4 | SUMMARY = "FSL Community package group - full set of all GStreamer 1.0 plugins" 5 | 6 | inherit packagegroup 7 | 8 | RDEPENDS:${PN} = " \ 9 | packagegroup-fsl-gstreamer1.0 \ 10 | ${@bb.utils.contains('LICENSE_FLAGS_ACCEPTED', 'commercial', 'packagegroup-fsl-gstreamer1.0-commercial', '', d)} \ 11 | gstreamer1.0-plugins-base-meta \ 12 | gstreamer1.0-plugins-good-meta \ 13 | gstreamer1.0-plugins-bad-meta \ 14 | ${@bb.utils.contains('LICENSE_FLAGS_ACCEPTED', 'commercial', 'gstreamer1.0-plugins-ugly-meta', '', d)} \ 15 | " 16 | -------------------------------------------------------------------------------- /recipes-fsl/packagegroups/packagegroup-fsl-gstreamer1.0.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "Package group used by FSL Community to provide audio, video, networking and debug \ 2 | GStreamer plugins with the required hardware acceleration (if supported by the SoC)." 3 | SUMMARY = "FSL Community package group - set of commonly used GStreamer 1.0 plugins" 4 | 5 | PACKAGE_ARCH = "${MACHINE_ARCH}" 6 | 7 | inherit packagegroup 8 | 9 | PACKAGES += " \ 10 | ${PN}-base \ 11 | ${PN}-audio \ 12 | ${PN}-video \ 13 | ${PN}-video-bad \ 14 | ${PN}-debug \ 15 | ${PN}-network-base \ 16 | ${PN}-network \ 17 | " 18 | 19 | MACHINE_GSTREAMER_1_0_PLUGIN ?= "" 20 | 21 | RDEPENDS:${PN} = " \ 22 | ${PN}-audio \ 23 | ${PN}-video \ 24 | ${PN}-network-base \ 25 | ${PN}-debug \ 26 | " 27 | 28 | # List of X11 specific plugins 29 | GST_X11_PACKAGES = " \ 30 | gstreamer1.0-plugins-base-ximagesink \ 31 | gstreamer1.0-plugins-base-xvimagesink \ 32 | " 33 | 34 | # List of Wayland specific plugins 35 | GST_WAYLAND_PACKAGES = " \ 36 | gstreamer1.0-plugins-bad-waylandsink \ 37 | " 38 | 39 | # basic plugins required in virtually every pipeline 40 | RDEPENDS:${PN}-base = " \ 41 | gstreamer1.0 \ 42 | gstreamer1.0-plugins-base-playback \ 43 | ${@bb.utils.contains('DISTRO_FEATURES', 'alsa', 'gstreamer1.0-plugins-base-alsa', '', d)} \ 44 | gstreamer1.0-plugins-base-audioconvert \ 45 | gstreamer1.0-plugins-base-audioresample \ 46 | gstreamer1.0-plugins-base-gio \ 47 | gstreamer1.0-plugins-base-typefindfunctions \ 48 | gstreamer1.0-plugins-base-videoconvertscale \ 49 | gstreamer1.0-plugins-base-volume \ 50 | gstreamer1.0-plugins-good-autodetect \ 51 | ${MACHINE_GSTREAMER_1_0_PLUGIN} \ 52 | ${@bb.utils.contains("MACHINE_GSTREAMER_1_0_PLUGIN", "imx-gst1.0-plugin", "imx-gst1.0-plugin-gplay", "", d)} \ 53 | ${@bb.utils.contains("MACHINE_GSTREAMER_1_0_PLUGIN", "imx-gst1.0-plugin", "imx-gst1.0-plugin-grecorder", "", d)} \ 54 | " 55 | 56 | RRECOMMENDS:${PN}-base = " \ 57 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', '${GST_X11_PACKAGES}', \ 58 | bb.utils.contains('DISTRO_FEATURES', 'wayland', \ 59 | '${GST_WAYLAND_PACKAGES}', '', d), d)} \ 60 | " 61 | 62 | # Basic audio plugins: parsers, demuxers, decoders 63 | RDEPENDS:${PN}-audio = " \ 64 | ${PN}-base \ 65 | gstreamer1.0-plugins-base-ogg \ 66 | gstreamer1.0-plugins-good-audioparsers \ 67 | gstreamer1.0-plugins-good-flac \ 68 | gstreamer1.0-plugins-good-icydemux \ 69 | gstreamer1.0-plugins-good-id3demux \ 70 | gstreamer1.0-plugins-good-speex \ 71 | gstreamer1.0-plugins-good-wavparse \ 72 | " 73 | 74 | # Basic video plugins: parsers, demuxers 75 | RDEPENDS:${PN}-video = " \ 76 | ${PN}-base \ 77 | gstreamer1.0-plugins-base-subparse \ 78 | gstreamer1.0-plugins-base-theora \ 79 | gstreamer1.0-plugins-good-avi \ 80 | gstreamer1.0-plugins-good-flv \ 81 | gstreamer1.0-plugins-good-isomp4 \ 82 | gstreamer1.0-plugins-good-matroska \ 83 | " 84 | 85 | RRECOMMENDS:${PN}-video = " \ 86 | ${PN}-audio \ 87 | " 88 | 89 | # Additional video plugins from the -bad collection 90 | RDEPENDS:${PN}-video-bad = " \ 91 | ${PN}-video \ 92 | gstreamer1.0-plugins-bad-mpegpsdemux \ 93 | gstreamer1.0-plugins-bad-mpegtsdemux \ 94 | gstreamer1.0-plugins-bad-videoparsersbad \ 95 | " 96 | 97 | # Plugins used for diagnostics and debugging of pipelines 98 | RDEPENDS:${PN}-debug = " \ 99 | ${PN}-base \ 100 | gstreamer1.0-plugins-base-audiotestsrc \ 101 | gstreamer1.0-plugins-base-videotestsrc \ 102 | gstreamer1.0-plugins-good-debug \ 103 | gstreamer1.0-plugins-good-navigationtest \ 104 | " 105 | 106 | # Basic networking plugins required by most pipelines that receive and/or send data 107 | RDEPENDS:${PN}-network-base = " \ 108 | gstreamer1.0-plugins-base-tcp \ 109 | gstreamer1.0-plugins-good-soup \ 110 | gstreamer1.0-plugins-good-udp \ 111 | " 112 | 113 | # Additional networking plugins 114 | RDEPENDS:${PN}-network = " \ 115 | ${PN}-network-base \ 116 | gstreamer1.0-plugins-good-rtp \ 117 | gstreamer1.0-plugins-good-rtpmanager \ 118 | gstreamer1.0-plugins-good-rtsp \ 119 | " 120 | -------------------------------------------------------------------------------- /recipes-fsl/packagegroups/packagegroup-fsl-network.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2020 Jens Rehsack 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "Package group used by FSL Community to add the packages which provide (QorIQ) networking support." 5 | SUMMARY = "FSL Community package group - networking" 6 | 7 | PACKAGE_ARCH = "${MACHINE_ARCH}" 8 | 9 | inherit packagegroup 10 | 11 | NETWORK_TOOLS = "\ 12 | ethtool \ 13 | tcpdump \ 14 | " 15 | 16 | NETWORK_TOOLS:append:qoriq = " \ 17 | ceetm \ 18 | dpdk \ 19 | ovs-dpdk \ 20 | pktgen-dpdk \ 21 | tsntool \ 22 | " 23 | 24 | # Data Place Acceleration Architecture 25 | NETWORK_TOOLS:append:fsl-lsch2 = "\ 26 | eth-config \ 27 | " 28 | 29 | # 2nd generation Data Place Acceleration Architecture 30 | NETWORK_TOOLS:append:ls1088a = "\ 31 | aiopsl \ 32 | gpp-aioptool \ 33 | ofp \ 34 | " 35 | 36 | NETWORK_TOOLS:append:ls2088a = "\ 37 | aiopsl \ 38 | gpp-aioptool \ 39 | ofp \ 40 | " 41 | 42 | NETWORK_TOOLS:append:fsl-lsch3 = "\ 43 | dce \ 44 | restool \ 45 | spc \ 46 | " 47 | 48 | RDEPENDS:${PN} = " \ 49 | ${NETWORK_TOOLS} \ 50 | " 51 | -------------------------------------------------------------------------------- /recipes-fsl/packagegroups/packagegroup-fsl-tools-benchmark.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012-2016 Freescale Semiconductor 2 | # Released under the MIT license (see COPYING.MIT for the terms) 3 | 4 | DESCRIPTION = "Package group used by FSL Community to provide a set of benchmark applications." 5 | SUMMARY = "FSL Communtiy package group - tools/benchmark" 6 | 7 | PACKAGE_ARCH = "${MACHINE_ARCH}" 8 | 9 | inherit packagegroup 10 | 11 | RDEPENDS:${PN} = " \ 12 | lmbench \ 13 | bonnie++ \ 14 | dbench \ 15 | fio \ 16 | iozone3 \ 17 | iperf3 \ 18 | nbench-byte \ 19 | tiobench \ 20 | ${@bb.utils.contains('TUNE_FEATURES', 'neon', 'cpuburn-neon', \ 21 | bb.utils.contains('TUNE_FEATURES', 'cortexa53 crypto', 'cpuburn-neon', \ 22 | '', d), d)} \ 23 | " 24 | -------------------------------------------------------------------------------- /recipes-fsl/packagegroups/packagegroup-fsl-tools-gpu-external.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2014, 2016 Freescale Semiconductor 2 | # Copyright (C) 2015, 2016 O.S. Systems Software LTDA. 3 | # Released under the MIT license (see COPYING.MIT for the terms) 4 | DESCRIPTION = "Package group used by FSL Community to provide graphic packages used \ 5 | to test the several hardware accelerated graphics APIs including packages not \ 6 | provided by Freescale." 7 | SUMMARY = "FSL Community Package group - tools/gpu/external" 8 | 9 | PACKAGE_ARCH = "${MACHINE_ARCH}" 10 | 11 | inherit packagegroup 12 | 13 | SOC_TOOLS_GPU_X11 = "" 14 | SOC_TOOLS_GPU_X11:imxgpu2d = " mesa-demos glmark2 gtkperf" 15 | 16 | SOC_TOOLS_GPU_FB = "" 17 | 18 | SOC_TOOLS_GPU_WAYLAND = "" 19 | 20 | SOC_TOOLS_GPU_XWAYLAND = "" 21 | SOC_TOOLS_GPU_XWAYLAND:imxgpu2d = "mesa-demos gtkperf" 22 | 23 | RDEPENDS:${PN} = " \ 24 | ${@bb.utils.contains("DISTRO_FEATURES", "x11 wayland", "${SOC_TOOLS_GPU_XWAYLAND}", \ 25 | bb.utils.contains("DISTRO_FEATURES", "wayland", "${SOC_TOOLS_GPU_WAYLAND}", \ 26 | bb.utils.contains("DISTRO_FEATURES", "x11", "${SOC_TOOLS_GPU_X11}", \ 27 | "${SOC_TOOLS_GPU_FB}", d), d), d)} \ 28 | " 29 | -------------------------------------------------------------------------------- /recipes-fsl/packagegroups/packagegroup-fsl-tools-gpu.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012-2014, 2016 Freescale Semiconductor 2 | # Copyright (C) 2015, 2016 O.S. Systems Software LTDA. 3 | # Released under the MIT license (see COPYING.MIT for the terms) 4 | 5 | DESCRIPTION = "Package group used by FSL Community to add the packages which provide GPU support." 6 | SUMMARY = "FSL Community package group - tools/gpu" 7 | 8 | PACKAGE_ARCH = "${MACHINE_ARCH}" 9 | 10 | inherit packagegroup 11 | 12 | SOC_TOOLS_GPU = "" 13 | 14 | # i.MX6 SoloLite does not support apitrace because of its dependency on gles2. 15 | SOC_TOOLS_GPU:imxgpu2d = " \ 16 | ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', '', \ 17 | bb.utils.contains('DISTRO_FEATURES', 'x11', 'xserver-xorg-extension-viv-autohdmi', \ 18 | '', d), d)} \ 19 | " 20 | 21 | SOC_TOOLS_GPU:append:imxgpu3d = " \ 22 | imx-gpu-apitrace \ 23 | " 24 | 25 | SOC_TOOLS_GPU:append:imxgpu = " \ 26 | imx-gpu-sdk \ 27 | imx-gpu-viv-tools \ 28 | " 29 | 30 | RDEPENDS:${PN} = " \ 31 | ${SOC_TOOLS_GPU} \ 32 | " 33 | -------------------------------------------------------------------------------- /recipes-fsl/packagegroups/packagegroup-fsl-tools-testapps.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2012-2014, 2016 Freescale Semiconductor 2 | # Copyright (C) 2015, 2016 O.S. Systems Software LTDA. 3 | # Released under the MIT license (see COPYING.MIT for the terms) 4 | 5 | DESCRIPTION = "Packagegroup used by FSL Community to provide a set of packages and utilities \ 6 | for hardware test." 7 | SUMMARY = "FSL Community packagegroup - tools/testapps" 8 | 9 | PACKAGE_ARCH = "${MACHINE_ARCH}" 10 | 11 | inherit packagegroup 12 | 13 | SOC_TOOLS_TEST = "" 14 | SOC_TOOLS_TEST:imx-nxp-bsp = "imx-test" 15 | SOC_TOOLS_TEST:imxgpu = "imx-test imx-gpu-viv-demos" 16 | SOC_TOOLS_TEST:qoriq = "ceetm optee-test-qoriq" 17 | 18 | RDEPENDS:${PN} = " \ 19 | alsa-utils \ 20 | alsa-tools \ 21 | dosfstools \ 22 | evtest \ 23 | e2fsprogs-mke2fs \ 24 | ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'fsl-rc-local', '', d)} \ 25 | fbset \ 26 | i2c-tools \ 27 | iproute2 \ 28 | memtester \ 29 | python3-core \ 30 | python3-json \ 31 | python3-datetime \ 32 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'v4l-utils', '', d)} \ 33 | ethtool \ 34 | mtd-utils \ 35 | mtd-utils-ubifs \ 36 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'gtk+3-demo', '', d)} \ 37 | ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', \ 38 | 'weston-examples', '', d)} \ 39 | ${SOC_TOOLS_TEST} \ 40 | " 41 | 42 | RDEPENDS_IMX_TO_REMOVE = "" 43 | RDEPENDS_IMX_TO_REMOVE:imxgpu3d = "" 44 | 45 | RDEPENDS:${PN}:remove = "${RDEPENDS_IMX_TO_REMOVE}" 46 | -------------------------------------------------------------------------------- /recipes-fsl/packagegroups/packagegroup-imx-tools-audio.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2015 Freescale Semiconductor 2 | # Copyright (C) 2015 O.S. Systems Software LTDA. 3 | # Released under the MIT license (see COPYING.MIT for the terms) 4 | 5 | SUMMARY = "Set of audio tools for inclusion on images" 6 | LICENSE = "MIT" 7 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302 \ 8 | file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" 9 | 10 | inherit packagegroup 11 | 12 | ALSA_INSTALL = " \ 13 | alsa-utils \ 14 | alsa-tools \ 15 | " 16 | 17 | PULSEAUDIO_INSTALL = " \ 18 | pulseaudio-server \ 19 | pulseaudio-module-cli \ 20 | pulseaudio-misc \ 21 | pulseaudio-module-device-manager \ 22 | ${@bb.utils.contains('DISTRO_FEATURES',"x11", "pulseaudio-module-x11-xsmp \ 23 | pulseaudio-module-x11-publish \ 24 | pulseaudio-module-x11-cork-request \ 25 | pulseaudio-module-x11-bell \ 26 | consolekit", \ 27 | "", d)} \ 28 | " 29 | 30 | RDEPENDS:${PN} = " \ 31 | ${@bb.utils.contains("DISTRO_FEATURES", "alsa", "${ALSA_INSTALL}", "", d)} \ 32 | ${@bb.utils.contains("DISTRO_FEATURES", "pulseaudio", "${PULSEAUDIO_INSTALL}", "", d)} \ 33 | " 34 | -------------------------------------------------------------------------------- /recipes-graphics/devil/devil_1.8.0.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "A full featured cross-platform image library" 2 | SECTION = "libs" 3 | LICENSE = "LGPL-2.1-only" 4 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/LGPL-2.1-only;md5=1a6d268fd218675ffea8be556788b780" 5 | PR = "r0" 6 | 7 | DEPENDS = "libpng jpeg tiff xz" 8 | 9 | SRC_URI = "http://sourceforge.net/projects/openil/files/DevIL/${PV}/DevIL-${PV}.zip" 10 | SRC_URI[sha256sum] = "451337f392c65bfb83698a781370534dc63d7bafca21e9b37178df0518f7e895" 11 | 12 | S = "${WORKDIR}/DevIL/DevIL" 13 | 14 | inherit cmake 15 | 16 | TARGET_CFLAGS += "-Dpng_set_gray_1_2_4_to_8=png_set_expand_gray_1_2_4_to_8" 17 | 18 | SOLIBS = ".so" 19 | FILES_SOLIBSDEV = "" 20 | 21 | PACKAGE_ARCH = "${MACHINE_ARCH}" 22 | -------------------------------------------------------------------------------- /recipes-graphics/gli/gli_0.8.4.0.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "OpenGL Image Library" 2 | DESCRIPTION = "OpenGL Image (GLI) is a header only C++ \ 3 | image library for graphics software." 4 | HOMEPAGE = "http://gli.g-truc.net" 5 | BUGTRACKER = "https://github.com/g-truc/gli/issues" 6 | 7 | SECTION = "libs" 8 | 9 | LICENSE = "MIT" 10 | LIC_FILES_CHKSUM = "file://readme.md;beginline=19;endline=20;md5=ab03b667ee630c1abb1add70365a50fb" 11 | 12 | SRC_URI = " \ 13 | git://github.com/g-truc/gli;protocol=https;branch=master \ 14 | " 15 | SRCREV = "0c171ee87fcfe35a7e0e0445adef06f92e0b6a91" 16 | S = "${WORKDIR}/git" 17 | 18 | inherit cmake 19 | 20 | # This is a header-only library, so the main package will be empty. 21 | ALLOW_EMPTY:${PN} = "1" 22 | 23 | BBCLASSEXTEND = "native" 24 | -------------------------------------------------------------------------------- /recipes-graphics/glm/glm_%.bbappend: -------------------------------------------------------------------------------- 1 | # This is a header-only library, so the main package will be empty. 2 | ALLOW_EMPTY:${PN} = "1" 3 | -------------------------------------------------------------------------------- /recipes-graphics/imx-gpu-sdk/imx-gpu-sdk-src.inc: -------------------------------------------------------------------------------- 1 | SRC_URI = "${GPU_SDK_SRC};branch=${GPU_SDK_SRC_BRANCH}" 2 | GPU_SDK_SRC ?= "git://github.com/nxp-imx/gtec-demo-framework.git;protocol=https" 3 | GPU_SDK_SRC_BRANCH ?= "master" 4 | SRCREV = "35bbd45ed6eac169a778bd154283771b9bf39be7" 5 | -------------------------------------------------------------------------------- /recipes-graphics/imx-gpu-sdk/imx-gpu-sdk_6.1.1.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "i.MX GPU SDK Samples" 2 | DESCRIPTION = "Set of sample applications for i.MX GPU" 3 | LICENSE = "BSD-3-Clause" 4 | LIC_FILES_CHKSUM = "file://License.md;md5=9d58a2573275ce8c35d79576835dbeb8" 5 | 6 | DEPENDS_BACKEND = \ 7 | "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', ' libxdg-shell wayland', \ 8 | bb.utils.contains('DISTRO_FEATURES', 'x11', ' xrandr', \ 9 | '', d), d)}" 10 | DEPENDS_MX8 = "" 11 | DEPENDS_MX8:mx8-nxp-bsp = " \ 12 | glslang-native \ 13 | opencv \ 14 | rapidopencl \ 15 | rapidopenvx \ 16 | rapidvulkan \ 17 | vulkan-headers \ 18 | vulkan-loader \ 19 | " 20 | DEPENDS_MX8:mx8mm-nxp-bsp = " \ 21 | opencv \ 22 | " 23 | DEPENDS = " \ 24 | assimp \ 25 | cmake-native \ 26 | devil \ 27 | fmt \ 28 | gli \ 29 | glm \ 30 | gstreamer1.0 \ 31 | gstreamer1.0-plugins-base \ 32 | gtest \ 33 | half \ 34 | ninja-native \ 35 | nlohmann-json \ 36 | rapidjson \ 37 | stb \ 38 | zlib \ 39 | ${DEPENDS_BACKEND} \ 40 | ${DEPENDS_MX8} \ 41 | " 42 | DEPENDS:append:imxgpu2d = " virtual/libg2d virtual/libopenvg" 43 | DEPENDS:append:imxgpu3d = " virtual/libgles2" 44 | 45 | require imx-gpu-sdk-src.inc 46 | 47 | S = "${WORKDIR}/git" 48 | 49 | WINDOW_SYSTEM = \ 50 | "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'Wayland_XDG', \ 51 | bb.utils.contains('DISTRO_FEATURES', 'x11', 'X11', \ 52 | 'FB', d), d)}" 53 | 54 | FEATURES = "ConsoleHost,EarlyAccess,EGL,GoogleUnitTest,Lib_NlohmannJson,OpenVG,Test_RequireUserInputToExit,WindowHost" 55 | FEATURES:append:imxgpu = ",HW_GPU_VIVANTE" 56 | FEATURES:append:imxgpu2d = ",G2D" 57 | FEATURES:append:imxgpu3d = ",OpenGLES2" 58 | FEATURES:append = "${FEATURES_SOC}" 59 | 60 | FEATURES_SOC = "" 61 | FEATURES_SOC:mx6q-nxp-bsp = ",OpenGLES3" 62 | FEATURES_SOC:mx6dl-nxp-bsp = ",OpenGLES3" 63 | FEATURES_SOC:mx8-nxp-bsp = ",OpenCV4,Vulkan1.2,OpenGLES3.2,OpenCL1.2,OpenVX1.2" 64 | FEATURES_SOC:mx8mm-nxp-bsp = ",OpenCV4" 65 | 66 | EXTENSIONS = "*" 67 | EXTENSIONS:mx6q-nxp-bsp = "OpenGLES:GL_VIV_direct_texture,OpenGLES3:GL_EXT_geometry_shader,OpenGLES3:GL_EXT_tessellation_shader" 68 | EXTENSIONS:mx6dl-nxp-bsp = "OpenGLES:GL_VIV_direct_texture,OpenGLES3:GL_EXT_geometry_shader,OpenGLES3:GL_EXT_tessellation_shader" 69 | EXTENSIONS:mx8m-nxp-bsp = "OpenGLES:GL_VIV_direct_texture,OpenGLES3:GL_EXT_color_buffer_float" 70 | EXTENSIONS:mx8mm-nxp-bsp = "*" 71 | 72 | do_compile () { 73 | export FSL_PLATFORM_NAME=Yocto 74 | export ROOTFS=${STAGING_DIR_HOST} 75 | . ./prepare.sh 76 | FslBuild.py -vvvvv -t sdk --UseFeatures [${FEATURES}] --UseExtensions [${EXTENSIONS}] --Variants [WindowSystem=${WINDOW_SYSTEM}] --BuildThreads ${@oe.utils.parallel_make(d)} -c install --CMakeInstallPrefix ${S} 77 | } 78 | 79 | REMOVALS = " \ 80 | GLES2/DeBayer \ 81 | GLES2/DirectMultiSamplingVideoYUV \ 82 | GLES3/DirectMultiSamplingVideoYUV \ 83 | " 84 | REMOVALS:append:imxdpu = " \ 85 | G2D/EightLayers \ 86 | " 87 | REMOVALS:append:mx6q-nxp-bsp = " \ 88 | GLES3/HDR02_FBBasicToneMapping \ 89 | GLES3/HDR03_SkyboxTonemapping \ 90 | GLES3/HDR04_HDRFramebuffer \ 91 | " 92 | REMOVALS:append:mx6dl-nxp-bsp = " \ 93 | GLES3/HDR02_FBBasicToneMapping \ 94 | GLES3/HDR03_SkyboxTonemapping \ 95 | GLES3/HDR04_HDRFramebuffer \ 96 | " 97 | 98 | do_install () { 99 | install -d "${D}/opt/${PN}" 100 | cp -r ${S}/bin/* ${D}/opt/${PN} 101 | for removal in ${REMOVALS}; do 102 | rm -rf ${D}/opt/${PN}/$removal 103 | done 104 | } 105 | 106 | FILES:${PN} += "/opt/${PN}" 107 | FILES:${PN}-dbg += "/opt/${PN}/*/*/.debug /usr/src/debug" 108 | INSANE_SKIP:${PN} += "already-stripped rpaths" 109 | 110 | # Unfortunately recipes with an empty main package, like header-only libraries, 111 | # are not included in the SDK. Use RDEPENDS as a workaround. 112 | RDEPENDS_EMPTY_MAIN_PACKAGE = " \ 113 | fmt \ 114 | gli \ 115 | glm \ 116 | googletest \ 117 | half \ 118 | nlohmann-json \ 119 | rapidjson \ 120 | stb \ 121 | " 122 | RDEPENDS_EMPTY_MAIN_PACKAGE_MX8 = "" 123 | RDEPENDS_EMPTY_MAIN_PACKAGE_MX8:mx8-nxp-bsp = " \ 124 | ${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'libxdg-shell', '', d)} \ 125 | rapidopencl \ 126 | rapidopenvx \ 127 | rapidvulkan \ 128 | " 129 | RDEPENDS_EMPTY_MAIN_PACKAGE_MX8:mx8mm-nxp-bsp = "" 130 | # vulkan-loader is dynamically loaded, so need to add an explicit 131 | # dependency 132 | RDEPENDS_VULKAN_LOADER = "" 133 | RDEPENDS_VULKAN_LOADER:mx8-nxp-bsp = "vulkan-validation-layers vulkan-loader" 134 | RDEPENDS_VULKAN_LOADER:mx8mm-nxp-bsp = "" 135 | RDEPENDS:${PN} += " \ 136 | ${RDEPENDS_EMPTY_MAIN_PACKAGE} \ 137 | ${RDEPENDS_EMPTY_MAIN_PACKAGE_MX8} \ 138 | ${RDEPENDS_VULKAN_LOADER} \ 139 | " 140 | 141 | # For backwards compatibility 142 | RPROVIDES:${PN} = "fsl-gpu-sdk" 143 | RREPLACES:${PN} = "fsl-gpu-sdk" 144 | RCONFLICTS:${PN} = "fsl-gpu-sdk" 145 | 146 | COMPATIBLE_MACHINE = "(imxgpu)" 147 | -------------------------------------------------------------------------------- /recipes-graphics/imx-gpu-sdk/libxdg-shell.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "Provides XDG shell header and glue code library" 2 | LICENSE = "BSD-3-Clause" 3 | LIC_FILES_CHKSUM = "file://${WORKDIR}/git/License.md;md5=9d58a2573275ce8c35d79576835dbeb8" 4 | 5 | DEPENDS = "wayland-native wayland wayland-protocols" 6 | 7 | require imx-gpu-sdk-src.inc 8 | 9 | S = "${WORKDIR}/git/ThirdParty/Recipe/xdg-shell" 10 | 11 | inherit cmake pkgconfig 12 | 13 | EXTRA_OECMAKE = " \ 14 | -DWAYLAND_SCANNER=${STAGING_BINDIR_NATIVE}/wayland-scanner \ 15 | -DWAYLAND_PROTOCOLS_DIR=${STAGING_DATADIR}/wayland-protocols \ 16 | " 17 | 18 | ALLOW_EMPTY:${PN} = "1" 19 | RDEPENDS:${PN}-dev = "${PN}-staticdev" 20 | -------------------------------------------------------------------------------- /recipes-graphics/rapidopencl/rapidopencl_1.1.0.1.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "Experimental low level header only C++11 RAII wrapper classes for the OpenCL API" 2 | LICENSE = "BSD-3-Clause" 3 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=b98f636daed34d12d11e25f3185c0204" 4 | 5 | SRC_URI = "git://github.com/Unarmed1000/RapidOpenCL;protocol=https;branch=master \ 6 | " 7 | SRCREV = "21254804a56ae96e8385c2652733c338d62da04f" 8 | 9 | S = "${WORKDIR}/git" 10 | 11 | # RapidOpenCL is a header-only C++11 RAII wrapper class, so the main package will be empty. 12 | 13 | do_install () { 14 | install -d ${D}${includedir} 15 | cp -r ${S}/include/* ${D}${includedir} 16 | } 17 | 18 | ALLOW_EMPTY:${PN} = "1" 19 | -------------------------------------------------------------------------------- /recipes-graphics/rapidopenvx/rapidopenvx_1.1.0.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "Low level header only C++11 RAII wrapper classes for the OpenVX API" 2 | LICENSE = "BSD-3-Clause" 3 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=b98f636daed34d12d11e25f3185c0204" 4 | 5 | SRC_URI = "git://github.com/Unarmed1000/RapidOpenVX;protocol=https;branch=master \ 6 | " 7 | SRCREV = "909c7abbff0ee35610f07f6fadeaf3a2eadce36e" 8 | 9 | S = "${WORKDIR}/git" 10 | 11 | do_install () { 12 | install -d ${D}${includedir} 13 | cp -r ${S}/include/* ${D}${includedir} 14 | } 15 | 16 | ALLOW_EMPTY:${PN} = "1" 17 | -------------------------------------------------------------------------------- /recipes-graphics/rapidvulkan/rapidvulkan_1.2.162.0.bb: -------------------------------------------------------------------------------- 1 | SUMMARY = "Low level header only C++11 RAII wrapper classes for the Vulkan API" 2 | LICENSE = "BSD-3-Clause" 3 | LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=b98f636daed34d12d11e25f3185c0204" 4 | 5 | DEPENDS = "vulkan-loader" 6 | 7 | SRC_URI = "git://github.com/Unarmed1000/RapidVulkan;protocol=https;branch=master" 8 | SRCREV = "e39a407c5ae880792d8843ada65a19dd26b3dca7" 9 | 10 | S = "${WORKDIR}/git" 11 | 12 | inherit cmake 13 | 14 | ALLOW_EMPTY:${PN} = "1" 15 | -------------------------------------------------------------------------------- /recipes-graphics/vulkan/assimp/0001-assimp-remove-shared-lib-from-_IMPORT_CHECK_TARGETS.patch: -------------------------------------------------------------------------------- 1 | From: Ranjitsinh Rathod 2 | Date: Fri, 13 Aug 2021 16:42:48 +0530 3 | Subject: [PATCH] assimp: remove shared lib from _IMPORT_CHECK_TARGETS 4 | 5 | In the target assimp::assimp shared library verification removed 6 | as it is giving configuration error when used by 3rd part component to 7 | configure itself using assimp::assimp target 8 | 9 | Upstream-Status: Inappropriate [oe specific] 10 | 11 | Signed-off-by: Ranjitsinh Rathod 12 | --- 13 | assimpTargets-release.cmake.in | 4 ++-- 14 | 1 file changed, 2 insertions(+), 2 deletions(-) 15 | 16 | diff --git a/assimpTargets-release.cmake.in b/assimpTargets-release.cmake.in 17 | index cd2fac7e0..52edc7990 100644 18 | --- a/assimpTargets-release.cmake.in 19 | +++ b/assimpTargets-release.cmake.in 20 | @@ -72,8 +72,8 @@ else() 21 | IMPORTED_SONAME_RELEASE "${sharedLibraryName}" 22 | IMPORTED_LOCATION_RELEASE "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}" 23 | ) 24 | - list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp ) 25 | - list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}" ) 26 | + #list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp ) 27 | + #list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}" ) 28 | else() 29 | set(staticLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_STATIC_LIBRARY_SUFFIX@") 30 | set_target_properties(assimp::assimp PROPERTIES 31 | -- 32 | 2.17.1 33 | -------------------------------------------------------------------------------- /recipes-graphics/vulkan/assimp/0001-closes-https-github.com-assimp-assimp-issues-2733-up.patch: -------------------------------------------------------------------------------- 1 | From 7fc220b2350d78942fb3935cad0b1564418ebe8f Mon Sep 17 00:00:00 2001 2 | From: Kim Kulling 3 | Date: Tue, 19 Nov 2019 20:30:40 +0100 4 | Subject: [PATCH] closes https://github.com/assimp/assimp/issues/2733: update 5 | of zlip to fix gcc build for v9.2.0 32 bit 6 | 7 | Upstream-Status: Backport [https://github.com/assimp/assimp/commit/f78446b14aff46db2ef27d062a275b6a01fd68b1] 8 | Signed-off-by: Alexander Kanavin 9 | --- 10 | contrib/zip/.gitignore | 2 + 11 | contrib/zip/CMakeLists.txt | 83 +++++- 12 | contrib/zip/README.md | 12 +- 13 | contrib/zip/appveyor.yml | 2 +- 14 | contrib/zip/src/miniz.h | 457 ++++++++++++++++++++++++++++---- 15 | contrib/zip/src/zip.c | 62 +++-- 16 | contrib/zip/src/zip.h | 457 ++++++++++++++++---------------- 17 | contrib/zip/test/CMakeLists.txt | 27 +- 18 | contrib/zip/test/test.c | 38 ++- 19 | contrib/zip/test/test_miniz.c | 25 +- 20 | 10 files changed, 821 insertions(+), 344 deletions(-) 21 | 22 | diff --git a/contrib/zip/.gitignore b/contrib/zip/.gitignore 23 | index a7904a1e..49b2cb2f 100644 24 | --- a/contrib/zip/.gitignore 25 | +++ b/contrib/zip/.gitignore 26 | @@ -1,6 +1,7 @@ 27 | /build/ 28 | /test/build/ 29 | /xcodeproj/ 30 | +.vscode/ 31 | 32 | # Object files 33 | *.o 34 | @@ -54,3 +55,4 @@ zip.dir/ 35 | test/test.exe.vcxproj.filters 36 | test/test.exe.vcxproj 37 | test/test.exe.dir/ 38 | + 39 | diff --git a/contrib/zip/CMakeLists.txt b/contrib/zip/CMakeLists.txt 40 | index b46dbb1d..77916d2e 100644 41 | --- a/contrib/zip/CMakeLists.txt 42 | +++ b/contrib/zip/CMakeLists.txt 43 | @@ -1,10 +1,14 @@ 44 | -cmake_minimum_required(VERSION 2.8) 45 | -project(zip) 46 | -enable_language(C) 47 | +cmake_minimum_required(VERSION 3.0) 48 | + 49 | +project(zip 50 | + LANGUAGES C 51 | + VERSION "0.1.15") 52 | set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) 53 | 54 | +option(CMAKE_DISABLE_TESTING "Disable test creation" OFF) 55 | + 56 | if (MSVC) 57 | - # Use secure functions by defaualt and suppress warnings about "deprecated" functions 58 | + # Use secure functions by default and suppress warnings about "deprecated" functions 59 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES=1") 60 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT=1") 61 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_NONSTDC_NO_WARNINGS=1 /D _CRT_SECURE_NO_WARNINGS=1") 62 | @@ -12,28 +16,80 @@ elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR 63 | "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR 64 | "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") 65 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -Wextra -Werror -pedantic") 66 | + if(ENABLE_COVERAGE) 67 | + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0 -fprofile-arcs -ftest-coverage") 68 | + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") 69 | + endif() 70 | endif (MSVC) 71 | 72 | # zip 73 | set(SRC src/miniz.h src/zip.h src/zip.c) 74 | add_library(${PROJECT_NAME} ${SRC}) 75 | -target_include_directories(${PROJECT_NAME} INTERFACE src) 76 | +target_include_directories(${PROJECT_NAME} PUBLIC 77 | + $ 78 | + $ 79 | +) 80 | 81 | # test 82 | if (NOT CMAKE_DISABLE_TESTING) 83 | enable_testing() 84 | add_subdirectory(test) 85 | find_package(Sanitizers) 86 | - add_sanitizers(${PROJECT_NAME} test.exe) 87 | - add_sanitizers(${PROJECT_NAME} test_miniz.exe) 88 | + add_sanitizers(${PROJECT_NAME} ${test_out} ${test_miniz_out}) 89 | endif() 90 | 91 | +#### 92 | +# Installation (https://github.com/forexample/package-example) { 93 | + 94 | +set(CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}") 95 | +set(INCLUDE_INSTALL_DIR "include") 96 | + 97 | +set(GENERATED_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated") 98 | + 99 | +# Configuration 100 | +set(VERSION_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}ConfigVersion.cmake") 101 | +set(PROJECT_CONFIG "${GENERATED_DIR}/${PROJECT_NAME}Config.cmake") 102 | +set(TARGETS_EXPORT_NAME "${PROJECT_NAME}Targets") 103 | +set(NAMESPACE "${PROJECT_NAME}::") 104 | + 105 | +# Include module with fuction 'write_basic_package_version_file' 106 | +include(CMakePackageConfigHelpers) 107 | + 108 | +# Note: PROJECT_VERSION is used as a VERSION 109 | +write_basic_package_version_file( 110 | + "${VERSION_CONFIG}" COMPATIBILITY SameMajorVersion 111 | +) 112 | + 113 | +# Use variables: 114 | +# * TARGETS_EXPORT_NAME 115 | +# * PROJECT_NAME 116 | +configure_package_config_file( 117 | + "cmake/Config.cmake.in" 118 | + "${PROJECT_CONFIG}" 119 | + INSTALL_DESTINATION "${CONFIG_INSTALL_DIR}" 120 | +) 121 | + 122 | +install( 123 | + FILES "${PROJECT_CONFIG}" "${VERSION_CONFIG}" 124 | + DESTINATION "${CONFIG_INSTALL_DIR}" 125 | +) 126 | + 127 | +install( 128 | + EXPORT "${TARGETS_EXPORT_NAME}" 129 | + NAMESPACE "${NAMESPACE}" 130 | + DESTINATION "${CONFIG_INSTALL_DIR}" 131 | +) 132 | + 133 | +# } 134 | + 135 | install(TARGETS ${PROJECT_NAME} 136 | + EXPORT ${TARGETS_EXPORT_NAME} 137 | RUNTIME DESTINATION bin 138 | ARCHIVE DESTINATION lib 139 | LIBRARY DESTINATION lib 140 | - COMPONENT library) 141 | -install(FILES ${PROJECT_SOURCE_DIR}/src/zip.h DESTINATION include) 142 | + INCLUDES DESTINATION ${INCLUDE_INSTALL_DIR} 143 | +) 144 | +install(FILES ${PROJECT_SOURCE_DIR}/src/zip.h DESTINATION ${INCLUDE_INSTALL_DIR}/zip) 145 | 146 | # uninstall target (https://gitlab.kitware.com/cmake/community/wikis/FAQ#can-i-do-make-uninstall-with-cmake) 147 | if(NOT TARGET uninstall) 148 | @@ -45,3 +101,12 @@ if(NOT TARGET uninstall) 149 | add_custom_target(uninstall 150 | COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake) 151 | endif() 152 | + 153 | +find_package(Doxygen) 154 | +if(DOXYGEN_FOUND) 155 | + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) 156 | + add_custom_target(doc 157 | + ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile 158 | + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 159 | + COMMENT "Generating API documentation with Doxygen" VERBATIM) 160 | +endif() 161 | diff --git a/contrib/zip/README.md b/contrib/zip/README.md 162 | index d5fb8cd2..14eb9a34 100644 163 | --- a/contrib/zip/README.md 164 | +++ b/contrib/zip/README.md 165 | @@ -71,7 +71,7 @@ int arg = 2; 166 | zip_extract("foo.zip", "/tmp", on_extract_entry, &arg); 167 | ``` 168 | 169 | -* Extract a zip entry into memory. 170 | +* Extract a zip entry into memory. 171 | ```c 172 | void *buf = NULL; 173 | size_t bufsize; 174 | @@ -89,7 +89,7 @@ zip_close(zip); 175 | free(buf); 176 | ``` 177 | 178 | -* Extract a zip entry into memory (no internal allocation). 179 | +* Extract a zip entry into memory (no internal allocation). 180 | ```c 181 | unsigned char *buf; 182 | size_t bufsize; 183 | @@ -110,7 +110,7 @@ zip_close(zip); 184 | free(buf); 185 | ``` 186 | 187 | -* Extract a zip entry into memory using callback. 188 | +* Extract a zip entry into memory using callback. 189 | ```c 190 | struct buffer_t { 191 | char *data; 192 | @@ -144,7 +144,7 @@ free(buf.data); 193 | ``` 194 | 195 | 196 | -* Extract a zip entry into a file. 197 | +* Extract a zip entry into a file. 198 | ```c 199 | struct zip_t *zip = zip_open("foo.zip", 0, 'r'); 200 | { 201 | @@ -157,7 +157,7 @@ struct zip_t *zip = zip_open("foo.zip", 0, 'r'); 202 | zip_close(zip); 203 | ``` 204 | 205 | -* List of all zip entries 206 | +* List of all zip entries 207 | ```c 208 | struct zip_t *zip = zip_open("foo.zip", 0, 'r'); 209 | int i, n = zip_total_entries(zip); 210 | @@ -174,7 +174,7 @@ for (i = 0; i < n; ++i) { 211 | zip_close(zip); 212 | ``` 213 | 214 | -## Bindings 215 | +# Bindings 216 | Compile zip library as a dynamic library. 217 | ```shell 218 | $ mkdir build 219 | diff --git a/contrib/zip/appveyor.yml b/contrib/zip/appveyor.yml 220 | index 0be6373c..ea17f5de 100644 221 | --- a/contrib/zip/appveyor.yml 222 | +++ b/contrib/zip/appveyor.yml 223 | @@ -1,4 +1,4 @@ 224 | -version: zip-0.1.9.{build} 225 | +version: zip-0.1.15.{build} 226 | build_script: 227 | - cmd: >- 228 | cd c:\projects\zip 229 | diff --git a/contrib/zip/src/miniz.h b/contrib/zip/src/miniz.h 230 | index 2c27a94d..c4fcfb83 100644 231 | --- a/contrib/zip/src/miniz.h 232 | +++ b/contrib/zip/src/miniz.h 233 | @@ -221,6 +221,7 @@ 234 | #ifndef MINIZ_HEADER_INCLUDED 235 | #define MINIZ_HEADER_INCLUDED 236 | 237 | +#include 238 | #include 239 | 240 | // Defines to completely disable specific portions of miniz.c: 241 | @@ -284,7 +285,8 @@ 242 | /* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES only if not set */ 243 | #if !defined(MINIZ_USE_UNALIGNED_LOADS_AND_STORES) 244 | #if MINIZ_X86_OR_X64_CPU 245 | -/* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 on CPU's that permit efficient integer loads and stores from unaligned addresses. */ 246 | +/* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES to 1 on CPU's that permit efficient 247 | + * integer loads and stores from unaligned addresses. */ 248 | #define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1 249 | #define MINIZ_UNALIGNED_USE_MEMCPY 250 | #else 251 | @@ -354,6 +356,44 @@ enum { 252 | MZ_FIXED = 4 253 | }; 254 | 255 | +/* miniz error codes. Be sure to update mz_zip_get_error_string() if you add or 256 | + * modify this enum. */ 257 | +typedef enum { 258 | + MZ_ZIP_NO_ERROR = 0, 259 | + MZ_ZIP_UNDEFINED_ERROR, 260 | + MZ_ZIP_TOO_MANY_FILES, 261 | + MZ_ZIP_FILE_TOO_LARGE, 262 | + MZ_ZIP_UNSUPPORTED_METHOD, 263 | + MZ_ZIP_UNSUPPORTED_ENCRYPTION, 264 | + MZ_ZIP_UNSUPPORTED_FEATURE, 265 | + MZ_ZIP_FAILED_FINDING_CENTRAL_DIR, 266 | + MZ_ZIP_NOT_AN_ARCHIVE, 267 | + MZ_ZIP_INVALID_HEADER_OR_CORRUPTED, 268 | + MZ_ZIP_UNSUPPORTED_MULTIDISK, 269 | + MZ_ZIP_DECOMPRESSION_FAILED, 270 | + MZ_ZIP_COMPRESSION_FAILED, 271 | + MZ_ZIP_UNEXPECTED_DECOMPRESSED_SIZE, 272 | + MZ_ZIP_CRC_CHECK_FAILED, 273 | + MZ_ZIP_UNSUPPORTED_CDIR_SIZE, 274 | + MZ_ZIP_ALLOC_FAILED, 275 | + MZ_ZIP_FILE_OPEN_FAILED, 276 | + MZ_ZIP_FILE_CREATE_FAILED, 277 | + MZ_ZIP_FILE_WRITE_FAILED, 278 | + MZ_ZIP_FILE_READ_FAILED, 279 | + MZ_ZIP_FILE_CLOSE_FAILED, 280 | + MZ_ZIP_FILE_SEEK_FAILED, 281 | + MZ_ZIP_FILE_STAT_FAILED, 282 | + MZ_ZIP_INVALID_PARAMETER, 283 | + MZ_ZIP_INVALID_FILENAME, 284 | + MZ_ZIP_BUF_TOO_SMALL, 285 | + MZ_ZIP_INTERNAL_ERROR, 286 | + MZ_ZIP_FILE_NOT_FOUND, 287 | + MZ_ZIP_ARCHIVE_TOO_LARGE, 288 | + MZ_ZIP_VALIDATION_FAILED, 289 | + MZ_ZIP_WRITE_CALLBACK_FAILED, 290 | + MZ_ZIP_TOTAL_ERRORS 291 | +} mz_zip_error; 292 | + 293 | // Method 294 | #define MZ_DEFLATED 8 295 | 296 | @@ -696,6 +736,7 @@ typedef size_t (*mz_file_read_func)(void *pOpaque, mz_uint64 file_ofs, 297 | void *pBuf, size_t n); 298 | typedef size_t (*mz_file_write_func)(void *pOpaque, mz_uint64 file_ofs, 299 | const void *pBuf, size_t n); 300 | +typedef mz_bool (*mz_file_needs_keepalive)(void *pOpaque); 301 | 302 | struct mz_zip_internal_state_tag; 303 | typedef struct mz_zip_internal_state_tag mz_zip_internal_state; 304 | @@ -707,13 +748,27 @@ typedef enum { 305 | MZ_ZIP_MODE_WRITING_HAS_BEEN_FINALIZED = 3 306 | } mz_zip_mode; 307 | 308 | -typedef struct mz_zip_archive_tag { 309 | +typedef enum { 310 | + MZ_ZIP_TYPE_INVALID = 0, 311 | + MZ_ZIP_TYPE_USER, 312 | + MZ_ZIP_TYPE_MEMORY, 313 | + MZ_ZIP_TYPE_HEAP, 314 | + MZ_ZIP_TYPE_FILE, 315 | + MZ_ZIP_TYPE_CFILE, 316 | + MZ_ZIP_TOTAL_TYPES 317 | +} mz_zip_type; 318 | + 319 | +typedef struct { 320 | mz_uint64 m_archive_size; 321 | mz_uint64 m_central_directory_file_ofs; 322 | - mz_uint m_total_files; 323 | + 324 | + /* We only support up to UINT32_MAX files in zip64 mode. */ 325 | + mz_uint32 m_total_files; 326 | mz_zip_mode m_zip_mode; 327 | + mz_zip_type m_zip_type; 328 | + mz_zip_error m_last_error; 329 | 330 | - mz_uint m_file_offset_alignment; 331 | + mz_uint64 m_file_offset_alignment; 332 | 333 | mz_alloc_func m_pAlloc; 334 | mz_free_func m_pFree; 335 | @@ -722,6 +777,7 @@ typedef struct mz_zip_archive_tag { 336 | 337 | mz_file_read_func m_pRead; 338 | mz_file_write_func m_pWrite; 339 | + mz_file_needs_keepalive m_pNeeds_keepalive; 340 | void *m_pIO_opaque; 341 | 342 | mz_zip_internal_state *m_pState; 343 | @@ -1263,6 +1319,9 @@ mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits, 344 | int strategy); 345 | #endif // #ifndef MINIZ_NO_ZLIB_APIS 346 | 347 | +#define MZ_UINT16_MAX (0xFFFFU) 348 | +#define MZ_UINT32_MAX (0xFFFFFFFFU) 349 | + 350 | #ifdef __cplusplus 351 | } 352 | #endif 353 | @@ -1311,6 +1370,11 @@ typedef unsigned char mz_validate_uint64[sizeof(mz_uint64) == 8 ? 1 : -1]; 354 | ((mz_uint32)(((const mz_uint8 *)(p))[3]) << 24U)) 355 | #endif 356 | 357 | +#define MZ_READ_LE64(p) \ 358 | + (((mz_uint64)MZ_READ_LE32(p)) | \ 359 | + (((mz_uint64)MZ_READ_LE32((const mz_uint8 *)(p) + sizeof(mz_uint32))) \ 360 | + << 32U)) 361 | + 362 | #ifdef _MSC_VER 363 | #define MZ_FORCEINLINE __forceinline 364 | #elif defined(__GNUC__) 365 | @@ -4160,6 +4224,17 @@ enum { 366 | MZ_ZIP_LOCAL_DIR_HEADER_SIZE = 30, 367 | MZ_ZIP_CENTRAL_DIR_HEADER_SIZE = 46, 368 | MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE = 22, 369 | + 370 | + /* ZIP64 archive identifier and record sizes */ 371 | + MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIG = 0x06064b50, 372 | + MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIG = 0x07064b50, 373 | + MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE = 56, 374 | + MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE = 20, 375 | + MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID = 0x0001, 376 | + MZ_ZIP_DATA_DESCRIPTOR_ID = 0x08074b50, 377 | + MZ_ZIP_DATA_DESCRIPTER_SIZE64 = 24, 378 | + MZ_ZIP_DATA_DESCRIPTER_SIZE32 = 16, 379 | + 380 | // Central directory header record offsets 381 | MZ_ZIP_CDH_SIG_OFS = 0, 382 | MZ_ZIP_CDH_VERSION_MADE_BY_OFS = 4, 383 | @@ -4199,6 +4274,31 @@ enum { 384 | MZ_ZIP_ECDH_CDIR_SIZE_OFS = 12, 385 | MZ_ZIP_ECDH_CDIR_OFS_OFS = 16, 386 | MZ_ZIP_ECDH_COMMENT_SIZE_OFS = 20, 387 | + 388 | + /* ZIP64 End of central directory locator offsets */ 389 | + MZ_ZIP64_ECDL_SIG_OFS = 0, /* 4 bytes */ 390 | + MZ_ZIP64_ECDL_NUM_DISK_CDIR_OFS = 4, /* 4 bytes */ 391 | + MZ_ZIP64_ECDL_REL_OFS_TO_ZIP64_ECDR_OFS = 8, /* 8 bytes */ 392 | + MZ_ZIP64_ECDL_TOTAL_NUMBER_OF_DISKS_OFS = 16, /* 4 bytes */ 393 | + 394 | + /* ZIP64 End of central directory header offsets */ 395 | + MZ_ZIP64_ECDH_SIG_OFS = 0, /* 4 bytes */ 396 | + MZ_ZIP64_ECDH_SIZE_OF_RECORD_OFS = 4, /* 8 bytes */ 397 | + MZ_ZIP64_ECDH_VERSION_MADE_BY_OFS = 12, /* 2 bytes */ 398 | + MZ_ZIP64_ECDH_VERSION_NEEDED_OFS = 14, /* 2 bytes */ 399 | + MZ_ZIP64_ECDH_NUM_THIS_DISK_OFS = 16, /* 4 bytes */ 400 | + MZ_ZIP64_ECDH_NUM_DISK_CDIR_OFS = 20, /* 4 bytes */ 401 | + MZ_ZIP64_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS = 24, /* 8 bytes */ 402 | + MZ_ZIP64_ECDH_CDIR_TOTAL_ENTRIES_OFS = 32, /* 8 bytes */ 403 | + MZ_ZIP64_ECDH_CDIR_SIZE_OFS = 40, /* 8 bytes */ 404 | + MZ_ZIP64_ECDH_CDIR_OFS_OFS = 48, /* 8 bytes */ 405 | + MZ_ZIP_VERSION_MADE_BY_DOS_FILESYSTEM_ID = 0, 406 | + MZ_ZIP_DOS_DIR_ATTRIBUTE_BITFLAG = 0x10, 407 | + MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_IS_ENCRYPTED = 1, 408 | + MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_COMPRESSED_PATCH_FLAG = 32, 409 | + MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_USES_STRONG_ENCRYPTION = 64, 410 | + MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_LOCAL_DIR_IS_MASKED = 8192, 411 | + MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_UTF8 = 1 << 11 412 | }; 413 | 414 | typedef struct { 415 | @@ -4211,7 +4311,24 @@ struct mz_zip_internal_state_tag { 416 | mz_zip_array m_central_dir; 417 | mz_zip_array m_central_dir_offsets; 418 | mz_zip_array m_sorted_central_dir_offsets; 419 | + 420 | + /* The flags passed in when the archive is initially opened. */ 421 | + uint32_t m_init_flags; 422 | + 423 | + /* MZ_TRUE if the archive has a zip64 end of central directory headers, etc. 424 | + */ 425 | + mz_bool m_zip64; 426 | + 427 | + /* MZ_TRUE if we found zip64 extended info in the central directory (m_zip64 428 | + * will also be slammed to true too, even if we didn't find a zip64 end of 429 | + * central dir header, etc.) */ 430 | + mz_bool m_zip64_has_extended_info_fields; 431 | + 432 | + /* These fields are used by the file, FILE, memory, and memory/heap read/write 433 | + * helpers. */ 434 | MZ_FILE *m_pFile; 435 | + mz_uint64 m_file_archive_start_ofs; 436 | + 437 | void *m_pMem; 438 | size_t m_mem_size; 439 | size_t m_mem_capacity; 440 | @@ -4363,6 +4480,13 @@ static mz_bool mz_zip_set_file_times(const char *pFilename, time_t access_time, 441 | #endif /* #ifndef MINIZ_NO_STDIO */ 442 | #endif /* #ifndef MINIZ_NO_TIME */ 443 | 444 | +static MZ_FORCEINLINE mz_bool mz_zip_set_error(mz_zip_archive *pZip, 445 | + mz_zip_error err_num) { 446 | + if (pZip) 447 | + pZip->m_last_error = err_num; 448 | + return MZ_FALSE; 449 | +} 450 | + 451 | static mz_bool mz_zip_reader_init_internal(mz_zip_archive *pZip, 452 | mz_uint32 flags) { 453 | (void)flags; 454 | @@ -4480,127 +4604,346 @@ mz_zip_reader_sort_central_dir_offsets_by_filename(mz_zip_archive *pZip) { 455 | } 456 | } 457 | 458 | -static mz_bool mz_zip_reader_read_central_dir(mz_zip_archive *pZip, 459 | - mz_uint32 flags) { 460 | - mz_uint cdir_size, num_this_disk, cdir_disk_index; 461 | - mz_uint64 cdir_ofs; 462 | +static mz_bool mz_zip_reader_locate_header_sig(mz_zip_archive *pZip, 463 | + mz_uint32 record_sig, 464 | + mz_uint32 record_size, 465 | + mz_int64 *pOfs) { 466 | mz_int64 cur_file_ofs; 467 | - const mz_uint8 *p; 468 | mz_uint32 buf_u32[4096 / sizeof(mz_uint32)]; 469 | mz_uint8 *pBuf = (mz_uint8 *)buf_u32; 470 | - mz_bool sort_central_dir = 471 | - ((flags & MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY) == 0); 472 | - // Basic sanity checks - reject files which are too small, and check the first 473 | - // 4 bytes of the file to make sure a local header is there. 474 | - if (pZip->m_archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) 475 | + 476 | + /* Basic sanity checks - reject files which are too small */ 477 | + if (pZip->m_archive_size < record_size) 478 | return MZ_FALSE; 479 | - // Find the end of central directory record by scanning the file from the end 480 | - // towards the beginning. 481 | + 482 | + /* Find the record by scanning the file from the end towards the beginning. */ 483 | cur_file_ofs = 484 | MZ_MAX((mz_int64)pZip->m_archive_size - (mz_int64)sizeof(buf_u32), 0); 485 | for (;;) { 486 | int i, 487 | n = (int)MZ_MIN(sizeof(buf_u32), pZip->m_archive_size - cur_file_ofs); 488 | + 489 | if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, n) != (mz_uint)n) 490 | return MZ_FALSE; 491 | - for (i = n - 4; i >= 0; --i) 492 | - if (MZ_READ_LE32(pBuf + i) == MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG) 493 | - break; 494 | + 495 | + for (i = n - 4; i >= 0; --i) { 496 | + mz_uint s = MZ_READ_LE32(pBuf + i); 497 | + if (s == record_sig) { 498 | + if ((pZip->m_archive_size - (cur_file_ofs + i)) >= record_size) 499 | + break; 500 | + } 501 | + } 502 | + 503 | if (i >= 0) { 504 | cur_file_ofs += i; 505 | break; 506 | } 507 | + 508 | + /* Give up if we've searched the entire file, or we've gone back "too far" 509 | + * (~64kb) */ 510 | if ((!cur_file_ofs) || ((pZip->m_archive_size - cur_file_ofs) >= 511 | - (0xFFFF + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE))) 512 | + (MZ_UINT16_MAX + record_size))) 513 | return MZ_FALSE; 514 | + 515 | cur_file_ofs = MZ_MAX(cur_file_ofs - (sizeof(buf_u32) - 3), 0); 516 | } 517 | - // Read and verify the end of central directory record. 518 | + 519 | + *pOfs = cur_file_ofs; 520 | + return MZ_TRUE; 521 | +} 522 | + 523 | +static mz_bool mz_zip_reader_read_central_dir(mz_zip_archive *pZip, 524 | + mz_uint flags) { 525 | + mz_uint cdir_size = 0, cdir_entries_on_this_disk = 0, num_this_disk = 0, 526 | + cdir_disk_index = 0; 527 | + mz_uint64 cdir_ofs = 0; 528 | + mz_int64 cur_file_ofs = 0; 529 | + const mz_uint8 *p; 530 | + 531 | + mz_uint32 buf_u32[4096 / sizeof(mz_uint32)]; 532 | + mz_uint8 *pBuf = (mz_uint8 *)buf_u32; 533 | + mz_bool sort_central_dir = 534 | + ((flags & MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY) == 0); 535 | + mz_uint32 zip64_end_of_central_dir_locator_u32 536 | + [(MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE + sizeof(mz_uint32) - 1) / 537 | + sizeof(mz_uint32)]; 538 | + mz_uint8 *pZip64_locator = (mz_uint8 *)zip64_end_of_central_dir_locator_u32; 539 | + 540 | + mz_uint32 zip64_end_of_central_dir_header_u32 541 | + [(MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE + sizeof(mz_uint32) - 1) / 542 | + sizeof(mz_uint32)]; 543 | + mz_uint8 *pZip64_end_of_central_dir = 544 | + (mz_uint8 *)zip64_end_of_central_dir_header_u32; 545 | + 546 | + mz_uint64 zip64_end_of_central_dir_ofs = 0; 547 | + 548 | + /* Basic sanity checks - reject files which are too small, and check the first 549 | + * 4 bytes of the file to make sure a local header is there. */ 550 | + if (pZip->m_archive_size < MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) 551 | + return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE); 552 | + 553 | + if (!mz_zip_reader_locate_header_sig( 554 | + pZip, MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG, 555 | + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE, &cur_file_ofs)) 556 | + return mz_zip_set_error(pZip, MZ_ZIP_FAILED_FINDING_CENTRAL_DIR); 557 | + 558 | + /* Read and verify the end of central directory record. */ 559 | if (pZip->m_pRead(pZip->m_pIO_opaque, cur_file_ofs, pBuf, 560 | MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) != 561 | MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIZE) 562 | - return MZ_FALSE; 563 | - if ((MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_SIG_OFS) != 564 | - MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG) || 565 | - ((pZip->m_total_files = 566 | - MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS)) != 567 | - MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS))) 568 | - return MZ_FALSE; 569 | + return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); 570 | + 571 | + if (MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_SIG_OFS) != 572 | + MZ_ZIP_END_OF_CENTRAL_DIR_HEADER_SIG) 573 | + return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE); 574 | + 575 | + if (cur_file_ofs >= (MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE + 576 | + MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE)) { 577 | + if (pZip->m_pRead(pZip->m_pIO_opaque, 578 | + cur_file_ofs - MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE, 579 | + pZip64_locator, 580 | + MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE) == 581 | + MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIZE) { 582 | + if (MZ_READ_LE32(pZip64_locator + MZ_ZIP64_ECDL_SIG_OFS) == 583 | + MZ_ZIP64_END_OF_CENTRAL_DIR_LOCATOR_SIG) { 584 | + zip64_end_of_central_dir_ofs = MZ_READ_LE64( 585 | + pZip64_locator + MZ_ZIP64_ECDL_REL_OFS_TO_ZIP64_ECDR_OFS); 586 | + if (zip64_end_of_central_dir_ofs > 587 | + (pZip->m_archive_size - MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE)) 588 | + return mz_zip_set_error(pZip, MZ_ZIP_NOT_AN_ARCHIVE); 589 | + 590 | + if (pZip->m_pRead(pZip->m_pIO_opaque, zip64_end_of_central_dir_ofs, 591 | + pZip64_end_of_central_dir, 592 | + MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE) == 593 | + MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE) { 594 | + if (MZ_READ_LE32(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_SIG_OFS) == 595 | + MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIG) { 596 | + pZip->m_pState->m_zip64 = MZ_TRUE; 597 | + } 598 | + } 599 | + } 600 | + } 601 | + } 602 | 603 | + pZip->m_total_files = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_TOTAL_ENTRIES_OFS); 604 | + cdir_entries_on_this_disk = 605 | + MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS); 606 | num_this_disk = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_NUM_THIS_DISK_OFS); 607 | cdir_disk_index = MZ_READ_LE16(pBuf + MZ_ZIP_ECDH_NUM_DISK_CDIR_OFS); 608 | + cdir_size = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_SIZE_OFS); 609 | + cdir_ofs = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_OFS_OFS); 610 | + 611 | + if (pZip->m_pState->m_zip64) { 612 | + mz_uint32 zip64_total_num_of_disks = 613 | + MZ_READ_LE32(pZip64_locator + MZ_ZIP64_ECDL_TOTAL_NUMBER_OF_DISKS_OFS); 614 | + mz_uint64 zip64_cdir_total_entries = MZ_READ_LE64( 615 | + pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_TOTAL_ENTRIES_OFS); 616 | + mz_uint64 zip64_cdir_total_entries_on_this_disk = MZ_READ_LE64( 617 | + pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_NUM_ENTRIES_ON_DISK_OFS); 618 | + mz_uint64 zip64_size_of_end_of_central_dir_record = MZ_READ_LE64( 619 | + pZip64_end_of_central_dir + MZ_ZIP64_ECDH_SIZE_OF_RECORD_OFS); 620 | + mz_uint64 zip64_size_of_central_directory = 621 | + MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_SIZE_OFS); 622 | + 623 | + if (zip64_size_of_end_of_central_dir_record < 624 | + (MZ_ZIP64_END_OF_CENTRAL_DIR_HEADER_SIZE - 12)) 625 | + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); 626 | + 627 | + if (zip64_total_num_of_disks != 1U) 628 | + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK); 629 | + 630 | + /* Check for miniz's practical limits */ 631 | + if (zip64_cdir_total_entries > MZ_UINT32_MAX) 632 | + return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); 633 | + 634 | + pZip->m_total_files = (mz_uint32)zip64_cdir_total_entries; 635 | + 636 | + if (zip64_cdir_total_entries_on_this_disk > MZ_UINT32_MAX) 637 | + return mz_zip_set_error(pZip, MZ_ZIP_TOO_MANY_FILES); 638 | + 639 | + cdir_entries_on_this_disk = 640 | + (mz_uint32)zip64_cdir_total_entries_on_this_disk; 641 | + 642 | + /* Check for miniz's current practical limits (sorry, this should be enough 643 | + * for millions of files) */ 644 | + if (zip64_size_of_central_directory > MZ_UINT32_MAX) 645 | + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_CDIR_SIZE); 646 | + 647 | + cdir_size = (mz_uint32)zip64_size_of_central_directory; 648 | + 649 | + num_this_disk = MZ_READ_LE32(pZip64_end_of_central_dir + 650 | + MZ_ZIP64_ECDH_NUM_THIS_DISK_OFS); 651 | + 652 | + cdir_disk_index = MZ_READ_LE32(pZip64_end_of_central_dir + 653 | + MZ_ZIP64_ECDH_NUM_DISK_CDIR_OFS); 654 | + 655 | + cdir_ofs = 656 | + MZ_READ_LE64(pZip64_end_of_central_dir + MZ_ZIP64_ECDH_CDIR_OFS_OFS); 657 | + } 658 | + 659 | + if (pZip->m_total_files != cdir_entries_on_this_disk) 660 | + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK); 661 | + 662 | if (((num_this_disk | cdir_disk_index) != 0) && 663 | ((num_this_disk != 1) || (cdir_disk_index != 1))) 664 | - return MZ_FALSE; 665 | + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK); 666 | 667 | - if ((cdir_size = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_SIZE_OFS)) < 668 | - pZip->m_total_files * MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) 669 | - return MZ_FALSE; 670 | + if (cdir_size < pZip->m_total_files * MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) 671 | + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); 672 | 673 | - cdir_ofs = MZ_READ_LE32(pBuf + MZ_ZIP_ECDH_CDIR_OFS_OFS); 674 | if ((cdir_ofs + (mz_uint64)cdir_size) > pZip->m_archive_size) 675 | - return MZ_FALSE; 676 | + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); 677 | 678 | pZip->m_central_directory_file_ofs = cdir_ofs; 679 | 680 | if (pZip->m_total_files) { 681 | mz_uint i, n; 682 | - 683 | - // Read the entire central directory into a heap block, and allocate another 684 | - // heap block to hold the unsorted central dir file record offsets, and 685 | - // another to hold the sorted indices. 686 | + /* Read the entire central directory into a heap block, and allocate another 687 | + * heap block to hold the unsorted central dir file record offsets, and 688 | + * possibly another to hold the sorted indices. */ 689 | if ((!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir, cdir_size, 690 | MZ_FALSE)) || 691 | (!mz_zip_array_resize(pZip, &pZip->m_pState->m_central_dir_offsets, 692 | pZip->m_total_files, MZ_FALSE))) 693 | - return MZ_FALSE; 694 | + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); 695 | 696 | if (sort_central_dir) { 697 | if (!mz_zip_array_resize(pZip, 698 | &pZip->m_pState->m_sorted_central_dir_offsets, 699 | pZip->m_total_files, MZ_FALSE)) 700 | - return MZ_FALSE; 701 | + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); 702 | } 703 | 704 | if (pZip->m_pRead(pZip->m_pIO_opaque, cdir_ofs, 705 | pZip->m_pState->m_central_dir.m_p, 706 | cdir_size) != cdir_size) 707 | - return MZ_FALSE; 708 | + return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); 709 | 710 | - // Now create an index into the central directory file records, do some 711 | - // basic sanity checking on each record, and check for zip64 entries (which 712 | - // are not yet supported). 713 | + /* Now create an index into the central directory file records, do some 714 | + * basic sanity checking on each record */ 715 | p = (const mz_uint8 *)pZip->m_pState->m_central_dir.m_p; 716 | for (n = cdir_size, i = 0; i < pZip->m_total_files; ++i) { 717 | - mz_uint total_header_size, comp_size, decomp_size, disk_index; 718 | + mz_uint total_header_size, disk_index, bit_flags, filename_size, 719 | + ext_data_size; 720 | + mz_uint64 comp_size, decomp_size, local_header_ofs; 721 | + 722 | if ((n < MZ_ZIP_CENTRAL_DIR_HEADER_SIZE) || 723 | (MZ_READ_LE32(p) != MZ_ZIP_CENTRAL_DIR_HEADER_SIG)) 724 | - return MZ_FALSE; 725 | + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); 726 | + 727 | MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_central_dir_offsets, mz_uint32, 728 | i) = 729 | (mz_uint32)(p - (const mz_uint8 *)pZip->m_pState->m_central_dir.m_p); 730 | + 731 | if (sort_central_dir) 732 | MZ_ZIP_ARRAY_ELEMENT(&pZip->m_pState->m_sorted_central_dir_offsets, 733 | mz_uint32, i) = i; 734 | + 735 | comp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_COMPRESSED_SIZE_OFS); 736 | decomp_size = MZ_READ_LE32(p + MZ_ZIP_CDH_DECOMPRESSED_SIZE_OFS); 737 | - if (((!MZ_READ_LE32(p + MZ_ZIP_CDH_METHOD_OFS)) && 738 | - (decomp_size != comp_size)) || 739 | - (decomp_size && !comp_size) || (decomp_size == 0xFFFFFFFF) || 740 | - (comp_size == 0xFFFFFFFF)) 741 | - return MZ_FALSE; 742 | + local_header_ofs = MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS); 743 | + filename_size = MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS); 744 | + ext_data_size = MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS); 745 | + 746 | + if ((!pZip->m_pState->m_zip64_has_extended_info_fields) && 747 | + (ext_data_size) && 748 | + (MZ_MAX(MZ_MAX(comp_size, decomp_size), local_header_ofs) == 749 | + MZ_UINT32_MAX)) { 750 | + /* Attempt to find zip64 extended information field in the entry's extra 751 | + * data */ 752 | + mz_uint32 extra_size_remaining = ext_data_size; 753 | + 754 | + if (extra_size_remaining) { 755 | + const mz_uint8 *pExtra_data; 756 | + void *buf = NULL; 757 | + 758 | + if (MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size + ext_data_size > 759 | + n) { 760 | + buf = MZ_MALLOC(ext_data_size); 761 | + if (buf == NULL) 762 | + return mz_zip_set_error(pZip, MZ_ZIP_ALLOC_FAILED); 763 | + 764 | + if (pZip->m_pRead(pZip->m_pIO_opaque, 765 | + cdir_ofs + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + 766 | + filename_size, 767 | + buf, ext_data_size) != ext_data_size) { 768 | + MZ_FREE(buf); 769 | + return mz_zip_set_error(pZip, MZ_ZIP_FILE_READ_FAILED); 770 | + } 771 | + 772 | + pExtra_data = (mz_uint8 *)buf; 773 | + } else { 774 | + pExtra_data = p + MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + filename_size; 775 | + } 776 | + 777 | + do { 778 | + mz_uint32 field_id; 779 | + mz_uint32 field_data_size; 780 | + 781 | + if (extra_size_remaining < (sizeof(mz_uint16) * 2)) { 782 | + MZ_FREE(buf); 783 | + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); 784 | + } 785 | + 786 | + field_id = MZ_READ_LE16(pExtra_data); 787 | + field_data_size = MZ_READ_LE16(pExtra_data + sizeof(mz_uint16)); 788 | + 789 | + if ((field_data_size + sizeof(mz_uint16) * 2) > 790 | + extra_size_remaining) { 791 | + MZ_FREE(buf); 792 | + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); 793 | + } 794 | + 795 | + if (field_id == MZ_ZIP64_EXTENDED_INFORMATION_FIELD_HEADER_ID) { 796 | + /* Ok, the archive didn't have any zip64 headers but it uses a 797 | + * zip64 extended information field so mark it as zip64 anyway 798 | + * (this can occur with infozip's zip util when it reads 799 | + * compresses files from stdin). */ 800 | + pZip->m_pState->m_zip64 = MZ_TRUE; 801 | + pZip->m_pState->m_zip64_has_extended_info_fields = MZ_TRUE; 802 | + break; 803 | + } 804 | + 805 | + pExtra_data += sizeof(mz_uint16) * 2 + field_data_size; 806 | + extra_size_remaining = 807 | + extra_size_remaining - sizeof(mz_uint16) * 2 - field_data_size; 808 | + } while (extra_size_remaining); 809 | + 810 | + MZ_FREE(buf); 811 | + } 812 | + } 813 | + 814 | + /* I've seen archives that aren't marked as zip64 that uses zip64 ext 815 | + * data, argh */ 816 | + if ((comp_size != MZ_UINT32_MAX) && (decomp_size != MZ_UINT32_MAX)) { 817 | + if (((!MZ_READ_LE32(p + MZ_ZIP_CDH_METHOD_OFS)) && 818 | + (decomp_size != comp_size)) || 819 | + (decomp_size && !comp_size)) 820 | + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); 821 | + } 822 | + 823 | disk_index = MZ_READ_LE16(p + MZ_ZIP_CDH_DISK_START_OFS); 824 | - if ((disk_index != num_this_disk) && (disk_index != 1)) 825 | - return MZ_FALSE; 826 | - if (((mz_uint64)MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS) + 827 | - MZ_ZIP_LOCAL_DIR_HEADER_SIZE + comp_size) > pZip->m_archive_size) 828 | - return MZ_FALSE; 829 | + if ((disk_index == MZ_UINT16_MAX) || 830 | + ((disk_index != num_this_disk) && (disk_index != 1))) 831 | + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_MULTIDISK); 832 | + 833 | + if (comp_size != MZ_UINT32_MAX) { 834 | + if (((mz_uint64)MZ_READ_LE32(p + MZ_ZIP_CDH_LOCAL_HEADER_OFS) + 835 | + MZ_ZIP_LOCAL_DIR_HEADER_SIZE + comp_size) > pZip->m_archive_size) 836 | + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); 837 | + } 838 | + 839 | + bit_flags = MZ_READ_LE16(p + MZ_ZIP_CDH_BIT_FLAG_OFS); 840 | + if (bit_flags & MZ_ZIP_GENERAL_PURPOSE_BIT_FLAG_LOCAL_DIR_IS_MASKED) 841 | + return mz_zip_set_error(pZip, MZ_ZIP_UNSUPPORTED_ENCRYPTION); 842 | + 843 | if ((total_header_size = MZ_ZIP_CENTRAL_DIR_HEADER_SIZE + 844 | MZ_READ_LE16(p + MZ_ZIP_CDH_FILENAME_LEN_OFS) + 845 | MZ_READ_LE16(p + MZ_ZIP_CDH_EXTRA_LEN_OFS) + 846 | MZ_READ_LE16(p + MZ_ZIP_CDH_COMMENT_LEN_OFS)) > 847 | n) 848 | - return MZ_FALSE; 849 | + return mz_zip_set_error(pZip, MZ_ZIP_INVALID_HEADER_OR_CORRUPTED); 850 | + 851 | n -= total_header_size; 852 | p += total_header_size; 853 | } 854 | diff --git a/contrib/zip/src/zip.c b/contrib/zip/src/zip.c 855 | index ff3a8fe1..1abcfd8f 100644 856 | --- a/contrib/zip/src/zip.c 857 | +++ b/contrib/zip/src/zip.c 858 | @@ -24,7 +24,6 @@ 859 | ((((P)[0] >= 'A' && (P)[0] <= 'Z') || ((P)[0] >= 'a' && (P)[0] <= 'z')) && \ 860 | (P)[1] == ':') 861 | #define FILESYSTEM_PREFIX_LEN(P) (HAS_DEVICE(P) ? 2 : 0) 862 | -#define ISSLASH(C) ((C) == '/' || (C) == '\\') 863 | 864 | #else 865 | 866 | @@ -48,7 +47,7 @@ int symlink(const char *target, const char *linkpath); // needed on Linux 867 | #endif 868 | 869 | #ifndef ISSLASH 870 | -#define ISSLASH(C) ((C) == '/') 871 | +#define ISSLASH(C) ((C) == '/' || (C) == '\\') 872 | #endif 873 | 874 | #define CLEANUP(ptr) \ 875 | @@ -78,26 +77,34 @@ static const char *base_name(const char *name) { 876 | return base; 877 | } 878 | 879 | -static int mkpath(const char *path) { 880 | - char const *p; 881 | +static int mkpath(char *path) { 882 | + char *p; 883 | char npath[MAX_PATH + 1]; 884 | int len = 0; 885 | int has_device = HAS_DEVICE(path); 886 | 887 | memset(npath, 0, MAX_PATH + 1); 888 | - 889 | -#ifdef _WIN32 890 | - // only on windows fix the path 891 | - npath[0] = path[0]; 892 | - npath[1] = path[1]; 893 | - len = 2; 894 | -#endif // _WIN32 895 | - 896 | + if (has_device) { 897 | + // only on windows 898 | + npath[0] = path[0]; 899 | + npath[1] = path[1]; 900 | + len = 2; 901 | + } 902 | for (p = path + len; *p && len < MAX_PATH; p++) { 903 | if (ISSLASH(*p) && ((!has_device && len > 0) || (has_device && len > 2))) { 904 | - if (MKDIR(npath) == -1) 905 | - if (errno != EEXIST) 906 | +#if defined(_WIN32) || defined(__WIN32__) || defined(_MSC_VER) || \ 907 | + defined(__MINGW32__) 908 | +#else 909 | + if ('\\' == *p) { 910 | + *p = '/'; 911 | + } 912 | +#endif 913 | + 914 | + if (MKDIR(npath) == -1) { 915 | + if (errno != EEXIST) { 916 | return -1; 917 | + } 918 | + } 919 | } 920 | npath[len++] = *p; 921 | } 922 | @@ -279,7 +286,14 @@ int zip_entry_open(struct zip_t *zip, const char *entryname) { 923 | zip->entry.header_offset = zip->archive.m_archive_size; 924 | memset(zip->entry.header, 0, MZ_ZIP_LOCAL_DIR_HEADER_SIZE * sizeof(mz_uint8)); 925 | zip->entry.method = 0; 926 | + 927 | + // UNIX or APPLE 928 | +#if MZ_PLATFORM == 3 || MZ_PLATFORM == 19 929 | + // regular file with rw-r--r-- persmissions 930 | + zip->entry.external_attr = (mz_uint32)(0100644) << 16; 931 | +#else 932 | zip->entry.external_attr = 0; 933 | +#endif 934 | 935 | num_alignment_padding_bytes = 936 | mz_zip_writer_compute_padding_needed_for_file_alignment(pzip); 937 | @@ -660,7 +674,7 @@ ssize_t zip_entry_noallocread(struct zip_t *zip, void *buf, size_t bufsize) { 938 | } 939 | 940 | if (!mz_zip_reader_extract_to_mem_no_alloc(pzip, (mz_uint)zip->entry.index, 941 | - buf, bufsize, 0, NULL, 0)) { 942 | + buf, bufsize, 0, NULL, 0)) { 943 | return -1; 944 | } 945 | 946 | @@ -670,10 +684,7 @@ ssize_t zip_entry_noallocread(struct zip_t *zip, void *buf, size_t bufsize) { 947 | int zip_entry_fread(struct zip_t *zip, const char *filename) { 948 | mz_zip_archive *pzip = NULL; 949 | mz_uint idx; 950 | -#if defined(_MSC_VER) 951 | -#else 952 | mz_uint32 xattr = 0; 953 | -#endif 954 | mz_zip_archive_file_stat info; 955 | 956 | if (!zip) { 957 | @@ -875,12 +886,19 @@ int zip_extract(const char *zipname, const char *dir, 958 | goto out; 959 | } 960 | 961 | - if ((((info.m_version_made_by >> 8) == 3) || ((info.m_version_made_by >> 8) == 19)) // if zip is produced on Unix or macOS (3 and 19 from section 4.4.2.2 of zip standard) 962 | - && info.m_external_attr & (0x20 << 24)) { // and has sym link attribute (0x80 is file, 0x40 is directory) 963 | + if ((((info.m_version_made_by >> 8) == 3) || 964 | + ((info.m_version_made_by >> 8) == 965 | + 19)) // if zip is produced on Unix or macOS (3 and 19 from 966 | + // section 4.4.2.2 of zip standard) 967 | + && info.m_external_attr & 968 | + (0x20 << 24)) { // and has sym link attribute (0x80 is file, 0x40 969 | + // is directory) 970 | #if defined(_WIN32) || defined(__WIN32__) || defined(_MSC_VER) || \ 971 | defined(__MINGW32__) 972 | -#else 973 | - if (info.m_uncomp_size > MAX_PATH || !mz_zip_reader_extract_to_mem_no_alloc(&zip_archive, i, symlink_to, MAX_PATH, 0, NULL, 0)) { 974 | +#else 975 | + if (info.m_uncomp_size > MAX_PATH || 976 | + !mz_zip_reader_extract_to_mem_no_alloc(&zip_archive, i, symlink_to, 977 | + MAX_PATH, 0, NULL, 0)) { 978 | goto out; 979 | } 980 | symlink_to[info.m_uncomp_size] = '\0'; 981 | diff --git a/contrib/zip/src/zip.h b/contrib/zip/src/zip.h 982 | index 5f39df50..a48d64d6 100644 983 | --- a/contrib/zip/src/zip.h 984 | +++ b/contrib/zip/src/zip.h 985 | @@ -20,241 +20,240 @@ extern "C" { 986 | #endif 987 | 988 | #if !defined(_SSIZE_T_DEFINED) && !defined(_SSIZE_T_DEFINED_) && \ 989 | - !defined(_SSIZE_T) && !defined(_SSIZE_T_) && !defined(__ssize_t_defined) 990 | -#define _SSIZE_T 991 | + !defined(__DEFINED_ssize_t) && !defined(__ssize_t_defined) && \ 992 | + !defined(_SSIZE_T) && !defined(_SSIZE_T_) 993 | + 994 | // 64-bit Windows is the only mainstream platform 995 | // where sizeof(long) != sizeof(void*) 996 | #ifdef _WIN64 997 | -typedef long long ssize_t; /* byte count or error */ 998 | +typedef long long ssize_t; /* byte count or error */ 999 | #else 1000 | -typedef long ssize_t; /* byte count or error */ 1001 | +typedef long ssize_t; /* byte count or error */ 1002 | #endif 1003 | + 1004 | +#define _SSIZE_T_DEFINED 1005 | +#define _SSIZE_T_DEFINED_ 1006 | +#define __DEFINED_ssize_t 1007 | +#define __ssize_t_defined 1008 | +#define _SSIZE_T 1009 | +#define _SSIZE_T_ 1010 | + 1011 | #endif 1012 | 1013 | #ifndef MAX_PATH 1014 | #define MAX_PATH 32767 /* # chars in a path name including NULL */ 1015 | #endif 1016 | 1017 | +/** 1018 | + * @mainpage 1019 | + * 1020 | + * Documenation for @ref zip. 1021 | + */ 1022 | + 1023 | +/** 1024 | + * @addtogroup zip 1025 | + * @{ 1026 | + */ 1027 | + 1028 | +/** 1029 | + * Default zip compression level. 1030 | + */ 1031 | + 1032 | #define ZIP_DEFAULT_COMPRESSION_LEVEL 6 1033 | 1034 | -/* 1035 | - This data structure is used throughout the library to represent zip archive 1036 | - - forward declaration. 1037 | -*/ 1038 | +/** 1039 | + * @struct zip_t 1040 | + * 1041 | + * This data structure is used throughout the library to represent zip archive - 1042 | + * forward declaration. 1043 | + */ 1044 | struct zip_t; 1045 | 1046 | -/* 1047 | - Opens zip archive with compression level using the given mode. 1048 | - 1049 | - Args: 1050 | - zipname: zip archive file name. 1051 | - level: compression level (0-9 are the standard zlib-style levels). 1052 | - mode: file access mode. 1053 | - 'r': opens a file for reading/extracting (the file must exists). 1054 | - 'w': creates an empty file for writing. 1055 | - 'a': appends to an existing archive. 1056 | - 1057 | - Returns: 1058 | - The zip archive handler or NULL on error 1059 | -*/ 1060 | +/** 1061 | + * Opens zip archive with compression level using the given mode. 1062 | + * 1063 | + * @param zipname zip archive file name. 1064 | + * @param level compression level (0-9 are the standard zlib-style levels). 1065 | + * @param mode file access mode. 1066 | + * - 'r': opens a file for reading/extracting (the file must exists). 1067 | + * - 'w': creates an empty file for writing. 1068 | + * - 'a': appends to an existing archive. 1069 | + * 1070 | + * @return the zip archive handler or NULL on error 1071 | + */ 1072 | extern struct zip_t *zip_open(const char *zipname, int level, char mode); 1073 | 1074 | -/* 1075 | - Closes the zip archive, releases resources - always finalize. 1076 | - 1077 | - Args: 1078 | - zip: zip archive handler. 1079 | -*/ 1080 | +/** 1081 | + * Closes the zip archive, releases resources - always finalize. 1082 | + * 1083 | + * @param zip zip archive handler. 1084 | + */ 1085 | extern void zip_close(struct zip_t *zip); 1086 | 1087 | -/* 1088 | - Opens an entry by name in the zip archive. 1089 | - For zip archive opened in 'w' or 'a' mode the function will append 1090 | - a new entry. In readonly mode the function tries to locate the entry 1091 | - in global dictionary. 1092 | - 1093 | - Args: 1094 | - zip: zip archive handler. 1095 | - entryname: an entry name in local dictionary. 1096 | - 1097 | - Returns: 1098 | - The return code - 0 on success, negative number (< 0) on error. 1099 | -*/ 1100 | +/** 1101 | + * Opens an entry by name in the zip archive. 1102 | + * 1103 | + * For zip archive opened in 'w' or 'a' mode the function will append 1104 | + * a new entry. In readonly mode the function tries to locate the entry 1105 | + * in global dictionary. 1106 | + * 1107 | + * @param zip zip archive handler. 1108 | + * @param entryname an entry name in local dictionary. 1109 | + * 1110 | + * @return the return code - 0 on success, negative number (< 0) on error. 1111 | + */ 1112 | extern int zip_entry_open(struct zip_t *zip, const char *entryname); 1113 | 1114 | -/* 1115 | - Opens a new entry by index in the zip archive. 1116 | - This function is only valid if zip archive was opened in 'r' (readonly) mode. 1117 | - 1118 | - Args: 1119 | - zip: zip archive handler. 1120 | - index: index in local dictionary. 1121 | - 1122 | - Returns: 1123 | - The return code - 0 on success, negative number (< 0) on error. 1124 | -*/ 1125 | +/** 1126 | + * Opens a new entry by index in the zip archive. 1127 | + * 1128 | + * This function is only valid if zip archive was opened in 'r' (readonly) mode. 1129 | + * 1130 | + * @param zip zip archive handler. 1131 | + * @param index index in local dictionary. 1132 | + * 1133 | + * @return the return code - 0 on success, negative number (< 0) on error. 1134 | + */ 1135 | extern int zip_entry_openbyindex(struct zip_t *zip, int index); 1136 | 1137 | -/* 1138 | - Closes a zip entry, flushes buffer and releases resources. 1139 | - 1140 | - Args: 1141 | - zip: zip archive handler. 1142 | - 1143 | - Returns: 1144 | - The return code - 0 on success, negative number (< 0) on error. 1145 | -*/ 1146 | +/** 1147 | + * Closes a zip entry, flushes buffer and releases resources. 1148 | + * 1149 | + * @param zip zip archive handler. 1150 | + * 1151 | + * @return the return code - 0 on success, negative number (< 0) on error. 1152 | + */ 1153 | extern int zip_entry_close(struct zip_t *zip); 1154 | 1155 | -/* 1156 | - Returns a local name of the current zip entry. 1157 | - The main difference between user's entry name and local entry name 1158 | - is optional relative path. 1159 | - Following .ZIP File Format Specification - the path stored MUST not contain 1160 | - a drive or device letter, or a leading slash. 1161 | - All slashes MUST be forward slashes '/' as opposed to backwards slashes '\' 1162 | - for compatibility with Amiga and UNIX file systems etc. 1163 | - 1164 | - Args: 1165 | - zip: zip archive handler. 1166 | - 1167 | - Returns: 1168 | - The pointer to the current zip entry name, or NULL on error. 1169 | -*/ 1170 | +/** 1171 | + * Returns a local name of the current zip entry. 1172 | + * 1173 | + * The main difference between user's entry name and local entry name 1174 | + * is optional relative path. 1175 | + * Following .ZIP File Format Specification - the path stored MUST not contain 1176 | + * a drive or device letter, or a leading slash. 1177 | + * All slashes MUST be forward slashes '/' as opposed to backwards slashes '\' 1178 | + * for compatibility with Amiga and UNIX file systems etc. 1179 | + * 1180 | + * @param zip: zip archive handler. 1181 | + * 1182 | + * @return the pointer to the current zip entry name, or NULL on error. 1183 | + */ 1184 | extern const char *zip_entry_name(struct zip_t *zip); 1185 | 1186 | -/* 1187 | - Returns an index of the current zip entry. 1188 | - 1189 | - Args: 1190 | - zip: zip archive handler. 1191 | - 1192 | - Returns: 1193 | - The index on success, negative number (< 0) on error. 1194 | -*/ 1195 | +/** 1196 | + * Returns an index of the current zip entry. 1197 | + * 1198 | + * @param zip zip archive handler. 1199 | + * 1200 | + * @return the index on success, negative number (< 0) on error. 1201 | + */ 1202 | extern int zip_entry_index(struct zip_t *zip); 1203 | 1204 | -/* 1205 | - Determines if the current zip entry is a directory entry. 1206 | - 1207 | - Args: 1208 | - zip: zip archive handler. 1209 | - 1210 | - Returns: 1211 | - The return code - 1 (true), 0 (false), negative number (< 0) on error. 1212 | -*/ 1213 | +/** 1214 | + * Determines if the current zip entry is a directory entry. 1215 | + * 1216 | + * @param zip zip archive handler. 1217 | + * 1218 | + * @return the return code - 1 (true), 0 (false), negative number (< 0) on 1219 | + * error. 1220 | + */ 1221 | extern int zip_entry_isdir(struct zip_t *zip); 1222 | 1223 | -/* 1224 | - Returns an uncompressed size of the current zip entry. 1225 | - 1226 | - Args: 1227 | - zip: zip archive handler. 1228 | - 1229 | - Returns: 1230 | - The uncompressed size in bytes. 1231 | -*/ 1232 | +/** 1233 | + * Returns an uncompressed size of the current zip entry. 1234 | + * 1235 | + * @param zip zip archive handler. 1236 | + * 1237 | + * @return the uncompressed size in bytes. 1238 | + */ 1239 | extern unsigned long long zip_entry_size(struct zip_t *zip); 1240 | 1241 | -/* 1242 | - Returns CRC-32 checksum of the current zip entry. 1243 | - 1244 | - Args: 1245 | - zip: zip archive handler. 1246 | - 1247 | - Returns: 1248 | - The CRC-32 checksum. 1249 | -*/ 1250 | +/** 1251 | + * Returns CRC-32 checksum of the current zip entry. 1252 | + * 1253 | + * @param zip zip archive handler. 1254 | + * 1255 | + * @return the CRC-32 checksum. 1256 | + */ 1257 | extern unsigned int zip_entry_crc32(struct zip_t *zip); 1258 | 1259 | -/* 1260 | - Compresses an input buffer for the current zip entry. 1261 | - 1262 | - Args: 1263 | - zip: zip archive handler. 1264 | - buf: input buffer. 1265 | - bufsize: input buffer size (in bytes). 1266 | - 1267 | - Returns: 1268 | - The return code - 0 on success, negative number (< 0) on error. 1269 | -*/ 1270 | +/** 1271 | + * Compresses an input buffer for the current zip entry. 1272 | + * 1273 | + * @param zip zip archive handler. 1274 | + * @param buf input buffer. 1275 | + * @param bufsize input buffer size (in bytes). 1276 | + * 1277 | + * @return the return code - 0 on success, negative number (< 0) on error. 1278 | + */ 1279 | extern int zip_entry_write(struct zip_t *zip, const void *buf, size_t bufsize); 1280 | 1281 | -/* 1282 | - Compresses a file for the current zip entry. 1283 | - 1284 | - Args: 1285 | - zip: zip archive handler. 1286 | - filename: input file. 1287 | - 1288 | - Returns: 1289 | - The return code - 0 on success, negative number (< 0) on error. 1290 | -*/ 1291 | +/** 1292 | + * Compresses a file for the current zip entry. 1293 | + * 1294 | + * @param zip zip archive handler. 1295 | + * @param filename input file. 1296 | + * 1297 | + * @return the return code - 0 on success, negative number (< 0) on error. 1298 | + */ 1299 | extern int zip_entry_fwrite(struct zip_t *zip, const char *filename); 1300 | 1301 | -/* 1302 | - Extracts the current zip entry into output buffer. 1303 | - The function allocates sufficient memory for a output buffer. 1304 | - 1305 | - Args: 1306 | - zip: zip archive handler. 1307 | - buf: output buffer. 1308 | - bufsize: output buffer size (in bytes). 1309 | - 1310 | - Note: 1311 | - - remember to release memory allocated for a output buffer. 1312 | - - for large entries, please take a look at zip_entry_extract function. 1313 | - 1314 | - Returns: 1315 | - The return code - the number of bytes actually read on success. 1316 | - Otherwise a -1 on error. 1317 | -*/ 1318 | +/** 1319 | + * Extracts the current zip entry into output buffer. 1320 | + * 1321 | + * The function allocates sufficient memory for a output buffer. 1322 | + * 1323 | + * @param zip zip archive handler. 1324 | + * @param buf output buffer. 1325 | + * @param bufsize output buffer size (in bytes). 1326 | + * 1327 | + * @note remember to release memory allocated for a output buffer. 1328 | + * for large entries, please take a look at zip_entry_extract function. 1329 | + * 1330 | + * @return the return code - the number of bytes actually read on success. 1331 | + * Otherwise a -1 on error. 1332 | + */ 1333 | extern ssize_t zip_entry_read(struct zip_t *zip, void **buf, size_t *bufsize); 1334 | 1335 | -/* 1336 | - Extracts the current zip entry into a memory buffer using no memory 1337 | - allocation. 1338 | - 1339 | - Args: 1340 | - zip: zip archive handler. 1341 | - buf: preallocated output buffer. 1342 | - bufsize: output buffer size (in bytes). 1343 | - 1344 | - Note: 1345 | - - ensure supplied output buffer is large enough. 1346 | - - zip_entry_size function (returns uncompressed size for the current entry) 1347 | - can be handy to estimate how big buffer is needed. 1348 | - - for large entries, please take a look at zip_entry_extract function. 1349 | - 1350 | - Returns: 1351 | - The return code - the number of bytes actually read on success. 1352 | - Otherwise a -1 on error (e.g. bufsize is not large enough). 1353 | -*/ 1354 | -extern ssize_t zip_entry_noallocread(struct zip_t *zip, void *buf, size_t bufsize); 1355 | - 1356 | -/* 1357 | - Extracts the current zip entry into output file. 1358 | - 1359 | - Args: 1360 | - zip: zip archive handler. 1361 | - filename: output file. 1362 | - 1363 | - Returns: 1364 | - The return code - 0 on success, negative number (< 0) on error. 1365 | -*/ 1366 | +/** 1367 | + * Extracts the current zip entry into a memory buffer using no memory 1368 | + * allocation. 1369 | + * 1370 | + * @param zip zip archive handler. 1371 | + * @param buf preallocated output buffer. 1372 | + * @param bufsize output buffer size (in bytes). 1373 | + * 1374 | + * @note ensure supplied output buffer is large enough. 1375 | + * zip_entry_size function (returns uncompressed size for the current 1376 | + * entry) can be handy to estimate how big buffer is needed. for large 1377 | + * entries, please take a look at zip_entry_extract function. 1378 | + * 1379 | + * @return the return code - the number of bytes actually read on success. 1380 | + * Otherwise a -1 on error (e.g. bufsize is not large enough). 1381 | + */ 1382 | +extern ssize_t zip_entry_noallocread(struct zip_t *zip, void *buf, 1383 | + size_t bufsize); 1384 | + 1385 | +/** 1386 | + * Extracts the current zip entry into output file. 1387 | + * 1388 | + * @param zip zip archive handler. 1389 | + * @param filename output file. 1390 | + * 1391 | + * @return the return code - 0 on success, negative number (< 0) on error. 1392 | + */ 1393 | extern int zip_entry_fread(struct zip_t *zip, const char *filename); 1394 | 1395 | -/* 1396 | - Extracts the current zip entry using a callback function (on_extract). 1397 | - 1398 | - Args: 1399 | - zip: zip archive handler. 1400 | - on_extract: callback function. 1401 | - arg: opaque pointer (optional argument, 1402 | - which you can pass to the on_extract callback) 1403 | - 1404 | - Returns: 1405 | - The return code - 0 on success, negative number (< 0) on error. 1406 | +/** 1407 | + * Extracts the current zip entry using a callback function (on_extract). 1408 | + * 1409 | + * @param zip zip archive handler. 1410 | + * @param on_extract callback function. 1411 | + * @param arg opaque pointer (optional argument, which you can pass to the 1412 | + * on_extract callback) 1413 | + * 1414 | + * @return the return code - 0 on success, negative number (< 0) on error. 1415 | */ 1416 | extern int 1417 | zip_entry_extract(struct zip_t *zip, 1418 | @@ -262,53 +261,49 @@ zip_entry_extract(struct zip_t *zip, 1419 | const void *data, size_t size), 1420 | void *arg); 1421 | 1422 | -/* 1423 | - Returns the number of all entries (files and directories) in the zip archive. 1424 | - 1425 | - Args: 1426 | - zip: zip archive handler. 1427 | - 1428 | - Returns: 1429 | - The return code - the number of entries on success, 1430 | - negative number (< 0) on error. 1431 | -*/ 1432 | +/** 1433 | + * Returns the number of all entries (files and directories) in the zip archive. 1434 | + * 1435 | + * @param zip zip archive handler. 1436 | + * 1437 | + * @return the return code - the number of entries on success, negative number 1438 | + * (< 0) on error. 1439 | + */ 1440 | extern int zip_total_entries(struct zip_t *zip); 1441 | 1442 | -/* 1443 | - Creates a new archive and puts files into a single zip archive. 1444 | - 1445 | - Args: 1446 | - zipname: zip archive file. 1447 | - filenames: input files. 1448 | - len: number of input files. 1449 | - 1450 | - Returns: 1451 | - The return code - 0 on success, negative number (< 0) on error. 1452 | -*/ 1453 | +/** 1454 | + * Creates a new archive and puts files into a single zip archive. 1455 | + * 1456 | + * @param zipname zip archive file. 1457 | + * @param filenames input files. 1458 | + * @param len: number of input files. 1459 | + * 1460 | + * @return the return code - 0 on success, negative number (< 0) on error. 1461 | + */ 1462 | extern int zip_create(const char *zipname, const char *filenames[], size_t len); 1463 | 1464 | -/* 1465 | - Extracts a zip archive file into directory. 1466 | - 1467 | - If on_extract_entry is not NULL, the callback will be called after 1468 | - successfully extracted each zip entry. 1469 | - Returning a negative value from the callback will cause abort and return an 1470 | - error. The last argument (void *arg) is optional, which you can use to pass 1471 | - data to the on_extract_entry callback. 1472 | - 1473 | - Args: 1474 | - zipname: zip archive file. 1475 | - dir: output directory. 1476 | - on_extract_entry: on extract callback. 1477 | - arg: opaque pointer. 1478 | - 1479 | - Returns: 1480 | - The return code - 0 on success, negative number (< 0) on error. 1481 | -*/ 1482 | +/** 1483 | + * Extracts a zip archive file into directory. 1484 | + * 1485 | + * If on_extract_entry is not NULL, the callback will be called after 1486 | + * successfully extracted each zip entry. 1487 | + * Returning a negative value from the callback will cause abort and return an 1488 | + * error. The last argument (void *arg) is optional, which you can use to pass 1489 | + * data to the on_extract_entry callback. 1490 | + * 1491 | + * @param zipname zip archive file. 1492 | + * @param dir output directory. 1493 | + * @param on_extract_entry on extract callback. 1494 | + * @param arg opaque pointer. 1495 | + * 1496 | + * @return the return code - 0 on success, negative number (< 0) on error. 1497 | + */ 1498 | extern int zip_extract(const char *zipname, const char *dir, 1499 | int (*on_extract_entry)(const char *filename, void *arg), 1500 | void *arg); 1501 | 1502 | +/** @} */ 1503 | + 1504 | #ifdef __cplusplus 1505 | } 1506 | #endif 1507 | diff --git a/contrib/zip/test/CMakeLists.txt b/contrib/zip/test/CMakeLists.txt 1508 | index 9b2a8db1..cc060b00 100644 1509 | --- a/contrib/zip/test/CMakeLists.txt 1510 | +++ b/contrib/zip/test/CMakeLists.txt 1511 | @@ -1,19 +1,16 @@ 1512 | cmake_minimum_required(VERSION 2.8) 1513 | 1514 | -if ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "AppleClang") 1515 | - if(ENABLE_COVERAGE) 1516 | - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g ") 1517 | - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0") 1518 | - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs") 1519 | - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ftest-coverage") 1520 | - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage") 1521 | - endif() 1522 | -endif () 1523 | - 1524 | # test 1525 | -include_directories(../src) 1526 | -add_executable(test.exe test.c ../src/zip.c) 1527 | -add_executable(test_miniz.exe test_miniz.c) 1528 | +set(test_out test.out) 1529 | +set(test_miniz_out test_miniz.out) 1530 | + 1531 | +add_executable(${test_out} test.c) 1532 | +target_link_libraries(${test_out} zip) 1533 | +add_executable(${test_miniz_out} test_miniz.c) 1534 | +target_link_libraries(${test_miniz_out} zip) 1535 | + 1536 | +add_test(NAME ${test_out} COMMAND ${test_out}) 1537 | +add_test(NAME ${test_miniz_out} COMMAND ${test_miniz_out}) 1538 | 1539 | -add_test(NAME test COMMAND test.exe) 1540 | -add_test(NAME test_miniz COMMAND test_miniz.exe) 1541 | +set(test_out ${test_out} PARENT_SCOPE) 1542 | +set(test_miniz_out ${test_miniz_out} PARENT_SCOPE) 1543 | diff --git a/contrib/zip/test/test.c b/contrib/zip/test/test.c 1544 | index 45443053..a9b2ddab 100644 1545 | --- a/contrib/zip/test/test.c 1546 | +++ b/contrib/zip/test/test.c 1547 | @@ -29,6 +29,8 @@ 1548 | #define XFILE "7.txt\0" 1549 | #define XMODE 0100777 1550 | 1551 | +#define UNIXMODE 0100644 1552 | + 1553 | #define UNUSED(x) (void)x 1554 | 1555 | static int total_entries = 0; 1556 | @@ -102,7 +104,8 @@ static void test_read(void) { 1557 | assert(0 == zip_entry_close(zip)); 1558 | free(buf); 1559 | buf = NULL; 1560 | - 1561 | + bufsize = 0; 1562 | + 1563 | assert(0 == zip_entry_open(zip, "test/test-2.txt")); 1564 | assert(strlen(TESTDATA2) == zip_entry_size(zip)); 1565 | assert(CRC32DATA2 == zip_entry_crc32(zip)); 1566 | @@ -131,7 +134,8 @@ static void test_read(void) { 1567 | assert(0 == zip_entry_close(zip)); 1568 | free(buf); 1569 | buf = NULL; 1570 | - 1571 | + bufsize = 0; 1572 | + 1573 | buftmp = strlen(TESTDATA1); 1574 | buf = calloc(buftmp, sizeof(char)); 1575 | assert(0 == zip_entry_open(zip, "test/test-1.txt")); 1576 | @@ -433,6 +437,35 @@ static void test_mtime(void) { 1577 | remove(ZIPNAME); 1578 | } 1579 | 1580 | +static void test_unix_permissions(void) { 1581 | +#if defined(_WIN64) || defined(_WIN32) || defined(__WIN32__) 1582 | +#else 1583 | + // UNIX or APPLE 1584 | + struct MZ_FILE_STAT_STRUCT file_stats; 1585 | + 1586 | + remove(ZIPNAME); 1587 | + 1588 | + struct zip_t *zip = zip_open(ZIPNAME, ZIP_DEFAULT_COMPRESSION_LEVEL, 'w'); 1589 | + assert(zip != NULL); 1590 | + 1591 | + assert(0 == zip_entry_open(zip, RFILE)); 1592 | + assert(0 == zip_entry_write(zip, TESTDATA1, strlen(TESTDATA1))); 1593 | + assert(0 == zip_entry_close(zip)); 1594 | + 1595 | + zip_close(zip); 1596 | + 1597 | + remove(RFILE); 1598 | + 1599 | + assert(0 == zip_extract(ZIPNAME, ".", NULL, NULL)); 1600 | + 1601 | + assert(0 == MZ_FILE_STAT(RFILE, &file_stats)); 1602 | + assert(UNIXMODE == file_stats.st_mode); 1603 | + 1604 | + remove(RFILE); 1605 | + remove(ZIPNAME); 1606 | +#endif 1607 | +} 1608 | + 1609 | int main(int argc, char *argv[]) { 1610 | UNUSED(argc); 1611 | UNUSED(argv); 1612 | @@ -453,6 +486,7 @@ int main(int argc, char *argv[]) { 1613 | test_write_permissions(); 1614 | test_exe_permissions(); 1615 | test_mtime(); 1616 | + test_unix_permissions(); 1617 | 1618 | remove(ZIPNAME); 1619 | return 0; 1620 | diff --git a/contrib/zip/test/test_miniz.c b/contrib/zip/test/test_miniz.c 1621 | index ebc0564d..babcaecd 100644 1622 | --- a/contrib/zip/test/test_miniz.c 1623 | +++ b/contrib/zip/test/test_miniz.c 1624 | @@ -23,16 +23,39 @@ int main(int argc, char *argv[]) { 1625 | uint step = 0; 1626 | int cmp_status; 1627 | uLong src_len = (uLong)strlen(s_pStr); 1628 | - uLong cmp_len = compressBound(src_len); 1629 | uLong uncomp_len = src_len; 1630 | + uLong cmp_len; 1631 | uint8 *pCmp, *pUncomp; 1632 | + size_t sz; 1633 | uint total_succeeded = 0; 1634 | (void)argc, (void)argv; 1635 | 1636 | printf("miniz.c version: %s\n", MZ_VERSION); 1637 | 1638 | do { 1639 | + pCmp = (uint8 *)tdefl_compress_mem_to_heap(s_pStr, src_len, &cmp_len, 0); 1640 | + if (!pCmp) { 1641 | + printf("tdefl_compress_mem_to_heap failed\n"); 1642 | + return EXIT_FAILURE; 1643 | + } 1644 | + if (src_len <= cmp_len) { 1645 | + printf("tdefl_compress_mem_to_heap failed: from %u to %u bytes\n", 1646 | + (mz_uint32)uncomp_len, (mz_uint32)cmp_len); 1647 | + free(pCmp); 1648 | + return EXIT_FAILURE; 1649 | + } 1650 | + 1651 | + sz = tdefl_compress_mem_to_mem(pCmp, cmp_len, s_pStr, src_len, 0); 1652 | + if (sz != cmp_len) { 1653 | + printf("tdefl_compress_mem_to_mem failed: expected %u, got %u\n", 1654 | + (mz_uint32)cmp_len, (mz_uint32)sz); 1655 | + free(pCmp); 1656 | + return EXIT_FAILURE; 1657 | + } 1658 | + 1659 | // Allocate buffers to hold compressed and uncompressed data. 1660 | + free(pCmp); 1661 | + cmp_len = compressBound(src_len); 1662 | pCmp = (mz_uint8 *)malloc((size_t)cmp_len); 1663 | pUncomp = (mz_uint8 *)malloc((size_t)src_len); 1664 | if ((!pCmp) || (!pUncomp)) { 1665 | -------------------------------------------------------------------------------- /recipes-graphics/vulkan/assimp/use-GNUInstallDirs-where-possible.patch: -------------------------------------------------------------------------------- 1 | From cbf94fd62ff831879d10f99aa7766d391ae8a9b7 Mon Sep 17 00:00:00 2001 2 | From: =?UTF-8?q?Victor=20Matar=C3=A9?= 3 | Date: Tue, 31 Mar 2020 21:30:07 +0200 4 | Subject: [PATCH] use GNUInstallDirs where possible 5 | 6 | Emulate the CMAKE_INSTALL_FULL_* variables on non-Unix systems and 7 | disable redefining FHS-mandated install locations via user-editable 8 | ASSIMP_*_INSTALL_DIR variables. Instead, if it REALLY proves necessary, 9 | Unix users can edit the advanced, canonical CMAKE_INSTALL_* variables. 10 | --- 11 | CMakeLists.txt | 36 ++++++++++++++++++++++------------ 12 | assimp.pc.in | 6 ++---- 13 | assimpTargets-debug.cmake.in | 20 +++++++++---------- 14 | assimpTargets-release.cmake.in | 18 ++++++++--------- 15 | assimpTargets.cmake.in | 15 +------------- 16 | 5 files changed, 45 insertions(+), 50 deletions(-) 17 | 18 | Upstream-Status: Backport 19 | Comment: Additionally remove setting of ASSIMP_LIBRARY_DIRS, ASSIMP_INCLUDE_DIRS 20 | and INTERFACE_INCLUDE_DIRECTORIES as default cross compile paths are enough 21 | and setting them manually adds non-existing paths to CMake modules 22 | 23 | Signed-off-by: Ranjitsinh Rathod 24 | 25 | diff --git a/CMakeLists.txt b/CMakeLists.txt 26 | index dcafb649f5..c23c0df33e 100644 27 | --- a/CMakeLists.txt 28 | +++ b/CMakeLists.txt 29 | @@ -230,11 +230,6 @@ SET(LIBASSIMP-DEV_COMPONENT "libassimp${ASSIMP_VERSION_MAJOR}.${ASSIMP_VERSION_M 30 | SET(CPACK_COMPONENTS_ALL assimp-bin ${LIBASSIMP_COMPONENT} ${LIBASSIMP-DEV_COMPONENT} assimp-dev) 31 | SET(ASSIMP_LIBRARY_SUFFIX "" CACHE STRING "Suffix to append to library names") 32 | 33 | -IF( UNIX ) 34 | - # Use GNUInstallDirs for Unix predefined directories 35 | - INCLUDE(GNUInstallDirs) 36 | -ENDIF( UNIX ) 37 | - 38 | # Grouped compiler settings 39 | IF ((CMAKE_C_COMPILER_ID MATCHES "GNU") AND NOT CMAKE_COMPILER_IS_MINGW) 40 | IF(NOT HUNTER_ENABLED) 41 | @@ -329,14 +324,6 @@ IF ( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR ) 42 | SET( CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_HOME_DIRECTORY}/bin" ) 43 | ENDIF ( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR ) 44 | 45 | -# Cache these to allow the user to override them manually. 46 | -SET( ASSIMP_LIB_INSTALL_DIR "lib" CACHE STRING 47 | - "Path the built library files are installed to." ) 48 | -SET( ASSIMP_INCLUDE_INSTALL_DIR "include" CACHE STRING 49 | - "Path the header files are installed to." ) 50 | -SET( ASSIMP_BIN_INSTALL_DIR "bin" CACHE STRING 51 | - "Path the tool executables are installed to." ) 52 | - 53 | get_cmake_property(is_multi_config GENERATOR_IS_MULTI_CONFIG) 54 | 55 | IF (INJECT_DEBUG_POSTFIX AND (is_multi_config OR CMAKE_BUILD_TYPE STREQUAL "Debug")) 56 | @@ -391,6 +378,29 @@ IF(HUNTER_ENABLED) 57 | ) 58 | ELSE(HUNTER_ENABLED) 59 | # cmake configuration files 60 | + 61 | + IF( UNIX ) 62 | + # Use GNUInstallDirs for Unix predefined directories 63 | + INCLUDE(GNUInstallDirs) 64 | + 65 | + SET( ASSIMP_LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR}) 66 | + SET( ASSIMP_INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) 67 | + SET( ASSIMP_BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}) 68 | + ELSE( UNIX ) 69 | + # Cache these to allow the user to override them on non-Unix platforms 70 | + SET( ASSIMP_LIB_INSTALL_DIR "lib" CACHE STRING 71 | + "Path the built library files are installed to." ) 72 | + SET( ASSIMP_INCLUDE_INSTALL_DIR "include" CACHE STRING 73 | + "Path the header files are installed to." ) 74 | + SET( ASSIMP_BIN_INSTALL_DIR "bin" CACHE STRING 75 | + "Path the tool executables are installed to." ) 76 | + 77 | + SET(CMAKE_INSTALL_FULL_INCLUDEDIR ${CMAKE_INSTALL_PREFIX}/${ASSIMP_INCLUDE_INSTALL_DIR}) 78 | + SET(CMAKE_INSTALL_FULL_LIBDIR ${CMAKE_INSTALL_PREFIX}/${ASSIMP_LIB_INSTALL_DIR}) 79 | + SET(CMAKE_INSTALL_FULL_BINDIR ${CMAKE_INSTALL_PREFIX}/${ASSIMP_BIN_INSTALL_DIR}) 80 | + ENDIF( UNIX ) 81 | + 82 | + 83 | CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimp-config.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimp-config.cmake" @ONLY IMMEDIATE) 84 | CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/assimpTargets.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/assimpTargets.cmake" @ONLY IMMEDIATE) 85 | IF (is_multi_config) 86 | diff --git a/assimp.pc.in b/assimp.pc.in 87 | index c659e19f2c..555a3a1d3b 100644 88 | --- a/assimp.pc.in 89 | +++ b/assimp.pc.in 90 | @@ -1,7 +1,5 @@ 91 | -prefix=@CMAKE_INSTALL_PREFIX@ 92 | -exec_prefix=@CMAKE_INSTALL_PREFIX@/ 93 | -libdir=@CMAKE_INSTALL_PREFIX@/@ASSIMP_LIB_INSTALL_DIR@ 94 | -includedir=@CMAKE_INSTALL_PREFIX@/../include/@ASSIMP_INCLUDE_INSTALL_DIR@ 95 | +libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 96 | +includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 97 | 98 | Name: @CMAKE_PROJECT_NAME@ 99 | Description: Import various well-known 3D model formats in an uniform manner. 100 | diff --git a/assimpTargets-debug.cmake.in b/assimpTargets-debug.cmake.in 101 | index 1ebe2a6081..f5034c9349 100644 102 | --- a/assimpTargets-debug.cmake.in 103 | +++ b/assimpTargets-debug.cmake.in 104 | @@ -42,22 +42,22 @@ if(MSVC) 105 | # Import target "assimp::assimp" for configuration "Debug" 106 | set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) 107 | set_target_properties(assimp::assimp PROPERTIES 108 | - IMPORTED_IMPLIB_DEBUG "${_IMPORT_PREFIX}/lib/${importLibraryName}" 109 | - IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/bin/${sharedLibraryName}" 110 | + IMPORTED_IMPLIB_DEBUG "@CMAKE_INSTALL_FULL_LIBDIR@/${importLibraryName}" 111 | + IMPORTED_LOCATION_DEBUG "@CMAKE_INSTALL_FULL_BINDIR@/${sharedLibraryName}" 112 | ) 113 | list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp ) 114 | - list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "${_IMPORT_PREFIX}/lib/${importLibraryName}") 115 | - list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "${_IMPORT_PREFIX}/bin/${sharedLibraryName}" ) 116 | + list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${importLibraryName}") 117 | + list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_BINDIR@/${sharedLibraryName}" ) 118 | else() 119 | set(staticLibraryName "assimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@@CMAKE_STATIC_LIBRARY_SUFFIX@") 120 | 121 | # Import target "assimp::assimp" for configuration "Debug" 122 | set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG) 123 | set_target_properties(assimp::assimp PROPERTIES 124 | - IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/lib/${staticLibraryName}" 125 | + IMPORTED_LOCATION_DEBUG "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}" 126 | ) 127 | list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp ) 128 | - list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "${_IMPORT_PREFIX}/lib/${staticLibraryName}") 129 | + list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}") 130 | endif() 131 | 132 | else() 133 | @@ -66,17 +66,17 @@ else() 134 | set(sharedLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@@CMAKE_SHARED_LIBRARY_SUFFIX@.@ASSIMP_VERSION_MAJOR@") 135 | set_target_properties(assimp::assimp PROPERTIES 136 | IMPORTED_SONAME_DEBUG "${sharedLibraryName}" 137 | - IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/lib/${sharedLibraryName}" 138 | + IMPORTED_LOCATION_DEBUG "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}" 139 | ) 140 | list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp ) 141 | - list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "${_IMPORT_PREFIX}/lib/${sharedLibraryName}" ) 142 | + list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}" ) 143 | else() 144 | set(staticLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_DEBUG_POSTFIX@@CMAKE_STATIC_LIBRARY_SUFFIX@") 145 | set_target_properties(assimp::assimp PROPERTIES 146 | - IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/lib/${staticLibraryName}" 147 | + IMPORTED_LOCATION_DEBUG "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}" 148 | ) 149 | list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp ) 150 | - list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "${_IMPORT_PREFIX}/lib/${staticLibraryName}" ) 151 | + list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}" ) 152 | endif() 153 | endif() 154 | 155 | diff --git a/assimpTargets-release.cmake.in b/assimpTargets-release.cmake.in 156 | index f3db8f12cd..a416e8899b 100644 157 | --- a/assimpTargets-release.cmake.in 158 | +++ b/assimpTargets-release.cmake.in 159 | @@ -42,12 +42,12 @@ if(MSVC) 160 | # Import target "assimp::assimp" for configuration "Release" 161 | set_property(TARGET assimp::assimp APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) 162 | set_target_properties(assimp::assimp PROPERTIES 163 | - IMPORTED_IMPLIB_RELEASE "${_IMPORT_PREFIX}/lib/${importLibraryName}" 164 | - IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/bin/${sharedLibraryName}" 165 | + IMPORTED_IMPLIB_RELEASE "@CMAKE_INSTALL_FULL_LIBDIR@/${importLibraryName}" 166 | + IMPORTED_LOCATION_RELEASE "@CMAKE_INSTALL_FULL_BINDIR@/${sharedLibraryName}" 167 | ) 168 | list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp ) 169 | - list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "${_IMPORT_PREFIX}/lib/${importLibraryName}") 170 | - list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "${_IMPORT_PREFIX}/bin/${sharedLibraryName}" ) 171 | + list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${importLibraryName}") 172 | + list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_BINDIR@/${sharedLibraryName}" ) 173 | else() 174 | set(staticLibraryName "assimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_STATIC_LIBRARY_SUFFIX@") 175 | 176 | @@ -57,7 +57,7 @@ if(MSVC) 177 | IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/${staticLibraryName}" 178 | ) 179 | list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp ) 180 | - list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "${_IMPORT_PREFIX}/lib/${staticLibraryName}") 181 | + list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}") 182 | endif() 183 | 184 | else() 185 | @@ -70,17 +70,17 @@ else() 186 | endif() 187 | set_target_properties(assimp::assimp PROPERTIES 188 | IMPORTED_SONAME_RELEASE "${sharedLibraryName}" 189 | - IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/${sharedLibraryName}" 190 | + IMPORTED_LOCATION_RELEASE "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}" 191 | ) 192 | list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp ) 193 | - list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "${_IMPORT_PREFIX}/lib/${sharedLibraryName}" ) 194 | + list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${sharedLibraryName}" ) 195 | else() 196 | set(staticLibraryName "libassimp${ASSIMP_LIBRARY_SUFFIX}@CMAKE_STATIC_LIBRARY_SUFFIX@") 197 | set_target_properties(assimp::assimp PROPERTIES 198 | - IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/${staticLibraryName}" 199 | + IMPORTED_LOCATION_RELEASE "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}" 200 | ) 201 | list(APPEND _IMPORT_CHECK_TARGETS assimp::assimp ) 202 | - list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "${_IMPORT_PREFIX}/lib/${staticLibraryName}" ) 203 | + list(APPEND _IMPORT_CHECK_FILES_FOR_assimp::assimp "@CMAKE_INSTALL_FULL_LIBDIR@/${staticLibraryName}" ) 204 | endif() 205 | endif() 206 | 207 | @@ -91,8 +91,6 @@ get_filename_component(ASSIMP_ROOT_DIR "@CMAKE_INSTALL_PREFIX@" REALPATH) 208 | 209 | set( ASSIMP_CXX_FLAGS ) # dynamically linked library 210 | set( ASSIMP_LINK_FLAGS "" ) 211 | -set( ASSIMP_LIBRARY_DIRS "${ASSIMP_ROOT_DIR}/@ASSIMP_LIB_INSTALL_DIR@") 212 | -set( ASSIMP_INCLUDE_DIRS "${ASSIMP_ROOT_DIR}/@ASSIMP_INCLUDE_INSTALL_DIR@") 213 | if(ASSIMP_BUILD_SHARED_LIBS) 214 | set( ASSIMP_LIBRARIES ${sharedLibraryName}) 215 | else() 216 | 217 | diff --git a/assimpTargets.cmake.in b/assimpTargets.cmake.in 218 | index ab1a8d2c7b..ef90c834a6 100644 219 | --- a/assimpTargets.cmake.in 220 | +++ b/assimpTargets.cmake.in 221 | @@ -40,16 +40,6 @@ unset(_targetsDefined) 222 | unset(_targetsNotDefined) 223 | unset(_expectedTargets) 224 | 225 | - 226 | -# Compute the installation prefix relative to this file. 227 | -get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) 228 | -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 229 | -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 230 | -get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) 231 | -if(_IMPORT_PREFIX STREQUAL "/") 232 | - set(_IMPORT_PREFIX "") 233 | -endif() 234 | - 235 | # Create imported target assimp::assimp 236 | if(@BUILD_SHARED_LIBS@) 237 | add_library(assimp::assimp SHARED IMPORTED) 238 | @@ -60,7 +50,7 @@ endif() 239 | set_target_properties(assimp::assimp PROPERTIES 240 | COMPATIBLE_INTERFACE_STRING "assimp_MAJOR_VERSION" 241 | INTERFACE_assimp_MAJOR_VERSION "1" 242 | - INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include" 243 | + #INTERFACE_INCLUDE_DIRECTORIES "@CMAKE_INSTALL_FULL_INCLUDEDIR@" 244 | #INTERFACE_LINK_LIBRARIES "TxtUtils::TxtUtils;MealyMachine::MealyMachine" 245 | ) 246 | 247 | @@ -75,9 +65,6 @@ foreach(f ${CONFIG_FILES}) 248 | include(${f}) 249 | endforeach() 250 | 251 | -# Cleanup temporary variables. 252 | -set(_IMPORT_PREFIX) 253 | - 254 | # Loop over all imported files and verify that they actually exist 255 | foreach(target ${_IMPORT_CHECK_TARGETS} ) 256 | foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} ) 257 | 258 | -------------------------------------------------------------------------------- /recipes-graphics/vulkan/assimp_5.0.1.bb: -------------------------------------------------------------------------------- 1 | DESCRIPTION = "Open Asset Import Library is a portable Open Source library to import \ 2 | various well-known 3D model formats in a uniform manner." 3 | HOMEPAGE = "http://www.assimp.org/" 4 | SECTION = "devel" 5 | 6 | LICENSE = "BSD-3-Clause" 7 | LIC_FILES_CHKSUM = "file://LICENSE;md5=2119edef0916b0bd511cb3c731076271" 8 | 9 | DEPENDS = "zlib" 10 | 11 | SRC_URI = "git://github.com/assimp/assimp.git;protocol=https;branch=assimp_5.0_release \ 12 | file://0001-closes-https-github.com-assimp-assimp-issues-2733-up.patch \ 13 | file://use-GNUInstallDirs-where-possible.patch \ 14 | file://0001-assimp-remove-shared-lib-from-_IMPORT_CHECK_TARGETS.patch \ 15 | " 16 | UPSTREAM_CHECK_GITTAGREGEX = "v(?P(\d+(\.\d+)+))" 17 | 18 | SRCREV = "8f0c6b04b2257a520aaab38421b2e090204b69df" 19 | 20 | S = "${WORKDIR}/git" 21 | 22 | inherit cmake 23 | 24 | do_unpack:append() { 25 | bb.build.exec_func('remove_non_compliant_source', d) 26 | } 27 | 28 | remove_non_compliant_source() { 29 | # Remove non-compliant files manually. A patch file cannot be used 30 | # since many of the files are binary. 31 | rm -rf ${S}/test/models-nonbsd ${S}/scripts/StepImporter/schema_ifc2x3.exp 32 | } 33 | 34 | EXTRA_OECMAKE = "-DASSIMP_BUILD_ASSIMP_TOOLS=OFF -DASSIMP_BUILD_TESTS=OFF -DASSIMP_LIB_INSTALL_DIR=${baselib}" 35 | 36 | BBCLASSEXTEND = "native nativesdk" 37 | -------------------------------------------------------------------------------- /recipes-multimedia/gstreamer/gst-variable-rtsp-server_1.0.bb: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2017 NXP Semiconductor 2 | 3 | SUMMARY = "RTSP server for live-stream from a v4l2 video source" 4 | HOMEPAGE = "https://github.com/Gateworks/gst-gateworks-apps" 5 | SECTION = "multimedia" 6 | 7 | LICENSE = "GPL-3.0-only" 8 | 9 | inherit pkgconfig 10 | 11 | DEPENDS = "gstreamer1.0 gstreamer1.0-rtsp-server glib-2.0" 12 | 13 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504" 14 | 15 | SRC_URI = " \ 16 | git://github.com/Gateworks/gst-gateworks-apps;branch=master;protocol=https \ 17 | " 18 | 19 | SRCREV = "490564815d8049dbdd79087f546835b673ba6e88" 20 | 21 | S = "${WORKDIR}/git" 22 | 23 | do_install() { 24 | install -m 0755 -D ${S}/bin/gst-variable-rtsp-server \ 25 | ${D}/${bindir}/gst-variable-rtsp-server 26 | } 27 | --------------------------------------------------------------------------------