Building Podzilla for the Desktop

From wikiPodLinux

NOTE This is out of date - needs to be edited to reflect the new Makefile. Also, podzilla 2 is built as described at Building Podzilla and can be built for either iPod or desktop from the same build.

Table of contents

Introduction

We're gonna build podzilla so it can run on the desktop. This can be useful if you're developing stuff for the iPod and either (a) don't have an iPod about or (b) don't like copying podzilla onto the ipod and rebooting (the iPod) just to test it. Running it from the desktop isn't perfect however. Navigating the menu takes a bit of getting used to.

You might wanna build podzilla for the iPod before doing this. If so, see Building Podzilla (legacy). A lot of this was taken from there.

Image:Podzilla_desktop.png Image:Podzilla-mac-desktop.jpg Image:Podzilla-win-desktop.png

Caveat: The specific instructions for Windows/Cygwin are not yet perfect.

Needed Libraries

You'll need to download these archives before being able to build podzilla.

Automatic Build on Linux

If you want to build podzilla on Linux, you can get this small shell script, edit the paths in it and execute it to automatically build podzilla for X from CVS. You will need the toolchain installed and all of the files from above downloaded in some directory. See the script source for instructions.

Automatic build script for Linux: Image:Xpodzilla-builder.tgz


Building libjpeg

