Developing on Mac OS X

This page will document the steps required to get started on developing NNTPGrab on Mac OS X environments

Requirements

Environment

NNTPGrab requires some external dependencies which are not bundled with XCode or the Qt SDK. These can be installed by performing these commands in the Terminal:

mkdir -p ~/Development/NNTPGrab
cd ~/Development
svn co https://svn.openftd.org/svn/build_env/osx NNTPGrab

When using Qt Creator, some environment variables need to be set to allow the build scripts to detect all the external dependencies which are required for NNTPGrab. Please perform these commands in the Terminal:

echo ~/Development/NNTPGrab/deps/bin > ~/tmp
sudo mv ~/tmp /etc/paths.d/NNTPGrab

cp /etc/profile ~/tmp
chmod 644 ~/tmp
echo "export PKG_CONFIG_LIBDIR=~/Development/NNTPGrab/deps/lib/pkgconfig" >> ~/tmp
sudo mv ~/tmp /etc/profile
sudo chown root:wheel /etc/profile
source /etc/profile

cd ~/Development/NNTPGrab/deps/share/aclocal
sudo cp glib-2.0.m4 glib-gettext.m4 intltool.m4 nls.m4 pkg.m4 /usr/share/aclocal

cd ~/Development/NNTPGrab/deps/lib
sed -i '' "s|PREFIX|`echo ~`/Development/NNTPGrab/deps|g" libgio-2.0.la
sed -i '' "s|PREFIX|`echo ~`/Development/NNTPGrab/deps|g" libglib-2.0.la
sed -i '' "s|PREFIX|`echo ~`/Development/NNTPGrab/deps|g" libgmodule-2.0.la
sed -i '' "s|PREFIX|`echo ~`/Development/NNTPGrab/deps|g" libgobject-2.0.la
sed -i '' "s|PREFIX|`echo ~`/Development/NNTPGrab/deps|g" libgthread-2.0.la
sed -i '' "s|PREFIX|`echo ~`/Development/NNTPGrab/deps|g" libintl.la
sed -i '' "s|PREFIX|`echo ~`/Development/NNTPGrab/deps|g" libsoup-2.4.la

cd ~/Development/NNTPGrab/deps/lib/pkgconfig
sed -i '' "s|PREFIX|`echo ~`|" gio-2.0.pc
sed -i '' "s|PREFIX|`echo ~`|" gio-unix-2.0.pc
sed -i '' "s|PREFIX|`echo ~`|" glib-2.0.pc
sed -i '' "s|PREFIX|`echo ~`|" gmodule-2.0.pc
sed -i '' "s|PREFIX|`echo ~`|" gmodule-export-2.0.pc
sed -i '' "s|PREFIX|`echo ~`|" gmodule-no-export-2.0.pc
sed -i '' "s|PREFIX|`echo ~`|" gobject-2.0.pc
sed -i '' "s|PREFIX|`echo ~`|" gthread-2.0.pc
sed -i '' "s|PREFIX|`echo ~`|" libsoup-2.4.pc

Restart the Terminal application now to allow the new environment variables to be set

Retrieving and preparing the source code

Retrieve the NNTPGrab source code and prepare it with these commands:

cd ~/Development/NNTPGrab
svn co https://svn.openftd.org/svn/nntpgrab/trunk src
cd src
./autogen.sh
./configure \
   --prefix=`echo ~`/Development/NNTPGrab/dest \
   --disable-gui \
   --disable-webinterface \
   --disable-dependency-tracking \
   CPPFLAGS="-I`echo ~`/Development/NNTPGrab/deps/include" \
   CFLAGS="-arch ppc -arch i386 -arch x86_64" \
   DYLD_LIBRARY_PATH="`echo ~`/Development/NNTPGrab/deps/lib" 
make

Qt Creator

Now everything's ready we can open the project in Qt Creator. Start Qt Creator and select ''File'' -> ''Open File or Project''. Now navigate to the folder Development/NNTPGrab/src and select the file ''NNTPGrab.creator''

The Qt version of the NNTPGrab Server is currently bundled as a seperate project. To work on this, open the project file ''server_qt/server_qt.pro''

The Qt version of the NNTPGrab GUI is currently bundled as a seperate project. To work on this, open the project file ''client/gui_qt/gui_qt.pro''

Also available in: HTML TXT