Skip to content

Instantly share code, notes, and snippets.

@codebutler
Created February 5, 2010 08:56
Show Gist options
  • Save codebutler/295658 to your computer and use it in GitHub Desktop.
Save codebutler/295658 to your computer and use it in GitHub Desktop.
Script to (somewhat?) properly install Monobjc
#!/bin/bash
# install-monobjc.sh - Properly installs Monobjc
# Part of MonoDevelop.Monobjc: http://codebutler.github.com/monodevelop-monobjc
# Created by Eric Butler <eric@codebutler.com>
# This script should be run from within the Monobjc source directory.
# Monobjc can be downloaded from http://www.monobjc.net/index.php?page=downloads
if [[ $UID != 0 ]]; then
echo "You must be root to run this script."
exit 1
fi
MONO_VERSION=2.6.1
DIR=/Library/Frameworks/Mono.framework/Versions/$MONO_VERSION/lib/mono/monobjc
PC_FILE=/Library/Frameworks/Mono.framework/Versions/$MONO_VERSION/share/pkgconfig/monobjc.pc
CONFIG_FILE=dist/2.0/Monobjc.dll.config
cat > $CONFIG_FILE <<EOF
<configuration>
<dllmap dll="@executable_path/libmonobjc.2.dylib" target="$DIR/libmonobjc.2.dylib"/>
</configuration>
EOF
mkdir -p $DIR
cp -v dist/libmonobjc.2.dylib $DIR
gacutil -u Monobjc
gacutil -u Monobjc.Cocoa
gacutil -i dist/2.0/Monobjc.dll -package monobjc
gacutil -i dist/2.0/Monobjc.Cocoa.dll -package monobjc
cat > $PC_FILE <<EOF
prefix=/Library/Frameworks/Mono.framework/Versions/$MONO_VERSION
exec_prefix=\${prefix}
pkglibdir=\${exec_prefix}/lib/mono/monobjc
Libraries=\${pkglibdir}/Monobjc.dll \${pkglibdir}/Monobjc.Cocoa.dll
Name: Monobjc
Description:
Version: 2.0.476.0
Requires:
Libs: -r:\${pkglibdir}/Monobjc.dll -r:\${pkglibdir}/Monobjc.Cocoa.dll
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment