Page 1 of 2

[DEV TUT] Vita programming Tutorials: Part 0 -- Installation

Posted: Tue Aug 16, 2016 7:12 am
by thevitamaster
Hi guys,
welcome to my tutorial series on how to develop homebrew for the Vita with the unofficial vitaSDK toolchain and vita2dlib. In this series, we will start with part zero, which guides you through the installation of the necessary components, then we will continue in part one with a graphical hello world and we'll do a Game Menu in part two. Along the way, I'll explain all the function calls in the sample programs, and why they are needed, to you. Now, let's get started.

Requirements:
- An up-to-date Linux distribution which runs either natively or in a VM (some distros have Virtualbox images, so you can just plug and play, for example the Kali Linux distribution).
To update your linux system (provided you use apt as your package manager), you can open a terminal and type:

Code: Select all

apt-get update
apt-get upgrade
********************************************************************************************************************
- An internet connection
********************************************************************************************************************
- Some common sense for troubleshooting, etc.
********************************************************************************************************************

So, let's begin with the installation of the VitaSDK toolchain.
Here we'll do a manual install instead of running the automated vdpm script, because we want to keep a light ship and know exactly where everything is located.
1.:
Open a terminal and download the nightly build of the linux version:

Code: Select all

wget https://bintray.com/vitasdk/vitasdk/download_file?file_path=vitasdk-gcc-5.4-linux-compat-nightly-e4a61561aa42a32280c28406395a9e82fb0e75cd.tar.bz2
2.: Untar the archive:

Code: Select all

tar -xvf vitasdk-gcc-5.4-linux-compat-nightly-e4a61561aa42a32280c28406395a9e82fb0e75cd.tar.bz2 
3.: Move the contents of the untarred folder into the correctly named one:

Code: Select all

