Skip to content

Commit

Permalink
Use Ant for OS X builds.
Browse files Browse the repository at this point in the history
  • Loading branch information
vslavik committed Apr 17, 2010
1 parent ecb474a commit ab4a0bc
Show file tree
Hide file tree
Showing 6 changed files with 104 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ icons/win32/installer_wizard_image.bmp
distrib/
win32/Release/
win32/Debug/
build-osx/
6 changes: 3 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ SUBDIRS = src docs locales icons
desktopdir=$(datadir)/applications
desktop_DATA = poedit.desktop

bundle: all
$(MAKE) $(MAKEOPTS) -C src bundle

dist-osx:
$(MAKE) -C src bundle
rm -f poedit-$(VERSION).dmg
dist-osx: bundle
$(srcdir)/macosx/make-dmg poedit-$(VERSION).dmg src/Poedit.app $(srcdir)/macosx/dmg
18 changes: 18 additions & 0 deletions build.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
poedit.version=1.5beta1

osx.sdk=10.5
osx.deploy=10.4
osx.arch.native=i386

msvs.path=c:/Program Files/Microsoft Visual Studio 9.0

deps.dir=${basedir}/deps

osx.sdk.path=/Developer/SDKs/MacOSX${osx.sdk}.sdk
osx.cc=gcc
osx.cxx=g++
osx.cflags.sdk=-isysroot ${osx.sdk.path} -mmacosx-version-min=${osx.deploy}
osx.ldflags.sdk=${osx.cflags.sdk} -Wl,-syslibroot,${osx.sdk.path} -Wl,-macosx_version_min,${osx.deploy}
osx.cflags=-O2 -ggdb3 ${osx.cflags.sdk}
osx.ldflags=-ggdb3 ${osx.ldflags.sdk}

msvs.vcbuild=${msvs.path}/VC/vcpackages/vcbuild.exe
msvs.redist=${msvs.path}/VC/redist/x86/Microsoft.VC90.CRT

82 changes: 79 additions & 3 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@

<target name="compile"
description="compile all dependencies for building on this platform"
depends="compile-win"/>
depends="compile-win,compile-osx"/>


<target name="distrib"
description="build distribution for this platform"
depends="distrib-win"/>
depends="distrib-win,distrib-osx"/>


<!-- ==============================================================
Expand All @@ -44,11 +44,87 @@
</target>


<target name="distrib-win" if="is_windows" depends="compile-win">
<target name="distrib-win" if="is_windows">
<exec dir="win32" executable="deps/inno-setup/iscc.exe" failonerror="true">
<arg value="poedit.iss"/>
<arg value="/dCRT_REDIST=${msvs.redist}"/>
</exec>
</target>


<!-- ==============================================================
OS X build
============================================================== -->

<available property="bootstrapped" file="configure"/>
<target name="bootstrap-osx" if="is_osx" unless="bootstrapped">
<echo level="info" message="Bootstrapping git sources..."/>
<exec executable="./bootstrap" failonerror="true"/>
</target>


<target name="compile-osx-arch">
<echo level="info" message="Building Poedit for ${osx.arch}..."/>
<mkdir dir="build-osx/${osx.arch}"/>
<exec dir="build-osx/${osx.arch}" executable="/bin/sh" failonerror="true">
<arg value="../../configure"/>
<arg value="CC=${osx.cc}"/>
<arg value="CXX=${osx.cxx}"/>
<arg value="CPPFLAGS=-I${deps.dir}/boost -I${deps.dir}/bin-osx/${osx.arch}/include"/>
<arg value="CFLAGS=-arch ${osx.arch} ${osx.cflags}"/>
<arg value="CXXFLAGS=-arch ${osx.arch} ${osx.cflags}"/>
<arg value="OBJCFLAGS=-arch ${osx.arch} ${osx.cflags}"/>
<arg value="LDFLAGS=-arch ${osx.arch} ${osx.ldflags} -L${deps.dir}/bin-osx/${osx.arch}/lib"/>
<arg value="--with-wx-config=${deps.dir}/bin-osx/${osx.arch}/bin/wx-config"/>
<arg value="--with-sparkle=${deps.dir}/sparkle/build/Release"/>
<arg value="WXRC=${deps.dir}/bin-osx/${osx.arch.native}/bin/wxrc"/>
</exec>
<exec dir="build-osx/${osx.arch}/src" executable="make" failonerror="true">
<arg value="all"/>
</exec>
</target>

<target name="compile-osx" if="is_osx" depends="bootstrap-osx">
<antcall target="compile-osx-arch">
<param name="osx.arch" value="i386"/>
</antcall>
<antcall target="compile-osx-arch">
<param name="osx.arch" value="ppc"/>
</antcall>

<echo level="info" message="Creating universal Poedit binary..."/>
<exec dir="build-osx" executable="lipo" failonerror="true">
<arg value="-arch"/>
<arg value="i386"/>
<arg value="i386/src/poedit"/>
<arg value="-arch"/>
<arg value="ppc"/>
<arg value="ppc/src/poedit"/>
<arg value="-create"/>
<arg value="-output"/>
<arg value="poedit.universal"/>
</exec>

<echo level="info" message="Creating Poedit.app bundle..."/>
<exec dir="build-osx" executable="../macosx/make-bundle" failonerror="true">
<env key="GETTEXT_PREFIX" path="${deps.dir}/bin-gettext"/>
<env key="WX_ROOT" path="${deps.dir}/bin-osx/i386"/>
<env key="SPARKLE_FRAMEWORK" path="${deps.dir}/sparkle/build/Release/Sparkle.framework"/>
<arg value="Poedit.app"/>
<arg value="poedit.universal"/>
<arg value="i386"/> <!-- top_builddir (any) -->
<arg value=".."/> <!-- top_srcdir -->
</exec>
</target>

<target name="distrib-osx" if="is_osx">
<echo level="info" message="Creating DMG package..."/>
<mkdir dir="distrib"/>
<exec executable="macosx/make-dmg" failonerror="true">
<arg value="distrib/poedit-${poedit.version}.dmg"/>
<arg value="build-osx/Poedit.app"/>
<arg value="macosx/dmg"/>
</exec>
</target>

</project>
2 changes: 2 additions & 0 deletions chversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ replace_ver configure.ac \
'\(AC_INIT(\[poedit\], \[\)[^]]*\(\],.*\)' "\1$VER_FULL\2"
replace_ver make-distrib.sh \
'\(VERSION=\).*' "\1$VER_FULL"
replace_ver build.properties \
'\(poedit.version=\).*' "\1$VER_FULL"
replace_ver src/version.h \
'\(POEDIT_VERSION.*"\).*\("\)' "\1$VER_FULL\2"
replace_ver src/version.h \
Expand Down
2 changes: 1 addition & 1 deletion deps
Submodule deps updated from bd43a9 to 1abd36

0 comments on commit ab4a0bc

Please sign in to comment.