STXInstaller.st
changeset 5 16cff74f42b0
parent 4 8b68fdf7c870
child 6 e08461c725fd
equal deleted inserted replaced
4:8b68fdf7c870 5:16cff74f42b0
     1 Object subclass:#STXInstaller
     1 Object subclass:#STXInstaller
     2 	instanceVariableNames:'stxLibDir stxBinDir actionPercentageHolder actionTextHolder
     2 	instanceVariableNames:'stxLibDir stxBinDir installDocFiles installSourceFiles
     3 		commandTraceView'
     3 		installSTCFiles installGoodyFiles actionPercentageHolder
       
     4 		actionTextHolder commandTraceView resources'
     4 	classVariableNames:'LastBinDir LastLibDir'
     5 	classVariableNames:'LastBinDir LastLibDir'
     5 	poolDictionaries:''
     6 	poolDictionaries:''
     6 	category:'eXept-tools'
     7 	category:'eXept-tools'
     7 !
     8 !
     8 
     9 
    74     |msg fileSpec filesToCopy numFiles nDone|
    75     |msg fileSpec filesToCopy numFiles nDone|
    75 
    76 
    76     msg := #('ST/X Installation' '' 'copying:' '' 'to:' '') asStringCollection.
    77     msg := #('ST/X Installation' '' 'copying:' '' 'to:' '') asStringCollection.
    77 
    78 
    78     fileSpec := #(
    79     fileSpec := #(
    79                 "/ name                        destination   subDir  required mode      
    80                 "/ name                        destination   subDir    required mode      
    80 
    81                 ( 'projects/smalltalk/smalltalk'     #bin     nil        true  '755' )
    81                 ( 'stc/stc'                         #bin     nil  false '755' )
    82                 ( 'projects/smalltalk/include'       #lib     nil        true  '644' )
    82                 ( 'rules/stmkmp'                    #bin     nil  false '755' )
    83                 ( 'projects/smalltalk/*.rc'          #lib     nil        false '644' )
    83                 ( 'rules/stmkmf'                    #bin     nil  false '755' )
    84                 ( 'projects/smalltalk/patches'       #lib     nil        true  '644' )
    84                 ( 'projects/smalltalk/smalltalk'    #bin     nil  true  '755' )
    85                 ( 'projects/smalltalk/bitmaps'       #lib     nil        true  '644' )
    85 
    86                 ( 'projects/smalltalk/resources'     #lib     nil        true  '644' )
    86                 ( 'librun/librun.a'                 #lib     'lib'    false '644' )
    87                 ( 'projects/smalltalk/lib'           #lib     nil        true  '644' )
    87                 ( 'libbasic/libbasic.o'             #lib     'lib'    false '644' )
    88     ).
    88                 ( 'libbasic2/libbasic2.o'           #lib     'lib'    false '644' )
    89 
    89                 ( 'libbasic3/libbasic3.o'           #lib     'lib'    false '644' )
    90     installDocFiles ifTrue:[
    90                 ( 'libcomp/libcomp.o'               #lib     'lib'    false '644' )
    91         fileSpec := fileSpec , #(
    91                 ( 'libview/libview.o'               #lib     'lib'    false '644' )
    92                 ( 'doc'                              #lib     nil        false '644' )
    92                 ( 'libview2/libview2.o'             #lib     'lib'    false '644' )
    93         ).
    93                 ( 'libwidg/libwidg.o'               #lib     'lib'    false '644' )
    94     ].
    94                 ( 'libwidg2/libwidg2.o'             #lib     'lib'    false '644' )
    95 
    95                 ( 'libwidg3/libwidg3.o'             #lib     'lib'    false '644' )
    96     installSTCFiles ifTrue:[
    96                 ( 'libsnmp/libsnmp.o'               #lib     'lib'    false '644' )
    97         fileSpec := fileSpec , #(
    97                 ( 'libtable/libtable.o'             #lib     'lib'    false '644' )
    98                 ( 'stc/stc'                                  #bin     nil        false '755' )
    98                 ( 'libtool/libtool.o'               #lib     'lib'    false '644' )
    99                 ( 'rules/stmkmp'                             #bin     nil        false '755' )
    99                 ( 'libxt/libxt.o'                   #lib     'lib'    false '644' )
   100                 ( 'rules/stmkmf'                             #bin     nil        false '755' )
   100                 ( 'librt/librt.o'                   #lib     'lib'    false '644' )
   101                 ( 'include'                                  #lib     nil        true  '644' )
   101                 ( 'support/VGL/vogl/src/libvogl.a'  #lib     'lib'        false '644' )
   102                 ( 'configurations'                           #lib     nil        false '644' )
   102                 ( 'support/VGL/vogl/src/*.h'        #lib     'include'    false '644' )
   103                 ( 'rules'                                    #lib     nil        false '644' )
   103                 ( 'support/DLD/dld-3.2.5/libdld.a'  #lib     'lib'        false '644' )
   104 
   104 
   105                 ( 'support/VGL/vogl/src/libvogl.*'           #lib     'lib'      false '644' )
   105                 ( 'projects/smalltalk/*.rc'         #lib   nil    false '644' )
   106                 ( 'support/VGL/vogl/src/*.h'                 #lib     'include'  false '644' )
   106                 ( 'projects/smalltalk/patches'      #lib   nil    true  '644' )
   107                 ( 'support/DLD/dld-3.2.5/libdld.*'           #lib     'lib'      false '644' )
   107 
   108                 ( 'goodies/persistency/db-1.6/PORT/libdb.*'  #lib     'lib'      false '644' )
   108                 ( 'projects/smalltalk/bitmaps'      #lib nil    true  '644' )
   109 
   109                 ( 'doc'                             #lib nil    false '644' )
   110                 ( 'librun/librun.*'                          #lib     'lib'      false '644' )
   110                 ( 'projects/smalltalk/include'      #lib nil    true  '644' )
   111                 ( 'libbasic/libbasic.*'                      #lib     'lib'      false '644' )
   111                 ( 'projects/smalltalk/resources'    #lib nil    true  '644' )
   112                 ( 'libbasic2/libbasic2.*'                    #lib     'lib'      false '644' )
   112                 ( 'projects/smalltalk/source'       #lib nil    true  '644' )
   113                 ( 'libbasic3/libbasic3.*'                    #lib     'lib'      false '644' )
   113                 ( 'configurations'                  #lib nil    false '644' )
   114                 ( 'libcomp/libcomp.*'                        #lib     'lib'      false '644' )
   114                 ( 'rules'                           #lib nil    false '644' )
   115                 ( 'libview/libview.*'                        #lib     'lib'      false '644' )
   115 
   116                 ( 'libview2/libview2.*'                      #lib     'lib'      false '644' )
   116                 ( 'goodies/*.st'                    #lib 'goodies'    false '644' )
   117                 ( 'libwidg/libwidg.*'                        #lib     'lib'      false '644' )
   117                 ( 'goodies/*.chg'                   #lib 'goodies'    false '644' )
   118                 ( 'libwidg2/libwidg2.*'                      #lib     'lib'      false '644' )
   118                 ( 'goodies/rdoit/rdoit'             #bin nil          false '755' )
   119                 ( 'libwidg3/libwidg3.*'                      #lib     'lib'      false '644' )
   119               ).
   120                 ( 'libsnmp/libsnmp.*'                        #lib     'lib'      false '644' )
       
   121                 ( 'contrib/libPVM/libPVM.*'                  #lib     'lib'      false '644' )
       
   122                 ( 'goodies/persistency/libdbase.*'           #lib     'lib'      false '644' )
       
   123                 ( 'libtable/libtable.*'                      #lib     'lib'      false '644' )
       
   124                 ( 'libtool/libtool.*'                        #lib     'lib'      false '644' )
       
   125                 ( 'libxt/libxt.*'                            #lib     'lib'      false '644' )
       
   126                 ( 'librt/librt.*'                            #lib     'lib'      false '644' )
       
   127         ).
       
   128     ].
       
   129 
       
   130     installGoodyFiles ifTrue:[
       
   131         fileSpec := fileSpec , #(
       
   132                 ( 'goodies/*.st'                             #lib     'goodies'  false '644' )
       
   133                 ( 'goodies/*.chg'                            #lib     'goodies'  false '644' )
       
   134                 ( 'goodies/rdoit/rdoit'                      #bin     nil        false '755' )
       
   135         ).
       
   136     ].
       
   137 
       
   138     installSourceFiles ifTrue:[
       
   139         fileSpec := fileSpec , #(
       
   140                 ( 'projects/smalltalk/source'                #lib     nil        true  '644' )
       
   141         ).
       
   142     ].
   120 
   143 
   121     filesToCopy := OrderedCollection new.
   144     filesToCopy := OrderedCollection new.
   122 
   145 
   123     fileSpec do:[:entry |
   146     fileSpec do:[:entry |
   124         |fileName dest subDir required destDir|
   147         |fileName dest subDir required destDir|
   293 askForDestination
   316 askForDestination
   294     "open a dialog to enter destination directories"
   317     "open a dialog to enter destination directories"
   295 
   318 
   296     |d cm l green dark img
   319     |d cm l green dark img
   297      stxLibDirHolder stxBinDirHolder
   320      stxLibDirHolder stxBinDirHolder
       
   321      installDocHolder installSourceHolder installSTCHolder installGoodiesHolder
   298     |
   322     |
   299 
   323 
   300     LastLibDir isNil ifTrue:[
   324     LastLibDir isNil ifTrue:[
   301         LastLibDir := '/usr/local/lib/smalltalk'
   325         LastLibDir := '/usr/local/lib/smalltalk'
   302     ].
   326     ].
   304         LastBinDir := '/usr/local/bin'
   328         LastBinDir := '/usr/local/bin'
   305     ].
   329     ].
   306 
   330 
   307     stxLibDirHolder := LastLibDir asValue.
   331     stxLibDirHolder := LastLibDir asValue.
   308     stxBinDirHolder := LastBinDir asValue.
   332     stxBinDirHolder := LastBinDir asValue.
       
   333     installDocHolder := true asValue.
       
   334     installSourceHolder := true asValue.
       
   335     installSTCHolder := true asValue.
       
   336     installGoodiesHolder := true asValue.
   309 
   337 
   310     Screen current hasColors ifTrue:[
   338     Screen current hasColors ifTrue:[
   311         green := (Color red:0 green:80 blue:20) "darkened".
   339         green := (Color red:0 green:80 blue:20) "darkened".
   312         dark := Color grey:10.
   340         dark := Color grey:10.
   313     ] ifFalse:[
   341     ] ifFalse:[
   355         from:0.0 to:1.0 separateAtX:0.25
   383         from:0.0 to:1.0 separateAtX:0.25
   356         nameAs:'libraryBox'.
   384         nameAs:'libraryBox'.
   357 
   385 
   358     (d componentAt:'libraryBox.label') backgroundColor:dark; foregroundColor:Color white.
   386     (d componentAt:'libraryBox.label') backgroundColor:dark; foregroundColor:Color white.
   359 
   387 
       
   388     d addVerticalSpace.
       
   389     d addHorizontalLine.
       
   390     d addVerticalSpace.
       
   391 
       
   392     (d addTextLabel:('required:'))
       
   393         adjust:#left; foregroundColor:Color white backgroundColor:dark.
       
   394 
       
   395     d leftIndent:35.
       
   396     (d addTextLabel:('binaries (approx. 10 Mb)'))
       
   397         adjust:#left; foregroundColor:Color white backgroundColor:dark.
       
   398     (d addTextLabel:('libraries (approx. 10 Mb)'))
       
   399         adjust:#left; foregroundColor:Color white backgroundColor:dark.
       
   400     d leftIndent:0.
       
   401 
       
   402     d addVerticalSpace.
       
   403     d addHorizontalLine.
       
   404     d addVerticalSpace.
       
   405 
       
   406     (d addTextLabel:('optional:'))
       
   407         adjust:#left; foregroundColor:Color white backgroundColor:dark.
       
   408 
       
   409     (d addCheckBox:('doc files (+8 Mb)') on:installDocHolder)
       
   410         labelView foregroundColor:Color white backgroundColor:dark.
       
   411     (d addCheckBox:('smalltalk source files (+12 Mb)') on:installSourceHolder)
       
   412         labelView foregroundColor:Color white backgroundColor:dark.
       
   413     (d addCheckBox:('goodies (+0.5 Mb)') on:installGoodiesHolder)
       
   414         labelView foregroundColor:Color white backgroundColor:dark.
       
   415     (d addCheckBox:('stc & support files (+2 Mb)') on:installSTCHolder)
       
   416         labelView foregroundColor:Color white backgroundColor:dark.
       
   417 
       
   418     d addVerticalSpace.
       
   419     d addHorizontalLine.
       
   420 
   360     d addAbortButton; addOkButtonLabelled:'install'.
   421     d addAbortButton; addOkButtonLabelled:'install'.
   361     d extent:400@300.
   422     d extent:400@300.
   362 
   423 
   363     d allViewBackground:dark.
   424     d allViewBackground:dark.
   364 
   425 
   365     d openAtCenter.
   426     d openAtCenter.
   366     d accepted ifTrue:[
   427     d accepted ifTrue:[
   367         stxLibDir := LastLibDir := stxLibDirHolder value.
   428         stxLibDir := LastLibDir := stxLibDirHolder value.
   368         stxBinDir := LastBinDir := stxBinDirHolder value.
   429         stxBinDir := LastBinDir := stxBinDirHolder value.
       
   430         installDocFiles := installDocHolder value.
       
   431         installSourceFiles := installSourceHolder value.
       
   432         installSTCFiles := installSTCHolder value.
       
   433         installGoodyFiles := installGoodiesHolder value.
   369         d destroy.
   434         d destroy.
   370         ^ true
   435         ^ true
   371     ].
   436     ].
   372     d destroy.
   437     d destroy.
   373     ^ false
   438     ^ false
   453 !
   518 !
   454 
   519 
   455 open
   520 open
   456     self askAndInstall.
   521     self askAndInstall.
   457 
   522 
   458     "Created: 17.7.1996 / 14:37:14 / cg"
   523     "
   459     "Modified: 18.7.1996 / 18:26:20 / cg"
   524      STXInstaller open
       
   525     "
   460 !
   526 !
   461 
   527 
   462 postInstall
   528 postInstall
   463     "some messages at the end ..."
   529     "some messages at the end ..."
   464 
   530