Re: Building Scan Tailor on OSX
Posted: 28 May 2010, 12:56
Thanks TIm. Yeah, I thought briefly maybe I was supposed to enter all these lines into Xcode....there's at least 3 apps involved to get this one going.
A set of discussions about DIY Book Scanners
https://diybookscanner.org/forum/
Code: Select all
[ 82%] Building CXX object CMakeFiles/scantailor.dir/ErrorWidget.cpp.o
[ 82%] Building CXX object CMakeFiles/scantailor.dir/OrthogonalRotation.cpp.o
[ 82%] Building CXX object CMakeFiles/scantailor.dir/NewOpenProjectPanel.cpp.o
[ 83%] Building CXX object CMakeFiles/scantailor.dir/ProjectFilesDialog.cpp.o
[ 83%] Building CXX object CMakeFiles/scantailor.dir/WorkerThread.cpp.o
/opt/local/libexec/qt4-mac/include/QtCore/qsettings.h: In member function ‘WorkerThread::Dispatcher::UpdatePriorityResult WorkerThread::Dispatcher::updateThreadPriority(const BackgroundTask&)’:
/opt/local/libexec/qt4-mac/include/QtCore/qsettings.h:304: error: ‘QSettings::QSettings(const QSettings&)’ is private
/Users/matt/Applications/scantailor/WorkerThread.cpp:161: error: within this context
make[2]: *** [CMakeFiles/scantailor.dir/WorkerThread.cpp.o] Error 1
make[1]: *** [CMakeFiles/scantailor.dir/all] Error 2
make: *** [all] Error 2
Nice. I had made a basic info.plist file that did work and sent it to Tulon, but I didn't know how to fit it into the build infrastructure to make it easy on him. You're way beyond my simple efforts.n9yty wrote:Just a note - working on an OSX standard .app version of this. Unfortunately, it may be 10.6/Intel only.
This is killer news for the Mac crowd. I've been procrastinating to get this app going; the hardware environment has fully consumed my time.n9yty wrote:Just a note - working on an OSX standard .app version of this...Anyone care to try this out?
Code: Select all
mkdir /usr/local/src/scantailor
cd /usr/local/src/scantailor
Code: Select all
vi {filename}
(press i on the keyboard to enter insert mode in vi)
{paste in the text}
hit : then type wq and hit enter to save
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleExecutable</key>
<string>ScanTailor</string>
<key>CFBundleName</key>
<string>ScanTailor</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleIdentifier</key>
<string>net.sourceforge.Scantailor</string>
<key>CFBundleSignature</key>
<string>sctl</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>CFBundleIconFile</key>
<string>ScanTailor.icns</string>
<key>CFBundleShortVersionString</key>
<string>ScanTailor-@VERSION@</string>
<key>LSMinimumSystemVersion</key>
<string>10.4.0</string>
</dict>
</plist>
Code: Select all
#!/bin/bash
export APP=ScanTailor.app
export APPC=$APP/Contents
export APPM=$APPC/MacOS
export APPR=$APPC/Resources
export APPF=$APPC/Frameworks
rm -rf ScanTailor.app
mkdir -p $APPC
mkdir -p $APPM
mkdir -p $APPR
mkdir -p $APPF
cp $STHOME/ScanTailor.icns $APPR
cp scantailor_*.qm $APPR
cp scantailor $APPM/ScanTailor
stver=`cat version.h | grep 'VERSION "' | cut -d ' ' -f 3 | tr -d '"'`
cat $STHOME/Info.plist.in | sed "s/@VERSION@/$stver/" > $APPC/Info.plist
otool -L $APPM/ScanTailor | tail -n +2 | tr -d '\t' | cut -f 1 -d ' ' | while read line; do
case $line in
$BUILDDIR/*)
ourlib=`basename $line`
cp $line $APPF >/dev/null 2>&1
install_name_tool -change $line @executable_path/../Frameworks/$ourlib $APPM/ScanTailor
install_name_tool -id @executable_path/../Frameworks/$ourlib $APPF/$ourlib
;;
esac
done
# libtiff has a dependency on libjpeg, or can depending on how it is built
[ -e $APPF/libtiff.3.dylib ] && install_name_tool -change /usr/local/lib/libjpeg.8.dylib @executable_path/../Frameworks/libjpeg.8.dylib $APPF/libtiff.3.dylib
rm -rf ScanTailor.dmg ScanTailor-$stver.dmg
macdeployqt ScanTailor.app -dmg
mv ScanTailor.dmg ScanTailor-$stver.dmg
Code: Select all
using darwin : 4.0 : g++-4.0 ;
Code: Select all
#!/bin/bash
export STHOME=/usr/local/src/scantailor
export BUILDDIR=$STHOME/build
export CMAKE_PREFIX_PATH=$BUILDDIR
export CMAKE_INCLUDE_PATH=$BUILDDIR
export CMAKE_LIBRARY_PATH=$BUILDDIR
export CMAKE_INSTALL_PREFIX=$BUILDDIR
mkdir -p $BUILDDIR
export CC=gcc-4.0
export CPP=cpp-4.0
export CXX=g++-4.0
export LD=g++-4.0
export MAC_OS_X_VERSION_MIN_REQUIRED=10.4
export MACOSX_DEPLOYMENT_TARGET=10.4
export MYCFLAGS="-m32 -arch i386 -arch x86_64 -arch ppc -mmacosx-version-min=10.4"
export MYLDFLAGS="-m32 -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
export BOOST_ROOT=/usr/local/src/scantailor/boost_1_43_0
# LIBTIFF
curl -O "http://download.osgeo.org/libtiff/tiff-3.9.4.tar.gz"
tar xzvvf tiff-3.9.4.tar.gz
cd tiff-3.9.4
make clean
env CFLAGS="$MYCFLAGS" CXXFLAGS="$MYCFLAGS" LDFLAGS="$MYLDFLAGS" ./configure --prefix=$BUILDDIR --disable-dependency-tracking --enable-shared --enable-static
make
make install
cd $STHOME
# LIBJPG
curl -O "http://www.ijg.org/files/jpegsrc.v8b.tar.gz"
tar xzvvf jpegsrc.v8b.tar.gz
cd jpeg-8b
make clean
env CFLAGS="$MYCFLAGS" CXXFLAGS="$MYCFLAGS" LDFLAGS="$MYLDFLAGS" ./configure --prefix=$BUILDDIR --disable-dependency-tracking --enable-shared --enable-static
make
make install
cd $STHOME
# LIBPNG
curl -O "ftp://ftp.simplesystems.org/pub/libpng/png/src/libpng-1.4.3.tar.gz"
tar xzvvf libpng-1.4.3.tar.gz
cd libpng-1.4.3
make clean
env CFLAGS="$MYCFLAGS" CXXFLAGS="$MYCFLAGS" LDFLAGS="$MYLDFLAGS" ./configure --prefix=$BUILDDIR --disable-dependency-tracking --enable-shared --enable-static
make
make install
cd $STHOME
# BOOST
curl -L -o boost_1_43_0.tar.gz "http://sourceforge.net/projects/boost/files/boost/1.43.0/boost_1_43_0.tar.gz/download"
tar xzvvf boost_1_43_0.tar.gz
cd boost_1_43_0
make clean
./bootstrap.sh --prefix=$BUILDDIR --with-libraries=test,system,signals
# ./bjam --prefix=$BUILDDIR --user-config=$STHOME/user-config.jam --toolset=darwin-4.0 --build-dir=$BUILDDIR --with-test --with-system --with-signals link=static runtime-link=static architecture=combined address-model=32_64 macosx-version=10.4 macosx-version-min=10.4 install
./bjam --toolset=darwin-4.0 --prefix=$BUILDDIR --user-config=$STHOME/user-config.jam --build-dir=$BUILDDIR --with-test --with-system --with-signals link=static runtime-link=static architecture=combined address-model=32 macosx-version=10.4 macosx-version-min=10.4 --debug-configuration install
export BOOST_ROOT=`pwd` install
cd $STHOME
# SCANTAILOR
curl -o scantailor.tar.gz -L "http://scantailor.git.sourceforge.net/git/gitweb.cgi?p=scantailor/scantailor;a=snapshot;h=5cdf6456a849c831b218bcaa608babc522674ad1;sf=tgz"
tar xzvvf scantailor.tar.gz
cd scantailor
make clean
rm CMakeCache.txt
# These edis are needed for the boost library version we are using
sed -i '.old' -e '1,$ s/^#include <boost/test/auto_unit_test\.hpp>/#include <boost/test/included/unit_test.hpp>/g' imageproc/tests/main.cpp
sed -i '.old' -e '1,$ s/^#include <boost/test/auto_unit_test\.hpp>/#include <boost/test/included/unit_test.hpp>/g' tests/main.cpp
ccmake -DCMAKE_FIND_FRAMEWORK=LAST -DCMAKE_OSX_ARCHITECTURES="ppc;i386" -DCMAKE_OSX_DEPLOYMENT_TARGET="10.4" -DCMAKE_OSX_SYSROOT="/Developer/SDKs/MacOSX10.4u.sdk" -DPNG_INCLUDE_DIR=$BUILDDIR .
make
../makeapp.sh
cd $STHOME
Code: Select all
chmod +rx buildscantailor.sh makeapp.sh
Code: Select all
./buildscantailor.sh