Skip to content

Commit

Permalink
wii: build env dockerize
Browse files Browse the repository at this point in the history
  • Loading branch information
palxex committed Apr 10, 2021
1 parent 8a3e0d0 commit 4187ebf
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 103 deletions.
41 changes: 10 additions & 31 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,42 +128,21 @@ jobs:
- os: linux
env: TARGET=wii EXT=tar.bz2
before_install:
- export DEVKITPRO=$CACHE/devkitPro
- export DEVKITPPC=${DEVKITPRO}/devkitPPC
- export PATH=$DEVKITPPC/bin:$PATH
- |
if ! [ -f $DEVKITPRO/libogc/include/gctypes.h ]
then
rm -rfv $DEVKITPRO
fi
- export PUSHD="$(pwd)"
- mkdir -p $CACHE/
- cd $CACHE/
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker run -dit --name devkit -v $(pwd):/cache -v $TRAVIS_BUILD_DIR:/src devkitpro/devkitppc bash
- |
if ! [ -d $DEVKITPRO ]
if ! [ -d $CACHE/sdl-wii ]
then
export PUSHD="$(pwd)"
mkdir -p $DEVKITPRO
(
cd $DEVKITPRO &&
wget https://github.com/sdlpal/tools/releases/download/sensedown/devkitPPC_r27-x86_64-linux.tar.bz2 &&
wget https://github.com/sdlpal/tools/releases/download/sensedown/libogc-1.8.12.tar.bz2 &&
wget https://github.com/sdlpal/tools/releases/download/sensedown/libfat-ogc-1.0.13.tar.bz2 &&
wget https://github.com/dborth/sdl-wii/releases/download/2013-10-28/SDL.Wii.10-28-2013.zip
)&&(
cd $DEVKITPRO
tar xvf devkitPPC_r27-x86_64-linux.tar.bz2
mkdir libogc
tar xvf libogc-1.8.12.tar.bz2 -C libogc
tar xvf libfat-ogc-1.0.13.tar.bz2 -C libogc
unzip SDL.Wii.10-28-2013.zip
rm -v *.zip *.bz2
echo "cache finished!"
)||(
rm -rfv $DEVKITPRO
echo "download failed! clearing cache"
)
git clone https://github.com/dborth/sdl-wii.git
fi
- docker exec -it devkit make -C cache/sdl-wii/SDL install
- cd "${PUSHD}"
script:
- cd wii
- make
- docker exec -it devkit /bin/bash -ex /src/wii/.travis/docker.sh
- tar cvjf ../deploy/sdlpal-wii.tar.bz2 icon.png meta.xml boot.dol
- make clean
- cd ..
Expand Down
4 changes: 4 additions & 0 deletions wii/.travis/docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash -ex
source /etc/profile.d/devkit-env.sh
export PATH=$DEVKITPPC/bin:$PATH
make -C /src/wii
4 changes: 2 additions & 2 deletions wii/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ CPPFILES = $(foreach dir, $(SOURCES), $(wildcard $(dir)/*.cpp))
OFILES = $(CFILES:.c=$(INTER).o) $(CPPFILES:.cpp=$(INTER).o)
DEPFILES = $(OFILES:.o=.d)

CCFLAGS = $(DFALG) -g -Wall -O2 -DGEKKO -D__POWERPC__ -D__ppc__ $(EXTRA_CCFLAGS) $(DEPFLAGS) -I$(DEVKITPRO)/libogc/include -I$(DEVKITPRO)/libogc/include/ogc -I$(DEVKITPRO)/libogc/include/SDL
CCFLAGS = $(DFALG) -g -Wall -O2 -DGEKKO -D__POWERPC__ -D__ppc__ $(EXTRA_CCFLAGS) $(DEPFLAGS) -I$(DEVKITPRO)/libogc/include -I$(DEVKITPRO)/libogc/include/ogc -I$(DEVKITPRO)/portlibs/wii/include/SDL
CXXFLAGS = $(CCFLAGS) -std=c++11
CFLAGS = $(CCFLAGS) -std=gnu99
LDFLAGS = -L$(DEVKITPRO)/libogc/lib/wii -lSDL -lfat -lwiiuse -lbte -logc -lm -lwiikeyboard -lg -mrvl
LDFLAGS = -L$(DEVKITPRO)/libogc/lib/wii -L$(DEVKITPRO)/portlibs/wii/lib -lSDL -lfat -lwiiuse -lbte -logc -lm -lwiikeyboard -lg -mrvl

ifeq ($(DEBUG),1)
CCFLAGS += -DDEBUG -I$(DEVKITPRO)/wii_dev_debug/net_print/sockettest/source
Expand Down
70 changes: 0 additions & 70 deletions wii/libc.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,76 +27,6 @@ int access(const char *pathname, int mode) {
return 0;
}

int alphasort(const void *d1, const void *d2)
{
return strcmp((*(struct dirent * const *)d1)->d_name,
(*(struct dirent * const *)d2)->d_name);
}

int scandir(const char *dirp, struct dirent ***namelist,
int (*filter)(struct dirent *),
int (*compar)(const void *, const void *))
{

DIR *dp = opendir (dirp);
struct dirent *current;
struct dirent **names = NULL;
size_t names_size = 0, pos;

if (dp == NULL)
return -1;

errno = 0;

pos = 0;
while ((current = readdir (dp)) != NULL)
if (filter == NULL || (*filter) (current))
{
struct dirent *vnew;
size_t dsize;

if (pos == names_size)
{
struct dirent **new;
if (names_size == 0)
names_size = 10;
else
names_size *= 2;
new = (struct dirent **) realloc (names, names_size * sizeof (struct dirent *));
if (new == NULL)
break;
names = new;
}

dsize = &current->d_name[strlen(current->d_name)+1] - (char *) current;
vnew = (struct dirent *) malloc (dsize);
if (vnew == NULL)
break;

names[pos++] = (struct dirent *) memcpy (vnew, current, dsize);
}

if (errno != 0)
{
closedir (dp);
while (pos > 0)
free (names[--pos]);
free (names);

return -1;
}

closedir (dp);


/* Sort the list if we have a comparison function to sort with. */
if (compar != NULL)
qsort (names, pos, sizeof (struct dirent *), compar);
*namelist = names;
return pos;
}


#endif

/*-----------------------------------------------------------------------
Expand Down

0 comments on commit 4187ebf

Please sign in to comment.