#169934 - RyanFox - Sun Aug 16, 2009 8:04 am
The latest version of this script can be found at here.
Hey guys,
I'm not sure if anyone's already done this (a quick search revealed nothing), but I wrote myself an install script for libnds, devkitARM, etc.
When it's run, it will check Sourceforge for the latest files, download them, install into the proper directory structure (under the current directory) and then add lines to ~/.bashrc to set up the environment variables.
I've only tested this on my own computer, so I make no guarantees for it.
Edit: Apparently, I didn't test well enough, as I just found a bug. Now it should work. :)
Last edited by RyanFox on Thu Sep 10, 2009 4:01 am; edited 1 time in total
Hey guys,
I'm not sure if anyone's already done this (a quick search revealed nothing), but I wrote myself an install script for libnds, devkitARM, etc.
When it's run, it will check Sourceforge for the latest files, download them, install into the proper directory structure (under the current directory) and then add lines to ~/.bashrc to set up the environment variables.
I've only tested this on my own computer, so I make no guarantees for it.
Edit: Apparently, I didn't test well enough, as I just found a bug. Now it should work. :)
Code: |
#!/usr/bin/perl
use strict; use warnings; use LWP::Simple; use List::Util qw(maxstr); use Date::Manip; my $arch = `uname -m`; chomp($arch); my $os = "linux"; my $pages_base = "http://sourceforge.net/projects/devkitpro/files"; my $download_base = "http://downloads.sourceforge.net/project/devkitpro"; my @pages = ( "devkitARM", "libnds", "default%20arm7", "maxmod", "dswifi", "libfat", "filesystem", "examples_%20nds", ); print "Downloading the latest Nintendo DS development tool chain files...\n\n"; foreach my $page (@pages) { my %options; my $page_data; # If we don't get the page, try again twice more. for(my $i = 0; $i < 3; ++$i) { $page_data = get("$pages_base/$page"); if ($page_data) { last; } } if (!$page_data) { print "Failed 3 attempts to access $pages_base/$page.\n"; } my @content = split(/\n/,$page_data); foreach(@content) { if (/title="\/(.*($arch)?.*($os)?.*tar.*):\s* released on (.*)"/ && !/src/ && !/gba/ && !/ogc/) { my $key = ParseDate($4); my $val = $1; # Replace spaces to work properly in the URL. $val =~ s/ /%20/g; $options{$key} = $val; } } `wget -c -nc $download_base/$options{maxstr(keys %options)}`; } my $current_dir = `pwd`; chomp($current_dir); print "Extracting downloaded archives...\n"; print `tar -xvjf devkitARM*.tar.bz2`; mkdir "libnds"; chdir "libnds"; my @files = ("libnds", "libfat", "dswifi", "maxmod", "default_arm7", "libfilesystem"); foreach(@files) { print `tar -xvjf ../$_*.tar.bz2`; } chdir ".."; mkdir "examples"; chdir "examples"; mkdir "ds"; chdir "ds"; print `tar -xvjf ../../nds-examples*.tar.bz2`; `echo "export DEVKITPRO=$current_dir" >> ~/.bashrc`; `echo "export DEVKITARM=\\\$DEVKITPRO/devkitARM" >> ~/.bashrc`; |
Last edited by RyanFox on Thu Sep 10, 2009 4:01 am; edited 1 time in total