snap/snapcraft.yaml
changeset 123 032aaa29f498
parent 106 cf158979ecae
child 124 9304b56075c2
equal deleted inserted replaced
122:ef1c44f741e3 123:032aaa29f498
    32   - snap@beremiz.fr
    32   - snap@beremiz.fr
    33 
    33 
    34 
    34 
    35 grade: devel
    35 grade: devel
    36 confinement: strict
    36 confinement: strict
    37 base: core20
    37 base: core22
    38 architectures: [amd64, arm64]
    38 architectures: [amd64, arm64]
    39 
    39 
    40 parts:
    40 parts:
    41 
    41 
    42   python-deps:
       
    43     # This part provides all python2 dependencies, including interpreter
       
    44     # More particularily, it builds latest PIP supporting python2 from git
       
    45     # and uses it to collect and buid other Beremiz dependencies.
       
    46     #
       
    47     # rational:
       
    48     #  - python plugin doesn't support python2 anymore on core20+
       
    49     #  - attempts to get python2+pip+virtualenv in a core20 based snap failed
       
    50 
       
    51     plugin: nil
       
    52     source: https://github.com/pypa/pip/archive/refs/tags/20.3.4.tar.gz
       
    53     build-packages:
       
    54       - libssl-dev
       
    55       - libgtk-3-dev
       
    56       - libgl1-mesa-dev
       
    57       - libglu1-mesa-dev
       
    58       - python2-dev
       
    59 
       
    60     stage-packages:
       
    61       - python2
       
    62       - python-setuptools
       
    63       - python-lxml
       
    64 
       
    65     override-build: |
       
    66       # For some reasons site-packages needs to be created and 
       
    67       # added to PYTHONPATH during PIP (own) build.
       
    68       # Apparently not anymore when snap is executed.
       
    69       mkdir $SNAPCRAFT_PART_INSTALL/usr/lib/python2.7/site-packages
       
    70       PYTHONPATH=$SNAPCRAFT_PART_INSTALL/usr/lib/python2.7/site-packages \
       
    71         $SNAPCRAFT_PART_INSTALL/usr/bin/python2 $SNAPCRAFT_PART_SRC/setup.py \
       
    72             install --prefix $SNAPCRAFT_PART_INSTALL/usr
       
    73       PYTHONPATH=$SNAPCRAFT_PART_INSTALL/usr/lib/python2.7/site-packages \
       
    74         $SNAPCRAFT_PART_INSTALL/usr/bin/pip install \
       
    75           future              \
       
    76           matplotlib          \
       
    77           msgpack_python      \
       
    78           u-msgpack-python    \
       
    79           zeroconf2           \
       
    80           enum34              \
       
    81           pyro                \
       
    82           sslpsk              \
       
    83           posix_spawn         \
       
    84           twisted             \
       
    85           nevow               \
       
    86           autobahn            \
       
    87           click               \
       
    88           opcua               \
       
    89           pycountry           \
       
    90           fonttools           \
       
    91           Brotli              \
       
    92           wxPython==4.1.1
       
    93 
       
    94   beremiz:
    42   beremiz:
    95     # Beremiz python source + GCC toolchain
    43     # Beremiz python source and dependencies, inc. native GCC
    96     # source tree is expected to be just aside snap directory
    44     # source tree is expected to be just aside snap directory
    97     plugin: nil
    45     plugin: python
    98     source: beremiz
    46     source: beremiz
    99     source-type: local
    47     source-type: local
       
    48     python-requirements:
       
    49       - requirements.txt
       
    50     # native GCC toolchain
       
    51     # note: GCC toolchain cannot be move to separate part
       
    52     # otherwise there is a file conflict about lib64 in prime step
       
    53     # caused apparently by libc6 (needed to have consistent sysroot)
   100     stage-packages:
    54     stage-packages:
   101       - gcc
    55       - gcc
   102       - libc6
    56       - libc6
   103       - libc6-dev
    57       - libc6-dev
   104       - linux-libc-dev
    58       - linux-libc-dev
   105       - libgcc-9-dev
    59       - libgcc-9-dev
   106       - libgcc-s1
    60       - libgcc-s1
   107     override-pull: |
    61     override-pull: |
   108       snapcraftctl pull
    62       snapcraftctl pull
   109       snapcraftctl set-version `python2 $SNAPCRAFT_PART_SRC/version.py`
    63       snapcraftctl set-version `python3 $SNAPCRAFT_PART_SRC/version.py`
   110     override-build: |
    64     override-build: |
       
    65       snapcraftctl build
   111       cp -a $SNAPCRAFT_PART_SRC $SNAPCRAFT_PART_INSTALL/beremiz
    66       cp -a $SNAPCRAFT_PART_SRC $SNAPCRAFT_PART_INSTALL/beremiz
   112 
    67 
   113   matiec:
    68   matiec:
   114     # Matiec ST, SFC and IL compiler.
    69     # Matiec ST, SFC and IL compiler.
   115     # source tree is expected to be just aside snap directory
    70     # source tree is expected to be just aside snap directory
   170 apps:
   125 apps:
   171   ide:
   126   ide:
   172     # Launcher for the IDE
   127     # Launcher for the IDE
   173     environment:
   128     environment:
   174       SYSROOT: $SNAP
   129       SYSROOT: $SNAP
   175     command: usr/bin/python2 $SNAP/beremiz/Beremiz.py
   130     command: bin/python3 $SNAP/beremiz/Beremiz.py
   176     extensions: [gnome-3-38]
   131     extensions: [gnome]
   177     plugs:
   132     plugs:
   178       - network
   133       - network
   179       - network-bind
   134       - network-bind
   180 
   135 
   181   beremiz:
   136   beremiz:
   182     # Beremiz Command Line interface
   137     # Beremiz Command Line interface
   183     environment:
   138     environment:
   184       SYSROOT: $SNAP
   139       SYSROOT: $SNAP
   185     command: usr/bin/python2 $SNAP/beremiz/Beremiz_cli.py
   140     command: bin/python3 $SNAP/beremiz/Beremiz_cli.py
   186     plugs:
   141     plugs:
   187       - network
   142       - network
   188       - network-bind
   143       - network-bind
   189  
   144  
   190   runtime:
   145   runtime:
   191     # Standalone runtime
   146     # Standalone runtime
   192     environment:
   147     environment:
   193       SYSROOT: $SNAP
   148       SYSROOT: $SNAP
   194     command: usr/bin/python2 $SNAP/beremiz/Beremiz_service.py
   149     command: bin/python3 $SNAP/beremiz/Beremiz_service.py
   195     plugs:
   150     plugs:
   196       - network
   151       - network
   197       - network-bind
   152       - network-bind
   198 
   153