mkdir vitasdk
mv ~/gcc-arm-vita-eabi-5_4-2016q3/* ~/vitasdk/
rmdir gcc-arm-vita-eabi-5_4-2016q3/
4.: Move the vitasdk folder to /usr/local/:

Code: Select all

mv ~/vitasdk/ /usr/local/vitasdk
5.: Set the $VITASDK enviroment variable (this step varies between linux distributions):

Code: Select all

gedit ~/.bashrc
then press control+f and type .bash_aliases.
If this returns anything, then execute

Code: Select all

 gedit ~/.bash_aliases 
and add the line:

Code: Select all

export VITASDK=/usr/local/vitasdk
else, add the line

Code: Select all

export VITASDK=/usr/local/vitasdk
to your .bashrc file (gedit ~./bashrc)

Now, we install vita_portlibs followed by vitasdk:
1.:
Clone vita_portlibs

Code: Select all

git clone https://github.com/xerpi/vita_portlibs
cd vita_portlibs
2.:
Make

Code: Select all

sudo make
3.:
Clean up

Code: Select all

cd .. & rm -R vita_portlibs
4.:
Clone vita2dlib and install it

Code: Select all

git clone https://github.com/xerpi/libvita2d
cd libvita2d/libvita2d/
sudo make & sudo make install
5.:
And, lastly, it's always good to clean up behind you!

Code: Select all

cd ~/
rm -R libvita2d
And that was it! Quite simple, right?

Re: [DEV TUT] Vita programming Tutorials: Part 0 -- Installa

Posted: Tue Sep 13, 2016 7:07 pm
by domis4
Thank you for the really helpfull tutorial!
My 2 cents are maybe for some people helpfull, if vita_portlibs make fails (like mine) with the error:

Code: Select all

domi@domispc:~/vita_portlibs$ make
Using arm-vita-eabi-gcc-ar
Checking for arm-vita-eabi-gcc...
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
** ./configure aborting.
Makefile:97: recipe for target 'zlib' failed
make: *** [zlib] Error 1
this is on some distros relevant and solved my problem:
https://github.com/xerpi/vita_portlibs/ ... /README.md
This will install the portlibs to $VITASDK. If this is a privileged location, you will need to sudo make install-zlib and sudo make install in order for the portlibs to be installed.

Re: [DEV TUT] Vita programming Tutorials: Part 0 -- Installa

Posted: Fri Sep 16, 2016 1:59 am
by thevitamaster
domis4 wrote:Thank you for the really helpfull tutorial!
My 2 cents are maybe for some people helpfull, if vita_portlibs make fails (like mine) with the error:

Code: Select all

domi@domispc:~/vita_portlibs$ make
Using arm-vita-eabi-gcc-ar
Checking for arm-vita-eabi-gcc...
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
** ./configure aborting.
Makefile:97: recipe for target 'zlib' failed
make: *** [zlib] Error 1
this is on some distros relevant and solved my problem:
https://github.com/xerpi/vita_portlibs/ ... /README.md
This will install the portlibs to $VITASDK. If this is a privileged location, you will need to sudo make install-zlib and sudo make install in order for the portlibs to be installed.
Hi domis4, thanks for pointing that out. I changed the make and make install commands to be executed by root with sudo. Didn't have that at first because my build machine was running Kali Linux.

Re: [DEV TUT] Vita programming Tutorials: Part 0 -- Installa

Posted: Fri Sep 16, 2016 4:08 am
by KronosXLI
Is there a windows equivalent setup? I'm not going to download and setup a VM just for coding.

Re: [DEV TUT] Vita programming Tutorials: Part 0 -- Installa

Posted: Fri Sep 16, 2016 9:37 am
by thevitamaster
KronosXLI wrote:Is there a windows equivalent setup? I'm not going to download and setup a VM just for coding.
Yes, there is actually, and, if you're using Windows 10, you can also make the process considerably easier by using Bash for Windows.

Re: [DEV TUT] Vita programming Tutorials: Part 0 -- Installa

Posted: Tue Sep 20, 2016 4:29 pm
by KronosXLI
thevitamaster wrote:
KronosXLI wrote:Is there a windows equivalent setup? I'm not going to download and setup a VM just for coding.
Yes, there is actually, and, if you're using Windows 10, you can also make the process considerably easier by using Bash for Windows.
Oh thanks, not on win10 but I guess a bit of extra work is good for learning/practice.

Re: [DEV TUT] Vita programming Tutorials: Part 0 -- Installa

Posted: Tue Sep 20, 2016 4:31 pm
by KronosXLI
How did I miss that tab on henkaku? Well, better late than never.

Re: [DEV TUT] Vita programming Tutorials: Part 0 -- Installa

Posted: Thu Nov 24, 2016 3:07 am
by Blankets_McGee
trying to dl the nightly bulid from bintray.com....getting a 403 error...any help??? here is the original error:

Resolving bintray.com (bintray.com)... 108.168.194.93
Connecting to bintray.com (bintray.com)|108.168.194.93|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://dl.bintray.com/vitasdk/vitasdk/ ... cd.tar.bz2 [following]
--2016-11-23 22:03:03-- https://dl.bintray.com/vitasdk/vitasdk/ ... cd.tar.bz2
Resolving dl.bintray.com (dl.bintray.com)... 35.160.48.73, 35.163.95.201
Connecting to dl.bintray.com (dl.bintray.com)|35.160.48.73|:443... connected.
HTTP request sent, awaiting response... 403 Forbidden
2016-11-23 22:03:03 ERROR 403: Forbidden.


what does this mean?? i tried using wget -U firefox but that doesn't help either.

Re: [DEV TUT] Vita programming Tutorials: Part 0 -- Installa

Posted: Thu Nov 24, 2016 9:40 pm
by Globi
I also run into a "403: forbidden" error in step 1.

Re: [DEV TUT] Vita programming Tutorials: Part 0 -- Installa

Posted: Sun Nov 27, 2016 10:25 am
by domis4
for anyone getting 403, you must built from source.
https://github.com/vitasdk/buildscripts