From 0397b0b2731ff7dd3a66c3b96bb8bbf64f62e983 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sat, 19 Jun 2021 00:06:57 +0200 Subject: [PATCH 1/5] Docker: improve build reproducibility --- .dockerignore | 3 +- Dockerfile | 699 +++++++++--------- contrib/build-deps/Dockerfile.linux-builddeps | 35 + contrib/build-deps/get-packages.sh | 17 + contrib/build-deps/sources.list | 9 + contrib/build-deps/verify-packages.sh | 34 + 6 files changed, 458 insertions(+), 339 deletions(-) create mode 100644 contrib/build-deps/Dockerfile.linux-builddeps create mode 100644 contrib/build-deps/get-packages.sh create mode 100644 contrib/build-deps/sources.list create mode 100644 contrib/build-deps/verify-packages.sh diff --git a/.dockerignore b/.dockerignore index 01a8d7c..8a57c81 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ * !contrib/Qt5.15_LinuxPatch.json -!utils/pubkeys/* \ No newline at end of file +!utils/pubkeys/* +!contrib/build-deps/verify-packages.sh \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index d7b0eee..834250f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,7 @@ -FROM ubuntu:18.04 AS tor +# bionic-20210615.1 (18.04) +FROM ubuntu@sha256:ce1e17c0e0aa9db95cf19fb6ba297eb2a52b9ba71768f32a74ab39213c416600 + +ARG THREADS=1 ENV CFLAGS="-fPIC" ENV CPPFLAGS="-fPIC" @@ -6,21 +9,334 @@ ENV CXXFLAGS="-fPIC" ENV SOURCE_DATE_EPOCH=1397818193 ENV DEBIAN_FRONTEND=noninteractive +# Feather build flags +ENV CHECK_UPDATES=ON + +COPY --from=featherwallet/feather-deps:linux-beta-8 /deps /deps +COPY --from=featherwallet/feather-deps:linux-beta-8 /var/cache/apt/archives /archives + RUN apt-get update && \ - apt-get install -y build-essential wget git automake pkg-config python python3 && \ + apt-get install -y gpg xz-utils ca-certificates wget && \ rm -rf /var/lib/apt/lists/* -RUN wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz && \ - echo "892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5 openssl-1.1.1k.tar.gz" | sha256sum -c && \ - tar -xzf openssl-1.1.1k.tar.gz && \ - rm openssl-1.1.1k.tar.gz && \ - cd openssl-1.1.1k && \ +COPY contrib/build-deps/verify-packages.sh . +RUN bash verify-packages.sh && rm -rf /deps /archives + +# OpenSSL: Required for CMake, Qt 5.15.2, libwallet, Tor +ENV OPENSSL_ROOT_DIR=/usr/local/openssl/ +RUN git clone -b OpenSSL_1_1_1k --depth 1 https://github.com/openssl/openssl.git && \ + cd openssl && \ + git reset --hard fd78df59b0f656aefe96e39533130454aa957c00 && \ ./config no-shared no-dso --prefix=/usr/local/openssl && \ make -j$THREADS && \ - make test && \ make -j$THREADS install_sw && \ rm -rf $(pwd) +# CMake: Required to build libqrencode, monero-seed, libzip +RUN git clone -b v3.18.4 --depth 1 https://github.com/Kitware/CMake && \ + cd CMake && \ + git reset --hard 3cc3d42aba879fff5e85b363ae8f21386a3f9f9b && \ + ./bootstrap && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# xorg-macros: Required for xorgproto, other xcb libs +RUN git clone -b util-macros-1.19.3 --depth 1 https://gitlab.freedesktop.org/xorg/util/macros.git && \ + cd macros && \ + git reset --hard b8766308d2f78bc572abe5198007cf7aeec9b761 && \ + ./autogen.sh --prefix=/usr && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# xorgproto: Required for Qt 5.15.2 +RUN git clone -b xorgproto-2020.1 --depth 1 https://gitlab.freedesktop.org/xorg/proto/xorgproto && \ + cd xorgproto && \ + git reset --hard c62e8203402cafafa5ba0357b6d1c019156c9f36 && \ + ./autogen.sh && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# xcbproto: Required for Qt 5.15.2 +RUN git clone -b xcb-proto-1.14.1 --depth 1 https://gitlab.freedesktop.org/xorg/proto/xcbproto && \ + cd xcbproto && \ + git reset --hard 496e3ce329c3cc9b32af4054c30fa0f306deb007 && \ + ./autogen.sh && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# libxau: Required for Qt 5.15.2 +RUN git clone -b libXau-1.0.9 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxau && \ + cd libxau && \ + git reset --hard d9443b2c57b512cfb250b35707378654d86c7dea && \ + ./autogen.sh --enable-shared --disable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# pthread-stubs: Required for libxcb +RUN git clone -b 0.4 --depth 1 https://gitlab.freedesktop.org/xorg/lib/pthread-stubs.git && \ + cd pthread-stubs && \ + git reset --hard 50f0755a7f894acae168f19c66e52a3f139ca4ec && \ + ./autogen.sh && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# libxcb: Required for Qt 5.15 +RUN git clone -b libxcb-1.14 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb && \ + cd libxcb && \ + git reset --hard 4b40b44cb6d088b6ffa2fb5cf3ad8f12da588cef && \ + ./autogen.sh --enable-shared --disable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# libxcb-util: Required for Qt 5.15 +RUN git clone -b 0.4.0 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-util && \ + cd libxcb-util && \ + git reset --hard acf790d7752f36e450d476ad79807d4012ec863b && \ + git submodule init && \ + git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ + git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ + ./autogen.sh --enable-shared --disable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# libxcb-image: Required for Qt 5.15 +RUN git clone -b 0.4.0 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-image && \ + cd libxcb-image && \ + git reset --hard d882052fb2ce439c6483fce944ba8f16f7294639 && \ + git submodule init && \ + git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ + git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ + ./autogen.sh --enable-shared --disable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# libxcb-keysyms: Required for Qt 5.15 +RUN git clone -b 0.4.0 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-keysyms && \ + cd libxcb-keysyms && \ + git reset --hard 0e51ee5570a6a80bdf98770b975dfe8a57f4eeb1 && \ + git submodule init && \ + git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ + git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ + ./autogen.sh --enable-shared --disable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# libxcb-render-util: Required for Qt 5.15 +RUN git clone -b 0.3.9 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-render-util && \ + cd libxcb-render-util && \ + git reset --hard 0317caf63de532fd7a0493ed6afa871a67253747 && \ + git submodule init && \ + git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ + git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ + ./autogen.sh --enable-shared --disable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# libxcb-wm: Required for Qt 5.15 +RUN git clone -b 0.4.1 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-wm && \ + cd libxcb-wm && \ + git reset --hard 24eb17df2e1245885e72c9d4bbb0a0f69f0700f2 && \ + git submodule init && \ + git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ + git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ + ./autogen.sh --enable-shared --disable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# libkcbcommon: Required for Qt 5.15 +RUN git clone -b xkbcommon-0.5.0 --depth 1 https://github.com/xkbcommon/libxkbcommon && \ + cd libxkbcommon && \ + git reset --hard c43c3c866eb9d52cd8f61e75cbef1c30d07f3a28 && \ + ./autogen.sh --prefix=/usr --enable-shared --disable-static --enable-x11 --disable-docs && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# libXext: Required for Qt 5.15 +RUN git clone -b libXext-1.3.4 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxext.git && \ + cd libxext && \ + git reset --hard ebb167f34a3514783966775fb12573c4ed209625 && \ + ./autogen.sh --enable-shared --disable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# freetype2: Required for Qt 5.15 +RUN git clone -b VER-2-10-2 --depth 1 https://git.savannah.gnu.org/git/freetype/freetype2.git && \ + cd freetype2 && \ + git reset --hard 132f19b779828b194b3fede187cee719785db4d8 && \ + ./autogen.sh && \ + ./configure --disable-shared --enable-static --with-zlib=no && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# expat: Required for fontconfig +RUN git clone -b R_2_2_9 --depth 1 https://github.com/libexpat/libexpat && \ + cd libexpat/expat && \ + git reset --hard a7bc26b69768f7fb24f0c7976fae24b157b85b13 && \ + ./buildconf.sh && \ + ./configure --disable-shared --enable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# fontconfig: Required for Qt 5.15 +RUN git clone -b 2.13.92 --depth 1 https://gitlab.freedesktop.org/fontconfig/fontconfig && \ + cd fontconfig && \ + git reset --hard b1df1101a643ae16cdfa1d83b939de2497b1bf27 && \ + ./autogen.sh --disable-shared --enable-static --sysconfdir=/etc --localstatedir=/var && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +ENV QT_VERSION=v5.15.2 +RUN git clone git://code.qt.io/qt/qt5.git -b ${QT_VERSION} --depth 1 && \ + cd qt5 && \ + git clone git://code.qt.io/qt/qtbase.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qtimageformats.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qtmultimedia.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qtsvg.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qttools.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qttranslations.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qtx11extras.git -b ${QT_VERSION} --depth 1 && \ + git clone git://code.qt.io/qt/qtwebsockets.git -b ${QT_VERSION} --depth 1 && \ + sed -ri s/\(Libs:.*\)/\\1\ -lexpat/ /usr/local/lib/pkgconfig/fontconfig.pc && \ + sed -ri s/\(Libs:.*\)/\\1\ -lz/ /usr/local/lib/pkgconfig/freetype2.pc && \ + sed -ri s/\(Libs:.*\)/\\1\ -lXau/ /usr/local/lib/pkgconfig/xcb.pc && \ + sed -i s/\\/usr\\/X11R6\\/lib64/\\/usr\\/local\\/lib/ qtbase/mkspecs/linux-g++-64/qmake.conf + +RUN cd qt5 && \ + rm /usr/lib/x86_64-linux-gnu/libX11.a && \ + rm /usr/lib/x86_64-linux-gnu/libX11-xcb.a && \ + OPENSSL_LIBS="-lssl -lcrypto -lpthread -ldl" \ + ./configure --prefix=/usr -platform linux-g++-64 -opensource -confirm-license -release -static -no-avx \ + -no-opengl -qpa xcb --xcb -xcb-xlib -feature-xlib -openssl-linked -I /usr/local/openssl/include \ + -L /usr/local/openssl/lib -system-freetype -fontconfig -glib \ + -no-dbus -no-sql-sqlite -no-use-gold-linker -no-kms \ + -qt-harfbuzz -qt-libjpeg -qt-libpng -qt-pcre -qt-zlib \ + -skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d \ + -skip qtdoc -skip qtquickcontrols -skip qtquickcontrols2 -skip qtspeech -skip qtgamepad \ + -skip qtlocation -skip qtmacextras -skip qtnetworkauth -skip qtpurchasing -optimize-size \ + -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttools \ + -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebview \ + -skip qtwinextras -skip qtx11extras -skip gamepad -skip serialbus -skip location -skip webengine \ + -skip qtdeclarative -gstreamer \ + -no-feature-cups -no-feature-ftp -no-feature-pdf -no-feature-animation \ + -nomake examples -nomake tests -nomake tools && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# boost: Required for libwallet +RUN wget https://downloads.sourceforge.net/project/boost/boost/1.73.0/boost_1_73_0.tar.bz2 && \ + echo "4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402 boost_1_73_0.tar.bz2" | sha256sum -c && \ + tar -xvf boost_1_73_0.tar.bz2 && \ + rm boost_1_73_0.tar.bz2 && \ + cd boost_1_73_0 && \ + ./bootstrap.sh && \ + ./b2 --with-atomic --with-system --with-filesystem --with-thread --with-date_time --with-chrono --with-regex --with-serialization --with-program_options --with-locale variant=release link=static runtime-link=static cflags="${CFLAGS}" cxxflags="${CXXFLAGS}" install -a --prefix=/usr && \ + rm -rf $(pwd) + +# libusb: Required for libwallet +RUN git clone -b v1.0.24 --depth 1 https://github.com/libusb/libusb && \ + cd libusb && \ + git reset --hard c6a35c56016ea2ab2f19115d2ea1e85e0edae155 && \ + ./autogen.sh --disable-shared --enable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# hidapi: Required for libwallet +RUN git clone -b hidapi-0.10.1 --depth 1 https://github.com/libusb/hidapi && \ + cd hidapi && \ + git reset --hard f6d0073fcddbdda24549199445e844971d3c9cef && \ + ./bootstrap && \ + ./configure --disable-shared --enable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# libsodium: Required for libzmq +RUN git clone -b 1.0.18-RELEASE --depth 1 https://github.com/jedisct1/libsodium.git && \ + cd libsodium && \ + git reset --hard 940ef42797baa0278df6b7fd9e67c7590f87744b && \ + ./autogen.sh && \ + ./configure --disable-shared --enable-static && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# libzmq: Required for libwallet +RUN git clone -b v4.3.2 --depth 1 https://github.com/zeromq/libzmq && \ + cd libzmq && \ + git reset --hard a84ffa12b2eb3569ced199660bac5ad128bff1f0 && \ + ./autogen.sh && \ + ./configure --disable-shared --enable-static --disable-libunwind --with-libsodium && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# protobuf: Required for libwallet +RUN git clone -b v3.10.0 --depth 1 https://github.com/protocolbuffers/protobuf && \ + cd protobuf && \ + git reset --hard 6d4e7fd7966c989e38024a8ea693db83758944f1 && \ + ./autogen.sh && \ + ./configure --enable-static --disable-shared && \ + make -j$THREADS && \ + make -j$THREADS install && \ + rm -rf $(pwd) + +# appimagetool: Used to created Feather AppImage +RUN mkdir appimagetool && \ + cd appimagetool && \ + wget https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage && \ + echo "d918b4df547b388ef253f3c9e7f6529ca81a885395c31f619d9aaf7030499a13 appimagetool-x86_64.AppImage" | sha256sum -c && \ + chmod +x appimagetool-x86_64.AppImage && \ + ./appimagetool-x86_64.AppImage --appimage-extract && \ + rm appimagetool-x86_64.AppImage + +# squashfs-tools: Used to create Feather AppImage +RUN git clone https://github.com/plougher/squashfs-tools.git && \ + cd squashfs-tools/squashfs-tools && \ + git reset --hard 38fa0720526222827da44b3b6c3f7eb63e8f5c2f && \ + make && \ + make install && \ + rm -rf $(pwd) + +# patchelf: Required by linuxdeployqt +RUN git clone -b 0.12 --depth 1 https://github.com/NixOS/patchelf.git && \ + cd patchelf && \ + git reset --hard 8d3a16e97294e3c5521c61b4c8835499c9918264 && \ + ./bootstrap.sh && \ + ./configure && \ + make -j$THREADS && \ + make install && \ + rm -rf $(pwd) + +# linuxdeployqt: Used to create Feather AppImage +# build from source because latest release does not allow glib 2.27 +RUN git clone https://github.com/probonopd/linuxdeployqt.git && \ + cd linuxdeployqt && \ + git reset --hard b4697483c98120007019c3456914cfd1dba58384 && \ + qmake && \ + make -j$THREADS && \ + make install && \ + rm -rf $(pwd) + +# libevent: Required for Tor RUN wget https://github.com/libevent/libevent/releases/download/release-2.1.12-stable/libevent-2.1.12-stable.tar.gz && \ echo "92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb libevent-2.1.12-stable.tar.gz" | sha256sum -c && \ tar -zxvf libevent-2.1.12-stable.tar.gz && \ @@ -34,6 +350,7 @@ RUN wget https://github.com/libevent/libevent/releases/download/release-2.1.12-s make -j$THREADS install && \ rm -rf $(pwd) +# zlib: Required for Tor RUN git clone -b v1.2.11 --depth 1 https://github.com/madler/zlib && \ cd zlib && \ git reset --hard cacf7f1d4e3d44d871b605da3b647f07d718623f && \ @@ -42,6 +359,9 @@ RUN git clone -b v1.2.11 --depth 1 https://github.com/madler/zlib && \ make -j$THREADS install && \ rm -rf $(pwd) +# Tor: Optional for Feather (-DTOR_BIN) +# Binary can be embedded in Feather +ENV TOR_BIN=/usr/local/tor/bin/tor RUN git clone -b tor-0.4.5.7 --depth 1 https://git.torproject.org/tor.git && \ cd tor && \ git reset --hard 83f895c015de55201e5f226f84a866f30f5ee14b && \ @@ -66,292 +386,37 @@ RUN git clone -b tor-0.4.5.7 --depth 1 https://git.torproject.org/tor.git && \ rm -rf $(pwd) && \ strip -s -D /usr/local/tor/bin/tor -FROM ubuntu:16.04 - -ARG THREADS=1 -ARG QT_VERSION=v5.15.2 - -ENV CFLAGS="-fPIC" -ENV CPPFLAGS="-fPIC" -ENV CXXFLAGS="-fPIC" -ENV SOURCE_DATE_EPOCH=1397818193 - -ENV OPENSSL_ROOT_DIR=/usr/local/openssl/ -ENV TOR_BIN=/usr/local/tor/bin/tor - -COPY --from=tor ${TOR_BIN} /usr/local/tor/bin/tor - -RUN apt-get update && \ - apt-get install -y \ -# dev tools - nano vim ccache \ -# build tools - software-properties-common automake pkg-config python \ - libtool-bin wget zip \ -# Qt - libgl1-mesa-dev libglib2.0-dev mesa-common-dev \ -# libusb - libudev-dev \ -# fontconfig - autopoint gettext gperf libpng12-dev \ -# libxcb - libpthread-stubs0-dev \ -# xorgproto - xutils-dev \ -# libxkbcommon - bison \ -# zeromq - libsodium-dev \ -# AppImage tools - file squashfs-tools desktop-file-utils patchelf - -RUN add-apt-repository ppa:git-core/ppa && \ - apt-get update && \ - apt-get install -y git && \ - rm -rf /var/lib/apt/lists/* - -RUN wget http://archive.ubuntu.com/ubuntu/pool/main/s/systemd/libudev-dev_229-4ubuntu21.31_amd64.deb && \ - echo "f1f72bd814d1e8ca2828ac004924fba0b54a3299e60f089c6d818262b11750f7 libudev-dev_229-4ubuntu21.31_amd64.deb" | sha256sum -c && \ - apt install ./libudev-dev_229-4ubuntu21.31_amd64.deb && \ - rm libudev-dev_229-4ubuntu21.31_amd64.deb - -RUN mkdir appimagetool && \ - cd appimagetool && \ - wget https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage && \ - echo "d918b4df547b388ef253f3c9e7f6529ca81a885395c31f619d9aaf7030499a13 appimagetool-x86_64.AppImage" | sha256sum -c && \ - chmod +x appimagetool-x86_64.AppImage && \ - ./appimagetool-x86_64.AppImage --appimage-extract && \ - rm appimagetool-x86_64.AppImage - -RUN git clone -b xorgproto-2020.1 --depth 1 https://gitlab.freedesktop.org/xorg/proto/xorgproto && \ - cd xorgproto && \ - git reset --hard c62e8203402cafafa5ba0357b6d1c019156c9f36 && \ - ./autogen.sh && \ +# libqrencode: Required for Feather +# Used to display QR Codes +RUN git clone -b v4.1.1 --depth 1 https://github.com/fukuchi/libqrencode.git && \ + cd libqrencode && \ + git reset --hard 715e29fd4cd71b6e452ae0f4e36d917b43122ce8 && \ + cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr . && \ make -j$THREADS && \ make -j$THREADS install && \ rm -rf $(pwd) -RUN git clone -b 1.12 --depth 1 https://gitlab.freedesktop.org/xorg/proto/xcbproto && \ - cd xcbproto && \ - git reset --hard 6398e42131eedddde0d98759067dde933191f049 && \ - ./autogen.sh && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b libXau-1.0.9 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxau && \ - cd libxau && \ - git reset --hard d9443b2c57b512cfb250b35707378654d86c7dea && \ - ./autogen.sh --enable-shared --disable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b 1.12 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb && \ - cd libxcb && \ - git reset --hard d34785a34f28fa6a00f8ce00d87e3132ff0f6467 && \ - ./autogen.sh --enable-shared --disable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - make -j$THREADS clean && \ - rm /usr/local/lib/libxcb-xinerama.so && \ - ./autogen.sh --disable-shared --enable-static && \ - make -j$THREADS && \ - cp src/.libs/libxcb-xinerama.a /usr/local/lib/ && \ - rm -rf $(pwd) - -RUN git clone -b 0.4.0 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-util && \ - cd libxcb-util && \ - git reset --hard acf790d7752f36e450d476ad79807d4012ec863b && \ - git submodule init && \ - git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ - git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ - ./autogen.sh --enable-shared --disable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b 0.4.0 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-image && \ - cd libxcb-image && \ - git reset --hard d882052fb2ce439c6483fce944ba8f16f7294639 && \ - git submodule init && \ - git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ - git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ - ./autogen.sh --enable-shared --disable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b 0.4.0 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-keysyms && \ - cd libxcb-keysyms && \ - git reset --hard 0e51ee5570a6a80bdf98770b975dfe8a57f4eeb1 && \ - git submodule init && \ - git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ - git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ - ./autogen.sh --enable-shared --disable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b 0.3.9 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-render-util && \ - cd libxcb-render-util && \ - git reset --hard 0317caf63de532fd7a0493ed6afa871a67253747 && \ - git submodule init && \ - git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ - git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ - ./autogen.sh --enable-shared --disable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b 0.4.1 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-wm && \ - cd libxcb-wm && \ - git reset --hard 24eb17df2e1245885e72c9d4bbb0a0f69f0700f2 && \ - git submodule init && \ - git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ - git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ - ./autogen.sh --enable-shared --disable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b xkbcommon-0.5.0 --depth 1 https://github.com/xkbcommon/libxkbcommon && \ - cd libxkbcommon && \ - git reset --hard c43c3c866eb9d52cd8f61e75cbef1c30d07f3a28 && \ - ./autogen.sh --prefix=/usr --enable-shared --disable-static --enable-x11 --disable-docs && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b v1.2.11 --depth 1 https://github.com/madler/zlib && \ - cd zlib && \ - git reset --hard cacf7f1d4e3d44d871b605da3b647f07d718623f && \ - ./configure --static --prefix=/usr/local/zlib && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b VER-2-10-2 --depth 1 https://git.savannah.gnu.org/git/freetype/freetype2.git && \ - cd freetype2 && \ - git reset --hard 132f19b779828b194b3fede187cee719785db4d8 && \ - ./autogen.sh && \ - ./configure --disable-shared --enable-static --with-zlib=no && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b R_2_2_9 --depth 1 https://github.com/libexpat/libexpat && \ - cd libexpat/expat && \ - git reset --hard a7bc26b69768f7fb24f0c7976fae24b157b85b13 && \ - ./buildconf.sh && \ - ./configure --disable-shared --enable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b 2.13.92 --depth 1 https://gitlab.freedesktop.org/fontconfig/fontconfig && \ - cd fontconfig && \ - git reset --hard b1df1101a643ae16cdfa1d83b939de2497b1bf27 && \ - ./autogen.sh --disable-shared --enable-static --sysconfdir=/etc --localstatedir=/var && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b release-64-2 --depth 1 https://github.com/unicode-org/icu && \ - cd icu/icu4c/source && \ - git reset --hard e2d85306162d3a0691b070b4f0a73e4012433444 && \ - ./configure --disable-shared --enable-static --disable-tests --disable-samples && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN wget https://downloads.sourceforge.net/project/boost/boost/1.73.0/boost_1_73_0.tar.bz2 && \ - echo "4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402 boost_1_73_0.tar.bz2" | sha256sum -c && \ - tar -xvf boost_1_73_0.tar.bz2 && \ - rm boost_1_73_0.tar.bz2 && \ - cd boost_1_73_0 && \ - ./bootstrap.sh && \ - ./b2 --with-atomic --with-system --with-filesystem --with-thread --with-date_time --with-chrono --with-regex --with-serialization --with-program_options --with-locale variant=release link=static runtime-link=static cflags="${CFLAGS}" cxxflags="${CXXFLAGS}" install -a --prefix=/usr && \ - rm -rf $(pwd) - -RUN wget https://www.openssl.org/source/openssl-1.1.1k.tar.gz && \ - echo "892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5 openssl-1.1.1k.tar.gz" | sha256sum -c && \ - tar -xzf openssl-1.1.1k.tar.gz && \ - rm openssl-1.1.1k.tar.gz && \ - cd openssl-1.1.1k && \ - ./config no-shared no-dso --prefix=/usr/local/openssl && \ - make -j$THREADS && \ - make test && \ - make -j$THREADS install_sw && \ - rm -rf $(pwd) - -RUN rm /usr/lib/x86_64-linux-gnu/libX11.a && \ - rm /usr/lib/x86_64-linux-gnu/libXext.a && \ - rm /usr/lib/x86_64-linux-gnu/libX11-xcb.a && \ - git clone git://code.qt.io/qt/qt5.git -b ${QT_VERSION} --depth 1 && \ - cd qt5 && \ - git clone git://code.qt.io/qt/qtbase.git -b ${QT_VERSION} --depth 1 && \ - git clone git://code.qt.io/qt/qtimageformats.git -b ${QT_VERSION} --depth 1 && \ - git clone git://code.qt.io/qt/qtmultimedia.git -b ${QT_VERSION} --depth 1 && \ - git clone git://code.qt.io/qt/qtsvg.git -b ${QT_VERSION} --depth 1 && \ - git clone git://code.qt.io/qt/qttools.git -b ${QT_VERSION} --depth 1 && \ - git clone git://code.qt.io/qt/qttranslations.git -b ${QT_VERSION} --depth 1 && \ - git clone git://code.qt.io/qt/qtx11extras.git -b ${QT_VERSION} --depth 1 && \ - git clone git://code.qt.io/qt/qtwebsockets.git -b ${QT_VERSION} --depth 1 && \ - sed -ri s/\(Libs:.*\)/\\1\ -lexpat/ /usr/local/lib/pkgconfig/fontconfig.pc && \ - sed -ri s/\(Libs:.*\)/\\1\ -lz/ /usr/local/lib/pkgconfig/freetype2.pc && \ - sed -ri s/\(Libs:.*\)/\\1\ -lXau/ /usr/local/lib/pkgconfig/xcb.pc && \ - sed -i s/\\/usr\\/X11R6\\/lib64/\\/usr\\/local\\/lib/ qtbase/mkspecs/linux-g++-64/qmake.conf && \ - OPENSSL_LIBS="-lssl -lcrypto -lpthread -ldl" \ - ./configure --prefix=/usr -platform linux-g++-64 -opensource -confirm-license -release -static -no-avx \ - -no-opengl -qpa xcb --xcb -xcb-xlib -feature-xlib -openssl-linked -I /usr/local/openssl/include \ - -L /usr/local/openssl/lib -system-freetype -fontconfig -glib \ - -no-dbus -no-sql-sqlite -no-use-gold-linker -no-kms \ - -qt-harfbuzz -qt-libjpeg -qt-libpng -qt-pcre -qt-zlib \ - -skip qt3d -skip qtandroidextras -skip qtcanvas3d -skip qtcharts -skip qtconnectivity -skip qtdatavis3d \ - -skip qtdoc -skip qtquickcontrols -skip qtquickcontrols2 -skip qtspeech -skip qtgamepad \ - -skip qtlocation -skip qtmacextras -skip qtnetworkauth -skip qtpurchasing -optimize-size \ - -skip qtscript -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qttools \ - -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebengine -skip qtwebview \ - -skip qtwinextras -skip qtx11extras -skip gamepad -skip serialbus -skip location -skip webengine \ - -skip qtdeclarative \ - -no-feature-cups -no-feature-ftp -no-feature-pdf -no-feature-animation \ - -nomake examples -nomake tests -nomake tools && \ - make -j$THREADS && \ - make -j$THREADS install && \ - cd qttools/src/linguist/lrelease && \ - ../../../../qtbase/bin/qmake && \ - make -j$THREADS && \ - make -j$THREADS install && \ - cd ../../../.. && \ - rm -rf $(pwd) - -RUN git clone -b v1.0.24 --depth 1 https://github.com/libusb/libusb && \ - cd libusb && \ - git reset --hard c6a35c56016ea2ab2f19115d2ea1e85e0edae155 && \ - ./autogen.sh --disable-shared --enable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b hidapi-0.10.1 --depth 1 https://github.com/libusb/hidapi && \ - cd hidapi && \ - git reset --hard f6d0073fcddbdda24549199445e844971d3c9cef && \ - ./bootstrap && \ - ./configure --disable-shared --enable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b v4.3.2 --depth 1 https://github.com/zeromq/libzmq && \ - cd libzmq && \ - git reset --hard a84ffa12b2eb3569ced199660bac5ad128bff1f0 && \ - ./autogen.sh && \ - ./configure --disable-shared --enable-static --disable-libunwind --with-libsodium && \ +# monero-seed: Required for Feather +# Tevador's 14 word seed library +RUN git clone https://git.featherwallet.org/feather/monero-seed.git && \ + cd monero-seed && \ + git reset --hard 4674ef09b6faa6fe602ab5ae0b9ca8e1fd7d5e1b && \ + cmake -DCMAKE_BUILD_TYPE=Release -Bbuild && \ + make -Cbuild -j$THREADS && \ + make -Cbuild install && \ + rm -rf $(pwd) + +# libzip: Required for Feather +# Used to unzip updates downloaded by the built-in updater +RUN git clone -b v1.7.3 --depth 1 https://github.com/nih-at/libzip.git && \ + cd libzip && \ + git reset --hard 66e496489bdae81bfda8b0088172871d8fda0032 && \ + cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr . && \ make -j$THREADS && \ make -j$THREADS install && \ rm -rf $(pwd) +# libgpg-error: Required for libgcrypt RUN git clone -b libgpg-error-1.38 --depth 1 git://git.gnupg.org/libgpg-error.git && \ cd libgpg-error && \ git reset --hard 71d278824c5fe61865f7927a2ed1aa3115f9e439 && \ @@ -361,6 +426,8 @@ RUN git clone -b libgpg-error-1.38 --depth 1 git://git.gnupg.org/libgpg-error.gi make -j$THREADS install && \ rm -rf $(pwd) +# libgcrypt: Required for Feather +# Used in src/openpgp to verify updates downloaded by the built-in updater RUN git clone -b libgcrypt-1.8.5 --depth 1 git://git.gnupg.org/libgcrypt.git && \ cd libgcrypt && \ git reset --hard 56606331bc2a80536db9fc11ad53695126007298 && \ @@ -370,57 +437,13 @@ RUN git clone -b libgcrypt-1.8.5 --depth 1 git://git.gnupg.org/libgcrypt.git && make -j$THREADS install && \ rm -rf $(pwd) -RUN git clone -b v3.10.0 --depth 1 https://github.com/protocolbuffers/protobuf && \ - cd protobuf && \ - git reset --hard 6d4e7fd7966c989e38024a8ea693db83758944f1 && \ - ./autogen.sh && \ - ./configure --enable-static --disable-shared && \ +# zbar: Optional for Feather (-DWITH_SCANNER) +# Used to scan for QR Codes +RUN git clone -b stable-0.21 --recursive https://github.com/mchehab/zbar.git && \ + cd zbar && \ + git reset --hard 505f1a87b32cb7bb0edbaf37e20ccdd46bbae2a3 && \ + autoreconf -vfi && \ + ./configure --enable-static --disable-shared --without-imagemagick --with-gtk=no --with-python=no --enable-doc=no && \ make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b v3.18.4 --depth 1 https://github.com/Kitware/CMake && \ - cd CMake && \ - git reset --hard 3cc3d42aba879fff5e85b363ae8f21386a3f9f9b && \ - ./bootstrap && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone -b v4.1.1 --depth 1 https://github.com/fukuchi/libqrencode.git && \ - cd libqrencode && \ - git reset --hard 715e29fd4cd71b6e452ae0f4e36d917b43122ce8 && \ - cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr . && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -RUN git clone https://git.featherwallet.org/feather/monero-seed.git && \ - cd monero-seed && \ - git reset --hard 4674ef09b6faa6fe602ab5ae0b9ca8e1fd7d5e1b && \ - cmake -DCMAKE_BUILD_TYPE=Release -Bbuild && \ - make -Cbuild -j$THREADS && \ - make -Cbuild install && \ - rm -rf $(pwd) - -RUN git clone https://github.com/plougher/squashfs-tools.git && \ - cd squashfs-tools/squashfs-tools && \ - git reset --hard 38fa0720526222827da44b3b6c3f7eb63e8f5c2f && \ - make && \ make install && \ - rm -rf $(pwd) - -RUN mkdir linuxdeployqt && \ - cd linuxdeployqt && \ - wget https://github.com/probonopd/linuxdeployqt/releases/download/7/linuxdeployqt-7-x86_64.AppImage && \ - echo "645276306a801d7154d59e5b4b3c2fac3d34e09be57ec31f6d9a09814c6c162a linuxdeployqt-7-x86_64.AppImage" | sha256sum -c && \ - chmod +x linuxdeployqt-7-x86_64.AppImage && \ - ./linuxdeployqt-7-x86_64.AppImage --appimage-extract && \ - rm linuxdeployqt-7-x86_64.AppImage - -RUN git clone -b v1.7.3 --depth 1 https://github.com/nih-at/libzip.git && \ - cd libzip && \ - git reset --hard 66e496489bdae81bfda8b0088172871d8fda0032 && \ - cmake -DBUILD_SHARED_LIBS=OFF -DCMAKE_INSTALL_PREFIX=/usr . && \ - make -j$THREADS && \ - make -j$THREADS install + rm -rf $(pwd) \ No newline at end of file diff --git a/contrib/build-deps/Dockerfile.linux-builddeps b/contrib/build-deps/Dockerfile.linux-builddeps new file mode 100644 index 0000000..70643f2 --- /dev/null +++ b/contrib/build-deps/Dockerfile.linux-builddeps @@ -0,0 +1,35 @@ +FROM ubuntu:18.04 + +ENV DEBIAN_FRONTEND=noninteractive + +WORKDIR /deps + +COPY sources.list /etc/apt/sources.list +RUN apt-get update && \ + apt-get install -y wget xz-utils nano + +COPY get-packages.sh . +RUN bash get-packages.sh + +RUN apt-get install -y --no-install-recommends --no-install-suggests --reinstall --download-only \ +# build tools + software-properties-common python3 build-essential automake libtool-bin git \ +# ninja + unzip \ +# GStreamer plugins + libjpeg-dev libvpx-dev libvorbis-dev \ +# fontconfig + autopoint gettext gperf libpng-dev \ +# libxkbcommon + bison \ +# Qt 5.15 + libx11-dev libx11-xcb-dev \ +# libwallet +# libudev.so is included in AppImage + libudev1 libudev-dev \ +# GStreamer + gstreamer1.0-plugins-good \ + libgstreamer1.0-dev \ + libgstreamer-plugins-base1.0-dev \ +# git dependency + libpsl5 diff --git a/contrib/build-deps/get-packages.sh b/contrib/build-deps/get-packages.sh new file mode 100644 index 0000000..8a7fbf9 --- /dev/null +++ b/contrib/build-deps/get-packages.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash +for target in bionic bionic-updates bionic-security +do + mkdir "$target" + pushd "$target" + target_uri="http://archive.ubuntu.com/ubuntu/dists/$target/" + wget "$target_uri/Release" + wget "$target_uri/Release.gpg" + for repo in main multiverse restricted universe + do + mkdir "$repo" + pushd "$repo" + wget "$target_uri/$repo/binary-amd64/Packages.xz" + popd + done + popd +done \ No newline at end of file diff --git a/contrib/build-deps/sources.list b/contrib/build-deps/sources.list new file mode 100644 index 0000000..ef27457 --- /dev/null +++ b/contrib/build-deps/sources.list @@ -0,0 +1,9 @@ +deb http://archive.ubuntu.com/ubuntu/ bionic main restricted +deb http://archive.ubuntu.com/ubuntu/ bionic-updates main restricted +deb http://archive.ubuntu.com/ubuntu/ bionic universe +deb http://archive.ubuntu.com/ubuntu/ bionic-updates universe +deb http://archive.ubuntu.com/ubuntu/ bionic multiverse +deb http://archive.ubuntu.com/ubuntu/ bionic-updates multiverse +deb http://security.ubuntu.com/ubuntu/ bionic-security main restricted +deb http://security.ubuntu.com/ubuntu/ bionic-security universe +deb http://security.ubuntu.com/ubuntu/ bionic-security multiverse \ No newline at end of file diff --git a/contrib/build-deps/verify-packages.sh b/contrib/build-deps/verify-packages.sh new file mode 100644 index 0000000..3e0ee88 --- /dev/null +++ b/contrib/build-deps/verify-packages.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -e + +cd /deps +for target in bionic bionic-updates bionic-security +do + pushd "$target" + + # Verify Releases + gpg --no-default-keyring --keyring /usr/share/keyrings/ubuntu-archive-keyring.gpg --verify Release.gpg Release + + for repo in main multiverse restricted universe + do + pushd "$repo" + + # Verify Packages.xz + sha256=`cat ../Release | grep "$repo/binary-amd64/Packages.xz" | tail -n 1 | awk '{print $1}'` + echo "$sha256 Packages.xz" | sha256sum -c + + xz -d -c Packages.xz >> ../../Packages-all + popd + done + popd +done + +# Verify individual .deb files +cd /archives +for deb in *.deb; do + file_name=`echo $deb | sed 's/[0-9]*%3a//g'` # --download-only uses this version format sometimes, not sure what that is all about + sha256=`sed -n "/\/${file_name}$"'/{:start /SHA256: /!{N;b start};//p}' /deps/Packages-all | tail -n 1 | awk '{print $2}'` + echo "$sha256 $deb" | sha256sum -c +done + +dpkg -i --force-depends *.deb \ No newline at end of file From ae61d1a99cdf1c4eefcf981e2dbd319573644183 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Wed, 23 Jun 2021 23:56:11 +0200 Subject: [PATCH 2/5] Docker: clean up x11, xcb builds --- Dockerfile | 133 ------------------ contrib/build-deps/Dockerfile.linux-builddeps | 20 ++- 2 files changed, 19 insertions(+), 134 deletions(-) diff --git a/Dockerfile b/Dockerfile index 834250f..c85013e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,138 +41,6 @@ RUN git clone -b v3.18.4 --depth 1 https://github.com/Kitware/CMake && \ make -j$THREADS install && \ rm -rf $(pwd) -# xorg-macros: Required for xorgproto, other xcb libs -RUN git clone -b util-macros-1.19.3 --depth 1 https://gitlab.freedesktop.org/xorg/util/macros.git && \ - cd macros && \ - git reset --hard b8766308d2f78bc572abe5198007cf7aeec9b761 && \ - ./autogen.sh --prefix=/usr && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -# xorgproto: Required for Qt 5.15.2 -RUN git clone -b xorgproto-2020.1 --depth 1 https://gitlab.freedesktop.org/xorg/proto/xorgproto && \ - cd xorgproto && \ - git reset --hard c62e8203402cafafa5ba0357b6d1c019156c9f36 && \ - ./autogen.sh && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -# xcbproto: Required for Qt 5.15.2 -RUN git clone -b xcb-proto-1.14.1 --depth 1 https://gitlab.freedesktop.org/xorg/proto/xcbproto && \ - cd xcbproto && \ - git reset --hard 496e3ce329c3cc9b32af4054c30fa0f306deb007 && \ - ./autogen.sh && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -# libxau: Required for Qt 5.15.2 -RUN git clone -b libXau-1.0.9 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxau && \ - cd libxau && \ - git reset --hard d9443b2c57b512cfb250b35707378654d86c7dea && \ - ./autogen.sh --enable-shared --disable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -# pthread-stubs: Required for libxcb -RUN git clone -b 0.4 --depth 1 https://gitlab.freedesktop.org/xorg/lib/pthread-stubs.git && \ - cd pthread-stubs && \ - git reset --hard 50f0755a7f894acae168f19c66e52a3f139ca4ec && \ - ./autogen.sh && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -# libxcb: Required for Qt 5.15 -RUN git clone -b libxcb-1.14 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb && \ - cd libxcb && \ - git reset --hard 4b40b44cb6d088b6ffa2fb5cf3ad8f12da588cef && \ - ./autogen.sh --enable-shared --disable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -# libxcb-util: Required for Qt 5.15 -RUN git clone -b 0.4.0 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-util && \ - cd libxcb-util && \ - git reset --hard acf790d7752f36e450d476ad79807d4012ec863b && \ - git submodule init && \ - git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ - git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ - ./autogen.sh --enable-shared --disable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -# libxcb-image: Required for Qt 5.15 -RUN git clone -b 0.4.0 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-image && \ - cd libxcb-image && \ - git reset --hard d882052fb2ce439c6483fce944ba8f16f7294639 && \ - git submodule init && \ - git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ - git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ - ./autogen.sh --enable-shared --disable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -# libxcb-keysyms: Required for Qt 5.15 -RUN git clone -b 0.4.0 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-keysyms && \ - cd libxcb-keysyms && \ - git reset --hard 0e51ee5570a6a80bdf98770b975dfe8a57f4eeb1 && \ - git submodule init && \ - git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ - git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ - ./autogen.sh --enable-shared --disable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -# libxcb-render-util: Required for Qt 5.15 -RUN git clone -b 0.3.9 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-render-util && \ - cd libxcb-render-util && \ - git reset --hard 0317caf63de532fd7a0493ed6afa871a67253747 && \ - git submodule init && \ - git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ - git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ - ./autogen.sh --enable-shared --disable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -# libxcb-wm: Required for Qt 5.15 -RUN git clone -b 0.4.1 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxcb-wm && \ - cd libxcb-wm && \ - git reset --hard 24eb17df2e1245885e72c9d4bbb0a0f69f0700f2 && \ - git submodule init && \ - git clone --depth 1 https://gitlab.freedesktop.org/xorg/util/xcb-util-m4 m4 && \ - git -C m4 reset --hard f662e3a93ebdec3d1c9374382dcc070093a42fed && \ - ./autogen.sh --enable-shared --disable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -# libkcbcommon: Required for Qt 5.15 -RUN git clone -b xkbcommon-0.5.0 --depth 1 https://github.com/xkbcommon/libxkbcommon && \ - cd libxkbcommon && \ - git reset --hard c43c3c866eb9d52cd8f61e75cbef1c30d07f3a28 && \ - ./autogen.sh --prefix=/usr --enable-shared --disable-static --enable-x11 --disable-docs && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - -# libXext: Required for Qt 5.15 -RUN git clone -b libXext-1.3.4 --depth 1 https://gitlab.freedesktop.org/xorg/lib/libxext.git && \ - cd libxext && \ - git reset --hard ebb167f34a3514783966775fb12573c4ed209625 && \ - ./autogen.sh --enable-shared --disable-static && \ - make -j$THREADS && \ - make -j$THREADS install && \ - rm -rf $(pwd) - # freetype2: Required for Qt 5.15 RUN git clone -b VER-2-10-2 --depth 1 https://git.savannah.gnu.org/git/freetype/freetype2.git && \ cd freetype2 && \ @@ -215,7 +83,6 @@ RUN git clone git://code.qt.io/qt/qt5.git -b ${QT_VERSION} --depth 1 && \ git clone git://code.qt.io/qt/qtwebsockets.git -b ${QT_VERSION} --depth 1 && \ sed -ri s/\(Libs:.*\)/\\1\ -lexpat/ /usr/local/lib/pkgconfig/fontconfig.pc && \ sed -ri s/\(Libs:.*\)/\\1\ -lz/ /usr/local/lib/pkgconfig/freetype2.pc && \ - sed -ri s/\(Libs:.*\)/\\1\ -lXau/ /usr/local/lib/pkgconfig/xcb.pc && \ sed -i s/\\/usr\\/X11R6\\/lib64/\\/usr\\/local\\/lib/ qtbase/mkspecs/linux-g++-64/qmake.conf RUN cd qt5 && \ diff --git a/contrib/build-deps/Dockerfile.linux-builddeps b/contrib/build-deps/Dockerfile.linux-builddeps index 70643f2..ca497a0 100644 --- a/contrib/build-deps/Dockerfile.linux-builddeps +++ b/contrib/build-deps/Dockerfile.linux-builddeps @@ -23,7 +23,25 @@ RUN apt-get install -y --no-install-recommends --no-install-suggests --reinstall # libxkbcommon bison \ # Qt 5.15 - libx11-dev libx11-xcb-dev \ +# https://doc.qt.io/qt-5/linux-requirements.html + libx11-dev \ + libx11-xcb-dev \ + libxext-dev \ + libxfixes-dev \ + libxi-dev \ + libxrender-dev \ + libxcb1-dev \ + libxcb-keysyms1-dev \ + libxcb-image0-dev \ + libxcb-icccm4-dev \ + libxcb-xfixes0-dev \ + libxcb-render-util0-dev \ + libxcb-xinerama0-dev \ + libxkbcommon-dev \ + libxkbcommon-x11-dev \ + xutils-dev \ + libxcb-util-dev \ + libxcb-xinput-dev \ # libwallet # libudev.so is included in AppImage libudev1 libudev-dev \ From 1ee6f596a7f46b50300b9d10e0a28e4f6a6696b7 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Fri, 25 Jun 2021 15:52:23 +0200 Subject: [PATCH 3/5] Cleanup cmake dir --- cmake/32-bit-toolchain.cmake | 50 - cmake/64-bit-toolchain.cmake | 50 - cmake/CheckLinkerFlag.cmake | 47 - cmake/CheckTrezor.cmake | 5 - cmake/Doxyfile.in | 1803 ---------------------------------- cmake/Doxygen.extra.css.in | 14 - cmake/FindBacktrace.cmake | 98 -- cmake/FindBerkeleyDB.cmake | 25 - cmake/FindHIDAPI.cmake | 60 -- cmake/FindLibunwind.cmake | 41 - cmake/FindMiniupnpc.cmake | 59 -- cmake/FindReadline.cmake | 91 -- cmake/FindUnbound.cmake | 40 - cmake/FindZBAR.cmake | 29 + cmake/FindZBar0.cmake | 22 - cmake/FindZLIB.cmake | 154 +++ cmake/test-protobuf.cpp | 43 - cmake/test-protobuf.proto | 7 - cmake/test-static-assert.c | 34 - cmake/test-static-assert.cpp | 34 - 20 files changed, 183 insertions(+), 2523 deletions(-) delete mode 100644 cmake/32-bit-toolchain.cmake delete mode 100644 cmake/64-bit-toolchain.cmake delete mode 100644 cmake/CheckLinkerFlag.cmake delete mode 100644 cmake/CheckTrezor.cmake delete mode 100644 cmake/Doxyfile.in delete mode 100644 cmake/Doxygen.extra.css.in delete mode 100644 cmake/FindBacktrace.cmake delete mode 100644 cmake/FindBerkeleyDB.cmake delete mode 100644 cmake/FindHIDAPI.cmake delete mode 100644 cmake/FindLibunwind.cmake delete mode 100644 cmake/FindMiniupnpc.cmake delete mode 100644 cmake/FindReadline.cmake delete mode 100644 cmake/FindUnbound.cmake create mode 100644 cmake/FindZBAR.cmake delete mode 100644 cmake/FindZBar0.cmake create mode 100644 cmake/FindZLIB.cmake delete mode 100644 cmake/test-protobuf.cpp delete mode 100644 cmake/test-protobuf.proto delete mode 100644 cmake/test-static-assert.c delete mode 100644 cmake/test-static-assert.cpp diff --git a/cmake/32-bit-toolchain.cmake b/cmake/32-bit-toolchain.cmake deleted file mode 100644 index 2d53adf..0000000 --- a/cmake/32-bit-toolchain.cmake +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) 2014-2019, The Monero Project -# -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are -# permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this list of -# conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, this list -# of conditions and the following disclaimer in the documentation and/or other -# materials provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its contributors may be -# used to endorse or promote products derived from this software without specific -# prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -if (NOT CMAKE_HOST_WIN32) - set (CMAKE_SYSTEM_NAME Windows) -endif() - -set (GCC_PREFIX i686-w64-mingw32) -set (CMAKE_C_COMPILER ${GCC_PREFIX}-gcc) -set (CMAKE_CXX_COMPILER ${GCC_PREFIX}-g++) -set (CMAKE_AR ar CACHE FILEPATH "" FORCE) -set (CMAKE_NM nm CACHE FILEPATH "" FORCE) -set (CMAKE_LINKER ld CACHE FILEPATH "" FORCE) -#set (CMAKE_RANLIB ${GCC_PREFIX}-gcc-ranlib CACHE FILEPATH "" FORCE) -set (CMAKE_RC_COMPILER windres) - -set (CMAKE_FIND_ROOT_PATH "${MSYS2_FOLDER}/mingw32") - -# Ensure cmake doesn't find things in the wrong places -set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # Find programs on host -set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # Find libs in target -set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Find includes in target - -set (MINGW_FLAG "-m32") -set (USE_LTO_DEFAULT false) diff --git a/cmake/64-bit-toolchain.cmake b/cmake/64-bit-toolchain.cmake deleted file mode 100644 index 7c56eef..0000000 --- a/cmake/64-bit-toolchain.cmake +++ /dev/null @@ -1,50 +0,0 @@ -# Copyright (c) 2014-2019, The Monero Project -# -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are -# permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this list of -# conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, this list -# of conditions and the following disclaimer in the documentation and/or other -# materials provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its contributors may be -# used to endorse or promote products derived from this software without specific -# prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -if (NOT CMAKE_HOST_WIN32) - set (CMAKE_SYSTEM_NAME Windows) -endif() - -set (GCC_PREFIX x86_64-w64-mingw32) -set (CMAKE_C_COMPILER ${GCC_PREFIX}-gcc) -set (CMAKE_CXX_COMPILER ${GCC_PREFIX}-g++) -set (CMAKE_AR ar CACHE FILEPATH "" FORCE) -set (CMAKE_NM nm CACHE FILEPATH "" FORCE) -set (CMAKE_LINKER ld CACHE FILEPATH "" FORCE) -#set (CMAKE_RANLIB ${GCC_PREFIX}-gcc-ranlib CACHE FILEPATH "" FORCE) -set (CMAKE_RC_COMPILER windres) - -set (CMAKE_FIND_ROOT_PATH "${MSYS2_FOLDER}/mingw64") - -# Ensure cmake doesn't find things in the wrong places -set (CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) # Find programs on host -set (CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) # Find libs in target -set (CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) # Find includes in target - -set (MINGW_FLAG "-m64") -set (USE_LTO_DEFAULT false) diff --git a/cmake/CheckLinkerFlag.cmake b/cmake/CheckLinkerFlag.cmake deleted file mode 100644 index 2b507ab..0000000 --- a/cmake/CheckLinkerFlag.cmake +++ /dev/null @@ -1,47 +0,0 @@ -include(CheckCCompilerFlag) - -macro(CHECK_LINKER_FLAG flag VARIABLE) - if(NOT DEFINED "${VARIABLE}") - if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${flag} linker flag") - endif() - - set(_cle_source ${CMAKE_SOURCE_DIR}/cmake/CheckLinkerFlag.c) - - set(saved_CMAKE_C_FLAGS ${CMAKE_C_FLAGS}) - set(CMAKE_C_FLAGS "${flag}") - try_compile(${VARIABLE} - ${CMAKE_BINARY_DIR} - ${_cle_source} - COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} ${flag} - CMAKE_FLAGS - OUTPUT_VARIABLE OUTPUT) - unset(_cle_source) - set(CMAKE_C_FLAGS ${saved_CMAKE_C_FLAGS}) - unset(saved_CMAKE_C_FLAGS) - - if ("${OUTPUT}" MATCHES "warning.*ignored") - set(${VARIABLE} 0) - endif() - - if(${VARIABLE}) - if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${flag} linker flag - found") - endif() - set(${VARIABLE} 1 CACHE INTERNAL "Have linker flag ${flag}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log - "Determining if the ${flag} linker flag is supported " - "passed with the following output:\n" - "${OUTPUT}\n\n") - else() - if(NOT CMAKE_REQUIRED_QUIET) - message(STATUS "Looking for ${flag} linker flag - not found") - endif() - set(${VARIABLE} "" CACHE INTERNAL "Have linker flag ${flag}") - file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log - "Determining if the ${flag} linker flag is supported " - "failed with the following output:\n" - "${OUTPUT}\n\n") - endif() - endif() -endmacro() diff --git a/cmake/CheckTrezor.cmake b/cmake/CheckTrezor.cmake deleted file mode 100644 index 54f067d..0000000 --- a/cmake/CheckTrezor.cmake +++ /dev/null @@ -1,5 +0,0 @@ -OPTION(USE_DEVICE_TREZOR "Trezor support compilation" OFF) -OPTION(USE_DEVICE_TREZOR_LIBUSB "Trezor LibUSB compilation" OFF) -OPTION(USE_DEVICE_TREZOR_UDP_RELEASE "Trezor UdpTransport in release mode" OFF) -OPTION(USE_DEVICE_TREZOR_DEBUG "Trezor Debugging enabled" OFF) -OPTION(TREZOR_DEBUG "Main trezor debugging switch" OFF) diff --git a/cmake/Doxyfile.in b/cmake/Doxyfile.in deleted file mode 100644 index 35a4911..0000000 --- a/cmake/Doxyfile.in +++ /dev/null @@ -1,1803 +0,0 @@ -# Doxyfile 1.8.1.2 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project -# -# All text after a hash (#) is considered a comment and will be ignored -# The format is: -# TAG = value [value, ...] -# For lists items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (" ") - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all -# text before the first occurrence of this tag. Doxygen uses libiconv (or the -# iconv built into libc) for the transcoding. See -# http://www.gnu.org/software/libiconv for the list of possible encodings. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or sequence of words) that should -# identify the project. Note that if you do not use Doxywizard you need -# to put quotes around the project name if it contains spaces. - -PROJECT_NAME = Monero - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. -# This could be handy for archiving the generated documentation or -# if some version control system is used. - -PROJECT_NUMBER = @VERSION_STRING@ - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer -# a quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = @CPACK_PACKAGE_DESCRIPTION_SUMMARY@ - -# With the PROJECT_LOGO tag one can specify an logo or icon that is -# included in the documentation. The maximum height of the logo should not -# exceed 55 pixels and the maximum width should not exceed 200 pixels. -# Doxygen will copy the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) -# base path where the generated documentation will be put. -# If a relative path is entered, it will be relative to the location -# where doxygen was started. If left blank the current directory will be used. - -OUTPUT_DIRECTORY = ./docs - -# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create -# 4096 sub-directories (in 2 levels) under the output directory of each output -# format and will distribute the generated files over these directories. -# Enabling this option can be useful when feeding doxygen a huge amount of -# source files, where putting all generated files in the same directory would -# otherwise cause performance problems for the file system. - -CREATE_SUBDIRS = YES - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# The default language is English, other supported languages are: -# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, -# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, -# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English -# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, -# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, -# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. - -OUTPUT_LANGUAGE = English - -# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will -# include brief member descriptions after the members that are listed in -# the file and class documentation (similar to JavaDoc). -# Set to NO to disable this. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend -# the brief description of a member or function before the detailed description. -# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator -# that is used to form the text in various listings. Each string -# in this list, if found as the leading text of the brief description, will be -# stripped from the text and the result after processing the whole list, is -# used as the annotated text. Otherwise, the brief description is used as-is. -# If left blank, the following values are used ("$name" is automatically -# replaced with the name of the entity): "The $name class" "The $name widget" -# "The $name file" "is" "provides" "specifies" "contains" -# "represents" "a" "an" "the" - -ABBREVIATE_BRIEF = - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# Doxygen will generate a detailed section even if there is only a brief -# description. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full -# path before files name in the file list and in the header files. If set -# to NO the shortest path that makes the file name unique will be used. - -FULL_PATH_NAMES = YES - -# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag -# can be used to strip a user-defined part of the path. Stripping is -# only done if one of the specified strings matches the left-hand part of -# the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the -# path to strip. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of -# the path mentioned in the documentation of a class, which tells -# the reader which header file to include in order to use a class. -# If left blank only the name of the header file containing the class -# definition is used. Otherwise one should specify the include paths that -# are normally passed to the compiler using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter -# (but less readable) file names. This can be useful if your file system -# doesn't support long names like on DOS, Mac, or CD-ROM. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen -# will interpret the first line (until the first dot) of a JavaDoc-style -# comment as the brief description. If set to NO, the JavaDoc -# comments will behave just like regular Qt-style comments -# (thus requiring an explicit @brief command for a brief description.) - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then Doxygen will -# interpret the first line (until the first dot) of a Qt-style -# comment as the brief description. If set to NO, the comments -# will behave just like regular Qt-style comments (thus requiring -# an explicit \brief command for a brief description.) - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen -# treat a multi-line C++ special comment block (i.e. a block of //! or /// -# comments) as a brief description. This used to be the default behaviour. -# The new default is to treat a multi-line C++ comment block as a detailed -# description. Set this tag to YES if you prefer the old behaviour instead. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented -# member inherits the documentation from any documented member that it -# re-implements. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce -# a new page for each member. If set to NO, the documentation of a member will -# be part of the file/class/namespace that contains it. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. -# Doxygen uses this value to replace tabs by spaces in code fragments. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that acts -# as commands in the documentation. An alias has the form "name=value". -# For example adding "sideeffect=\par Side Effects:\n" will allow you to -# put the command \sideeffect (or @sideeffect) in the documentation, which -# will result in a user-defined paragraph with heading "Side Effects:". -# You can put \n's in the value part of an alias to insert newlines. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding -# "class=itcl::class" will allow you to use the command class in the -# itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C -# sources only. Doxygen will then generate output that is more tailored for C. -# For instance, some of the names that are used will be different. The list -# of all members will be omitted, etc. - -OPTIMIZE_OUTPUT_FOR_C = NO - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java -# sources only. Doxygen will then generate output that is more tailored for -# Java. For instance, namespaces will be presented as packages, qualified -# scopes will look different, etc. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources only. Doxygen will then generate output that is more tailored for -# Fortran. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for -# VHDL. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given extension. -# Doxygen has a built-in mapping, but you can override or extend it using this -# tag. The format is ext=language, where ext is a file extension, and language -# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, -# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make -# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C -# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions -# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If MARKDOWN_SUPPORT is enabled (the default) then doxygen pre-processes all -# comments according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you -# can mix doxygen, HTML, and XML commands with Markdown formatting. -# Disable only in case of backward compatibilities issues. - -MARKDOWN_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should -# set this tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. -# func(std::string) {}). This also makes the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. - -BUILTIN_STL_SUPPORT = YES - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. -# Doxygen will parse them like normal C++ but will assume all classes use public -# instead of private inheritance when no explicit protection keyword is present. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate getter -# and setter methods for a property. Setting this option to YES (the default) -# will make doxygen replace the get and set methods by a property in the -# documentation. This will only work if the methods are indeed getting or -# setting a simple type. If this is not the case, or you want to show the -# methods anyway, you should set this option to NO. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES, then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. - -DISTRIBUTE_GROUP_DOC = NO - -# Set the SUBGROUPING tag to YES (the default) to allow class member groups of -# the same type (for instance a group of public functions) to be put as a -# subgroup of that type (e.g. under the Public Functions section). Set it to -# NO to prevent subgrouping. Alternatively, this can be done per class using -# the \nosubgrouping command. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and -# unions are shown inside the group in which they are included (e.g. using -# @ingroup) instead of on a separate page (for HTML and Man pages) or -# section (for LaTeX and RTF). - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and -# unions with only public data fields will be shown inline in the documentation -# of the scope in which they are defined (i.e. file, namespace, or group -# documentation), provided this scope is documented. If set to NO (the default), -# structs, classes, and unions are shown on a separate page (for HTML and Man -# pages) or section (for LaTeX and RTF). - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum -# is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically -# be useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. - -TYPEDEF_HIDES_STRUCT = NO - -# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to -# determine which symbols to keep in memory and which to flush to disk. -# When the cache is full, less often used symbols will be written to disk. -# For small to medium size projects (<1000 input files) the default value is -# probably good enough. For larger projects a too small cache size can cause -# doxygen to be busy swapping symbols to and from disk most of the time -# causing a significant performance penalty. -# If the system has enough physical memory increasing the cache will improve the -# performance by keeping more symbols in memory. Note that the value works on -# a logarithmic scale so increasing the size by one will roughly double the -# memory usage. The cache size is given by this formula: -# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols. - -SYMBOL_CACHE_SIZE = 0 - -# Similar to the SYMBOL_CACHE_SIZE the size of the symbol lookup cache can be -# set using LOOKUP_CACHE_SIZE. This cache is used to resolve symbols given -# their name and scope. Since this can be an expensive process and often the -# same symbol appear multiple times in the code, doxygen keeps a cache of -# pre-resolved symbols. If the cache is too small doxygen will become slower. -# If the cache is too large, memory is wasted. The cache size is given by this -# formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range is 0..9, the default is 0, -# corresponding to a cache size of 2^16 = 65536 symbols. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in -# documentation are documented, even if no documentation was available. -# Private class members and static file members will be hidden unless -# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES all private members of a class -# will be included in the documentation. - -EXTRACT_PRIVATE = NO - -# If the EXTRACT_PACKAGE tag is set to YES all members with package or internal -# scope will be included in the documentation. - -EXTRACT_PACKAGE = NO - -# If the EXTRACT_STATIC tag is set to YES all static members of a file -# will be included in the documentation. - -EXTRACT_STATIC = NO - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) -# defined locally in source files will be included in the documentation. -# If set to NO only classes defined in header files are included. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. When set to YES local -# methods, which are defined in the implementation section but not in -# the interface are included in the documentation. -# If set to NO (the default) only methods in the interface are included. - -EXTRACT_LOCAL_METHODS = NO - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base -# name of the file that contains the anonymous namespace. By default -# anonymous namespaces are hidden. - -EXTRACT_ANON_NSPACES = NO - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all -# undocumented members of documented classes, files or namespaces. -# If set to NO (the default) these members will be included in the -# various overviews, but no documentation section is generated. -# This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. -# If set to NO (the default) these classes will be included in the various -# overviews. This option has no effect if EXTRACT_ALL is enabled. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all -# friend (class|struct|union) declarations. -# If set to NO (the default) these declarations will be included in the -# documentation. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any -# documentation blocks found inside the body of a function. -# If set to NO (the default) these blocks will be appended to the -# function's detailed documentation block. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation -# that is typed after a \internal command is included. If the tag is set -# to NO (the default) then the documentation will be excluded. -# Set it to YES to include the internal documentation. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate -# file names in lower-case letters. If set to YES upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. - -CASE_SENSE_NAMES = NO - -# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen -# will show members with their full class and namespace scopes in the -# documentation. If set to YES the scope will be hidden. - -HIDE_SCOPE_NAMES = NO - -# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen -# will put a list of the files that are included by a file in the documentation -# of that file. - -SHOW_INCLUDE_FILES = YES - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen -# will list include files with double quotes in the documentation -# rather than with sharp brackets. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] -# is inserted in the documentation for inline members. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen -# will sort the (detailed) documentation of file and class members -# alphabetically by member name. If set to NO the members will appear in -# declaration order. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the -# brief documentation of file, namespace and class members alphabetically -# by member name. If set to NO (the default) the members will appear in -# declaration order. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen -# will sort the (brief and detailed) documentation of class members so that -# constructors and destructors are listed first. If set to NO (the default) -# the constructors will appear in the respective orders defined by -# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. -# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO -# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the -# hierarchy of group names into alphabetical order. If set to NO (the default) -# the group names will appear in their defined order. - -SORT_GROUP_NAMES = NO - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be -# sorted by fully-qualified names, including namespaces. If set to -# NO (the default), the class list will be sorted only by class name, -# not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the -# alphabetical list. - -SORT_BY_SCOPE_NAME = NO - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to -# do proper type resolution of all parameters of a function it will reject a -# match between the prototype and the implementation of a member function even -# if there is only one candidate or it is obvious which candidate to choose -# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen -# will still accept a match between prototype and implementation in such cases. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or -# disable (NO) the todo list. This list is created by putting \todo -# commands in the documentation. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or -# disable (NO) the test list. This list is created by putting \test -# commands in the documentation. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or -# disable (NO) the bug list. This list is created by putting \bug -# commands in the documentation. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or -# disable (NO) the deprecated list. This list is created by putting -# \deprecated commands in the documentation. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional -# documentation sections, marked by \if sectionname ... \endif. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines -# the initial value of a variable or macro consists of for it to appear in -# the documentation. If the initializer consists of more lines than specified -# here it will be hidden. Use a value of 0 to hide initializers completely. -# The appearance of the initializer of individual variables and macros in the -# documentation can be controlled using \showinitializer or \hideinitializer -# command in the documentation regardless of this setting. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated -# at the bottom of the documentation of classes and structs. If set to YES the -# list will mention the files that were used to generate the documentation. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. -# This will remove the Files entry from the Quick Index and from the -# Folder Tree View (if specified). The default is YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the -# Namespaces page. This will remove the Namespaces entry from the Quick Index -# and from the Folder Tree View (if specified). The default is YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command , where is the value of -# the FILE_VERSION_FILTER tag, and is the name of an input file -# provided by doxygen. Whatever the program writes to standard output -# is used as the file version. See the manual for examples. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. -# You can optionally specify a file name after the option, if omitted -# DoxygenLayout.xml will be used as the name of the layout file. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files -# containing the references data. This must be a list of .bib files. The -# .bib extension is automatically appended if omitted. Using this command -# requires the bibtex tool to be installed. See also -# http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style -# of the bibliography can be controlled using LATEX_BIB_STYLE. To use this -# feature you need bibtex and perl available in the search path. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated -# by doxygen. Possible values are YES and NO. If left blank NO is used. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated by doxygen. Possible values are YES and NO. If left blank -# NO is used. - -WARNINGS = YES - -# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings -# for undocumented members. If EXTRACT_ALL is set to YES then this flag will -# automatically be disabled. - -WARN_IF_UNDOCUMENTED = YES - -# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some -# parameters in a documented function, or documenting parameters that -# don't exist or using markup commands wrongly. - -WARN_IF_DOC_ERROR = YES - -# The WARN_NO_PARAMDOC option can be enabled to get warnings for -# functions that are documented, but have no documentation for their parameters -# or return value. If set to NO (the default) doxygen will only warn about -# wrong or incomplete parameter documentation, but not about the absence of -# documentation. - -WARN_NO_PARAMDOC = NO - -# The WARN_FORMAT tag determines the format of the warning messages that -# doxygen can produce. The string should contain the $file, $line, and $text -# tags, which will be replaced by the file and line number from which the -# warning originated and the warning text. Optionally the format may contain -# $version, which will be replaced by the version of the file (if it could -# be obtained via FILE_VERSION_FILTER) - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning -# and error messages should be written. If left blank the output is written -# to stderr. - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag can be used to specify the files and/or directories that contain -# documented source files. You may enter file names like "myfile.cpp" or -# directories like "/usr/src/myproject". Separate the files or directories -# with spaces. - -INPUT = ../README.md \ - ../contrib/ \ - ../external/ \ - ../include/ \ - ../tests/ \ - ../src/ - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is -# also the default input encoding. Doxygen uses libiconv (or the iconv built -# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for -# the list of possible encodings. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank the following patterns are tested: -# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh -# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py -# *.f90 *.f *.for *.vhd *.vhdl - -FILE_PATTERNS = *.cpp \ - *.h \ - *.hpp - -# The RECURSIVE tag can be used to turn specify whether or not subdirectories -# should be searched for input files as well. Possible values are YES and NO. -# If left blank NO is used. - -RECURSIVE = YES - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. Note that the wildcards are matched -# against the file with absolute path, so to exclude all test directories -# for example use the pattern */test/* - -EXCLUDE_PATTERNS = *.pb.* \ - tinythread.* \ - fast_mutex.* \ - anyoption.* \ - stacktrace.* \ - */simpleini/* \ - ExportWrapper.* \ - WinsockWrapper.* \ - otapicli.* \ - test*.* \ - irrXML.* \ - */chaiscript/* \ - */zmq/* - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test - -EXCLUDE_SYMBOLS = tinythread - -# The EXAMPLE_PATH tag can be used to specify one or more files or -# directories that contain example code fragments that are included (see -# the \include command). - -EXAMPLE_PATH = - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp -# and *.h) to filter out the source-files in the directories. If left -# blank all files are included. - -EXAMPLE_PATTERNS = - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude -# commands irrespective of the value of the RECURSIVE tag. -# Possible values are YES and NO. If left blank NO is used. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or -# directories that contain image that are included in the documentation (see -# the \image command). - -IMAGE_PATH = - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command , where -# is the value of the INPUT_FILTER tag, and is the name of an -# input file. Doxygen will then use the output that the filter program writes -# to standard output. If FILTER_PATTERNS is specified, this tag will be -# ignored. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: -# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further -# info on how filters are used. If FILTER_PATTERNS is empty or if -# non of the patterns match the file name, INPUT_FILTER is applied. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will be used to filter the input files when producing source -# files to browse (i.e. when SOURCE_BROWSER is set to YES). - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) -# and it is also possible to disable source filtering for a specific pattern -# using *.ext= (so without naming a filter). This option only has effect when -# FILTER_SOURCE_FILES is enabled. - -FILTER_SOURCE_PATTERNS = - -#--------------------------------------------------------------------------- -# configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will -# be generated. Documented entities will be cross-referenced with these sources. -# Note: To get rid of all source code in the generated output, make sure also -# VERBATIM_HEADERS is set to NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body -# of functions and classes directly in the documentation. - -INLINE_SOURCES = YES - -# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct -# doxygen to hide any special comment blocks from generated source code -# fragments. Normal C, C++ and Fortran comments will always remain visible. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES -# then for each documented function all documented -# functions referencing it will be listed. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES -# then for each documented function all documented entities -# called/used by that function will be listed. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) -# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from -# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will -# link to the source code. Otherwise they will link to the documentation. - -REFERENCES_LINK_SOURCE = YES - -# If the USE_HTAGS tag is set to YES then the references to source code -# will point to the HTML generated by the htags(1) tool instead of doxygen -# built-in source browser. The htags tool is part of GNU's global source -# tagging system (see http://www.gnu.org/software/global/global.html). You -# will need version 4.8.6 or higher. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen -# will generate a verbatim copy of the header file for each class for -# which an include is specified. Set to NO to disable this. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index -# of all compounds will be generated. Enable this if the project -# contains a lot of classes, structs, unions or interfaces. - -ALPHABETICAL_INDEX = YES - -# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then -# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns -# in which this list will be split (can be a number in the range [1..20]) - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all -# classes will be put under the same header in the alphabetical index. -# The IGNORE_PREFIX tag can be used to specify one or more prefixes that -# should be ignored while generating the index headers. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES (the default) Doxygen will -# generate HTML output. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `html' will be used as the default path. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for -# each generated HTML page (for example: .htm,.php,.asp). If it is left blank -# doxygen will generate files with .html extension. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a personal HTML header for -# each generated HTML page. If it is left blank doxygen will generate a -# standard header. Note that when using a custom header you are responsible -# for the proper inclusion of any scripts and style sheets that doxygen -# needs, which is dependent on the configuration options used. -# It is advised to generate a default header using "doxygen -w html -# header.html footer.html stylesheet.css YourConfigFile" and then modify -# that header. Note that the header is subject to change so you typically -# have to redo this when upgrading to a newer version of doxygen or when -# changing the value of configuration settings such as GENERATE_TREEVIEW! - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a personal HTML footer for -# each generated HTML page. If it is left blank doxygen will generate a -# standard footer. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading -# style sheet that is used by each HTML page. It can be used to -# fine-tune the look of the HTML output. If the tag is left blank doxygen -# will generate a default style sheet. Note that doxygen will try to copy -# the style sheet file to the HTML output directory, so don't put your own -# style sheet in the HTML output directory as well, or it will be erased! - -HTML_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that -# the files will be copied as-is; there are no commands or markers available. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. -# Doxygen will adjust the colors in the style sheet and background images -# according to this color. Hue is specified as an angle on a colorwheel, -# see http://en.wikipedia.org/wiki/Hue for more information. -# For instance the value 0 represents red, 60 is yellow, 120 is green, -# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. -# The allowed range is 0 to 359. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of -# the colors in the HTML output. For a value of 0 the output will use -# grayscales only. A value of 255 will produce the most vivid colors. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to -# the luminance component of the colors in the HTML output. Values below -# 100 gradually make the output lighter, whereas values above 100 make -# the output darker. The value divided by 100 is the actual gamma applied, -# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, -# and 100 does not change the gamma. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting -# this to NO can help when comparing the output of multiple runs. - -HTML_TIMESTAMP = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of -# entries shown in the various tree structured indices initially; the user -# can expand and collapse entries dynamically later on. Doxygen will expand -# the tree to such a level that at most the specified number of entries are -# visible (unless a fully collapsed tree already exceeds this amount). -# So setting the number of entries 1 will produce a full collapsed tree by -# default. 0 is a special value representing an infinite number of entries -# and will result in a full expanded tree by default. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files -# will be generated that can be used as input for Apple's Xcode 3 -# integrated development environment, introduced with OSX 10.5 (Leopard). -# To create a documentation set, doxygen will generate a Makefile in the -# HTML output directory. Running make will produce the docset in that -# directory and running "make install" will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find -# it at startup. -# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. - -GENERATE_DOCSET = NO - -# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the -# feed. A documentation feed provides an umbrella under which multiple -# documentation sets from a single provider (such as a company or product suite) -# can be grouped. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that -# should uniquely identify the documentation set bundle. This should be a -# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen -# will append .docset to the name. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES, additional index files -# will be generated that can be used as input for tools like the -# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) -# of the generated HTML documentation. - -GENERATE_HTMLHELP = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can -# be used to specify the file name of the resulting .chm file. You -# can add a path in front of the file if the result should not be -# written to the html output directory. - -CHM_FILE = - -# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can -# be used to specify the location (absolute path including file name) of -# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run -# the HTML help compiler on the generated index.hhp. - -HHC_LOCATION = - -# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag -# controls if a separate .chi index file is generated (YES) or that -# it should be included in the master .chm file (NO). - -GENERATE_CHI = NO - -# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING -# is used to encode HtmlHelp index (hhk), content (hhc) and project file -# content. - -CHM_INDEX_ENCODING = - -# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag -# controls whether a binary table of contents is generated (YES) or a -# normal table of contents (NO) in the .chm file. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members -# to the contents of the HTML help documentation and to the tree view. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated -# that can be used as input for Qt's qhelpgenerator to generate a -# Qt Compressed Help (.qch) of the generated HTML documentation. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can -# be used to specify the file name of the resulting .qch file. -# The path specified is relative to the HTML output folder. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#namespace - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating -# Qt Help Project output. For more information please see -# http://doc.trolltech.com/qthelpproject.html#virtual-folders - -QHP_VIRTUAL_FOLDER = doc - -# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to -# add. For more information please see -# http://doc.trolltech.com/qthelpproject.html#custom-filters - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see -# -# Qt Help Project / Custom Filters. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's -# filter section matches. -# -# Qt Help Project / Filter Attributes. - -QHP_SECT_FILTER_ATTRS = - -# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can -# be used to specify the location of Qt's qhelpgenerator. -# If non-empty doxygen will try to run qhelpgenerator on the generated -# .qhp file. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files -# will be generated, which together with the HTML files, form an Eclipse help -# plugin. To install this plugin and make it available under the help contents -# menu in Eclipse, the contents of the directory containing the HTML and XML -# files needs to be copied into the plugins directory of eclipse. The name of -# the directory within the plugins directory should be the same as -# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before -# the help appears. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have -# this name. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# The DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) -# at top of each HTML page. The value NO (the default) enables the index and -# the value YES disables it. Since the tabs have the same information as the -# navigation tree you can set this option to NO if you already set -# GENERATE_TREEVIEW to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. -# If the tag value is set to YES, a side panel will be generated -# containing a tree-like index structure (just like the one that -# is generated for HTML Help). For this to work a browser that supports -# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). -# Windows users are probably better off using the HTML help feature. -# Since the tree basically has the same information as the tab index you -# could consider to set DISABLE_INDEX to NO when enabling this option. - -GENERATE_TREEVIEW = YES - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values -# (range [0,1..20]) that doxygen will group on one line in the generated HTML -# documentation. Note that a value of 0 will completely suppress the enum -# values from appearing in the overview section. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be -# used to set the initial width (in pixels) of the frame in which the tree -# is shown. - -TREEVIEW_WIDTH = 250 - -# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open -# links to external symbols imported via tag files in a separate window. - -EXT_LINKS_IN_WINDOW = YES - -# Use this tag to change the font size of Latex formulas included -# as images in the HTML documentation. The default is 10. Note that -# when you change the font size after a successful doxygen run you need -# to manually remove any form_*.png images from the HTML output directory -# to force them to be regenerated. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are -# not supported properly for IE 6.0, but are supported on all modern browsers. -# Note that when changing this option you need to delete any form_*.png files -# in the HTML output before the changes have effect. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax -# (see http://www.mathjax.org) which uses client side Javascript for the -# rendering instead of using prerendered bitmaps. Use this if you do not -# have LaTeX installed or if you want to formulas look prettier in the HTML -# output. When enabled you may also need to install MathJax separately and -# configure the path to it using the MATHJAX_RELPATH option. - -USE_MATHJAX = NO - -# When MathJax is enabled you need to specify the location relative to the -# HTML output directory using the MATHJAX_RELPATH option. The destination -# directory should contain the MathJax.js script. For instance, if the mathjax -# directory is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to -# the MathJax Content Delivery Network so you can quickly see the result without -# installing MathJax. However, it is strongly recommended to install a local -# copy of MathJax from http://www.mathjax.org before deployment. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or MathJax extension -# names that should be enabled during MathJax rendering. - -MATHJAX_EXTENSIONS = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box -# for the HTML output. The underlying search engine uses javascript -# and DHTML and should work on any modern browser. Note that when using -# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets -# (GENERATE_DOCSET) there is already a search function so this one should -# typically be disabled. For large projects the javascript based search engine -# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. - -SEARCHENGINE = YES - -# When the SERVER_BASED_SEARCH tag is enabled the search engine will be -# implemented using a PHP enabled web server instead of at the web client -# using Javascript. Doxygen will generate the search PHP script and index -# file to put on the web server. The advantage of the server -# based approach is that it scales better to large projects and allows -# full text search. The disadvantages are that it is more difficult to setup -# and does not have live searching capabilities. - -SERVER_BASED_SEARCH = NO - -#--------------------------------------------------------------------------- -# configuration options related to the LaTeX output -#--------------------------------------------------------------------------- - -# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will -# generate Latex output. - -GENERATE_LATEX = NO - -# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `latex' will be used as the default path. - -LATEX_OUTPUT = latex - -# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be -# invoked. If left blank `latex' will be used as the default command name. -# Note that when enabling USE_PDFLATEX this option is only used for -# generating bitmaps for formulas in the HTML output, but not in the -# Makefile that is written to the output directory. - -LATEX_CMD_NAME = latex - -# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to -# generate index for LaTeX. If left blank `makeindex' will be used as the -# default command name. - -MAKEINDEX_CMD_NAME = makeindex - -# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact -# LaTeX documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_LATEX = NO - -# The PAPER_TYPE tag can be used to set the paper type that is used -# by the printer. Possible values are: a4, letter, legal and -# executive. If left blank a4wide will be used. - -PAPER_TYPE = a4 - -# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX -# packages that should be included in the LaTeX output. - -EXTRA_PACKAGES = - -# The LATEX_HEADER tag can be used to specify a personal LaTeX header for -# the generated latex document. The header should contain everything until -# the first chapter. If it is left blank doxygen will generate a -# standard header. Notice: only use this tag if you know what you are doing! - -LATEX_HEADER = - -# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for -# the generated latex document. The footer should contain everything after -# the last chapter. If it is left blank doxygen will generate a -# standard footer. Notice: only use this tag if you know what you are doing! - -LATEX_FOOTER = - -# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated -# is prepared for conversion to pdf (using ps2pdf). The pdf file will -# contain links (just like the HTML output) instead of page references -# This makes the output suitable for online browsing using a pdf viewer. - -PDF_HYPERLINKS = YES - -# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of -# plain latex in the generated Makefile. Set this option to YES to get a -# higher quality PDF documentation. - -USE_PDFLATEX = YES - -# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. -# command to the generated LaTeX files. This will instruct LaTeX to keep -# running if errors occur, instead of asking the user for help. -# This option is also used when generating formulas in HTML. - -LATEX_BATCHMODE = NO - -# If LATEX_HIDE_INDICES is set to YES then doxygen will not -# include the index chapters (such as File Index, Compound Index, etc.) -# in the output. - -LATEX_HIDE_INDICES = NO - -# If LATEX_SOURCE_CODE is set to YES then doxygen will include -# source code with syntax highlighting in the LaTeX output. -# Note that which sources are shown also depends on other settings -# such as SOURCE_BROWSER. - -LATEX_SOURCE_CODE = NO - -# The LATEX_BIB_STYLE tag can be used to specify the style to use for the -# bibliography, e.g. plainnat, or ieeetr. The default style is "plain". See -# http://en.wikipedia.org/wiki/BibTeX for more info. - -LATEX_BIB_STYLE = plain - -#--------------------------------------------------------------------------- -# configuration options related to the RTF output -#--------------------------------------------------------------------------- - -# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output -# The RTF output is optimized for Word 97 and may not look very pretty with -# other RTF readers or editors. - -GENERATE_RTF = NO - -# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `rtf' will be used as the default path. - -RTF_OUTPUT = rtf - -# If the COMPACT_RTF tag is set to YES Doxygen generates more compact -# RTF documents. This may be useful for small projects and may help to -# save some trees in general. - -COMPACT_RTF = NO - -# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated -# will contain hyperlink fields. The RTF file will -# contain links (just like the HTML output) instead of page references. -# This makes the output suitable for online browsing using WORD or other -# programs which support those fields. -# Note: wordpad (write) and others do not support links. - -RTF_HYPERLINKS = NO - -# Load style sheet definitions from file. Syntax is similar to doxygen's -# config file, i.e. a series of assignments. You only have to provide -# replacements, missing definitions are set to their default value. - -RTF_STYLESHEET_FILE = - -# Set optional variables used in the generation of an rtf document. -# Syntax is similar to doxygen's config file. - -RTF_EXTENSIONS_FILE = - -#--------------------------------------------------------------------------- -# configuration options related to the man page output -#--------------------------------------------------------------------------- - -# If the GENERATE_MAN tag is set to YES (the default) Doxygen will -# generate man pages - -GENERATE_MAN = NO - -# The MAN_OUTPUT tag is used to specify where the man pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `man' will be used as the default path. - -MAN_OUTPUT = man - -# The MAN_EXTENSION tag determines the extension that is added to -# the generated man pages (default is the subroutine's section .3) - -MAN_EXTENSION = .3 - -# If the MAN_LINKS tag is set to YES and Doxygen generates man output, -# then it will generate one additional man file for each entity -# documented in the real man page(s). These additional files -# only source the real man page, but without them the man command -# would be unable to find the correct page. The default is NO. - -MAN_LINKS = NO - -#--------------------------------------------------------------------------- -# configuration options related to the XML output -#--------------------------------------------------------------------------- - -# If the GENERATE_XML tag is set to YES Doxygen will -# generate an XML file that captures the structure of -# the code including all documentation. - -GENERATE_XML = NO - -# The XML_OUTPUT tag is used to specify where the XML pages will be put. -# If a relative path is entered the value of OUTPUT_DIRECTORY will be -# put in front of it. If left blank `xml' will be used as the default path. - -XML_OUTPUT = xml - -# The XML_SCHEMA tag can be used to specify an XML schema, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_SCHEMA = - -# The XML_DTD tag can be used to specify an XML DTD, -# which can be used by a validating XML parser to check the -# syntax of the XML files. - -XML_DTD = - -# If the XML_PROGRAMLISTING tag is set to YES Doxygen will -# dump the program listings (including syntax highlighting -# and cross-referencing information) to the XML output. Note that -# enabling this will significantly increase the size of the XML output. - -XML_PROGRAMLISTING = YES - -#--------------------------------------------------------------------------- -# configuration options for the AutoGen Definitions output -#--------------------------------------------------------------------------- - -# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will -# generate an AutoGen Definitions (see autogen.sf.net) file -# that captures the structure of the code including all -# documentation. Note that this feature is still experimental -# and incomplete at the moment. - -GENERATE_AUTOGEN_DEF = NO - -#--------------------------------------------------------------------------- -# configuration options related to the Perl module output -#--------------------------------------------------------------------------- - -# If the GENERATE_PERLMOD tag is set to YES Doxygen will -# generate a Perl module file that captures the structure of -# the code including all documentation. Note that this -# feature is still experimental and incomplete at the -# moment. - -GENERATE_PERLMOD = NO - -# If the PERLMOD_LATEX tag is set to YES Doxygen will generate -# the necessary Makefile rules, Perl scripts and LaTeX code to be able -# to generate PDF and DVI output from the Perl module output. - -PERLMOD_LATEX = NO - -# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be -# nicely formatted so it can be parsed by a human reader. This is useful -# if you want to understand what is going on. On the other hand, if this -# tag is set to NO the size of the Perl module output will be much smaller -# and Perl will parse it just the same. - -PERLMOD_PRETTY = YES - -# The names of the make variables in the generated doxyrules.make file -# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. -# This is useful so different doxyrules.make files included by the same -# Makefile don't overwrite each other's variables. - -PERLMOD_MAKEVAR_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the preprocessor -#--------------------------------------------------------------------------- - -# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will -# evaluate all C-preprocessor directives found in the sources and include -# files. - -ENABLE_PREPROCESSING = YES - -# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro -# names in the source code. If set to NO (the default) only conditional -# compilation will be performed. Macro expansion can be done in a controlled -# way by setting EXPAND_ONLY_PREDEF to YES. - -MACRO_EXPANSION = NO - -# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES -# then the macro expansion is limited to the macros specified with the -# PREDEFINED and EXPAND_AS_DEFINED tags. - -EXPAND_ONLY_PREDEF = NO - -# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files -# pointed to by INCLUDE_PATH will be searched when a #include is found. - -SEARCH_INCLUDES = YES - -# The INCLUDE_PATH tag can be used to specify one or more directories that -# contain include files that are not input files but should be processed by -# the preprocessor. - -INCLUDE_PATH = - -# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard -# patterns (like *.h and *.hpp) to filter out the header-files in the -# directories. If left blank, the patterns specified with FILE_PATTERNS will -# be used. - -INCLUDE_FILE_PATTERNS = - -# The PREDEFINED tag can be used to specify one or more macro names that -# are defined before the preprocessor is started (similar to the -D option of -# gcc). The argument of the tag is a list of macros of the form: name -# or name=definition (no spaces). If the definition and the = are -# omitted =1 is assumed. To prevent a macro definition from being -# undefined via #undef or recursively expanded use the := operator -# instead of the = operator. - -PREDEFINED = OT_CRYPTO_USING_OPENSSL \ - OT_CASH_USING_LUCRE - -# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then -# this tag can be used to specify a list of macro names that should be expanded. -# The macro definition that is found in the sources will be used. -# Use the PREDEFINED tag if you want to use a different macro definition that -# overrules the definition found in the source code. - -EXPAND_AS_DEFINED = - -# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then -# doxygen's preprocessor will remove all references to function-like macros -# that are alone on a line, have an all uppercase name, and do not end with a -# semicolon, because these will confuse the parser if not removed. - -SKIP_FUNCTION_MACROS = YES - -#--------------------------------------------------------------------------- -# Configuration::additions related to external references -#--------------------------------------------------------------------------- - -# The TAGFILES option can be used to specify one or more tagfiles. For each -# tag file the location of the external documentation should be added. The -# format of a tag file without this location is as follows: -# TAGFILES = file1 file2 ... -# Adding location for the tag files is done as follows: -# TAGFILES = file1=loc1 "file2 = loc2" ... -# where "loc1" and "loc2" can be relative or absolute paths -# or URLs. Note that each tag file must have a unique name (where the name does -# NOT include the path). If a tag file is not located in the directory in which -# doxygen is run, you must also specify the path to the tagfile here. - -TAGFILES = - -# When a file name is specified after GENERATE_TAGFILE, doxygen will create -# a tag file that is based on the input files it reads. - -GENERATE_TAGFILE = - -# If the ALLEXTERNALS tag is set to YES all external classes will be listed -# in the class index. If set to NO only the inherited external classes -# will be listed. - -ALLEXTERNALS = NO - -# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed -# in the modules index. If set to NO, only the current project's groups will -# be listed. - -EXTERNAL_GROUPS = YES - -# The PERL_PATH should be the absolute path and name of the perl script -# interpreter (i.e. the result of `which perl'). - -PERL_PATH = /usr/bin/perl - -#--------------------------------------------------------------------------- -# Configuration options related to the dot tool -#--------------------------------------------------------------------------- - -# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will -# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base -# or super classes. Setting the tag to NO turns the diagrams off. Note that -# this option also works with HAVE_DOT disabled, but it is recommended to -# install and use dot, since it yields more powerful graphs. - -CLASS_DIAGRAMS = NO - -# You can define message sequence charts within doxygen comments using the \msc -# command. Doxygen will then run the mscgen tool (see -# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the -# documentation. The MSCGEN_PATH tag allows you to specify the directory where -# the mscgen tool resides. If left empty the tool is assumed to be found in the -# default search path. - -MSCGEN_PATH = - -# If set to YES, the inheritance and collaboration graphs will hide -# inheritance and usage relations if the target is undocumented -# or is not a class. - -HIDE_UNDOC_RELATIONS = YES - -# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is -# available from the path. This tool is part of Graphviz, a graph visualization -# toolkit from AT&T and Lucent Bell Labs. The other options in this section -# have no effect if this option is set to NO (the default) - -HAVE_DOT = YES - -# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is -# allowed to run in parallel. When set to 0 (the default) doxygen will -# base this on the number of processors available in the system. You can set it -# explicitly to a value larger than 0 to get control over the balance -# between CPU load and processing speed. - -DOT_NUM_THREADS = 0 - -# By default doxygen will use the Helvetica font for all dot files that -# doxygen generates. When you want a differently looking font you can specify -# the font name using DOT_FONTNAME. You need to make sure dot is able to find -# the font, which can be done by putting it in a standard location or by setting -# the DOTFONTPATH environment variable or by setting DOT_FONTPATH to the -# directory containing the font. - -DOT_FONTNAME = Helvetica - -# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. -# The default size is 10pt. - -DOT_FONTSIZE = 10 - -# By default doxygen will tell dot to use the Helvetica font. -# If you specify a different font using DOT_FONTNAME you can use DOT_FONTPATH to -# set the path where dot can find it. - -DOT_FONTPATH = - -# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect inheritance relations. Setting this tag to YES will force the -# CLASS_DIAGRAMS tag to NO. - -CLASS_GRAPH = YES - -# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for each documented class showing the direct and -# indirect implementation dependencies (inheritance, containment, and -# class references variables) of the class with other documented classes. - -COLLABORATION_GRAPH = YES - -# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen -# will generate a graph for groups, showing the direct groups dependencies - -GROUP_GRAPHS = YES - -# If the UML_LOOK tag is set to YES doxygen will generate inheritance and -# collaboration diagrams in a style similar to the OMG's Unified Modeling -# Language. - -UML_LOOK = NO - -# If the UML_LOOK tag is enabled, the fields and methods are shown inside -# the class node. If there are many fields or methods and many nodes the -# graph may become too big to be useful. The UML_LIMIT_NUM_FIELDS -# threshold limits the number of items for each type to make the size more -# managable. Set this to 0 for no limit. Note that the threshold may be -# exceeded by 50% before the limit is enforced. - -UML_LIMIT_NUM_FIELDS = 10 - -# If set to YES, the inheritance and collaboration graphs will show the -# relations between templates and their instances. - -TEMPLATE_RELATIONS = NO - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT -# tags are set to YES then doxygen will generate a graph for each documented -# file showing the direct and indirect include dependencies of the file with -# other documented files. - -INCLUDE_GRAPH = YES - -# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and -# HAVE_DOT tags are set to YES then doxygen will generate a graph for each -# documented header file showing the documented files that directly or -# indirectly include this file. - -INCLUDED_BY_GRAPH = YES - -# If the CALL_GRAPH and HAVE_DOT options are set to YES then -# doxygen will generate a call dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable call graphs -# for selected functions only using the \callgraph command. - -CALL_GRAPH = YES - -# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then -# doxygen will generate a caller dependency graph for every global function -# or class method. Note that enabling this option will significantly increase -# the time of a run. So in most cases it will be better to enable caller -# graphs for selected functions only using the \callergraph command. - -CALLER_GRAPH = YES - -# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen -# will generate a graphical hierarchy of all classes instead of a textual one. - -GRAPHICAL_HIERARCHY = YES - -# If the DIRECTORY_GRAPH and HAVE_DOT tags are set to YES -# then doxygen will show the dependencies a directory has on other directories -# in a graphical way. The dependency relations are determined by the #include -# relations between the files in the directories. - -DIRECTORY_GRAPH = YES - -# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images -# generated by dot. Possible values are svg, png, jpg, or gif. -# If left blank png will be used. If you choose svg you need to set -# HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible in IE 9+ (other browsers do not have this requirement). - -DOT_IMAGE_FORMAT = png - -# If DOT_IMAGE_FORMAT is set to svg, then this option can be set to YES to -# enable generation of interactive SVG images that allow zooming and panning. -# Note that this requires a modern browser other than Internet Explorer. -# Tested and working are Firefox, Chrome, Safari, and Opera. For IE 9+ you -# need to set HTML_FILE_EXTENSION to xhtml in order to make the SVG files -# visible. Older versions of IE do not have SVG support. - -INTERACTIVE_SVG = NO - -# The tag DOT_PATH can be used to specify the path where the dot tool can be -# found. If left blank, it is assumed the dot tool can be found in the path. - -DOT_PATH = - -# The DOTFILE_DIRS tag can be used to specify one or more directories that -# contain dot files that are included in the documentation (see the -# \dotfile command). - -DOTFILE_DIRS = - -# The MSCFILE_DIRS tag can be used to specify one or more directories that -# contain msc files that are included in the documentation (see the -# \mscfile command). - -MSCFILE_DIRS = - -# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of -# nodes that will be shown in the graph. If the number of nodes in a graph -# becomes larger than this value, doxygen will truncate the graph, which is -# visualized by representing a node as a red box. Note that doxygen if the -# number of direct children of the root node in a graph is already larger than -# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note -# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. - -DOT_GRAPH_MAX_NODES = 50 - -# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the -# graphs generated by dot. A depth value of 3 means that only nodes reachable -# from the root by following a path via at most 3 edges will be shown. Nodes -# that lay further from the root node will be omitted. Note that setting this -# option to 1 or 2 may greatly reduce the computation time needed for large -# code bases. Also note that the size of a graph can be further restricted by -# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. - -MAX_DOT_GRAPH_DEPTH = 0 - -# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent -# background. This is disabled by default, because dot on Windows does not -# seem to support this out of the box. Warning: Depending on the platform used, -# enabling this option may lead to badly anti-aliased labels on the edges of -# a graph (i.e. they become hard to read). - -DOT_TRANSPARENT = NO - -# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output -# files in one run (i.e. multiple -o and -T options on the command line). This -# makes dot run faster, but since only newer versions of dot (>1.8.10) -# support this, this feature is disabled by default. - -DOT_MULTI_TARGETS = NO - -# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will -# generate a legend page explaining the meaning of the various boxes and -# arrows in the dot generated graphs. - -GENERATE_LEGEND = YES - -# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will -# remove the intermediate dot files that are used to generate -# the various graphs. - -DOT_CLEANUP = YES diff --git a/cmake/Doxygen.extra.css.in b/cmake/Doxygen.extra.css.in deleted file mode 100644 index 022974f..0000000 --- a/cmake/Doxygen.extra.css.in +++ /dev/null @@ -1,14 +0,0 @@ -/* increase vertical space */ -#titlearea, #nav-path { - display: none; - height: 0px; -} - - -/* uncomment these lines for some extra vertical space */ - -/* -.tablist li { - line-height: 26px; -} -*/ diff --git a/cmake/FindBacktrace.cmake b/cmake/FindBacktrace.cmake deleted file mode 100644 index 8137125..0000000 --- a/cmake/FindBacktrace.cmake +++ /dev/null @@ -1,98 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. See accompanying -# file Copyright.txt or https://cmake.org/licensing for details. - -#.rst: -# FindBacktrace -# ------------- -# -# Find provider for backtrace(3). -# -# Checks if OS supports backtrace(3) via either libc or custom library. -# This module defines the following variables: -# -# ``Backtrace_HEADER`` -# The header file needed for backtrace(3). Cached. -# Could be forcibly set by user. -# ``Backtrace_INCLUDE_DIRS`` -# The include directories needed to use backtrace(3) header. -# ``Backtrace_LIBRARIES`` -# The libraries (linker flags) needed to use backtrace(3), if any. -# ``Backtrace_FOUND`` -# Is set if and only if backtrace(3) support detected. -# -# The following cache variables are also available to set or use: -# -# ``Backtrace_LIBRARY`` -# The external library providing backtrace, if any. -# ``Backtrace_INCLUDE_DIR`` -# The directory holding the backtrace(3) header. -# -# Typical usage is to generate of header file using configure_file() with the -# contents like the following:: -# -# #cmakedefine01 Backtrace_FOUND -# #if Backtrace_FOUND -# # include <${Backtrace_HEADER}> -# #endif -# -# And then reference that generated header file in actual source. - -include(CMakePushCheckState) -include(CheckSymbolExists) -include(FindPackageHandleStandardArgs) - -# List of variables to be provided to find_package_handle_standard_args() -set(_Backtrace_STD_ARGS Backtrace_INCLUDE_DIR) - -if(Backtrace_HEADER) - set(_Backtrace_HEADER_TRY "${Backtrace_HEADER}") -else(Backtrace_HEADER) - set(_Backtrace_HEADER_TRY "execinfo.h") -endif(Backtrace_HEADER) - -find_path(Backtrace_INCLUDE_DIR "${_Backtrace_HEADER_TRY}") -set(Backtrace_INCLUDE_DIRS ${Backtrace_INCLUDE_DIR}) - -if (NOT DEFINED Backtrace_LIBRARY) - # First, check if we already have backtrace(), e.g., in libc - cmake_push_check_state(RESET) - set(CMAKE_REQUIRED_INCLUDES ${Backtrace_INCLUDE_DIRS}) - set(CMAKE_REQUIRED_QUIET ${Backtrace_FIND_QUIETLY}) - check_symbol_exists("backtrace" "${_Backtrace_HEADER_TRY}" _Backtrace_SYM_FOUND) - cmake_pop_check_state() -endif() - -if(_Backtrace_SYM_FOUND) - # Avoid repeating the message() call below each time CMake is run. - if(NOT Backtrace_FIND_QUIETLY AND NOT DEFINED Backtrace_LIBRARY) - message(STATUS "backtrace facility detected in default set of libraries") - endif() - set(Backtrace_LIBRARY "" CACHE FILEPATH "Library providing backtrace(3), empty for default set of libraries") -else() - # Check for external library, for non-glibc systems - if(Backtrace_INCLUDE_DIR) - # OpenBSD has libbacktrace renamed to libexecinfo - find_library(Backtrace_LIBRARY "execinfo") - elseif() # respect user wishes - set(_Backtrace_HEADER_TRY "backtrace.h") - find_path(Backtrace_INCLUDE_DIR ${_Backtrace_HEADER_TRY}) - find_library(Backtrace_LIBRARY "backtrace") - endif() - - # Prepend list with library path as it's more common practice - set(_Backtrace_STD_ARGS Backtrace_LIBRARY ${_Backtrace_STD_ARGS}) -endif() - -message(STATUS "Backtrace_LIBRARY: ${Backtrace_LIBRARY}") -if(Backtrace_LIBRARY STREQUAL "NOTFOUND") - set(Backtrace_LIBRARY "") -endif() -if(Backtrace_LIBRARY STREQUAL "Backtrace_LIBRARY-NOTFOUND") - set(Backtrace_LIBRARY "") -endif() - -set(Backtrace_LIBRARIES ${Backtrace_LIBRARY}) -set(Backtrace_HEADER "${_Backtrace_HEADER_TRY}" CACHE STRING "Header providing backtrace(3) facility") - -find_package_handle_standard_args(Backtrace FOUND_VAR Backtrace_FOUND REQUIRED_VARS ${_Backtrace_STD_ARGS}) -mark_as_advanced(Backtrace_HEADER Backtrace_INCLUDE_DIR Backtrace_LIBRARY) diff --git a/cmake/FindBerkeleyDB.cmake b/cmake/FindBerkeleyDB.cmake deleted file mode 100644 index 916d8f9..0000000 --- a/cmake/FindBerkeleyDB.cmake +++ /dev/null @@ -1,25 +0,0 @@ -# - Try to find Berkeley DB -# Once done this will define -# -# BERKELEY_DB_FOUND - system has Berkeley DB -# BERKELEY_DB_INCLUDE_DIR - the Berkeley DB include directory -# BERKELEY_DB_LIBRARIES - Link these to use Berkeley DB -# BERKELEY_DB_DEFINITIONS - Compiler switches required for using Berkeley DB - -# Copyright (c) 2006, Alexander Dymo, -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -find_path(BERKELEY_DB_INCLUDE_DIR db_cxx.h - /usr/include/db4 - /usr/local/include/db4 -) - -find_library(BERKELEY_DB_LIBRARIES NAMES db_cxx ) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Berkeley "Could not find Berkeley DB >= 4.1" BERKELEY_DB_INCLUDE_DIR BERKELEY_DB_LIBRARIES) -# show the BERKELEY_DB_INCLUDE_DIR and BERKELEY_DB_LIBRARIES variables only in the advanced view -mark_as_advanced(BERKELEY_DB_INCLUDE_DIR BERKELEY_DB_LIBRARIES ) - diff --git a/cmake/FindHIDAPI.cmake b/cmake/FindHIDAPI.cmake deleted file mode 100644 index ca1c8e4..0000000 --- a/cmake/FindHIDAPI.cmake +++ /dev/null @@ -1,60 +0,0 @@ -# - try to find HIDAPI library -# from http://www.signal11.us/oss/hidapi/ -# -# Cache Variables: (probably not for direct use in your scripts) -# HIDAPI_INCLUDE_DIR -# HIDAPI_LIBRARY -# -# Non-cache variables you might use in your CMakeLists.txt: -# HIDAPI_FOUND -# HIDAPI_INCLUDE_DIRS -# HIDAPI_LIBRARIES -# -# Requires these CMake modules: -# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) -# -# Original Author: -# 2009-2010 Ryan Pavlik -# http://academic.cleardefinition.com -# Iowa State University HCI Graduate Program/VRAC -# -# Copyright Iowa State University 2009-2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -find_library(HIDAPI_LIBRARY - NAMES hidapi hidapi-libusb) - -find_path(HIDAPI_INCLUDE_DIR - NAMES hidapi.h - PATH_SUFFIXES - hidapi) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(HIDAPI - DEFAULT_MSG - HIDAPI_LIBRARY - HIDAPI_INCLUDE_DIR) - -if(HIDAPI_FOUND) - set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARY}") - if((STATIC AND UNIX AND NOT APPLE) OR (DEPENDS AND CMAKE_SYSTEM_NAME STREQUAL "Linux")) - find_library(LIBUSB-1.0_LIBRARY usb-1.0) - find_library(LIBUDEV_LIBRARY udev) - if(LIBUSB-1.0_LIBRARY) - set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARIES};${LIBUSB-1.0_LIBRARY}") - if(LIBUDEV_LIBRARY) - set(HIDAPI_LIBRARIES "${HIDAPI_LIBRARIES};${LIBUDEV_LIBRARY}") - else() - message(WARNING "libudev library not found, binaries may fail to link.") - endif() - else() - message(WARNING "libusb-1.0 library not found, binaries may fail to link.") - endif() - endif() - - set(HIDAPI_INCLUDE_DIRS "${HIDAPI_INCLUDE_DIR}") -endif() - -mark_as_advanced(HIDAPI_INCLUDE_DIR HIDAPI_LIBRARY) \ No newline at end of file diff --git a/cmake/FindLibunwind.cmake b/cmake/FindLibunwind.cmake deleted file mode 100644 index af657ca..0000000 --- a/cmake/FindLibunwind.cmake +++ /dev/null @@ -1,41 +0,0 @@ -# - Try to find libunwind -# Once done this will define -# -# LIBUNWIND_FOUND - system has libunwind -# LIBUNWIND_INCLUDE_DIR - the libunwind include directory -# LIBUNWIND_LIBRARIES - Link these to use libunwind -# LIBUNWIND_DEFINITIONS - Compiler switches required for using libunwind - -# Copyright (c) 2006, Alexander Dymo, -# -# Redistribution and use is allowed according to the terms of the BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. - -find_path(LIBUNWIND_INCLUDE_DIR libunwind.h - /usr/include - /usr/local/include -) - -find_library(LIBUNWIND_LIBRARIES NAMES unwind ) -if(NOT LIBUNWIND_LIBRARIES STREQUAL "LIBUNWIND_LIBRARIES-NOTFOUND") - if (CMAKE_COMPILER_IS_GNUCC) - set(LIBUNWIND_LIBRARIES "gcc_eh;${LIBUNWIND_LIBRARIES}") - endif() -endif() - -# some versions of libunwind need liblzma, and we don't use pkg-config -# so we just look whether liblzma is installed, and add it if it is. -# It might not be actually needed, but doesn't hurt if it is not. -# We don't need any headers, just the lib, as it's privately needed. -message(STATUS "looking for liblzma") -find_library(LIBLZMA_LIBRARIES lzma ) -if(NOT LIBLZMA_LIBRARIES STREQUAL "LIBLZMA_LIBRARIES-NOTFOUND") - message(STATUS "liblzma found") - set(LIBUNWIND_LIBRARIES "${LIBUNWIND_LIBRARIES};${LIBLZMA_LIBRARIES}") -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Libunwind "Could not find libunwind" LIBUNWIND_INCLUDE_DIR LIBUNWIND_LIBRARIES) -# show the LIBUNWIND_INCLUDE_DIR and LIBUNWIND_LIBRARIES variables only in the advanced view -mark_as_advanced(LIBUNWIND_INCLUDE_DIR LIBUNWIND_LIBRARIES ) - diff --git a/cmake/FindMiniupnpc.cmake b/cmake/FindMiniupnpc.cmake deleted file mode 100644 index ad2004a..0000000 --- a/cmake/FindMiniupnpc.cmake +++ /dev/null @@ -1,59 +0,0 @@ -# --------------------------------- FindMiniupnpc Start --------------------------------- -# Locate miniupnp library -# This module defines -# MINIUPNP_FOUND, if false, do not try to link to miniupnp -# MINIUPNP_LIBRARY, the miniupnp variant -# MINIUPNP_INCLUDE_DIR, where to find miniupnpc.h and family) -# MINIUPNPC_VERSION_1_7_OR_HIGHER, set if we detect the version of miniupnpc is 1.7 or higher -# -# Note that the expected include convention is -# #include "miniupnpc.h" -# and not -# #include -# This is because, the miniupnpc location is not standardized and may exist -# in locations other than miniupnpc/ - -if (MINIUPNP_INCLUDE_DIR AND MINIUPNP_LIBRARY) - # Already in cache, be silent - set(MINIUPNP_FIND_QUIETLY TRUE) -endif () - -find_path(MINIUPNP_INCLUDE_DIR miniupnpc.h - HINTS $ENV{MINIUPNP_INCLUDE_DIR} - PATH_SUFFIXES miniupnpc -) - -find_library(MINIUPNP_LIBRARY miniupnpc - HINTS $ENV{MINIUPNP_LIBRARY} -) - -find_library(MINIUPNP_STATIC_LIBRARY libminiupnpc.a - HINTS $ENV{MINIUPNP_STATIC_LIBRARY} -) - -set(MINIUPNP_INCLUDE_DIRS ${MINIUPNP_INCLUDE_DIR}) -set(MINIUPNP_LIBRARIES ${MINIUPNP_LIBRARY}) -set(MINIUPNP_STATIC_LIBRARIES ${MINIUPNP_STATIC_LIBRARY}) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args( - MiniUPnPc DEFAULT_MSG - MINIUPNP_INCLUDE_DIR - MINIUPNP_LIBRARY -) - -IF(MINIUPNPC_FOUND) - file(STRINGS "${MINIUPNP_INCLUDE_DIR}/miniupnpc.h" MINIUPNPC_API_VERSION_STR REGEX "^#define[\t ]+MINIUPNPC_API_VERSION[\t ]+[0-9]+") - if(MINIUPNPC_API_VERSION_STR MATCHES "^#define[\t ]+MINIUPNPC_API_VERSION[\t ]+([0-9]+)") - set(MINIUPNPC_API_VERSION "${CMAKE_MATCH_1}") - if (${MINIUPNPC_API_VERSION} GREATER "10" OR ${MINIUPNPC_API_VERSION} EQUAL "10") - message(STATUS "Found miniupnpc API version " ${MINIUPNPC_API_VERSION}) - set(MINIUPNP_FOUND true) - set(MINIUPNPC_VERSION_1_7_OR_HIGHER true) - endif() - endif() - -ENDIF() - -mark_as_advanced(MINIUPNP_INCLUDE_DIR MINIUPNP_LIBRARY MINIUPNP_STATIC_LIBRARY) -# --------------------------------- FindMiniupnpc End --------------------------------- diff --git a/cmake/FindReadline.cmake b/cmake/FindReadline.cmake deleted file mode 100644 index f26911b..0000000 --- a/cmake/FindReadline.cmake +++ /dev/null @@ -1,91 +0,0 @@ -# - Try to find readline include dirs and libraries -# -# Usage of this module as follows: -# -# find_package(Readline) -# -# Variables used by this module, they can change the default behaviour and need -# to be set before calling find_package: -# -# Readline_ROOT_DIR Set this variable to the root installation of -# readline if the module has problems finding the -# proper installation path. -# -# Variables defined by this module: -# -# READLINE_FOUND System has readline, include and lib dirs found -# GNU_READLINE_FOUND Version of readline found is GNU readline, not libedit! -# LIBEDIT_FOUND Version of readline found is libedit, not GNU readline! -# Readline_INCLUDE_DIR The readline include directories. -# Readline_LIBRARY The readline library. -# GNU_READLINE_LIBRARY The GNU readline library or empty string. -# LIBEDIT_LIBRARY The libedit library or empty string. - -find_path(Readline_ROOT_DIR - NAMES include/readline/readline.h - PATHS /usr/local/opt/readline/ /opt/local/ /usr/local/ /usr/ - NO_DEFAULT_PATH -) - -find_path(Readline_INCLUDE_DIR - NAMES readline/readline.h - PATHS ${Readline_ROOT_DIR}/include - NO_DEFAULT_PATH -) - -find_library(Readline_LIBRARY - NAMES readline - PATHS ${Readline_ROOT_DIR}/lib - NO_DEFAULT_PATH -) - -find_library(Termcap_LIBRARY - NAMES tinfo termcap ncursesw ncurses cursesw curses -) - -if(Readline_INCLUDE_DIR AND Readline_LIBRARY) - set(READLINE_FOUND TRUE) -else(Readline_INCLUDE_DIR AND Readline_LIBRARY) - FIND_LIBRARY(Readline_LIBRARY NAMES readline PATHS Readline_ROOT_DIR) - include(FindPackageHandleStandardArgs) - FIND_PACKAGE_HANDLE_STANDARD_ARGS(Readline DEFAULT_MSG Readline_INCLUDE_DIR Readline_LIBRARY ) - MARK_AS_ADVANCED(Readline_INCLUDE_DIR Readline_LIBRARY) -endif(Readline_INCLUDE_DIR AND Readline_LIBRARY) - -mark_as_advanced( - Readline_ROOT_DIR - Readline_INCLUDE_DIR - Readline_LIBRARY -) - -set(CMAKE_REQUIRED_INCLUDES ${Readline_INCLUDE_DIR}) -set(CMAKE_REQUIRED_LIBRARIES ${Readline_LIBRARY}) - -include(CheckFunctionExists) -check_function_exists(rl_copy_text HAVE_COPY_TEXT) -check_function_exists(rl_filename_completion_function HAVE_COMPLETION_FUNCTION) - -if(NOT HAVE_COMPLETION_FUNCTION) - if (Readline_LIBRARY) - set(CMAKE_REQUIRED_LIBRARIES ${Readline_LIBRARY} ${Termcap_LIBRARY}) - endif(Readline_LIBRARY) - check_function_exists(rl_copy_text HAVE_COPY_TEXT_TC) - check_function_exists(rl_filename_completion_function HAVE_COMPLETION_FUNCTION_TC) - set(HAVE_COMPLETION_FUNCTION ${HAVE_COMPLETION_FUNCTION_TC}) - set(HAVE_COPY_TEXT ${HAVE_COPY_TEXT_TC}) - if(HAVE_COMPLETION_FUNCTION) - set(Readline_LIBRARY ${Readline_LIBRARY} ${Termcap_LIBRARY}) - endif(HAVE_COMPLETION_FUNCTION) -endif(NOT HAVE_COMPLETION_FUNCTION) - -set(LIBEDIT_LIBRARY "") -set(GNU_READLINE_LIBRARY "") - -if(HAVE_COMPLETION_FUNCTION AND HAVE_COPY_TEXT) - set(GNU_READLINE_FOUND TRUE) - set(GNU_READLINE_LIBRARY ${Readline_LIBRARY}) -elseif(READLINE_FOUND AND NOT HAVE_COPY_TEXT) - set(LIBEDIT_FOUND TRUE) - set(LIBEDIT_LIBRARY ${Readline_LIBRARY}) -endif(HAVE_COMPLETION_FUNCTION AND HAVE_COPY_TEXT) - diff --git a/cmake/FindUnbound.cmake b/cmake/FindUnbound.cmake deleted file mode 100644 index e3eb3d6..0000000 --- a/cmake/FindUnbound.cmake +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (c) 2014-2019, The Monero Project -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, are -# permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this list of -# conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, this list -# of conditions and the following disclaimer in the documentation and/or other -# materials provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its contributors may be -# used to endorse or promote products derived from this software without specific -# prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -# THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -MESSAGE(STATUS "Looking for libunbound") - -FIND_PATH(UNBOUND_INCLUDE_DIR - NAMES unbound.h - PATH_SUFFIXES include/ include/unbound/ - PATHS "${PROJECT_SOURCE_DIR}" - ${UNBOUND_ROOT} - $ENV{UNBOUND_ROOT} - /usr/local/ - /usr/ -) - -find_library(UNBOUND_LIBRARIES unbound) diff --git a/cmake/FindZBAR.cmake b/cmake/FindZBAR.cmake new file mode 100644 index 0000000..94f26df --- /dev/null +++ b/cmake/FindZBAR.cmake @@ -0,0 +1,29 @@ +find_package(PkgConfig) + +if(PkgConfig_FOUND) + pkg_check_modules(PC_ZBAR QUIET zbar) + if(PC_ZBAR_FOUND) + set(ZBAR_DEFINITIONS ${PC_ZBAR_CFLAGS_OTHER}) + find_library(ZBAR_LIBRARIES NAMES zbar HINTS ${PC_ZBAR_LIBDIR} ${PC_ZBAR_LIBRARY_DIRS}) + find_path(ZBAR_INCLUDE_DIR Decoder.h HINTS ${PC_ZBAR_INCLUDEDIR} ${PC_ZBAR_INCLUDE_DIRS}) + endif() +endif() + +if(NOT ZBAR_LIBRARIES AND ANDROID) + find_library(ZBARJNI_LIBRARY NAMES zbarjni) + find_library(ICONV_LIBRARY NAMES iconv) + if(ZBARJNI_LIBRARY AND ICONV_LIBRARY) + set(ZBAR_LIBRARIES ${ZBARJNI_LIBRARY} ${ICONV_LIBRARY}) + endif() +endif() + +if(NOT ZBAR_INCLUDE_DIR) + find_path(ZBAR_H_PATH zbar.h) + if(ZBAR_H_PATH) + set(ZBAR_INCLUDE_DIR "${ZBAR_H_PATH}") + endif() +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(ZBAR DEFAULT_MSG ZBAR_LIBRARIES ZBAR_INCLUDE_DIR) +message(STATUS "Found zbar libraries ${ZBAR_LIBRARIES}") diff --git a/cmake/FindZBar0.cmake b/cmake/FindZBar0.cmake deleted file mode 100644 index efb1009..0000000 --- a/cmake/FindZBar0.cmake +++ /dev/null @@ -1,22 +0,0 @@ -# from http://code.google.com/p/low-cost-vision-2012/source/browse/CMakeModules/FindZBar0.cmake?name=2-helium-1&r=d61f248bd5565b3c086bf4769a04bfd98f7079df -# - Try to find ZBar -# This will define -# -# ZBAR_FOUND - -# ZBAR_LIBRARY_DIR - -# ZBAR_INCLUDE_DIR - -# ZBAR_LIBRARIES - -# - -find_package(PkgConfig) -pkg_check_modules(PC_ZBAR QUIET zbar) -set(ZBAR_DEFINITIONS ${PC_ZBAR_CFLAGS_OTHER}) -find_library(ZBAR_LIBRARIES NAMES zbar - HINTS ${PC_ZBAR_LIBDIR} ${PC_ZBAR_LIBRARY_DIRS} ) -find_path(ZBAR_INCLUDE_DIR Decoder.h - HINTS ${PC_ZBAR_INCLUDEDIR} ${PC_ZBAR_INCLUDE_DIRS} - PATH_SUFFIXES zbar ) -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(ZBAR DEFAULT_MSG ZBAR_LIBRARIES ZBAR_INCLUDE_DIR) -message(STATUS "Found zbar libraries ${ZBAR_LIBRARIES}") - diff --git a/cmake/FindZLIB.cmake b/cmake/FindZLIB.cmake new file mode 100644 index 0000000..c86758f --- /dev/null +++ b/cmake/FindZLIB.cmake @@ -0,0 +1,154 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[=======================================================================[.rst: +FindZLIB +-------- + +Find the native ZLIB includes and library. + +IMPORTED Targets +^^^^^^^^^^^^^^^^ + +.. versionadded:: 3.1 + +This module defines :prop_tgt:`IMPORTED` target ``ZLIB::ZLIB``, if +ZLIB has been found. + +Result Variables +^^^^^^^^^^^^^^^^ + +This module defines the following variables: + +:: + + ZLIB_INCLUDE_DIRS - where to find zlib.h, etc. + ZLIB_LIBRARIES - List of libraries when using zlib. + ZLIB_FOUND - True if zlib found. + +:: + + ZLIB_VERSION_STRING - The version of zlib found (x.y.z) + ZLIB_VERSION_MAJOR - The major version of zlib + ZLIB_VERSION_MINOR - The minor version of zlib + ZLIB_VERSION_PATCH - The patch version of zlib + ZLIB_VERSION_TWEAK - The tweak version of zlib + +.. versionadded:: 3.4 + Debug and Release variants are found separately. + +Backward Compatibility +^^^^^^^^^^^^^^^^^^^^^^ + +The following variable are provided for backward compatibility + +:: + + ZLIB_MAJOR_VERSION - The major version of zlib + ZLIB_MINOR_VERSION - The minor version of zlib + ZLIB_PATCH_VERSION - The patch version of zlib + +Hints +^^^^^ + +A user may set ``ZLIB_ROOT`` to a zlib installation root to tell this +module where to look. +#]=======================================================================] + +set(_ZLIB_SEARCHES) + +# Search ZLIB_ROOT first if it is set. +if(ZLIB_ROOT) + set(_ZLIB_SEARCH_ROOT PATHS ${ZLIB_ROOT} NO_DEFAULT_PATH) + list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_ROOT) +endif() + +# Normal search. +set(_ZLIB_x86 "(x86)") +set(_ZLIB_SEARCH_NORMAL + PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\GnuWin32\\Zlib;InstallPath]" + "$ENV{ProgramFiles}/zlib" + "$ENV{ProgramFiles${_ZLIB_x86}}/zlib") +unset(_ZLIB_x86) +list(APPEND _ZLIB_SEARCHES _ZLIB_SEARCH_NORMAL) + +set(ZLIB_NAMES z zlib zdll zlib1 zlibstatic) +set(ZLIB_NAMES_DEBUG zd zlibd zdlld zlibd1 zlib1d zlibstaticd) + +# Try each search configuration. +foreach(search ${_ZLIB_SEARCHES}) + find_path(ZLIB_INCLUDE_DIR NAMES zlib.h ${${search}} PATH_SUFFIXES include) +endforeach() + +# Allow ZLIB_LIBRARY to be set manually, as the location of the zlib library +if(NOT ZLIB_LIBRARY) + foreach(search ${_ZLIB_SEARCHES}) + find_library(ZLIB_LIBRARY_RELEASE NAMES ${ZLIB_NAMES} NAMES_PER_DIR ${${search}} PATH_SUFFIXES lib) + find_library(ZLIB_LIBRARY_DEBUG NAMES ${ZLIB_NAMES_DEBUG} NAMES_PER_DIR ${${search}} PATH_SUFFIXES lib) + endforeach() + + include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake) + select_library_configurations(ZLIB) +endif() + +unset(ZLIB_NAMES) +unset(ZLIB_NAMES_DEBUG) + +mark_as_advanced(ZLIB_INCLUDE_DIR) + +if(ZLIB_INCLUDE_DIR AND EXISTS "${ZLIB_INCLUDE_DIR}/zlib.h") + file(STRINGS "${ZLIB_INCLUDE_DIR}/zlib.h" ZLIB_H REGEX "^#define ZLIB_VERSION \"[^\"]*\"$") + + string(REGEX REPLACE "^.*ZLIB_VERSION \"([0-9]+).*$" "\\1" ZLIB_VERSION_MAJOR "${ZLIB_H}") + string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_MINOR "${ZLIB_H}") + string(REGEX REPLACE "^.*ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.([0-9]+).*$" "\\1" ZLIB_VERSION_PATCH "${ZLIB_H}") + set(ZLIB_VERSION_STRING "${ZLIB_VERSION_MAJOR}.${ZLIB_VERSION_MINOR}.${ZLIB_VERSION_PATCH}") + + # only append a TWEAK version if it exists: + set(ZLIB_VERSION_TWEAK "") + if( "${ZLIB_H}" MATCHES "ZLIB_VERSION \"[0-9]+\\.[0-9]+\\.[0-9]+\\.([0-9]+)") + set(ZLIB_VERSION_TWEAK "${CMAKE_MATCH_1}") + string(APPEND ZLIB_VERSION_STRING ".${ZLIB_VERSION_TWEAK}") + endif() + + set(ZLIB_MAJOR_VERSION "${ZLIB_VERSION_MAJOR}") + set(ZLIB_MINOR_VERSION "${ZLIB_VERSION_MINOR}") + set(ZLIB_PATCH_VERSION "${ZLIB_VERSION_PATCH}") +endif() + +include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_LIBRARY ZLIB_INCLUDE_DIR + VERSION_VAR ZLIB_VERSION_STRING) + +if(ZLIB_FOUND) + set(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) + + if(NOT ZLIB_LIBRARIES) + set(ZLIB_LIBRARIES ${ZLIB_LIBRARY}) + endif() + + if(NOT TARGET ZLIB::ZLIB) + add_library(ZLIB::ZLIB UNKNOWN IMPORTED) + set_target_properties(ZLIB::ZLIB PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${ZLIB_INCLUDE_DIRS}") + + if(ZLIB_LIBRARY_RELEASE) + set_property(TARGET ZLIB::ZLIB APPEND PROPERTY + IMPORTED_CONFIGURATIONS RELEASE) + set_target_properties(ZLIB::ZLIB PROPERTIES + IMPORTED_LOCATION_RELEASE "${ZLIB_LIBRARY_RELEASE}") + endif() + + if(ZLIB_LIBRARY_DEBUG) + set_property(TARGET ZLIB::ZLIB APPEND PROPERTY + IMPORTED_CONFIGURATIONS DEBUG) + set_target_properties(ZLIB::ZLIB PROPERTIES + IMPORTED_LOCATION_DEBUG "${ZLIB_LIBRARY_DEBUG}") + endif() + + if(NOT ZLIB_LIBRARY_RELEASE AND NOT ZLIB_LIBRARY_DEBUG) + set_property(TARGET ZLIB::ZLIB APPEND PROPERTY + IMPORTED_LOCATION "${ZLIB_LIBRARY}") + endif() + endif() +endif() \ No newline at end of file diff --git a/cmake/test-protobuf.cpp b/cmake/test-protobuf.cpp deleted file mode 100644 index 0a1ca82..0000000 --- a/cmake/test-protobuf.cpp +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2014-2019, The Monero Project -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, are -// permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of -// conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list -// of conditions and the following disclaimer in the documentation and/or other -// materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be -// used to endorse or promote products derived from this software without specific -// prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include -#include -#include -#include -#include "test-protobuf.pb.h" - -int main(int argc, char *argv[]) { - google::protobuf::UnknownFieldSet ufs; - ufs.ClearAndFreeMemory(); - - Success sc; - sc.set_message("test"); - sc.SerializeToOstream(&std::cerr); - return 0; -} diff --git a/cmake/test-protobuf.proto b/cmake/test-protobuf.proto deleted file mode 100644 index 5300aea..0000000 --- a/cmake/test-protobuf.proto +++ /dev/null @@ -1,7 +0,0 @@ -syntax = "proto2"; - -import "google/protobuf/descriptor.proto"; - -message Success { - optional string message = 1; -} diff --git a/cmake/test-static-assert.c b/cmake/test-static-assert.c deleted file mode 100644 index 2e6c848..0000000 --- a/cmake/test-static-assert.c +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2014-2019, The Monero Project -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, are -// permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of -// conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list -// of conditions and the following disclaimer in the documentation and/or other -// materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be -// used to endorse or promote products derived from this software without specific -// prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -static_assert(1, "FAIL"); -int main(int argc, char *argv[]) { - return 0; -} diff --git a/cmake/test-static-assert.cpp b/cmake/test-static-assert.cpp deleted file mode 100644 index 2e6c848..0000000 --- a/cmake/test-static-assert.cpp +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2014-2019, The Monero Project -// -// All rights reserved. -// -// Redistribution and use in source and binary forms, with or without modification, are -// permitted provided that the following conditions are met: -// -// 1. Redistributions of source code must retain the above copyright notice, this list of -// conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright notice, this list -// of conditions and the following disclaimer in the documentation and/or other -// materials provided with the distribution. -// -// 3. Neither the name of the copyright holder nor the names of its contributors may be -// used to endorse or promote products derived from this software without specific -// prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -// THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, -// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF -// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -#include - -static_assert(1, "FAIL"); -int main(int argc, char *argv[]) { - return 0; -} From 3db3e330d5034d2b1add2cf7d50d1222f6a2ecf3 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Fri, 25 Jun 2021 16:14:49 +0200 Subject: [PATCH 4/5] Qr Scanner --- CMakeLists.txt | 41 +++------ Dockerfile | 3 +- Dockerfile.windows | 22 ++++- Makefile | 1 + contrib/build-appimage.sh | 21 ++++- src/CMakeLists.txt | 66 +++++++++++--- src/libwalletqt/CMakeLists.txt | 2 - src/main.cpp | 1 + src/mainwindow.cpp | 6 +- src/mainwindow.h | 1 + src/model/CMakeLists.txt | 4 - src/qrcode_scanner/CMakeLists.txt | 3 + src/qrcode_scanner/QrCodeScanDialog.cpp | 76 ++++++++++++++++ src/qrcode_scanner/QrCodeScanDialog.h | 39 +++++++++ src/qrcode_scanner/QrCodeScanDialog.ui | 110 ++++++++++++++++++++++++ src/qrcode_scanner/QrCodeScanner.cpp | 72 ++++++++++++++++ src/qrcode_scanner/QrCodeScanner.h | 48 +++++++++++ src/qrcode_scanner/QrScanThread.cpp | 102 ++++++++++++++++++++++ src/qrcode_scanner/QrScanThread.h | 44 ++++++++++ src/sendwidget.cpp | 26 ++++++ src/sendwidget.h | 2 + src/sendwidget.ui | 65 +++++++++++--- src/utils/CMakeLists.txt | 2 - src/utils/childproc.h | 2 +- 24 files changed, 693 insertions(+), 66 deletions(-) create mode 100644 src/qrcode_scanner/CMakeLists.txt create mode 100644 src/qrcode_scanner/QrCodeScanDialog.cpp create mode 100644 src/qrcode_scanner/QrCodeScanDialog.h create mode 100644 src/qrcode_scanner/QrCodeScanDialog.ui create mode 100644 src/qrcode_scanner/QrCodeScanner.cpp create mode 100644 src/qrcode_scanner/QrCodeScanner.h create mode 100644 src/qrcode_scanner/QrScanThread.cpp create mode 100644 src/qrcode_scanner/QrScanThread.h diff --git a/CMakeLists.txt b/CMakeLists.txt index d2da336..5e52e00 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,7 @@ option(TOR_BIN "Path to Tor binary to embed inside Feather" OFF) option(CHECK_UPDATES "Enable checking for application updates" OFF) option(USE_DEVICE_TREZOR "Trezor support compilation" OFF) option(DONATE_BEG "Prompt donation window every once in a while" ON) +option(WITH_SCANNER "Enable webcam QR scanner" OFF) list(INSERT CMAKE_MODULE_PATH 0 "${CMAKE_SOURCE_DIR}/cmake") include(CheckCCompilerFlag) @@ -56,34 +57,8 @@ if(STATIC) set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_STATIC_RUNTIME ON) - add_definitions(-DMONERO_GUI_STATIC) endif() -function (add_c_flag_if_supported flag var) - string(REPLACE "-" "_" supported ${flag}_c) - check_c_compiler_flag(${flag} ${supported}) - if(${${supported}}) - set(${var} "${${var}} ${flag}" PARENT_SCOPE) - endif() -endfunction() - -function (add_cxx_flag_if_supported flag var) - string(REPLACE "-" "_" supported ${flag}_cxx) - check_cxx_compiler_flag(${flag} ${supported}) - if(${${supported}}) - set(${var} "${${var}} ${flag}" PARENT_SCOPE) - endif() -endfunction() - -function (add_linker_flag_if_supported flag var) - string(REPLACE "-" "_" supported ${flag}_ld) - string(REPLACE "," "_" supported ${flag}_ld) - check_linker_flag(${flag} ${supported}) - if(${${supported}}) - set(${var} "${${var}} ${flag}" PARENT_SCOPE) - endif() -endfunction() - find_package(Git) if(GIT_FOUND) execute_process(COMMAND git rev-parse "HEAD" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/monero OUTPUT_VARIABLE _MONERO_HEAD OUTPUT_STRIP_TRAILING_WHITESPACE) @@ -125,6 +100,13 @@ set(HIDAPI_FOUND OFF) # QrEncode find_package(QREncode REQUIRED) +# Qr scanner +if (WITH_SCANNER) + find_package(ZBAR REQUIRED) + message(STATUS "libzbar: include dir at ${ZBAR_INCLUDE_DIR}") + message(STATUS "libzbar: libraries at ${ZBAR_LIBRARIES}") +endif() + # Tevador 14 word Monero seed find_package(monero-seed CONFIG) if(NOT monero-seed_FOUND) @@ -199,9 +181,10 @@ if(TOR_BIN) execute_process(COMMAND bash -c "${TOR_BIN} --version --quiet" OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE out RESULT_VARIABLE ret) if (ret EQUAL "0") - set(TOR_VERSION "${out}") + string(REGEX MATCH "[0-9]+\.[0-9]+\.[0-9]+\.[0-9]" version ${out}) + set(TOR_VERSION "${version}") endif() - message(STATUS "${TOR_VERSION}") + message(STATUS "Embedded Tor version: ${TOR_VERSION}") configure_file("cmake/config-feather.h.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/src/config-feather.h") # on the buildbot Tor is baked into the image @@ -245,7 +228,7 @@ if(MINGW) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wa,-mbig-obj") set(EXTRA_LIBRARIES mswsock;ws2_32;iphlpapi;crypt32;bcrypt) if(DEPENDS) - set(ICU_LIBRARIES iconv) + set(ICU_LIBRARIES iconv) else() set(ICU_LIBRARIES icuio icuin icuuc icudt icutu iconv) endif() diff --git a/Dockerfile b/Dockerfile index c85013e..2a620ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ # bionic-20210615.1 (18.04) FROM ubuntu@sha256:ce1e17c0e0aa9db95cf19fb6ba297eb2a52b9ba71768f32a74ab39213c416600 -ARG THREADS=1 +ARG THREADS=4 ENV CFLAGS="-fPIC" ENV CPPFLAGS="-fPIC" @@ -11,6 +11,7 @@ ENV DEBIAN_FRONTEND=noninteractive # Feather build flags ENV CHECK_UPDATES=ON +ENV WITH_SCANNER=ON COPY --from=featherwallet/feather-deps:linux-beta-8 /deps /deps COPY --from=featherwallet/feather-deps:linux-beta-8 /var/cache/apt/archives /archives diff --git a/Dockerfile.windows b/Dockerfile.windows index da29f88..cf1a2b9 100644 --- a/Dockerfile.windows +++ b/Dockerfile.windows @@ -3,13 +3,21 @@ FROM ubuntu:20.04 ARG THREADS=1 ARG QT_VERSION=5.15.2 ENV SOURCE_DATE_EPOCH=1397818193 +ENV DEBIAN_FRONTEND=noninteractive + +# Feather build flags +ENV CHECK_UPDATES=ON +ENV WITH_SCANNER=ON ENV OPENSSL_ROOT_DIR=/usr/local/openssl/ ENV TOR_BIN=/usr/local/tor/bin/tor.exe RUN apt update && \ - DEBIAN_FRONTEND=noninteractive apt install -y curl wget zip automake build-essential cmake gcc-mingw-w64 g++-mingw-w64 gettext git libtool pkg-config \ - python && \ + apt install -y \ + curl wget zip automake build-essential cmake gcc-mingw-w64 g++-mingw-w64 gettext git libtool pkg-config \ + python \ +# zbar + autopoint && \ rm -rf /var/lib/apt/lists/* RUN update-alternatives --set x86_64-w64-mingw32-g++ $(which x86_64-w64-mingw32-g++-posix) && \ @@ -189,4 +197,12 @@ RUN git clone https://github.com/nih-at/libzip.git && \ -DBUILD_SHARED_LIBS=OFF \ -DCMAKE_PREFIX_PATH=/usr/x86_64-w64-mingw32 && \ make -j$THREADS && \ - make -j$THREADS install \ No newline at end of file + make -j$THREADS install + +RUN git clone -b 0.23.92 --depth 1 --recursive https://github.com/mchehab/zbar.git && \ + cd zbar && \ + git reset --hard aac86d5f08d64ab4c3da78188eb622fa3cb07182 && \ + autoreconf -vfi && \ + ./configure --enable-static --disable-shared --without-imagemagick --disable-video --without-xv --with-gtk=no --with-python=no --enable-doc=no --host=x86_64-w64-mingw32 && \ + make -j$THREADS && \ + make install \ No newline at end of file diff --git a/Makefile b/Makefile index bde8936..7d01330 100644 --- a/Makefile +++ b/Makefile @@ -45,6 +45,7 @@ CMAKEFLAGS = \ release-static: CMAKEFLAGS += -DBUILD_TAG="linux-x64" release-static: CMAKEFLAGS += -DTOR_BIN=$(or ${TOR_BIN},OFF) release-static: CMAKEFLAGS += -DCHECK_UPDATES=$(or ${CHECK_UPDATES}, Off) +release-static: CMAKEFLAGS += -DWITH_SCANNER=$(or ${WITH_SCANNER}, Off) release-static: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Release release-static: CMAKEFLAGS += -DREPRODUCIBLE=$(or ${SOURCE_DATE_EPOCH},OFF) release-static: diff --git a/contrib/build-appimage.sh b/contrib/build-appimage.sh index 3ba8157..6c7ff9c 100755 --- a/contrib/build-appimage.sh +++ b/contrib/build-appimage.sh @@ -8,20 +8,35 @@ rm -rf $APPDIR mkdir -p "$APPDIR" mkdir -p "$APPDIR/usr/share/applications/" mkdir -p "$APPDIR/usr/bin" +mkdir -p "$APPDIR/usr/lib" +mkdir -p "$APPDIR/usr/plugins" cp "$PWD/../src/assets/feather.desktop" "$APPDIR/usr/share/applications/feather.desktop" cp "$PWD/../src/assets/images/appicons/64x64.png" "$APPDIR/feather.png" cp "$PWD/bin/feather" "$APPDIR/usr/bin/feather" +chmod +x "$APPDIR/usr/bin/feather" -LD_LIBRARY_PATH=/usr/local/lib /linuxdeployqt/squashfs-root/AppRun feather.AppDir/usr/share/applications/feather.desktop -bundle-non-qt-libs +export LD_LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu/:/usr/local/lib/$LD_LIBRARY_PATH +linuxdeployqt feather.AppDir/usr/share/applications/feather.desktop -bundle-non-qt-libs + +pushd feather.AppDir/usr/plugins +ln -s ../lib/ gstreamer +popd + +cp -r /usr/lib/x86_64-linux-gnu/gstreamer-1.0/* feather.AppDir/usr/plugins/gstreamer/ +cp /usr/lib/x86_64-linux-gnu/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner feather.AppDir/usr/plugins/gstreamer/ + +rm "$APPDIR/AppRun" +cp "$PWD/../contrib/AppImage/AppRun" "$APPDIR/" +chmod +x "$APPDIR/AppRun" find feather.AppDir/ -exec touch -h -a -m -t 202101010100.00 {} \; # Manually create AppImage (reproducibly) # download runtime -wget -nc https://github.com/AppImage/AppImageKit/releases/download/12/runtime-x86_64 -echo "24da8e0e149b7211cbfb00a545189a1101cb18d1f27d4cfc1895837d2c30bc30 runtime-x86_64" | sha256sum -c +wget -nc https://github.com/AppImage/AppImageKit/releases/download/13/runtime-x86_64 +echo "328e0d745c5c6817048c27bc3e8314871703f8f47ffa81a37cb06cd95a94b323 runtime-x86_64" | sha256sum -c mksquashfs feather.AppDir feather.squashfs -info -root-owned -no-xattrs -noappend -fstime 0 # mksquashfs writes a timestamp to the header diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index bdac1b5..56d9314 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -5,11 +5,24 @@ set(CMAKE_AUTOUIC ON) # pthread find_package(Threads REQUIRED) -find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui Network Svg Xml WebSockets) +set(QT5_COMPONENTS + Core + Widgets + Gui + Network + Svg + Xml + WebSockets +) + +if (WITH_SCANNER) + list(APPEND QT5_COMPONENTS + Multimedia + MultimediaWidgets) +endif() + +find_package(Qt5 REQUIRED COMPONENTS ${QT5_COMPONENTS}) -add_subdirectory(libwalletqt) -add_subdirectory(model) -add_subdirectory(utils) add_subdirectory(openpgp) qt5_add_resources(RESOURCES assets.qrc) @@ -46,6 +59,15 @@ file(GLOB SOURCE_FILES "dialog/*.cpp" ) +if (WITH_SCANNER) + file(GLOB SCANNER_FILES + "qrcode_scanner/*.h" + "qrcode_scanner/*.cpp") + + list(APPEND SOURCE_FILES + ${SCANNER_FILES}) +endif() + if(TOR_BIN) if(APPLE) set(ASSETS_TOR "assets_tor_macos.qrc") @@ -90,12 +112,9 @@ set_target_properties(feather PROPERTIES set_property(TARGET feather PROPERTY RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin") -target_include_directories(feather PUBLIC ${OPENGL_INCLUDE_DIR}) +#target_include_directories(feather PUBLIC ${OPENGL_INCLUDE_DIR}) target_include_directories(feather PUBLIC ${Qt5Gui_PRIVATE_INCLUDE_DIRS}) -file(GLOB_RECURSE SRC_SOURCES *.cpp) -file(GLOB_RECURSE SRC_HEADERS *.h) - target_include_directories(feather PUBLIC ${CMAKE_BINARY_DIR}/src/feather_autogen/include ${CMAKE_SOURCE_DIR}/monero/include @@ -124,6 +143,14 @@ target_include_directories(feather PUBLIC ${LIBZIP_INCLUDE_DIRS} ) +if(WITH_SCANNER) + target_include_directories(feather PUBLIC + ${ZBAR_INCLUDE_DIR} + ${Qt5Multimedia_INCLUDE_DIRS} + ${Qt5MultimediaWidgets_INCLUDE_DIRS} + ) +endif() + if(DONATE_BEG) target_compile_definitions(feather PRIVATE DONATE_BEG=1) endif() @@ -144,6 +171,10 @@ if(XMRIG) target_compile_definitions(feather PRIVATE HAS_XMRIG=1) endif() +if(WITH_SCANNER) + target_compile_definitions(feather PRIVATE WITH_SCANNER=1) +endif() + # TODO: PLACEHOLDER target_compile_definitions(feather PRIVATE HAS_WEBSOCKET=1) @@ -172,7 +203,14 @@ target_compile_definitions(feather ${Qt5Svg_DEFINITIONS} ${Qt5Xml_DEFINITIONS} ${Qt5WebSockets_DEFINITIONS} - ) +) + +if (WITH_SCANNER) + target_compile_definitions(feather PUBLIC + ${Qt5Multimedia_DEFINITIONS} + ${Qt5MultimediaWidgets_DEFINITIONS} + ) +endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}") @@ -212,6 +250,14 @@ target_link_libraries(feather ${LIBZIP_LIBRARIES} ) +if (WITH_SCANNER) + target_link_libraries(feather + Qt5::Multimedia + Qt5::MultimediaWidgets + ${ZBAR_LIBRARIES} + ) +endif() + if(APPLE) target_link_libraries(feather KDMacTouchBar @@ -247,4 +293,4 @@ endif() install(TARGETS feather DESTINATION ${CMAKE_INSTALL_PREFIX} - ) +) diff --git a/src/libwalletqt/CMakeLists.txt b/src/libwalletqt/CMakeLists.txt index 7d16b0f..e69de29 100644 --- a/src/libwalletqt/CMakeLists.txt +++ b/src/libwalletqt/CMakeLists.txt @@ -1,2 +0,0 @@ -file(GLOB_RECURSE SRC_SOURCES *.cpp) -file(GLOB_RECURSE SRC_HEADERS *.h) diff --git a/src/main.cpp b/src/main.cpp index a62ae80..62fdb9f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -14,6 +14,7 @@ #if defined(Q_OS_WIN) #include +#include #endif #if defined(Q_OS_LINUX) && defined(STATIC) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 2ec89f1..fd415fa 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -74,6 +74,7 @@ MainWindow::MainWindow(WindowManager *windowManager, Wallet *wallet, QWidget *pa connect(m_windowSettings, &Settings::preferredFiatCurrencyChanged, m_sendWidget, QOverload<>::of(&SendWidget::onPreferredFiatCurrencyChanged)); connect(m_windowSettings, &Settings::amountPrecisionChanged, m_ctx.get(), &AppContext::onAmountPrecisionChanged); connect(m_windowSettings, &Settings::skinChanged, this, &MainWindow::skinChanged); + QTimer::singleShot(1, [this]{this->updateWidgetIcons();}); connect(m_windowManager, &WindowManager::torSettingsChanged, m_ctx.get(), &AppContext::onTorSettingsChanged); connect(torManager(), &TorManager::connectionStateChanged, this, &MainWindow::onTorConnectionStateChanged); @@ -791,11 +792,14 @@ void MainWindow::menuVerifyTxProof() { void MainWindow::skinChanged(const QString &skinName) { m_windowManager->changeSkin(skinName); ColorScheme::updateFromWidget(this); + this->updateWidgetIcons(); +} +void MainWindow::updateWidgetIcons() { + m_sendWidget->skinChanged(); #ifdef HAS_LOCALMONERO m_localMoneroWidget->skinChanged(); #endif - ui->conversionWidget->skinChanged(); } diff --git a/src/mainwindow.h b/src/mainwindow.h index eaecad9..efe14ff 100644 --- a/src/mainwindow.h +++ b/src/mainwindow.h @@ -204,6 +204,7 @@ private: void updateTitle(); void donationNag(); void updateRecentlyOpened(const QString &filename); + void updateWidgetIcons(); Ui::MainWindow *ui; WindowManager *m_windowManager; diff --git a/src/model/CMakeLists.txt b/src/model/CMakeLists.txt index 9ca31c6..e69de29 100644 --- a/src/model/CMakeLists.txt +++ b/src/model/CMakeLists.txt @@ -1,4 +0,0 @@ -file(GLOB_RECURSE SRC_SOURCES *.cpp) -file(GLOB_RECURSE SRC_HEADERS *.h) - - diff --git a/src/qrcode_scanner/CMakeLists.txt b/src/qrcode_scanner/CMakeLists.txt new file mode 100644 index 0000000..e927cef --- /dev/null +++ b/src/qrcode_scanner/CMakeLists.txt @@ -0,0 +1,3 @@ +file(GLOB_RECURSE SRC_SOURCES *.cpp) +file(GLOB_RECURSE SRC_HEADERS *.h) + diff --git a/src/qrcode_scanner/QrCodeScanDialog.cpp b/src/qrcode_scanner/QrCodeScanDialog.cpp new file mode 100644 index 0000000..9d70f17 --- /dev/null +++ b/src/qrcode_scanner/QrCodeScanDialog.cpp @@ -0,0 +1,76 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2020-2021, The Monero Project. + +#include "QrCodeScanDialog.h" +#include "ui_QrCodeScanDialog.h" + +#include +#include +#include + +QrCodeScanDialog::QrCodeScanDialog(QWidget *parent) + : QDialog(parent) + , ui(new Ui::QrCodeScanDialog) + , m_scanner(new QrCodeScanner(this)) +{ + ui->setupUi(this); + this->setWindowTitle("Scan QR Code"); + + QPixmap pixmap = QPixmap(":/assets/images/warning.png"); + ui->icon_warning->setPixmap(pixmap.scaledToWidth(32, Qt::SmoothTransformation)); + + m_cameras = QCameraInfo::availableCameras(); + if (m_cameras.count() < 1) { + QMessageBox::warning(parent, "QR code scanner", "No available cameras found."); + this->close(); + } + + for (const auto &camera : m_cameras) { + ui->combo_camera->addItem(camera.deviceName()); + } + + connect(ui->combo_camera, QOverload::of(&QComboBox::currentIndexChanged), this, &QrCodeScanDialog::onCameraSwitched); + + connect(m_scanner, &QrCodeScanner::decoded, this, &QrCodeScanDialog::onDecoded); + connect(m_scanner, &QrCodeScanner::notifyError, this, &QrCodeScanDialog::notifyError); + + this->onCameraSwitched(0); +} + +void QrCodeScanDialog::onCameraSwitched(int index) { + if (index >= m_cameras.size()) { + return; + } + + m_scanner->setSource(nullptr); + delete m_camera; + + m_camera = new QCamera(m_cameras.at(index), this); + connect(m_camera, &QCamera::statusChanged, [this](QCamera::Status status){ + bool unloaded = (status == QCamera::Status::UnloadedStatus); + ui->frame_unavailable->setVisible(unloaded); + }); + + m_camera->setCaptureMode(QCamera::CaptureViewfinder); + m_camera->setViewfinder(ui->viewfinder); + + m_scanner->setSource(m_camera); + m_scanner->setEnabled(true); + + m_camera->start(); +} + +void QrCodeScanDialog::onDecoded(int type, const QString &data) { + decodedString = data; + this->accept(); +} + +void QrCodeScanDialog::notifyError(const QString &msg) { + qDebug() << "QrScanner error: " << msg; +} + +QrCodeScanDialog::~QrCodeScanDialog() +{ + delete m_camera; + delete ui; +} \ No newline at end of file diff --git a/src/qrcode_scanner/QrCodeScanDialog.h b/src/qrcode_scanner/QrCodeScanDialog.h new file mode 100644 index 0000000..5fe1ff4 --- /dev/null +++ b/src/qrcode_scanner/QrCodeScanDialog.h @@ -0,0 +1,39 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2020-2021, The Monero Project. + +#ifndef FEATHER_QRCODESCANDIALOG_H +#define FEATHER_QRCODESCANDIALOG_H + +#include +#include + +#include "QrCodeScanner.h" + +namespace Ui { + class QrCodeScanDialog; +} + +class QrCodeScanDialog : public QDialog +{ + Q_OBJECT + +public: + explicit QrCodeScanDialog(QWidget *parent); + ~QrCodeScanDialog() override; + + QString decodedString = ""; + +private slots: + void onCameraSwitched(int index); + void onDecoded(int type, const QString &data); + void notifyError(const QString &msg); + +private: + Ui::QrCodeScanDialog *ui; + + QList m_cameras; + QCamera *m_camera = nullptr; + QrCodeScanner *m_scanner; +}; + +#endif //FEATHER_QRCODESCANDIALOG_H \ No newline at end of file diff --git a/src/qrcode_scanner/QrCodeScanDialog.ui b/src/qrcode_scanner/QrCodeScanDialog.ui new file mode 100644 index 0000000..fb555eb --- /dev/null +++ b/src/qrcode_scanner/QrCodeScanDialog.ui @@ -0,0 +1,110 @@ + + + QrCodeScanDialog + + + + 0 + 0 + 400 + 300 + + + + Dialog + + + + + + + 0 + 0 + + + + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 0 + + + + icon + + + + + + + Qt::Horizontal + + + QSizePolicy::Preferred + + + + 10 + 0 + + + + + + + + Lost connection to camera. Please restart scan dialog. + + + true + + + + + + + + + + + + + 0 + 0 + + + + Camera: + + + + + + + + + + + + + QCameraViewfinder + QWidget +
qcameraviewfinder.h
+ 1 +
+
+ + +
diff --git a/src/qrcode_scanner/QrCodeScanner.cpp b/src/qrcode_scanner/QrCodeScanner.cpp new file mode 100644 index 0000000..44c211c --- /dev/null +++ b/src/qrcode_scanner/QrCodeScanner.cpp @@ -0,0 +1,72 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2014-2021, The Monero Project. + +#include "QrCodeScanner.h" +#include +#include +#include + +QrCodeScanner::QrCodeScanner(QObject *parent) + : QObject(parent) + , m_processTimerId(-1) + , m_processInterval(750) + , m_enabled(true) +{ + m_probe = new QVideoProbe(this); + m_thread = new QrScanThread(this); + m_thread->start(); + + connect(m_thread, &QrScanThread::decoded, this, &QrCodeScanner::decoded); + connect(m_thread, &QrScanThread::notifyError, this, &QrCodeScanner::notifyError); + connect(m_probe, &QVideoProbe::videoFrameProbed, this, &QrCodeScanner::processFrame); +} + +void QrCodeScanner::setSource(QCamera *camera) +{ + m_probe->setSource((QMediaObject *)camera); +} + +void QrCodeScanner::processFrame(const QVideoFrame &frame) +{ + if (frame.isValid()){ + m_curFrame = frame; + } +} + +bool QrCodeScanner::enabled() const +{ + return m_enabled; +} + +void QrCodeScanner::setEnabled(bool enabled) +{ + m_enabled = enabled; + if(!enabled && (m_processTimerId != -1) ) + { + this->killTimer(m_processTimerId); + m_processTimerId = -1; + } + else if (enabled && (m_processTimerId == -1) ) + { + m_processTimerId = this->startTimer(m_processInterval); + } + emit enabledChanged(); +} + +void QrCodeScanner::timerEvent(QTimerEvent *event) +{ + if (event->timerId() == m_processTimerId) { + m_thread->addFrame(m_curFrame); + } +} + +QrCodeScanner::~QrCodeScanner() +{ + m_thread->stop(); + m_thread->quit(); + if (!m_thread->wait(5000)) + { + m_thread->terminate(); + m_thread->wait(); + } +} diff --git a/src/qrcode_scanner/QrCodeScanner.h b/src/qrcode_scanner/QrCodeScanner.h new file mode 100644 index 0000000..5339faf --- /dev/null +++ b/src/qrcode_scanner/QrCodeScanner.h @@ -0,0 +1,48 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2014-2020, The Monero Project. + + +#ifndef QRCODESCANNER_H_ +#define QRCODESCANNER_H_ + +#include +#include +#include "QrScanThread.h" + +class QVideoProbe; +class QCamera; + +class QrCodeScanner : public QObject +{ +Q_OBJECT + +Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) + +public: + explicit QrCodeScanner(QObject *parent = nullptr); + ~QrCodeScanner() override; + void setSource(QCamera*); + + bool enabled() const; + void setEnabled(bool enabled); + +public slots: + void processFrame(const QVideoFrame &frame); + +signals: + void enabledChanged(); + void decoded(int type, const QString &data); + void decode(int type, const QString &data); + void notifyError(const QString &error, bool warning = false); + +protected: + void timerEvent(QTimerEvent *); + QrScanThread *m_thread; + int m_processTimerId; + int m_processInterval; + int m_enabled; + QVideoFrame m_curFrame; + QVideoProbe *m_probe; +}; + +#endif diff --git a/src/qrcode_scanner/QrScanThread.cpp b/src/qrcode_scanner/QrScanThread.cpp new file mode 100644 index 0000000..2cfb0b7 --- /dev/null +++ b/src/qrcode_scanner/QrScanThread.cpp @@ -0,0 +1,102 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2014-2020, The Monero Project. + +#include "QrScanThread.h" +#include +#include + +QrScanThread::QrScanThread(QObject *parent) + : QThread(parent) + , m_running(true) +{ + m_scanner.set_handler(*this); +} + +void QrScanThread::image_callback(zbar::Image &image) +{ + qDebug() << "image_callback : Found Code ! " ; + for (zbar::Image::SymbolIterator sym = image.symbol_begin(); sym != image.symbol_end(); ++sym) { + if (!sym->get_count()) { + QString data = QString::fromStdString(sym->get_data()); + emit decoded(sym->get_type(), data); + } + } +} + +void QrScanThread::processZImage(zbar::Image &image) +{ + m_scanner.recycle_image(image); + zbar::Image tmp = image.convert(*(long*)"Y800"); + m_scanner.scan(tmp); + image.set_symbols(tmp.get_symbols()); +} + +bool QrScanThread::zimageFromQImage(const QImage &qimg, zbar::Image &dst) +{ + switch( qimg.format() ){ + case QImage::Format_RGB32 : + case QImage::Format_ARGB32 : + case QImage::Format_ARGB32_Premultiplied : + break; + default : + qDebug() << "Format: " << qimg.format(); + emit notifyError(QString("Invalid QImage Format !")); + return false; + } + unsigned int bpl( qimg.bytesPerLine() ), width( bpl / 4), height( qimg.height()); + dst.set_size(width, height); + dst.set_format("BGR4"); + unsigned long datalen = qimg.sizeInBytes(); + dst.set_data(qimg.bits(), datalen); + if((width * 4 != bpl) || (width * height * 4 > datalen)){ + emit notifyError(QString("QImage to Zbar::Image failed !")); + return false; + } + return true; +} + +void QrScanThread::processQImage(const QImage &qimg) +{ + try { + m_image = QSharedPointer(new zbar::Image()); + if (!zimageFromQImage(qimg, *m_image)) + return; + processZImage(*m_image); + } + catch(std::exception &e) { + qDebug() << "ERROR: " << e.what(); + emit notifyError(e.what()); + } +} + +void QrScanThread::processVideoFrame(const QVideoFrame &frame) +{ + processQImage(frame.image()); +} + +void QrScanThread::stop() +{ + m_running = false; + m_waitCondition.wakeOne(); +} + +void QrScanThread::addFrame(const QVideoFrame &frame) +{ + QMutexLocker locker(&m_mutex); + m_queue.append(frame); + m_waitCondition.wakeOne(); +} + +void QrScanThread::run() +{ + QVideoFrame frame; + while (m_running) { + QMutexLocker locker(&m_mutex); + while (m_queue.isEmpty() && m_running) { + m_waitCondition.wait(&m_mutex); + } + if (!m_queue.isEmpty()) { + processVideoFrame(m_queue.takeFirst()); + } + } +} \ No newline at end of file diff --git a/src/qrcode_scanner/QrScanThread.h b/src/qrcode_scanner/QrScanThread.h new file mode 100644 index 0000000..9575340 --- /dev/null +++ b/src/qrcode_scanner/QrScanThread.h @@ -0,0 +1,44 @@ +// SPDX-License-Identifier: BSD-3-Clause +// Copyright (c) 2020, The Monero Project. + +#ifndef _QRSCANTHREAD_H_ +#define _QRSCANTHREAD_H_ + +#include +#include +#include +#include +#include +#include +#include + +class QrScanThread : public QThread, public zbar::Image::Handler +{ + Q_OBJECT + +public: + QrScanThread(QObject *parent = nullptr); + void addFrame(const QVideoFrame &frame); + virtual void stop(); + +signals: + void decoded(int type, const QString &data); + void notifyError(const QString &error, bool warning = false); + +protected: + virtual void run(); + void processVideoFrame(const QVideoFrame &); + void processQImage(const QImage &); + void processZImage(zbar::Image &image); + virtual void image_callback(zbar::Image &image); + bool zimageFromQImage(const QImage&, zbar::Image &); + +private: + zbar::ImageScanner m_scanner; + QSharedPointer m_image; + bool m_running; + QMutex m_mutex; + QWaitCondition m_waitCondition; + QList m_queue; +}; +#endif \ No newline at end of file diff --git a/src/sendwidget.cpp b/src/sendwidget.cpp index 2e1cd29..60f3fdc 100644 --- a/src/sendwidget.cpp +++ b/src/sendwidget.cpp @@ -7,6 +7,12 @@ #include "ui_sendwidget.h" #include "constants.h" #include "utils/AppData.h" +#include "Icons.h" +#include "ColorScheme.h" + +#ifdef WITH_SCANNER +#include "qrcode_scanner/QrCodeScanDialog.h" +#endif SendWidget::SendWidget(QSharedPointer ctx, QWidget *parent) : QWidget(parent) @@ -26,6 +32,7 @@ SendWidget::SendWidget(QSharedPointer ctx, QWidget *parent) connect(m_ctx.get(), &AppContext::openAliasResolved, this, &SendWidget::onOpenAliasResolved); connect(m_ctx.get(), &AppContext::openAliasResolveError, this, &SendWidget::onOpenAliasResolveError); + connect(ui->btnScan, &QPushButton::clicked, this, &SendWidget::scanClicked); connect(ui->btnSend, &QPushButton::clicked, this, &SendWidget::sendClicked); connect(ui->btnClear, &QPushButton::clicked, this, &SendWidget::clearClicked); connect(ui->btnMax, &QPushButton::clicked, this, &SendWidget::btnMaxClicked); @@ -103,6 +110,17 @@ void SendWidget::fillAddress(const QString &address) { ui->lineAddress->moveCursor(QTextCursor::Start); } +void SendWidget::scanClicked() { +#ifdef WITH_SCANNER + auto *dialog = new QrCodeScanDialog(this); + dialog->exec(); + ui->lineAddress->setText(dialog->decodedString); + dialog->deleteLater(); +#else + QMessageBox::warning(this, "QR scanner", "Feather was built without webcam QR scanner support."); +#endif +} + void SendWidget::sendClicked() { if (!m_ctx->wallet->isConnected()) { QMessageBox::warning(this, "Error", "Unable to create transaction:\n\n" @@ -276,6 +294,14 @@ void SendWidget::onPreferredFiatCurrencyChanged() { this->setupComboBox(); } +void SendWidget::skinChanged() { + if (ColorScheme::hasDarkBackground(this)) { + ui->btnScan->setIcon(icons()->icon("camera_white.png")); + } else { + ui->btnScan->setIcon(icons()->icon("camera_dark.png")); + } +} + SendWidget::~SendWidget() { delete ui; } diff --git a/src/sendwidget.h b/src/sendwidget.h index f4666db..f72b985 100644 --- a/src/sendwidget.h +++ b/src/sendwidget.h @@ -26,6 +26,8 @@ public: ~SendWidget() override; public slots: + void skinChanged(); + void scanClicked(); void sendClicked(); void clearClicked(); void aliasClicked(); diff --git a/src/sendwidget.ui b/src/sendwidget.ui index 5de0934..8ad083d 100644 --- a/src/sendwidget.ui +++ b/src/sendwidget.ui @@ -52,17 +52,51 @@ - - - Qt::ScrollBarAlwaysOff + + + 10 - - true - - - QPlainTextEdit::NoWrap - - + + + + Qt::ScrollBarAlwaysOff + + + true + + + QPlainTextEdit::NoWrap + + + + + + + + + Qt::Vertical + + + QSizePolicy::Preferred + + + + 20 + 0 + + + + + + + + Scan + + + + + + @@ -208,6 +242,17 @@
widgets/PayToEdit.h
+ + lineAddress + lineDescription + lineAmount + comboCurrencySelection + btnMax + btn_openAlias + btnClear + btnSend + btnScan + diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt index 7d16b0f..e69de29 100644 --- a/src/utils/CMakeLists.txt +++ b/src/utils/CMakeLists.txt @@ -1,2 +0,0 @@ -file(GLOB_RECURSE SRC_SOURCES *.cpp) -file(GLOB_RECURSE SRC_HEADERS *.h) diff --git a/src/utils/childproc.h b/src/utils/childproc.h index 00afda7..b7548ed 100644 --- a/src/utils/childproc.h +++ b/src/utils/childproc.h @@ -15,7 +15,7 @@ class ChildProcess : public QProcess { Q_OBJECT public: explicit ChildProcess(QObject* parent = nullptr); - ~ChildProcess(); + ~ChildProcess() override; protected: void setupChildProcess() override; }; From a1db9ade6bdd7c348ee85380d4107cc41507ba19 Mon Sep 17 00:00:00 2001 From: tobtoht Date: Sun, 27 Jun 2021 02:41:30 +0200 Subject: [PATCH 5/5] QrScanner: macOS support --- Dockerfile | 2 +- Makefile | 1 + src/qrcode_scanner/QrCodeScanDialog.cpp | 75 ++++++++++++++++++++----- src/qrcode_scanner/QrCodeScanDialog.h | 17 +++++- src/qrcode_scanner/QrCodeScanner.cpp | 72 ------------------------ src/qrcode_scanner/QrCodeScanner.h | 48 ---------------- src/qrcode_scanner/QrScanThread.cpp | 14 ++--- src/qrcode_scanner/QrScanThread.h | 6 +- 8 files changed, 83 insertions(+), 152 deletions(-) delete mode 100644 src/qrcode_scanner/QrCodeScanner.cpp delete mode 100644 src/qrcode_scanner/QrCodeScanner.h diff --git a/Dockerfile b/Dockerfile index 2a620ff..a162361 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,7 +42,7 @@ RUN git clone -b v3.18.4 --depth 1 https://github.com/Kitware/CMake && \ make -j$THREADS install && \ rm -rf $(pwd) -# freetype2: Required for Qt 5.15 +# freetype2: Required for Qt 5.15, fontconfig RUN git clone -b VER-2-10-2 --depth 1 https://git.savannah.gnu.org/git/freetype/freetype2.git && \ cd freetype2 && \ git reset --hard 132f19b779828b194b3fede187cee719785db4d8 && \ diff --git a/Makefile b/Makefile index 7d01330..dc0c2a3 100644 --- a/Makefile +++ b/Makefile @@ -59,6 +59,7 @@ depends: mac-release: CMAKEFLAGS += -DSTATIC=Off mac-release: CMAKEFLAGS += -DTOR_BIN=$(or ${TOR_BIN},OFF) mac-release: CMAKEFLAGS += -DCHECK_UPDATES=$(or ${CHECK_UPDATES}, Off) +mac-release: CMAKEFLAGS += -DWITH_SCANNER=$(or ${WITH_SCANNER}, On) mac-release: CMAKEFLAGS += -DBUILD_TAG="mac-x64" mac-release: CMAKEFLAGS += -DCMAKE_BUILD_TYPE=Release mac-release: diff --git a/src/qrcode_scanner/QrCodeScanDialog.cpp b/src/qrcode_scanner/QrCodeScanDialog.cpp index 9d70f17..502f308 100644 --- a/src/qrcode_scanner/QrCodeScanDialog.cpp +++ b/src/qrcode_scanner/QrCodeScanDialog.cpp @@ -11,7 +11,6 @@ QrCodeScanDialog::QrCodeScanDialog(QWidget *parent) : QDialog(parent) , ui(new Ui::QrCodeScanDialog) - , m_scanner(new QrCodeScanner(this)) { ui->setupUi(this); this->setWindowTitle("Scan QR Code"); @@ -31,10 +30,16 @@ QrCodeScanDialog::QrCodeScanDialog(QWidget *parent) connect(ui->combo_camera, QOverload::of(&QComboBox::currentIndexChanged), this, &QrCodeScanDialog::onCameraSwitched); - connect(m_scanner, &QrCodeScanner::decoded, this, &QrCodeScanDialog::onDecoded); - connect(m_scanner, &QrCodeScanner::notifyError, this, &QrCodeScanDialog::notifyError); - this->onCameraSwitched(0); + + m_thread = new QrScanThread(this); + m_thread->start(); + + connect(m_thread, &QrScanThread::decoded, this, &QrCodeScanDialog::onDecoded); + connect(m_thread, &QrScanThread::notifyError, this, &QrCodeScanDialog::notifyError); + + connect(&m_imageTimer, &QTimer::timeout, this, &QrCodeScanDialog::takeImage); + m_imageTimer.start(500); } void QrCodeScanDialog::onCameraSwitched(int index) { @@ -42,24 +47,60 @@ void QrCodeScanDialog::onCameraSwitched(int index) { return; } - m_scanner->setSource(nullptr); - delete m_camera; + m_camera.reset(new QCamera(m_cameras.at(index))); - m_camera = new QCamera(m_cameras.at(index), this); - connect(m_camera, &QCamera::statusChanged, [this](QCamera::Status status){ + auto captureMode = QCamera::CaptureStillImage; + if (m_camera->isCaptureModeSupported(captureMode)) { + m_camera->setCaptureMode(captureMode); + } + + connect(m_camera.data(), QOverload::of(&QCamera::error), this, &QrCodeScanDialog::displayCameraError); + connect(m_camera.data(), &QCamera::statusChanged, [this](QCamera::Status status){ bool unloaded = (status == QCamera::Status::UnloadedStatus); ui->frame_unavailable->setVisible(unloaded); }); - m_camera->setCaptureMode(QCamera::CaptureViewfinder); + m_imageCapture.reset(new QCameraImageCapture(m_camera.data())); + if (!m_imageCapture->isCaptureDestinationSupported(QCameraImageCapture::CaptureToBuffer)) { + qDebug() << "Capture to buffer is NOT supported"; + } + + m_imageCapture->setCaptureDestination(QCameraImageCapture::CaptureToBuffer); + + connect(m_imageCapture.data(), &QCameraImageCapture::imageAvailable, this, &QrCodeScanDialog::processAvailableImage); + connect(m_imageCapture.data(), QOverload::of(&QCameraImageCapture::error), + this, &QrCodeScanDialog::displayCaptureError); + m_camera->setViewfinder(ui->viewfinder); - - m_scanner->setSource(m_camera); - m_scanner->setEnabled(true); - m_camera->start(); } +void QrCodeScanDialog::displayCaptureError(int id, const QCameraImageCapture::Error error, const QString &errorString) +{ + Q_UNUSED(id); + Q_UNUSED(error); + QMessageBox::warning(this, "Image Capture Error", errorString); +} + +void QrCodeScanDialog::displayCameraError() +{ + QMessageBox::warning(this, "Camera Error", m_camera->errorString()); +} + +void QrCodeScanDialog::processAvailableImage(int id, const QVideoFrame &frame) { + Q_UNUSED(id); + QImage img = frame.image(); + img.convertTo(QImage::Format_RGB32); + m_thread->addImage(img); +} + +void QrCodeScanDialog::takeImage() +{ + if (m_imageCapture->isReadyForCapture()) { + m_imageCapture->capture(); + } +} + void QrCodeScanDialog::onDecoded(int type, const QString &data) { decodedString = data; this->accept(); @@ -71,6 +112,12 @@ void QrCodeScanDialog::notifyError(const QString &msg) { QrCodeScanDialog::~QrCodeScanDialog() { - delete m_camera; + m_thread->stop(); + m_thread->quit(); + if (!m_thread->wait(5000)) + { + m_thread->terminate(); + m_thread->wait(); + } delete ui; } \ No newline at end of file diff --git a/src/qrcode_scanner/QrCodeScanDialog.h b/src/qrcode_scanner/QrCodeScanDialog.h index 5fe1ff4..8227ed1 100644 --- a/src/qrcode_scanner/QrCodeScanDialog.h +++ b/src/qrcode_scanner/QrCodeScanDialog.h @@ -6,8 +6,11 @@ #include #include +#include +#include +#include -#include "QrCodeScanner.h" +#include "QrScanThread.h" namespace Ui { class QrCodeScanDialog; @@ -29,11 +32,19 @@ private slots: void notifyError(const QString &msg); private: + void processAvailableImage(int id, const QVideoFrame &frame); + void displayCaptureError(int, QCameraImageCapture::Error, const QString &errorString); + void displayCameraError(); + void takeImage(); + Ui::QrCodeScanDialog *ui; + QScopedPointer m_camera; + QScopedPointer m_imageCapture; + + QrScanThread *m_thread; + QTimer m_imageTimer; QList m_cameras; - QCamera *m_camera = nullptr; - QrCodeScanner *m_scanner; }; #endif //FEATHER_QRCODESCANDIALOG_H \ No newline at end of file diff --git a/src/qrcode_scanner/QrCodeScanner.cpp b/src/qrcode_scanner/QrCodeScanner.cpp deleted file mode 100644 index 44c211c..0000000 --- a/src/qrcode_scanner/QrCodeScanner.cpp +++ /dev/null @@ -1,72 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// Copyright (c) 2014-2021, The Monero Project. - -#include "QrCodeScanner.h" -#include -#include -#include - -QrCodeScanner::QrCodeScanner(QObject *parent) - : QObject(parent) - , m_processTimerId(-1) - , m_processInterval(750) - , m_enabled(true) -{ - m_probe = new QVideoProbe(this); - m_thread = new QrScanThread(this); - m_thread->start(); - - connect(m_thread, &QrScanThread::decoded, this, &QrCodeScanner::decoded); - connect(m_thread, &QrScanThread::notifyError, this, &QrCodeScanner::notifyError); - connect(m_probe, &QVideoProbe::videoFrameProbed, this, &QrCodeScanner::processFrame); -} - -void QrCodeScanner::setSource(QCamera *camera) -{ - m_probe->setSource((QMediaObject *)camera); -} - -void QrCodeScanner::processFrame(const QVideoFrame &frame) -{ - if (frame.isValid()){ - m_curFrame = frame; - } -} - -bool QrCodeScanner::enabled() const -{ - return m_enabled; -} - -void QrCodeScanner::setEnabled(bool enabled) -{ - m_enabled = enabled; - if(!enabled && (m_processTimerId != -1) ) - { - this->killTimer(m_processTimerId); - m_processTimerId = -1; - } - else if (enabled && (m_processTimerId == -1) ) - { - m_processTimerId = this->startTimer(m_processInterval); - } - emit enabledChanged(); -} - -void QrCodeScanner::timerEvent(QTimerEvent *event) -{ - if (event->timerId() == m_processTimerId) { - m_thread->addFrame(m_curFrame); - } -} - -QrCodeScanner::~QrCodeScanner() -{ - m_thread->stop(); - m_thread->quit(); - if (!m_thread->wait(5000)) - { - m_thread->terminate(); - m_thread->wait(); - } -} diff --git a/src/qrcode_scanner/QrCodeScanner.h b/src/qrcode_scanner/QrCodeScanner.h deleted file mode 100644 index 5339faf..0000000 --- a/src/qrcode_scanner/QrCodeScanner.h +++ /dev/null @@ -1,48 +0,0 @@ -// SPDX-License-Identifier: BSD-3-Clause -// Copyright (c) 2014-2020, The Monero Project. - - -#ifndef QRCODESCANNER_H_ -#define QRCODESCANNER_H_ - -#include -#include -#include "QrScanThread.h" - -class QVideoProbe; -class QCamera; - -class QrCodeScanner : public QObject -{ -Q_OBJECT - -Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged) - -public: - explicit QrCodeScanner(QObject *parent = nullptr); - ~QrCodeScanner() override; - void setSource(QCamera*); - - bool enabled() const; - void setEnabled(bool enabled); - -public slots: - void processFrame(const QVideoFrame &frame); - -signals: - void enabledChanged(); - void decoded(int type, const QString &data); - void decode(int type, const QString &data); - void notifyError(const QString &error, bool warning = false); - -protected: - void timerEvent(QTimerEvent *); - QrScanThread *m_thread; - int m_processTimerId; - int m_processInterval; - int m_enabled; - QVideoFrame m_curFrame; - QVideoProbe *m_probe; -}; - -#endif diff --git a/src/qrcode_scanner/QrScanThread.cpp b/src/qrcode_scanner/QrScanThread.cpp index 2cfb0b7..a74d141 100644 --- a/src/qrcode_scanner/QrScanThread.cpp +++ b/src/qrcode_scanner/QrScanThread.cpp @@ -33,7 +33,7 @@ void QrScanThread::processZImage(zbar::Image &image) bool QrScanThread::zimageFromQImage(const QImage &qimg, zbar::Image &dst) { - switch( qimg.format() ){ + switch (qimg.format()) { case QImage::Format_RGB32 : case QImage::Format_ARGB32 : case QImage::Format_ARGB32_Premultiplied : @@ -69,34 +69,28 @@ void QrScanThread::processQImage(const QImage &qimg) } } -void QrScanThread::processVideoFrame(const QVideoFrame &frame) -{ - processQImage(frame.image()); -} - void QrScanThread::stop() { m_running = false; m_waitCondition.wakeOne(); } -void QrScanThread::addFrame(const QVideoFrame &frame) +void QrScanThread::addImage(const QImage &img) { QMutexLocker locker(&m_mutex); - m_queue.append(frame); + m_queue.append(img); m_waitCondition.wakeOne(); } void QrScanThread::run() { - QVideoFrame frame; while (m_running) { QMutexLocker locker(&m_mutex); while (m_queue.isEmpty() && m_running) { m_waitCondition.wait(&m_mutex); } if (!m_queue.isEmpty()) { - processVideoFrame(m_queue.takeFirst()); + processQImage(m_queue.takeFirst()); } } } \ No newline at end of file diff --git a/src/qrcode_scanner/QrScanThread.h b/src/qrcode_scanner/QrScanThread.h index 9575340..bba7823 100644 --- a/src/qrcode_scanner/QrScanThread.h +++ b/src/qrcode_scanner/QrScanThread.h @@ -8,7 +8,6 @@ #include #include #include -#include #include #include @@ -18,7 +17,7 @@ class QrScanThread : public QThread, public zbar::Image::Handler public: QrScanThread(QObject *parent = nullptr); - void addFrame(const QVideoFrame &frame); + void addImage(const QImage &img); virtual void stop(); signals: @@ -27,7 +26,6 @@ signals: protected: virtual void run(); - void processVideoFrame(const QVideoFrame &); void processQImage(const QImage &); void processZImage(zbar::Image &image); virtual void image_callback(zbar::Image &image); @@ -39,6 +37,6 @@ private: bool m_running; QMutex m_mutex; QWaitCondition m_waitCondition; - QList m_queue; + QList m_queue; }; #endif \ No newline at end of file