OSX Shell Scripts

From Emergent

Jump to: navigation, search

These scripts are helpful when building packages on OSX. Be sure to go through and fix hard-coded paths and version numbers first.

Contents

install-emergent-prereqs.sh

#!/bin/bash

#  This will install emergent and all the prereqs. They should already
#  be built. The directories containing the configure scripts should
#  be beneath the current directory. The Qt .dmg should be in the
#  current directory. Modify this script for your Qt version (or make
#  it dynamic). The configure script for emergent should be in
#  /Users/mingus/emergent. Modify the script for your user.

# Install non-Qt prereqs
for i in `find . -maxdepth 1 -type d | grep -v '^\.$' | tr "\n" " "`;do cd $i && make install && cd ..;done

# Install Qt
hdid qt-mac-opensource-4.2.3.dmg
installer -verbose -pkg /Volumes/Qt\ 4.2.3/Qt.mpkg -target /
for volume in `mount | grep Qt | sed 's/\ .*//' | tr "\n" " "`;
do
  hdiutil detach $volume -force;
done

# Install emergent

make -C /Users/mingus/emergent install

uninstall-emergent-prereqs.sh

#!/bin/bash

# This will uninstall emergent and all the prereqs. You should get a
# copy of the qt uninstaller, located in
# /Developer/Tools/uninstall-qt.py after Qt has been installed, and
# put it in this directory. This directory should contain ode, gsl,
# simage, coin, and soqt, already built. Emergent should be located in
# ~/emergent, and should be already built.

for i in `find . -maxdepth 1 -type d | grep -v '^\.$' | tr "\n" " "`;
do
  cd $i && make uninstall && cd ..;
done
cp ./uninstall-qt.py /Developer/Tools/uninstall-qt.py
python /Developer/Tools/uninstall-qt.py
make -C /Users/mingus/emergent uninstall

reconfigure-emergent-prereqs.sh

#!/bin/bash

# To build a package using [[PackageMaker]], you need to reconfigure and install configure-style scripts to the package pseudo-root.
# This expects that you are in a directory with all emergent prereqs already built in subdirectories, and emergent in /Users/mingus/emergent

for i in `find . -maxdepth 1 -type d | grep -v '^\.$' | tr "\n" " "` /Users/mingus/emergent;
do
  cd $i && ./configure --prefix=/Users/mingus/emergentapp/usr/local && make -t && make install && cd ..;
done

Personal tools