jaromail

a commandline tool to easily and privately handle your e-mail
git clone git://parazyd.org/jaromail.git
Log | Files | Refs | Submodules | README

commit daed84ec984fcfce979357a4f7a0b4eda477d500
parent 2d55ed0999d2f8716e7c70609b8eff74709bed68
Author: Jaromil <jaromil@dyne.org>
Date:   Mon,  5 May 2014 20:04:07 +0200

osx build fixes

Diffstat:
Mbuild/build-osx.sh | 236++++++++-----------------------------------------------------------------------
Mbuild/release-osx.sh | 20+++++++++++---------
2 files changed, 34 insertions(+), 222 deletions(-)

diff --git a/build/build-osx.sh b/build/build-osx.sh @@ -18,9 +18,9 @@ builddir=`pwd` #cc="gcc-4.7" #cpp="cpp-4.7" -OSX_SDK=10.7 -cc="llvm-gcc" -cpp="llvm-cpp-4.2" +OSX_SDK=10.8 +#cc="llvm-gcc" +#cpp="llvm-cpp-4.2" cflags+=(-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OSX_SDK}.sdk/usr/include) ldflags+=(-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX${OSX_SDK}.sdk/usr/lib) @@ -32,7 +32,7 @@ ldflags+=(-L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform #cflags="-arch x86_64 -arch i386 -O2" cflags=(-I/opt/local/include -I/usr/include) cflags+=(-arch x86_64) -cflags+=(-arch i386) +#cflags+=(-arch i386) cflags+=(-O2) @@ -57,32 +57,13 @@ copydeps() { libs=(`otool -L $1 | awk ' /^\// {next} /\/local/ {print $1}'`) - # for p1 in ${(f)libs}; do - # echo "$p1" >> $tmp - # # second pass - # libs2=`otool -L $p1 | awk ' - # /^\// {next} /\/opt\/local/ {print $1}'` - - # for p2 in ${(f)libs2}; do - # echo "$p2" >> $tmp - # # third pass - # libs3=`otool -L $p2 | awk ' - # /^\// {next} /\/opt\/local/ {print $1}'` - - # for p3 in ${(f)libs3}; do - # echo "$p3" >> $tmp - # done # 3rd - # done # 2nd - # done # 1st - exe=`basename $1` - dst=$2 - bin=$dst/Contents/Resources/jaro/bin - lib=$dst/Contents/Frameworks + bin=osx + lib=osx/dylib cp -v $1 $bin/$exe { test $? = 0 } || { print "Error copying $1" } chmod +w $bin/$exe - strip $dst/$exe + strip $bin/$exe for d in ${libs}; do dylib=`basename $d` print " $dylib" @@ -94,7 +75,7 @@ copydeps() { dylibdest=$lib/`basename $d` { test -r $dylibdest } || { cp -v "$d" "$dylibdest" } install_name_tool -change $d \ - "/Applications/$dst/Contents/Frameworks/`basename $d`" $bin/$exe + "/Applications/JaroMail.app/Contents/Frameworks/`basename $d`" $bin/$exe done } @@ -127,18 +108,6 @@ fi popd } -{ test "$target" = "mairix" } || { - test "$target" = "all" } && { -# build mairix - pushd src/mairix - print "Search engine and date parser" - CFLAGS="${=cflags} ${=ldflags} -L/usr/local/opt/bison/lib" \ - CFLAGS="$CFLAGS -L/usr/local/opt/flex/lib -I/usr/local/opt/flex/include" \ - CC="$cc" LD=ld CPP="$cpp" \ - ./configure --disable-gzip-mbox --disable-bzip-mbox ; make - popd -} - { test "$target" = "fetchdate" } || { test "$target" = "all" } && { # build our own fetchdate @@ -177,88 +146,8 @@ fi # popd # } -# build our own mutt -{ test "$target" = "mutt" } || { - test "$target" = "all" } && { - echo "Compiling Mutt (MUA)" - pushd src/mutt-1.5.21 -# aclocal-17 -# automake-17 -a -c -# autoconf -# autoheader - - # -I/usr/local/Cellar/gettext/0.18.2/include" \ - # -L/usr/local/Cellar/gettext/0.18.2/lib" ./configure \ - - make clean - make -C imap clean - - # first 32 bit - CC="gcc" CPP="cpp" CFLAGS="-O2 -arch i386 -I/opt/local/include -I/usr/include" - CPPFLAGS="${CFLAGS}" LDFLAGS="-arch i386 -L/usr/local/lib -L/usr/lib" \ - ./configure \ - --with-ssl --with-gnutls --enable-imap --disable-debug \ - --with-slang --disable-gpgme \ - --enable-hcache --with-regex --with-tokyocabinet \ - --with-mixmaster=${root}/src/mixmaster --enable-pgp - make -C imap - make keymap_defs.h - make reldate.h - make hcversion.h # with Cellar include? - make mutt - make pgpewrap - - mv mutt mutt_32 - mv pgpewrap pgpewrap_32 - - make clean - make -C imap clean - - - # then 64 bit - CC="gcc" CPP="cpp" CFLAGS="-O2 -arch x86_64 -I/opt/local/include -I/usr/include" - CPPFLAGS="${CFLAGS}" LDFLAGS="-arch x86_64 -L/usr/local/lib -L/usr/lib" \ - ./configure \ - --with-ssl --with-gnutls --enable-imap --disable-debug \ - --with-slang --disable-gpgme \ - --enable-hcache --with-regex --with-tokyocabinet \ - --with-mixmaster=${root}/src/mixmaster --enable-pgp - make -C imap - make keymap_defs.h - make reldate.h - make hcversion.h # with Cellar include? - make mutt - make pgpewrap - - mv mutt mutt_64 - mv pgpewrap pgpewrap_64 - - lipo -create -arch i386 mutt_32 -arch x86_64 mutt_64 -output mutt - lipo -create -arch i386 pgpewrap_32 -arch x86_64 pgpewrap_64 -output pgpewrap - - popd -} - -# # build our own lynx (no ssl) -# { test "$target" = "lynx" } || { -# test "$target" = "all" } && { -# echo "Compiling Lynx (html 2 txt)" -# pushd src/lynx2-8-7 -# CC="$gcc" CPP="$cpp" CFLAGS="${=cflags} -I/usr/local/Cellar/gettext/0.18.2/include" \ -# CPPFLAGS="${=cflags}" LDFLAGS="${=ldflags} -L/usr/local/Cellar/gettext/0.18.2/lib" ./configure \ -# --disable-trace --enable-nls --with-screen=slang --enable-widec --enable-default-colors \ -# --disable-file-upload --disable-persistent-cookie --with-bzlib --with-zlib \ -# --disable-finger --disable-gopher --disable-news --disable-ftp --disable-dired \ -# --enable-cjk --enable-japanese-utf8 --enable-charset-selection -# make -# popd -# } - - # CFLAGS="${=cflags}" \ - pushd build appdst=JaroMail.app -bindst=$appdst/Contents/Resources/jaro/bin # copy all built binaries in place { test "$target" = "install" } || { @@ -268,101 +157,22 @@ bindst=$appdst/Contents/Resources/jaro/bin mkdir -p $appdst/Contents/Frameworks # static ones do not require relocated links - cp -v ${root}/src/fetchdate $bindst - cp -v ${root}/src/fetchaddr $bindst - cp -v ${root}/src/mairix/mairix $bindst - cp -v ${root}/src/dotlock $bindst - cp -v ${root}/src/ABQuery/build/Release/lbdb-ABQuery $bindst - copydeps ${root}/src/mutt-1.5.21/mutt $appdst - copydeps ${root}/src/mutt-1.5.21/pgpewrap $appdst - copydeps /opt/local/bin/fetchmail $appdst - copydeps /opt/local/bin/elinks $appdst - copydeps /usr/local/bin/gfind $appdst - copydeps /usr/local/bin/msmtp $appdst - copydeps /usr/local/bin/gpg $appdst - copydeps /usr/local/bin/pinentry $appdst - copydeps /usr/local/bin/pinentry-curses $appdst - copydeps /usr/local/bin/abook $appdst - - # rename to avoid conflicts - mv $bindst/gpg $bindst/gpg-jaro - mv $bindst/mutt $bindst/mutt-jaro - - + cp -v ${root}/src/fetchdate + cp -v ${root}/src/fetchaddr + cp -v ${root}/src/ABQuery/build/Release/lbdb-ABQuery + copydeps /opt/local/bin/mutt + copydeps /opt/local/bin/mutt_dotlock + copydeps /opt/local/bin/pgpewrap + copydeps /opt/local/bin/procmail + copydeps /opt/local/bin/fetchmail + copydeps /opt/local/bin/elinks + copydeps /opt/local/bin/gfind + copydeps /opt/local/bin/msmtp + copydeps /opt/local/bin/gpg + copydeps /opt/local/bin/pinentry + copydeps /opt/local/bin/pinentry-curses + copydeps /opt/local/bin/abook # system wide # rm build/osx/dylib/libiconv.2.dylib } - -mkdir -p $appdst/Contents/MacOS -cat <<EOF > $appdst/Contents/MacOS/jaroshell.sh -export PATH="/Applications/JaroMail.app/Contents/Resources/jaro/bin:\$PATH" -export GNUPGHOME="\$HOME/.gnupg" -export JAROMAILDIR="\$HOME/Library/Application\ Support/JaroMail" -export JAROWORKDIR="/Applications/JaroMail.app/Contents/Resources/jaro" -clear -zsh -i -c "echo \"Welcome to Jaro Mail\ntype 'jaro help' for a list of commands.\n\"" -EOF -chmod +x $appdst/Contents/MacOS/jaroshell.sh - -cat <<EOF > $appdst/Contents/MacOS/JaroMail.command -#!/usr/bin/env zsh -# JaroMail startup script for Mac .app -# Copyright (C) 2012-2013 by Denis Roio <Jaromil@dyne.org> -# GNU GPL V3 (see COPYING) -osascript <<EOF -tell application "System Events" to set terminalOn to (exists process "Terminal") -tell application "Terminal" - activate - if (terminalOn) then - do script "source /Applications/JaroMail.app/Contents/MacOS/jaroshell.sh" - else - do script "source /Applications/JaroMail.app/Contents/MacOS/jaroshell.sh" in front window - set custom title of front window to "Jaro Mail" - end if -end tell -EOF -echo "EOF" >> $appdst/Contents/MacOS/JaroMail.command - -chmod +x $appdst/Contents/MacOS/JaroMail.command - -cat <<EOF > $appdst/Contents/PkgInfo -APPLJAROMAIL -EOF - -cat <<EOF > $appdst/Contents/Info.plist -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE plist PUBLIC "-//Apple Computer//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>CFBundleExecutable</key> - <string>JaroMail.command</string> - <key>CFBundleIconFile</key> - <string>JaroMail.icns</string> - <key>CFBundleIdentifier</key> - <string>org.dyne.jaromail</string> - <key>CFBundleInfoDictionaryVersion</key> - <string>6.0</string> - <key>CFBundleName</key> - <string>JAROMAIL</string> - <key>CFBundlePackageType</key> - <string>APPL</string> - <key>CFBundleSignature</key> - <string>????</string> - <key>CFBundleVersion</key> - <string>1.0</string> - <key>CSResourcesFileMapped</key> - <true/> -</dict> -</plist> -EOF - -popd - -mkdir -p build/JaroMail.app/Contents/Resources/ -cp -v doc/JaroMail.icns build/JaroMail.app/Contents/Resources/ -./install.sh build/JaroMail.app/Contents/Resources -chmod -R go+rX build/JaroMail.app/Contents/Resources/ -chmod -R go+rx build/JaroMail.app/Contents/Resources/jaro/bin diff --git a/build/release-osx.sh b/build/release-osx.sh @@ -26,19 +26,20 @@ appdst=JaroMail.app WORKDIR=${appdst}/Contents/Resources/jaro bindst=${WORKDIR}/bin +mkdir -p $WORKDIR/{bin,zlibs,.mutt,.procmail,.stats} + # copying inside the fresh scripts print "Compiling Jaro Mail ZLibs" { test -d ${WORKDIR}/zlibs } && { rm -f $WORKDIR/zlibs/* } -mkdir -p $WORKDIR/zlibs cp ../src/zlibs/* $WORKDIR/zlibs/ for z in `find $WORKDIR/zlibs -type f`; do zcompile -R ${z} done -cp -r ../src/mutt $WORKDIR/.mutt -cp -r ../src/procmail $WORKDIR/.procmail -cp -r ../src/stats $WORKDIR/.stats +cp -r ../src/mutt/* $WORKDIR/.mutt/ +cp -r ../src/procmail/* $WORKDIR/.procmail/ +cp -r ../src/stats/* $WORKDIR/.stats/ cp ../doc/Applications.txt $WORKDIR/ cp ../doc/Filters.txt $WORKDIR/ cp ../doc/Mutt.txt $WORKDIR/ @@ -62,14 +63,14 @@ export GNUPGHOME="\$HOME/.gnupg" export JAROMAILDIR="\$HOME/Library/Application Support/JaroMail" export JAROWORKDIR="/Applications/JaroMail.app/Contents/Resources/jaro" clear -zsh -i -c "echo \"Welcome to Jaro Mail\ntype 'jaro help' for a list of commands.\n\"" +zsh -i -c "echo \"Welcome to Jaro Mail\ntype 'jaro help' for a list of commands\nedit config files in: \$HOME/Library/Application Support/JaroMail\"" EOF chmod +x $appdst/Contents/MacOS/jaroshell.sh cat <<EOF > $appdst/Contents/MacOS/JaroMail.command #!/usr/bin/env zsh # JaroMail startup script for Mac .app -# Copyright (C) 2012-2013 by Denis Roio <Jaromil@dyne.org> +# Copyright (C) 2012-2014 by Denis Roio <Jaromil@dyne.org> # GNU GPL V3 (see COPYING) osascript <<EOF tell application "System Events" to set terminalOn to (exists process "Terminal") @@ -132,9 +133,10 @@ mkdir -p ${dir} } echo "Source app: `du -hs ${dir}/JaroMail.app`" -v=README.txt; cp -v -f ../${v} ${dir}/${v} -v=COPYING.txt; cp -v -f ../${v} ${dir}/${v} -v=ChangeLog.txt; cp -v -f ../${v} ${dir}/${v} +v=README; cp -v -f ../${v}.md ${dir}/${v}.txt + +v=COPYING; cp -v -f ../${v}.txt ${dir}/${v}.txt +v=ChangeLog; cp -v -f ../${v}.md ${dir}/${v}.txt v=jaromail-manual.pdf; cp -v -f ../doc/${v} ${dir}/${v} ln -sf /Applications ${dir}/Applications