README.md
changeset 37 fd09116d3537
child 80 1088ce57d3c9
equal deleted inserted replaced
36:ad68e85dc416 37:fd09116d3537
       
     1 # Beremiz public distribution #
       
     2 
       
     3 This repository holds recipes and patches to build the Beremiz related 
       
     4 bundles, packages, installers and images available on 
       
     5 [Beremiz website](http://www.beremiz.org/).
       
     6 
       
     7 Patches have same license as projects beeing patched. For other files,
       
     8 unless made explicit in file header, GPLv3 applies.
       
     9 
       
    10 
       
    11 ## Prerequisites ##
       
    12 
       
    13 A usable Docker is required. Docker is used to ensure a reproducible build
       
    14 environment. 
       
    15 
       
    16 Other containerization/virtualization could be used to achieve the same effect. 
       
    17 
       
    18 Reference build environment is obtained by applying [provision_focal64.sh](provision_focal64.sh) on Ubuntu 20.04 amd64.
       
    19 
       
    20 ## Build ##
       
    21 
       
    22 The top Makefile expects source code of Beremiz, Matiec and CanFestival to be 
       
    23 sibling to beremiz_public_dist directory, in the 'source directory'.
       
    24 For example :
       
    25 
       
    26 ```
       
    27 ~/src
       
    28      /beremiz
       
    29      /beremiz_public_dist
       
    30      /CanFestival-3
       
    31      /matiec
       
    32 ```
       
    33 
       
    34 If any of Beremiz, Matiec or CanFestival repositories are missing, they will be
       
    35 cloned aside beremiz_public_dist from https://hg.beremiz.org .
       
    36 
       
    37 Intermediate and final results are all placed in a single 'build directory'
       
    38 during build process.
       
    39 
       
    40 ### Prepare Docker image ###
       
    41 
       
    42 The script [rebuild_docker.sh](rebuild_docker.sh) is used for that purpose.
       
    43 
       
    44 Synopsis:
       
    45 
       
    46     ./rebuild_docker.sh [build directory]
       
    47 
       
    48 Example:
       
    49 
       
    50 ```
       
    51 #!sh
       
    52 mkdir ~/src
       
    53 cd ~/src
       
    54 hg clone https://hg.beremiz.org/beremiz_public_dist
       
    55 cd beremiz_public_dist
       
    56 ./rebuild_docker.sh
       
    57 ```
       
    58 
       
    59 Source and Build Volumes :
       
    60  
       
    61  Role             | Docker Volume     | Host path in example | Rationale
       
    62 ------------------|-------------------|----------------------|------------------------------------------------
       
    63  source directory | /home/devel/src   | ~/src                | Always relative to CWD : "../"
       
    64  build directory  | /home/devel/build | ~/build              | First argument to rebuild_docker.sh or ~/build
       
    65 
       
    66 'build directory' can be specified as absolute path argument of rebuild_docker.sh.
       
    67 If not specified it defaults to ~/build
       
    68 
       
    69 ```
       
    70 #!sh
       
    71 ./rebuild_docker.sh ~/build_next
       
    72 ```
       
    73 
       
    74 Note: 'build directory' is created if not already existing.
       
    75 
       
    76 ### Build Windows Installer ###
       
    77 
       
    78 The script [build_in_docker.sh](build_in_docker.sh) is used for that purpose.
       
    79 
       
    80 ```
       
    81 #!sh
       
    82 ./build_in_docker.sh 
       
    83 ```
       
    84 
       
    85 Note: 'build directory' must exist before calling build_in_docker.sh, otherwise
       
    86 Docker will create it as root user. Be sure to create it again if you delete it.
       
    87 
       
    88 Resulting installer is Beremiz-1.2.exe in 'build directory'. 
       
    89 
       
    90 ## Manhole ##
       
    91 
       
    92 Once Docker image ready, the scripts [enter_docker.sh](enter_docker.sh) and
       
    93 [enter_docker_as_root.sh](enter_docker_as_root.sh) let you issue build 
       
    94 commands, or install additional packages.
       
    95 
       
    96 [clean_docker_container.sh](clean_docker_container.sh) and [create_docker_container.sh](create_docker_container.sh) and 
       
    97 [clean_docker_image.sh](clean_docker_image.sh) and [build_docker_image.sh](build_docker_image.sh) are invoked by 
       
    98 [rebuild_docker.sh](rebuild_docker.sh).