[MLton-commit] r6278

Matthew Fluet fluet at mlton.org
Mon Dec 17 14:56:51 PST 2007


Some resources for making packages and disk images on MacOS X
----------------------------------------------------------------------

A   mlton/trunk/package/macosx/
A   mlton/trunk/package/macosx/.ignore
A   mlton/trunk/package/macosx/Description.plist
A   mlton/trunk/package/macosx/Info.plist.in
A   mlton/trunk/package/macosx/Makefile
A   mlton/trunk/package/macosx/Resources/
A   mlton/trunk/package/macosx/Resources/postinstall
A   mlton/trunk/package/macosx/Resources/postupgrade

----------------------------------------------------------------------


Property changes on: mlton/trunk/package/macosx
___________________________________________________________________
Name: svn:ignore
   + Info.plist
*.dmg
*.pkg
install


Added: mlton/trunk/package/macosx/.ignore
===================================================================
--- mlton/trunk/package/macosx/.ignore	2007-12-17 01:01:35 UTC (rev 6277)
+++ mlton/trunk/package/macosx/.ignore	2007-12-17 22:56:50 UTC (rev 6278)
@@ -0,0 +1,4 @@
+Info.plist
+*.dmg
+*.pkg
+install

Added: mlton/trunk/package/macosx/Description.plist
===================================================================
--- mlton/trunk/package/macosx/Description.plist	2007-12-17 01:01:35 UTC (rev 6277)
+++ mlton/trunk/package/macosx/Description.plist	2007-12-17 22:56:50 UTC (rev 6278)
@@ -0,0 +1,10 @@
+<?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>IFPkgDescriptionDescription</key>
+	<string>MLton is an open-source, whole-program, optimizing Standard ML compiler.</string>
+	<key>IFPkgDescriptionTitle</key>
+	<string>MLton Standard ML Compiler</string>
+</dict>
+</plist>

Added: mlton/trunk/package/macosx/Info.plist.in
===================================================================
--- mlton/trunk/package/macosx/Info.plist.in	2007-12-17 01:01:35 UTC (rev 6277)
+++ mlton/trunk/package/macosx/Info.plist.in	2007-12-17 22:56:50 UTC (rev 6278)
@@ -0,0 +1,44 @@
+<?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>CFBundleGetInfoString</key>
+	<string>MLton VERSION (TARGET_ARCH-TARGET_OS)</string>
+	<key>CFBundleIdentifier</key>
+	<string>org.mlton.TARGET_ARCH-TARGET_OS.VERSION</string>
+	<key>CFBundleShortVersionString</key>
+	<string>VERSION</string>
+	<key>IFMajorVersion</key>
+	<integer>VERSION</integer>
+	<key>IFMinorVersion</key>
+	<integer>0</integer>
+	<key>IFPkgFlagAllowBackRev</key>
+	<false/>
+	<key>IFPkgFlagAuthorizationAction</key>
+	<string>RootAuthorization</string>
+	<key>IFPkgFlagBackgroundAlignment</key>
+	<string>topleft</string>
+	<key>IFPkgFlagBackgroundScaling</key>
+	<string>none</string>
+	<key>IFPkgFlagDefaultLocation</key>
+	<string>/usr/local</string>
+	<key>IFPkgFlagFollowLinks</key>
+	<true/>
+	<key>IFPkgFlagInstallFat</key>
+	<false/>
+	<key>IFPkgFlagIsRequired</key>
+	<false/>
+	<key>IFPkgFlagOverwritePermissions</key>
+	<false/>
+	<key>IFPkgFlagRelocatable</key>
+	<true/>
+	<key>IFPkgFlagRestartAction</key>
+	<string>NoRestart</string>
+	<key>IFPkgFlagRootVolumeOnly</key>
+	<false/>
+	<key>IFPkgFlagUpdateInstalledLanguages</key>
+	<false/>
+	<key>IFPkgFormatVersion</key>
+	<real>0.10000000149011612</real>
+</dict>
+</plist>

