[MLton-commit] r6806

Wesley Terpstra wesley at mlton.org
Mon Aug 25 10:25:31 PDT 2008


Setup PATH on install
Setup file associations for SML and MLB files.
----------------------------------------------------------------------

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

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

Modified: mlton/trunk/package/mingw/Makefile
===================================================================
--- mlton/trunk/package/mingw/Makefile	2008-08-25 17:24:44 UTC (rev 6805)
+++ mlton/trunk/package/mingw/Makefile	2008-08-25 17:25:30 UTC (rev 6806)
@@ -71,5 +71,5 @@
 	mv $@.tmp $@
 
 dbg.wxs:	self.wxs
-	cd staging; find * -type f -name *-gdb.a | ../files2wix-component Debug  ../$@.tmp
+	cd staging; find * -type f -name *-gdb.a | ../files2wix-component Debug > ../$@.tmp
 	mv $@.tmp $@

Copied: mlton/trunk/package/mingw/files2wix-component.sml (from rev 6803, mlton/trunk/package/mingw/files2wix-components.sml)

Deleted: mlton/trunk/package/mingw/files2wix-components.sml
===================================================================
--- mlton/trunk/package/mingw/files2wix-components.sml	2008-08-25 17:24:44 UTC (rev 6805)
+++ mlton/trunk/package/mingw/files2wix-components.sml	2008-08-25 17:25:30 UTC (rev 6806)
@@ -1,85 +0,0 @@
-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
- 

Modified: mlton/trunk/package/mingw/mlton.wxs
===================================================================
--- mlton/trunk/package/mingw/mlton.wxs	2008-08-25 17:24:44 UTC (rev 6805)
+++ mlton/trunk/package/mingw/mlton.wxs	2008-08-25 17:25:30 UTC (rev 6806)
@@ -14,26 +14,50 @@
 
     <Directory Id='TARGETDIR' Name='SourceDir'>
       <Directory Id='ProgramFilesFolder' Name='PFiles'>
-        <Directory Id='INSTALLDIR' Name='MLton'/>
+        <Directory Id='INSTALLDIR' Name='MLton' />
       </Directory>
 
       <Directory Id="ProgramMenuFolder" Name="PMenu" LongName="Programs">
-        <Directory Id="ProgramMenuDir" Name='MLton'/>
+        <Directory Id="ProgramMenuDir" Name='MLton'>
+          <Directory Id='ProgramMenuDocs' Name='Docs' LongName='Documentation'>
+          </Directory>
+        </Directory>
       </Directory>
 
       <Directory Id="DesktopFolder" Name="Desktop" />
     </Directory>
 
+    <DirectoryRef Id='dir.bin'>
+      <Component Id='component.path' Guid='5B06C123-B426-3D4D-BE48-4D07BAD8A6BA'>
+        <Environment Id='env.path' Name='PATH' Action='set' Part='last' System='yes' Value='[dir.bin]' />
+      </Component>
+      <Component Id='component.batch' Guid='A2E613BD-41F8-1CF7-D5EA-0C41674D78AC'>
+        <File Id='file.bin_mlton.bat' Name='mlton.bat' Source='mlton.bat' DiskId='1' Vital='yes' />
+        <ProgId Id='MLton.mlb' Description='Standard ML basis file'>
+          <Extension Id='mlb' ContentType='application/mlb'>
+            <Verb Id='buildMLB' Sequence='10' Command='Compile' Target='[!file.bin_mlton.bat]' Argument='-cc-opt -O1 -verbose 1 "%1"' />
+          </Extension>
+        </ProgId>
+        <ProgId Id='MLton.sml' Description='Standard ML source file'>
+          <Extension Id='sml' ContentType='application/sml'>
+            <Verb Id='buildSML' Sequence='10' Command='Compile' Target='[!file.bin_mlton.bat]' Argument='-cc-opt -O1 -verbose 1 "%1"' />
+          </Extension>
+        </ProgId>
+      </Component>
+    </DirectoryRef>
+   
     <Feature Id='MLton' Title='MLton' Description='A whole-program optimizing Standard ML compiler.' Display='expand' Level='1' ConfigurableDirectory='INSTALLDIR'>
       <ComponentGroupRef Id='component.MLton' />
+      <ComponentRef Id='component.batch' />
+      <ComponentRef Id='component.path' />
       <Feature Id='Debug' Title='Debug' Description='The MLton runtime libraries with included debug information.' Level='10'>
         <ComponentGroupRef Id='component.Debug' />
       </Feature>
     </Feature>
-    <Feature Id='GMP' Title='GMP' Description='An arbitrary precision integer artihmetic library.' Level='1'>
+    <Feature Id='GMP' Title='GMP' Description='An arbitrary precision integer artihmetic library.' Level='1' ConfigurableDirectory='INSTALLDIR'>
       <ComponentGroupRef Id='component.GMP' />
     </Feature>
-    <Feature Id='MinGW' Title='MinGW' Description='The minimalist GNU for Windows C compiler toolchain.' Level='1'>
+    <Feature Id='MinGW' Title='MinGW' Description='The minimalist GNU for Windows C compiler toolchain.' Level='1' ConfigurableDirectory='INSTALLDIR'>
       <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>
@@ -41,12 +65,15 @@
         <ComponentGroupRef Id='component.W32API' />
       </Feature>
       <Feature Id='Binutils' Title='Binutils' Description='Utilities for manipulating object files, such as the linker and assembler.' Level='1'>
+        <ComponentRef Id='component.path' />
         <ComponentGroupRef Id='component.Binutils' />
       </Feature>
       <Feature Id='GCC' Title='GCC' Description='The GNU C Compiler. Compiles C files to assembly.' Level='1'>
+        <ComponentRef Id='component.path' />
         <ComponentGroupRef Id='component.GCC' />
       </Feature>
       <Feature Id='MSYS' Title='MSYS' Description='A system shell along with UNIX-style command-line utilities.' Level='1'>
+        <ComponentRef Id='component.path' />
         <ComponentGroupRef Id='component.MSYS' />
       </Feature>
     </Feature>




More information about the MLton-commit mailing list