snapcraft.yaml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. name: ozwadmin
  2. base: core20
  3. version: 'V0.1.74'
  4. adopt-info: ozw-admin
  5. grade: devel # must be 'stable' to release into candidate/stable channels
  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. plugs:
  27. ozw-configuration:
  28. interface: content
  29. content: ozw-configuration
  30. target: $SNAP/usr/local/share/OpenZWave/ozw-admin
  31. qt-ozw-db:
  32. interface: content
  33. content: qt-ozw-db
  34. target: $SNAP/usr/local/share/OpenZWave
  35. qt-ozw-lib:
  36. interface: content
  37. content: qt-ozw-lib
  38. target: $SNAP/usr/qt-ozw-lib
  39. slots:
  40. a11y-bus:
  41. interface: dbus
  42. bus: session
  43. name: org.a11y.Bus
  44. apps:
  45. ozwadmin:
  46. command: usr/local/bin/ozwadmin
  47. command-chain:
  48. - wrapper
  49. plugs:
  50. - desktop
  51. - desktop-legacy
  52. - x11
  53. - network
  54. - network-bind
  55. - hardware-observe
  56. slots:
  57. - a11y-bus
  58. parts:
  59. ozw-admin:
  60. plugin: make
  61. source: https://github.com/OpenZWave/ozw-admin.git
  62. source-tag: ${SNAPCRAFT_PROJECT_VERSION}
  63. parse-info: [scripts/ozwadmin.appdata.xml]
  64. build-snaps:
  65. - ozwdaemon
  66. build-packages:
  67. - appstream
  68. - build-essential
  69. - fuse
  70. - joe
  71. - libcurl4-openssl-dev
  72. - libgl1-mesa-dev
  73. - libunwind-dev
  74. - mc
  75. - mesa-common-dev
  76. - pkgconf
  77. - python3.8
  78. - rapidjson-dev
  79. - qt512-meta-minimal
  80. - libqt5remoteobjects5-dev
  81. - libqt5serialport5-dev
  82. - libqt5svg5-dev
  83. - libqt5websockets5-dev
  84. stage-packages:
  85. - libdouble-conversion3
  86. - libfreetype6
  87. - libgl1
  88. - libglvnd0
  89. - libglx0
  90. - libgraphite2-3
  91. - libharfbuzz0b
  92. - libicu66
  93. - libpcre2-16-0
  94. - libpng16-16
  95. - libqt5core5a
  96. - libqt5gui5
  97. - libqt5network5
  98. - libqt5serialport5
  99. - libqt5svg5
  100. - libqt5widgets5
  101. - libqt5xml5
  102. - libx11-6
  103. - libxau6
  104. - libxcb1
  105. - libxdmcp6
  106. - libgl1-mesa-dri
  107. - mesa-utils
  108. override-build: |
  109. cp ${SNAPCRAFT_PART_BUILD}/scripts/ozwadmin.* "${SNAPCRAFT_PART_INSTALL}"
  110. #sed -i -E "s#^Exec=(.+)#Exec=usr/local/bin/ozwadmin#" "${SNAPCRAFT_PART_INSTALL}/ozwadmin.desktop"
  111. sed -i '$ d' "${SNAPCRAFT_PART_INSTALL}/ozwadmin.desktop"
  112. if [ -f "Makefile" ]; then
  113. echo "Clean $SNAPCRAFT_PART_BUILD"
  114. qmake -r
  115. make distclean
  116. fi
  117. # Lets go dummy to mimic ozw-admin's expected directory layout
  118. OZWD_SNAP_PATH="/snap/ozwdaemon/current/"
  119. DUMMY_DIR="${HOME}/dummy"
  120. rm -rf "${DUMMY_DIR}"
  121. mkdir -p "${DUMMY_DIR}/lib"
  122. QTOZW_LIB_PATH="$(dirname $(find ${OZWD_SNAP_PATH} -name libqt-openzwave.so -print0 -quit))"
  123. ln -sf "$QTOZW_LIB_PATH" "${DUMMY_DIR}/lib/qt-openzwave"
  124. mkdir -p "${DUMMY_DIR}/include"
  125. QTOZW_INCLUDE_PATH="$(dirname $(find ${OZWD_SNAP_PATH} -name qtopenzwave.h -print0 -quit))"
  126. ln -sf "$QTOZW_INCLUDE_PATH" "${DUMMY_DIR}/include/qt-openzwave"
  127. mkdir "${DUMMY_DIR}/lib/qt-openzwavedatabase"
  128. QTOZW_DB_PATH="$(find ${OZWD_SNAP_PATH} -name qt-openzwavedatabase.rcc -print0 -quit)"
  129. ln -sf "$QTOZW_DB_PATH" "${DUMMY_DIR}/lib/qt-openzwavedatabase/"
  130. # Dummy life over, lets link OpenZWave files
  131. OZW_LIB_PATH="$(dirname $(find ${OZWD_SNAP_PATH} -name libopenzwave.so -print0 -quit))"
  132. OZW_INCLUDE_PATH="$(dirname $(find ${OZWD_SNAP_PATH} -name Manager.h -print0 -quit))"
  133. OZW_DATABASE_PATH="$(dirname $(find ${OZWD_SNAP_PATH} -name manufacturer_specific.xml))"
  134. qmake -r "CONFIG+=release" \
  135. QTOZW_LIB_PATH="${DUMMY_DIR}/lib/" \
  136. QTOZW_INCLUDE_PATH="${DUMMY_DIR}/include" \
  137. OZW_LIB_PATH="${OZW_LIB_PATH}" \
  138. OZW_INCLUDE_PATH="${OZW_INCLUDE_PATH}" \
  139. OZW_DATABASE_PATH="${OZW_DATABASE_PATH}"
  140. QTOZW_LIB_PATH=""
  141. make -j$(nproc)
  142. make -j$(nproc) install INSTALL_ROOT="${SNAPCRAFT_PART_INSTALL}"
  143. organize:
  144. ozwadmin.png: snap/gui/ozwadmin.png
  145. ozwadmin.desktop: snap/gui/ozwadmin.desktop
  146. local-src:
  147. plugin: dump
  148. source: src/
  149. source-type: local