ps3dev / ps3toolchain

A script to autobuild an open source toolchain for the PS3.
BSD 2-Clause "Simplified" License
280 stars 92 forks source link

build issues for Debian 11 #125

Closed danboid closed 1 month ago

danboid commented 1 month ago

I think I have successfully built most of the ps3toolchain repo under debian 11 but I had to make a few small changes before I was able to get it to start building.

I used Debian 11 because you can still install python2 from the Debian 11 repos but using python2 is trickier under Debian 12 and later so I installed Debian 11 in a incus container. Ideally the ps3toolchain build scripts will get updated to use python3 instead.

I had to use the following command to install the build dependencies:

apt-get install autoconf automake bison flex gcc libelf-dev make \
    texinfo libncurses5-dev patch python2 subversion wget zlib1g-dev \
    libtool libtool-bin python2-dev bzip2 libgmp3-dev pkg-config g++ libssl-dev clang

The only differences in that command compared to the apt command in the README is that I have replaced python with python2 and python-dev with python2-dev. These packages no longer exist in Debian 12 so we should maybe add a warning to the README about this until the build scripts get updated for python3?

I also had to change depends/check-python.sh to use python2-config instead of python-config or else it would fail to find my Python.h.

pyprefix=$(python2-config --prefix)

I have attached the last part of my attempt to build the repo. It fails when building PSL1GHT.

ps3dev-build-error.txt

zeldin commented 1 month ago

Hm? I though all the scripts had already been fixed to work with python 3? Which script is it that still needs python 2?

danboid commented 1 month ago

Unfortunately not.

If it does work with python3, the apt example commands needs updating to change to python3 and python3-dev packages (instead of python and python-dev) but even after changing depends/check-python.sh to use python3-config instead of python-config I still get this under Debian 12 w/ python3:

root@rigodon:/home/dan/src/ps3toolchain# ./toolchain.sh 
ERROR: Install python before continuing.
../depends/check-python.sh: Failed.
zeldin commented 1 month ago

Hm, yes, it looks like Debian has taken to weird naming of their packages. What you should actually install is python-is-python3 and python-dev-is-python3. Then python will be called python and python-config will be called python-config, and you should not have to change anything. This is how ps3dev-docker does it.

danboid commented 1 month ago

I'd already got it to start building under Debian 12 by symlinking /usr/bin/python3 to /usr/bin/python before I saw your previous reply, which is what I expect python-is-python3 does.

zeldin commented 1 month ago

Yeah, I haven't looked at the details, but I suspect it just contains the symlink and has a dependency on the python3 package for the rest. 😸

danboid commented 1 month ago

Can you comment on / have you tried the PS3 SDL port, recently? I want to try porting an emulator to the PS3.

Is it known to build OK at least?

Whats the POSIX support like around here?

zeldin commented 1 month ago

I last did a build of the Docker image (which includes all the libraries) 4 months ago, but then everything built fine at least.

POSIX support is descent, we use newlib for that. Just don't expect to much from C++ STL. 😓

danboid commented 1 month ago

I've just had the repo fully build under Debian 12 so I think we just need to update the apt command in the README.

Good to hear that you say it has decent POSIX support. It shouldn't be too hard to get it to build then, I'd hope.

danboid commented 1 month ago

I can see that your scripts have successfully built the sdl_psl1ght library OK under Debian 12.

sdl_psl1ght includes several simple test programs in ps3toolchain/build/ps3libraries/build/sdl_psl1ght/test.

How would I turn one of those SDL test program binaries into a .pkg file that I could install and run on my CFW PS3? I presume this is documented somewhere already.

Or if you know of a better open source PS3 program that uses SDL that you could point to as an example of packaging an SDL program, that'd be very handy!

zeldin commented 1 month ago

The SDL tests are not specific for PS3, so they will not build a pkg. (SDL_PSL1GHT is just a fork of regular SDL, so it contains everything SDL does, including non-PS3 things.)

I'd recommend trying out one of the PSL1GHT samples (like samples/graphics/cairo) to get started. The PSL1GHT ppu_rules has a rule to build pkgs, so after compiling the sample you can just type make cairo.pkg to get a pkg.

Anyway, I updated the build instructions for Debian 12 (and 13) now, so closing this issue.

danboid commented 1 month ago

Thanks for explaining how to build the Cairo package. I successfully built and installed it on my PS3 but when I run it, only get a black screen. I've not tried the same demo on my PC yet so I'm not sure what I should see.

Does it work for you on your PS3? I can open a new issue for this, if it is a bug.