README.md
changeset 80 1088ce57d3c9
parent 37 fd09116d3537
child 89 9af00a65266a
equal deleted inserted replaced
79:a8b434605895 80:1088ce57d3c9
    15 
    15 
    16 Other containerization/virtualization could be used to achieve the same effect. 
    16 Other containerization/virtualization could be used to achieve the same effect. 
    17 
    17 
    18 Reference build environment is obtained by applying [provision_focal64.sh](provision_focal64.sh) on Ubuntu 20.04 amd64.
    18 Reference build environment is obtained by applying [provision_focal64.sh](provision_focal64.sh) on Ubuntu 20.04 amd64.
    19 
    19 
    20 ## Build ##
    20 ## Preparing source ##
    21 
    21 
    22 The top Makefile expects source code of Beremiz, Matiec and CanFestival to be 
    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'.
    23 sibling to beremiz_public_dist directory, in the 'source directory'.
    24 For example :
    24 For example :
    25 
    25 
    26 ```
    26 ```
    27 ~/src
    27 ~/src
    28      /beremiz
    28      /beremiz
    29      /beremiz_public_dist
    29      /beremiz_public_dist
    30      /CanFestival-3
    30      /canfestival
    31      /matiec
    31      /matiec
    32 ```
    32 ```
    33 
    33 
    34 If any of Beremiz, Matiec or CanFestival repositories are missing, they will be
    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 .
    35 cloned aside beremiz_public_dist from https://hg.beremiz.org .
    36 
    36 
    37 Intermediate and final results are all placed in a single 'build directory'
    37 Intermediate and final results are all placed in a single 'build directory'
    38 during build process.
    38 during build process.
       
    39 
       
    40 ## Windows installer Build ##
    39 
    41 
    40 ### Prepare Docker image ###
    42 ### Prepare Docker image ###
    41 
    43 
    42 The script [rebuild_docker.sh](rebuild_docker.sh) is used for that purpose.
    44 The script [rebuild_docker.sh](rebuild_docker.sh) is used for that purpose.
    43 
    45 
    47 
    49 
    48 Example:
    50 Example:
    49 
    51 
    50 ```
    52 ```
    51 #!sh
    53 #!sh
    52 mkdir ~/src
    54 mkdir ~/src ~/build
    53 cd ~/src
    55 cd ~/src
    54 hg clone https://hg.beremiz.org/beremiz_public_dist
    56 hg clone https://hg.beremiz.org/beremiz_public_dist
    55 cd beremiz_public_dist
    57 cd beremiz_public_dist
    56 ./rebuild_docker.sh
    58 ./rebuild_docker.sh
    57 ```
    59 ```
    85 Note: 'build directory' must exist before calling build_in_docker.sh, otherwise
    87 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.
    88 Docker will create it as root user. Be sure to create it again if you delete it.
    87 
    89 
    88 Resulting installer is Beremiz-1.2.exe in 'build directory'. 
    90 Resulting installer is Beremiz-1.2.exe in 'build directory'. 
    89 
    91 
    90 ## Manhole ##
    92 ### Manhole ###
    91 
    93 
    92 Once Docker image ready, the scripts [enter_docker.sh](enter_docker.sh) and
    94 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 
    95 [enter_docker_as_root.sh](enter_docker_as_root.sh) let you issue build 
    94 commands, or install additional packages.
    96 commands, or install additional packages.
    95 
    97 
    96 [clean_docker_container.sh](clean_docker_container.sh) and [create_docker_container.sh](create_docker_container.sh) and 
    98 [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 
    99 [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). 
   100 [rebuild_docker.sh](rebuild_docker.sh). 
       
   101 
       
   102 ## Snap Package Build ##
       
   103 
       
   104 snapcraft.yaml does not rely on HG or GIT repos, but refers to local sources, this is responsibility of caller to prepare sources for snapcraft.
       
   105 
       
   106 Reasons for this are :
       
   107  - no parameters or conditional variables exist to tell snapcraft.yaml where to get the source from
       
   108  - building from local source should be always possible
       
   109  - revisions.txt must be updated in any case so that it is always possible to know what version wqas used to build resulting package
       
   110  - when Snap is built from GitHub actions, Makefile isn't used at all, and GitHub action workflow organize sources and revisions.txt on its own.
       
   111 
       
   112 In the end, instead of just calling `snapcraft` to get a snap package, it is more complicated:
       
   113 
       
   114 ```
       
   115 #!sh
       
   116 mkdir ~/src ~/build
       
   117 cd ~/src
       
   118 hg clone https://hg.beremiz.org/beremiz_public_dist
       
   119 cd ~/build
       
   120 make -f ~/src/beremiz_public_dist/Makefile DIST=snap
       
   121 
       
   122 ```
       
   123