[MLton-commit] r6803

Wesley Terpstra wesley at mlton.org
Mon Aug 25 07:12:48 PDT 2008


Move descriptions into the mlton.wxs file as opposed to the Makefile. Will allow us more freedom to add additional actions.
----------------------------------------------------------------------

U   mlton/trunk/package/mingw/Makefile
A   mlton/trunk/package/mingw/files2wix-components.sml
D   mlton/trunk/package/mingw/files2wix-feature.sml
U   mlton/trunk/package/mingw/mlton.wxs

----------------------------------------------------------------------

Modified: mlton/trunk/package/mingw/Makefile
===================================================================
--- mlton/trunk/package/mingw/Makefile	2008-08-25 00:59:02 UTC (rev 6802)
+++ mlton/trunk/package/mingw/Makefile	2008-08-25 14:12:41 UTC (rev 6803)
@@ -1,75 +1,75 @@
-WIX="/c/Program Files/WiX"
-TARDIR=/c/DOCUME~1/terpstra/Desktop/downloads/mingw
-MLTON=mlton
-
-MINGW_RUNTIME=$(TARDIR)/mingw-runtime-3.14.tar.gz
-MINGW_W32API=$(TARDIR)/w32api-3.11.tar.gz
-MINGW_BINUTILS=$(TARDIR)/binutils-2.17.50-20060824-1.tar.gz
-MINGW_GCC=$(TARDIR)/gcc-core-3.4.5-20060117-1.tar.gz
-MINGW_MSYS=$(TARDIR)/msysCORE-1.0.11-2007.01.19-1.tar.bz2
-MINGW_GMP=$(TARDIR)/gmp-static-mingw-4.1.tar.gz
-
-MINGW_WXS=mingw-runtime.wxs w32api.wxs binutils.wxs gcc.wxs gmp.wxs msys.wxs
-MINGW_WIXOBJ=$(patsubst %.wxs,%.wixobj,$(MINGW_WXS))
-
-mlton.msi:	mlton.wixobj self.wixobj dbg.wixobj filesys.wixobj $(MINGW_WIXOBJ)
-	$(WIX)/light -out $@ $^ $(WIX)/wixui.wixlib -loc $(WIX)/WixUI_en-us.wxl
-
-clean:
-	rm -rf staging mlton.msi *.wixobj *.exe $(MINGW_WXS) self.wxs dbg.wxs filesys.wxs
-
-%.wixobj:	%.wxs
-	$(WIX)/candle $<
-
-%.exe:		%.sml
-	$(MLTON) $<
-
-# This has to happen after everything else is unpacked
-filesys.wxs:	dirs2wix-filesys.exe $(MINGW_WIXOBJ) self.wixobj
-	cd staging; find * -type d | ../dirs2wix-filesys > ../$@.tmp 
-	mv $@.tmp $@
-
-mingw-runtime.wxs:	$(MINGW_RUNTIME) self.wxs
-	tar tzf $< | ./files2wix-feature "MinGW" "Runtime" "Runtime" "An assortment of thin wrappers that provide POSIX-like functionality on a windows platform." > $@.tmp
-	cd staging; tar xzf $(MINGW_RUNTIME)
-	mv $@.tmp $@
-
-w32api.wxs:		$(MINGW_W32API) self.wxs
-	tar tzf $< | ./files2wix-feature "MinGW" "W32API" "W32API" "Headers and link stub libraries needed to access windows system DLLs." > $@.tmp
-	cd staging; tar xzf $(MINGW_W32API)
-	mv $@.tmp $@
-
-binutils.wxs:		$(MINGW_BINUTILS) self.wxs
-	tar tzf $< | grep -v info/dir | ./files2wix-feature "MinGW" "Binutils" "Binutils" "Utilities for manipulating object files, such as the linker and assembler." > $@.tmp
-	cd staging; tar xzf $(MINGW_BINUTILS)
-	mv $@.tmp $@
-
-gcc.wxs:		$(MINGW_GCC) self.wxs
-	tar tzf $< | ./files2wix-feature "MinGW" "GCC" "GCC" "The GNU C Compiler. Compiles C files to assembly." > $@.tmp
-	cd staging; tar xzf $(MINGW_GCC)
-	mv $@.tmp $@
-
-msys.wxs:		$(MINGW_MSYS) self.wxs
-	(tar tjf $<; echo bin/bash.exe) | ./files2wix-feature "MinGW" "MSYS" "MSYS" "A system shell along with UNIX-style command-line utilities." > $@.tmp
-	cd staging; tar xjf $(MINGW_MSYS)
-	cp staging/bin/sh.exe staging/bin/bash.exe
-	cp msys.bat staging
-	mv $@.tmp $@
-
-gmp.wxs:		$(MINGW_GMP) self.wxs
-	tar tzf $< | sed 's@^gmp/@@' | ./files2wix-feature "MinGW" "GMP" "GnuMP" "A library for arbitrary precision arithmetic." > $@.tmp
-	tar xzf $(MINGW_GMP)
-	cp -a gmp/* staging
-	rm -rf gmp
-	mv $@.tmp $@
-
-self.wxs:	files2wix-feature.exe
-	rm -rf staging
-	make -C ../.. PREFIX= install
-	mv ../../install staging
-	cd staging; find * -type f ! -name *-gdb.a | ../files2wix-feature "Complete" "MLton" "MLton" "A whole-program optimizing Standard ML compiler." > ../$@.tmp
-	mv $@.tmp $@
-
-dbg.wxs:	self.wxs
-	cd staging; find * -type f -name *-gdb.a | ../files2wix-feature "Complete" "Debug" "MLton Debug" "The MLton runtime libraries with included debug information." > ../$@.tmp
-	mv $@.tmp $@
+WIX="/c/Program Files/WiX"
+TARDIR=/c/DOCUME~1/terpstra/Desktop/downloads/mingw
+MLTON=mlton
+
+MINGW_RUNTIME=$(TARDIR)/mingw-runtime-3.14.tar.gz
+MINGW_W32API=$(TARDIR)/w32api-3.11.tar.gz
+MINGW_BINUTILS=$(TARDIR)/binutils-2.17.50-20060824-1.tar.gz
+MINGW_GCC=$(TARDIR)/gcc-core-3.4.5-20060117-1.tar.gz
+MINGW_MSYS=$(TARDIR)/msysCORE-1.0.11-2007.01.19-1.tar.bz2
+MINGW_GMP=$(TARDIR)/gmp-static-mingw-4.1.tar.gz
+
+MINGW_WXS=mingw-runtime.wxs w32api.wxs binutils.wxs gcc.wxs gmp.wxs msys.wxs
+MINGW_WIXOBJ=$(patsubst %.wxs,%.wixobj,$(MINGW_WXS))
+
+mlton.msi:	mlton.wixobj self.wixobj dbg.wixobj filesys.wixobj $(MINGW_WIXOBJ)
+	$(WIX)/light -out $@ $^ $(WIX)/wixui.wixlib -loc $(WIX)/WixUI_en-us.wxl
+
+clean:
+	rm -rf staging mlton.msi *.wixobj *.exe $(MINGW_WXS) self.wxs dbg.wxs filesys.wxs
+
+%.wixobj:	%.wxs
+	$(WIX)/candle $<
+
+%.exe:		%.sml
+	$(MLTON) $<
+
+# This has to happen after everything else is unpacked
+filesys.wxs:	dirs2wix-filesys.exe $(MINGW_WIXOBJ) self.wixobj
+	cd staging; find * -type d | ../dirs2wix-filesys > ../$@.tmp 
+	mv $@.tmp $@
+
+mingw-runtime.wxs:	$(MINGW_RUNTIME) self.wxs
+	tar tzf $< | ./files2wix-component Runtime > $@.tmp
+	cd staging; tar xzf $(MINGW_RUNTIME)
+	mv $@.tmp $@
+
+w32api.wxs:		$(MINGW_W32API) self.wxs
+	tar tzf $< | ./files2wix-component W32API > $@.tmp
+	cd staging; tar xzf $(MINGW_W32API)
+	mv $@.tmp $@
+
+binutils.wxs:		$(MINGW_BINUTILS) self.wxs
+	tar tzf $< | grep -v info/dir | ./files2wix-component Binutils > $@.tmp
+	cd staging; tar xzf $(MINGW_BINUTILS)
+	mv $@.tmp $@
+
+gcc.wxs:		$(MINGW_GCC) self.wxs
+	tar tzf $< | ./files2wix-component GCC > $@.tmp
+	cd staging; tar xzf $(MINGW_GCC)
+	mv $@.tmp $@
+
+msys.wxs:		$(MINGW_MSYS) self.wxs
+	(tar tjf $<; echo bin/bash.exe) | ./files2wix-component MSYS > $@.tmp
+	cd staging; tar xjf $(MINGW_MSYS)
+	cp staging/bin/sh.exe staging/bin/bash.exe
+	cp msys.bat staging
+	mv $@.tmp $@
+
+gmp.wxs:		$(MINGW_GMP) self.wxs
+	tar tzf $< | sed 's@^gmp/@@' | ./files2wix-component GMP > $@.tmp
+	tar xzf $(MINGW_GMP)
+	cp -a gmp/* staging
+	rm -rf gmp
+	mv $@.tmp $@
+
+self.wxs:	files2wix-component.exe
+	rm -rf staging
+	make -C ../.. PREFIX= install
+	mv ../../install staging
+	cd staging; find * -type f ! -name *-gdb.a | ../files2wix-component MLton > ../$@.tmp
+	mv $@.tmp $@
+
+dbg.wxs:	self.wxs
+	cd staging; find * -type f -name *-gdb.a | ../files2wix-component Debug  ../$@.tmp
+	mv $@.tmp $@

Copied: mlton/trunk/package/mingw/files2wix-components.sml (from rev 6802, mlton/trunk/package/mingw/files2wix-feature.sml)
===================================================================
--- mlton/trunk/package/mingw/files2wix-feature.sml	2008-08-25 00:59:02 UTC (rev 6802)
+++ mlton/trunk/package/mingw/files2wix-components.sml	2008-08-25 14:12:41 UTC (rev 6803)
@@ -0,0 +1,85 @@
+val myId =
+   case CommandLine.arguments () of
+      [] => (print "Missing component group command-line argument.\n"; "XXX")
+    | (x :: []) => x
+    | (x :: _) => (print "Too many arguments supplied.\n"; x)
+
+val prefix = "\
+   \<?xml version='1.0' encoding='windows-1252'?>\n\
+   \<Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'>\n\
+   \  <Fragment Id='Fragment" ^ myId ^ "'>\n"
+val suffix = "\
+   \  </Fragment>\n\
+   \</Wix>\n"
+
+fun escape c = if Char.isAlphaNum c orelse c = #"." then c else #"_"
+val escape = CharVector.map escape
+
+fun feature paths =
+   let
+      val prefix = "\
+         \    <ComponentGroup Id='component." ^ myId ^ "'>\n"
+      fun component path = 
+         if #file (OS.Path.splitDirFile path) = "" then "" else "\
+         \      <ComponentRef Id='component." ^ escape path ^ "' />\n"
+      val suffix = "\
+         \    </ComponentGroup>\n"
+   in
+      print prefix
+      ; List.app (print o component) paths
+      ; print suffix
+   end
+ 
+fun dirEntry path =
+   let
+      val {dir, file} = OS.Path.splitDirFile path
+      val dir = if dir = "" then "INSTALLDIR" else "dir." ^ escape dir
+      val uglypath = escape path
+      val guid = guid path
+      val file83 = file83 file
+   in
+      if file = "" then "" else
+      "    <DirectoryRef Id='" ^ dir ^ "'>\n\
+      \      <Component Id='component." ^ uglypath ^ "' \
+                       \Guid='" ^ guid ^ "'>\n\
+      \         <File Id='file." ^ uglypath ^ "' \
+                     \LongName='" ^ file ^ "' \
+                     \Name='" ^ file83 ^ "' DiskId='1' Vital='yes' \
+                     \Source='staging/" ^ path ^ "' />\n\
+      \      </Component>\n\
+      \    </DirectoryRef>\n"
+   end 
+and guid path = 
+   let
+      val w32 = Word32.fromLarge o Word.toLarge o MLton.Random.rand
+      val w16 = Word16.fromLarge o Word.toLarge o MLton.Random.rand
+      val zero = "00000000"
+      fun pad i s = String.substring (zero, 0, i - String.size s) ^ s 
+      val w32 = pad 8 o Word32.toString o w32
+      val w16 = pad 4 o Word16.toString o w16
+   in
+      w32 () ^"-"^ w16 () ^"-"^ w16 () ^"-"^ w16 () ^"-"^ w16 () ^ w32 ()
+   end
+and file83 file = 
+   let
+      val {base, ext} = OS.Path.splitBaseExt file
+      fun trunc x s = String.substring (s, 0, Int.min (x, String.size s))
+      val (base, ext) = (trunc 8 base, Option.map (trunc 3) ext)
+      fun crush c = if Char.contains "\\?|><:/*+,;=[] " c then #"_" else c
+      val crush = CharVector.map crush
+      val (base, ext) = (crush base, Option.map crush ext)
+   in
+      case ext of NONE => base | SOME ext => base ^ "." ^ ext
+   end
+
+fun trim path = String.substring (path, 0, String.size path - 1)
+fun loop files =
+   case TextIO.inputLine TextIO.stdIn of NONE => files | SOME path =>
+   (print (dirEntry (trim path)); loop ((trim path) :: files))
+
+val () = MLton.Random.srand (Word.fromLargeInt (Time.toNanoseconds (Time.now ())))
+val () = print prefix
+val files = loop []
+val () = feature (rev files)
+val () = print suffix
+ 


Property changes on: mlton/trunk/package/mingw/files2wix-components.sml
___________________________________________________________________
Name: svn:mergeinfo
   + 

Deleted: mlton/trunk/package/mingw/files2wix-feature.sml
===================================================================
--- mlton/trunk/package/mingw/files2wix-feature.sml	2008-08-25 00:59:02 UTC (rev 6802)
+++ mlton/trunk/package/mingw/files2wix-feature.sml	2008-08-25 14:12:41 UTC (rev 6803)
@@ -1,94 +0,0 @@
-fun useArgument ([], default) = ([], default)
-  | useArgument (x :: r, _) = (r, x)
-
-val args = CommandLine.arguments ()
-val (args, parentId)   = useArgument (args, "Complete")
-val (args, selfId)     = useArgument (args, "MainProgram")
-val (args, title)      = useArgument (args, "Main Program")
-val (args, description)= useArgument (args, "")
-
-val () = if args = [] then () else
-         print "Warning: Too many arguments supplied.\n"
-
-val prefix = "\
-   \<?xml version='1.0' encoding='windows-1252'?>\n\
-   \<Wix xmlns='http://schemas.microsoft.com/wix/2003/01/wi'>\n\
-   \  <Fragment Id='Fragment" ^ selfId ^ "'>\n"
-val suffix = "\
-   \  </Fragment>\n\
-   \</Wix>\n"
-
-fun escape c = if Char.isAlphaNum c orelse c = #"." then c else #"_"
-val escape = CharVector.map escape
-
-fun feature paths =
-   let
-      val prefix = "\
-         \    <FeatureRef Id='" ^ parentId ^ "'>\n\
-         \      <Feature Id='" ^ selfId ^ "' Title='" ^ title ^ "' \
-                        \Description='" ^ description ^ "' Level='1'>\n"
-      fun component path = 
-         if #file (OS.Path.splitDirFile path) = "" then "" else "\
-         \        <ComponentRef Id='component." ^ escape path ^ "' />\n"
-      val suffix = "\
-         \      </Feature>\n\
-         \    </FeatureRef>\n"
-   in
-      print prefix
-      ; List.app (print o component) paths
-      ; print suffix
-   end
- 
-fun dirEntry path =
-   let
-      val {dir, file} = OS.Path.splitDirFile path
-      val dir = if dir = "" then "INSTALLDIR" else "dir." ^ escape dir
-      val uglypath = escape path
-      val guid = guid path
-      val file83 = file83 file
-   in
-      if file = "" then "" else
-      "    <DirectoryRef Id='" ^ dir ^ "'>\n\
-      \      <Component Id='component." ^ uglypath ^ "' \
-                       \Guid='" ^ guid ^ "'>\n\
-      \         <File Id='file." ^ uglypath ^ "' \
-                     \LongName='" ^ file ^ "' \
-                     \Name='" ^ file83 ^ "' DiskId='1' Vital='yes' \
-                     \Source='staging/" ^ path ^ "' />\n\
-      \      </Component>\n\
-      \    </DirectoryRef>\n"
-   end 
-and guid path = 
-   let
-      val w32 = Word32.fromLarge o Word.toLarge o MLton.Random.rand
-      val w16 = Word16.fromLarge o Word.toLarge o MLton.Random.rand
-      val zero = "00000000"
-      fun pad i s = String.substring (zero, 0, i - String.size s) ^ s 
-      val w32 = pad 8 o Word32.toString o w32
-      val w16 = pad 4 o Word16.toString o w16
-   in
-      w32 () ^"-"^ w16 () ^"-"^ w16 () ^"-"^ w16 () ^"-"^ w16 () ^ w32 ()
-   end
-and file83 file = 
-   let
-      val {base, ext} = OS.Path.splitBaseExt file
-      fun trunc x s = String.substring (s, 0, Int.min (x, String.size s))
-      val (base, ext) = (trunc 8 base, Option.map (trunc 3) ext)
-      fun crush c = if Char.contains "\\?|><:/*+,;=[] " c then #"_" else c
-      val crush = CharVector.map crush
-      val (base, ext) = (crush base, Option.map crush ext)
-   in
-      case ext of NONE => base | SOME ext => base ^ "." ^ ext
-   end
-
-fun trim path = String.substring (path, 0, String.size path - 1)
-fun loop files =
-   case TextIO.inputLine TextIO.stdIn of NONE => files | SOME path =>
-   (print (dirEntry (trim path)); loop ((trim path) :: files))
-
-val () = MLton.Random.srand (Word.fromLargeInt (Time.toNanoseconds (Time.now ())))
-val () = print prefix
-val files = loop []
-val () = feature (rev files)
-val () = print suffix
- 

Modified: mlton/trunk/package/mingw/mlton.wxs
===================================================================
--- mlton/trunk/package/mingw/mlton.wxs	2008-08-25 00:59:02 UTC (rev 6802)
+++ mlton/trunk/package/mingw/mlton.wxs	2008-08-25 14:12:41 UTC (rev 6803)
@@ -24,19 +24,32 @@
       <Directory Id="DesktopFolder" Name="Desktop" />
     </Directory>
 
-    <Feature Id='Complete' Title='MLton/MinGW' Description='A complete SML and C toolchain.'
-      Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR'>
-      <Feature Id='MinGW' Title='MinGW' Description='The minimalist GNU for Windows C compiler toolchain.' Level='1'>
-        <FeatureRef Id='Runtime'/>
-        <FeatureRef Id='W32API'/>
-        <FeatureRef Id='Binutils'/>
-        <FeatureRef Id='GCC'/>
-        <FeatureRef Id='GMP'/>
-        <FeatureRef Id='MSYS'/>
+    <Feature Id='MLton' Title='MLton' Description='A whole-program optimizing Standard ML compiler.' Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR'>
+      <ComponentGroupRef Id='component.MLton' />
+      <Feature Id='Debug' Title='Debug' Description='The MLton runtime libraries with included debug information.' Level='10'>
+        <ComponentGroupRef Id='component.Debug' />
       </Feature>
-      <FeatureRef Id='MLton'/>
-      <FeatureRef Id='Debug'/>
     </Feature>
+    <Feature Id='GMP' Title='GMP' Description='An arbitrary precision integer artihmetic library.' Level='1'>
+      <ComponentGroupRef Id='component.GMP' />
+    </Feature>
+    <Feature Id='MinGW' Title='MinGW' Description='The minimalist GNU for Windows C compiler toolchain.' Level='1'>
+      <Feature Id='Runtime' Title='Runtime' Description='An assortment of thin wrappers that provide POSIX-like functionality on a windows platform.' Level='1'>
+        <ComponentGroupRef Id='component.Runtime' />
+      </Feature>
+      <Feature Id='W32API' Title='Win32 API' Description='Headers and link stub libraries needed to access windows system DLLs.' Level='1'>
+        <ComponentGroupRef Id='component.W32API' />
+      </Feature>
+      <Feature Id='Binutils' Title='Binutils' Description='Utilities for manipulating object files, such as the linker and assembler.' Level='1'>
+        <ComponentGroupRef Id='component.Binutils' />
+      </Feature>
+      <Feature Id='GCC' Title='GCC' Description='The GNU C Compiler. Compiles C files to assembly.' Level='1'>
+        <ComponentGroupRef Id='component.GCC' />
+      </Feature>
+      <Feature Id='MSYS' Title='MSYS' Description='A system shell along with UNIX-style command-line utilities.' Level='1'>
+        <ComponentGroupRef Id='component.MSYS' />
+      </Feature>
+    </Feature>
 
     <UIRef Id="WixUI_Mondo" />
     <UIRef Id="WixUI_ErrorProgressText" />




More information about the MLton-commit mailing list