WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to install pygame on piCore 13.1  (Read 974 times)

Offline xdemy

  • Newbie
  • *
  • Posts: 7
How to install pygame on piCore 13.1
« on: January 03, 2024, 05:46:49 PM »
Hi,
I stuck with the following message while trying to install pygame.
Using RPI Zero 2W; 5.10.77-piCore-v7 (piCore 13.1):

Code: [Select]
tc@box:~$ pip3 install pygame --user
Collecting pygame
  Downloading pygame-2.5.2.tar.gz (15.8 MB)
     |████████████████████████████████| 15.8 MB 3.1 MB/s
    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-wfgsca9r/pygame/setup.py'"'"'; __file__='"'"'/tmp/pip-install-wfgsca9r/pygame/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-5rdafe1y
         cwd: /tmp/pip-install-wfgsca9r/pygame/
    Complete output (42 lines):
    Skipping Cython compilation
   
   
    WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
    Using UNIX configuration...
   
    /bin/sh: dpkg-architecture: not found
    Package freetype2 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `freetype2.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'freetype2' found
    Package freetype2 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `freetype2.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'freetype2' found
    Package freetype2 was not found in the pkg-config search path.
    Perhaps you should add the directory containing `freetype2.pc'
    to the PKG_CONFIG_PATH environment variable
    No package 'freetype2' found
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-wfgsca9r/pygame/setup.py", line 409, in <module>
        buildconfig.config.main(AUTO_CONFIG)
      File "/tmp/pip-install-wfgsca9r/pygame/buildconfig/config.py", line 231, in main
        deps = CFG.main(**kwds, auto_config=auto)
      File "/tmp/pip-install-wfgsca9r/pygame/buildconfig/config_unix.py", line 238, in main
        DEPS.append(find_freetype())
      File "/tmp/pip-install-wfgsca9r/pygame/buildconfig/config_unix.py", line 202, in find_freetype
        pkg_config = DependencyProg(
      File "/tmp/pip-install-wfgsca9r/pygame/buildconfig/config_unix.py", line 43, in __init__
        self.ver = config[0].strip()
    IndexError: list index out of range
   
    Hunting dependencies...
   
    ---
    For help with compilation see:
        https://www.pygame.org/wiki/Compilation
    To contribute to pygame development see:
        https://www.pygame.org/contribute.html
    ---
   
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

In my onboot.lst, regarding pygame I have:
Code: [Select]
python3.8.tcz
python3.8-pip.tcz
python3.8-setuptools.tcz
compiletc.tcz
SDL2.tcz
SDL2-dev.tcz
alsa.tcz
alsa-utils.tcz

Not sure if they're all required, but I need pygame to work with MIDI over USB and playing sounds.

I've seen this post: https://forum.tinycorelinux.net/index.php/topic,25672.15.html but I dont really understand it.. was it solved actually?
Do I need to compile the pygame as a tcz extension to use it?

I would greatly appreciate any guidance in this topic..

Offline xdemy

  • Newbie
  • *
  • Posts: 7
Re: How to install pygame on piCore 13.1
« Reply #1 on: January 08, 2024, 10:02:33 AM »
I gave up on 13.1 as I have found py3.8game.tcz in 14.x/aarch64 repository.

So I moved to 14.1/64, but this extension didnt work (was build against different version of SDL than the ones included in repository).
Finally I built the extension from source against the right SDL, and fixed py3.8game.tcz.dep content, did my best. If there's anything I could improve, please let me know.
The file is to big to attach here, so I'll submit the extension via email.


Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11515
Re: How to install pygame on piCore 13.1
« Reply #2 on: January 08, 2024, 12:40:53 PM »
Hi xdemy
... The file is to big to attach here, so I'll submit the extension via email.
Extensions are not allowed to be attached to posts. They must
always be submitted as explained here:
https://wiki.tinycorelinux.net/doku.php?id=wiki:creating_extensions#submitting

Do not use the picore address. Always use the  tcesubmit @ gmail  address.