name: ozwadmin base: core20 version: 'V0.1.74' adopt-info: ozw-admin grade: 'stable' confinement: strict layout: /etc/fonts: bind: $SNAP/etc/fonts /usr/share/fonts: bind: $SNAP/usr/share/fonts /usr/local/share/OpenZWave: bind: $SNAP/usr/local/share/OpenZWave package-repositories: - type: apt components: [main] suites: [xenial] key-id: C65D51784EDC19A871DBDBB710C56D0DE9977759 url: http://ppa.launchpad.net/beineri/opt-qt-5.12.8-xenial/ubuntu - type: apt formats: [deb] components: [main] suites: [xenial-security] key-id: 40976EAF437D05B5 url: http://security.ubuntu.com/ubuntu - type: apt ppa: deadsnakes/ppa plugs: ozw-config: interface: content content: ozw-config target: $SNAP/usr/local/share/OpenZWave/ozw-admin default-provider: ozwdaemon ozw-db: interface: content content: ozw-db target: $SNAP/usr/local/share/OpenZWave/qt-openzwavedatabase.rcc default-provider: ozwdaemon qt-ozw-lib: interface: content content: qt-ozw-lib target: $SNAP/usr/qt-ozw-lib default-provider: ozwdaemon apps: ozwadmin: command: usr/local/bin/ozwadmin command-chain: - misc/ensure-plugs - misc/wrapper common-id: ozwadmin plugs: - desktop - desktop-legacy - x11 - network - network-bind - hardware-observe - ozw-config - ozw-db - qt-ozw-lib parts: ozw-admin: plugin: make source: https://github.com/OpenZWave/ozw-admin.git source-tag: ${SNAPCRAFT_PROJECT_VERSION} parse-info: [scripts/ozwadmin.appdata.xml] build-snaps: - ozwdaemon build-packages: - appstream - build-essential - fuse - joe - libcurl4-openssl-dev - libgl1-mesa-dev - libunwind-dev - mc - mesa-common-dev - pkgconf - python3.8 - rapidjson-dev - qt512-meta-minimal - libqt5remoteobjects5-dev - libqt5serialport5-dev - libqt5svg5-dev - libqt5websockets5-dev stage-packages: - libdouble-conversion3 - libfreetype6 - libgl1 - libglvnd0 - libglx0 - libgraphite2-3 - libharfbuzz0b - libicu66 - libpcre2-16-0 - libpng16-16 - libqt5core5a - libqt5gui5 - libqt5network5 - libqt5serialport5 - libqt5svg5 - libqt5widgets5 - libqt5xml5 - libx11-6 - libxau6 - libxcb1 - libxdmcp6 - libgl1-mesa-dri - mesa-utils override-build: | cp ${SNAPCRAFT_PART_BUILD}/scripts/ozwadmin.png "${SNAPCRAFT_PART_INSTALL}" if [ -f "Makefile" ]; then echo "Clean $SNAPCRAFT_PART_BUILD" qmake -r make distclean fi # Lets go dummy to mimic ozw-admin's expected directory layout OZWD_SNAP_PATH="/snap/ozwdaemon/current/" DUMMY_DIR="${HOME}/dummy" rm -rf "${DUMMY_DIR}" mkdir -p "${DUMMY_DIR}/lib" QTOZW_LIB_PATH="$(dirname $(find ${OZWD_SNAP_PATH} -name libqt-openzwave.so -print0 -quit))" ln -sf "$QTOZW_LIB_PATH" "${DUMMY_DIR}/lib/qt-openzwave" mkdir -p "${DUMMY_DIR}/include" QTOZW_INCLUDE_PATH="$(dirname $(find ${OZWD_SNAP_PATH} -name qtopenzwave.h -print0 -quit))" ln -sf "$QTOZW_INCLUDE_PATH" "${DUMMY_DIR}/include/qt-openzwave" mkdir "${DUMMY_DIR}/lib/qt-openzwavedatabase" QTOZW_DB_PATH="$(find ${OZWD_SNAP_PATH} -name qt-openzwavedatabase.rcc -print0 -quit)" ln -sf "$QTOZW_DB_PATH" "${DUMMY_DIR}/lib/qt-openzwavedatabase/" # Dummy life over, lets link OpenZWave files OZW_LIB_PATH="$(dirname $(find ${OZWD_SNAP_PATH} -name libopenzwave.so -print0 -quit))" OZW_INCLUDE_PATH="$(dirname $(find ${OZWD_SNAP_PATH} -name Manager.h -print0 -quit))" OZW_DATABASE_PATH="$(dirname $(find ${OZWD_SNAP_PATH} -name manufacturer_specific.xml))" qmake -r "CONFIG+=release" \ QTOZW_LIB_PATH="${DUMMY_DIR}/lib/" \ QTOZW_INCLUDE_PATH="${DUMMY_DIR}/include" \ OZW_LIB_PATH="${OZW_LIB_PATH}" \ OZW_INCLUDE_PATH="${OZW_INCLUDE_PATH}" \ OZW_DATABASE_PATH="${OZW_DATABASE_PATH}" QTOZW_LIB_PATH="" make -j$(nproc) make -j$(nproc) install INSTALL_ROOT="${SNAPCRAFT_PART_INSTALL}" organize: ozwadmin.png: meta/gui/ozwadmin.png filesets: ozwadmin-usr: - usr/bin - usr/include - usr/local - usr/share - usr/lib/X11 - usr/lib/*/libQt5SerialPort* - usr/lib/*/libQt5Svg* - usr/lib/*/libQt5Xml* - usr/lib/*/qt5/plugins/iconengines - usr/lib/*/qt5/plugins/imageformats/libqsvg.so stage: - $ozwadmin-usr - etc/ - lib*/* - meta/ wrapper: plugin: dump source: src/wrapper source-type: local organize: ensure-plugs: misc/ensure-plugs wrapper: misc/wrapper splash-screen: plugin: python source: src/python source-type: local python-packages: - wheel requirements: - requirements.txt build-packages: - python3-dev - python3-setuptools - python3-wheel - python3-pip stage-packages: - libgl1-mesa-dri - mesa-utils - libfreetype6 - libfontconfig1 - libxcb-icccm4 - libxcb-image0 - libxcb-keysyms1 - libxcb-randr0 - libxcb-render-util0 - libxcb-shape0 - libxcb-xinerama0 - libxcb-xkb1 - libxcb-sync1 - libxcb-xfixes0 - libxcb-shm0 - libxkbcommon-x11-0 stage: - bin/ - etc/ - lib*/* - share/ - usr/ - pyvenv.cfg