Advertising (This ad goes away for registered users. You can Login or Register)

[Tutorial] How to compile homebrew for Rejuvenate on Ubuntu

Rejuvenate is a native homebrew platform for PS Vita. Read more about Rejuvenate here.
Locked
Beatnukem
Posts: 51
Joined: Fri Aug 21, 2015 5:43 pm

[Tutorial] How to compile homebrew for Rejuvenate on Ubuntu

Post by Beatnukem »

Hi,

I found that compiling for the Vita using the rejuvenate hack is a little bit tricky, specially if you are not super familiar with Linux.

Since the rejuvenate competition is coming up and I would love to see more great homebrews developed by all the talent out there I uploaded the prebuild toolchain for linux and wrote a little tutorial on how to use it:

How to compile hello world for rejuvenate

1. You need a Linux machine
I used Ubuntu 14.04 running inside VirtualBox VM. There are lot of tutorials out there how to set this up.

2. Download the precompiled tool-chain on your linux machine
http://www.mediafire.com/download/7yyw8 ... 5q3.tar.gz
This is the prebuild toolchain for Vita including some additional prebuild libs (e.g. xerpi's vita2d lib).

3. Extract the toolchain into your home folder
First you need to move the archive from the download location into your home folder.
To move the downloaded archive into your home folder simply open a terminal window:

Code: Select all

beatnukem@UbuntuVM:~$ mv ~/Downloads/gcc-arm-vita-eabi-4_9-2015q3.tar.gz ~
(Usually Firefox on Ubuntu will download that file into your ~/Downloads folder. Of course if you downloaded it elsewhere you need to adjust the source path)
~ is a shortcut for your homefolder on linux.

4. Extract the archive

Code: Select all

beatnukem@UbuntuVM:~$ cd ~
beatnukem@UbuntuVM:~$ tar -xzf gcc-arm-vita-eabi-4_9-2015q3.tar.gz
beatnukem@UbuntuVM:~$ cp ~/gcc-arm-vita-eabi-4_9-2015q3/*.json ~/gcc-arm-vita-eabi-4_9-2015q3/arm-vita-eabi/bin/
5. Add the compiler executable folder to your PATH and reboot/re-log

Code: Select all

beatnukem@UbuntuVM:~$ echo 'PATH="$HOME/gcc-arm-vita-eabi-4_9-2015q3/bin:$PATH"' >> ~/.profile
You need to reboot the machine in order to reflect the PATH changes. Alternatively you can log out and log back in.

6. If you are on 64-Bit Ubuntu you need to install 32-Bit libraries (you can skip this step if you use 32-Bit Ubuntu)

Code: Select all

beatnukem@UbuntuVM:~$ sudo dpkg --add-architecture i386
beatnukem@UbuntuVM:~$ sudo apt-get update
beatnukem@UbuntuVM:~$ sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
7. Install GIT if not installed

Code: Select all

beatnukem@UbuntuVM:~$ sudo apt-get install git git-core
8. You are now ready to compile your c code for the vita
E.g. this will download and compile xerpi's hello world example:

Code: Select all

beatnukem@UbuntuVM:~$ git clone https://github.com/xerpi/vitahelloworld.git
beatnukem@UbuntuVM:~$ cd vitahelloworld
beatnukem@UbuntuVM:~/vitahelloworld$ make VITASDK=~/gcc-arm-vita-eabi-4_9-2015q3/arm-vita-eabi/
9. Run the helloworld homebrew
you will find a vitahelloworld.velf file inside the vitahelloworld folder which you can now copy over to your windows machine and run on your vita using rejuvenate ('run_homebrew.bat vitahelloworld.velf').

Tip:
look into the Makefile how to setup the makefile to compile your code using vita toolchain

I used Ubuntu 8.10 (32-bit) to build the toolchain but it also works on 14.04 64-Bit.
I think it should work with any Linux version.

For those of you guys how like to dig deeper and build the toolchain yourself:
https://github.com/xyzz/vitasdk-buildscripts
https://github.com/xerpi/vita2dlib
https://github.com/xerpi/vita_portlibs

Last but not least:
Thanks a TON for all the awesome people putting all the effort into making things like rejuvenate and the toolchain/SDK for the vita possible!!!
Advertising
X-death
Posts: 86
Joined: Sun Nov 16, 2014 1:37 pm

Re: [Tutorial] How to compile homebrew for Rejuvenate on Ubu

Post by X-death »

Thanks a lot for your tutorial,
i have started to test it ( I'm on Kubuntu 64).
that seems to work but i have copied the db.json into the correct folder ( arm-vita-eabi/bin) for fix the could not open db.json error.
Advertising
Playstation TV PSNOVA JAP 3.60 Henkaku
RanDomnss
Posts: 26
Joined: Sun Sep 14, 2014 8:16 pm

Re: [Tutorial] How to compile homebrew for Rejuvenate on Ubu

Post by RanDomnss »

Mind telling me why I'm getting this error?

tyler@tyler-VirtualBox:~$ cd vitahelloworld-master
tyler@tyler-VirtualBox:~/vitahelloworld-master$ make
arm-vita-eabi-gcc -Wl,-q -Wall -O3 -I/include -L/lib -c -o main.o main.c
main.c: In function 'main':
main.c:51:21: error: 'SCE_CTRL_START' undeclared (first use in this function)
if (pad.buttons & SCE_CTRL_START) {
^
main.c:51:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:61:21: error: 'SCE_CTRL_UP' undeclared (first use in this function)
if (pad.buttons & SCE_CTRL_UP) {
^
main.c:63:29: error: 'SCE_CTRL_DOWN' undeclared (first use in this function)
} else if (pad.buttons & SCE_CTRL_DOWN) {
^
main.c:66:21: error: 'SCE_CTRL_LEFT' undeclared (first use in this function)
if (pad.buttons & SCE_CTRL_LEFT) {
^
main.c:68:29: error: 'SCE_CTRL_RIGHT' undeclared (first use in this function)
} else if (pad.buttons & SCE_CTRL_RIGHT) {
^
main.c:72:21: error: 'SCE_CTRL_LTRIGGER' undeclared (first use in this function)
if (pad.buttons & SCE_CTRL_LTRIGGER) {
^
main.c:75:29: error: 'SCE_CTRL_RTRIGGER' undeclared (first use in this function)
} else if (pad.buttons & SCE_CTRL_RTRIGGER) {
^
main.c:80:21: error: 'SCE_CTRL_CROSS' undeclared (first use in this function)
if (pad.buttons & SCE_CTRL_CROSS) {
^
<builtin>: recipe for target 'main.o' failed
make: *** [main.o] Error 1

I basically got the same error on Windows which is why I made the switch to Ubuntu.
Ps Vita 3.18 TN-V10/ ARK
PS3 4.76 OFW :(
Jhon Doe or John Doe
Posts: 27
Joined: Tue May 12, 2015 8:28 am

Re: [Tutorial] How to compile homebrew for Rejuvenate on Ubu

Post by Jhon Doe or John Doe »

RanDomnss wrote:Mind telling me why I'm getting this error?

tyler@tyler-VirtualBox:~$ cd vitahelloworld-master
tyler@tyler-VirtualBox:~/vitahelloworld-master$ make
arm-vita-eabi-gcc -Wl,-q -Wall -O3 -I/include -L/lib -c -o main.o main.c
main.c: In function 'main':
main.c:51:21: error: 'SCE_CTRL_START' undeclared (first use in this function)
if (pad.buttons & SCE_CTRL_START) {
^
main.c:51:21: note: each undeclared identifier is reported only once for each function it appears in
main.c:61:21: error: 'SCE_CTRL_UP' undeclared (first use in this function)
if (pad.buttons & SCE_CTRL_UP) {
^
main.c:63:29: error: 'SCE_CTRL_DOWN' undeclared (first use in this function)
} else if (pad.buttons & SCE_CTRL_DOWN) {
^
main.c:66:21: error: 'SCE_CTRL_LEFT' undeclared (first use in this function)
if (pad.buttons & SCE_CTRL_LEFT) {
^
main.c:68:29: error: 'SCE_CTRL_RIGHT' undeclared (first use in this function)
} else if (pad.buttons & SCE_CTRL_RIGHT) {
^
main.c:72:21: error: 'SCE_CTRL_LTRIGGER' undeclared (first use in this function)
if (pad.buttons & SCE_CTRL_LTRIGGER) {
^
main.c:75:29: error: 'SCE_CTRL_RTRIGGER' undeclared (first use in this function)
} else if (pad.buttons & SCE_CTRL_RTRIGGER) {
^
main.c:80:21: error: 'SCE_CTRL_CROSS' undeclared (first use in this function)
if (pad.buttons & SCE_CTRL_CROSS) {
^
<builtin>: recipe for target 'main.o' failed
make: *** [main.o] Error 1

I basically got the same error on Windows which is why I made the switch to Ubuntu.
Because this precompiled toolchain is including an older version of the SDK which used PSP2_CTRL_* and vitahelloworld was updated for the new SDK which uses SCE_CTRL_*.

For using the older SDK version, this might work: https://github.com/xerpi/vitahelloworld ... 230853650c
For updating the SDK: https://github.com/vitasdk
666charizard
Posts: 7
Joined: Wed Jun 15, 2016 1:01 pm
Location: out your window
Contact:

Re: [Tutorial] How to compile homebrew for Rejuvenate on Ubu

Post by 666charizard »

This should work on arch right?
All I wanted was a pepsi.....
Locked

Return to “Rejuvenate”