Skip to content
This repository has been archived by the owner on Feb 3, 2022. It is now read-only.

Commit

Permalink
tweaks to mac installer:
Browse files Browse the repository at this point in the history
- require command line tools to be installed (save patch-ghc-settings plan for another day)
- hand edit settings file to point at /usr/bin for both ar and gcc
- tiny Makefile fixes
  • Loading branch information
mzero committed May 27, 2012
1 parent 242e44a commit 4df2b74
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
7 changes: 3 additions & 4 deletions src/macos/Makefile
Expand Up @@ -210,9 +210,7 @@ $(HP_POST_SCRIPT):
echo "done" >> $@ echo "done" >> $@
echo "ln -sf $(TARGET_HASKELL)/bin/* /usr/bin" >> $@ echo "ln -sf $(TARGET_HASKELL)/bin/* /usr/bin" >> $@
echo "/usr/bin/uninstall-hs install-check" $(GHC_VERSION) " Installer" >> $@ echo "/usr/bin/uninstall-hs install-check" $(GHC_VERSION) " Installer" >> $@
echo "/usr/bin/patch-ghc-settings $(TARGET_GHC_FRAMEWORK)/Versions/Current/usr/lib/ghc-$(GHC_VERSION)/settings" >> $@
chmod +x $@ chmod +x $@

scripts: $(HP_POST_SCRIPT) scripts: $(HP_POST_SCRIPT)
clean-scripts: clean-scripts:
-rm -rf $(HP_POST_SCRIPT) -rm -rf $(HP_POST_SCRIPT)
Expand Down Expand Up @@ -330,11 +328,12 @@ $(INSTALLER_PACKAGE): Platform.pmdoc ghc scripts polish
@echo "About to change permissions of root. You will need to authorize:" @echo "About to change permissions of root. You will need to authorize:"
sudo chown -R -P root:admin $(IMAGE_ROOT) sudo chown -R -P root:admin $(IMAGE_ROOT)
sudo chmod -R go=u-w $(IMAGE_ROOT) sudo chmod -R go=u-w $(IMAGE_ROOT)
ln -sf $(BUILD) dist rm -rf dist
ln -s $(BUILD) dist
@echo "Build from PackageMaker please..." @echo "Build from PackageMaker please..."
rm -f Platform.pmdoc/*-contents.xml rm -f Platform.pmdoc/*-contents.xml
open -a /Developer/Applications/Utilities/PackageMaker.app Platform.pmdoc open -a /Developer/Applications/Utilities/PackageMaker.app Platform.pmdoc

installer: $(INSTALLER_PACKAGE) installer: $(INSTALLER_PACKAGE)
clean-installer: clean-installer:
-rm $(INSTALLER_PACKAGE) -rm $(INSTALLER_PACKAGE)
Expand Down
2 changes: 1 addition & 1 deletion 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>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> <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>installFrom.isRelativeType</mod><mod>installTo</mod><mod>scripts.postinstall.path</mod><mod>installFrom.path</mod><mod>identifier</mod><mod>parent</mod><mod>version</mod><mod>includeRoot</mod><mod>installTo.path</mod><mod>scripts.postinstall.isRelativeType</mod></config><scripts><postinstall relative="true" mod="true">dist/GHC-package/ghc.pkg/Scripts/create-links</postinstall></scripts><contents><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>
2 changes: 1 addition & 1 deletion 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>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> <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>installFrom.isRelativeType</mod><mod>installTo</mod><mod>installFrom.path</mod><mod>identifier</mod><mod>parent</mod><mod>version</mod><mod>installTo.path</mod><mod>includeRoot</mod><mod>scripts.postinstall.isRelativeType</mod></config><scripts><postinstall relative="true" mod="true">dist/hp-postinstall.sh</postinstall></scripts></pkgref>
4 changes: 2 additions & 2 deletions src/macos/Platform.pmdoc/index.xml
Expand Up @@ -16,6 +16,6 @@ This package will be installed on the system volume and is not relocatable. An
\ \
*** IMPORTANT PREREQUISITE ***\ *** IMPORTANT PREREQUISITE ***\
\ \
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.\ The Glasgow Haskell Compiler relies on the command line developer tools (gcc, ar, etc..). They can be installed as a part of Xcode, or via the "Command Line Tools for Xcode" package from {\field{\*\fldinst{HYPERLINK "http://developer.apple.com"}}{\fldrslt http://developer.apple.com}}.\
\ \
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> See {\field{\*\fldinst{HYPERLINK "http://hackage.haskell.org/platform//mac.html"}}{\fldrslt Haskell Platform for Mac OS X}} for details.}]]></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="file" operator="eq" value="true"><file>/usr/bin/gcc</file><message-title>Command Line Build Tools Required</message-title><message>The command line build tools (gcc, ar, etc...) need to be installed. They are an optional part of Xcode, or can be installed independently. See http://hackage.haskell.org/platform/mac.html for details.</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>properties.systemDomain</mod><mod>properties.title</mod><mod>description</mod><mod>properties.anywhereDomain</mod><mod>postinstallActions.actions</mod></pkmkdoc>
16 changes: 8 additions & 8 deletions src/macos/README
Expand Up @@ -4,8 +4,8 @@ To build the Haskell Platform for Mac OS X:
create a subdirectory "dist-i386" or "dist-x86_64 here create a subdirectory "dist-i386" or "dist-x86_64 here
move or sym-link the package into it move or sym-link the package into it
You should have a file there named seomthing like You should have a file there named seomthing like
GHC-7.0.4-i386.pkg GHC-7.4.1-i386.pkg
GHC-7.0.4-x86_64.pkg GHC-7.4.1-x86_64.pkg


2) Edit the makefile so that GHC_ARCH is set to the architecture you're building 2) Edit the makefile so that GHC_ARCH is set to the architecture you're building


Expand All @@ -17,12 +17,12 @@ You should have a file there named seomthing like
5) Run 5) Run
make ghc make ghc


6) Edit the ghc script in: 6) Edit the ghc settings file in:
dist/root/Library/Frameworks/GHC.framework/Versions/7.0.4-i386/usr/bin/ghc-7.0.4 dist/root/Library/Frameworks/GHC.framework/Versions/7.4.1-i386/usr/lib/ghc-7.4.1
Modify the last line to include this option, just before "${1+"$@"}" ending: Make sure that the entries for "C compiler command" and "ar command" are:
32-bit: -optl"-Wl,-read_only_relocs,suppress" ("C compiler command", "/usr/bin/gcc"),
64-bit: -optl"-Wl,-no_pie" ("ar command", "/usr/bin/ar"),

7) Update your cabal package list: 7) Update your cabal package list:
cabal update cabal update


Expand Down

0 comments on commit 4df2b74

Please sign in to comment.