1

How can you install pygame to your yocto project? Can only seem to find old solutions that doesn't seem to work. I mange to install python3 without any issues, but the meta-python layer doesn't contain pygame as standard. How can you create your own layer/recipe to get pygame?

Tried to create my own recipe from the script here but when I use bitbake add-layer <PATH> I get an error saying that: Specified layer directory <PATH> doesn't contain a conf/layer.conf file

SUMMARY = "Python Game Development"
HOMEPAGE = "https://www.pygame.org"
AUTHOR = "A community project. <pygame@pygame.org>"
LICENSE = "LGPL-2.0"
LIC_FILES_CHKSUM = "file://setup.py;md5=59f9a291287e87473bbb98f2c9291c5c"

SRC_URI = "https://files.pythonhosted.org/packages/9a/50/67767e5586a45e7e7b02e6f0e07853f8fcb81b54c66db6278f1a1344491f/pygame-2.1.2.tar.gz"
SRC_URI[md5sum] = "8467a125e9075fa701f082806d228366"
SRC_URI[sha256sum] = "d6d0eca28f886f0477cd0721ac688189155a587f2bb8eae740e52ca56c3ad23c"

S = "${WORKDIR}/pygame-2.1.2"

RDEPENDS_${PN} = ""

inherit setuptools3

How my other files look. local.conf:

MACHINE ??= "raspberrypi4-64"
RASPBERRYPI_DISPLAY = " 1"
IMAGE_INSTALL:append = " python3"
IMAGE_FSTYPES = "wic wic.bmap"

bblayers.conf:

  <PATH>/poky/meta \
  <PATH>/poky/meta-poky \
  <PATH>/poky/meta-yocto-bsp \
  <PATH>/meta-openembedded/meta-oe \
  <PATH>/meta-openembedded/meta-python \
  <PATH>/meta-raspberrypi \
  • 1
    Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Dec 30 '22 at 11:49

2 Answers2

1

The solution that worked for me: Add meta-python and meta-netoworking via meta-openembedded. In local.conf add IMAGE_INSTALL:append = " python3-pip". While up and running use the command pip3 install pygame

0

Have you managed to add pygame to Yocto? I'm trying to achieve the same thing.

I've also tried generating a recipe with pipoe. (Without creating a custom layer. I've added the recipe to ../sources/poky/meta/recipes-devtools/python.) The recipe is parsed successfully, however the compilation fails.

This is my python3-pygame_2.1.3.dev8.bb:

SUMMARY = "Python Game Development"
HOMEPAGE = "https://www.pygame.org"
AUTHOR = "A community project. <pygame@pygame.org>"
LICENSE = "LGPL-2.0"
LIC_FILES_CHKSUM = "file://setup.py;md5=f28719c8b1d7e19071bd25e2f3a54c06"

SRC_URI = "https://files.pythonhosted.org/packages/f0/34/fc13b596b637cc59961ed606447a27a96d31bfda3ca965b73ebd16a02750/pygame-2.1.3.dev8.tar.gz"
SRC_URI[md5sum] = "6cf32b59a453b9824f421065a0205b52"
SRC_URI[sha256sum] = "94d98328e73d56be35cc3ae8e31f9d95fbce4f3dca6a74f05c58f4c5ef18c33d"

S = "${WORKDIR}/pygame-2.1.3.dev8"

RDEPENDS_${PN} = "libsdl2"

inherit setuptools3
benc
  • 1
  • 2
  • Hello, I managed to install pygame. But not via the build of the image. I installed pip3 in local.conf with IMAGE_INSTALL:append = " python3-pip". When I booted up and connected to the internet I ran the command pip3 install pygame, which worked! – Alexander Jönsson Jan 23 '23 at 09:34