snapcraft.yaml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. name: ozwadmin
  2. base: core20
  3. version: 'V0.1.74'
  4. adopt-info: ozw-admin
  5. grade: 'stable'
  6. confinement: strict
  7. layout:
  8. /etc/fonts:
  9. bind: $SNAP/etc/fonts
  10. /usr/share/fonts:
  11. bind: $SNAP/usr/share/fonts
  12. /usr/local/share/OpenZWave:
  13. bind: $SNAP/usr/local/share/OpenZWave
  14. package-repositories:
  15. - type: apt
  16. components: [main]
  17. suites: [xenial]
  18. key-id: C65D51784EDC19A871DBDBB710C56D0DE9977759
  19. url: http://ppa.launchpad.net/beineri/opt-qt-5.12.8-xenial/ubuntu
  20. - type: apt
  21. formats: [deb]
  22. components: [main]
  23. suites: [xenial-security]
  24. key-id: 40976EAF437D05B5
  25. url: http://security.ubuntu.com/ubuntu
  26. - type: apt
  27. ppa: deadsnakes/ppa
  28. plugs:
  29. ozw-config:
  30. interface: content
  31. content: ozw-config
  32. target: $SNAP/usr/local/share/OpenZWave/ozw-admin
  33. default-provider: ozwdaemon
  34. ozw-db:
  35. interface: content
  36. content: ozw-db
  37. target: $SNAP/usr/local/share/OpenZWave/qt-openzwavedatabase.rcc
  38. default-provider: ozwdaemon
  39. qt-ozw-lib:
  40. interface: content
  41. content: qt-ozw-lib
  42. target: $SNAP/usr/qt-ozw-lib
  43. default-provider: ozwdaemon
  44. apps:
  45. ozwadmin:
  46. command: usr/local/bin/ozwadmin
  47. command-chain:
  48. - misc/ensure-plugs
  49. - misc/wrapper
  50. common-id: ozwadmin
  51. plugs:
  52. - desktop
  53. - desktop-legacy
  54. - x11
  55. - network
  56. - network-bind
  57. - hardware-observe
  58. - ozw-config
  59. - ozw-db
  60. - qt-ozw-lib
  61. parts:
  62. ozw-admin:
  63. plugin: make
  64. source: https://github.com/OpenZWave/ozw-admin.git
  65. source-tag: ${SNAPCRAFT_PROJECT_VERSION}
  66. parse-info: [scripts/ozwadmin.appdata.xml]
  67. build-snaps:
  68. - ozwdaemon
  69. build-packages:
  70. - appstream
  71. - build-essential
  72. - fuse
  73. - joe
  74. - libcurl4-openssl-dev
  75. - libgl1-mesa-dev
  76. - libunwind-dev
  77. - mc
  78. - mesa-common-dev
  79. - pkgconf
  80. - python3.8
  81. - rapidjson-dev
  82. - qt512-meta-minimal
  83. - libqt5remoteobjects5-dev
  84. - libqt5serialport5-dev
  85. - libqt5svg5-dev
  86. - libqt5websockets5-dev
  87. stage-packages:
  88. - libdouble-conversion3
  89. - libfreetype6
  90. - libgl1
  91. - libglvnd0
  92. - libglx0
  93. - libgraphite2-3
  94. - libharfbuzz0b
  95. - libicu66
  96. - libpcre2-16-0
  97. - libpng16-16
  98. - libqt5core5a
  99. - libqt5gui5
  100. - libqt5network5
  101. - libqt5serialport5
  102. - libqt5svg5
  103. - libqt5widgets5
  104. - libqt5xml5
  105. - libx11-6
  106. - libxau6
  107. - libxcb1
  108. - libxdmcp6
  109. - libgl1-mesa-dri
  110. - mesa-utils
  111. override-build: |
  112. cp ${SNAPCRAFT_PART_BUILD}/scripts/ozwadmin.png "${SNAPCRAFT_PART_INSTALL}"
  113. if [ -f "Makefile" ]; then
  114. echo "Clean $SNAPCRAFT_PART_BUILD"
  115. qmake -r
  116. make distclean
  117. fi
  118. # Lets go dummy to mimic ozw-admin's expected directory layout
  119. OZWD_SNAP_PATH="/snap/ozwdaemon/current/"
  120. DUMMY_DIR="${HOME}/dummy"
  121. rm -rf "${DUMMY_DIR}"
  122. mkdir -p "${DUMMY_DIR}/lib"
  123. QTOZW_LIB_PATH="$(dirname $(find ${OZWD_SNAP_PATH} -name libqt-openzwave.so -print0 -quit))"
  124. ln -sf "$QTOZW_LIB_PATH" "${DUMMY_DIR}/lib/qt-openzwave"
  125. mkdir -p "${DUMMY_DIR}/include"
  126. QTOZW_INCLUDE_PATH="$(dirname $(find ${OZWD_SNAP_PATH} -name qtopenzwave.h -print0 -quit))"
  127. ln -sf "$QTOZW_INCLUDE_PATH" "${DUMMY_DIR}/include/qt-openzwave"
  128. mkdir "${DUMMY_DIR}/lib/qt-openzwavedatabase"
  129. QTOZW_DB_PATH="$(find ${OZWD_SNAP_PATH} -name qt-openzwavedatabase.rcc -print0 -quit)"
  130. ln -sf "$QTOZW_DB_PATH" "${DUMMY_DIR}/lib/qt-openzwavedatabase/"
  131. # Dummy life over, lets link OpenZWave files
  132. OZW_LIB_PATH="$(dirname $(find ${OZWD_SNAP_PATH} -name libopenzwave.so -print0 -quit))"
  133. OZW_INCLUDE_PATH="$(dirname $(find ${OZWD_SNAP_PATH} -name Manager.h -print0 -quit))"
  134. OZW_DATABASE_PATH="$(dirname $(find ${OZWD_SNAP_PATH} -name manufacturer_specific.xml))"
  135. qmake -r "CONFIG+=release" \
  136. QTOZW_LIB_PATH="${DUMMY_DIR}/lib/" \
  137. QTOZW_INCLUDE_PATH="${DUMMY_DIR}/include" \
  138. OZW_LIB_PATH="${OZW_LIB_PATH}" \
  139. OZW_INCLUDE_PATH="${OZW_INCLUDE_PATH}" \
  140. OZW_DATABASE_PATH="${OZW_DATABASE_PATH}"
  141. QTOZW_LIB_PATH=""
  142. make -j$(nproc)
  143. make -j$(nproc) install INSTALL_ROOT="${SNAPCRAFT_PART_INSTALL}"
  144. organize:
  145. ozwadmin.png: meta/gui/ozwadmin.png
  146. filesets:
  147. ozwadmin-usr:
  148. - usr/bin
  149. - usr/include
  150. - usr/local
  151. - usr/share
  152. - usr/lib/X11
  153. - usr/lib/*/libQt5SerialPort*
  154. - usr/lib/*/libQt5Svg*
  155. - usr/lib/*/libQt5Xml*
  156. - usr/lib/*/qt5/plugins/iconengines
  157. - usr/lib/*/qt5/plugins/imageformats/libqsvg.so
  158. stage:
  159. - $ozwadmin-usr
  160. - etc/
  161. - lib*/*
  162. - meta/
  163. wrapper:
  164. plugin: dump
  165. source: src/wrapper
  166. source-type: local
  167. organize:
  168. ensure-plugs: misc/ensure-plugs
  169. wrapper: misc/wrapper
  170. splash-screen:
  171. plugin: python
  172. source: src/python
  173. source-type: local
  174. python-packages:
  175. - wheel
  176. requirements:
  177. - requirements.txt
  178. build-packages:
  179. - python3-dev
  180. - python3-setuptools
  181. - python3-wheel
  182. - python3-pip
  183. stage-packages:
  184. - libgl1-mesa-dri
  185. - mesa-utils
  186. - libfreetype6
  187. - libfontconfig1
  188. - libxcb-icccm4
  189. - libxcb-image0
  190. - libxcb-keysyms1
  191. - libxcb-randr0
  192. - libxcb-render-util0
  193. - libxcb-shape0
  194. - libxcb-xinerama0
  195. - libxcb-xkb1
  196. - libxcb-sync1
  197. - libxcb-xfixes0
  198. - libxcb-shm0
  199. - libxkbcommon-x11-0
  200. stage:
  201. - bin/
  202. - etc/
  203. - lib*/*
  204. - share/
  205. - usr/
  206. - pyvenv.cfg