I tried to add simplejpeg to a Yocto project currently running on the main/bleeding edge version.
I used the latest pipoe version to autogenerate a .bb / receipe file with the simple command pipoe -p simplejpeg --python python3
this generated following bb file:
SUMMARY = "A simple package for fast JPEG encoding and decoding."
HOMEPAGE = ""
AUTHOR = "Joachim Folz <joachim.folz@dfki.de>"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=af754d278ce3e4ddb2683b219eb831ba"
inherit setuptools3
SRC_URI = "https://files.pythonhosted.org/packages/25/50/6a4ea4f14d72d21c0fe0e3ef4c916b162fc6208f7a32c145f690c7c678b0/simplejpeg-1.6.6.tar.gz"
SRC_URI[md5sum] = "8f25a777a21832be0771ee22f282ce88"
SRC_URI[sha256sum] = "942294f9fd602375289759f1b70dd734e1c939063d8479c04dffb23074a8d662"
S = "${WORKDIR}/simplejpeg-1.6.6"
DEPENDS += " "
RDEPENDS:${PN} = "python3-numpy"
BBCLASSEXTEND = "native nativesdk"
trying to build the receipe with bitbake ( bitbake python3-simplejpeg
) results in following error:
NOTE: Executing Tasks
ERROR: python3-simplejpeg-1.6.6-r0 do_compile: 'python3 setup.py bdist_wheel ' execution failed.
ERROR: python3-simplejpeg-1.6.6-r0 do_compile: ExecutionError('/home/user/yocto/build/tmp/work/cortexa53-poky-linux/python3-simplejpeg/1.6.6-r0/temp/run.do_compile.10750', 1, None, None)
ERROR: Logfile of failure stored in: /home/user/yocto/build/tmp/work/cortexa53-poky-linux/python3-simplejpeg/1.6.6-r0/temp/log.do_compile.10750
Log data follows:
| DEBUG: Executing shell function do_compile
| Traceback (most recent call last):
| File "/home/user/yocto/build/tmp/work/cortexa53-poky-linux/python3-simplejpeg/1.6.6-r0/simplejpeg-1.6.6/setup.py", line 11, in <module>
| from cmake import CMAKE_BIN_DIR
| ModuleNotFoundError: No module named 'cmake'
| ERROR: 'python3 setup.py bdist_wheel ' execution failed.
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/user/yocto/sources/meta-project/recipes-project/recipes-core/python3-simplejpeg/python3-simplejpeg_1.6.6.bb:do_compile) failed with exit code '1'
I also tired rewriting a lot of this receipe in hopes of getting it working...
SUMMARY = "python3-simplejpeg"
LICENSE = "CLOSED"
SRC_URI[md5sum] = "8f25a777a21832be0771ee22f282ce88"
SRC_URI[sha256sum] = "942294f9fd602375289759f1b70dd734e1c939063d8479c04dffb23074a8d662"
PYPI_PACKAGE = "simplejpeg"
DEPENDS += "cmake-native python3-setuptools-native python3-numpy-native"
inherit cmake pypi setuptools3 python3native pkgconfig
S = "${WORKDIR}/simplejpeg-1.6.6"
do_configure() {
setuptools3_do_configure
cmake_do_configure
}
do_compile() {
setuptools3_do_compile
cmake_do_compile
}
do_install() {
setuptools3_do_install
cmake_do_install
}
BBCLASSEXTEND = "native nativesdk"
but this just ended in the error
NOTE: Executing Tasks
ERROR: python3-simplejpeg-1.6.6-r0 do_configure: ExecutionError('/home/user/yocto/build/tmp/work/cortexa53-poky-linux/python3-simplejpeg/1.6.6-r0/temp/run.do_configure.17786', 1, None, None)
ERROR: Logfile of failure stored in: /home/user/yocto/build/tmp/work/cortexa53-poky-linux/python3-simplejpeg/1.6.6-r0/temp/log.do_configure.17786
Log data follows:
| DEBUG: Executing python function extend_recipe_sysroot
| NOTE: Direct dependencies are ['/home/user/yocto/sources/poky/meta/recipes-core/glibc/glibc_2.37.bb:do_populate_sysroot', '/home/user/yocto/sources/poky/meta/recipes-devtools/cmake/cmake-native_3.26.4.bb:do_populate_sysroot', '/home/user/yocto/sources/poky/meta/recipes-devtools/gcc/gcc-cross_13.1.bb:do_populate_sysroot', '/home/user/yocto/sources/poky/meta/recipes-devtools/gcc/gcc-runtime_13.1.bb:do_populate_sysroot', '/home/user/yocto/sources/poky/meta/recipes-devtools/python/python3_3.11.3.bb:do_populate_sysroot', '/home/user/yocto/sources/poky/meta/recipes-devtools/quilt/quilt-native_0.67.bb:do_populate_sysroot', 'virtual:native:/home/user/yocto/sources/poky/meta/recipes-devtools/ninja/ninja_1.11.1.bb:do_populate_sysroot', 'virtual:native:/home/user/yocto/sources/poky/meta/recipes-devtools/patch/patch_2.7.6.bb:do_populate_sysroot', 'virtual:native:/home/user/yocto/sources/poky/meta/recipes-devtools/pkgconfig/pkgconfig_git.bb:do_populate_sysroot', 'virtual:native:/home/user/yocto/sources/poky/meta/recipes-devtools/pseudo/pseudo_git.bb:do_populate_sysroot', 'virtual:native:/home/user/yocto/sources/poky/meta/recipes-devtools/python/python3-build_0.10.0.bb:do_populate_sysroot', 'virtual:native:/home/user/yocto/sources/poky/meta/recipes-devtools/python/python3-installer_0.7.0.bb:do_populate_sysroot', 'virtual:native:/home/user/yocto/sources/poky/meta/recipes-devtools/python/python3-numpy_1.24.3.bb:do_populate_sysroot', 'virtual:native:/home/user/yocto/sources/poky/meta/recipes-devtools/python/python3-setuptools_67.6.1.bb:do_populate_sysroot', 'virtual:native:/home/user/yocto/sources/poky/meta/recipes-devtools/python/python3-wheel_0.40.0.bb:do_populate_sysroot', 'virtual:native:/home/user/yocto/sources/poky/meta/recipes-devtools/python/python3_3.11.3.bb:do_populate_sysroot']
| NOTE: Installed into sysroot: []
| NOTE: Skipping as already exists in sysroot: ['glibc', 'cmake-native', 'gcc-cross-aarch64', 'gcc-runtime', 'python3', 'quilt-native', 'ninja-native', 'patch-native', 'pkgconfig-native', 'pseudo-native', 'python3-build-native', 'python3-installer-native', 'python3-numpy-native', 'python3-setuptools-native', 'python3-wheel-native', 'python3-native', 'attr-native', 'libtool-native', 're2c-native', 'python3-flit-core-native', 'zlib-native', 'ncurses-native', 'zstd-native', 'openssl-native', 'bzip2-native', 'xz-native', 'libgcc', 'linux-libc-headers', 'python3-cython-native', 'opkg-utils', 'libxcrypt', 'expat', 'libtirpc', 'openssl', 'libffi', 'libedit', 'gdbm', 'util-linux-libuuid', 'bzip2', 'xz', 'libnsl2', 'zlib', 'ncurses', 'sqlite3', 'util-linux-libuuid-native', 'libedit-native', 'libffi-native', 'expat-native', 'gdbm-native', 'sqlite3-native', 'libnsl2-native', 'libtirpc-native', 'python3-pyproject-hooks-native', 'python3-packaging-native', 'flex-native', 'gnu-config-native', 'gmp-native', 'texinfo-dummy-native', 'libmpc-native', 'binutils-cross-aarch64', 'mpfr-native', 'gettext-minimal-native', 'unzip-native', 'perl-native', 'm4-native', 'make-native']
| DEBUG: Python function extend_recipe_sysroot finished
| DEBUG: Executing shell function do_configure
| CMake Warning:
| Ignoring extra path from command line:
|
| "/home/user/yocto/build/tmp/work/cortexa53-poky-linux/python3-simplejpeg/1.6.6-r0/simplejpeg-1.6.6"
|
|
| CMake Error: The source directory "/home/user/yocto/build/tmp/work/cortexa53-poky-linux/python3-simplejpeg/1.6.6-r0/simplejpeg-1.6.6" does not appear to contain CMakeLists.txt.
| Specify --help for usage, or press the help button on the CMake GUI.
| WARNING: exit code 1 from a shell command.
ERROR: Task (/home/user/yocto/sources/meta-project/recipes-project/recipes-core/python3-simplejpeg/python3-simplejpeg_1.6.6.bb:do_configure) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1346 tasks of which 1337 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
NOTE: Writing buildhistory took: 1 seconds
could someone please help me get this fixed?
Thanks a lot :)
Update 1:
SUMMARY = "A simple package for fast JPEG encoding and decoding."
HOMEPAGE = ""
AUTHOR = "Joachim Folz <joachim.folz@dfki.de>"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=af754d278ce3e4ddb2683b219eb831ba"
SRC_URI = "https://files.pythonhosted.org/packages/ac/35/b20cad2bee9d91e901f16beaa9d26ff4685dd17ad727918774b32ec04485/simplejpeg-${PV}-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl;downloadfilename=simplejpeg-${PV}-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.zip;subdir=${BP}"
SRC_URI[md5sum] = "0a29f9057f0f6c2a3b06d4df53e5f5b0"
SRC_URI[sha256sum] = "50b282cc9e03a315d452e8fb541cfe0d9b8e0dff1869a90828faab4c99d70331"
inherit python3-dir
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file:///${S}/simplejpeg-${PV}.dist-info/LICENSE;md5=af754d278ce3e4ddb2683b219eb831ba"
do_unpack[depends] += "unzip-native:do_populate_sysroot"
DEPENDS += "python3"
FILES:${PN} += "\
${libdir}/${PYTHON_DIR}/site-packages/simplejpeg/* \
${libdir}/${PYTHON_DIR}/site-packages/simplejpeg-${PV}.dist-info/* \
"
do_install() {
install -d ${D}${libdir}/${PYTHON_DIR}/site-packages/simplejpeg
install -d ${D}${libdir}/${PYTHON_DIR}/site-packages/simplejpeg-${PV}.dist-info
install -m 644 ${S}/simplejpeg/* ${D}${libdir}/${PYTHON_DIR}/site-packages/simplejpeg/
install -m 644 ${S}/simplejpeg-${PV}.dist-info/* ${D}${libdir}/${PYTHON_DIR}/site-packages/simplejpeg-${PV}.dist-info/
}
I added a new .bb and tried to build it not from source, but from a .whl file. However, I get a new error and even though the packet seems to be installed, no data is available in the final image
WARNING: python3-simplejpeg-1.6.6-r0 do_populate_sysroot: File '/usr/lib/python3.11/site-packages/simplejpeg/_jpeg.cpython-311-aarch64-linux-gnu.so' from python3-simplejpeg was already stripped, this will prevent future debugging!
ERROR: python3-simplejpeg-1.6.6-r0 do_package: QA Issue: File '/usr/lib/python3.11/site-packages/simplejpeg/_jpeg.cpython-311-aarch64-linux-gnu.so' from python3-simplejpeg was already stripped, this will prevent future debugging! [already-stripped]
ERROR: python3-simplejpeg-1.6.6-r0 do_package: Fatal QA errors were found, failing task.
ERROR: Logfile of failure stored in: /home/user/yocto/build/tmp/work/cortexa53-poky-linux/python3-simplejpeg/1.6.6-r0/temp/log.do_package.2645
ERROR: Task (/home/user/yocto/sources/meta-project/recipes-project/recipes-core/python3-simplejpeg/python3-simplejpeg_1.6.6.bb:do_package) failed with exit code '1'
Update 2 - finally working thanks to @skandigraun
SUMMARY = "A simple package for fast JPEG encoding and decoding."
HOMEPAGE = ""
AUTHOR = "Joachim Folz <joachim.folz@dfki.de>"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE;md5=af754d278ce3e4ddb2683b219eb831ba"
SRC_URI = "https://files.pythonhosted.org/packages/ac/35/b20cad2bee9d91e901f16beaa9d26ff4685dd17ad727918774b32ec04485/simplejpeg-${PV}-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl;downloadfilename=simplejpeg-${PV}-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.zip;subdir=${BP}"
SRC_URI[md5sum] = "0a29f9057f0f6c2a3b06d4df53e5f5b0"
SRC_URI[sha256sum] = "50b282cc9e03a315d452e8fb541cfe0d9b8e0dff1869a90828faab4c99d70331"
inherit python3-dir
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file:///${S}/simplejpeg-${PV}.dist-info/LICENSE;md5=af754d278ce3e4ddb2683b219eb831ba"
do_unpack[depends] += "unzip-native:do_populate_sysroot"
INSANE_SKIP:${PN} += "already-stripped"
DEPENDS += "python3"
FILES:${PN} += "\
${libdir}/${PYTHON_DIR}/site-packages/simplejpeg/* \
${libdir}/${PYTHON_DIR}/site-packages/simplejpeg-${PV}.dist-info/* \
"
do_install() {
install -d ${D}${libdir}/${PYTHON_DIR}/site-packages/simplejpeg
install -d ${D}${libdir}/${PYTHON_DIR}/site-packages/simplejpeg-${PV}.dist-info
install -m 644 ${S}/simplejpeg/* ${D}${libdir}/${PYTHON_DIR}/site-packages/simplejpeg/
install -m 644 ${S}/simplejpeg-${PV}.dist-info/* ${D}${libdir}/${PYTHON_DIR}/site-packages/simplejpeg-${PV}.dist-info/
}