Create GCC in podman

This commit is contained in:
2025-01-02 19:47:47 +01:00
parent faa1ec4a0f
commit 12de40e2a0
11 changed files with 57 additions and 19 deletions

16
podman/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
FROM "ubuntu:24.04"
ADD ["scripts/install_pop-fe.sh", "scripts/install_rust.sh", "scripts/make_gcc.sh", "scripts/prerequisites.sh", "/usr/scripts"]
RUN apt update && cd /usr/scripts && ./prerequisites.sh && ./install_rust.sh && cd /usr && ./scripts/make_gcc.sh
#RUN apt update && apt install -y nginx
#RUN mkdir /app
#WORKDIR /app
#VOLUME my_vol (Do not use)
#ADD install_pop-fe.sh install_pop-fe.sh
#CMD ["cp", "install_pop-fe.sh", "/my_vol"]
# TODO: Make a script that builds the image and then registers alias like `jaby-make` for the docker command

1
podman/install.sh Normal file
View File

@@ -0,0 +1 @@
podman build -t jaby_engine .

View File

@@ -0,0 +1,42 @@
#!/bin/bash
#Made possible by Cody the white tiger
BASEDIR=$(dirname "$0")
mkdir -p $BASEDIR/../bin/extern/
cd $BASEDIR/../bin/extern
sudo apt install -y python3 python3-pip python3-venv pkg-config libiso9660-dev libsndfile1-dev swig
if ! test -d py3venv; then
python3 -m venv py3venv
fi
source py3venv/bin/activate
pip3 install ecdsa wheel pillow rarfile PyPDF2 requests opencv-contrib-python pycryptodome pycdio pycdlib
if ! test -d pop-fe; then
git clone https://github.com/sahlberg/pop-fe
fi
if ! test -d Cue2cu2; then
git clone https://github.com/NRGDEAD/Cue2cu2
cp Cue2cu2/cue2cu2.py pop-fe
fi
cd pop-fe
if ! test -d atracdenc; then
git clone https://github.com/dcherednik/atracdenc.git
cd atracdenc/src/
cmake .
make
cd ../..
fi
if ! test -d PSL1GHT; then
git clone https://github.com/sahlberg/PSL1GHT
cd PSL1GHT/tools/ps3py
git checkout origin/use-python3
make
fi
#if ! test -f /usr/local/bin/python; then
# sudo ln -s $(which python3) /usr/local/bin/python
#fi

5
podman/scripts/install_rust.sh Executable file
View File

@@ -0,0 +1,5 @@
#!/bin/bash
echo "<<< Install Rust >>>"
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
. "$HOME/.cargo/env"
cargo install cargo-edit --locked

64
podman/scripts/make_gcc.sh Executable file
View File

@@ -0,0 +1,64 @@
#!/bin/bash
GCC_VERSION=13.1.0
echo "<<< Build GCC >>>"
mkdir -p psx-gcc
cd psx-gcc
echo "<<< clone binutils >>>"
git clone git://sourceware.org/git/binutils-gdb.git
cd binutils-gdb
mkdir -p build
cd build
echo "<<< Configure binutils >>>"
../configure --target=mipsel-linux-gnu --with-sysroot --disable-nls --disable-werror
if [ $? -ne 0 ]; then
exit 1
fi
echo "<<< Make binutils >>>"
make
if [ $? -ne 0 ]; then
exit 1
fi
echo "<<< Install binutils >>>"
make install
if [ $? -ne 0 ]; then
exit 1
fi
cd ../..
echo "<<< clone gcc >>>"
git clone --recurse-submodules git://gcc.gnu.org/git/gcc.git
cd gcc
echo "<<< checkout gcc $GCC_VERSION >>>"
git checkout releases/$GCC_VERSION
mkdir -p build
cd build
echo "<<< configure gcc >>>"
../configure --target=mipsel-linux-gnu --disable-nls --enable-languages=c,c++ --without-headers
if [ $? -ne 0 ]; then
exit 1
fi
echo "<<< Make gcc >>>"
make all-gcc
if [ $? -ne 0 ]; then
exit 1
fi
echo "<<< Install gcc >>>"
make install-gcc
if [ $? -ne 0 ]; then
exit 1
fi
echo "<<< Delete GCC folder >>>"
cd /usr
rm -fr psx-gcc
# TODO: Remove gcc files after everything

View File

@@ -0,0 +1,3 @@
#!/bin/bash
echo "<<< Install prerequisites >>>"
apt install -y curl make texinfo g++ gcc git libgmp3-dev libmpfr-dev libmpc-dev flex install-info info bison