snap/snapcraft.yaml
changeset 81 a95b2fa896e9
parent 79 a8b434605895
child 82 90da520cbaa5
equal deleted inserted replaced
80:1088ce57d3c9 81:a95b2fa896e9
     1 name: beremiz
     1 name: beremiz
     2 version: '1.3-beta2'
     2 version: '1.3-beta2'
     3 summary: Beremiz
     3 summary: Beremiz
     4 description: |
     4 description: |
     5   Beremiz is an integrated development environment for machine automation. It is Free Software, conforming to IEC-61131 among other standards.
     5   Beremiz is Free and Open Source PLC. It brings Free Software IDE (GPL) and Runtime (LGPL) for machine automation, conforming to IEC-61131.
       
     6 # TODO icon
       
     7 
     6 
     8 
     7 grade: devel
     9 grade: devel
     8 confinement: devmode
    10 confinement: devmode
     9 base: core20
    11 base: core20
    10 
    12 
    12 
    14 
    13   python-deps:
    15   python-deps:
    14     # This part provides all python2 dependencies, including interpreter
    16     # This part provides all python2 dependencies, including interpreter
    15     # More particularily, it builds latest PIP supporting python2 from git
    17     # More particularily, it builds latest PIP supporting python2 from git
    16     # and uses it to collect and buid other Beremiz dependencies.
    18     # and uses it to collect and buid other Beremiz dependencies.
    17 
    19     #
    18     # rational:
    20     # rational:
    19     #  - python plugin doesn't support python2 anymore on core20+
    21     #  - python plugin doesn't support python2 anymore on core20+
    20     #  - attempts to get python2+pip+virtualenv in a core20 based snap failed
    22     #  - attempts to get python2+pip+virtualenv in a core20 based snap failed
       
    23 
    21     plugin: nil
    24     plugin: nil
    22     source: https://github.com/pypa/pip/archive/refs/tags/20.3.4.tar.gz
    25     source: https://github.com/pypa/pip/archive/refs/tags/20.3.4.tar.gz
    23     build-packages:
    26     build-packages:
    24       - libssl-dev
    27       - libssl-dev
    25       - libgtk-3-dev
    28       - libgtk-3-dev
    28       - python2-dev
    31       - python2-dev
    29 
    32 
    30     stage-packages:
    33     stage-packages:
    31       - python2
    34       - python2
    32       - python-setuptools
    35       - python-setuptools
    33       # libs reclaimed by snapcraft at the end of wxPython build
       
    34       # TODO: test if still necessary since using "extensions: [gnome-3-38]"
       
    35       - libgtk-3-0
       
    36       - libegl1
       
    37       - libgl1
       
    38       - libsm6
       
    39       - libxtst6
       
    40 
    36 
    41     override-build: |
    37     override-build: |
    42       # For some reasons site-packages needs to be created and 
    38       # For some reasons site-packages needs to be created and 
    43       # added to PYTHONPATH during PIP (own) build.
    39       # added to PYTHONPATH during PIP (own) build.
    44       # Strangely, not anymore when snap is executed.
    40       # Apparently not anymore when snap is executed.
    45       mkdir $SNAPCRAFT_PART_INSTALL/usr/lib/python2.7/site-packages
    41       mkdir $SNAPCRAFT_PART_INSTALL/usr/lib/python2.7/site-packages
    46       PYTHONPATH=$SNAPCRAFT_PART_INSTALL/usr/lib/python2.7/site-packages $SNAPCRAFT_PART_INSTALL/usr/bin/python2 $SNAPCRAFT_PART_SRC/setup.py install --prefix $SNAPCRAFT_PART_INSTALL/usr
    42       PYTHONPATH=$SNAPCRAFT_PART_INSTALL/usr/lib/python2.7/site-packages \
    47       PYTHONPATH=$SNAPCRAFT_PART_INSTALL/usr/lib/python2.7/site-packages $SNAPCRAFT_PART_INSTALL/usr/bin/pip install \
    43         $SNAPCRAFT_PART_INSTALL/usr/bin/python2 $SNAPCRAFT_PART_SRC/setup.py \
    48           lxml \
    44             install --prefix $SNAPCRAFT_PART_INSTALL/usr
    49           future \
    45       PYTHONPATH=$SNAPCRAFT_PART_INSTALL/usr/lib/python2.7/site-packages \
    50           matplotlib \
    46         $SNAPCRAFT_PART_INSTALL/usr/bin/pip install \
    51           zeroconf2 \
    47           lxml                \
    52           enum34 \
    48           future              \
    53           pyro \
    49           matplotlib          \
    54           sslpsk \
    50           msgpack_python      \
    55           posix_spawn \
    51           u-msgpack-python    \
    56           twisted \
    52           zeroconf2           \
    57           nevow \
    53           enum34              \
    58           autobahn \
    54           pyro                \
    59           click \
    55           sslpsk              \
    60           opcua \
    56           posix_spawn         \
       
    57           twisted             \
       
    58           nevow               \
       
    59           autobahn            \
       
    60           click               \
       
    61           opcua               \
       
    62           pycountry           \
       
    63           fonttools           \
       
    64           Brotli              \
    61           wxPython==4.1.1
    65           wxPython==4.1.1
    62 
    66 
    63   beremiz:
    67   beremiz:
    64     # Beremiz python source + GCC toolchain
    68     # Beremiz python source + GCC toolchain
    65     # source tree is expected to be just aside snap directory
    69     # source tree is expected to be just aside snap directory
    71       - libc6
    75       - libc6
    72       - libc6-dev
    76       - libc6-dev
    73       - linux-libc-dev
    77       - linux-libc-dev
    74       - libgcc-9-dev
    78       - libgcc-9-dev
    75       - libgcc-s1
    79       - libgcc-s1
    76 
       
    77     override-build: |
    80     override-build: |
    78       cp -a $SNAPCRAFT_PART_SRC $SNAPCRAFT_PART_INSTALL/beremiz
    81       cp -a $SNAPCRAFT_PART_SRC $SNAPCRAFT_PART_INSTALL/beremiz
    79 
    82 
    80   matiec:
    83   matiec:
    81     # Matiec ST, SFC and IL compiler.
    84     # Matiec ST, SFC and IL compiler.
    89       - flex
    92       - flex
    90       - bison
    93       - bison
    91     override-build: |
    94     override-build: |
    92       autoreconf -i && ./configure && make
    95       autoreconf -i && ./configure && make
    93       cp -a $SNAPCRAFT_PART_BUILD $SNAPCRAFT_PART_INSTALL/matiec
    96       cp -a $SNAPCRAFT_PART_BUILD $SNAPCRAFT_PART_INSTALL/matiec
       
    97 
       
    98   open62541:
       
    99     plugin: nil
       
   100     source: open62541
       
   101     source-type: local
       
   102     build-packages:
       
   103       - build-essential
       
   104       - cmake
       
   105     override-build: |
       
   106       mkdir build && cd build && cmake .. && make
       
   107       cp -a $SNAPCRAFT_PART_BUILD $SNAPCRAFT_PART_INSTALL/open62541
    94       
   108       
       
   109   inkscape:
       
   110     # CLI only, used in SVGHMI build
       
   111     # GUI fails to launch couldn't find a way
       
   112     plugin: nil
       
   113     stage-packages:
       
   114       - inkscape
       
   115       - libgtk-3-0 
       
   116       # libgtk3 needs to be explicitely given
       
   117       # otherwise wxGtk doesn't start, with this error :
       
   118       # libgtk-3.so.0: undefined symbol: pango_font_family_get_face
       
   119       # ... why ?
       
   120 
    95   revisiontxt:
   121   revisiontxt:
    96     # Makefile generated "revisions.txt"
   122     # Makefile generated "revisions.txt"
    97     plugin: nil
   123     plugin: nil
    98     source: .
   124     source: .
    99     source-type: local
   125     source-type: local
   100     override-build: |
   126     override-build: |
   101       cp $SNAPCRAFT_PART_SRC/revisions.txt $SNAPCRAFT_PART_INSTALL
   127       cp $SNAPCRAFT_PART_SRC/revisions.txt $SNAPCRAFT_PART_INSTALL
   102 
   128 
   103 apps:
   129 apps:
   104   ide:
   130   ide:
       
   131     # Launcher for the IDE
   105     environment:
   132     environment:
   106       SYSROOT: $SNAP
   133       SYSROOT: $SNAP
   107     command: usr/bin/python2 $SNAP/beremiz/Beremiz.py
   134     command: usr/bin/python2 $SNAP/beremiz/Beremiz.py
   108     extensions: [gnome-3-38]
   135     extensions: [gnome-3-38]
   109 
   136 
   110   beremiz:
   137   beremiz:
       
   138     # Beremiz Command Line interface
   111     environment:
   139     environment:
   112       SYSROOT: $SNAP
   140       SYSROOT: $SNAP
   113     command: usr/bin/python2 $SNAP/beremiz/Beremiz_cli.py
   141     command: usr/bin/python2 $SNAP/beremiz/Beremiz_cli.py
   114 
   142  
       
   143   runtime:
       
   144     # Standalone runtime
       
   145     environment:
       
   146       SYSROOT: $SNAP
       
   147     command: usr/bin/python2 $SNAP/beremiz/Beremiz_service.py