Page 1 of 1

[Tutorial] How to compile homebrew for Rejuvenate on Ubuntu

Posted: Fri Sep 11, 2015 7:17 am
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

[email protected]:~$ 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

[email protected]:~$ cd ~
[email protected]:~$ tar -xzf gcc-arm-vita-eabi-4_9-2015q3.tar.gz
[email protected]:~$ 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

[email protected]:~$ 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

[email protected]:~$ sudo dpkg --add-architecture i386
[email protected]:~$ sudo apt-get update
[email protected]:~$ sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
7. Install GIT if not installed

Code: Select all

[email protected]:~$ 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

[email protected]:~$ git clone https://github.com/xerpi/vitahelloworld.git
[email protected]:~$ cd vitahelloworld
[email protected]:~/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!!!

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

Posted: Sat Sep 12, 2015 10:41 am
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.

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

Posted: Sun Apr 24, 2016 10:16 pm
by RanDomnss
Mind telling me why I'm getting this error?

[email protected]:~$ cd vitahelloworld-master
[email protected]:~/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.

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

Posted: Mon Apr 25, 2016 3:57 am
by Jhon Doe or John Doe
RanDomnss wrote:Mind telling me why I'm getting this error?

[email protected]:~$ cd vitahelloworld-master
[email protected]:~/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

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

Posted: Fri Jun 17, 2016 3:09 am
by 666charizard
This should work on arch right?