|
|
Notes on compiling AMIDE and associated programs on Mac OS X and creating an app bundle
This is a long, involved process, and assumes a good command of
standard GNU build environments. Be aware that these notes are
fragmentary and may contain bugs and omissions.
At present, (amide 1.0.1) I'm building on OS X 10.6 and it works
for both 10.6 and 10.7. It's unclear if building on 10.7 will create a
binary that also works on 10.6.
General notes. Not currently using a common framework for gtk, as this
is not ready for distribution yet per the gtk-osx.sf.net site. As
such, all libraries (including GTK) will be included in the AMIDE app
bundle.
- XCode: Need to have XCode installed
- amide.modules: Create a file containing the following called amide/amide.modules
<?xml version="1.0"?>
<!DOCTYPE moduleset SYSTEM "moduleset.dtd">
<?xml-stylesheet type="text/xsl" href="moduleset.xsl"?>
<moduleset>
<repository type="tarball" name="sourceforge" default="yes"
href="http://downloads.sourceforge.net/project/"/>
<repository type="tarball" name="gnu" default="yes"
href="http://mirrors.ecvps.com/gnu/"/>
<repository type="tarball" name="offis" default="yes"
href="ftp://dicom.offis.de/pub/dicom/offis/software/"/>
<autotools id="dcmtk" makeinstallargs="install install-lib" autogen-sh="configure">
<branch repo="offis" module="dcmtk/dcmtk360/dcmtk-3.6.0.tar.gz"
version="3.6.0"/>
</autotools>
<autotools id="xmedcon" autogenargs="--disable-tpc" autogen-sh="configure">
<branch repo="sourceforge" module="xmedcon/XMedCon-Source/0.10.7/xmedcon-0.10.7.tar.bz2"
version="0.10.7"/>
</autotools>
<autotools id="gsl" autogen-sh="configure">
<branch repo="gnu" module="gsl/gsl-1.15.tar.gz"
version="1.15"/>
</autotools>
<autotools id="volpack" autogen-sh="configure">
<branch repo="sourceforge" module="amide/volpack/1.0c7/volpack-1.0c7.tgz"
version="1.0c7"/>
</autotools>
<autotools id="amide" autogenargs="--enable-amide-debug=no --enable-native-gtk-osx=yes" autogen-sh="configure">
<branch repo="sourceforge" module="amide/amide/1.0.1/amide-1.0.1.tgz"
version="1.0.1"/>
<dep package="libgnomecanvas"/>
<dep package="xmedcon"/>
<dep package="gsl"/>
<dep package="dcmtk"/>
<dep package="volpack"/>
</autotools>
</moduleset>
- GTK-OSX install:
Goto http://www.gtk.org/download/macos.php
follow Building GTK-OSX directions
will need to add the following in .bashrc:
export PATH=~/.local/bin:$PATH
and run "source .bashrc" to load this into the shell
If your version of OS X/X Code does not include GIT, will need to
install it.
Will need to add this line to the beginning of .jhbuildrc-custom as
apple's version of libiconv does not play well with the standard
version.
skip.append("libiconv")
Will need to setup for 32bit building, as 64bit is currently poorly
supported by GTK-OSX, and would build an application that only works
for 10.6/10.7. Will need to edit .jhbuildrc-custom with the
moduleset and setup_sdk edits suggested under the "Snow Leopard and
Lion" portion of the building page, except use the following for the
setup_sdk line:
setup_sdk(target="10.6", sdk_version="10.6", architectures=["i386"])
Also should probably add:
build_policy = "updated-deps"
to the end of .jhbuildrc-custom to prevent rebuilding dependencies
that have already been built
you may also have to edit .jhbuildrc and change:
os.environ["CC"] = "/usr/bin/gcc-42"
os.environ["CXX"] = "/usr/bin/g++-42"
to
os.environ["CC"] = "/usr/bin/gcc"
os.environ["CXX"] = "/usr/bin/g++"
need to build:
jhbuild bootstrap
jhbuild build meta-gtk-osx-bootstrap
jhbuild build meta-gtk-osx-core
- Hack to get gtk 2.24.6 to work - a change in
gdk_quartz_gc_update_cg_context was made that broke the pixbuf support
in libgnomecanvas.
Get this patch: gtk+-2.24.6_libgnomecanvas_fix.diff.
jhbuild shell
cd gtk/source/gtk+-2.24.6
patch -p1 < gtk+-2.24.6_libgnomecanvas_fix.diff
make
make install
exit
- GTK-OSX additional modules:
jhbuild build libart_lgpl
jhbuild -m Source/jhbuild/modulesets/gnome2/gnome-suites-2.32.modules buildone libgnomecanvas
- DCMTK: to get dcmtk running
CFLAGS=-D_DARWIN_C_SOURCE CXXFLAGS=-D_DARWIN_C_SOURCE jhbuild -m amide/amide.modules buildone dcmtk
[then do the following to get the dictionary built into the library]
jhbuild shell
cd ~/gtk/source/dcmtk-3.6.0
cd dcmdata/libsrc
make mkdictbi
./mkdictbi ../data/dicom.dic ../data/private.dic > dcdictbi.cc
make
cd ../..
make install
make install-lib
exit
notes/todo
* dcmtk is currently built as static library. ideal would be a shared lib
- XMedCon:
jhbuild -m amide/amide.modules buildone xmedcon
notes/todo
* As of version 0.10.7, need to pass the configure option
--disable-tpc to configure out the Turku ECAT7 library stuff, as it
errors out during building. A patch to fix this problem has been
submitted to xmedcon.
* xmedcon binary errors out, appears to be a problem with
gtk_style_get_font in fancy.c. It's okay for now, as all we really
need for amide is the library.
- Volpack:
jhbuild -m amide/amide.modules buildone volpack
- GSL:
jhbuild -m amide/amide.modules buildone gsl
- FFMPEG:
(to get the latest version)
svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg
note, the below configure script doesn't recognize ~ as the home directory
./configure --prefix=/Users/loening/gtk/inst --enable-shared --disable-static --arch=x86_32
[ edit config.mak, add "-arch i386" to the end of CFLAGS and LDFLAGS]
make
make install
cd ~/gtk/inst/include
ln -s ./ ffmpeg
- AMIDE:
jhbuild -m amide/amide.modules buildone amide
When building amide, it'll give you errors about being unable to
import libxml2. I haven't gotten around to fixing this, it's only a
problem with the help files so I'm skipping it for now. Just use
option 2 (ignore errors and continue).
- BUNDLING:. Using ige-mac-bundler-0.6.0.tar.gz
unpack, cd into the directory
make install
grab the amide.bundle, amide.icns, amide.plist, gtkrc, and launcher.sh
file from the gtk/source/amide-XYZ/macosx directory.
Edit launcher.sh, and insert the current [VERSION] where specified
near the top.
then:
$ jhbuild shell
$ export PATH=$PREFIX/bin:~/.local/bin:$PATH
$ ige-mac-bundler amide.bundle
- To get the gdkpixbuf loaders working correctly (needed to export JPEG's)
gdk-pixbuf-query-loaders | \
sed 's#/Users/.*loaders/#@executable_path/../Resources/lib/gdk-pixbuf-2.0/loaders/#' \
> ~/Desktop/AMIDE.app/Contents/Resources/etc/gtk-2.0/gdk-pixbuf.loaders
- And finally:
zip -r amide-[VERSION]_osx_v1.zip AMIDE.app
|