Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

improvements to Mac OS X installer

- fix links in haddock (trac #169)
- patch location of gcc based on Xcode location at install time (trac #186, #194)
  • Loading branch information...
commit 229b1682df21c395093e28999fbe6fd2186e4016 1 parent 64a23ce
@mzero mzero authored
View
39 src/macos/Makefile
@@ -107,7 +107,7 @@ $(foreach prog,$(GHC_PROGS),\
$(BUILD_PACKAGE_DB)/package.cache: | $(IMAGE_GHC_FRAMEWORK)
for conf in $(IMAGE_GHC_PACKAGE_DB)/*.conf; do \
- sed -e 's:$(TARGET_GHC_FRAMEWORK):$(IMAGE_GHC_FRAMEWORK_ABS):' $$conf > $(BUILD_PACKAGE_DB)/`basename $$conf`; \
+ sed -e '/haddock-html/!s:$(TARGET_GHC_FRAMEWORK):$(IMAGE_GHC_FRAMEWORK_ABS):' $$conf > $(BUILD_PACKAGE_DB)/`basename $$conf`; \
done
$(BUILD_BIN)/ghc-pkg --package-conf $(BUILD_PACKAGE_DB) recache
@@ -124,7 +124,9 @@ clean: clean-rewrap
GENERIC_SOURCE_TREE := ../generic/haskell-platform-$(PLATFORM_VERSION)
GENERIC_PACKAGE_LIST := $(GENERIC_SOURCE_TREE)/packages/platform.packages
BUILD_SOURCE_TREE := $(BUILD)/source
-BUILD_PACKAGE_LIST := $(BUILD_SOURCE_TREE)/packages/platform.packages
+BUILD_SOURCE_PACKAGES := $(BUILD_SOURCE_TREE)/packages
+BUILD_SOURCE_PACKAGES_ABS := $(abspath $(BUILD_SOURCE_PACKAGES))
+BUILD_PACKAGE_LIST := $(BUILD_SOURCE_PACKAGES)/platform.packages
WITH_EXTRA := COPYFILE_DISABLE=true
$(GENERIC_PACKAGE_LIST):
@@ -179,17 +181,18 @@ clean: clean-build
$(eval $(call location,PLATFORM_REGISTRATIONS,PLATFORM_LIB,registrations))
+PACKAGE_STAMP := $(BUILD_SOURCE_TREE)/package.stamp
-$(IMAGE_PLATFORM_REGISTRATIONS): $(BUILD_STAMP)
+$(PACKAGE_STAMP): $(BUILD_STAMP)
-rm -rf $(IMAGE_PLATFORM_REGISTRATIONS)
-mkdir -p $(IMAGE_PLATFORM_REGISTRATIONS)
$(SRC_RUN) scripts/package.sh $(IMAGE_ROOT_ABS) $(IMAGE_PLATFORM_REGISTRATIONS_ABS)
@touch $@
-package: build $(IMAGE_PLATFORM_REGISTRATIONS)
+package: build $(PACKAGE_STAMP)
clean-package:
- -rm -rf $(IMAGE_PLATFORM_REGISTRATIONS)
-
+ -rm -rf $(IMAGE_PLATFORM_REGISTRATIONS) $(PACKAGE_STAMP)
+
clean: clean-package
.PHONY: package clean-package
@@ -207,6 +210,8 @@ $(HP_POST_SCRIPT):
echo "done" >> $@
echo "ln -sf $(TARGET_HASKELL)/bin/* /usr/bin" >> $@
echo "/usr/bin/uninstall-hs install-check" $(GHC_VERSION) " Installer" >> $@
+ echo "/usr/bin/patch-ghc-settings" >> $@
+ chmod +x $@
scripts: $(HP_POST_SCRIPT)
clean-scripts:
@@ -260,10 +265,19 @@ $(IMAGE_INDEX_HTML): $(HP_POST_SCRIPT)
$(IMAGE_START_HTML): start.html
cp $< $@
-
-doc: ghc package scripts $(IMAGE_INDEX_HTML) $(IMAGE_START_HTML)
+
+DOC_FIX_STAMP := $(BUILD_SOURCE_TREE)/docfix.stamp
+SOURCE_LINK_PATTERN := $(BUILD_SOURCE_PACKAGES_ABS)/\([^/]*\)/dist/doc/html/[^/]*
+TARGET_LINK_REPLACEMENT := $(TARGET_PLATFORM_LIB)/\1/doc/html
+
+$(DOC_FIX_STAMP): $(PACKAGE_STAMP) $(IMAGE_INDEX_HTML)
+ find $(IMAGE_PLATFORM_BASE) -name '*.html' -print0 \
+ | xargs -0 -n 1 sed -i '' -e 's=$(SOURCE_LINK_PATTERN)=$(TARGET_LINK_REPLACEMENT)=g'
+ @touch $@
+
+doc: ghc package scripts $(IMAGE_INDEX_HTML) $(IMAGE_START_HTML) $(DOC_FIX_STAMP)
clean-doc:
- -rm -rf $(IMAGE_DOC_BASE)
+ -rm -rf $(IMAGE_DOC_BASE) $(DOC_FIX_STAMP)
clean: clean-doc
.PHONY: doc clean-doc
@@ -290,13 +304,18 @@ $(UNINST_PROG): polish-bin | UninstallHS.hs
$(WITH_DB) $(WITH_PATH) ghc --make -O -fforce-recomp -o $@ UninstallHS.hs
strip $@
+PATCH_PROG = $(IMAGE_PLATFORM_BIN)/patch-ghc-settings
+$(PATCH_PROG): polish-bin | PatchSettings.hs
+ $(WITH_DB) $(WITH_PATH) ghc --make -O -fforce-recomp -o $@ PatchSettings.hs
+ strip $@
+
polish-symlinks:
-rm $(IMAGE_HASKELL)/current $(IMAGE_HASKELL)/bin $(IMAGE_HASKELL)/doc
cd $(IMAGE_HASKELL) && ln -sf ghc-$(GHC_VERSION) current
cd $(IMAGE_HASKELL) && ln -sf current/bin bin
cd $(IMAGE_HASKELL) && ln -sf current/doc doc
-polish: doc package polish-bin polish-cabal polish-symlinks $(UNINST_PROG)
+polish: doc package polish-bin polish-cabal polish-symlinks $(UNINST_PROG) $(PATCH_PROG)
.PHONY: polish
View
2  src/macos/Platform.pmdoc/01ghc.xml
@@ -1 +1 @@
-<pkgref spec="1.12" uuid="17347407-D99A-4311-85B7-42E546DA4F40"><config><identifier>org.haskell.HaskellPlatform.GHC.704.pkg</identifier><version>1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true" mod="true" includeRoot="true">dist/root/Library/Frameworks/GHC.framework</installFrom><installTo mod="true">/Library/Frameworks</installTo><flags><mod>followSymbolicLinks</mod></flags><packageStore type="internal"></packageStore><mod>includeRoot</mod><mod>installTo</mod><mod>installFrom.path</mod><mod>scripts.postinstall.path</mod><mod>identifier</mod><mod>parent</mod><mod>version</mod><mod>installTo.path</mod><mod>installFrom.isRelativeType</mod><mod>scripts.postinstall.isRelativeType</mod></config><scripts><postinstall relative="true" mod="true">dist/GHC-package/ghc.pkg/Scripts/create-links</postinstall></scripts><contents><file-list>01ghc-contents.xml</file-list><component id="org.haskell.ghc.7.0.4-x86_64" path="/Users/markl/Projects/A/platform/hp-mac/src/macos/dist/root/Library/Frameworks/GHC.framework" version="070004"><component id="org.haskell.ghc.7.0.4-x86_64" path="/Users/markl/Projects/A/platform/hp-mac/src/macos/dist/root/Library/Frameworks/GHC.framework/Versions/7.0.4-x86_64" version="070004"/></component><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
+<pkgref spec="1.12" uuid="17347407-D99A-4311-85B7-42E546DA4F40"><config><identifier>org.haskell.HaskellPlatform.GHC.704.pkg</identifier><version>1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true" mod="true" includeRoot="true">dist/root/Library/Frameworks/GHC.framework</installFrom><installTo mod="true">/Library/Frameworks</installTo><flags><mod>followSymbolicLinks</mod></flags><packageStore type="internal"></packageStore><mod>version</mod><mod>installTo</mod><mod>installFrom.path</mod><mod>scripts.postinstall.path</mod><mod>identifier</mod><mod>parent</mod><mod>includeRoot</mod><mod>installTo.path</mod><mod>scripts.postinstall.isRelativeType</mod><mod>installFrom.isRelativeType</mod></config><scripts><postinstall relative="true" mod="true">dist/GHC-package/ghc.pkg/Scripts/create-links</postinstall></scripts><contents><file-list>01ghc-contents.xml</file-list><component id="org.haskell.ghc.7.4.1-i386" path="/Users/markl/Projects/A/platform/hp-github/src/macos/dist/root/Library/Frameworks/GHC.framework" version="070401"><component id="org.haskell.ghc.7.4.1-i386" path="/Users/markl/Projects/A/platform/hp-github/src/macos/dist/root/Library/Frameworks/GHC.framework/Versions/7.4.1-i386" version="070401"/></component><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
View
2  src/macos/Platform.pmdoc/02haskell.xml
@@ -1 +1 @@
-<pkgref spec="1.12" uuid="A8434D73-E38D-4F22-8C66-7BD3146636FB"><config><identifier>org.haskell.HaskellPlatform.Libraries.20114.pkg</identifier><version>1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true" mod="true" includeRoot="true">dist/root/Library/Haskell</installFrom><installTo mod="true">/Library</installTo><flags><mod>followSymbolicLinks</mod></flags><packageStore type="internal"></packageStore><mod>installTo.path</mod><mod>installTo</mod><mod>installFrom.path</mod><mod>identifier</mod><mod>parent</mod><mod>version</mod><mod>includeRoot</mod><mod>installFrom.isRelativeType</mod><mod>scripts.postinstall.isRelativeType</mod></config><scripts><postinstall relative="true" mod="true">dist/hp-postinstall.sh</postinstall></scripts><contents><file-list>02haskell-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
+<pkgref spec="1.12" uuid="A8434D73-E38D-4F22-8C66-7BD3146636FB"><config><identifier>org.haskell.HaskellPlatform.Libraries.20114.pkg</identifier><version>1</version><description></description><post-install type="none"/><requireAuthorization/><installFrom relative="true" mod="true" includeRoot="true">dist/root/Library/Haskell</installFrom><installTo mod="true">/Library</installTo><flags><mod>followSymbolicLinks</mod></flags><packageStore type="internal"></packageStore><mod>installTo.path</mod><mod>installTo</mod><mod>installFrom.path</mod><mod>identifier</mod><mod>parent</mod><mod>version</mod><mod>includeRoot</mod><mod>scripts.postinstall.isRelativeType</mod><mod>installFrom.isRelativeType</mod></config><scripts><postinstall relative="true" mod="true">dist/hp-postinstall.sh</postinstall></scripts><contents><file-list>02haskell-contents.xml</file-list><filter>/CVS$</filter><filter>/\.svn$</filter><filter>/\.cvsignore$</filter><filter>/\.cvspass$</filter><filter>/\.DS_Store$</filter></contents></pkgref>
View
11 src/macos/Platform.pmdoc/index.xml
@@ -1,4 +1,11 @@
-<pkmkdoc spec="1.12"><properties><title>Haskell Platform</title><build>/Users/markl/Projects/A/platform/products/Haskell Platform 2011.4.0.0 32bit rc1.pkg</build><organization>org.haskell</organization><userSees ui="both"/><min-target os="3"/><domain system="true"/></properties><distribution><versions min-spec="1.000000"/><scripts></scripts></distribution><description>The Haskell Platform is a comprehensive, robust development environment for programming in Haskell. For new users the platform makes it trivial to get up and running with a full Haskell development environment. For experienced developers, the platform provides a comprehensive, standard base for commercial and open source Haskell development that maximises interoperability and stability of your code.</description><contents><choice title="Glasgow Haskell Compiler" id="choice2" description="The Haskell computer, interactive interpreter, package manager, utilities, and core libraries. Includes full documentation, and the documentation generator." starts_selected="true" starts_enabled="false" starts_hidden="false"><pkgref id="org.haskell.HaskellPlatform.GHC.704.pkg"/></choice><choice title="Haskell Platform Libraries" id="choice3" description="The Haskell libraries and utilities that comprise the Haskell Platform. Includes full documentation." starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.haskell.HaskellPlatform.Libraries.20114.pkg"/></choice></contents><resources bg-scale="none" bg-align="bottomleft"><locale lang="en"><resource relative="true" mod="true" type="background">logo-color.png</resource><resource mime-type="text/rtf" kind="embedded" type="welcome"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf230
+<pkmkdoc spec="1.12"><properties><title>Haskell Platform</title><build>/Users/markl/Projects/A/platform/products/Haskell Platform 2012.2.0.0 32bit rc3.pkg</build><organization>org.haskell</organization><userSees ui="both"/><min-target os="3"/><domain system="true"/></properties><distribution><versions min-spec="1.000000"/><scripts>function find_gcc() {
+ var a = system.files.fileExistsAtPath('/usr/bin/gcc');
+ var b = system.files.fileExistsAtPath('/Developer/usr/bin/gcc');
+ var c = system.files.fileExistsAtPath('/Applications/Xcode.app/Contents/Developer/usr/bin/gcc');
+
+ return (a || b || c);
+}
+</scripts></distribution><description>The Haskell Platform is a comprehensive, robust development environment for programming in Haskell. For new users the platform makes it trivial to get up and running with a full Haskell development environment. For experienced developers, the platform provides a comprehensive, standard base for commercial and open source Haskell development that maximises interoperability and stability of your code.</description><contents><choice title="Glasgow Haskell Compiler" id="choice2" description="The Haskell computer, interactive interpreter, package manager, utilities, and core libraries. Includes full documentation, and the documentation generator." starts_selected="true" starts_enabled="false" starts_hidden="false"><pkgref id="org.haskell.HaskellPlatform.GHC.704.pkg"/></choice><choice title="Haskell Platform Libraries" id="choice3" description="The Haskell libraries and utilities that comprise the Haskell Platform. Includes full documentation." starts_selected="true" starts_enabled="true" starts_hidden="false"><pkgref id="org.haskell.HaskellPlatform.Libraries.20114.pkg"/></choice></contents><resources bg-scale="none" bg-align="bottomleft"><locale lang="en"><resource relative="true" mod="true" type="background">logo-color.png</resource><resource mime-type="text/rtf" kind="embedded" type="welcome"><![CDATA[{\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf470
{\fonttbl\f0\fnil\fcharset0 LucidaGrande;}
{\colortbl;\red255\green255\blue255;}
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural
@@ -11,4 +18,4 @@ This package will be installed on the system volume and is not relocatable. An
\
You must have Xcode 3.0 or later installed before you continue. Apple's developer package Xcode includes basic developer tools, such as the make utility and a C compiler. The Glasgow Haskell Compiler relies on these tools.\
\
-Xcode can be installed off your Mac OS X installation DVD or be downloaded from {\field{\*\fldinst{HYPERLINK "http://developer.apple.com"}}{\fldrslt http://developer.apple.com}}.}]]></resource></locale></resources><requirements><requirement id="file" operator="eq" value="true"><file>/usr/bin/gcc</file><message-title>Developer Tools Missing</message-title><message>Please install Xcode developer tools first.</message></requirement><requirement id="tosv" operator="ge" value="'10.6.0'"><message>This version of Haskell Platform requires Mac OS X 10.6 or later.</message></requirement></requirements><flags/><postinstall><action id="com.apple.packagemaker.actions.openfile"><value>/Library/Haskell/doc/start.html</value><type>absolute-path</type></action></postinstall><item type="file">01ghc.xml</item><item type="file">02haskell.xml</item><mod>postinstallActions.actions</mod><mod>properties.title</mod><mod>description</mod><mod>properties.anywhereDomain</mod><mod>properties.systemDomain</mod></pkmkdoc>
+Xcode can be installed off your Mac OS X installation DVD or be downloaded from {\field{\*\fldinst{HYPERLINK "http://developer.apple.com"}}{\fldrslt http://developer.apple.com}}.}]]></resource></locale></resources><requirements><requirement id="tosv" operator="ge" value="'10.6.0'"><message>This version of Haskell Platform requires Mac OS X 10.6 or later.</message></requirement><requirement id="java" operator="eq" value="true"><argument>find_gcc()</argument><message-title>Xcode Tools</message-title><message>You need to have Xcode installed. You can get it from https://developer.apple.com/</message></requirement></requirements><flags/><postinstall><action id="com.apple.packagemaker.actions.openfile"><value>/Library/Haskell/doc/start.html</value><type>absolute-path</type></action></postinstall><item type="file">01ghc.xml</item><item type="file">02haskell.xml</item><mod>postinstallActions.actions</mod><mod>properties.title</mod><mod>description</mod><mod>properties.anywhereDomain</mod><mod>properties.systemDomain</mod></pkmkdoc>
View
2  src/macos/start.html
@@ -168,4 +168,4 @@
</div>
</div>
</body>
-</html>
+</html>
Please sign in to comment.
Something went wrong with that request. Please try again.