Skip to content

add raylib#237

Merged
sharkwouter merged 6 commits intopspdev:masterfrom
BrownNPC:raylib
Sep 5, 2025
Merged

add raylib#237
sharkwouter merged 6 commits intopspdev:masterfrom
BrownNPC:raylib

Conversation

@BrownNPC
Copy link
Contributor

@BrownNPC BrownNPC commented Sep 1, 2025

I've added the PSPBUILD. it's based on the one used in the stb library. I've tested it and it seems to work on my machine. But one thing to note is that:
It depends on the psp toolchain. ie. pspkernel.h pspdisplay, pspgl, and it expects $(PSPDEV) to point to the toolchain.
Here is the list of dependencies

#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <GLES/egl.h>
#include <GLES/gl.h>

Copy link
Member

@sharkwouter sharkwouter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks pretty good, thanks! I would like to request one more change. Could you add the license file to the package? You can just copy that from other packages, since they almost all have an install command for it.

@sharkwouter
Copy link
Member

At some point we should probably add a pkg config file for Raylib, but I won't require that for the first package. If you feel like it, you can take a go at it, though.

@BrownNPC
Copy link
Contributor Author

BrownNPC commented Sep 1, 2025

@sharkwouter I could add it if you tell me where to look

@BrownNPC
Copy link
Contributor Author

BrownNPC commented Sep 1, 2025

Alongside the psp toolchain, this port requires the following libraries to be linked when being consumed by an end user

-lraylib -lpng -lz  -lglut -lGLU -lGL -lpspvfpu 

Here is the full Makefile for raylib usage

BUILD_PRX = 1
TARGET = raylib
OBJS = main.o
INCDIR =
CFLAGS = -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LDFLAGS =
LIBS=   -lraylib -lpng -lz  -lglut -lGLU -lGL -lpspvfpu 

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = raylib textures bunnymark
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak


# --- Move build artifacts into a build/ directory, leaving EBOOT.PBP and PARAM.SFO behind ---
BUILD_DIR := build

.PHONY: postbuild install

# run postbuild automatically after the SDK's all target
all: postbuild

postbuild: $(BUILD_DIR)
	@for f in *.o *.prx *.elf; do \
	  if [ -f "$$f" ]; then \
	    echo "  mv $$f -> $(BUILD_DIR)/"; \
	    mv -f "$$f" "$(BUILD_DIR)/"; \
	  fi; \
	done
	@echo "Done."

$(BUILD_DIR):
	@mkdir -p "$(BUILD_DIR)"

@BrownNPC
Copy link
Contributor Author

BrownNPC commented Sep 2, 2025

I've added them. I copied the .cmake from raylib but removed the if else checks for static/dynamic linking, and replaced them with the static version.

@BrownNPC
Copy link
Contributor Author

BrownNPC commented Sep 2, 2025

@sharkwouter the build environment doesnt seem to have psp gl

@sharkwouter
Copy link
Member

You'll have to add pspgl as a dependency for it to become available during the build.

@BrownNPC
Copy link
Contributor Author

BrownNPC commented Sep 4, 2025

@sharkwouter I made the changes, hopefully it works as intended now 🤞 (probably wont)

@sharkwouter sharkwouter merged commit cde5b6c into pspdev:master Sep 5, 2025
181 of 182 checks passed
@sharkwouter
Copy link
Member

I fixed the hashes which were still missing and merged it now. Thanks for contributing :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants