Commit c222ce6d authored by chak@cse.unsw.edu.au.'s avatar chak@cse.unsw.edu.au.

First stab at an installer package for the Mac

- GHC as a Mac framework
- I tried to make a package where the user could choose whether to install
  in /Library/Frameworks or ~/Library/Frameworks (to allow installation for
  non-admins).  However, that doesn't work well without including the whole
  distribution twice as the decision as to whether the admin password needs
  to be entered is made at packaging time (not at install time).
parent 937eb1f1
......@@ -227,7 +227,7 @@ install-docs ::
# -----------------------------------------------------------------------------
# Making a binary distribution
#
# `dist' `binary-dist'
# `dist' `binary-dist' `binary-dist-macos'
# Create a distribution tar file for this program. The tar file
# should be set up so that the file names in the tar file start with
# a subdirectory name which is the name of the package it is a
......@@ -244,12 +244,14 @@ install-docs ::
# that are in the distribution, to make sure they are up to date in
# the distribution. See Making Releases.
#
# binary-dist is a GHC addition for binary distributions
# binary-dist is a GHC addition for binary distributions and
# binary-dist-macos is the Mac OS X-specific variant creating an
# installer package for GHC.framework.
#
binary-dist::
-rm -rf $(BIN_DIST_DIR)
-$(RM) $(BIN_DIST_DIR).tar.gz
-$(RM) $(BIN_DIST_TARBALL)
# When making bindists, we can have problems if some things (e.g. ghc-pkg)
# are compiled with the bootstrapping compiler and some (e.g. the stage 2
......@@ -299,7 +301,7 @@ ifeq "$(darwin_TARGET_OS)" "1"
BIN_DIST_TOP+=mk/fix_install_names.sh
endif
.PHONY: binary-dist-pre% binary-dist binary-pack
.PHONY: binary-dist-pre% binary-dist binary-dist-macos
binary-dist:: binary-dist-pre
......@@ -365,7 +367,7 @@ binary-dist :: tar-binary-dist
.PHONY: tar-binary-dist
tar-binary-dist:
( cd $(BIN_DIST_TOPDIR_ABS); tar cf - $(BIN_DIST_NAME) | bzip2 >$(BIN_DIST_TARBALL) )
( cd $(BIN_DIST_TOPDIR_ABS); bunzip2 -c $(BIN_DIST_TARBALL) | tar tf - | sed "s/^ghc-$(ProjectVersion)/fptools/" | sort >bin-manifest-$(ProjectVersion) )
( cd $(BIN_DIST_TOPDIR_ABS); bunzip2 -c $(BIN_DIST_TARBALL) | tar tf - | sed "s/^ghc-$(ProjectVersion)/fptools/" | sort >$(FPTOOLS_TOP_ABS)/bin-manifest-$(ProjectVersion) )
PUBLISH_FILES = $(BIN_DIST_TARBALL)
......@@ -417,6 +419,39 @@ publish-binary-dist ::
binary-dist::
@echo "Mechanical and super-natty! Inspect the result and *if* happy; freeze, sell and get some sleep!"
ifeq "$(darwin_TARGET_OS)" "1"
# Wrap a binary dist as a MacOS framework and put it into an installer package.
# The ProjectVersionInt is GHC's idea of an API version and hence determines
# the framework version.
FRAMEWORK_VERSION = $(ProjectVersionInt)
# Xcode requires CURRENT_PROJECT_VERSION to be an int or float. We use this
# only as the build version (aka CFBundleVersion).
CURRENT_PROJECT_VERSION = $(ProjectVersionInt).$(ProjectPatchLevel)
# The user-visible CFBundleShortVersionString is set to the standard GHC
# version number.
SHORT_VERSION_STRING = $(ProjectVersion)
# Instead of making 'binary-dist' a Makefile dependency, we let xcodebuild call
# 'make binary-dist'. This has the advantage that xcode knows the framework
# path into which the distribution should be installed and can instruct
# binary-dist to put it into the right place without copying the whole tree yet
# another time.
#
binary-dist-macos:
(cd distrib/MacOS; \
xcodebuild CURRENT_PROJECT_VERSION=$(CURRENT_PROJECT_VERSION)\
SHORT_VERSION_STRING=$(SHORT_VERSION_STRING)\
FRAMEWORK_VERSION=$(FRAMEWORK_VERSION)\
CURRENT_LIBRARY_VERSION=$(FRAMEWORK_VERSION))
(cd distrib/MacOS; \
!!!Call the packager!!! )
endif
# -----------------------------------------------------------------------------
# Building source distributions
#
......
B/* Localized versions of Info.plist keys */
This diff is collapsed.
<pkgref spec="1.12" uuid="FD3688D8-0443-4DCE-A3BB-F4A8EF12A4AB"><config><identifier>org.haskell.glasgowHaskellCompiler.ghc.pkg</identifier><version>1</version><description></description><post-install type="none"/><installFrom relative="true" mod="true" includeRoot="true">build/Release/GHC.framework</installFrom><installTo relocatable="true">/Library/Frameworks</installTo><flags><followSymbolicLinks/></flags><packageStore type="internal"></packageStore><mod>parent</mod><mod>scripts.postinstall.path</mod><mod>requireAuthorization</mod><mod>scripts.scriptsDirectoryPath.isRelativeType</mod><mod>scripts.postinstall.isRelativeType</mod><mod>installTo.isRelativeType</mod><mod>scripts.postinstall.isAbsoluteType</mod><mod>relocatable</mod><mod>installFrom.isRelativeType</mod><mod>installFrom.path</mod><mod>installTo</mod></config><scripts><postinstall relative="true" mod="true">installer-scripts/relocate</postinstall><scripts-dir relative="true" mod="true">installer-scripts</scripts-dir></scripts><contents><file-list>01ghc-contents.xml</file-list><component id="org.haskell.GHC" path="/Users/chak/Code/ghc/distrib/MacOS/build/Release/GHC.framework" version="609.20071208"/><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
\ No newline at end of file
<pkmkdoc spec="1.12"><properties><title>Glasgow Haskell Compiler</title><build>/Users/chak/Desktop/Glasgow Haskell Compiler.pkg</build><organization>org.haskell</organization><userSees ui="easy"/><min-target os="3"/><domain anywhere="true" system="true" user="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>The Glasgow Haskell Compiler (GHC) is a state-of-the-art, open source, compiler and interactive environment for the functional language Haskell. GHC supports the entire Haskell 98 language plus a wide variety of extensions. GHC generates fast code, is available on a range of platforms, and includes an extensive set of libraries.</description><contents><choice title="GHC" id="choice0" starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.haskell.glasgowHaskellCompiler.ghc.pkg"/><choice-reqs><requirement id="file" operator="eq" value="true" selected="no" enabled="no" hidden="unchanged" startSelected="unchanged" startEnabled="unchanged" startHidden="unchanged"><file>/usr/bin/gcc-4.0</file></requirement></choice-reqs></choice></contents><resources bg-scale="none" bg-align="topleft"><locale lang="de"/><locale lang="en"><resource relative="true" mod="true" type="license">build/Release/GHC.framework/Versions/609/ghc/LICENSE</resource><resource mime-type="text/rtf" kind="embedded" type="welcome"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf949
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\f0\fs26 \cf0 The installer will guide you through the process of installing the Glasgow Haskell Compiler (GHC) framework in a location of your choice.\
\
*** IMPORTANT NOTE ***\
\
You already need to have Xcode 3.0 or later installed. Apple's developer package Xcode includes basic developer tools, such as the make utility and a C compiler. Without these installed, the installation of the Glasgow Haskell Compiler will fail.\
\
Xcode can be installed off your Mac OS X installation DVD or be downloaded from <http://developer.apple.com>.}]]></resource><resource mime-type="text/rtf" kind="embedded" type="conclusion"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf949
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural
\f0\fs26 \cf0 To start the Glasgow Haskell Compiler interactively, invoke the command 'ghci' in a Terminal window. \
\
Extensive documentation is available online at\
\
http://haskell.org/haskellwiki/GHC}]]></resource></locale></resources><flags/><item type="file">01ghc.xml</item><mod>properties.userDomain</mod><mod>properties.title</mod><mod>description</mod><mod>properties.systemDomain</mod></pkmkdoc>
\ No newline at end of file
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 44;
objects = {
/* Begin PBXBuildFile section */
8D07F2C00486CC7A007CD1D0 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 089C1666FE841158C02AAC07 /* InfoPlist.strings */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 10; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = "<group>"; };
8D07F2C70486CC7A007CD1D0 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
8D07F2C80486CC7A007CD1D0 /* GHC.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GHC.framework; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXGroup section */
034768DDFF38A45A11DB9C8B /* Products */ = {
isa = PBXGroup;
children = (
8D07F2C80486CC7A007CD1D0 /* GHC.framework */,
);
name = Products;
sourceTree = "<group>";
};
0867D691FE84028FC02AAC07 /* GHC */ = {
isa = PBXGroup;
children = (
08FB77ACFE841707C02AAC07 /* Source */,
089C1665FE841158C02AAC07 /* Resources */,
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */,
034768DDFF38A45A11DB9C8B /* Products */,
);
name = GHC;
sourceTree = "<group>";
};
0867D69AFE84028FC02AAC07 /* External Frameworks and Libraries */ = {
isa = PBXGroup;
children = (
);
name = "External Frameworks and Libraries";
sourceTree = "<group>";
};
089C1665FE841158C02AAC07 /* Resources */ = {
isa = PBXGroup;
children = (
8D07F2C70486CC7A007CD1D0 /* Info.plist */,
089C1666FE841158C02AAC07 /* InfoPlist.strings */,
);
name = Resources;
sourceTree = "<group>";
};
08FB77ACFE841707C02AAC07 /* Source */ = {
isa = PBXGroup;
children = (
);
name = Source;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
8D07F2BC0486CC7A007CD1D0 /* GHC */ = {
isa = PBXNativeTarget;
buildConfigurationList = 4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "GHC" */;
buildPhases = (
8D07F2BF0486CC7A007CD1D0 /* Resources */,
E76B00450D52DFDB00A05A2F /* ShellScript */,
);
buildRules = (
);
comments = "This project creates a Mac OS X framework that encapsulates a (relocatable) binary GHC distribution.";
dependencies = (
);
name = GHC;
productInstallPath = "$(HOME)/Library/Frameworks";
productName = GHC;
productReference = 8D07F2C80486CC7A007CD1D0 /* GHC.framework */;
productType = "com.apple.product-type.framework";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
0867D690FE84028FC02AAC07 /* Project object */ = {
isa = PBXProject;
buildConfigurationList = 4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "GHC" */;
compatibilityVersion = "Xcode 3.0";
hasScannedForEncodings = 1;
mainGroup = 0867D691FE84028FC02AAC07 /* GHC */;
productRefGroup = 034768DDFF38A45A11DB9C8B /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
8D07F2BC0486CC7A007CD1D0 /* GHC */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
8D07F2BF0486CC7A007CD1D0 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
8D07F2C00486CC7A007CD1D0 /* InfoPlist.strings in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
E76B00450D52DFDB00A05A2F /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
comments = "Generate the binary distribution tree.";
files = (
);
inputPaths = (
);
outputPaths = (
"$(TARGET_BUILD_DIR)/$(CONTENTS_FOLDER_PATH)/ghc",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "if [ ${ACTION} = build ]; then\n make -C ../.. BIN_DIST_TOPDIR_ABS=${TARGET_BUILD_DIR}/${CONTENTS_FOLDER_PATH} BIN_DIST_NAME=ghc binary-dist\nfi\n";
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXVariantGroup section */
089C1666FE841158C02AAC07 /* InfoPlist.strings */ = {
isa = PBXVariantGroup;
children = (
089C1667FE841158C02AAC07 /* English */,
);
name = InfoPlist.strings;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
4FADC24308B4156D00ABE55E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
COPY_PHASE_STRIP = NO;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = YES;
GCC_MODEL_TUNING = G5;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = GHC_Prefix.pch;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Frameworks";
LIBRARY_STYLE = DYNAMIC;
MACH_O_TYPE = mh_dylib;
PRODUCT_NAME = GHC;
WRAPPER_EXTENSION = framework;
ZERO_LINK = YES;
};
name = Debug;
};
4FADC24408B4156D00ABE55E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ARCHS = (
ppc,
i386,
);
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
FRAMEWORK_VERSION = A;
GCC_MODEL_TUNING = G5;
GCC_PRECOMPILE_PREFIX_HEADER = YES;
GCC_PREFIX_HEADER = GHC_Prefix.pch;
INFOPLIST_FILE = Info.plist;
INSTALL_PATH = "$(HOME)/Library/Frameworks";
LIBRARY_STYLE = DYNAMIC;
MACH_O_TYPE = mh_dylib;
PRODUCT_NAME = GHC;
VERSIONING_SYSTEM = "";
WRAPPER_EXTENSION = framework;
};
name = Release;
};
4FADC24708B4156D00ABE55E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
};
name = Debug;
};
4FADC24808B4156D00ABE55E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
PREBINDING = NO;
SDKROOT = "$(DEVELOPER_SDK_DIR)/MacOSX10.5.sdk";
SHORT_VERSION_STRING = "";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
4FADC24208B4156D00ABE55E /* Build configuration list for PBXNativeTarget "GHC" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4FADC24308B4156D00ABE55E /* Debug */,
4FADC24408B4156D00ABE55E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4FADC24608B4156D00ABE55E /* Build configuration list for PBXProject "GHC" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4FADC24708B4156D00ABE55E /* Debug */,
4FADC24808B4156D00ABE55E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 0867D690FE84028FC02AAC07 /* Project object */;
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>GHC</string>
<key>CFBundleGetInfoString</key>
<string>The Glorious Glasgow Haskell Compilation System</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>org.haskell.GHC</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>${SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${CURRENT_PROJECT_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
</dict>
</plist>
#!/bin/sh
# Post install script that relocates the GHC installation to a /usr tree rooted
# GHC framework's versioned contents folder.
INSTALL_DIR=`pwd`
CONTENTS_FOLDER_PATH=GHC.framework/Versions/Current
cd ${CONTENTS_FOLDER_PATH}/ghc; \
./configure --prefix=${INSTALL_DIR}/${CONTENTS_FOLDER_PATH}/usr
cd ${CONTENTS_FOLDER_PATH}/ghc; \
make install
# TODO: remove the binary dist tree
\ No newline at end of file
......@@ -507,10 +507,9 @@ endif
FPTOOLS_TOP_ABS = @hardtop@
BIN_DIST_NAME=ghc-$(ProjectVersion)
BIN_DIST_TOPDIR_REL=$(FPTOOLS_TOP)
BIN_DIST_TOPDIR_ABS=$(FPTOOLS_TOP_ABS)
BIN_DIST_DIR=$(BIN_DIST_TOPDIR_ABS)/$(BIN_DIST_NAME)
BIN_DIST_TARBALL=$(BIN_DIST_TOPDIR_REL)/$(BIN_DIST_NAME)-$(TARGETPLATFORM).tar.bz2
BIN_DIST_TARBALL=$(FPTOOLS_TOP_ABS)/$(BIN_DIST_NAME)-$(TARGETPLATFORM).tar.bz2
# Definition of installation directories, we don't use half of these, but since
# the configure script has them on offer while passing through, we might as well
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment