From b78367803c357d76b4538ea92414b3735de94740 Mon Sep 17 00:00:00 2001 From: Manuel M T Chakravarty Date: Sat, 9 Feb 2008 11:07:27 +0000 Subject: [PATCH] Mac installer: added support for full docs --- distrib/MacOS/GHC-system.pmdoc/01ghc.xml | 2 +- distrib/MacOS/GHC-system.pmdoc/index.xml | 8 ++++++-- distrib/MacOS/GHC.xcodeproj/project.pbxproj | 6 +++--- distrib/MacOS/Makefile | 2 +- distrib/MacOS/installer-scripts/Uninstaller | 18 +++++++++++++++--- distrib/MacOS/installer-scripts/create-links | 20 +++++++++++++++----- 6 files changed, 41 insertions(+), 15 deletions(-) diff --git a/distrib/MacOS/GHC-system.pmdoc/01ghc.xml b/distrib/MacOS/GHC-system.pmdoc/01ghc.xml index f313f78..f507669 100644 --- a/distrib/MacOS/GHC-system.pmdoc/01ghc.xml +++ b/distrib/MacOS/GHC-system.pmdoc/01ghc.xml @@ -1 +1 @@ -org.haskell.glasgowHaskellCompiler.ghc.pkg1/tmp/GHC.dst/Library/Frameworks/GHC.framework/Library/FrameworksallowRevertscripts.scriptsDirectoryPath.isRelativeTypescripts.postinstall.isRelativeTypeinstallTo.isRelativeTypescripts.postinstall.isAbsoluteTypeinstallFrom.isAbsoluteTypeincludeRootparentscripts.postinstall.pathrequireAuthorizationrelocatableinstallFrom.isRelativeTypeinstallFrom.pathinstallToinstaller-scripts/create-linksinstaller-scripts01ghc-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ \ No newline at end of file +org.haskell.glasgowHaskellCompiler.ghc.pkg1/tmp/GHC.dst/Library/Frameworks/GHC.framework/Library/FrameworksallowRevertscripts.scriptsDirectoryPath.isRelativeTypescripts.postinstall.isRelativeTypeinstallTo.isRelativeTypescripts.postinstall.isAbsoluteTypeinstallFrom.isAbsoluteTypeincludeRootparentscripts.postinstall.pathrequireAuthorizationrelocatableinstallFrom.isRelativeTypeinstallFrom.pathinstallToinstaller-scripts/create-linksinstaller-scripts/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 65e8544..13a39a1 100644 --- a/distrib/MacOS/GHC-system.pmdoc/index.xml +++ b/distrib/MacOS/GHC-system.pmdoc/index.xml @@ -16,9 +16,13 @@ Xcode can be installed off your Mac OS X installation DVD or be downloaded from {\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. \ +\f0\fs26 \cf0 To start the Glasgow Haskell Compiler interactively, invoke the command 'ghci' in a Terminal window.\ \ -Extensive documentation is available online at\ +A user's guide and detailed library documentation is at\ +\ + /usr/share/doc/ghc/index.html\ +\ +More documentation is available online at\ \ http://haskell.org/haskellwiki/GHC\ \ diff --git a/distrib/MacOS/GHC.xcodeproj/project.pbxproj b/distrib/MacOS/GHC.xcodeproj/project.pbxproj index 442ce82..733fa9c 100644 --- a/distrib/MacOS/GHC.xcodeproj/project.pbxproj +++ b/distrib/MacOS/GHC.xcodeproj/project.pbxproj @@ -94,7 +94,7 @@ ); buildRules = ( ); - comments = "Supported targets: build, install, clean\n\nPrecondition: We are in a distribution tree, not a vanilla tree from darcs - i.e., \"sh boot\" was already executed.\n\nThis project creates a Mac OS X framework at /Library/Frameworks.\n\n* The framework is versioned using GHC's ProjectVersionInt.\n\n* The target configures the tree for the deployment location and builds the tree.\n\n* This target installs the framework not into its final destination, but into a build directory using the DESTDIR feature of GHC build system (unless the deployment flag in the build rules is set).\n\n* The idea is that the framework at the build location is being turned into a package and the package installer eventually puts its at its final destination. \n\nTODO: build and install documentation"; + comments = "Supported targets: build, install\n\nPrecondition: We are in a distribution tree, not a vanilla tree from darcs - i.e., \"sh boot\" was already executed.\n\nThis project creates a Mac OS X framework at /Library/Frameworks.\n\n* The framework is versioned using GHC's ProjectVersionInt.\n\n* The target configures the tree for the deployment location and builds the tree.\n\n* This target installs the framework not into its final destination, but into a build directory using the DESTDIR feature of GHC build system (unless the deployment flag in the build rules is set).\n\n* The idea is that the framework at the build location is being turned into a package and the package installer eventually puts its at its final destination. \n\nTODO: build and install documentation"; dependencies = ( ); name = "GHC-systemwide"; @@ -145,7 +145,7 @@ E72A15EA0D54ADB90059C234 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; - comments = "Perform a DESTDIR install unless the build settings have DEPLOYMENT_LOCATION=1.\n\nNB: Why use a run script build phase instead of an external target (with a dependency)? Because we need to be underneath the GHC target to get the right build settings."; + comments = "Build and install both code and documentation. Building includes configuring the tree with the right prefix.\n\nNB: Why use a run script build phase instead of an external target (with a dependency)? Because we need to be underneath the GHC target to get the right build settings."; files = ( ); inputPaths = ( @@ -154,7 +154,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# We need to be at the top of the ghc tree\ncd ../..\n\nPREFIX=${INSTALL_PATH}/${CONTENTS_FOLDER_PATH}/usr\n\nif [ ${ACTION} = installsrc ]; then\n echo \"xcodebuild action 'installsrc' not supported\"\n exit 0\nfi\n\nif [ ${ACTION} = build ]; then\n ./configure --prefix=${PREFIX}\n MAKE_ACTION=\nelse\n MAKE_ACTION=${ACTION}\nfi\n\nmake DESTDIR=${DSTROOT} ${MAKE_ACTION}\n"; + shellScript = "# We need to be at the top of the ghc tree\ncd ../..\n\nPREFIX=${INSTALL_PATH}/${CONTENTS_FOLDER_PATH}/usr\n\nif [ ${ACTION} = build ]; then\n ./configure --prefix=${PREFIX}\n MAKE_ACTION=\n DOCS_ACTION=html\nelse\n MAKE_ACTION=${ACTION}\n DOCS_ACTION=install-docs\nfi\n\n# Yes, it's the vanilla install target that must see HADDOCK_DOCS=YES, not the install-docs target\nmake DESTDIR=${DSTROOT} HADDOCK_DOCS=YES ${MAKE_ACTION}\nmake DESTDIR=${DSTROOT} XMLDocWays=html ${DOCS_ACTION}"; }; E76B00450D52DFDB00A05A2F /* ShellScript */ = { isa = PBXShellScriptBuildPhase; diff --git a/distrib/MacOS/Makefile b/distrib/MacOS/Makefile index 7f4698a..6b44d15 100644 --- a/distrib/MacOS/Makefile +++ b/distrib/MacOS/Makefile @@ -57,7 +57,7 @@ framework-pkg: -$(RM) -rf $(DSTROOT) mkdir -p $(TOOLS_SYSTEM) cp installer-scripts/Uninstaller $(TOOLS_SYSTEM) - xcodebuild -target GHC-systemwide clean install\ + xcodebuild -target GHC-systemwide clean build install\ CURRENT_PROJECT_VERSION=$(CURRENT_PROJECT_VERSION)\ SHORT_VERSION_STRING=$(SHORT_VERSION_STRING)\ FRAMEWORK_VERSION=$(FRAMEWORK_VERSION)\ diff --git a/distrib/MacOS/installer-scripts/Uninstaller b/distrib/MacOS/installer-scripts/Uninstaller index de4141b..0b79258 100644 --- a/distrib/MacOS/installer-scripts/Uninstaller +++ b/distrib/MacOS/installer-scripts/Uninstaller @@ -5,11 +5,13 @@ INSTALL_DEST=/Library/Frameworks INSTALL_BASE=/ + if [ ${INSTALL_BASE} = / ]; then - INSTALL_BIN=/usr/bin -else - INSTALL_BIN=${INSTALL_BASE}/bin + INSTALL_BASE=/usr fi +INSTALL_BIN=${INSTALL_BASE}/bin +INSTALL_MAN1=${INSTALL_BASE}/share/man/man1 +INSTALL_HTML=${INSTALL_BASE}/share/doc if [ ! -x ${INSTALL_DEST}/GHC.framework ]; then echo "${INSTALL_DEST}/GHC.framework does not exit" @@ -51,6 +53,16 @@ for thisfile in `ls ${INSTALL_BIN}`; do rm -f ${INSTALL_BIN}/${thisfile} fi done +for thisfile in `ls ${INSTALL_MAN1}`; do + if ls -l ${INSTALL_MAN1}/${thisfile} | grep -q GHC.framework/Versions; then + rm -f ${INSTALL_MAN1}/${thisfile} + fi +done +for thisfile in `ls ${INSTALL_HTML}`; do + if ls -l ${INSTALL_HTML}/${thisfile} | grep -q GHC.framework/Versions; then + rm -f ${INSTALL_HTML}/${thisfile} + fi +done echo "Removing ${INSTALL_DEST}/GHC.framework" rm -rf ${INSTALL_DEST}/GHC.framework diff --git a/distrib/MacOS/installer-scripts/create-links b/distrib/MacOS/installer-scripts/create-links index bbe9fa6..7102f12 100644 --- a/distrib/MacOS/installer-scripts/create-links +++ b/distrib/MacOS/installer-scripts/create-links @@ -1,15 +1,25 @@ #!/bin/sh # GHC framework post-install script -# * Add links to all executables into standard bin/ directory +# * Add links to all executables into the standard bin/ directory +# * Add link to the man page into the standard man/man1/ directory +# * Add link to the HTML docs into the standard share/doc/ directory INSTALL_DEST=$2 INSTALL_BASE=$3 if [ ${INSTALL_BASE} = / ]; then - INSTALL_BIN=/usr/bin/ -else - INSTALL_BIN=${INSTALL_BASE}/bin/ + INSTALL_BASE=/usr fi + +INSTALL_BIN=${INSTALL_BASE}/bin mkdir -p ${INSTALL_BIN} -ln -sf ${INSTALL_DEST}/GHC.framework/Versions/Current/usr/bin/* ${INSTALL_BIN} +ln -sf ${INSTALL_DEST}/GHC.framework/Versions/Current/usr/bin/* ${INSTALL_BIN}/ + +INSTALL_MAN1=${INSTALL_BASE}/share/man/man1 +INSTALL_HTML=${INSTALL_BASE}/share/doc +mkdir -p ${INSTALL_MAN1} +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}/ -- 1.7.10.4