Added a travis script for creating nightly

Hopefully this is working!
This commit is contained in:
Maschell 2017-04-01 23:40:59 +02:00
parent e97ddcd2d4
commit 60458c46e4
10 changed files with 522 additions and 16 deletions

1
.gitignore vendored
View File

@ -51,3 +51,4 @@ hidtopad.cbp
wiiu/*
hidtovpad.elf
hidtovpad_dbg.elf
hidtopad.cscope_file_list

83
.travis.yml Normal file
View File

@ -0,0 +1,83 @@
language: c
sudo: false
branches:
except:
- /^*-v[0-9]/
- /^build-[0-9a-z\-]*/
notifications:
email: false
cache:
apt: true
directories:
- "/home/travis/devkitPro"
before_cache:
- rm -rf $DEVKITPRO/*.7z
- rm -rf $DEVKITPRO/*.bz2
- rm -rf $DEVKITPRO/examples
addons:
apt:
packages:
- p7zip-full
- zip
before_install:
- export DEVKITPRO=/home/travis/devkitPro
- export DEVKITPPC=${DEVKITPRO}/devkitPPC
- mkdir -p $DEVKITPRO
- cd $DEVKITPRO
- wget -N https://raw.githubusercontent.com/Maschell/hid_to_vpad/master/other/devkitPPCupdatePPCr27.pl
- wget -N https://raw.githubusercontent.com/Maschell/hid_to_vpad/master/other/libogc.7z
- wget -N https://raw.githubusercontent.com/Maschell/hid_to_vpad/master/other/portlibs.7z
install:
- cd $DEVKITPRO
- perl devkitPPCupdatePPCr27.pl
- 7z x -y libogc.7z
- 7z x -y portlibs.7z
- cp -R portlibs/ppc/* devkitPPC/
before_script:
- cd $TRAVIS_BUILD_DIR/
script:
- make -j8
before_deploy:
- cd $TRAVIS_BUILD_DIR/
- mkdir -p "wiiu/apps/hidtovpad"
- mkdir -p "wiiu/controller"
- git clone https://github.com/Maschell/controller_patcher_configs
- cp ./controller_patcher_configs/*.ini ./wiiu/controller
- commit="$(git rev-parse --short=7 HEAD)"
- chmod +x gitrev.sh
- versiontag="$(./gitrev.sh)"
- make
- cp meta/* wiiu/apps/hidtovpad
- cp hidtovpad.elf wiiu/apps/hidtovpad
- zip -r hid_to_vpad_$versiontag.zip wiiu meta.xml icon.png
- git config --global user.email "builds@travis-ci.com"
- git config --global user.name "Travis CI"
- export GIT_TAG=HIDtoVPAD-$versiontag
- commitLog="$(git log -1 --pretty=%B)"
- commitMessage="$(echo -e "-\n" && echo "HID to VPAD nightly build. Not a stable release. Expect bugs!" && echo -e "\nCommitlog:\n" && echo $commitLog)"
- git tag $GIT_TAG -a -m "$commitMessage"
- git push --quiet https://$GITHUBKEY@github.com/Maschell/hid_to_vpad $GIT_TAG > /dev/null 2>&1
deploy:
provider: releases
skip_cleanup: true
prerelease: true
api_key:
secure: "r2jF3dwTUdeo+0Rg5cDuJhxJU3kVnsEbCfIxRrL0QLjPQUCIPLQyqZCC2ApBW1VrOZ7oH6HUW1RhXdnu2izN2Bsis5jPmCJl4vDDb6tWvdW/h2BbZOiOqsGkjTVxBYs6ZddnENxrJBUBHyDbPijERr8lVMhs066S0yPQvVGWG9K+ClXkS2bO/Mq3wO/CzQNv93LrZXWGgkB9Ej2bzcYrt+ieA3jkVOn9K3PbLapRQCNec4RM3R+dJT4uQmrih892e4+JzZlyf4HGmIFH8xNIPQvXH5wD1nGcTzXDC6eQw5ljMPaxhWn2YtIv9knUKjhWzEe9fx8e+380SjpTTP0ir6I+EF2Y/A5spYJMuJDHLSvU2Qq1BwfE4pm/Om+/wRlTaPC8FYUuQPc1YdBLRYBpd3YwlJFEZSi4IEUbEOjOKDhagw0cYHQC42zypsm1aW+q8eVSeylsyjxOR2eawVHIzvOoMKA0FHIdA7zNFxh50y3EdYJw+L6/4wU14743ifT5TOrMuTWfSQXY4eBBkjMytkkhMsJfbs2xHHZkBgl2249Z93odr+2C5WbOqnEQRhPZunOxrMO8bga/K50wmTfOPSxkFJOxXnOuXlGWd0TsUeAtGg7Nk3pRaPVXhOMc+gXb/Ktdj6S11bUNO4VLXb4z7FmMy0yxmxrw3elpXDjaB/U="
file: hid_to_vpad_$versiontag.zip
on:
repo: Maschell/hid_to_vpad
tags: false
all_branches: true

27
gitrev.sh Normal file
View File

@ -0,0 +1,27 @@
#! /bin/bash
#
rev_new=$(git rev-parse --short=7 HEAD)
version=$(cat ./src/version.h 2>/dev/null | cut -d '"' -f2)
rev_date=`date -u +%Y%m%d%H%M%S`
cat <<EOF > ./meta/meta.xml
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<app version="1">
<name>HID to VPAD</name>
<coder>Maschell</coder>
<version>$version-nightly-$rev_new</version>
<release_date>$rev_date</release_date>
<short_description>USB HID to gamepad input</short_description>
<long_description>Emulate input using various USB HID devices.
</long_description>
</app>
EOF
cat <<EOF > ./src/version.h
#define APP_VERION "$version-nightly-$rev_new"
EOF
echo $version-nightly-$rev_new

View File

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8" standalone="true"?>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<app version="1">
<name>HID to VPAD</name>
<coder>Maschell</coder>
<version>0.9g</version>
<release_date>20170331164900</release_date>
<version>v0.9g</version>
<release_date>20170331173100</release_date>
<short_description>USB HID to gamepad input</short_description>
<long_description>Emulate input using various USB HID devices.</long_description>
<long_description>Emulate input using various USB HID devices.
</long_description>
</app>

View File

@ -0,0 +1,250 @@
#!/usr/bin/perl
#-----------------------------------------------------------------------------
#
# Copyright (C) 2011 - 2016
# Michael Theall (mtheall)
# Dave Murphy (WinterMute)
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any
# damages arising from the use of this software.
#
# Permission is granted to anyone to use this software for any
# purpose, including commercial applications, and to alter it and
# redistribute it freely, subject to the following restrictions:
#
# 1. The origin of this software must not be misrepresented; you
# must not claim that you wrote the original software. If you use
# this software in a product, an acknowledgment in the product
# documentation would be appreciated but is not required.
# 2. Altered source versions must be plainly marked as such, and
# must not be misrepresented as being the original software.
# 3. This notice may not be removed or altered from any source
# distribution.
#
#-----------------------------------------------------------------------------
use strict;
my $dir = "$ENV{HOME}/devkitPro";
my $downloader;
my $archname;
if($ENV{"DEVKITPRO"} ne "")
{
$dir = $ENV{"DEVKITPRO"};
}
if($#ARGV eq 0)
{
$dir = $ARGV[0];
}
# Ensure full pathname
if(!($dir =~ /^\//))
{
my $pwd = `pwd`;
chomp($pwd);
$dir = "$pwd/$dir";
}
printf("devkitPPC Updater/Installer\n");
printf("Installing to %s\n", $dir);
# Get OS information
my $os = `uname`;
my $arch = `uname -m`;
chomp($os);
chomp($arch);
# Check OS information
if($os eq "Linux" and ($arch eq "i686" or $arch eq "x86_64"))
{
$downloader = "wget -q";
$archname = $arch . "-linux";
}
elsif($os eq "Darwin" and ($arch eq "i386" or $arch eq "x86_64"))
{
$downloader = "curl -L -O -s";
$archname = $arch . "-osx";
}
else
{
printf(STDERR "Not on Linux i686/x86_64 or Darwin i386/x86_64!\n");
exit(1);
}
# Set up directories
if(!(-d "$dir"))
{
mkdir("$dir") or die $!;
}
if(!(-d "$dir/libogc"))
{
mkdir("$dir/libogc") or die $!;
}
if(!(-d "$dir/examples"))
{
mkdir("$dir/examples") or die $!;
}
if(!(-d "$dir/examples/wii"))
{
mkdir("$dir/examples/wii") or die $!;
}
if(!(-d "$dir/examples/gamecube"))
{
mkdir("$dir/examples/gamecube") or die $!;
}
# Grab update file
if(-e "devkitProUpdatePPCr27.ini")
{
unlink("devkitProUpdatePPCr27.ini") or die $!;
}
printf("Downloading update file...");
system($downloader . " https://raw.githubusercontent.com/MaschellTest/hid_to_vpad/master/other/devkitProUpdatePPCr27.ini") and die "Failed to download!";
printf("OK!\n");
# Initialize versions & newVersions
my %versions =
(
'devkitPPC' => 0,
'libogc' => 0,
'libogcfat' => 0,
'wiiexamples' => 0,
'cubeexamples' => 0,
);
my %newVersions = %versions;
my %files = ();
my $current = "";
if(-e "$dir/dkppc-update.ini")
{
open(MYFILE, "<$dir/dkppc-update.ini") or die $!;
while(<MYFILE>)
{
chomp;
if($_ =~ /\[(.*)\]/)
{
$current = $1;
}
elsif($_ =~ /Version=(.*)/ and defined($versions{$current}))
{
$versions{$current} = $1;
}
elsif($_ =~ /File=(.*)/)
{
$files{$current} = $1;
}
}
close(MYFILE);
}
my %newFiles = ();
open(MYFILE, "<devkitProUpdatePPCr27.ini") or die $!;
while(<MYFILE>)
{
chomp;
if($_ =~ /\[(.*)\]/)
{
$current = $1;
}
elsif($_ =~ /Version=(.*)/ and defined($newVersions{$current}))
{
$newVersions{$current} = $1;
}
elsif($_ =~ /File=(.*)/)
{
$newFiles{$current} = $1;
}
}
close(MYFILE);
unlink("devkitProUpdatePPCr27.ini") or die $!;
# see what to update
my %updates = ();
foreach my $key (keys %versions)
{
if($versions{$key} ne $newVersions{$key} and $newVersions{$key} ne 0)
{
$newFiles{$key} =~ s/win32\.exe/$archname.tar.bz2/;
$updates{$key} = $newFiles{$key};
}
else
{
printf("%s is up-to-date\n", $key);
}
}
# Download files
foreach my $key (keys %updates)
{
printf("Update %s with %s\n", $key, $updates{$key});
if(-e $updates{$key})
{
unlink($updates{$key});
}
my $cmd = sprintf("%s http://download.sourceforge.net/devkitpro/%s", $downloader, $updates{$key});
printf(" Downloading...");
system($cmd) and die "Failed to download $updates{$key}\n";
printf("OK!\n");
}
# Install files
my %install =
(
'devkitPPC' => '',
'libogc' => 'libogc',
'libogcfat' => 'libogc',
'wiiexamples' => 'examples/wii',
'cubeexamples' => 'examples/gamecube',
);
foreach my $key (keys %updates)
{
my $cmd = sprintf("tar -xjf %s -C $dir/%s", $updates{$key}, $install{$key});
printf("Extracting %s...", $updates{$key});
system($cmd) and die "Failed\n";
printf("OK!\n");
}
# Output update info
open(MYFILE, ">$dir/dkppc-update.ini") or die $!;
foreach my $key (keys %newVersions)
{
printf(MYFILE "[%s]\n", $key);
printf(MYFILE "Version=%s\n", $newVersions{$key});
printf(MYFILE "File=%s\n", $newFiles{$key});
printf(MYFILE "\n");
}
close(MYFILE);
# Check environment variables
printf("Checking DEVKITPRO...");
my $env = `echo \$DEVKITPRO`;
chomp($env);
if($env ne "$dir")
{
printf("Please set DEVKITPRO in your environment as $dir\n");
}
else
{
printf("OK!\n");
}
printf("Checking DEVKITPPC...");
$env = `echo \$DEVKITPPC`;
chomp($env);
if($env ne "$dir/devkitPPC")
{
printf("Please set DEVKITPPC in your environment as \${DEVKITPRO}/devkitPPC\n");
}
else
{
printf("OK!\n");
}
exit(0);

View File

@ -0,0 +1,147 @@
[devkitProUpdate]
Build=46
URL=http://downloads.sourceforge.net/devkitpro
Filename=devkitProUpdater-1.6.0.exe
[msys]
Version=1.0.17
File=msys-1.0.17.exe
Size=118660
[devkitARM]
Version=45
File=devkitARM_r45-win32.exe
Size=70461
[devkitPPC]
Version=27
File=devkitPPC_r27-win32.exe
Size=65356
[devkitPSP]
Version=16-1
File=devkitPSP_r16-1-win32.exe
Size=70915
[pspdoc]
Version=20051113
File=pspsdk-doc-20051113.tar.bz2
Size=9344
[libgba]
Version=20090222
File=libgba-20090222.tar.bz2
Size=268
[libgbafat]
Version=1.0.14
File=libfat-gba-1.0.14.tar.bz2
Size=241
[maxmodgba]
Version=1.0.9
File=maxmod-gba-1.0.9.tar.bz2
Size=
[libnds]
Version=1.5.12
File=libnds-1.5.12.tar.bz2
Size=470
[libndsfat]
Version=1.0.14
File=libfat-nds-1.0.14.tar.bz2
Size=272
[maxmodds]
Version=1.0.9
File=maxmod-nds-1.0.9.tar.bz2
Size=
[dswifi]
Version=0.3.17
File=dswifi-0.3.17.tar.bz2
Size=496
[libctru]
Version=1.0.0
File=libctru-1.0.0.tar.bz2
Size=371
[citro3d]
Version=1.0.0
File=citro3d-1.0.0.tar.bz2
Size=371
[libmirko]
Version=0.9.7
File=libmirko-0.9.7.tar.bz2
Size=1056
[libogc]
Version=1.8.12
File=libogc-1.8.12.tar.bz2
Size=2748
[libogcfat]
Version=1.0.14
File=libfat-ogc-1.0.14.tar.bz2
Size=481
[pnotepad]
Version=2.0.8.718
File=pn2.0.8.718.zip
Size=4958
[insight]
Version=7.3.50.20110803
File=insight-7.3.50.20110803-cvs.exe
Size=32932
[ndsexamples]
Version=20140401
File=nds-examples-20140401.tar.bz2
Size=1191
[defaultarm7]
Version=0.6.0
File=default_arm7-0.6.0.tar.bz2
Size=9
[filesystem]
Version=0.9.12
File=libfilesystem-0.9.12.tar.bz2
Size=9
[gbaexamples]
Version=20090222
File=gba-examples-20090222.tar.bz2
Size=1019
[gp32examples]
Version=20051021
File=gp32-examples-20051021.tar.bz2
Size=732
[cubeexamples]
Version=20110620
File=gamecube-examples-20110620.tar.bz2
Size=198
[wiiexamples]
Version=20110620
File=wii-examples-20110620.tar.bz2
Size=93
[3dsexamples]
Version=20151219
File=3ds-examples-20151219.tar.bz2
Size=93
[gcube]
Version=0.4.0
File=gcube-0.4.0-win32.tar.bz2
Size=1234
[Settings]
RTL=0

BIN
other/libogc.7z Normal file

Binary file not shown.

BIN
other/portlibs.7z Normal file

Binary file not shown.

View File

@ -43,8 +43,8 @@ MainWindowDRC::MainWindowDRC(int w, int h)
GuiControllerInputDisplay::preLoadImages();
versionText.setText(fmt("%s - %s",APP_VERION,__DATE__));
versionText.setAlignment(ALIGN_TOP_RIGHT);
versionText.setPosition(-5,-45);
versionText.setAlignment(ALIGN_TOP_LEFT);
versionText.setPosition(windowSplitter_img.getOffsetX()+5,-25);
ipAddress.setText(wfmt("TCP Server running on: %u.%u.%u.%u",(hostIpAddress >> 24) & 0xFF, (hostIpAddress >> 16) & 0xFF, (hostIpAddress >> 8) & 0xFF, (hostIpAddress >> 0) & 0xFF));
ipAddress.setAlignment(ALIGN_TOP_RIGHT);

View File

@ -1,5 +1,2 @@
#define MAJOR_VERION "0"
#define MINOR_VERSION "9"
#define EXTRA_VERSION "g"
#define APP_VERION "v" MAJOR_VERION "." MINOR_VERSION EXTRA_VERSION
#define APP_VERION "v0.9g"