mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
de7d74cac8
Set the debug configuration to NATIVE_ARCH_ACTUAL because NATIVE_ARCH will always be i386 Move the "compile libgit2" script build phase to it's own target. By setting the script to run in it's own target we get the ability to clean it durning the clean phase (normal build phase scripts don't run during clean). This will be needed if someone has built GitX prior to this commit because the object files will be for the old architectures. Also give an error if there is no git repository. This is from several questions I've received after someone has downloaded the source from github instead of cloning the project. The problem is that there is no submodule setting to update.
53 lines
1014 B
Bash
Executable File
53 lines
1014 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# build_libgit2.sh
|
|
# GitX
|
|
#
|
|
# Created by BrotherBard on 7/3/10.
|
|
# Copyright 2010 BrotherBard. All rights reserved.
|
|
#
|
|
# based on: http://log.yeahrightkeller.com/post/270155578/run-script-while-cleaning-in-xcode
|
|
|
|
buildAction () {
|
|
echo "Building libgit2..."
|
|
if [[ -d .git ]]
|
|
then
|
|
export PATH=$PATH:$HOME/bin:$HOME/local/bin:/sw/bin:/opt/local/bin:`"$TARGET_BUILD_DIR"/gitx --git-path`
|
|
git submodule init
|
|
git submodule update
|
|
cd libgit2
|
|
rm -f libgit2.a
|
|
make CFLAGS="-arch i386 -arch ppc -arch x86_64"
|
|
ranlib libgit2.a
|
|
else
|
|
echo "error: Not a git repository."
|
|
echo "error: clone GitX first so that the libgit2 submodule can be updated"
|
|
exit 1
|
|
fi
|
|
}
|
|
|
|
cleanAction () {
|
|
echo "Cleaning libgit2..."
|
|
cd libgit2
|
|
make clean
|
|
}
|
|
|
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
|
# MAIN
|
|
|
|
#echo "Running with ACTION=${ACTION}"
|
|
|
|
case $ACTION in
|
|
# NOTE: it gets set to "" rather than "build" when doing a build.
|
|
"")
|
|
buildAction
|
|
;;
|
|
|
|
"clean")
|
|
cleanAction
|
|
;;
|
|
esac
|
|
|
|
exit 0
|
|
|