Giter Club home page Giter Club logo

psp-pacman's Introduction

PSPDEV

CI CI-Docker Docker Pulls

Main PSP Repo for building the whole PSP Development environment in your local machine.

Table of Contents

This program will automatically build and install the whole compiler and other tools used in the creation of Homebrew software for the Sony PlayStation Portable® video game system.

Up and running

You can get started very quickly by grabbing the latest development pre-releases from the releases' page for your platform and extract them to the pspdev directory in your path.

Export the PSPDEV environment variable to point to the pspdev directory. For example:

export PSPDEV=~/pspdev
export PATH=$PATH:$PSPDEV/bin

What these scripts do

These scripts download (git clone) and install:

Requirements

  • Install gcc/clang, make, cmake, patch, git, texinfo, flex, bison, gettext, wget, gsl, gmp, mpfr, mpc, libusb, readline, libarchive, gpgme, bash, openssl and libtool.
  • If you don't have those. We offer a script to help you for installing dependencies:
sudo ./prepare.sh
  1. Optional. If you are upgrading from the previous version of the PSPDEV environment, it is highly recommended removing the content of the PSPDEV folder before upgrade. This is a necessary step after the major toolchain upgrade.

    sudo rm -rf $PSPDEV
  2. Ensure that you have enough permissions for managing PSPDEV location (default to /usr/local/pspdev, but you can use a different path). PSPDEV location MUST NOT have spaces or special characters in its path! PSPDEV should be an absolute path. On Unix systems, if the command mkdir -p $PSPDEV fails for you, you can set access for the current user by running commands:

    export PSPDEV=/usr/local/pspdev
    sudo mkdir -p $PSPDEV
    sudo chown -R $USER: $PSPDEV
  3. Add this to your login script (example: ~/.bash_profile) Note: Ensure that you have full access to the PSPDEV path. You can change the PSPDEV path with the following requirements: only use absolute paths, don't use spaces, only use Latin characters.

    export PSPDEV=/usr/local/pspdev
    export PATH=$PATH:$PSPDEV/bin
  4. Run build-all.sh

    ./build-all.sh

Docker generation

This repo also uses CI/CD to create a docker image called pspdev/pspdev:latest per change. This is useful if you're a developer that wants to create/port an application to the PSP. You can compile your project using this docker image.

Extra steps

If you want, you can JUST install the extra dependencies as psplinkusb and ebootsigner. To achieve this execute

./build-extra.sh

macOS

If you download the pre-built macOS binaries and get a security error such as "pspsh" cannot be opened because the developer cannot be verified., you can remove the quarantine attribute by running:

xattr -dr com.apple.quarantine path/to/prebuilt/pspdev

Local package builds

The toolchain (binutils, gcc), the SDK (pspsdk) and the host tools are built locally. However, the provided packages (psp-packages) are installed via psp-pacman (or a similar mechanism if not available), which fetches packages from GitHub releases. If you wish to build these packages locally, you might define the variable LOCAL_PACKAGE_BUILD which will force pacman to build the packages from source instead of downloading them:

LOCAL_PACKAGE_BUILD=1 ./build-all.sh

This is particularly useful if you are testing changes in the toolchain (i.e. gcc or binutils) and want to test your changes end to end. It can also be useful if you want a hermetic build and don't want to use any of the provided binaries.

Thanks

psp-pacman's People

Contributors

carstene1ns avatar davidgfnet avatar fjtrujy avatar sharkwouter avatar wally4000 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

psp-pacman's Issues

Pacman needs root on systems which use the existing pacman

I've discussed this with @carstene1ns yesterday. Since our patches don't apply to the system's pacman, root is required for software installation when using it. We have decided that we should build our version of pacman also on these systems, to lower the amount of work we need to do and to make sure it works for everyone. I will be working on this.

warning: no 'XferCommand' configured

When running the script build-all.sh from pspdev/pspdev, I get an error when it tries to run pacman -Sy. These are the last three lines from the log (I'm going from memory here, if I have the time to rerun the whole script I'll update this):

...
warning: no 'XferCommand' configured
:: Synchronizing package databases...
error: no usable package repositories configured.

To solve this problem, I had to uncomment one of the XferCommand lines from the pacman.conf file (so either line 19 or line 20).
I'm creating an issue instead of a PR because this problem happens on my laptop but not on my desktop. Both systems run Fedora 37 (x86_64).

Wrong strip binary is used by makepkg

Here an example of the tidy step when building the angelscript package:

==> Tidying install...
  -> Purging unwanted files...
  -> Stripping unneeded symbols from binaries and libraries...
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_atomic.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_builder.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_bytecode.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_callfunc.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_callfunc_x86.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_callfunc_x64_gcc.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_callfunc_x64_msvc.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_callfunc_x64_mingw.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_compiler.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_configgroup.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_context.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_datatype.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_gc.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_generic.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_globalproperty.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_memory.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_module.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_objecttype.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_outputbuffer.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_parser.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_restore.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_scriptcode.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_scriptengine.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_scriptfunction.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_scriptnode.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_scriptobject.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_string.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_string_util.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_thread.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_tokenizer.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_typeinfo.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_variablescope.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_callfunc_mips.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_atomic.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_builder.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_bytecode.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_callfunc.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_callfunc_x86.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_callfunc_x64_gcc.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_callfunc_x64_msvc.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_callfunc_x64_mingw.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_compiler.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_configgroup.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_context.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_datatype.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_gc.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_generic.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_globalproperty.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_memory.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_module.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_objecttype.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_outputbuffer.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_parser.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_restore.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_scriptcode.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_scriptengine.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_scriptfunction.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_scriptnode.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_scriptobject.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_string.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_string_util.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_thread.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_tokenizer.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_typeinfo.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_variablescope.cpp.obj)'
strip: Unable to recognise the format of the input file `./psp/lib/libAngelscript.a(as_callfunc_mips.cpp.obj)'

It should be using psp-strip, but it instead uses the strip binary in the user's path. This is meant for x86_64 and doesn't work.

Set up a pacman repository

I think this would be quite a challenge to set this up right, but I think it's needed.

I would propose we do the following:

  • Build and upload the psptoolchain docker container to the dockerhub automatically with each commit to the master branch of the psptoolchain repo
  • Convert psplibraries to just containing directories with PSPBUILDs
  • Build all packages in the psplibraries repo automatically using the psptoolchain docker container
  • Add to build packages to an arch repository we host, automatically, somehow

For this we need webhosting, a domain name and an SSL certificate, though, which is not free.

Let me know if you'd do any of this in a different way, there might be easier solutions.

I found some documentation on how setting up an Arch repository works. Since it took a while to find, here is the link:
https://wiki.archlinux.org/index.php/Pacman/Tips_and_tricks#Custom_local_repository

Pacman uses bsdtar

This is not really a problem, but we do need to make sure we install this with all the prepare scripts and inside the docker container. I put up this issue to not forget it.

psp-pacman does not build on MacOS

It fails with the following error:

 Run-time dependency libarchive found: NO (tried framework and cmake)

meson.build:85:0: ERROR: Dependency lookup for libarchive with method 'pkgconfig' failed: Could not generate cargs for libarchive:
Package iconv was not found in the pkg-config search path.
Perhaps you should add the directory containing `iconv.pc'
to the PKG_CONFIG_PATH environment variable
Package 'iconv', required by 'libarchive', not found

This seems to be an issue with the libarchive package provided by Brew. There is an issue up on their GitHub repo here: Homebrew/homebrew-core#120526

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.