Changes between Version 72 and Version 73 of Documentation/BuildingStXWithRakefiles


Ignore:
Timestamp:
Feb 13, 2019, 11:11:38 AM (5 years ago)
Author:
patrik.svestka@…
Comment:

Major documentation refactoring concering scoop - added Windows 7 x64 SP1 and filled all found missing information during a i686 Smalltalk/X installation on Windows 7

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/BuildingStXWithRakefiles

    v72 v73  
    118118This should be everything you need to compile Smalltalk/X jv-branch as [[#InaNutshell|described above]]
    119119
    120 ==== Windows 10 (using scoop - exparimetnal, needs some more testing)
    121 
    122 Tested on Windows 10 x64 (Version 10.0.15063). Thanks to Patrik Svestka. **This guide is experimental and need
     120==== Windows 7 and 10 (using scoop - experimetal, needs some more testing)
     121
     122Tested on Windows 7 x64 SP1 and 10 x64 (Version 10.0.15063). Thanks to Patrik Svestka. **This guide is experimental and need
    123123some polishing!**
    124124
     125    {{{
     126    #!div class="note"
     127    **Note:** Scoop on Windows 7 needs at least **powershell 3.0** (aka PS).  The default PS that comes with Windows 7 is **powershell 2.0**.  You **need** to upgrade PS in order to use scoop in Windows 7! You can install up to PS 5.1 on Windows 7 (using .NET 4.5 and Windows Management Framework (WMF) 5.1).
     128    }}}
     129
     130
    125131This guide uses [[https://github.com/lukesampson/scoop|scoop]] installer as it makes the installation process much
    126 easier. See [[ScoopCrashCourse|scoop crashcourse]] for quick reference on [[https://github.com/lukesampson/scoop|scoop]].
     132easier. See [[ScoopCrashCourse|scoop crashcourse]] for quick reference on [[https://github.com/lukesampson/scoop|scoop]].
     133
     134{{{
     135#!div class="note"
     136    **Note:** The `powershell` and `cmd.exe` commands for each step are equivalent.  Some powershell commands are not available on lower powershell versions (e.g. 3.0 or 4.0) so `cmd.exe` has to be used.  Pick one way and stick with it.
     137}}}
    127138 
    128139
    129   * Install scoop. Execute the following in **powershell**  n a custom directory `c:\app_scoop`:
     140  * Install scoop. Execute the following in **powershell**: (installs scoop into a custom directory `c:\app_scoop`):
    130141    {{{
    131142    [environment]::setEnvironmentVariable('SCOOP','c:\app_scoop','User')
     
    136147  * Install 7zip, git and [[https://msys2.github.io/|MSYS2]]:
    137148    {{{
    138     scoop install 7zip
    139     scoop install git
    140     scoop install msys2
     149    scoop install 7zip git msys2
    141150    }}}
     151
     152  * Start the **msys2 shell** to wrap up the msys2 installation.  After the initial setup will be done within the msys2 shell you **must** close the whole msys2 shell in order for the installation and setup to be complete.
     153
     154  * Create a symbolic link `C:\MSYS64` for the msys2 directory installed via scoop e.g. `C:\app_scoop\apps\msys2\current` (don't forget to adjust your custom directory if used).  The path `C:\MSYS64` is hard-coded in build scripts for Smalltalk/X, which will be fixed in the future.  For now, you have to create the symbolic link.
     155
     156  The PS 5.0 way:
    142157    {{{
     158    New-Item -Path C:\MSYS64 -ItemType SymbolicLink -Value C:\app_scoop\apps\msys2\current
     159    }}}
     160  If you have less than PS 5.0 run `cmd.exe` as Administrator and execute:
     161    {{{
     162 cmd /c mklink C:\MSYS64 C:\app_scoop\apps\msys2\current
     163    }}}
     164
     165  * Update your `PATH` with `c:\msys64\usr\bin`.
     166
     167  The PS way:
     168  Updating the user variables:
     169{{{
     170[Environment]::SetEnvironmentVariable(
     171  "Path",
     172  [Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::User) + ";c:\msys64\usr\bin",
     173  [System.EnvironmentVariableTarget]::User)
     174}}}
     175  The cmd.exe way (**WARNING:** This will also execute in powershell, but the variable %PATH% will not be expanded and all the previous PATH(s) will be lost):
     176    {{{
     177    setx PATH "%PATH%;c:\msys64\usr\bin"
     178    }}}
     179
     180{{{
    143181    #!div class="note"
    144     Note: Don't forget to check your PATH if it was updated correctly with msys2. In case you are missing it update
    145     your **user** `PATH` with (use your own path): C:\app_scoop\apps\msys2\current\mingw64\bin.
    146     }}}
     182    **Note:** Should a need to update the system wide variables via powershell araise, this is how you do it:
     183 {{{
     184 [Environment]::SetEnvironmentVariable(
     185   "Path",
     186   [Environment]::GetEnvironmentVariable("Path", [EnvironmentVariableTarget]::Machine) + ";c:\msys64\usr\bin",
     187   [EnvironmentVariableTarget]::Machine)
     188 }}}
     189}}}
     190
     191* Check you updated path. You have to close the current powershell or cmd.exe and start it again.
     192
     193  To check if your `PATH` now contains msys64 path.
     194
     195  Via PS:
     196  {{{
     197  $env:path -split ";" | sls msys64
     198  }}}
     199
     200  Via cmd.exe
     201  {{{
     202  SET | findstr msys64
     203  }}}
    147204
    148205- Installing ruby
    149206
    150 Select option 2 (update msys2 installation), it will install Dev-kit including `MINGW/MSYS gcc`.  In my case it is `gcc.exe (Rev1, Built by MSYS2 project) 8.2.0` (when invoked in powershell via `gcc --version`)
    151 {{{
    152 scoop install ruby
    153 }}}
    154 
    155 In case you want to switch rubies you need a rubies switcher.  One of the best for windows is [[https://bitbucket.org/jonforums/uru|uru]]. Since the package is not offered in the official buckets , due to some special needs, the `uru` developer offers a link for easy install:
     207  {{{
     208  scoop install ruby
     209  }}}
     210
     211  After installation you will get a note:
     212  {{{
     213Notes
     214-----
     215Install MSYS2 via 'scoop install msys2' and then run 'ridk install' to install the toolchain!
     216}}}
     217  Since the msys2 is already installed there is no need to install it again.
     218
     219- (optional) Running `ridk install` after installing ruby to update msys2
     220
     221  The following information will be displayed:
     222{{{
     223ridk install
     224 _____       _           _____           _        _ _         ___
     225|  __ \     | |         |_   _|         | |      | | |       |__ \
     226| |__) |   _| |__  _   _  | |  _ __  ___| |_ __ _| | | ___ _ __ ) |
     227|  _  / | | | '_ \| | | | | | | '_ \/ __| __/ _` | | |/ _ \ '__/ /
     228| | \ \ |_| | |_) | |_| |_| |_| | | \__ \ || (_| | | |  __/ | / /_
     229|_|  \_\__,_|_.__/ \__, |_____|_| |_|___/\__\__,_|_|_|\___|_||____|
     230                    __/ |           _
     231                   |___/          _|_ _  __   | | o __  _| _     _
     232                                   | (_) |    |^| | | |(_|(_)\^/_>
     233
     234   1 - MSYS2 base installation
     235   2 - MSYS2 system update (optional)
     236   3 - MSYS2 and MINGW development toolchain
     237
     238Which components shall be installed? If unsure press ENTER [1,2,3]
     239}}}
     240
     241  Select option 2 which updates all msys2 packages.  Be sure that the StX building process supports all the newest packages most importantly gcc and gcc-libs, before running the update.
     242
     243- (optional) Switching among ruby versions
     244
     245  In case you want to switch rubies you need a rubies switcher.  One of the best for windows is [[https://bitbucket.org/jonforums/uru|uru]]. Since the package is not offered in the official buckets , due to some special needs, the `uru` developer offers a link for easy install:
    156246{{{
    157247scoop install https://bitbucket.org/jonforums/uru/downloads/uru.json
    158248}}}
    159 {{{
    160 #!div class="note"
    161 Note: You can also switch among rubies also via [[https://github.com/lukesampson/scoop/wiki/Switching-Ruby-And-Python-Versions|scoop itself]].  The `uru` application is probably easier to use for switching.
    162 }}}
    163 {{{
    164 #!div class="note"
    165 **Important note on gcc versions:**  For Smalltalk/X compilation you need to use mingw-64-gcc not the gcc for msys2.
     249  To add ruby via `uru`:
     250  {{{
     251  uru admin add C:\app_scoop\apps\ruby\2.6.1-1\bin
     252  }}}
     253{{{
     254#!div class="note"
     255**Note:** In the directory path use a specific ruby version, in this case `2.6.1-1`.  You should **not** use symlinked directory `current` for adding the ruby version as this will always point to the newest ruby version and thus can change in the future.
     256}}}
     257{{{
     258#!div class="note"
     259**Note2:** You can also switch among rubies also via [[https://github.com/lukesampson/scoop/wiki/Switching-Ruby-And-Python-Versions|scoop itself]].  The `uru` application is probably easier to use for switching.
     260}}}
     261
     262- Installing required dependencies via `msys2 shell`:
     263{{{
     264pacman -S make cvs openssh ssh-pageant-git zip unzip
     265}}}
     266
     267- Installing `gcc` and depedencies via msys2
     268
     269  This will differ when preparing toolchain for 64bit or 32bit Smalltalk/X:
     270
     271  For 64bit:
     272  {{{
     273  pacman -S  mingw-w64-x86_64-gcc mingw-w64-x86_64-SDL
     274  }}}
     275
     276  For 32bit:
     277  {{{
     278  pacman -S  mingw-w64-i686-gcc mingw-w64-i686-SDL
     279  }}}
     280 
     281{{{
     282#!div class="note"
     283**Note:** As of **13.02.2019** the supported gcc versions for compiling Smalltalk/x 8.x are:
     284 - For **64bits** up to gcc **8.2.0**
     285 - For **32Bits** up to gcc **6.x.x**
     286}}}
     287
     288{{{
     289#!div class="note"
     290**Important note on gcc versions:**  For Smalltalk/X compilation you need to use **MINGW gcc** => `mingw64/mingw-w64-x86_64-gcc` and **NOT** the  **MSYS2 gcc** => `msys/gcc 7.3.0-3 (msys2-devel)`!!!
    166291
    167292**Correct gcc:**
     
    197322- To install needed applications further (some maybe installed as dependencies, which is fine):
    198323{{{
    199 scoop install openssh innounp
    200 scoop install mercurial
     324scoop install innounp mercurial
    201325}}}
    202326
    203327- If you inted to use [[http://swing.fit.cvut.cz/projects/stx/doc/online/english/programming/java-helloworld.html|integrated Smalltalk/X Java]] which is build into Smalltalk/X VM (Virtual Machine) you need to:
    204328
    205 Adding a `java` bucket
    206 {{{
    207 scoop bucket add java
    208 }}}
    209 
    210 Installing [[https://www.azul.com/'|zulu7]] (Tested and certified OpenJDK Java builds), which translates into `Java 1.7`  implementation:
    211 {{{
    212 scoop install zulu7
    213 }}}
    214 
    215 Adding a `versions` bucket (contains previous versions of programs - we need it for `Ant` in our case):
    216 {{{
    217 scoop bucket add versions
    218 }}}
    219 
    220 To install `Ant 1.9` needed to work with Java 1.7
    221 {{{
    222 scoop install ant19
    223 }}}
    224 
    225 Since there is a `c:\MSYS2` path hardcoded in Smalltalk/X, which will be fixed in future versions, you need to create a symbolic link to point you to wherever you installed the `msys2` application:
    226 
    227 You can do that in powershell 5 the following way:
    228 {{{
    229 New-Item -Path C:\MSYS2 -ItemType SymbolicLink -Value C:\app_scoop\apps\msys2\current
    230 }}}
     329  Adding a `java` bucket
     330  {{{
     331  scoop bucket add java
     332  }}}
     333
     334  Installing [[https://www.azul.com/'|zulu7]] (Tested and certified OpenJDK Java builds), which translates into `Java 1.7`  implementation:
     335  {{{
     336  scoop install zulu7
     337  }}}
     338
     339  Adding a `versions` bucket (contains previous versions of programs - we need it for `Ant` in our case):
     340  {{{
     341  scoop bucket add versions
     342  }}}
     343
     344  To install `Ant 1.9` needed to work with Java 1.7
     345  {{{
     346  scoop install ant19
     347  }}}
    231348
    232349- To install [[https://www.mercurial-scm.org/wiki/EvolveExtension|Evolve]] mercurial plugin:
    233350
    234 Install `Python 2.7` (Note: you need to have the bucket `versions` added):
    235 {{{
    236 scoop install python27
    237 }}}
    238 
    239 Then upgrate the `pip` python installer:
    240 {{{
    241 python -m pip install --upgrade pip
    242 }}}
    243 
    244 Installing `Evolve`:
    245 {{{
    246 pip install --user hg-evolve
    247 }}}
    248 
    249 To add it to `TortoiseHG` find your `mercurial.ini` (usually at `c:\users\login`) and update it with:
    250 {{{
    251 evolve = C:\Users\<login>\AppData\Roaming\Python\Python27\site-packages\hgext3rd\evolve
     351  Install `Python 2.7` (Note: you need to have the bucket `versions` added):
     352  {{{
     353  scoop install python27
     354  }}}
     355
     356  Upgrate the `pip` python installer:
     357  {{{
     358  python -m pip install --upgrade pip
     359  }}}
     360
     361  Installing `Evolve`:
     362  {{{
     363  pip install --user hg-evolve
     364  }}}
     365
     366  To add it to `TortoiseHG` find your `mercurial.ini` (usually at `c:\users\login`) and update it with:
     367  {{{
     368  evolve = C:\Users\<login>\AppData\Roaming\Python\Python27\site-packages\hgext3rd\evolve
     369  }}}
     370
     371{{{
     372#!div class="note"
     373**Note:** If you intent to use ''TortoiseHG'' it is recommanded to use **identical versions** for both ''TortoiseHG'' **and** ''mercurial''.
    252374}}}
    253375