Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  How to automatically compile a daily build
« previous next »
  • Print
Pages: [1]

Author Topic: How to automatically compile a daily build  (Read 4062 times)

Offline mikeage

  • Member
  • *
  • Posts: 110
    • mikeage.net
How to automatically compile a daily build
« on: October 09, 2006, 03:46:18 PM »
I know this is not a new build, but it's a general comment for customized builds, so I hope it can stay in this forum.

I wrote a small bash script that automatically downloads, patches, and compiles a build for a given day (or the current day) for a given platform. This way, I can put this in a cron job, and my builds are done automatically. I hope this will help those who want to release customized builds more frequently.

To use this, cut and paste into a file named (for example) rockbox.sh. Edit the list of patches to apply, and cut-and-paste the section labeled
Code: [Select]
#BUILDS#
to select the builds you want (the number needs to be changed to the appropriate number from the configure script, and the filename / directory should be set). Then run
Code: [Select]
rockbox.sh 20061005
to download and build the October 5th build (for example), or
Code: [Select]
rockbox.sh -d
for the current days build. Note that I've only tested this on Linux (Ubuntu Dapper Drake), not on cygwin.

Code: [Select]
#!/bin/bash
if [ -z "$1" ]; then
exit
fi

if [ $1 = "-d" ]; then
date=`date "+%Y%m%d"`
else
date=$1
fi

cd /tmp/
wget -c --quiet http://download.rockbox.org/daily/rockbox-daily-$date.tar.gz
tar xvfz rockbox-daily-$date.tar.gz
cd rockbox-daily-$date
# PATCHES #
patch -p0 <
patch -p0 <

#BUILDS#
#iPod 4G#
cd /tmp/
mkdir build-4g
cd build-4g
echo -e "24\n\n" | ../rockbox-daily-$date/tools/configure
make
make zip
mv rockbox.zip /tmp/rockbox-$date-4g.zip

#iPod mini1g#
cd /tmp/
mkdir build-mini1g
cd build-mini1g
echo -e "25\n\n" | ../rockbox-daily-$date/tools/configure
make
make zip
mv rockbox.zip /tmp/rockbox-$date-mini1g.zip


cd /tmp/
rm -rf rockbox-daily-$date build-4g build-mini1g

Hope this is helpful!
Logged

Offline JdGordon

  • Member
  • *
  • Posts: 1817
  • Constantly breaking stuff
Re: How to automatically compile a daily build
« Reply #1 on: October 15, 2006, 08:31:58 AM »
an alternative way (less download and possibly faste, especially if you dont use ccache)

login to cvs and grab the whole repository (instructions on the wiki)
then put something like this into a script in the rockbox/ direcoty

#!/bin/bash
cvs up -dPC # grab a clean version of the source code
patch -p0 < %PATCHES% #do this for each patch you want
cd build_dir
make
Logged


Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline iPodFoo

  • Member
  • *
  • Posts: 221
  • Ya dig?
    • iPod Nano Rockbox Blog
Re: How to automatically compile a daily build
« Reply #2 on: November 09, 2006, 02:19:01 PM »
Ive been trying out a script of my own similar to these. But something isnt working right.

The script is:

Code: [Select]
#!/bin/bash
cvs up -dPC # grab a clean version of the source code
mkdir nano-sim
cd nano-sim
echo -e "21\s\s" | ../tools/configure
make
make install

I run it as sh ./update.sh in the rockbox-devel folder. It downloads the source but then crashes out to:

Quote
: No such file or directory/tools/configure
: command not foundne 6: make
make: *** No rule to make target `install'.  Stop.
user@debian:~/rockbox-devel$

Not sure whats hiding behind the second line?
: command not foundne 6: make
EDIT: Think its saying Line 6: make.

Anyway, the nano-sim folder that is made comes out as nano-sim\r and I cant view inside it as it keeps saying file or folder not found. In XP its seen as nano-simâ–¡ a small box after the name, but i can view inside it, though theres nothing there obviously as the configure couldnt run.

I think because debian cant seem to go into that folder it wont run the configure.

Any help much appreciated.
« Last Edit: November 09, 2006, 04:38:03 PM by ipodfoo »
Logged
Visit my blog at modprojects.blogspot.com for some iPod Nano goodies!

Offline pabouk

  • Member
  • *
  • Posts: 387
Re: How to automatically compile a daily build
« Reply #3 on: November 09, 2006, 04:46:54 PM »
I am almost sure that you edited the script using some Windows editor so it has wrong line ends. Convert it using dos2unix or other conversion utility.

If you want to edit the files in Windows use a better editor (for example notepad2) and save the files with Unix-style ends.

Regarding the problematic directory: Have you tried something like ls -l nano-sim\r ?
Logged

Offline iPodFoo

  • Member
  • *
  • Posts: 221
  • Ya dig?
    • iPod Nano Rockbox Blog
Re: How to automatically compile a daily build
« Reply #4 on: November 10, 2006, 07:19:16 AM »
Excellente  ;D

You were right pabouk. I now used textpad to save as unix format now and its fine now.

Quick question, how can I have the script look for the nano-sim folder and create it if one isnt available? Do I need to use the if and else commands?

Thanks.
« Last Edit: November 10, 2006, 07:35:11 AM by ipodfoo »
Logged
Visit my blog at modprojects.blogspot.com for some iPod Nano goodies!

Offline pabouk

  • Member
  • *
  • Posts: 387
Re: How to automatically compile a daily build
« Reply #5 on: November 10, 2006, 09:29:16 AM »
The short code is:
Code: [Select]
 test -e nano-sim || mkdir nano-sim

It has the same meaning as:
Code: [Select]
if test ! -e nano-sim ; then
  mkdir nano-sim
fi

For positive conditions use && instead of ||.

I would also recommend using variables like:
Code: [Select]
BUILD_DIR=nano-sim

See also: http://pegasus.rutgers.edu/~elflord/unix/bash-tute.html
Logged

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Starting Development and Compiling
| | |-+  How to automatically compile a daily build
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.087 seconds with 15 queries.