From f9302da84051f976a9eb4d0eed8f599c72253d65 Mon Sep 17 00:00:00 2001 From: Evan Laforge Date: Wed, 29 Sep 2010 23:45:38 +0000 Subject: [PATCH] change os x installer to allow multiple installed versions This puts the ghc version into the package name so they are considered separate packages. --- distrib/MacOS/GHC-relocatable.pmdoc/01ghc.xml | 2 +- distrib/MacOS/GHC-relocatable.pmdoc/index.xml | 4 +-- distrib/MacOS/GHC-system.pmdoc/01ghc.xml | 2 +- distrib/MacOS/GHC-system.pmdoc/index.xml | 4 +-- distrib/MacOS/Info.plist | 2 +- distrib/MacOS/Makefile | 3 +- distrib/MacOS/installer-scripts/Uninstaller | 2 +- distrib/MacOS/installer-scripts/create-links | 37 +++++++++++++++---------- 8 files changed, 32 insertions(+), 24 deletions(-) diff --git a/distrib/MacOS/GHC-relocatable.pmdoc/01ghc.xml b/distrib/MacOS/GHC-relocatable.pmdoc/01ghc.xml index d49d9c6..a414253 100644 --- a/distrib/MacOS/GHC-relocatable.pmdoc/01ghc.xml +++ b/distrib/MacOS/GHC-relocatable.pmdoc/01ghc.xml @@ -1 +1 @@ -org.haskell.glasgowHaskellCompiler.ghc.pkg1build/Release/GHC.framework/Library/Frameworksparentscripts.postinstall.pathrequireAuthorizationscripts.scriptsDirectoryPath.isRelativeTypescripts.postinstall.isRelativeTypeinstallTo.isRelativeTypescripts.postinstall.isAbsoluteTyperelocatableinstallFrom.isRelativeTypeinstallFrom.pathinstallToinstaller-scripts/relocateinstaller-scripts/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ \ No newline at end of file +org.haskell.ghc.pkg1build/Release/GHC.framework/Library/Frameworksparentscripts.postinstall.pathrequireAuthorizationscripts.scriptsDirectoryPath.isRelativeTypescripts.postinstall.isRelativeTypeinstallTo.isRelativeTypescripts.postinstall.isAbsoluteTyperelocatableinstallFrom.isRelativeTypeinstallFrom.pathinstallToinstaller-scripts/relocateinstaller-scripts/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ \ No newline at end of file diff --git a/distrib/MacOS/GHC-relocatable.pmdoc/index.xml b/distrib/MacOS/GHC-relocatable.pmdoc/index.xml index c70b3d9..f3ab818 100644 --- a/distrib/MacOS/GHC-relocatable.pmdoc/index.xml +++ b/distrib/MacOS/GHC-relocatable.pmdoc/index.xml @@ -1,4 +1,4 @@ -Glasgow Haskell Compiler/Users/chak/Desktop/Glasgow Haskell Compiler.pkgorg.haskellThe 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.build/Release/GHC.framework/Versions/609/ghc/LICENSEGlasgow Haskell Compiler/Users/chak/Desktop/Glasgow Haskell Compiler.pkgorg.haskellThe 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.build/Release/GHC.framework/Versions/609/ghc/LICENSE01ghc.xmlproperties.userDomainproperties.titledescriptionproperties.systemDomain \ No newline at end of file + http://haskell.org/haskellwiki/GHC}]]>01ghc.xmlproperties.userDomainproperties.titledescriptionproperties.systemDomain diff --git a/distrib/MacOS/GHC-system.pmdoc/01ghc.xml b/distrib/MacOS/GHC-system.pmdoc/01ghc.xml index b417646..9963fb1 100644 --- a/distrib/MacOS/GHC-system.pmdoc/01ghc.xml +++ b/distrib/MacOS/GHC-system.pmdoc/01ghc.xml @@ -1 +1 @@ -org.haskell.glasgowHaskellCompiler.GHC.pkg1.0/tmp/GHC.dst/Library/Frameworks/GHC.framework/Library/Frameworksscripts.scriptsDirectoryPath.pathparentidentifierscripts.postinstall.pathinstaller-scripts/create-linksinstaller-scripts01ghc-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ \ No newline at end of file +org.haskell.ghc.pkg1.0/tmp/GHC.dst/Library/Frameworks/GHC.framework/Library/Frameworksscripts.scriptsDirectoryPath.pathparentidentifierscripts.postinstall.pathinstaller-scripts/create-linksinstaller-scripts01ghc-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ \ No newline at end of file diff --git a/distrib/MacOS/GHC-system.pmdoc/index.xml b/distrib/MacOS/GHC-system.pmdoc/index.xml index 93fd985..ba5f836 100644 --- a/distrib/MacOS/GHC-system.pmdoc/index.xml +++ b/distrib/MacOS/GHC-system.pmdoc/index.xml @@ -1,4 +1,4 @@ -Glasgow Haskell Compiler/Users/bjs/Desktop/Glasgow Haskell Compiler.pkgorg.haskellThe 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. For more information, please consult <http://haskell.org/ghc>.installer-docs/lambda-logo.pnginstaller-docs/license.htmlGlasgow Haskell Compiler/Users/bjs/Desktop/Glasgow Haskell Compiler.pkgorg.haskellThe 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. For more information, please consult <http://haskell.org/ghc>.installer-docs/lambda-logo.pnginstaller-docs/license.html01ghc.xmlproperties.systemDomainproperties.titleproperties.userDomainproperties.anywhereDomaindescription \ No newline at end of file + /Library/Frameworks/GHC.framework/Tools/Uninstaller}]]>01ghc.xmlproperties.systemDomainproperties.titleproperties.userDomainproperties.anywhereDomaindescription diff --git a/distrib/MacOS/Info.plist b/distrib/MacOS/Info.plist index 241b4f4..4693799 100644 --- a/distrib/MacOS/Info.plist +++ b/distrib/MacOS/Info.plist @@ -11,7 +11,7 @@ CFBundleIconFile CFBundleIdentifier - org.haskell.GHC + org.haskell.ghc.${FRAMEWORK_VERSION} CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType diff --git a/distrib/MacOS/Makefile b/distrib/MacOS/Makefile index 3928d34..dbf7886 100644 --- a/distrib/MacOS/Makefile +++ b/distrib/MacOS/Makefile @@ -101,7 +101,8 @@ framework-pkg: COMMAND_MODE=unix2003 -$(RM) -f GHC-system.pmdoc/*-contents.xml $(PACKAGEMAKER) -v --doc GHC-system.pmdoc\ - $(PACKAGEMAKER_TARGET) -o $(TOP)/$(PACKAGE_NAME) -i org.haskell.GHC + $(PACKAGEMAKER_TARGET) -o $(TOP)/$(PACKAGE_NAME)\ + -i org.haskell.GHC.$(FRAMEWORK_VERSION) # If we don't specify COMMAND_MODE=unix2003 then xcodebuild defaults # to setting it to legacy, which means that ar builds archives diff --git a/distrib/MacOS/installer-scripts/Uninstaller b/distrib/MacOS/installer-scripts/Uninstaller index 696d571..784c7c2 100644 --- a/distrib/MacOS/installer-scripts/Uninstaller +++ b/distrib/MacOS/installer-scripts/Uninstaller @@ -69,7 +69,7 @@ rm -rf ${INSTALL_DEST}/GHC.framework echo "Removing package recipt" # The first is for Leopard packages and the second for Tiger packages. -rm -f /Library/Receipts/boms/org.haskell.glasgowHaskellCompiler.ghc.pkg.bom +rm -f /Library/Receipts/boms/org.haskell.ghc.pkg.bom rm -rf /Library/Receipts/ghc.pkg echo "${INSTALL_DEST}/GHC.framework has been purged!" diff --git a/distrib/MacOS/installer-scripts/create-links b/distrib/MacOS/installer-scripts/create-links index 4453a9d..55a356c 100644 --- a/distrib/MacOS/installer-scripts/create-links +++ b/distrib/MacOS/installer-scripts/create-links @@ -5,27 +5,34 @@ # * Add link to the man page into the standard man/man1/ directory # * Add link to the HTML docs into the standard share/doc/ directory +# The binary links are careful not to use Current, because that will be +# rebound to the current version on every reinstall. + +# It probably won't ever happen, but this should work correctly if the install +# destination has a space on it. + +# See apple "Install Operations" documentation for how this script is called. + INSTALL_DEST=$2 INSTALL_BASE=$3 -if [ ${INSTALL_BASE} = / ]; then +if [ "$INSTALL_BASE" = / ]; then INSTALL_BASE=/usr fi -INSTALL_BIN=${INSTALL_BASE}/bin -mkdir -p ${INSTALL_BIN} -if [ -d ${INSTALL_DEST}/GHC.framework/Versions/Current/usr/bin ]; then - ln -sf ${INSTALL_DEST}/GHC.framework/Versions/Current/usr/bin/*\ - ${INSTALL_BIN}/ +ProjectVersionInt=$(readlink "$INSTALL_DEST/GHC.framework/Versions/Current") +GHC_BASE=$INSTALL_DEST/GHC.framework/Versions/$ProjectVersionInt + +INSTALL_BIN=$INSTALL_BASE/bin +mkdir -p "$INSTALL_BIN" +if [ -d "$GHC_BASE/usr/bin" ]; then + ln -sf "$GHC_BASE"/usr/bin/* "$INSTALL_BIN/" fi -INSTALL_MAN1=${INSTALL_BASE}/share/man/man1 -INSTALL_HTML=${INSTALL_BASE}/share/doc -mkdir -p ${INSTALL_MAN1} -if [ -d ${INSTALL_DEST}/GHC.framework/Versions/Current/usr/share/man/man1 ]; -then - ln -sf ${INSTALL_DEST}/GHC.framework/Versions/Current/usr/share/man/man1/*\ - ${INSTALL_MAN1}/ - ln -sf ${INSTALL_DEST}/GHC.framework/Versions/Current/usr/share/doc/ghc\ - ${INSTALL_HTML}/ +INSTALL_MAN1="$INSTALL_BASE"/share/man/man1 +INSTALL_HTML="$INSTALL_BASE"/share/doc +mkdir -p "$INSTALL_MAN1" +if [ -d "$GHC_BASE"/usr/share/man/man1 ]; then + ln -sf "$GHC_BASE"/usr/share/man/man1/* "$INSTALL_MAN1/" + ln -sf "$GHC_BASE"/usr/share/doc/ghc.$ProjectVersionInt "$INSTALL_HTML/" fi -- 1.7.10.4