1. Make a new directory for your desktop-specific stuff (I'll call mine ~/ipodlinux/desktop). The podzilla source code will be in ~/ipodlinux/podzilla, and the libs (jpegsrc, microwindows, libitunesdb) compiled will be in ~/ipodlinux. For info on compiling the libs for the iPod consult Building Podzilla.

2. Untar jpegsrc

$ mkdir ~/ipodlinux/libjpeg
$ cd ~/ipodlinux/libjpeg
$ tar xvzf ../jpegsrc.v6b.tar.gz
$ mv jpeg-6b ipod-x11
$ cd ipod-x11

3. Configure the library for your desktop (rather than the iPod):

$ ./configure

4. Build the package:

$ make
$ ranlib libjpeg.a

Building Microwindows

1. Create your microwindows directory and untar Microwindows

$ mkdir ~/ipodlinux/microwindows
$ cd ~/ipodlinux/microwindows
$ tar xvzf ../microwindows-0.90.tar.gz
$ mv microwindows-0.90 ipod-x11

2. Get the Microwindows changes from ipodlinux CVS:

2a. Login to the CVS server (just press enter when prompted for a password):

$ cvs -d:pserver:anonymous@ipodlinux.cvs.sourceforge.net:/cvsroot/ipodlinux login

2b. Check out the Microwindows changes from CVS:

$ cvs -d:pserver:anonymous@ipodlinux.cvs.sourceforge.net:/cvsroot/ipodlinux co tools/microwindows

2c. Copy the changes over to your Microwindows directory:

$ cp -rf tools/microwindows/src/* ipod-x11/src/
$ rm -R tools

3. cd into the Microwindows source directory:

$ cd ipod-x11/src

4. Copy the new ipodlinux x11 config file that you just got from CVS:

$ cp Configs/config.ipod_x11 config

5.Windows/Cygwin only:

5a. Extract this archive in ipod-x11: Image:Microwindows_include_bogus.tgz

5b. In microwindows-0.90/src/Makefile.rules add "-I$(TOP)/../include_bogus" to INCLUDEDIRS:

- INCLUDEDIRS += -I. -I$(TOP)/include 
+ INCLUDEDIRS += -I. -I$(TOP)/include -I$(TOP)/../include_bogus

5c. Add "/usr/X11R6/bin/libX11.dll" to MW_CORE_LIBS:

- MW_CORE_LIBS := 
+ MW_CORE_LIBS := /usr/X11R6/bin/libX11.dll

Notice that the libs in Cygwin have ".dll" in their filenames.

7. OSX only:

7a. Edit src/Makefile.rules:

- $(AR) $(ARFLAGS) $(TOP)/lib/$(LIBNAME) $(OBJS) $(CXXOBJS) $(ASMOBJS)
+ -$(AR) $(ARFLAGS) $(TOP)/lib/$(LIBNAME) $(OBJS) $(CXXOBJS) $(ASMOBJS)

8. Build the package:

$ make

NOTE: You will need the libxorg-x11-devel package (well I did anyhow) for the X11 header files.

9. Some users might want to build various microwindows builds to test out their podzilla build for Mini and Photo, as well as original iPod screen formats. Here's a suggestion on how to do this: (NOTE: this procedure is untested for Windows-based installs, and requires that you have the command "lndir", which is usually included in X11 distributions.) Instead of doing step 8 above, do this: (or if you've already done step 8, do a 'make clean' in that directory.

9a. cd back up to your microwindows directory.

9b. set your configured directory aside as ipod-x11-base

mv ipod-x11 ipod-x11-base

9c. make three new directories next to that ipod-x11-base directory:

mkdir ipod-x11
mkdir mini-x11
mkdir photo-x11

9d. for each of these, link build the appropriate version of the microwindows library:

cd mini-x11
lndir ../ipod-x11-base 
cd src
make IPOD=MINI

do the same for the 'photo-x11' directory ("make IPOD=PHOTO") and 'ipod-x11' directory ("make")

9e. When you want to build for a selected display target, just select the appropriate target to build for it: make will build for original monochrome 1-4g ipod display format make PHOTO=1 will build for photo display format make MINI=1 will build for mini display format

Building libitunesdb

1. Create your libitunesdb directory and untar libitunesdb:

$ mkdir ~/ipodlinux/libitunesdb
$ cd ~/ipodlinux/libitunesdb
$ tar xvzf ../libitunesdb_0.5.1.tar.gz
$ mv libitunesdb_0.5.1 ipod-x11
$ cd ipod-x11

2. Type these to build the library: (The automake cmd is not needed if you have libitunesdb_0.5.2)

$ ./configure
$ make

Ensure you have g++, or the configure script will fail (took me a while to figure that out).

3. Windows/Cygwin only: Unfortunately there is currently no known way to get this library to compile under Cygwin.

MP4 File Format Library

Podzilla needs the MP4FF library from FAADv2 to understand M4A/M4B files.

% cd ~/ipodlinux
% tar zxf ~/ipodlinux/mp4ff.tar.gz
% cd mp4ff
% ./make-build-dirs.sh
% cd ipod-x11
% make

The make-build-dirs.sh script requires lndir, which usually comes as part of X11. If you don't have it, do the following instead of the ./make-build-dirs.sh line. This goes for the AAC decoder library too (Note: Mac OS X users should use "cp -pR ..." instead of "cp -dpR ..." since the -d option is not available on Mac OS X):

% mv src ipod
% cp -dpR ipod ipod-x11

Helix AAC Decoder Library

Podzilla uses the Helix Datatype AAC decoder to decode the AAC streams in M4A/M4B files.

% cd ~/ipodlinux
% tar zxf ~/ipodlinux/helix-aacdec.tar.gz
% cd helix-aacdec
% ./make-build-dirs.sh
% cd ipod-x11
% make

Getting Podzilla

Note: If you already have the podzilla code (from CVS) you can skip down to Configuring Podzilla.

1. cd back to ~/ipodlinux:

$ cd ~/ipodlinux

2. Login to the CVS server (just press enter if when prompted for a password):

$ cvs -d:pserver:anonymous@ipodlinux.cvs.sourceforge.net:/cvsroot/ipodlinux login

3. Download the current podzilla sources from CVS:

$ cvs -d:pserver:anonymous@ipodlinux.cvs.sourceforge.net:/cvsroot/ipodlinux co -d podzilla tools/podzilla

Configuring Podzilla

1. Enter the directory containing the podzilla source code:

$ cd podzilla

2. Now you should be able to run make to compile podzilla for microwindows. Running ./podzilla should open a new podzilla window after it is compiled. Use 'l' (left wheel), 'r' (right wheel), 'm' (menu), 'enter' (action), 'w' (rewind), 'f' (fast-forward), 'd' (play) to navigate.

2a. If you get an error, when the linker cannot find the jpeg library, along the lines of

 ld: can't locate file for: -ljpeg

Then you need to edit your makefile. Around line 73, you should see the following:

 # for libjpeg on x11
 #LDFLAGS+= -L../libjpeg/ipod-x11

Uncomment out the LDFLAGS line like so:

 # for libjpeg on x11
 LDFLAGS+= -L../libjpeg/ipod-x11


3. Running make IPOD=1 should build the ipod binary.

Configuring Podzilla in Windows/Cygwin

Since the above link is no longer available (?) these instructions are based on the original Makefile.

1. In the beginning of the Makefile there are two sections, one for compiling the iPod binary and one for compiling the X11 binary.

1a. Add the following lines to the iPod section:

CFLAGS+= -I$(LIBITUNESDB)
LDFLAGS+= $(LIBITUNESDB)/.libs/libitunesdb.a

1b. In the X11 section add the reference to the Cygwin X11 library:

-LDFLAGS=-L/usr/X11R6/lib -lX11
+LDFLAGS=-L/usr/X11R6/lib -lX11 /usr/X11R6/bin/libX11.dll

1d. Below the X11 section, remove references to libitunesdb in the CFLAGS and LDFLAGS lines:

-CFLAGS+=-Wall -g -I$(MICROWINDOWS)/include -g -I$(LIBITUNESDB) -DPZ_VER="$(PZ_VER)"
-LDFLAGS+=$(MICROWINDOWS)/lib/libnano-X.a $(MICROWINDOWS)/lib/libmwengine.a $(MICROWINDOWS)/lib/libmwdrivers.a $(MICROWINDOWS)/lib/libmwfonts.a $(LIBITUNESDB)/.libs/libitunesdb.a
+CFLAGS+=-Wall -g -I$(MICROWINDOWS)/include -g -DPZ_VER="$(PZ_VER)"
+LDFLAGS+=$(MICROWINDOWS)/lib/libnano-X.a $(MICROWINDOWS)/lib/libmwengine.a $(MICROWINDOWS)/lib/libmwdrivers.a $(MICROWINDOWS)/lib/libmwfonts.a

1e. In the list of object files, remove "mp3.o", "playlist.o", "itunes_db.o" and "itunesmenu.o".

1f. In the conditional below the object list, add "itunes_db.o" and "itunesmenu.o":

ifneq ($(IPOD),)
OBJS+=\
	mp3.o \
	playlist.o \
	itunes_db.o \
	itunesmenu.o \
	mp3decoder.o
endif

2. The file ipod.c includes some low level operations that will not work under X11. Add stub definitions of the functions IOR and IOW after the includes:

#ifndef IPOD
 #define _IOR(a, b, c) -1
 #define _IOW(a, b, c) -1
#endif

3. menu.c uses some itubesdb related things and as long as we can't compile those we need to make some adjustments.

3a. Remove the external declarations of the functions that open the itunes windows:

#ifdef IPOD
 extern void new_itunes_track(void);
 extern void new_itunes_artist(void);
 extern void new_itunes_album(void);
 extern void new_itunes_plist(void);
#endif

3b. Remove the itunes-related menus:

#ifdef IPOD
 static struct menu_item itunes_menu[] = {
        {"Playlists", ACTION_MENU, new_itunes_plist, NOSETTING, 0},
        {"Artists", ACTION_MENU, new_itunes_artist, NOSETTING, 0},
@@ -169,9 +172,12 @@
        {"Songs", ACTION_MENU, new_itunes_track, NOSETTING, 0},
        {0, 0, 0}
 };
#endif

 static struct menu_item main_menu[] = {
#ifdef IPOD
        {"Music", SUB_MENU_HEADER, itunes_menu, NOSETTING, 0},
#endif

Pre-Configured Podzilla for Windows

If you have tried everything and still can't seem to configure podzilla for windows, you can download this Missing imagePodzilla_desktop.tgz pre-configured build of podzilla for windows. It's not the most recent build of podzilla, but it works. Missing image
Podzilla_desktop.tgz
Image:podzilla_desktop.tgz

Navigation



  • Google Search (http://www.google.com/custom?sa=Google+Search&cof=S%3Ahttp%3A%2F%2Fwww.ipodlinux.org%3BVLC%3Apurple%3BAH%3Acenter%3BBGC%3Awhite%3BLH%3A141%3BLC%3Ablue%3BL%3Ahttp%3A%2F%2Fipodlinux.org%2Fstylesheets%2Fimages%2Fwiki.png%3BALC%3Ablue%3BLW%3A128%3BT%3Ablack%3BAWFID%3A70a74ab66f4d59ae%3B&domains=ipodlinux.org&sitesearch=ipodlinux.org)