소스 검색

Ship Py.x requirement, now 3.9

Joachim M. Giæver 2 년 전
부모
커밋
e955881f62
1개의 변경된 파일52개의 추가작업 그리고 19개의 파일을 삭제
  1. 52 19
      snap/snapcraft.yaml

+ 52 - 19
snap/snapcraft.yaml

@@ -1,6 +1,6 @@
 name: home-assistant-snap
 title: Home assistant
-version: '2021.11.1'
+version: '2021.11.3'
 icon: snap/gui/home-assistant-snap.svg
 summary: Open source home automation that puts local control and privacy first
 description: |
@@ -157,10 +157,50 @@ apps:
 
 parts:
   python:
-    plugin: dump 
-    source: ./src/nil
+    plugin: autotools
+    source: https://www.python.org/ftp/python/3.9.8/Python-3.9.8.tgz
+    autotools-configure-parameters:
+      - --enable-optimizations
+    build-packages:
+      - build-essential
+      - gdb 
+      - lcov
+      - pkg-config
+      - libbz2-dev 
+      - libffi-dev 
+      - libgdbm-dev 
+      - libgdbm-compat-dev 
+      - liblzma-dev
+      - libncurses5-dev
+      - libreadline6-dev
+      - libsqlite3-dev
+      - libssl-dev
+      - lzma
+      - lzma-dev 
+      - tk-dev 
+      - uuid-dev 
+      - zlib1g-dev
+    override-stage: |
+      snapcraftctl stage
+      [ ! -d "${SNAPCRAFT_STAGE}/bin" ] && mkdir ${SNAPCRAFT_STAGE}/bin
+      ln -s ../usr/local/bin/python3.9 "${SNAPCRAFT_STAGE}/bin/python3.9"
+      ln -s ../usr/local/bin/python3.9 "${SNAPCRAFT_STAGE}/usr/bin/python3"
     stage-packages:
-      - python3.9-venv
+      - libfontconfig1
+      - libfreetype6
+      - libgdbm-compat4
+      - libgdbm6
+      - libpng16-16
+      - libtcl8.6
+      - libtk8.6
+      - libx11-6
+      - libxau6
+      - libxcb1
+      - libxdmcp6
+      - libxext6
+      - libxft2
+      - libxrender1
+      - libxss1
 
   homeassistant:
     after: [python]
@@ -169,7 +209,6 @@ parts:
     source-tag: ${SNAPCRAFT_PROJECT_VERSION}
     build-environment:
       - SNAPCRAFT_PYTHON_INTERPRETER: python3.9
-      # - SNAPCRAFT_PYTHON_VENV_ARGS: --without-pip
     python-packages:
       - setuptools<58
       - wheel
@@ -204,17 +243,17 @@ parts:
       - pkg-config
       - python3-pip
       - python3.9-dev
-      # - python3.9-venv
       - zlib1g-dev
       - on armhf:
-        - rustc
         - cargo
-        - make
-        - gcc
         - dpkg-dev
-      - on ppc64el:
+        - gcc
+        - libfreetype-dev
+        - make
         - rustc
+      - on ppc64el:
         - cargo
+        - rustc
     stage-packages:
       - freeglut3
       - ffmpeg
@@ -226,7 +265,6 @@ parts:
       - netbase
       - tcpdump
       - zlib1g
-      # - python3.9-venv
     stage:
       - -lib/python3.9/site-packages/homeassistant/components/updater
       - -lib/python3.9/site-packages/aiogithubapi*
@@ -234,14 +272,9 @@ parts:
       - requirements_all.txt
     constraints:
       - homeassistant/package_constraints.txt
-    # override-build: |
-    #   rm -rf $SNAPCRAFT_PART_INSTALL/usr/lib/python3.9/distutils
-    #   mkdir -p $SNAPCRAFT_PART_INSTALL/usr/lib/python3.9
-    #   cp -rf /usr/lib/python3.9/distutils $SNAPCRAFT_PART_INSTALL/usr/lib/python3.9/distutils
-    #   mkdir -p $SNAPCRAFT_PART_INSTALL/usr/include/
-    #   cp -rf /usr/include/python3.9 $SNAPCRAFT_PART_INSTALL/usr/include/python3.9
-    #   snapcraftctl build
-    #   sed -i 's/include-system-site-packages = false/include-system-site-packages = true/g' $SNAPCRAFT_PART_INSTALL/pyvenv.cfg
+    override-stage: |
+      snapcraftctl stage
+      sed -i 's/include-system-site-packages = false/include-system-site-packages = true/g' $SNAPCRAFT_STAGE/pyvenv.cfg
   updater:
     after: [homeassistant]
     plugin: dump