Added: mlton/trunk/package/macosx/Makefile
===================================================================
--- mlton/trunk/package/macosx/Makefile	2007-12-17 01:01:35 UTC (rev 6277)
+++ mlton/trunk/package/macosx/Makefile	2007-12-17 22:56:50 UTC (rev 6278)
@@ -0,0 +1,36 @@
+TARGET_ARCH := $(shell ../../bin/host-arch)
+TARGET_OS := $(shell ../../bin/host-os)
+ifeq ($(origin VERSION), undefined)
+	VERSION := $(shell date +%Y%m%d)
+endif
+ifeq ($(origin RELEASE), undefined)
+	RELEASE := 1
+endif
+
+mlton-$(VERSION).$(TARGET_ARCH)-$(TARGET_OS).dmg: mlton-$(VERSION).$(TARGET_ARCH)-$(TARGET_OS).pkg
+	hdiutil create -srcfolder $< $@
+	rm -rf $<
+
+mlton-$(VERSION).$(TARGET_ARCH)-$(TARGET_OS).pkg: Info.plist Description.plist install/usr/local/bin/mlton Resources/postinstall Resources/postupgrade
+	/Developer/Tools/packagemaker -build -ds -v -i Info.plist -d Description.plist -f install/usr/local -r Resources -p $@
+	sudo rm -rf install
+
+install/usr/local/bin/mlton: ../../install/usr/local/bin/mlton
+	sudo rm -rf install
+	cp -prf ../../install install
+	sudo chown -R root:wheel install/usr
+
+Info.plist: Info.plist.in
+	rm -f Info.plist
+	cp Info.plist.in Info.plist
+	sed "s/\(.*\)VERSION\(.*\)/\1$(VERSION)\2/" <Info.plist >z && \
+	mv z Info.plist;
+	sed "s/\(.*\)TARGET_ARCH\(.*\)/\1$(TARGET_ARCH)\2/" <Info.plist >z && \
+	mv z Info.plist;
+	sed "s/\(.*\)TARGET_OS\(.*\)/\1$(TARGET_OS)\2/" <Info.plist >z && \
+	mv z Info.plist;
+
+.PHONY: clean
+clean:
+	../../bin/clean
+	rm -f *.dmg

Added: mlton/trunk/package/macosx/Resources/postinstall
===================================================================
--- mlton/trunk/package/macosx/Resources/postinstall	2007-12-17 01:01:35 UTC (rev 6277)
+++ mlton/trunk/package/macosx/Resources/postinstall	2007-12-17 22:56:50 UTC (rev 6278)
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+PREFIX=$2
+BIN_DIR=$PREFIX/bin
+LIB_DIR=$PREFIX/lib/mlton
+TMP_DIR=$INSTALLER_TEMP
+
+cp $BIN_DIR/mlton $TMP_DIR/mlton.script
+sed "/^lib=/s;.*;lib=$LIB_DIR;" < $TMP_DIR/mlton.script > $BIN_DIR/mlton
+exit 0


Property changes on: mlton/trunk/package/macosx/Resources/postinstall
___________________________________________________________________
Name: svn:executable
   + *

Added: mlton/trunk/package/macosx/Resources/postupgrade
===================================================================
--- mlton/trunk/package/macosx/Resources/postupgrade	2007-12-17 01:01:35 UTC (rev 6277)
+++ mlton/trunk/package/macosx/Resources/postupgrade	2007-12-17 22:56:50 UTC (rev 6278)
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+PREFIX=$2
+BIN_DIR=$PREFIX/bin
+LIB_DIR=$PREFIX/lib/mlton
+TMP_DIR=$INSTALLER_TEMP
+
+cp $BIN_DIR/mlton $TMP_DIR/mlton.script
+sed "/^lib=/s;.*;lib=$LIB_DIR;" < $TMP_DIR/mlton.script > $BIN_DIR/mlton
+exit 0
\ No newline at end of file


Property changes on: mlton/trunk/package/macosx/Resources/postupgrade
___________________________________________________________________
Name: svn:executable
   + *




More information about the MLton-commit mailing list