snap/snapcraft.yaml
changeset 79 a8b434605895
child 81 a95b2fa896e9
equal deleted inserted replaced
78:38597d675b03 79:a8b434605895
       
     1 name: beremiz
       
     2 version: '1.3-beta2'
       
     3 summary: Beremiz
       
     4 description: |
       
     5   Beremiz is an integrated development environment for machine automation. It is Free Software, conforming to IEC-61131 among other standards.
       
     6 
       
     7 grade: devel
       
     8 confinement: devmode
       
     9 base: core20
       
    10 
       
    11 parts:
       
    12 
       
    13   python-deps:
       
    14     # This part provides all python2 dependencies, including interpreter
       
    15     # More particularily, it builds latest PIP supporting python2 from git
       
    16     # and uses it to collect and buid other Beremiz dependencies.
       
    17 
       
    18     # rational:
       
    19     #  - python plugin doesn't support python2 anymore on core20+
       
    20     #  - attempts to get python2+pip+virtualenv in a core20 based snap failed
       
    21     plugin: nil
       
    22     source: https://github.com/pypa/pip/archive/refs/tags/20.3.4.tar.gz
       
    23     build-packages:
       
    24       - libssl-dev
       
    25       - libgtk-3-dev
       
    26       - libgl1-mesa-dev
       
    27       - libglu1-mesa-dev
       
    28       - python2-dev
       
    29 
       
    30     stage-packages:
       
    31       - python2
       
    32       - 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 
       
    41     override-build: |
       
    42       # For some reasons site-packages needs to be created and 
       
    43       # added to PYTHONPATH during PIP (own) build.
       
    44       # Strangely, not anymore when snap is executed.
       
    45       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
       
    47       PYTHONPATH=$SNAPCRAFT_PART_INSTALL/usr/lib/python2.7/site-packages $SNAPCRAFT_PART_INSTALL/usr/bin/pip install \
       
    48           lxml \
       
    49           future \
       
    50           matplotlib \
       
    51           zeroconf2 \
       
    52           enum34 \
       
    53           pyro \
       
    54           sslpsk \
       
    55           posix_spawn \
       
    56           twisted \
       
    57           nevow \
       
    58           autobahn \
       
    59           click \
       
    60           opcua \
       
    61           wxPython==4.1.1
       
    62 
       
    63   beremiz:
       
    64     # Beremiz python source + GCC toolchain
       
    65     # source tree is expected to be just aside snap directory
       
    66     plugin: nil
       
    67     source: beremiz
       
    68     source-type: local
       
    69     stage-packages:
       
    70       - gcc
       
    71       - libc6
       
    72       - libc6-dev
       
    73       - linux-libc-dev
       
    74       - libgcc-9-dev
       
    75       - libgcc-s1
       
    76 
       
    77     override-build: |
       
    78       cp -a $SNAPCRAFT_PART_SRC $SNAPCRAFT_PART_INSTALL/beremiz
       
    79 
       
    80   matiec:
       
    81     # Matiec ST, SFC and IL compiler.
       
    82     # source tree is expected to be just aside snap directory
       
    83     plugin: nil
       
    84     source: matiec
       
    85     source-type: local
       
    86     build-packages:
       
    87       - build-essential
       
    88       - automake
       
    89       - flex
       
    90       - bison
       
    91     override-build: |
       
    92       autoreconf -i && ./configure && make
       
    93       cp -a $SNAPCRAFT_PART_BUILD $SNAPCRAFT_PART_INSTALL/matiec
       
    94       
       
    95   revisiontxt:
       
    96     # Makefile generated "revisions.txt"
       
    97     plugin: nil
       
    98     source: .
       
    99     source-type: local
       
   100     override-build: |
       
   101       cp $SNAPCRAFT_PART_SRC/revisions.txt $SNAPCRAFT_PART_INSTALL
       
   102 
       
   103 apps:
       
   104   ide:
       
   105     environment:
       
   106       SYSROOT: $SNAP
       
   107     command: usr/bin/python2 $SNAP/beremiz/Beremiz.py
       
   108     extensions: [gnome-3-38]
       
   109 
       
   110   beremiz:
       
   111     environment:
       
   112       SYSROOT: $SNAP
       
   113     command: usr/bin/python2 $SNAP/beremiz/Beremiz_cli.py
       
   114