Compile python and drop environment dictionary

Classic python snaps require python to be compiled from source.
Additionaly, move away from using the environment dictionary
until it is fully supported by snapd. Finally, use a fixed python
path in order to get the correct site-specific config.

These changes were recommended in the following bug:
https://bugs.launchpad.net/snapcraft/+bug/1675479

Change-Id: Ibe68ab3a252067421169effd99fc5b14d490136b
This commit is contained in:
Corey Bryant 2017-04-24 13:08:58 +00:00
parent 64c93eb1cd
commit daad53b3d5
1 changed files with 25 additions and 5 deletions

View File

@ -5,18 +5,20 @@ description: OpenStack Network Service (neutron)
confinement: classic
grade: devel
environment:
PATH: $PATH:$SNAP/bin
apps:
api:
command: snap-openstack neutron-server
command: >
env PYTHONPATH=$PYTHONPATH:$SNAP/lib/python2.7/site-packages
$SNAP/usr/bin/python2 $SNAP/bin/snap-openstack neutron-server
daemon: simple
manage:
command: snap-openstack neutron-db-manage
command: >
env PYTHONPATH=$PYTHONPATH:$SNAP/lib/python2.7/site-packages
$SNAP/usr/bin/python2 $SNAP/bin/snap-openstack neutron-db-manage
parts:
neutron:
after: [python]
plugin: python
python-version: python2
source: http://tarballs.openstack.org/neutron/neutron-master.tar.gz
@ -29,6 +31,11 @@ parts:
- gcc
- libffi-dev
- libssl-dev
stage:
- -usr/bin/2to3
- -usr/bin/pydoc
- -usr/bin/python2.7
- -usr/lib/python2.7
install:
touch $SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages/paste/__init__.py
touch $SNAPCRAFT_PART_INSTALL/lib/python2.7/site-packages/repoze/__init__.py
@ -51,3 +58,16 @@ parts:
- etc/neutron/*
stage: [$etc]
snap: [$etc]
python:
source: https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tar.xz
plugin: autotools
configflags:
- --prefix=/usr
- --enable-shared
- --enable-unicode=ucs4
build-packages:
- libssl-dev
prime:
- -usr/include
install:
$SNAPCRAFT_PART_INSTALL/usr/bin/python2 -m ensurepip