Skip to main content

LINUX: tutorial for creating the installer on almost any distribution

The aim of this article is to show step-by-step how to generate the installer from any Linux distribution that supports Qt5 and python3.8.

The steps are:

  1. Install python 3.8
  2. Install makeself
  3. Download Lucas Chess sources
  4. Install the necessary python libraries
  5. Test if all is ok
  6. Create the template 
  7. Generate binaries
  8. Generate the installer

    This example is running on a new virtual machine with Ubuntu 20.04.


    Step 1: Install python 3.8

    Using miniconda is a simple way to install python 3.8.

    1.1. Download

    Link: https://docs.conda.io/en/latest/miniconda.html#linux-installers



    1.2. Installation

    Only for the user

    sh ./Miniconda3-latest-linux-x86_64.sh


    Destination folder= ~/miniconda3

    1.3. Default python3

    To facilitate the process (in my case), the python3 of miniconda is set as default python3 of my user:
    vi ~/.profile
    adding at end:
    export PATH="$HOME/miniconda3/bin:$PATH"

    Step 2: Install makeself

    This tool is used to create an installation in a compressed shell file with the possibility of launching a script when decompressing.
    In this moment I use:
    In the Download folder:
    sh makeself-2.4.5.run

    and the folder created I move to $HOME with the name makeself
    mv makeself-2.4.5 $HOME/makeself

    Step 3: Download Lucas Chess sources




    Extracting the download into the Public folder:



    Step 4: Install the necessary python libraries

    3.1. The pyaudio library needs a sudo command beforehand:
    sudo apt-get install libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0

    3.2. There is a file with all the libraries needed:
    cd $HOME/Public/lucaschessR-master
    pip3 install -r requirements.txt

    # pyinstaller is also needed
    pip3 install pyinstaller

    Step 5: Test if all is ok 

    The first time, before launching the program, you have to give execution permissions to all the engines.
    cd $HOME/Public/lucaschessR-master
    cd bin/OS/linux
    sh ./RunEngines
    cd ../..

    Then launch the program:
    python3 LucasR.py

    In my case there is a problem with the QT libraries.

    In order to solve it:
    sudo apt-get install qt5-default

    And launch it again:
    python3 LucasR.py

    Then this asks for the language and the name of the user below.

    Step 6: Create the template

    6.1 Create main

    cd  ~/Public/lucaschessR-master/genlinux
    pyinstaller Launcher.py

    Assuming that a bin folder does not exist in Files (if more than one attempt has been made, it may exist, in that case, delete it beforehand).
    mv dist/Launcher Files/bin
    mv Files/bin/Launcher Files/bin/LucasR

    6.2 Create aux

    pyinstaller setup_linux.py
    mv dist/setup_linux/setup_linux Files/bin

    6.3 Cleaning

    rm -rf dist build *.spec

    6.4 Reducing the size of the template

    All files with the word Web or Quick or 3D could be removed.
    cd  ~/Public/lucaschessR-master/genlinux/Files/bin

    find . -name "*Web*" -exec rm -rf "{}" \;
    find . -name "*Quick*" -exec rm -rf "{}" \;
    find . -name "3D*" -exec rm -rf "{}" \;
    rm -rf ./Qt/translations

    Step 7: Generate binaries

    cd  ~/Public/lucaschessR-master/genlinux
    python3 GenInstaller.py

    The folder LucasChessR is created.

    Step 8: Generate the installer

    cd  ~/Public/lucaschessR-master/genlinux
    rm -rf LucasChessR/UserData
    $HOME/makeself/makeself.sh LucasChessR LucasChessR.sh "Installing Lucas Chess R" ./setup_linux.sh .

    The installer is created: LucasChessR.sh
    To test:
    sh ./LucasChessR.sh

    Comments

    1. hello version 1.26 R win portable:
      by wanting to create a polyglot book, after confirmation the program crashe and closes, with no polyglot file in my book folder .

      ReplyDelete
      Replies
      1. How many positions does it have?
        There is a file, in folder bin/bug.log is a text file, perhaps it has more information.

        Delete
      2. my pgn have 26 games with 10 to 30 moves
        bug log :

        Version R 1.26
        Exception in thread Thread-6:
        Traceback (most recent call last):
        File "D:\obj\windows-release\37win32_Release\msi_python\zip_win32\threading.py", line 926, in _bootstrap_inner
        File "D:\obj\windows-release\37win32_Release\msi_python\zip_win32\threading.py", line 870, in run
        File "LucasChessR\bin\Code\SQL\UtilSQL.py", line 404, in _run_thread
        sqlite3.OperationalError: no such column: WHITERESULT

        Delete
      3. This information is not enough for me to replicate the problem, I assume there are more circumstances because all the tests I have done have been correct.

        Delete
      4. seeing your answer that on your side there is no bug, I started to change and search the settings during creation. while for two days the process closed my Lucaschess, I just changed the destination folder and no more problem. sorry for the false alarm, and always a big thumbs up for the respondent and the quality of the GUI

        Delete

    Post a Comment

    Popular posts from this blog

    Version R

    New version of the program. Continuist at user level with the previous one, but with great internal changes. This new version has been mainly tried: Update the code to a current version of the compiler, from python 2.7 to python 3.7 (based in a previous work of Alfonso Solbes). Update the graphic library, from version 4 to 5 of qt, via pyside2. Improve folder organization, with Linux support in mind. Negative consequences: It is incompatible with Windows XP. The data is not compatible with previous versions of Lucas Chess. The weight of the installer has doubled, currently around 120 Mb and the disk installation occupies 338 Mb.

    R 1.06 Maia

     This update contains a major improvement with the inclusion of Maia. Maia is a neural network chess engine, created with the purpose of making her movements as human as possible. The Maia creation team has prepared 9 versions, from 1100 to 1900 of elo, and thus they have been included in Lucas Chess. You have all the information about Maia at: https://maiachess.com/

    Version 11.17: update of Honey and Stockfish

    This update mainly contains the upgrade of two of the main engines: Honey formerly McCain, which is the default tutor used by the program, now updated to version XI. The author is Michael Byrne ( link ) Stockfish, version 11 ( link ) There are some bugs fixed thanks to LinuxOnTheDesktop and others.... Downloads  :  Update, from Information menu, Search for updates Portable:   LucasChessPortable1117.exe Installable:   InsLucasChess1117.exe