From 00341542ba32297be290de18ce107effb2a5ecb3 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Mon, 26 Jun 2017 18:10:18 +0200 Subject: [PATCH 01/77] Initial version of the build script Signed-off-by: Paul Cercueil --- build.sh | 260 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 260 insertions(+) create mode 100755 build.sh diff --git a/build.sh b/build.sh new file mode 100755 index 0000000000..11f655d697 --- /dev/null +++ b/build.sh @@ -0,0 +1,260 @@ +#!/usr/bin/bash.exe + +# Exit immediately if an error occurs +set -e + +export PATH=/bin:/usr/bin:/${MINGW_VERSION}/bin:/c/Program\ Files/Git/cmd:/c/Windows/System32 + +WORKDIR=${PWD} + +JOBS=3 + +CC=/${MINGW_VERSION}/bin/${ARCH}-w64-mingw32-gcc.exe +CXX=/${MINGW_VERSION}/bin/${ARCH}-w64-mingw32-g++.exe +CMAKE_OPTS="-DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=/${MINGW_VERSION} \ + -DCMAKE_C_COMPILER:FILEPATH=${CC} \ + -DCMAKE_CXX_COMPILER:FILEPATH=${CXX} \ + -DPKG_CONFIG_EXECUTABLE:FILEPATH=/${MINGW_VERSION}/bin/pkg-config.exe" +AUTOCONF_OPTS="--prefix=/msys64/${MINGW_VERSION} \ + --host=${ARCH}-w64-mingw32 \ + --enable-shared \ + --disable-static" + +DEPENDENCIES="mingw-w64-${ARCH}-libxml2 \ + mingw-w64-${ARCH}-libusb \ + mingw-w64-${ARCH}-boost \ + mingw-w64-${ARCH}-fftw \ + mingw-w64-${ARCH}-libzip \ + mingw-w64-${ARCH}-python3 \ + mingw-w64-${ARCH}-fftw \ + mingw-w64-${ARCH}-libzip \ + mingw-w64-${ARCH}-glib2 \ + mingw-w64-${ARCH}-glibmm \ + mingw-w64-${ARCH}-pkg-config \ + mingw-w64-${ARCH}-qt5" + +# Remove dependencies that prevent us from upgrading to GCC 6.2 +pacman -Rs --noconfirm \ + mingw-w64-${ARCH}-gcc-ada \ + mingw-w64-${ARCH}-gcc-fortran \ + mingw-w64-${ARCH}-gcc-libgfortran \ + mingw-w64-${ARCH}-gcc-objc + +# Remove existing file that causes GCC install to fail +rm /${MINGW_VERSION}/etc/gdbinit + +# Update to GCC 6.2 and install build-time dependencies +pacman --noconfirm -Sy \ + mingw-w64-${ARCH}-gcc \ + mingw-w64-${ARCH}-cmake \ + mingw-w64-${ARCH}-doxygen \ + mingw-w64-${ARCH}-swig \ + autoconf \ + automake-wrapper + +# Install dependencies +pacman --noconfirm -Sy ${DEPENDENCIES} + +# Fix Qt5 spec files +sed -i "s/\$\${CROSS_COMPILE}/${ARCH}-w64-mingw32-/" /${MINGW_VERSION}/share/qt5/mkspecs/win32-g++/qmake.conf + +build_libiio() { + git clone --depth 1 https://github.com/analogdevicesinc/libiio.git ${WORKDIR}/libiio + + mkdir ${WORKDIR}/libiio/build-${ARCH} + cd ${WORKDIR}/libiio/build-${ARCH} + + cmake -G 'Unix Makefiles' \ + ${CMAKE_OPTS} \ + -DWITH_TESTS:BOOL=OFF \ + -DWITH_DOC:BOOL=OFF \ + -DWITH_MATLAB_BINDINGS:BOOL=OFF \ + -DCSHARP_BINDINGS:BOOL=OFF \ + -DPYTHON_BINDINGS:BOOL=OFF \ + ${WORKDIR}/libiio + + make -j ${JOBS} install + DESTDIR=${WORKDIR} make -j ${JOBS} install +} + +build_libad9361() { + git clone --depth 1 https://github.com/analogdevicesinc/libad9361-iio.git ${WORKDIR}/libad9361 + + mkdir ${WORKDIR}/libad9361/build-${ARCH} + cd ${WORKDIR}/libad9361/build-${ARCH} + + cmake -G 'Unix Makefiles' \ + ${CMAKE_OPTS} \ + ${WORKDIR}/libad9361 + + make -j ${JOBS} install + DESTDIR=${WORKDIR} make -j ${JOBS} install +} + +build_libsigrok() { + git clone --depth 1 https://github.com/sschnelle/libsigrok.git ${WORKDIR}/libsigrok + + mkdir ${WORKDIR}/libsigrok/build-${ARCH} + cd ${WORKDIR}/libsigrok/build-${ARCH} + + ../autogen.sh + CPPFLAGS="-DLIBSIGROK_EXPORT=1" ../configure ${AUTOCONF_OPTS} \ + --without-libusb \ + --enable-all-drivers=no + + make -j ${JOBS} install + DESTDIR=${WORKDIR} make -j ${JOBS} install +} + +build_libsigrokdecode() { + mkdir -p ${WORKDIR}/libsigrokdecode/build-${ARCH} + cd ${WORKDIR}/libsigrokdecode/build-${ARCH} + + wget http://sigrok.org/download/source/libsigrokdecode/libsigrokdecode-0.4.1.tar.gz -O- \ + | tar xz --strip-components=1 -C ${WORKDIR}/libsigrokdecode + + CPPFLAGS="-DLIBSIGROKDECODE_EXPORT=1" ../configure ${AUTOCONF_OPTS} + + make -j ${JOBS} install + DESTDIR=${WORKDIR} make -j ${JOBS} install +} + +build_markdown() { + mkdir -p ${WORKDIR}/markdown + cd ${WORKDIR}/markdown + + wget https://pypi.python.org/packages/1d/25/3f6d2cb31ec42ca5bd3bfbea99b63892b735d76e26f20dd2dcc34ffe4f0d/Markdown-2.6.8.tar.gz -O- \ + | tar xz --strip-components=1 -C ${WORKDIR}/markdown + + python2 setup.py build + python2 setup.py install +} + +build_cheetah() { + mkdir -p ${WORKDIR}/cheetah + cd ${WORKDIR}/cheetah + + wget https://pypi.python.org/packages/cd/b0/c2d700252fc251e91c08639ff41a8a5203b627f4e0a2ae18a6b662ab32ea/Cheetah-2.4.4.tar.gz -O- \ + | tar xz --strip-components=1 -C ${WORKDIR}/cheetah + + python2 setup.py build + python2 setup.py install +} + +build_libvolk() { + mkdir -p ${WORKDIR}/libvolk/build-${ARCH} + cd ${WORKDIR}/libvolk/build-${ARCH} + + wget http://libvolk.org/releases/volk-1.3.tar.gz -O- \ + | tar xz --strip-components=1 -C ${WORKDIR}/libvolk + + cmake -G 'Unix Makefiles' ${CMAKE_OPTS} ${WORKDIR}/libvolk + + make -j ${JOBS} install + DESTDIR=${WORKDIR} make -j ${JOBS} install +} + +build_gnuradio() { + git clone --depth 1 https://github.com/analogdevicesinc/gnuradio.git -b fix-mingw ${WORKDIR}/gnuradio + + mkdir ${WORKDIR}/gnuradio/build-${ARCH} + cd ${WORKDIR}/gnuradio/build-${ARCH} + + cmake -G 'Unix Makefiles' \ + ${CMAKE_OPTS} \ + -DENABLE_DEFAULT:BOOL=OFF \ + -DENABLE_GNURADIO_RUNTIME:BOOL=ON \ + -DENABLE_GR_ANALOG:BOOL=ON \ + -DENABLE_GR_BLOCKS:BOOL=ON \ + -DENABLE_GR_FFT:BOOL=ON \ + -DENABLE_GR_FILTER:BOOL=ON \ + -DENABLE_INTERNAL_VOLK:BOOL=OFF \ + -DENABLE_PYTHON:BOOL=ON \ + -DSWIG_EXECUTABLE:FILEPATH=/${MINGW_VERSION}/bin/swig \ + ${WORKDIR}/gnuradio + + make -j ${JOBS} install + DESTDIR=${WORKDIR} make -j ${JOBS} install +} + +build_qwt() { + git clone --depth 1 https://github.com/osakared/qwt.git -b qwt-6.1-multiaxes ${WORKDIR}/qwt + cd ${WORKDIR}/qwt + + # Disable components that we won't build + sed -i "s/^QWT_CONFIG\\s*+=\\s*QwtMathML$/#/g" qwtconfig.pri + sed -i "s/^QWT_CONFIG\\s*+=\\s*QwtDesigner$/#/g" qwtconfig.pri + sed -i "s/^QWT_CONFIG\\s*+=\\s*QwtExamples$/#/g" qwtconfig.pri + + # Fix prefix + sed -i "s/^\\s*QWT_INSTALL_PREFIX.*$/QWT_INSTALL_PREFIX=\"\"/g" qwtconfig.pri + + cd ${WORKDIR}/qwt/src + qmake + make INSTALL_ROOT="/c/msys64/${MINGW_VERSION}" -j ${JOBS} -f Makefile.Release install + make INSTALL_ROOT="${WORKDIR}/msys64/${MINGW_VERSION}" -j ${JOBS} -f Makefile.Release install +} + +build_qwtpolar() { + mkdir -p ${WORKDIR}/qwtpolar + cd ${WORKDIR}/qwtpolar + + wget https://downloads.sourceforge.net/project/qwtpolar/qwtpolar/1.1.1/qwtpolar-1.1.1.tar.bz2 -O- \ + | tar xj --strip-components=1 -C ${WORKDIR}/qwtpolar + + patch -p1 < ${WORKDIR}/qwtpolar-qwt-6.1-compat.patch + + # Disable components that we won't build + sed -i "s/^QWT_POLAR_CONFIG\\s*+=\\s*QwtPolarDesigner$/#/g" qwtpolarconfig.pri + sed -i "s/^QWT_POLAR_CONFIG\\s*+=\\s*QwtPolarExamples$/#/g" qwtpolarconfig.pri + + # Fix prefix + sed -i "s/^\\s*QWT_POLAR_INSTALL_PREFIX.*$/QWT_POLAR_INSTALL_PREFIX=\"\"/g" qwtpolarconfig.pri + + cd ${WORKDIR}/qwtpolar/src + qmake LIBS+="-lqwt" + make INSTALL_ROOT="/c/msys64/${MINGW_VERSION}" -j ${JOBS} -f Makefile.Release install + make INSTALL_ROOT="${WORKDIR}/msys64/${MINGW_VERSION}" -j ${JOBS} -f Makefile.Release install +} + +build_griio() { + git clone --depth 1 https://github.com/analogdevicesinc/gr-iio.git ${WORKDIR}/gr-iio + + mkdir ${WORKDIR}/gr-iio/build-${ARCH} + cd ${WORKDIR}/gr-iio/build-${ARCH} + + # -D_hypot=hypot: http://boost.2283326.n4.nabble.com/Boost-Python-Compile-Error-s-GCC-via-MinGW-w64-td3165793.html#a3166757 + cmake -G 'Unix Makefiles' \ + ${CMAKE_OPTS} \ + -DCMAKE_CXX_FLAGS="-D_hypot=hypot" \ + -DSWIG_EXECUTABLE:FILEPATH=/${MINGW_VERSION}/bin/swig \ + ${WORKDIR}/gr-iio + + make -j ${JOBS} install + DESTDIR=${WORKDIR} make -j ${JOBS} install +} + +build_markdown +build_cheetah +build_libvolk +build_gnuradio +build_libiio +build_libad9361 +build_griio +build_qwt +build_qwtpolar +build_libsigrok +build_libsigrokdecode + +# Fix DLLs installed in the wrong path +mv ${WORKDIR}/msys64/${MINGW_VERSION}/lib/qwt.dll \ + ${WORKDIR}/msys64/${MINGW_VERSION}/lib/qwtpolar.dll \ + ${WORKDIR}/msys64/${MINGW_VERSION}/bin + +rm -rf ${WORKDIR}/msys64/${MINGW_VERSION}/doc \ + ${WORKDIR}/msys64/${MINGW_VERSION}/share/doc + +tar cavf ${WORKDIR}/scopy-${MINGW_VERSION}-build-deps.tar.xz -C ${WORKDIR} msys64 + +echo -n ${DEPENDENCIES} > ${WORKDIR}/dependencies.txt From a67d3cefab2265758da38a8bc7ec9cd1c72772af Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Fri, 30 Jun 2017 18:25:13 +0200 Subject: [PATCH 02/77] Add fixup for libsigrokcxx's enums.hpp Signed-off-by: Paul Cercueil --- build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.sh b/build.sh index 11f655d697..6dca0ca900 100755 --- a/build.sh +++ b/build.sh @@ -105,6 +105,10 @@ build_libsigrok() { make -j ${JOBS} install DESTDIR=${WORKDIR} make -j ${JOBS} install + + # For some reason, Scopy chokes if these are present in enums.hpp + sed -i "s/static const Quantity \* const DIFFERENCE;$//g" ${WORKDIR}/msys64/${MINGW_VERSION}/include/libsigrokcxx/enums.hpp + sed -i "s/static const QuantityFlag \* const RELATIVE;$//g" ${WORKDIR}/msys64/${MINGW_VERSION}/include/libsigrokcxx/enums.hpp } build_libsigrokdecode() { From 2bfc2dcb0ed4505194a09bccfd346318a4080c5a Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Mon, 3 Jul 2017 13:08:56 +0200 Subject: [PATCH 03/77] Fix libsigrokdecode not exporting its public symbols Signed-off-by: Paul Cercueil --- build.sh | 8 ++++++-- sigrokdecode-windows-fix.patch | 29 +++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 sigrokdecode-windows-fix.patch diff --git a/build.sh b/build.sh index 6dca0ca900..9b39333350 100755 --- a/build.sh +++ b/build.sh @@ -113,11 +113,14 @@ build_libsigrok() { build_libsigrokdecode() { mkdir -p ${WORKDIR}/libsigrokdecode/build-${ARCH} - cd ${WORKDIR}/libsigrokdecode/build-${ARCH} + cd ${WORKDIR}/libsigrokdecode wget http://sigrok.org/download/source/libsigrokdecode/libsigrokdecode-0.4.1.tar.gz -O- \ | tar xz --strip-components=1 -C ${WORKDIR}/libsigrokdecode + patch -p1 < ${WORKDIR}/sigrokdecode-windows-fix.patch + cd build-${ARCH} + CPPFLAGS="-DLIBSIGROKDECODE_EXPORT=1" ../configure ${AUTOCONF_OPTS} make -j ${JOBS} install @@ -257,7 +260,8 @@ mv ${WORKDIR}/msys64/${MINGW_VERSION}/lib/qwt.dll \ ${WORKDIR}/msys64/${MINGW_VERSION}/bin rm -rf ${WORKDIR}/msys64/${MINGW_VERSION}/doc \ - ${WORKDIR}/msys64/${MINGW_VERSION}/share/doc + ${WORKDIR}/msys64/${MINGW_VERSION}/share/doc \ + ${WORKDIR}/msys64/${MINGW_VERSION}/lib/*.la tar cavf ${WORKDIR}/scopy-${MINGW_VERSION}-build-deps.tar.xz -C ${WORKDIR} msys64 diff --git a/sigrokdecode-windows-fix.patch b/sigrokdecode-windows-fix.patch new file mode 100644 index 0000000000..eff7c8513b --- /dev/null +++ b/sigrokdecode-windows-fix.patch @@ -0,0 +1,29 @@ +From 0b21384bcd5ea71885dde8ebcb4c4d1bfd6f0187 Mon Sep 17 00:00:00 2001 +From: Paul Cercueil +Date: Mon, 3 Jul 2017 13:07:02 +0200 +Subject: [PATCH] Fix public functions visibility on Windows + +Signed-off-by: Paul Cercueil +--- + libsigrokdecode.h | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/libsigrokdecode.h b/libsigrokdecode.h +index 03a5de0..ed25e89 100644 +--- a/libsigrokdecode.h ++++ b/libsigrokdecode.h +@@ -108,8 +108,10 @@ enum srd_loglevel { + /* Marks public libsigrokdecode API symbols. */ + #ifndef _WIN32 + #define SRD_API __attribute__((visibility("default"))) ++#elif defined(LIBSIGROKDECODE_EXPORT) ++#define SRD_API __declspec(dllexport) + #else +-#define SRD_API ++#define SRD_API __declspec(dllimport) + #endif + + /* Marks private, non-public libsigrokdecode symbols (not part of the API). */ +-- +2.13.2 + From 0cc69042d7b347402f680665f349bea490f18ab1 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Wed, 5 Jul 2017 12:48:10 +0200 Subject: [PATCH 04/77] Build GNU Radio from the maint-msys64 branch Signed-off-by: Paul Cercueil --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 9b39333350..06146dbd94 100755 --- a/build.sh +++ b/build.sh @@ -163,7 +163,7 @@ build_libvolk() { } build_gnuradio() { - git clone --depth 1 https://github.com/analogdevicesinc/gnuradio.git -b fix-mingw ${WORKDIR}/gnuradio + git clone --depth 1 https://github.com/analogdevicesinc/gnuradio.git -b maint-msys64 ${WORKDIR}/gnuradio mkdir ${WORKDIR}/gnuradio/build-${ARCH} cd ${WORKDIR}/gnuradio/build-${ARCH} From aa2c5d716194ef231b62817064c8e489d65f3427 Mon Sep 17 00:00:00 2001 From: Alexandra Trifan Date: Tue, 31 Oct 2017 16:31:47 +0200 Subject: [PATCH 05/77] build.sh: Use Qt version 5.9.1 instead of latest. Signed-off-by: Alexandra Trifan --- build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index 06146dbd94..9315f8b24f 100755 --- a/build.sh +++ b/build.sh @@ -31,8 +31,7 @@ DEPENDENCIES="mingw-w64-${ARCH}-libxml2 \ mingw-w64-${ARCH}-libzip \ mingw-w64-${ARCH}-glib2 \ mingw-w64-${ARCH}-glibmm \ - mingw-w64-${ARCH}-pkg-config \ - mingw-w64-${ARCH}-qt5" + mingw-w64-${ARCH}-pkg-config" # Remove dependencies that prevent us from upgrading to GCC 6.2 pacman -Rs --noconfirm \ @@ -56,6 +55,10 @@ pacman --noconfirm -Sy \ # Install dependencies pacman --noconfirm -Sy ${DEPENDENCIES} +# Install an older version of Qt due to uic.exe issues +wget -q http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-qt5-5.9.1-1-any.pkg.tar.xz +pacman -U --noconfirm mingw-w64-${ARCH}-qt5-5.9.1-1-any.pkg.tar.xz + # Fix Qt5 spec files sed -i "s/\$\${CROSS_COMPILE}/${ARCH}-w64-mingw32-/" /${MINGW_VERSION}/share/qt5/mkspecs/win32-g++/qmake.conf From 47db2e177a548e2ed0361bc0e4f5de8d9f3ddc57 Mon Sep 17 00:00:00 2001 From: AlexandraTrifan Date: Mon, 20 Nov 2017 15:58:37 +0200 Subject: [PATCH 06/77] Add matio to the list of dependencies --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 9315f8b24f..8e1f3ea15d 100755 --- a/build.sh +++ b/build.sh @@ -31,7 +31,8 @@ DEPENDENCIES="mingw-w64-${ARCH}-libxml2 \ mingw-w64-${ARCH}-libzip \ mingw-w64-${ARCH}-glib2 \ mingw-w64-${ARCH}-glibmm \ - mingw-w64-${ARCH}-pkg-config" + mingw-w64-${ARCH}-pkg-config \ + mingw-w64-${ARCH}-matio" # Remove dependencies that prevent us from upgrading to GCC 6.2 pacman -Rs --noconfirm \ From 1081cc0b3fee07c06cfc2ff49bbfc5f12ec1ad7b Mon Sep 17 00:00:00 2001 From: AlexandraTrifan Date: Thu, 11 Jan 2018 16:39:40 +0200 Subject: [PATCH 07/77] build.sh: Use a different branch of gnuradio for now. Signed-off-by: Alexandra Trifan --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 8e1f3ea15d..4354293128 100755 --- a/build.sh +++ b/build.sh @@ -167,7 +167,7 @@ build_libvolk() { } build_gnuradio() { - git clone --depth 1 https://github.com/analogdevicesinc/gnuradio.git -b maint-msys64 ${WORKDIR}/gnuradio + git clone --depth 1 https://github.com/analogdevicesinc/gnuradio.git -b signal_source_phase ${WORKDIR}/gnuradio mkdir ${WORKDIR}/gnuradio/build-${ARCH} cd ${WORKDIR}/gnuradio/build-${ARCH} From b0ca3df78a872efc979444112940b7d0afb9c92b Mon Sep 17 00:00:00 2001 From: AlexandraTrifan Date: Thu, 1 Feb 2018 14:31:46 +0200 Subject: [PATCH 08/77] build.sh: Downgrade the llvm and clang packages for the moment. The latest packages seem to break the doxygen binary. For now, use an older known to work version. Signed-off-by: Alexandra Trifan --- build.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.sh b/build.sh index 4354293128..0d3ba1851a 100755 --- a/build.sh +++ b/build.sh @@ -53,6 +53,8 @@ pacman --noconfirm -Sy \ autoconf \ automake-wrapper +pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-llvm-5.0.0-3-any.pkg.tar.xz http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-clang-5.0.0-3-any.pkg.tar.xz + # Install dependencies pacman --noconfirm -Sy ${DEPENDENCIES} From 0b171a946ef34097ecc0b1349a85de6585fac82c Mon Sep 17 00:00:00 2001 From: AlexandraTrifan Date: Fri, 23 Mar 2018 16:26:25 +0200 Subject: [PATCH 09/77] build.sh: Install windres for reading Windows resource files (.rc) Signed-off-by: Alexandra Trifan --- build.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.sh b/build.sh index 0d3ba1851a..0bcf3a18fb 100755 --- a/build.sh +++ b/build.sh @@ -70,9 +70,15 @@ build_libiio() { mkdir ${WORKDIR}/libiio/build-${ARCH} cd ${WORKDIR}/libiio/build-${ARCH} + # Download a 32-bit version of windres.exe + + cd /c + wget http://swdownloads.analog.com/cse/build/windres.exe.gz + gunzip windres.exe.gz cmake -G 'Unix Makefiles' \ ${CMAKE_OPTS} \ + -DCMAKE_RC_COMPILER=/c/windres.exe \ -DWITH_TESTS:BOOL=OFF \ -DWITH_DOC:BOOL=OFF \ -DWITH_MATLAB_BINDINGS:BOOL=OFF \ From 07cd201cf6817fecfdbec48c49e4c563ea2ec928 Mon Sep 17 00:00:00 2001 From: AlexandraTrifan Date: Fri, 23 Mar 2018 17:24:30 +0200 Subject: [PATCH 10/77] build.sh: Fix bug introduced in previous commit. Signed-off-by: Alexandra Trifan --- build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sh b/build.sh index 0bcf3a18fb..a29e4896db 100755 --- a/build.sh +++ b/build.sh @@ -75,6 +75,7 @@ build_libiio() { cd /c wget http://swdownloads.analog.com/cse/build/windres.exe.gz gunzip windres.exe.gz + cd ${WORKDIR}/libiio/build-${ARCH} cmake -G 'Unix Makefiles' \ ${CMAKE_OPTS} \ From fb1d8691664b6eaea3b2238823304788f2cd6dba Mon Sep 17 00:00:00 2001 From: AlexandraTrifan Date: Mon, 26 Mar 2018 09:45:37 +0300 Subject: [PATCH 11/77] build.sh: Use the RC compiler only for 32 bit builds. Signed-off-by: Alexandra Trifan --- build.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index a29e4896db..e7094657e3 100755 --- a/build.sh +++ b/build.sh @@ -21,6 +21,13 @@ AUTOCONF_OPTS="--prefix=/msys64/${MINGW_VERSION} \ --enable-shared \ --disable-static" +if [ ${ARCH} == "i686" ] +then + RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=/c/windres.exe" +else + RC_COMPILER_OPT="" +fi + DEPENDENCIES="mingw-w64-${ARCH}-libxml2 \ mingw-w64-${ARCH}-libusb \ mingw-w64-${ARCH}-boost \ @@ -79,7 +86,7 @@ build_libiio() { cmake -G 'Unix Makefiles' \ ${CMAKE_OPTS} \ - -DCMAKE_RC_COMPILER=/c/windres.exe \ + ${RC_COMPILER_OPT} \ -DWITH_TESTS:BOOL=OFF \ -DWITH_DOC:BOOL=OFF \ -DWITH_MATLAB_BINDINGS:BOOL=OFF \ From 6476812499d6cacb4b4e911f8453a4d0f5f20051 Mon Sep 17 00:00:00 2001 From: Claudiu Pop Date: Wed, 18 Apr 2018 10:29:11 +0300 Subject: [PATCH 12/77] build.sh: install an older version of icu library Signed-off-by: Claudiu Pop --- build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.sh b/build.sh index e7094657e3..7c0f12715e 100755 --- a/build.sh +++ b/build.sh @@ -62,6 +62,10 @@ pacman --noconfirm -Sy \ pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-llvm-5.0.0-3-any.pkg.tar.xz http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-clang-5.0.0-3-any.pkg.tar.xz +# Install an older version of icu +pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-icu-58.2-3-any.pkg.tar.xz +pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-icu-debug-libs-58.2-3-any.pkg.tar.xz + # Install dependencies pacman --noconfirm -Sy ${DEPENDENCIES} From fcd0ac4587fcca9d0af32533bfd5b2ab87833285 Mon Sep 17 00:00:00 2001 From: AlexandraTrifan Date: Mon, 30 Apr 2018 09:40:06 +0300 Subject: [PATCH 13/77] build.sh: The cmake update to 3.11 causes the build to fail. For now, we should use the older version of cmake which is known to work. Signed-off-by: Alexandra Trifan --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 7c0f12715e..75e24fb06c 100755 --- a/build.sh +++ b/build.sh @@ -51,10 +51,11 @@ pacman -Rs --noconfirm \ # Remove existing file that causes GCC install to fail rm /${MINGW_VERSION}/etc/gdbinit +pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-cmake-3.10.2-1-any.pkg.tar.xz + # Update to GCC 6.2 and install build-time dependencies pacman --noconfirm -Sy \ mingw-w64-${ARCH}-gcc \ - mingw-w64-${ARCH}-cmake \ mingw-w64-${ARCH}-doxygen \ mingw-w64-${ARCH}-swig \ autoconf \ From f8c3b4dabf17d24b7d580fd5ea672a8bb0fef25b Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Wed, 9 May 2018 17:24:49 +0300 Subject: [PATCH 14/77] build.sh: added latest sigrok to fix logic analyzer memory leak bug Signed-off-by: Adrian Suciu --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 75e24fb06c..04615a1bfa 100755 --- a/build.sh +++ b/build.sh @@ -118,7 +118,7 @@ build_libad9361() { } build_libsigrok() { - git clone --depth 1 https://github.com/sschnelle/libsigrok.git ${WORKDIR}/libsigrok + git clone --depth 1 https://github.com/sigrokproject/libsigrok.git ${WORKDIR}/libsigrok mkdir ${WORKDIR}/libsigrok/build-${ARCH} cd ${WORKDIR}/libsigrok/build-${ARCH} From 0f82f05468e0b139b6757aacc7d299ae04503c87 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Tue, 15 May 2018 12:22:55 +0300 Subject: [PATCH 15/77] build.sh: Use gnuradio scopy branch Signed-off-by: Adrian Suciu --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 04615a1bfa..668dc5fcdd 100755 --- a/build.sh +++ b/build.sh @@ -188,7 +188,7 @@ build_libvolk() { } build_gnuradio() { - git clone --depth 1 https://github.com/analogdevicesinc/gnuradio.git -b signal_source_phase ${WORKDIR}/gnuradio + git clone --depth 1 https://github.com/analogdevicesinc/gnuradio.git -b scopy ${WORKDIR}/gnuradio mkdir ${WORKDIR}/gnuradio/build-${ARCH} cd ${WORKDIR}/gnuradio/build-${ARCH} From 0a324f2523de552a118f3b9484c3bb4c8132e871 Mon Sep 17 00:00:00 2001 From: AlexandraTrifan Date: Tue, 12 Jun 2018 11:36:33 +0300 Subject: [PATCH 16/77] build.sh: Update dependencies. Signed-off-by: Alexandra Trifan --- build.sh | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/build.sh b/build.sh index 668dc5fcdd..22024edb76 100755 --- a/build.sh +++ b/build.sh @@ -51,21 +51,19 @@ pacman -Rs --noconfirm \ # Remove existing file that causes GCC install to fail rm /${MINGW_VERSION}/etc/gdbinit -pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-cmake-3.10.2-1-any.pkg.tar.xz - # Update to GCC 6.2 and install build-time dependencies pacman --noconfirm -Sy \ mingw-w64-${ARCH}-gcc \ + mingw-w64-${ARCH}-cmake \ mingw-w64-${ARCH}-doxygen \ - mingw-w64-${ARCH}-swig \ autoconf \ automake-wrapper pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-llvm-5.0.0-3-any.pkg.tar.xz http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-clang-5.0.0-3-any.pkg.tar.xz # Install an older version of icu -pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-icu-58.2-3-any.pkg.tar.xz -pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-icu-debug-libs-58.2-3-any.pkg.tar.xz +#pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-icu-58.2-3-any.pkg.tar.xz +#pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-icu-debug-libs-58.2-3-any.pkg.tar.xz # Install dependencies pacman --noconfirm -Sy ${DEPENDENCIES} @@ -195,15 +193,17 @@ build_gnuradio() { cmake -G 'Unix Makefiles' \ ${CMAKE_OPTS} \ - -DENABLE_DEFAULT:BOOL=OFF \ - -DENABLE_GNURADIO_RUNTIME:BOOL=ON \ - -DENABLE_GR_ANALOG:BOOL=ON \ - -DENABLE_GR_BLOCKS:BOOL=ON \ - -DENABLE_GR_FFT:BOOL=ON \ - -DENABLE_GR_FILTER:BOOL=ON \ + -DENABLE_GR_DIGITAL:BOOL=OFF \ + -DENABLE_GR_DTV:BOOL=OFF \ + -DENABLE_GR_ATSC:BOOL=OFF \ + -DENABLE_GR_AUDIO:BOOL=OFF \ + -DENABLE_GR_CHANNELS:BOOL=OFF \ + -DENABLE_GR_NOAA:BOOL=OFF \ + -DENABLE_GR_PAGER:BOOL=OFF \ + -DENABLE_GR_TRELLIS:BOOL=OFF \ + -DENABLE_GR_VOCODER:BOOL=OFF \ + -DENABLE_GR_FEC:BOOL=OFF \ -DENABLE_INTERNAL_VOLK:BOOL=OFF \ - -DENABLE_PYTHON:BOOL=ON \ - -DSWIG_EXECUTABLE:FILEPATH=/${MINGW_VERSION}/bin/swig \ ${WORKDIR}/gnuradio make -j ${JOBS} install @@ -260,7 +260,6 @@ build_griio() { cmake -G 'Unix Makefiles' \ ${CMAKE_OPTS} \ -DCMAKE_CXX_FLAGS="-D_hypot=hypot" \ - -DSWIG_EXECUTABLE:FILEPATH=/${MINGW_VERSION}/bin/swig \ ${WORKDIR}/gr-iio make -j ${JOBS} install From 6e2a8d38359621a5276ae534ea63e82465bb2266 Mon Sep 17 00:00:00 2001 From: Alexandra Trifan Date: Thu, 18 Oct 2018 10:58:47 +0300 Subject: [PATCH 17/77] build.sh: Latest version of curl breaks the libiio build, so we downgrade it until things get fixed. Signed-off-by: Alexandra Trifan --- build.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 22024edb76..5b9c50f082 100755 --- a/build.sh +++ b/build.sh @@ -52,7 +52,7 @@ pacman -Rs --noconfirm \ rm /${MINGW_VERSION}/etc/gdbinit # Update to GCC 6.2 and install build-time dependencies -pacman --noconfirm -Sy \ +pacman --force --noconfirm -Sy \ mingw-w64-${ARCH}-gcc \ mingw-w64-${ARCH}-cmake \ mingw-w64-${ARCH}-doxygen \ @@ -66,11 +66,12 @@ pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-llvm #pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-icu-debug-libs-58.2-3-any.pkg.tar.xz # Install dependencies -pacman --noconfirm -Sy ${DEPENDENCIES} +pacman --force --noconfirm -Sy ${DEPENDENCIES} # Install an older version of Qt due to uic.exe issues wget -q http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-qt5-5.9.1-1-any.pkg.tar.xz -pacman -U --noconfirm mingw-w64-${ARCH}-qt5-5.9.1-1-any.pkg.tar.xz +pacman -U --force --noconfirm mingw-w64-${ARCH}-qt5-5.9.1-1-any.pkg.tar.xz +pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-curl-7.61.1-2-any.pkg.tar.xz # Fix Qt5 spec files sed -i "s/\$\${CROSS_COMPILE}/${ARCH}-w64-mingw32-/" /${MINGW_VERSION}/share/qt5/mkspecs/win32-g++/qmake.conf From 58204d9516eb93a64839d066cfefa4000c666d21 Mon Sep 17 00:00:00 2001 From: "Alexandra.Trifan" Date: Fri, 9 Nov 2018 14:27:18 +0200 Subject: [PATCH 18/77] Use libusb 1.0.21 instead of 1.0.22 Signed-off-by: Alexandra.Trifan --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 5b9c50f082..f13255d44f 100755 --- a/build.sh +++ b/build.sh @@ -29,7 +29,6 @@ else fi DEPENDENCIES="mingw-w64-${ARCH}-libxml2 \ - mingw-w64-${ARCH}-libusb \ mingw-w64-${ARCH}-boost \ mingw-w64-${ARCH}-fftw \ mingw-w64-${ARCH}-libzip \ @@ -72,6 +71,7 @@ pacman --force --noconfirm -Sy ${DEPENDENCIES} wget -q http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-qt5-5.9.1-1-any.pkg.tar.xz pacman -U --force --noconfirm mingw-w64-${ARCH}-qt5-5.9.1-1-any.pkg.tar.xz pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-curl-7.61.1-2-any.pkg.tar.xz +pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-libusb-1.0.21-2-any.pkg.tar.xz # Fix Qt5 spec files sed -i "s/\$\${CROSS_COMPILE}/${ARCH}-w64-mingw32-/" /${MINGW_VERSION}/share/qt5/mkspecs/win32-g++/qmake.conf From a4568d09d4a6dd391eef3eaa1dcf4ddd5d8e2fe5 Mon Sep 17 00:00:00 2001 From: "Alexandra.Trifan" Date: Fri, 16 Nov 2018 15:18:08 +0200 Subject: [PATCH 19/77] build.sh: Downgrade doxygen to a version which is known to work with cmake. Signed-off-by: Alexandra.Trifan --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index f13255d44f..9e32df5bd2 100755 --- a/build.sh +++ b/build.sh @@ -54,10 +54,11 @@ rm /${MINGW_VERSION}/etc/gdbinit pacman --force --noconfirm -Sy \ mingw-w64-${ARCH}-gcc \ mingw-w64-${ARCH}-cmake \ - mingw-w64-${ARCH}-doxygen \ autoconf \ automake-wrapper +pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-doxygen-1.8.14-2-any.pkg.tar.xz +pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-graphviz-2.40.1-4-any.pkg.tar.xz pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-llvm-5.0.0-3-any.pkg.tar.xz http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-clang-5.0.0-3-any.pkg.tar.xz # Install an older version of icu From 3d3590b322cd2b9d161863f05ed20c17079c24a9 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Thu, 22 Nov 2018 12:35:46 +0200 Subject: [PATCH 20/77] build.sh: use libiio v0.15 Use older libiio version because v0.16 of libiio has some backwards compatibility issues. Signed-off-by: Adrian Suciu --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 9e32df5bd2..4afe2c5dd6 100755 --- a/build.sh +++ b/build.sh @@ -78,7 +78,7 @@ pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-libu sed -i "s/\$\${CROSS_COMPILE}/${ARCH}-w64-mingw32-/" /${MINGW_VERSION}/share/qt5/mkspecs/win32-g++/qmake.conf build_libiio() { - git clone --depth 1 https://github.com/analogdevicesinc/libiio.git ${WORKDIR}/libiio + git clone --depth 1 --branch v0.15 https://github.com/analogdevicesinc/libiio.git ${WORKDIR}/libiio mkdir ${WORKDIR}/libiio/build-${ARCH} cd ${WORKDIR}/libiio/build-${ARCH} From d29a3fa883da00f57af98d031e15556034a24d61 Mon Sep 17 00:00:00 2001 From: Daniel Guramulta Date: Thu, 10 Jan 2019 18:12:19 +0200 Subject: [PATCH 21/77] build.sh: use latest version of curl Signed-off-by: Daniel Guramulta --- build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/build.sh b/build.sh index 4afe2c5dd6..8bb38ac214 100755 --- a/build.sh +++ b/build.sh @@ -71,7 +71,6 @@ pacman --force --noconfirm -Sy ${DEPENDENCIES} # Install an older version of Qt due to uic.exe issues wget -q http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-qt5-5.9.1-1-any.pkg.tar.xz pacman -U --force --noconfirm mingw-w64-${ARCH}-qt5-5.9.1-1-any.pkg.tar.xz -pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-curl-7.61.1-2-any.pkg.tar.xz pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-libusb-1.0.21-2-any.pkg.tar.xz # Fix Qt5 spec files From 513b9c9b7053a5a1d8d193fcd6bec24c989f90aa Mon Sep 17 00:00:00 2001 From: Daniel Guramulta Date: Mon, 22 Apr 2019 11:29:23 +0300 Subject: [PATCH 22/77] build.sh: downgrade boost to 1.69 Signed-off-by: Daniel Guramulta --- build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.sh b/build.sh index 8bb38ac214..ea4eadc95d 100755 --- a/build.sh +++ b/build.sh @@ -68,6 +68,10 @@ pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-llvm # Install dependencies pacman --force --noconfirm -Sy ${DEPENDENCIES} +# Install an older version of boost for gnuradio to use (currently not working with 1.70) +wget -q http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-boost-1.69.0-2-any.pkg.tar.xz +pacman -U --force --noconfirm mingw-w64-${ARCH}-boost-1.69.0-2-any.pkg.tar.xz + # Install an older version of Qt due to uic.exe issues wget -q http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-qt5-5.9.1-1-any.pkg.tar.xz pacman -U --force --noconfirm mingw-w64-${ARCH}-qt5-5.9.1-1-any.pkg.tar.xz From 550c593312f3186dee54a0af55e949b2d89dceeb Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Tue, 7 May 2019 12:45:51 +0300 Subject: [PATCH 23/77] Revert "build.sh: use libiio v0.15" This reverts commit 3d3590b322cd2b9d161863f05ed20c17079c24a9. Compatibility issues should be fixed with libiio v0.18 --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index ea4eadc95d..2ddf52b358 100755 --- a/build.sh +++ b/build.sh @@ -81,7 +81,7 @@ pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-libu sed -i "s/\$\${CROSS_COMPILE}/${ARCH}-w64-mingw32-/" /${MINGW_VERSION}/share/qt5/mkspecs/win32-g++/qmake.conf build_libiio() { - git clone --depth 1 --branch v0.15 https://github.com/analogdevicesinc/libiio.git ${WORKDIR}/libiio + git clone --depth 1 https://github.com/analogdevicesinc/libiio.git ${WORKDIR}/libiio mkdir ${WORKDIR}/libiio/build-${ARCH} cd ${WORKDIR}/libiio/build-${ARCH} From 84b52c016b05940da67d313c076fe7a5091f0f2b Mon Sep 17 00:00:00 2001 From: Daniel Guramulta Date: Mon, 29 Jul 2019 09:26:32 +0300 Subject: [PATCH 24/77] build.sh: install latest Qt Signed-off-by: Daniel Guramulta --- build.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 2ddf52b358..eb54e0b67c 100755 --- a/build.sh +++ b/build.sh @@ -38,7 +38,8 @@ DEPENDENCIES="mingw-w64-${ARCH}-libxml2 \ mingw-w64-${ARCH}-glib2 \ mingw-w64-${ARCH}-glibmm \ mingw-w64-${ARCH}-pkg-config \ - mingw-w64-${ARCH}-matio" + mingw-w64-${ARCH}-matio \ + mingw-w64-${ARCH}-qt" \ # Remove dependencies that prevent us from upgrading to GCC 6.2 pacman -Rs --noconfirm \ @@ -72,9 +73,6 @@ pacman --force --noconfirm -Sy ${DEPENDENCIES} wget -q http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-boost-1.69.0-2-any.pkg.tar.xz pacman -U --force --noconfirm mingw-w64-${ARCH}-boost-1.69.0-2-any.pkg.tar.xz -# Install an older version of Qt due to uic.exe issues -wget -q http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-qt5-5.9.1-1-any.pkg.tar.xz -pacman -U --force --noconfirm mingw-w64-${ARCH}-qt5-5.9.1-1-any.pkg.tar.xz pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-libusb-1.0.21-2-any.pkg.tar.xz # Fix Qt5 spec files From 70bdb19d44201a4ea0480bcb52e72e5ba3a1b519 Mon Sep 17 00:00:00 2001 From: Daniel Guramulta Date: Mon, 29 Jul 2019 09:30:04 +0300 Subject: [PATCH 25/77] build.sh: install older version of hdf5 Signed-off-by: Daniel Guramulta --- build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.sh b/build.sh index eb54e0b67c..1e362f048b 100755 --- a/build.sh +++ b/build.sh @@ -75,6 +75,10 @@ pacman -U --force --noconfirm mingw-w64-${ARCH}-boost-1.69.0-2-any.pkg.tar.xz pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-libusb-1.0.21-2-any.pkg.tar.xz +# Install older version of hdf5 +wget -q http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-hdf5-1.8.21-2-any.pkg.tar.xz +pacman -U --force --noconfirm mingw-w64-${ARCH}-hdf5-1.8.21-2-any.pkg.tar.xz + # Fix Qt5 spec files sed -i "s/\$\${CROSS_COMPILE}/${ARCH}-w64-mingw32-/" /${MINGW_VERSION}/share/qt5/mkspecs/win32-g++/qmake.conf From 949d6c8679c60daff02a2ef8bfbdaf9f74eba08a Mon Sep 17 00:00:00 2001 From: Daniel Guramulta Date: Mon, 29 Jul 2019 09:41:28 +0300 Subject: [PATCH 26/77] Revert "build.sh: downgrade boost to 1.69" This reverts commit 513b9c9b7053a5a1d8d193fcd6bec24c989f90aa. --- build.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/build.sh b/build.sh index 1e362f048b..e7babc99ae 100755 --- a/build.sh +++ b/build.sh @@ -69,10 +69,6 @@ pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-llvm # Install dependencies pacman --force --noconfirm -Sy ${DEPENDENCIES} -# Install an older version of boost for gnuradio to use (currently not working with 1.70) -wget -q http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-boost-1.69.0-2-any.pkg.tar.xz -pacman -U --force --noconfirm mingw-w64-${ARCH}-boost-1.69.0-2-any.pkg.tar.xz - pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-libusb-1.0.21-2-any.pkg.tar.xz # Install older version of hdf5 From c074543ea1b61ffffbb577b0b8e34771daebb1f0 Mon Sep 17 00:00:00 2001 From: AlexandraTrifan Date: Mon, 7 Oct 2019 11:09:11 +0300 Subject: [PATCH 27/77] Create README.md Signed-off-by: Alexandra.Trifan --- README.md | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000000..dedf19493b --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# scopy-mingw-build-deps +AppVeyor script to automatically build the dependencies for Scopy under MinGW. + + +## Appveyor Builds +Nightly builds for Windows are available at: https://ci.appveyor.com/project/analogdevicesinc/scopy-mingw-build-deps/build/artifacts + +Each build contains two jobs: +- Dependencies for 64-bit builds. +- Dependencies for 32-bit builds. From c9e8b09e43517131b96c7d82f9fac8eab918b6f3 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Thu, 7 Nov 2019 14:29:45 +0200 Subject: [PATCH 28/77] Use latest version of hdf5 Signed-off-by: Adrian Suciu --- build.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/build.sh b/build.sh index e7babc99ae..9ca2935537 100755 --- a/build.sh +++ b/build.sh @@ -38,6 +38,7 @@ DEPENDENCIES="mingw-w64-${ARCH}-libxml2 \ mingw-w64-${ARCH}-glib2 \ mingw-w64-${ARCH}-glibmm \ mingw-w64-${ARCH}-pkg-config \ + mingw-w64-${ARCH}-hdf5 \ mingw-w64-${ARCH}-matio \ mingw-w64-${ARCH}-qt" \ @@ -71,10 +72,6 @@ pacman --force --noconfirm -Sy ${DEPENDENCIES} pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-libusb-1.0.21-2-any.pkg.tar.xz -# Install older version of hdf5 -wget -q http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-hdf5-1.8.21-2-any.pkg.tar.xz -pacman -U --force --noconfirm mingw-w64-${ARCH}-hdf5-1.8.21-2-any.pkg.tar.xz - # Fix Qt5 spec files sed -i "s/\$\${CROSS_COMPILE}/${ARCH}-w64-mingw32-/" /${MINGW_VERSION}/share/qt5/mkspecs/win32-g++/qmake.conf From 8b9bc452d6ba345d5996d9980bc9b655c84cbee5 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Mon, 2 Mar 2020 13:56:08 +0200 Subject: [PATCH 29/77] Updated appveyor.yml Signed-off-by: Adrian Suciu --- build.sh | 310 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 161 insertions(+), 149 deletions(-) diff --git a/build.sh b/build.sh index 9ca2935537..c0e9a6f2a2 100755 --- a/build.sh +++ b/build.sh @@ -1,21 +1,37 @@ #!/usr/bin/bash.exe +LIBIIO_BRANCH=master +LIBAD9361_BRANCH=master +LIBM2K_BRANCH=master +GRIIO_BRANCH=upgrade-3.8 +GNURADIO_FORK=analogdevicesinc +GNURADIO_BRANCH=ming-3.8-clean +GRSCOPY_BRANCH=master +GRM2K_BRANCH=master +QWT_BRANCH=qwt-6.1-multiaxes +QWTPOLAR_BRANCH=master # not used +LIBSIGROK_BRANCH=master +LIBSIGROKDECODE_BRANCH=master #not used + +#TODO: make each dep install it's own deps # Exit immediately if an error occurs set -e export PATH=/bin:/usr/bin:/${MINGW_VERSION}/bin:/c/Program\ Files/Git/cmd:/c/Windows/System32 WORKDIR=${PWD} - -JOBS=3 +JOBS=-j3 CC=/${MINGW_VERSION}/bin/${ARCH}-w64-mingw32-gcc.exe CXX=/${MINGW_VERSION}/bin/${ARCH}-w64-mingw32-g++.exe -CMAKE_OPTS="-DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=/${MINGW_VERSION} \ +CMAKE_OPTS=" -DCMAKE_C_COMPILER:FILEPATH=${CC} \ -DCMAKE_CXX_COMPILER:FILEPATH=${CXX} \ - -DPKG_CONFIG_EXECUTABLE:FILEPATH=/${MINGW_VERSION}/bin/pkg-config.exe" + -DPKG_CONFIG_EXECUTABLE=/$MINGW_VERSION/bin/pkg-config.exe \ + -DCMAKE_INSTALL_PREFIX=/${MINGW_VERSION}\ + -DCMAKE_PREFIX_PATH=/c/msys64/$MINGW_VERSION/lib/cmake \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + " AUTOCONF_OPTS="--prefix=/msys64/${MINGW_VERSION} \ --host=${ARCH}-w64-mingw32 \ --enable-shared \ @@ -28,64 +44,56 @@ else RC_COMPILER_OPT="" fi -DEPENDENCIES="mingw-w64-${ARCH}-libxml2 \ - mingw-w64-${ARCH}-boost \ - mingw-w64-${ARCH}-fftw \ - mingw-w64-${ARCH}-libzip \ - mingw-w64-${ARCH}-python3 \ - mingw-w64-${ARCH}-fftw \ - mingw-w64-${ARCH}-libzip \ - mingw-w64-${ARCH}-glib2 \ - mingw-w64-${ARCH}-glibmm \ - mingw-w64-${ARCH}-pkg-config \ - mingw-w64-${ARCH}-hdf5 \ - mingw-w64-${ARCH}-matio \ - mingw-w64-${ARCH}-qt" \ - -# Remove dependencies that prevent us from upgrading to GCC 6.2 -pacman -Rs --noconfirm \ - mingw-w64-${ARCH}-gcc-ada \ - mingw-w64-${ARCH}-gcc-fortran \ - mingw-w64-${ARCH}-gcc-libgfortran \ - mingw-w64-${ARCH}-gcc-objc - -# Remove existing file that causes GCC install to fail -rm /${MINGW_VERSION}/etc/gdbinit - -# Update to GCC 6.2 and install build-time dependencies -pacman --force --noconfirm -Sy \ - mingw-w64-${ARCH}-gcc \ - mingw-w64-${ARCH}-cmake \ - autoconf \ - automake-wrapper - -pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-doxygen-1.8.14-2-any.pkg.tar.xz -pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-graphviz-2.40.1-4-any.pkg.tar.xz -pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-llvm-5.0.0-3-any.pkg.tar.xz http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-clang-5.0.0-3-any.pkg.tar.xz - -# Install an older version of icu -#pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-icu-58.2-3-any.pkg.tar.xz -#pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-icu-debug-libs-58.2-3-any.pkg.tar.xz - -# Install dependencies -pacman --force --noconfirm -Sy ${DEPENDENCIES} - -pacman -U --noconfirm http://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-libusb-1.0.21-2-any.pkg.tar.xz +echo "### Download and installed precompiled GNURadio ... " +wget "https://ci.appveyor.com/api/projects/$GNURADIO_FORK/gnuradio/artifacts/gnuradio-$MINGW_VERSION-deps.txt?branch=$GNURADIO_BRANCH&job=Environment: MINGW_VERSION=$MINGW_VERSION, ARCH=$ARCH" -O /c/gnuradio-$MINGW_VERSION-deps.txt +wget "https://ci.appveyor.com/api/projects/$GNURADIO_FORK/gnuradio/artifacts/gnuradio-$MINGW_VERSION.tar.xz?branch=$GNURADIO_BRANCH&job=Environment: MINGW_VERSION=$MINGW_VERSION, ARCH=$ARCH" -O /c/gnuradio-$MINGW_VERSION.tar.xz +cd $WORKDIR +tar xJf /c/gnuradio-$MINGW_VERSION.tar.xz +cd /c +tar xJf gnuradio-$MINGW_VERSION.tar.xz + +GNURADIO_DEPS=$( ${WORKDIR}/dependencies.txt +echo -n ${PACMAN_SYNC_DEPS} > ${WORKDIR}/scopy-$MINGW_VERSION-build-deps-pacman.txt From 7673b5082b9353a0f2aa030bfe91c4c85476966b Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Wed, 15 Apr 2020 18:54:37 +0300 Subject: [PATCH 30/77] appveyor.yml: Added libffi to deps Signed-off-by: Adrian Suciu --- build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sh b/build.sh index c0e9a6f2a2..c6c909ed64 100755 --- a/build.sh +++ b/build.sh @@ -62,6 +62,7 @@ PACMAN_SYNC_DEPS=" mingw-w64-$ARCH-boost \ mingw-w64-$ARCH-fftw \ mingw-w64-$ARCH-libzip \ + mingw-w64-$ARCH-libffi \ mingw-w64-$ARCH-glib2 \ mingw-w64-$ARCH-glibmm \ mingw-w64-$ARCH-matio \ From c6e3cebb8f673f003f70be80d884a203c11180b6 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Wed, 29 Apr 2020 11:52:27 +0300 Subject: [PATCH 31/77] ci: use /tmp to download deps Signed-off-by: Adrian Suciu --- build.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build.sh b/build.sh index c6c909ed64..66bfe68772 100755 --- a/build.sh +++ b/build.sh @@ -45,14 +45,14 @@ else fi echo "### Download and installed precompiled GNURadio ... " -wget "https://ci.appveyor.com/api/projects/$GNURADIO_FORK/gnuradio/artifacts/gnuradio-$MINGW_VERSION-deps.txt?branch=$GNURADIO_BRANCH&job=Environment: MINGW_VERSION=$MINGW_VERSION, ARCH=$ARCH" -O /c/gnuradio-$MINGW_VERSION-deps.txt -wget "https://ci.appveyor.com/api/projects/$GNURADIO_FORK/gnuradio/artifacts/gnuradio-$MINGW_VERSION.tar.xz?branch=$GNURADIO_BRANCH&job=Environment: MINGW_VERSION=$MINGW_VERSION, ARCH=$ARCH" -O /c/gnuradio-$MINGW_VERSION.tar.xz +wget "https://ci.appveyor.com/api/projects/$GNURADIO_FORK/gnuradio/artifacts/gnuradio-$MINGW_VERSION-deps.txt?branch=$GNURADIO_BRANCH&job=Environment: MINGW_VERSION=$MINGW_VERSION, ARCH=$ARCH" -O /tmp/gnuradio-$MINGW_VERSION-deps.txt +wget "https://ci.appveyor.com/api/projects/$GNURADIO_FORK/gnuradio/artifacts/gnuradio-$MINGW_VERSION.tar.xz?branch=$GNURADIO_BRANCH&job=Environment: MINGW_VERSION=$MINGW_VERSION, ARCH=$ARCH" -O /tmp/gnuradio-$MINGW_VERSION.tar.xz cd $WORKDIR -tar xJf /c/gnuradio-$MINGW_VERSION.tar.xz +tar xJf /tmp/gnuradio-$MINGW_VERSION.tar.xz cd /c -tar xJf gnuradio-$MINGW_VERSION.tar.xz +tar xJf /tmp/gnuradio-$MINGW_VERSION.tar.xz -GNURADIO_DEPS=$( Date: Wed, 29 Apr 2020 11:53:10 +0300 Subject: [PATCH 33/77] ci: removed matio as dependency as it's currently broken Signed-off-by: Adrian Suciu --- build.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/build.sh b/build.sh index 4e537d99a3..ab829d7822 100755 --- a/build.sh +++ b/build.sh @@ -65,8 +65,6 @@ PACMAN_SYNC_DEPS=" mingw-w64-$ARCH-libffi \ mingw-w64-$ARCH-glib2 \ mingw-w64-$ARCH-glibmm \ - mingw-w64-$ARCH-matio \ - mingw-w64-$ARCH-hdf5 \ mingw-w64-$ARCH-doxygen\ " From 0e19594082296d999b51ea7e93651d0e1ff60c30 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Wed, 29 Apr 2020 11:53:27 +0300 Subject: [PATCH 34/77] ci: use latest version of qt Signed-off-by: Adrian Suciu --- build.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/build.sh b/build.sh index ab829d7822..665838d154 100755 --- a/build.sh +++ b/build.sh @@ -66,10 +66,10 @@ PACMAN_SYNC_DEPS=" mingw-w64-$ARCH-glib2 \ mingw-w64-$ARCH-glibmm \ mingw-w64-$ARCH-doxygen\ + mingw-w64-$ARCH-qt5 \ " PACMAN_REPO_DEPS=" -http://repo.msys2.org/mingw/$ARCH/mingw-w64-$ARCH-qt5-5.13.2-1-any.pkg.tar.xz \ http://repo.msys2.org/mingw/$ARCH/mingw-w64-$ARCH-libusb-1.0.21-2-any.pkg.tar.xz\ " @@ -79,6 +79,7 @@ pacman --noconfirm -U $PACMAN_REPO_DEPS # Fix Qt5 spec files sed -i "s/\$\${CROSS_COMPILE}/${ARCH}-w64-mingw32-/" /${MINGW_VERSION}/share/qt5/mkspecs/win32-g++/qmake.conf +} build_libiio() { echo "### Building libiio - branch $LIBIIO_BRANCH" @@ -89,7 +90,7 @@ build_libiio() { cd ${WORKDIR}/libiio/build-${ARCH} # Download a 32-bit version of windres.exe - cd /c + cd /c wget http://swdownloads.analog.com/cse/build/windres.exe.gz gunzip windres.exe.gz cd ${WORKDIR}/libiio/build-${ARCH} @@ -302,3 +303,5 @@ echo "### Creating archive ... " tar cavf ${WORKDIR}/scopy-${MINGW_VERSION}-build-deps.tar.xz -C ${WORKDIR} msys64 echo -n ${PACMAN_SYNC_DEPS} > ${WORKDIR}/scopy-$MINGW_VERSION-build-deps-pacman.txt + + From d8f54119d45896ceb4d30dabafbf44a141061bc8 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Tue, 26 May 2020 17:24:13 +0300 Subject: [PATCH 35/77] ci: use older version of boost as 1.73 breaks gr dependency Signed-off-by: Adrian Suciu --- build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 665838d154..ca4bd4a9b5 100755 --- a/build.sh +++ b/build.sh @@ -59,7 +59,6 @@ PACMAN_SYNC_DEPS=" $GNURADIO_DEPS \ mingw-w64-$ARCH-libxml2 \ mingw-w64-$ARCH-libzip \ - mingw-w64-$ARCH-boost \ mingw-w64-$ARCH-fftw \ mingw-w64-$ARCH-libzip \ mingw-w64-$ARCH-libffi \ @@ -70,11 +69,12 @@ PACMAN_SYNC_DEPS=" " PACMAN_REPO_DEPS=" -http://repo.msys2.org/mingw/$ARCH/mingw-w64-$ARCH-libusb-1.0.21-2-any.pkg.tar.xz\ +http://repo.msys2.org/mingw/$ARCH/mingw-w64-$ARCH-libusb-1.0.21-2-any.pkg.tar.xz \ +http://repo.msys2.org/mingw/$ARCH/mingw-w64-$ARCH-boost-1.72.0-3-any.pkg.tar.zst \ " echo "### Installing dependencies ... " -pacman --noconfirm -Sy $PACMAN_SYNC_DEPS +pacman --noconfirm --needed -Sy $PACMAN_SYNC_DEPS pacman --noconfirm -U $PACMAN_REPO_DEPS # Fix Qt5 spec files From 9f4f7dc1bab07d91a643772db511a357186c9006 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Tue, 2 Jun 2020 12:53:30 +0300 Subject: [PATCH 36/77] ci: use qt5.14 Signed-off-by: Adrian Suciu --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index ca4bd4a9b5..3e5d4e345b 100755 --- a/build.sh +++ b/build.sh @@ -65,12 +65,12 @@ PACMAN_SYNC_DEPS=" mingw-w64-$ARCH-glib2 \ mingw-w64-$ARCH-glibmm \ mingw-w64-$ARCH-doxygen\ - mingw-w64-$ARCH-qt5 \ " PACMAN_REPO_DEPS=" http://repo.msys2.org/mingw/$ARCH/mingw-w64-$ARCH-libusb-1.0.21-2-any.pkg.tar.xz \ http://repo.msys2.org/mingw/$ARCH/mingw-w64-$ARCH-boost-1.72.0-3-any.pkg.tar.zst \ +http://repo.msys2.org/mingw/$ARCH/mingw-w64-$ARCH-qt5-5.14.2-3-any.pkg.tar.zst \ " echo "### Installing dependencies ... " From 5f3018cca797238a5b36d2e129611c2d2c2c677d Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Thu, 30 Apr 2020 15:03:59 +0300 Subject: [PATCH 37/77] ci: building latest version of libsigrokdecode Signed-off-by: Adrian Suciu --- build.sh | 39 +++++++-------------------------------- 1 file changed, 7 insertions(+), 32 deletions(-) diff --git a/build.sh b/build.sh index 3e5d4e345b..17a0ad412c 100755 --- a/build.sh +++ b/build.sh @@ -10,8 +10,7 @@ GRSCOPY_BRANCH=master GRM2K_BRANCH=master QWT_BRANCH=qwt-6.1-multiaxes QWTPOLAR_BRANCH=master # not used -LIBSIGROK_BRANCH=master -LIBSIGROKDECODE_BRANCH=master #not used +LIBSIGROKDECODE_BRANCH=master #TODO: make each dep install it's own deps # Exit immediately if an error occurs @@ -90,10 +89,10 @@ build_libiio() { cd ${WORKDIR}/libiio/build-${ARCH} # Download a 32-bit version of windres.exe - cd /c - wget http://swdownloads.analog.com/cse/build/windres.exe.gz - gunzip windres.exe.gz - cd ${WORKDIR}/libiio/build-${ARCH} + cd /c + wget http://swdownloads.analog.com/cse/build/windres.exe.gz + gunzip windres.exe.gz + cd ${WORKDIR}/libiio/build-${ARCH} cmake -G 'Unix Makefiles' \ ${CMAKE_OPTS} \ @@ -196,41 +195,18 @@ build_grscopy() { DESTDIR=${WORKDIR} make $JOBS install } -build_libsigrok() { - echo "### Building libsigrok - branch $LIBSIGROK_BRANCH" - - git clone --depth 1 https://github.com/sigrokproject/libsigrok.git -b $LIBSIGROK_BRANCH ${WORKDIR}/libsigrok - - mkdir ${WORKDIR}/libsigrok/build-${ARCH} - cd ${WORKDIR}/libsigrok/build-${ARCH} - - ../autogen.sh - CPPFLAGS="-DLIBSIGROK_EXPORT=1" ../configure ${AUTOCONF_OPTS} \ - --without-libusb \ - --enable-all-drivers=no - - make $JOBS install - DESTDIR=${WORKDIR} make $JOBS install - - # For some reason, Scopy chokes if these are present in enums.hpp - sed -i "s/static const Quantity \* const DIFFERENCE;$//g" ${WORKDIR}/msys64/${MINGW_VERSION}/include/libsigrokcxx/enums.hpp - sed -i "s/static const QuantityFlag \* const RELATIVE;$//g" ${WORKDIR}/msys64/${MINGW_VERSION}/include/libsigrokcxx/enums.hpp -} - build_libsigrokdecode() { echo "### Building libsigrokdecode - branch $LIBSIGROKDECODE_BRANCH" + git clone --depth 1 https://github.com/sigrokproject/libsigrokdecode.git -b $LIBSIGROKDECODE_BRANCH ${WORKDIR}/libsigrokdecode mkdir -p ${WORKDIR}/libsigrokdecode/build-${ARCH} cd ${WORKDIR}/libsigrokdecode - wget http://sigrok.org/download/source/libsigrokdecode/libsigrokdecode-0.4.1.tar.gz -O- \ - | tar xz --strip-components=1 -C ${WORKDIR}/libsigrokdecode - patch -p1 < ${WORKDIR}/sigrokdecode-windows-fix.patch + ./autogen.sh cd build-${ARCH} CPPFLAGS="-DLIBSIGROKDECODE_EXPORT=1" ../configure ${AUTOCONF_OPTS} - make $JOBS install DESTDIR=${WORKDIR} make $JOBS install } @@ -287,7 +263,6 @@ build_grscopy build_grm2k build_qwt build_qwtpolar -build_libsigrok build_libsigrokdecode # Fix DLLs installed in the wrong path From ea1cb25e888ce7c428505e7a22ab38473cdb6939 Mon Sep 17 00:00:00 2001 From: Dan Nechita Date: Fri, 10 Jul 2020 13:12:46 +0300 Subject: [PATCH 38/77] ci: Remove unused cmake option for libiio (matlab bindings) The matlab bindings option is no longer available. Signed-off-by: Dan Nechita --- build.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/build.sh b/build.sh index 17a0ad412c..7c217e852a 100755 --- a/build.sh +++ b/build.sh @@ -99,7 +99,6 @@ build_libiio() { ${RC_COMPILER_OPT} \ -DWITH_TESTS:BOOL=OFF \ -DWITH_DOC:BOOL=OFF \ - -DWITH_MATLAB_BINDINGS:BOOL=OFF \ -DCSHARP_BINDINGS:BOOL=OFF \ -DPYTHON_BINDINGS:BOOL=OFF \ ${WORKDIR}/libiio From 3f84075791eb594750279350f167a2c099d8e95a Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Thu, 23 Jul 2020 21:21:24 +0300 Subject: [PATCH 39/77] libm2k: use latest release instead of master Temp fix until libm2k and scopy come back in sync Signed-off-by: Adrian Suciu --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 7c217e852a..940cd891b5 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ LIBIIO_BRANCH=master LIBAD9361_BRANCH=master -LIBM2K_BRANCH=master +LIBM2K_BRANCH=v0.2.1 GRIIO_BRANCH=upgrade-3.8 GNURADIO_FORK=analogdevicesinc GNURADIO_BRANCH=ming-3.8-clean From 3335f8335fd21bb8eda8ae056f6ed9862c2ac3da Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Mon, 31 Aug 2020 12:57:13 +0300 Subject: [PATCH 40/77] build.sh: use master for libm2k Signed-off-by: Adrian Suciu --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 940cd891b5..7c217e852a 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ LIBIIO_BRANCH=master LIBAD9361_BRANCH=master -LIBM2K_BRANCH=v0.2.1 +LIBM2K_BRANCH=master GRIIO_BRANCH=upgrade-3.8 GNURADIO_FORK=analogdevicesinc GNURADIO_BRANCH=ming-3.8-clean From 9b5c19eb7c2fe5604864272b28f444b7cf27c0d8 Mon Sep 17 00:00:00 2001 From: Alexandra Trifan Date: Wed, 7 Oct 2020 16:15:46 +0300 Subject: [PATCH 41/77] Appveyor: Check the MSYS2 mirrorlist and use the one that works. The default mirror is "repo.msys2.org". If that fails, we make the build work with the next link in the list. Signed-off-by: Alexandra Trifan --- build.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 7c217e852a..1bf75e2462 100755 --- a/build.sh +++ b/build.sh @@ -66,10 +66,11 @@ PACMAN_SYNC_DEPS=" mingw-w64-$ARCH-doxygen\ " + PACMAN_REPO_DEPS=" -http://repo.msys2.org/mingw/$ARCH/mingw-w64-$ARCH-libusb-1.0.21-2-any.pkg.tar.xz \ -http://repo.msys2.org/mingw/$ARCH/mingw-w64-$ARCH-boost-1.72.0-3-any.pkg.tar.zst \ -http://repo.msys2.org/mingw/$ARCH/mingw-w64-$ARCH-qt5-5.14.2-3-any.pkg.tar.zst \ +${WORKDIR}/old_msys_deps_${MINGW_VERSION}/mingw-w64-$ARCH-libusb-1.0.21-2-any.pkg.tar.xz \ +${WORKDIR}/old_msys_deps_${MINGW_VERSION}/mingw-w64-$ARCH-boost-1.72.0-3-any.pkg.tar.zst \ +${WORKDIR}/old_msys_deps_${MINGW_VERSION}/mingw-w64-$ARCH-qt5-5.14.2-3-any.pkg.tar.zst \ " echo "### Installing dependencies ... " From b4534b86f747009217b09da8feacd988a170a5a9 Mon Sep 17 00:00:00 2001 From: Alexandra Trifan Date: Thu, 22 Oct 2020 12:02:10 +0300 Subject: [PATCH 42/77] Appveyor: Use mingw64/bin/windres as RC compiler for 64 bit. Signed-off-by: Alexandra Trifan --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 1bf75e2462..e076343fd8 100755 --- a/build.sh +++ b/build.sh @@ -40,7 +40,7 @@ if [ ${ARCH} == "i686" ] then RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=/c/windres.exe" else - RC_COMPILER_OPT="" + RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=/c/msys64/mingw64/bin/windres.exe" fi install_deps() { echo "### Download and installed precompiled GNURadio ... " From 9c7bfc3a737974a883ddad1cb5534469de19699d Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Tue, 27 Oct 2020 18:02:18 +0200 Subject: [PATCH 43/77] appveyor.yml Use Visual Studio 2019 image Hack: use static link for old msys deps Signed-off-by: Adrian Suciu --- build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sh b/build.sh index e076343fd8..969d8a28cb 100755 --- a/build.sh +++ b/build.sh @@ -72,6 +72,7 @@ ${WORKDIR}/old_msys_deps_${MINGW_VERSION}/mingw-w64-$ARCH-libusb-1.0.21-2-any.pk ${WORKDIR}/old_msys_deps_${MINGW_VERSION}/mingw-w64-$ARCH-boost-1.72.0-3-any.pkg.tar.zst \ ${WORKDIR}/old_msys_deps_${MINGW_VERSION}/mingw-w64-$ARCH-qt5-5.14.2-3-any.pkg.tar.zst \ " +ls ${WORKDIR}/old_msys_deps_${MINGW_VERSION} echo "### Installing dependencies ... " pacman --noconfirm --needed -Sy $PACMAN_SYNC_DEPS From 87a3a902ab567b774075f45db33b4e2e940beba8 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Mon, 23 Nov 2020 15:56:32 +0200 Subject: [PATCH 44/77] appveyor.yml: added build status that will be uploaded along with the artifact Signed-off-by: Adrian Suciu --- build.sh | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index 969d8a28cb..ca9a48c138 100755 --- a/build.sh +++ b/build.sh @@ -12,11 +12,14 @@ QWT_BRANCH=qwt-6.1-multiaxes QWTPOLAR_BRANCH=master # not used LIBSIGROKDECODE_BRANCH=master +BUILD_STATUS_FILE=/tmp/scopy-mingw-build-status +touch $BUILD_STATUS_FILE + #TODO: make each dep install it's own deps # Exit immediately if an error occurs set -e -export PATH=/bin:/usr/bin:/${MINGW_VERSION}/bin:/c/Program\ Files/Git/cmd:/c/Windows/System32 +export PATH=/bin:/usr/bin:/${MINGW_VERSION}/bin:/c/Program\ Files/Git/cmd:/c/Windows/System32:/c/Program\ Files/Appveyor/BuildAgent WORKDIR=${PWD} JOBS=-j3 @@ -72,6 +75,25 @@ ${WORKDIR}/old_msys_deps_${MINGW_VERSION}/mingw-w64-$ARCH-libusb-1.0.21-2-any.pk ${WORKDIR}/old_msys_deps_${MINGW_VERSION}/mingw-w64-$ARCH-boost-1.72.0-3-any.pkg.tar.zst \ ${WORKDIR}/old_msys_deps_${MINGW_VERSION}/mingw-w64-$ARCH-qt5-5.14.2-3-any.pkg.tar.zst \ " + +echo "Built scopy-mingw-build-deps on Appveyor" >> $BUILD_STATUS_FILE +echo "on $(date)" >> $BUILD_STATUS_FILE +echo "url: ${APPVEYOR_URL}" >> $BUILD_STATUS_FILE +echo "api_url: ${APPVEYOR_API_URL}" >> $BUILD_STATUS_FILE +echo "acc_name: ${APPVEYOR_ACCOUNT_NAME}" >> $BUILD_STATUS_FILE +echo "prj_name: ${APPVEYOR_PROJECT_NAME}" >> $BUILD_STATUS_FILE +echo "build_id: ${APPVEYOR_BUILD_ID}" >> $BUILD_STATUS_FILE +echo "build_nr: ${APPVEYOR_BUILD_NUMBER}" >> $BUILD_STATUS_FILE +echo "build_version: ${APPVEYOR_BUILD_VERSION}" >> $BUILD_STATUS_FILE +echo "job_id: ${APPVEYOR_JOB_ID}" >> $BUILD_STATUS_FILE +echo "job_name: ${APPVEYOR_JOB_NAME}" >> $BUILD_STATUS_FILE +echo "job_nr: ${APPVEYOR_JOB_NUMBER}" >> $BUILD_STATUS_FILE +echo "job_link: ${APPVEYOR_URL}/project/${APPVEYOR_ACCOUNT_NAME}/${APPVEYOR_PROJECT_NAME}/builds/${APPVEYOR_BUILD_ID}/job/${APPVEYOR_JOB_ID}" >> $BUILD_STATUS_FILE + +echo $BUILD_STATUS_FILE + +echo "Repo deps locations/files" >> $BUILD_STATUS_FILE +echo $PACMAN_REPO_DEPS >> $BUILD_STATUS_FILE ls ${WORKDIR}/old_msys_deps_${MINGW_VERSION} echo "### Installing dependencies ... " @@ -83,6 +105,7 @@ sed -i "s/\$\${CROSS_COMPILE}/${ARCH}-w64-mingw32-/" /${MINGW_VERSION}/share/qt5 } build_libiio() { + CURRENT_BUILD=libiio echo "### Building libiio - branch $LIBIIO_BRANCH" git clone --depth 1 https://github.com/analogdevicesinc/libiio.git -b $LIBIIO_BRANCH ${WORKDIR}/libiio @@ -107,10 +130,12 @@ build_libiio() { make ${JOBS} install DESTDIR=${WORKDIR} make ${JOBS} install + echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE } build_libm2k() { echo "### Building libm2k - branch $LIBM2K_BRANCH" + CURRENT_BUILD=libm2k git clone --depth 1 https://github.com/analogdevicesinc/libm2k.git -b $LIBM2K_BRANCH ${WORKDIR}/libm2k @@ -129,11 +154,13 @@ build_libm2k() { make ${JOBS} install DESTDIR=${WORKDIR} make ${JOBS} install + echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE } build_libad9361() { echo "### Building libad9361 - branch $LIBAD9361_BRANCH" + CURRENT_BUILD=libad9361 git clone --depth 1 https://github.com/analogdevicesinc/libad9361-iio.git -b $LIBAD9361_BRANCH ${WORKDIR}/libad9361 mkdir ${WORKDIR}/libad9361/build-${ARCH} @@ -145,11 +172,12 @@ build_libad9361() { make $JOBS install DESTDIR=${WORKDIR} make $JOBS install + echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE } build_griio() { echo "### Building gr-iio - branch $GRIIO_BRANCH" - + CURRENT_BUILD=gr-iio git clone --depth 1 https://github.com/analogdevicesinc/gr-iio.git -b $GRIIO_BRANCH ${WORKDIR}/gr-iio mkdir ${WORKDIR}/gr-iio/build-${ARCH} @@ -163,11 +191,12 @@ build_griio() { make $JOBS install DESTDIR=${WORKDIR} make $JOBS install + echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE } build_grm2k() { echo "### Building gr-m2k - branch $GRM2K_BRANCH" - + CURRENT_BUILD=gr-m2k git clone --depth 1 https://github.com/analogdevicesinc/gr-m2k.git -b $GRM2K_BRANCH ${WORKDIR}/gr-m2k mkdir ${WORKDIR}/gr-m2k/build-${ARCH} cd ${WORKDIR}/gr-m2k/build-${ARCH} @@ -179,11 +208,12 @@ build_grm2k() { make $JOBS install DESTDIR=${WORKDIR} make $JOBS install + echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE } build_grscopy() { echo "### Building gr-scopy - branch $GRSCOPY_BRANCH" - + CURRENT_BUILD=gr-scopy git clone --depth 1 https://github.com/analogdevicesinc/gr-scopy.git -b $GRSCOPY_BRANCH ${WORKDIR}/gr-scopy mkdir ${WORKDIR}/gr-scopy/build-${ARCH} cd ${WORKDIR}/gr-scopy/build-${ARCH} @@ -194,10 +224,12 @@ build_grscopy() { make $JOBS install DESTDIR=${WORKDIR} make $JOBS install + echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE } build_libsigrokdecode() { echo "### Building libsigrokdecode - branch $LIBSIGROKDECODE_BRANCH" + CURRENT_BUILD=libsigrokdecode git clone --depth 1 https://github.com/sigrokproject/libsigrokdecode.git -b $LIBSIGROKDECODE_BRANCH ${WORKDIR}/libsigrokdecode mkdir -p ${WORKDIR}/libsigrokdecode/build-${ARCH} @@ -210,11 +242,12 @@ build_libsigrokdecode() { CPPFLAGS="-DLIBSIGROKDECODE_EXPORT=1" ../configure ${AUTOCONF_OPTS} make $JOBS install DESTDIR=${WORKDIR} make $JOBS install + echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE } build_qwt() { echo "### Building qwt - branch $QWT_BRANCH" - + CURRENT_BUILD=qwt git clone --depth 1 https://github.com/osakared/qwt.git -b $QWT_BRANCH ${WORKDIR}/qwt cd ${WORKDIR}/qwt @@ -230,10 +263,12 @@ build_qwt() { qmake make INSTALL_ROOT="/c/msys64/${MINGW_VERSION}" $JOBS -f Makefile.Release install make INSTALL_ROOT="${WORKDIR}/msys64/${MINGW_VERSION}" $JOBS -f Makefile.Release install + echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE } build_qwtpolar() { echo "### Building qwtpolar - branch $QWTPOLAR_BRANCH" + CURRENT_BUILD=qwtpolar mkdir -p ${WORKDIR}/qwtpolar cd ${WORKDIR}/qwtpolar @@ -253,6 +288,7 @@ build_qwtpolar() { qmake LIBS+="-lqwt" make INSTALL_ROOT="/c/msys64/${MINGW_VERSION}" $JOBS -f Makefile.Release install make INSTALL_ROOT="${WORKDIR}/msys64/${MINGW_VERSION}" $JOBS -f Makefile.Release install + echo "$CURRENT_BUILD - v1.1.1" >> $BUILD_STATUS_FILE } install_deps @@ -266,6 +302,12 @@ build_qwt build_qwtpolar build_libsigrokdecode +echo "" >> $BUILD_STATUS_FILE +echo "pacman -Qe output - all explicitly installed packages on build machine" >> $BUILD_STATUS_FILE +pacman -Qe >> $BUILD_STATUS_FILE +#echo "pacman -Qm output - all packages from nonsync sources" >> $BUILD_STATUS_FILE +#pacman -Qm >> $BUILD_STATUS_FILE + # Fix DLLs installed in the wrong path mv ${WORKDIR}/msys64/${MINGW_VERSION}/lib/qwt.dll \ ${WORKDIR}/msys64/${MINGW_VERSION}/lib/qwtpolar.dll \ @@ -277,7 +319,9 @@ rm -rf ${WORKDIR}/msys64/${MINGW_VERSION}/doc \ echo "### Creating archive ... " tar cavf ${WORKDIR}/scopy-${MINGW_VERSION}-build-deps.tar.xz -C ${WORKDIR} msys64 - +appveyor PushArtifact $BUILD_STATUS_FILE +pacman -Q > /tmp/AllInstalledPackages +appveyor PushArtifact /tmp/AllInstalledPackages echo -n ${PACMAN_SYNC_DEPS} > ${WORKDIR}/scopy-$MINGW_VERSION-build-deps-pacman.txt From 2ce570f8a57b1adccff3731aeb2b8bf97becf18d Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Fri, 4 Dec 2020 19:49:29 +0200 Subject: [PATCH 45/77] ci: use swdownloads link for old deps and try gnuradio3.8 rebased Signed-off-by: Adrian Suciu --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index ca9a48c138..9f551244fe 100755 --- a/build.sh +++ b/build.sh @@ -5,7 +5,7 @@ LIBAD9361_BRANCH=master LIBM2K_BRANCH=master GRIIO_BRANCH=upgrade-3.8 GNURADIO_FORK=analogdevicesinc -GNURADIO_BRANCH=ming-3.8-clean +GNURADIO_BRANCH=ming-3.8-clean-rebase-test GRSCOPY_BRANCH=master GRM2K_BRANCH=master QWT_BRANCH=qwt-6.1-multiaxes From 395497cf45bc101bb99c6a38354a67bdefcf6635 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Mon, 18 Jan 2021 16:43:11 +0200 Subject: [PATCH 46/77] ci: use latest packages on msys2 and our own qwt fork Signed-off-by: Adrian Suciu --- build.sh | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/build.sh b/build.sh index 9f551244fe..96c9a1904d 100755 --- a/build.sh +++ b/build.sh @@ -5,10 +5,10 @@ LIBAD9361_BRANCH=master LIBM2K_BRANCH=master GRIIO_BRANCH=upgrade-3.8 GNURADIO_FORK=analogdevicesinc -GNURADIO_BRANCH=ming-3.8-clean-rebase-test +GNURADIO_BRANCH=scopy GRSCOPY_BRANCH=master GRM2K_BRANCH=master -QWT_BRANCH=qwt-6.1-multiaxes +QWT_BRANCH=qwt-6.1-multiaxes-scopy QWTPOLAR_BRANCH=master # not used LIBSIGROKDECODE_BRANCH=master @@ -56,7 +56,6 @@ tar xJf /tmp/gnuradio-$MINGW_VERSION.tar.xz GNURADIO_DEPS=$(> $BUILD_STATUS_FILE echo "on $(date)" >> $BUILD_STATUS_FILE @@ -93,12 +95,12 @@ echo "job_link: ${APPVEYOR_URL}/project/${APPVEYOR_ACCOUNT_NAME}/${APPVEYOR_PRO echo $BUILD_STATUS_FILE echo "Repo deps locations/files" >> $BUILD_STATUS_FILE -echo $PACMAN_REPO_DEPS >> $BUILD_STATUS_FILE +#echo $PACMAN_REPO_DEPS >> $BUILD_STATUS_FILE ls ${WORKDIR}/old_msys_deps_${MINGW_VERSION} echo "### Installing dependencies ... " pacman --noconfirm --needed -Sy $PACMAN_SYNC_DEPS -pacman --noconfirm -U $PACMAN_REPO_DEPS +#pacman --noconfirm -U $PACMAN_REPO_DEPS # Fix Qt5 spec files sed -i "s/\$\${CROSS_COMPILE}/${ARCH}-w64-mingw32-/" /${MINGW_VERSION}/share/qt5/mkspecs/win32-g++/qmake.conf @@ -248,17 +250,9 @@ build_libsigrokdecode() { build_qwt() { echo "### Building qwt - branch $QWT_BRANCH" CURRENT_BUILD=qwt - git clone --depth 1 https://github.com/osakared/qwt.git -b $QWT_BRANCH ${WORKDIR}/qwt + git clone --depth 1 https://github.com/adisuciu/qwt.git -b $QWT_BRANCH ${WORKDIR}/qwt cd ${WORKDIR}/qwt - # Disable components that we won't build - sed -i "s/^QWT_CONFIG\\s*+=\\s*QwtMathML$/#/g" qwtconfig.pri - sed -i "s/^QWT_CONFIG\\s*+=\\s*QwtDesigner$/#/g" qwtconfig.pri - sed -i "s/^QWT_CONFIG\\s*+=\\s*QwtExamples$/#/g" qwtconfig.pri - - # Fix prefix - sed -i "s/^\\s*QWT_INSTALL_PREFIX.*$/QWT_INSTALL_PREFIX=\"\"/g" qwtconfig.pri - cd ${WORKDIR}/qwt/src qmake make INSTALL_ROOT="/c/msys64/${MINGW_VERSION}" $JOBS -f Makefile.Release install From ba209ea5d31a52f8ba92a8323b39f80bd29e5d92 Mon Sep 17 00:00:00 2001 From: Teo Perisanu Date: Mon, 8 Feb 2021 10:32:16 +0200 Subject: [PATCH 47/77] build.sh: Add libtinyiiod. libtinyiiod is a dependency used in iio-emu (scopy submodule). iio-emu is a server application used for emulating device behaviors. Signed-off-by: Teo Perisanu --- build.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/build.sh b/build.sh index 96c9a1904d..1f2afd587e 100755 --- a/build.sh +++ b/build.sh @@ -11,6 +11,7 @@ GRM2K_BRANCH=master QWT_BRANCH=qwt-6.1-multiaxes-scopy QWTPOLAR_BRANCH=master # not used LIBSIGROKDECODE_BRANCH=master +LIBTINYIIOD_BRANCH=master BUILD_STATUS_FILE=/tmp/scopy-mingw-build-status touch $BUILD_STATUS_FILE @@ -285,6 +286,26 @@ build_qwtpolar() { echo "$CURRENT_BUILD - v1.1.1" >> $BUILD_STATUS_FILE } +build_libtinyiiod() { + echo "### Building libtinyiiod - branch $LIBTINYIIOD_BRANCH" + CURRENT_BUILD=libtinyiiod + + git clone --depth 1 https://github.com/analogdevicesinc/libtinyiiod.git -b $LIBTINYIIOD_BRANCH ${WORKDIR}/libtinyiiod + + mkdir ${WORKDIR}/libtinyiiod/build-${ARCH} + cd ${WORKDIR}/libtinyiiod/build-${ARCH} + + cmake -G 'Unix Makefiles' \ + ${CMAKE_OPTS} \ + -DBUILD_EXAMPLES=OFF\ + ${WORKDIR}/libtinyiiod + + make ${JOBS} install + DESTDIR=${WORKDIR} make ${JOBS} install + + echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE +} + install_deps build_libiio build_libad9361 @@ -295,6 +316,7 @@ build_grm2k build_qwt build_qwtpolar build_libsigrokdecode +build_libtinyiiod echo "" >> $BUILD_STATUS_FILE echo "pacman -Qe output - all explicitly installed packages on build machine" >> $BUILD_STATUS_FILE From 354f88437b2b3f49429a8619c3e34937493ecb83 Mon Sep 17 00:00:00 2001 From: Teo Perisanu Date: Tue, 6 Oct 2020 09:12:01 +0300 Subject: [PATCH 48/77] Build libm2k with logging support. Signed-off-by: Teo Perisanu --- build.sh | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/build.sh b/build.sh index 1f2afd587e..fe9769c324 100755 --- a/build.sh +++ b/build.sh @@ -12,6 +12,7 @@ QWT_BRANCH=qwt-6.1-multiaxes-scopy QWTPOLAR_BRANCH=master # not used LIBSIGROKDECODE_BRANCH=master LIBTINYIIOD_BRANCH=master +GLOG_BRANCH=master BUILD_STATUS_FILE=/tmp/scopy-mingw-build-status touch $BUILD_STATUS_FILE @@ -136,6 +137,25 @@ build_libiio() { echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE } +build_glog() { + echo "### Building glog - branch $GLOG_BRANCH" + + git clone --depth 1 https://github.com/teoperisanu/glog.git -b $GLOG_BRANCH ${WORKDIR}/glog + + mkdir ${WORKDIR}/glog/build-${ARCH} + cd ${WORKDIR}/glog/build-${ARCH} + + cmake -G 'Unix Makefiles' \ + ${CMAKE_OPTS} \ + -DWITH_GFLAGS=OFF \ + -DBUILD_SHARED_LIBS=ON \ + ${WORKDIR}/glog + + make ${JOBS} install + DESTDIR=${WORKDIR} make ${JOBS} install + echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE +} + build_libm2k() { echo "### Building libm2k - branch $LIBM2K_BRANCH" CURRENT_BUILD=libm2k @@ -151,6 +171,7 @@ build_libm2k() { -DENABLE_CSHARP=OFF\ -DENABLE_EXAMPLES=OFF\ -DENABLE_TOOLS=OFF\ + -DENABLE_LOG=ON\ -DINSTALL_UDEV_RULES=OFF\ ${WORKDIR}/libm2k @@ -307,6 +328,7 @@ build_libtinyiiod() { } install_deps +build_glog build_libiio build_libad9361 build_libm2k From 912b3ff7c20296776df0b553551fabbfef9bdf97 Mon Sep 17 00:00:00 2001 From: Teo Perisanu Date: Mon, 8 Feb 2021 10:41:28 +0200 Subject: [PATCH 49/77] build.sh: Replace in libm2k build ENABLE_EXAMPLES to BUILD_EXAMPLES. Signed-off-by: Teo Perisanu --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index fe9769c324..cca3e9afa8 100755 --- a/build.sh +++ b/build.sh @@ -169,7 +169,7 @@ build_libm2k() { ${CMAKE_OPTS} \ -DENABLE_PYTHON=OFF\ -DENABLE_CSHARP=OFF\ - -DENABLE_EXAMPLES=OFF\ + -DBUILD_EXAMPLES=OFF\ -DENABLE_TOOLS=OFF\ -DENABLE_LOG=ON\ -DINSTALL_UDEV_RULES=OFF\ From fb09b8ea8ec23d5edfac8aa53c795c0d752afb72 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Tue, 9 Mar 2021 17:55:12 +0200 Subject: [PATCH 50/77] build.sh: use libusb version v1.0.21 https://github.com/analogdevicesinc/scopy/issues/1031 Signed-off-by: Adrian Suciu --- build.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index cca3e9afa8..9f18d9598d 100755 --- a/build.sh +++ b/build.sh @@ -68,17 +68,17 @@ PACMAN_SYNC_DEPS=" mingw-w64-$ARCH-glib2 \ mingw-w64-$ARCH-glibmm \ mingw-w64-$ARCH-doxygen\ - mingw-w64-$ARCH-libusb \ mingw-w64-$ARCH-boost \ mingw-w64-$ARCH-qt5 \ " +# mingw-w64-$ARCH-libusb \ -#PACMAN_REPO_DEPS=" -#${WORKDIR}/old_msys_deps_${MINGW_VERSION}/mingw-w64-$ARCH-libusb-1.0.21-2-any.pkg.tar.xz \ +PACMAN_REPO_DEPS=" +${WORKDIR}/old_msys_deps_${MINGW_VERSION}/mingw-w64-$ARCH-libusb-1.0.21-2-any.pkg.tar.xz \ +" #${WORKDIR}/old_msys_deps_${MINGW_VERSION}/mingw-w64-$ARCH-boost-1.72.0-3-any.pkg.tar.zst \ #${WORKDIR}/old_msys_deps_${MINGW_VERSION}/mingw-w64-$ARCH-qt5-5.14.2-3-any.pkg.tar.zst \ -#" echo "Built scopy-mingw-build-deps on Appveyor" >> $BUILD_STATUS_FILE echo "on $(date)" >> $BUILD_STATUS_FILE @@ -97,12 +97,12 @@ echo "job_link: ${APPVEYOR_URL}/project/${APPVEYOR_ACCOUNT_NAME}/${APPVEYOR_PRO echo $BUILD_STATUS_FILE echo "Repo deps locations/files" >> $BUILD_STATUS_FILE -#echo $PACMAN_REPO_DEPS >> $BUILD_STATUS_FILE +echo $PACMAN_REPO_DEPS >> $BUILD_STATUS_FILE ls ${WORKDIR}/old_msys_deps_${MINGW_VERSION} echo "### Installing dependencies ... " pacman --noconfirm --needed -Sy $PACMAN_SYNC_DEPS -#pacman --noconfirm -U $PACMAN_REPO_DEPS +pacman --noconfirm -U $PACMAN_REPO_DEPS # Fix Qt5 spec files sed -i "s/\$\${CROSS_COMPILE}/${ARCH}-w64-mingw32-/" /${MINGW_VERSION}/share/qt5/mkspecs/win32-g++/qmake.conf From 5247e4d707559f959b6936da470f1c9a49fbeeb6 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Thu, 6 May 2021 17:51:24 +0300 Subject: [PATCH 51/77] appveyor.yml: update msys2 environment according to https://www.msys2.org/docs/ci/#appveyor Signed-off-by: Adrian Suciu --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 9f18d9598d..0f9323e70c 100755 --- a/build.sh +++ b/build.sh @@ -101,7 +101,7 @@ echo $PACMAN_REPO_DEPS >> $BUILD_STATUS_FILE ls ${WORKDIR}/old_msys_deps_${MINGW_VERSION} echo "### Installing dependencies ... " -pacman --noconfirm --needed -Sy $PACMAN_SYNC_DEPS +pacman --noconfirm --needed -S $PACMAN_SYNC_DEPS pacman --noconfirm -U $PACMAN_REPO_DEPS # Fix Qt5 spec files From 52be0721bb8c52ae29d0ac9d1a071d389dd9e86d Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Tue, 7 Sep 2021 21:34:44 +0300 Subject: [PATCH 52/77] build.sh: update for libiio v0.23 Signed-off-by: Adrian Suciu --- build.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.sh b/build.sh index 0f9323e70c..e2ad3492fb 100755 --- a/build.sh +++ b/build.sh @@ -126,6 +126,9 @@ build_libiio() { cmake -G 'Unix Makefiles' \ ${CMAKE_OPTS} \ ${RC_COMPILER_OPT} \ + -DENABLE_IPV6=OFF \ + -DWITH_USB_BACKEND=ON \ + -DWITH_SERIAL_BACKEND=OFF \ -DWITH_TESTS:BOOL=OFF \ -DWITH_DOC:BOOL=OFF \ -DCSHARP_BINDINGS:BOOL=OFF \ From 758f90a515852c5288fa33067953150106ca8a69 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Wed, 15 Sep 2021 21:59:47 +0300 Subject: [PATCH 53/77] tree: refactor use build script with staging folder use submodules Signed-off-by: Adrian Suciu --- build.sh | 460 +++++++++++++++++++++------------------------ init_staging.sh | 11 ++ mingw_toolchain.sh | 61 ++++++ 3 files changed, 283 insertions(+), 249 deletions(-) create mode 100644 init_staging.sh create mode 100644 mingw_toolchain.sh diff --git a/build.sh b/build.sh index e2ad3492fb..496389958d 100755 --- a/build.sh +++ b/build.sh @@ -1,84 +1,57 @@ #!/usr/bin/bash.exe -LIBIIO_BRANCH=master -LIBAD9361_BRANCH=master -LIBM2K_BRANCH=master -GRIIO_BRANCH=upgrade-3.8 -GNURADIO_FORK=analogdevicesinc -GNURADIO_BRANCH=scopy -GRSCOPY_BRANCH=master -GRM2K_BRANCH=master -QWT_BRANCH=qwt-6.1-multiaxes-scopy -QWTPOLAR_BRANCH=master # not used -LIBSIGROKDECODE_BRANCH=master -LIBTINYIIOD_BRANCH=master -GLOG_BRANCH=master - -BUILD_STATUS_FILE=/tmp/scopy-mingw-build-status -touch $BUILD_STATUS_FILE - -#TODO: make each dep install it's own deps -# Exit immediately if an error occurs -set -e - -export PATH=/bin:/usr/bin:/${MINGW_VERSION}/bin:/c/Program\ Files/Git/cmd:/c/Windows/System32:/c/Program\ Files/Appveyor/BuildAgent - -WORKDIR=${PWD} -JOBS=-j3 - -CC=/${MINGW_VERSION}/bin/${ARCH}-w64-mingw32-gcc.exe -CXX=/${MINGW_VERSION}/bin/${ARCH}-w64-mingw32-g++.exe -CMAKE_OPTS=" - -DCMAKE_C_COMPILER:FILEPATH=${CC} \ - -DCMAKE_CXX_COMPILER:FILEPATH=${CXX} \ - -DPKG_CONFIG_EXECUTABLE=/$MINGW_VERSION/bin/pkg-config.exe \ - -DCMAKE_INSTALL_PREFIX=/${MINGW_VERSION}\ - -DCMAKE_PREFIX_PATH=/c/msys64/$MINGW_VERSION/lib/cmake \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ - " -AUTOCONF_OPTS="--prefix=/msys64/${MINGW_VERSION} \ - --host=${ARCH}-w64-mingw32 \ - --enable-shared \ - --disable-static" - -if [ ${ARCH} == "i686" ] -then - RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=/c/windres.exe" -else - RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=/c/msys64/mingw64/bin/windres.exe" -fi -install_deps() { -echo "### Download and installed precompiled GNURadio ... " -wget "https://ci.appveyor.com/api/projects/$GNURADIO_FORK/gnuradio/artifacts/gnuradio-$MINGW_VERSION-deps.txt?branch=$GNURADIO_BRANCH&job=Environment: MINGW_VERSION=$MINGW_VERSION, ARCH=$ARCH" -O /tmp/gnuradio-$MINGW_VERSION-deps.txt -wget "https://ci.appveyor.com/api/projects/$GNURADIO_FORK/gnuradio/artifacts/gnuradio-$MINGW_VERSION.tar.xz?branch=$GNURADIO_BRANCH&job=Environment: MINGW_VERSION=$MINGW_VERSION, ARCH=$ARCH" -O /tmp/gnuradio-$MINGW_VERSION.tar.xz -cd $WORKDIR -tar xJf /tmp/gnuradio-$MINGW_VERSION.tar.xz -cd /c -tar xJf /tmp/gnuradio-$MINGW_VERSION.tar.xz - -GNURADIO_DEPS=$(> $BUILD_STATUS_FILE echo "on $(date)" >> $BUILD_STATUS_FILE @@ -99,32 +72,96 @@ echo $BUILD_STATUS_FILE echo "Repo deps locations/files" >> $BUILD_STATUS_FILE echo $PACMAN_REPO_DEPS >> $BUILD_STATUS_FILE ls ${WORKDIR}/old_msys_deps_${MINGW_VERSION} +} -echo "### Installing dependencies ... " -pacman --noconfirm --needed -S $PACMAN_SYNC_DEPS -pacman --noconfirm -U $PACMAN_REPO_DEPS +__clean_build_dir() { + git clean -xdf + rm -rf ${WORKDIR}/$CURRENT_BUILD/build-${ARCH} + mkdir ${WORKDIR}/$CURRENT_BUILD/build-${ARCH} + cd ${WORKDIR}/$CURRENT_BUILD/build-${ARCH} +} -# Fix Qt5 spec files -sed -i "s/\$\${CROSS_COMPILE}/${ARCH}-w64-mingw32-/" /${MINGW_VERSION}/share/qt5/mkspecs/win32-g++/qmake.conf +__build_with_cmake() { + INSTALL="install" + if [ $NO_INSTALL=="TRUE" ]; then + INSTALL="" + fi + pushd $WORKDIR/$CURRENT_BUILD + __clean_build_dir + eval $CURRENT_BUILD_POST_CLEAN + eval $CURRENT_BUILD_PATCHES + $CMAKE $CURRENT_BUILD_CMAKE_OPTS $WORKDIR/$CURRENT_BUILD + eval $CURRENT_BUILD_POST_CMAKE + $MAKE_BIN $JOBS $INSTALL + eval $CURRENT_BUILD_POST_MAKE + echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE + # clear vars + CURRENT_BUILD_CMAKE_OPTS="" + CURRENT_BUILD_POST_CLEAN="" + CURRENT_BUILD_PATCHES="" + CURRENT_BUILD_POST_CMAKE="" + CURRENT_BUILD_POST_MAKE="" + CURRENT_BUILD="" + NO_INSTALL="" + popd } -build_libiio() { - CURRENT_BUILD=libiio - echo "### Building libiio - branch $LIBIIO_BRANCH" +build_log4cpp() { + CURRENT_BUILD=log4cpp - git clone --depth 1 https://github.com/analogdevicesinc/libiio.git -b $LIBIIO_BRANCH ${WORKDIR}/libiio + # this is a fix for MINGW long long long is too long - patch the config-MingW32.h + # probably not the cleanest patch - deletes this line + # https://github.com/orocos-toolchain/log4cpp/blob/359be7d88eb8a87f618620918c73ef1fc6e87242/include/log4cpp/config-MinGW32.h#L27 + # we need a better patch here or maybe use another repo - mkdir ${WORKDIR}/libiio/build-${ARCH} - cd ${WORKDIR}/libiio/build-${ARCH} - # Download a 32-bit version of windres.exe + CURRENT_BUILD_POST_CLEAN=" + git reset --hard && + sed '27d' ../include/log4cpp/config-MinGW32.h > temp && mv temp ../include/log4cpp/config-MinGW32.h; + " + # LOG4CPP puts dll in wrong file for MINGW - it should be in bin, but it puts it in lib so we copy it + CURRENT_BUILD_POST_MAKE=" + mkdir -p $STAGING_DIR/bin && + cp $STAGING_DIR/lib/liblog4cpp.dll $STAGING_DIR/bin/liblog4cpp.dll + " + __build_with_cmake +} - cd /c - wget http://swdownloads.analog.com/cse/build/windres.exe.gz - gunzip windres.exe.gz - cd ${WORKDIR}/libiio/build-${ARCH} +build_volk() { + CURRENT_BUILD=volk + CURRENT_BUILD_POST_CLEAN="git submodule update --init" + CURRENT_BUILD_CMAKE_OPTS="-DPYTHON_EXECUTABLE=/mingw64/bin/python3 -DENABLE_MODTOOL=OFF -DENABLE_TESTING=OFF ../" + __build_with_cmake - cmake -G 'Unix Makefiles' \ - ${CMAKE_OPTS} \ +} + +build_gnuradio() { + #echo gnuradio + CURRENT_BUILD=gnuradio + + # Set -fno-asynchronous-unwind-tables to avoid these error messages: + # C:\Users\appveyor\AppData\Local\Temp\1\ccO00eqH.s: Assembler messages: + # C:\Users\appveyor\AppData\Local\Temp\1\ccO00eqH.s:17939: Error: invalid register for .seh_savexmm + # might be related to the liborc library though ... + + CURRENT_BUILD_CMAKE_OPTS="-DENABLE_GR_DIGITAL:BOOL=OFF \ + -DENABLE_GR_DTV:BOOL=OFF \ + -DENABLE_GR_AUDIO:BOOL=OFF \ + -DENABLE_GR_CHANNELS:BOOL=OFF \ + -DENABLE_GR_TRELLIS:BOOL=OFF \ + -DENABLE_GR_VOCODER:BOOL=OFF \ + -DENABLE_GR_FEC:BOOL=OFF \ + -DENABLE_DOXYGEN:BOOL=OFF \ + -DENABLE_TESTING:BOOL=OFF \ + -DENABLE_INTERNAL_VOLK:BOOL=OFF \ + -DCMAKE_C_FLAGS=-fno-asynchronous-unwind-tables \ + -DPYTHON_EXECUTABLE=/mingw64/bin/python3 \ + " + __build_with_cmake +} + +build_libiio() { + CURRENT_BUILD=libiio + CURRENT_BUILD_CMAKE_OPTS="\ ${RC_COMPILER_OPT} \ -DENABLE_IPV6=OFF \ -DWITH_USB_BACKEND=ON \ @@ -133,132 +170,71 @@ build_libiio() { -DWITH_DOC:BOOL=OFF \ -DCSHARP_BINDINGS:BOOL=OFF \ -DPYTHON_BINDINGS:BOOL=OFF \ - ${WORKDIR}/libiio - - make ${JOBS} install - DESTDIR=${WORKDIR} make ${JOBS} install - echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE + " + __build_with_cmake } build_glog() { - echo "### Building glog - branch $GLOG_BRANCH" - - git clone --depth 1 https://github.com/teoperisanu/glog.git -b $GLOG_BRANCH ${WORKDIR}/glog - - mkdir ${WORKDIR}/glog/build-${ARCH} - cd ${WORKDIR}/glog/build-${ARCH} - - cmake -G 'Unix Makefiles' \ - ${CMAKE_OPTS} \ - -DWITH_GFLAGS=OFF \ - -DBUILD_SHARED_LIBS=ON \ - ${WORKDIR}/glog - - make ${JOBS} install - DESTDIR=${WORKDIR} make ${JOBS} install - echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE + CURRENT_BUILD=glog + CURRENT_BUILD_CMAKE_OPTS="\ + -DWITH_GFLAGS=OFF \ + -DBUILD_SHARED_LIBS=ON \ + " + __build_with_cmake } build_libm2k() { - echo "### Building libm2k - branch $LIBM2K_BRANCH" CURRENT_BUILD=libm2k - - git clone --depth 1 https://github.com/analogdevicesinc/libm2k.git -b $LIBM2K_BRANCH ${WORKDIR}/libm2k - - mkdir ${WORKDIR}/libm2k/build-${ARCH} - cd ${WORKDIR}/libm2k/build-${ARCH} - - cmake -G 'Unix Makefiles' \ - ${CMAKE_OPTS} \ + CURRENT_BUILD_CMAKE_OPTS="\ -DENABLE_PYTHON=OFF\ -DENABLE_CSHARP=OFF\ -DBUILD_EXAMPLES=OFF\ -DENABLE_TOOLS=OFF\ -DENABLE_LOG=ON\ -DINSTALL_UDEV_RULES=OFF\ - ${WORKDIR}/libm2k - - make ${JOBS} install - DESTDIR=${WORKDIR} make ${JOBS} install - - echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE + " + __build_with_cmake } build_libad9361() { echo "### Building libad9361 - branch $LIBAD9361_BRANCH" - CURRENT_BUILD=libad9361 - git clone --depth 1 https://github.com/analogdevicesinc/libad9361-iio.git -b $LIBAD9361_BRANCH ${WORKDIR}/libad9361 - - mkdir ${WORKDIR}/libad9361/build-${ARCH} - cd ${WORKDIR}/libad9361/build-${ARCH} - - cmake -G 'Unix Makefiles' \ - ${CMAKE_OPTS} \ - ${WORKDIR}/libad9361 - - make $JOBS install - DESTDIR=${WORKDIR} make $JOBS install - echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE + __build_with_cmake } build_griio() { echo "### Building gr-iio - branch $GRIIO_BRANCH" - CURRENT_BUILD=gr-iio - git clone --depth 1 https://github.com/analogdevicesinc/gr-iio.git -b $GRIIO_BRANCH ${WORKDIR}/gr-iio - - mkdir ${WORKDIR}/gr-iio/build-${ARCH} - cd ${WORKDIR}/gr-iio/build-${ARCH} + CURRENT_BUILD=gr-iio # -D_hypot=hypot: http://boost.2283326.n4.nabble.com/Boost-Python-Compile-Error-s-GCC-via-MinGW-w64-td3165793.html#a3166757 - cmake -G 'Unix Makefiles' \ - ${CMAKE_OPTS} \ - -DCMAKE_CXX_FLAGS="-D_hypot=hypot" \ - ${WORKDIR}/gr-iio + CURRENT_BUILD_CMAKE_OPTS="-DCMAKE_CXX_FLAGS=-D_hypot=hypot -DPYTHON_EXECUTABLE=/mingw64/bin/python3 " + __build_with_cmake - make $JOBS install - DESTDIR=${WORKDIR} make $JOBS install - echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE } build_grm2k() { echo "### Building gr-m2k - branch $GRM2K_BRANCH" CURRENT_BUILD=gr-m2k - git clone --depth 1 https://github.com/analogdevicesinc/gr-m2k.git -b $GRM2K_BRANCH ${WORKDIR}/gr-m2k - mkdir ${WORKDIR}/gr-m2k/build-${ARCH} - cd ${WORKDIR}/gr-m2k/build-${ARCH} - - cmake -G 'Unix Makefiles' \ - ${CMAKE_OPTS} \ - ${WORKDIR}/gr-m2k - - make $JOBS install - DESTDIR=${WORKDIR} make $JOBS install - - echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE + CURRENT_BUILD_CMAKE_OPTS="-DPYTHON_EXECUTABLE=/mingw64/bin/python3 " + __build_with_cmake } build_grscopy() { echo "### Building gr-scopy - branch $GRSCOPY_BRANCH" CURRENT_BUILD=gr-scopy - git clone --depth 1 https://github.com/analogdevicesinc/gr-scopy.git -b $GRSCOPY_BRANCH ${WORKDIR}/gr-scopy - mkdir ${WORKDIR}/gr-scopy/build-${ARCH} - cd ${WORKDIR}/gr-scopy/build-${ARCH} - - cmake -G 'Unix Makefiles' \ - ${CMAKE_OPTS} \ - ${WORKDIR}/gr-scopy - - make $JOBS install - DESTDIR=${WORKDIR} make $JOBS install - echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE + CURRENT_BUILD_CMAKE_OPTS="-DPYTHON_EXECUTABLE=/mingw64/bin/python3 " + __build_with_cmake } build_libsigrokdecode() { echo "### Building libsigrokdecode - branch $LIBSIGROKDECODE_BRANCH" CURRENT_BUILD=libsigrokdecode - git clone --depth 1 https://github.com/sigrokproject/libsigrokdecode.git -b $LIBSIGROKDECODE_BRANCH ${WORKDIR}/libsigrokdecode + pushd $WORKDIR/libsigrokdecode + git reset --hard + git clean -xdf + + rm -rf ${WORKDIR}/libsigrokdecode/build-${ARCH} mkdir -p ${WORKDIR}/libsigrokdecode/build-${ARCH} cd ${WORKDIR}/libsigrokdecode @@ -267,102 +243,88 @@ build_libsigrokdecode() { cd build-${ARCH} CPPFLAGS="-DLIBSIGROKDECODE_EXPORT=1" ../configure ${AUTOCONF_OPTS} - make $JOBS install - DESTDIR=${WORKDIR} make $JOBS install + $MAKE_BIN $JOBS install echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE + popd } build_qwt() { echo "### Building qwt - branch $QWT_BRANCH" CURRENT_BUILD=qwt - git clone --depth 1 https://github.com/adisuciu/qwt.git -b $QWT_BRANCH ${WORKDIR}/qwt - cd ${WORKDIR}/qwt - - cd ${WORKDIR}/qwt/src - qmake - make INSTALL_ROOT="/c/msys64/${MINGW_VERSION}" $JOBS -f Makefile.Release install - make INSTALL_ROOT="${WORKDIR}/msys64/${MINGW_VERSION}" $JOBS -f Makefile.Release install + svn checkout svn://svn.code.sf.net/p/qwt/code/branches/qwt-6.1-multiaxes $CURRENT_BUILD + pushd $CURRENT_BUILD + svn patch $WORKDIR/qwt-config-svn.patch + + $QMAKE + make $JOBS + make INSTALL_ROOT="$STAGING_DIR" $JOBS install + cp $STAGING_DIR/lib/qwt.dll $STAGING_DIR/bin/qwt.dll echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE -} - -build_qwtpolar() { - echo "### Building qwtpolar - branch $QWTPOLAR_BRANCH" - CURRENT_BUILD=qwtpolar - mkdir -p ${WORKDIR}/qwtpolar - cd ${WORKDIR}/qwtpolar - - wget https://downloads.sourceforge.net/project/qwtpolar/qwtpolar/1.1.1/qwtpolar-1.1.1.tar.bz2 -O- \ - | tar xj --strip-components=1 -C ${WORKDIR}/qwtpolar - - patch -p1 < ${WORKDIR}/qwtpolar-qwt-6.1-compat.patch - - # Disable components that we won't build - sed -i "s/^QWT_POLAR_CONFIG\\s*+=\\s*QwtPolarDesigner$/#/g" qwtpolarconfig.pri - sed -i "s/^QWT_POLAR_CONFIG\\s*+=\\s*QwtPolarExamples$/#/g" qwtpolarconfig.pri - - # Fix prefix - sed -i "s/^\\s*QWT_POLAR_INSTALL_PREFIX.*$/QWT_POLAR_INSTALL_PREFIX=\"\"/g" qwtpolarconfig.pri - - cd ${WORKDIR}/qwtpolar/src - qmake LIBS+="-lqwt" - make INSTALL_ROOT="/c/msys64/${MINGW_VERSION}" $JOBS -f Makefile.Release install - make INSTALL_ROOT="${WORKDIR}/msys64/${MINGW_VERSION}" $JOBS -f Makefile.Release install - echo "$CURRENT_BUILD - v1.1.1" >> $BUILD_STATUS_FILE + popd } build_libtinyiiod() { echo "### Building libtinyiiod - branch $LIBTINYIIOD_BRANCH" CURRENT_BUILD=libtinyiiod + CURRENT_BUILD_CMAKE_OPTS="-DBUILD_EXAMPLES=OFF" + __build_with_cmake +} - git clone --depth 1 https://github.com/analogdevicesinc/libtinyiiod.git -b $LIBTINYIIOD_BRANCH ${WORKDIR}/libtinyiiod +build_scopy() { + CURRENT_BUILD=scopy + NO_INSTALL="TRUE" + CURRENT_BUILD_CMAKE_OPTS="$RC_COMPILER_OPT \ + -DBREAKPAD_HANDLER=ON \ + -DWITH_DOC=ON \ + -DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3.exe \ + " + __build_with_cmake +} - mkdir ${WORKDIR}/libtinyiiod/build-${ARCH} - cd ${WORKDIR}/libtinyiiod/build-${ARCH} +package_and_push() { +if [ -z $APPVEYOR ]; then + echo "Appveyor environment not detected" + return +fi - cmake -G 'Unix Makefiles' \ - ${CMAKE_OPTS} \ - -DBUILD_EXAMPLES=OFF\ - ${WORKDIR}/libtinyiiod +echo "" >> $BUILD_STATUS_FILE +echo "$PACMAN -Qe output - all explicitly installed packages on build machine" >> $BUILD_STATUS_FILE +$PACMAN -Qe >> $BUILD_STATUS_FILE +echo "pacman -Qm output - all packages from nonsync sources" >> $BUILD_STATUS_FILE +$PACMAN -Qm >> $BUILD_STATUS_FILE - make ${JOBS} install - DESTDIR=${WORKDIR} make ${JOBS} install +# Fix DLLs installed in the wrong path +#mv ${WORKDIR}/msys64/${MINGW_VERSION}/lib/qwt.dll \ +# ${WORKDIR}/msys64/${MINGW_VERSION}/lib/qwtpolar.dll \ +# ${WORKDIR}/msys64/${MINGW_VERSION}/bin - echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE +#rm -rf ${WORKDIR}/msys64/${MINGW_VERSION}/doc \ +# ${WORKDIR}/msys64/${MINGW_VERSION}/share/doc \ +# ${WORKDIR}/msys64/${MINGW_VERSION}/lib/*.la + +echo "### Creating archive ... " +tar cavf ${WORKDIR}/scopy-${MINGW_VERSION}-build-deps.tar.xz -C ${WORKDIR} msys64 +appveyor PushArtifact $BUILD_STATUS_FILE +$PACMAN -Q > /tmp/AllInstalledPackages +appveyor PushArtifact /tmp/AllInstalledPackages +echo -n ${PACMAN_SYNC_DEPS} > ${WORKDIR}/scopy-$MINGW_VERSION-build-deps-pacman.txt } +install_tools install_deps +create_build_status_file build_glog build_libiio build_libad9361 build_libm2k +build_log4cpp +build_volk +build_gnuradio build_griio build_grscopy build_grm2k build_qwt -build_qwtpolar build_libsigrokdecode build_libtinyiiod - -echo "" >> $BUILD_STATUS_FILE -echo "pacman -Qe output - all explicitly installed packages on build machine" >> $BUILD_STATUS_FILE -pacman -Qe >> $BUILD_STATUS_FILE -#echo "pacman -Qm output - all packages from nonsync sources" >> $BUILD_STATUS_FILE -#pacman -Qm >> $BUILD_STATUS_FILE - -# Fix DLLs installed in the wrong path -mv ${WORKDIR}/msys64/${MINGW_VERSION}/lib/qwt.dll \ - ${WORKDIR}/msys64/${MINGW_VERSION}/lib/qwtpolar.dll \ - ${WORKDIR}/msys64/${MINGW_VERSION}/bin - -rm -rf ${WORKDIR}/msys64/${MINGW_VERSION}/doc \ - ${WORKDIR}/msys64/${MINGW_VERSION}/share/doc \ - ${WORKDIR}/msys64/${MINGW_VERSION}/lib/*.la - -echo "### Creating archive ... " -tar cavf ${WORKDIR}/scopy-${MINGW_VERSION}-build-deps.tar.xz -C ${WORKDIR} msys64 -appveyor PushArtifact $BUILD_STATUS_FILE -pacman -Q > /tmp/AllInstalledPackages -appveyor PushArtifact /tmp/AllInstalledPackages -echo -n ${PACMAN_SYNC_DEPS} > ${WORKDIR}/scopy-$MINGW_VERSION-build-deps-pacman.txt - - +build_scopy # for testing +package_and_push diff --git a/init_staging.sh b/init_staging.sh new file mode 100644 index 0000000000..8e1140ce14 --- /dev/null +++ b/init_staging.sh @@ -0,0 +1,11 @@ +#!/usr/bin/bash.exe +set -x +source mingw_toolchain.sh + +init_staging() { + rm -rf $STAGING_ENV + mkdir -p $STAGING_ENV/var/lib/pacman/local + mkdir -p $STAGING_ENV/var/lib/pacman/sync + /usr/bin/bash.exe -c "$PACMAN -Syuu bash filesystem mintty pacman" +} +init_staging diff --git a/mingw_toolchain.sh b/mingw_toolchain.sh new file mode 100644 index 0000000000..594cdb24f9 --- /dev/null +++ b/mingw_toolchain.sh @@ -0,0 +1,61 @@ +#!/usr/bin/bash.exe +source build_system_setup.sh + +BUILD_STATUS_FILE=/tmp/scopy-mingw-build-status +touch $BUILD_STATUS_FILE + +#TODO: make each dep install it's own deps +# Exit immediately if an error occurs +#set -e +#set -x + +export PATH=/bin:/usr/bin:/${MINGW_VERSION}/bin:/c/Program\ Files/Git/cmd:/c/Windows/System32:/c/Program\ Files/Appveyor/BuildAgent + +export WORKDIR=${PWD} + +if [ -z "$STAGING" ]; + then + export STAGING_DIR=$WORKDIR/staging/$MINGW_VERSION + export STAGING_ENV=$WORKDIR/staging + else + export STAGING_DIR=$STAGING/$MINGW_VERSION + export STAGING_ENV=$STAGING +fi + +export CC=/${MINGW_VERSION}/bin/${ARCH}-w64-mingw32-gcc.exe +export CXX=/${MINGW_VERSION}/bin/${ARCH}-w64-mingw32-g++.exe +export JOBS="-j 9" +export MAKE_BIN=/${MINGW_VERSION}/bin/mingw32-make.exe +export MAKE_CMD="$MAKE_BIN $JOBS" +export CMAKE_GENERATOR="Unix Makefiles" +export CMAKE_OPTS=( \ + -DCMAKE_C_COMPILER:FILEPATH=${CC} \ + -DCMAKE_CXX_COMPILER:FILEPATH=${CXX} \ + -DCMAKE_MAKE_PROGRAM:FILEPATH=${MAKE_BIN}\ + -DPKG_CONFIG_EXECUTABLE=/$MINGW_VERSION/bin/pkg-config.exe \ + -DCMAKE_MODULE_PATH=$STAGING_DIR \ + -DCMAKE_PREFIX_PATH=$STAGING_DIR/lib/cmake \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_STAGING_PREFIX=$STAGING_DIR \ + -DCMAKE_INSTALL_PREFIX=$STAGING_DIR \ +) +export QMAKE="$STAGING_DIR/bin/qmake" +export CMAKE="/mingw64/bin/cmake ${CMAKE_OPTS[@]} " +export PACMAN="pacman -r $STAGING_ENV --noconfirm --needed" + +export AUTOCONF_OPTS="--prefix=$STAGING_DIR \ + --host=${ARCH}-w64-mingw32 \ + --enable-shared \ + --disable-static" + +if [ ${ARCH} == "i686" ] +then + export RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=$WORKDIR/windres/windres.exe" +else + export RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=/mingw64/bin/windres.exe" +fi + +echo -- $STAGING_DIR is the staging dir +echo -- PATH is $PATH +echo -- using cmake command +echo $CMAKE From 2f68ab8bdfa4dcf5568eee2dde3e2670a84bd126 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Mon, 27 Sep 2021 19:05:31 +0300 Subject: [PATCH 54/77] docker: added Dockerfile Signed-off-by: Adrian Suciu --- README.md | 21 ++++++++++----- build.sh | 64 ++++++++++++++++++++++++++++++++++------------ docker/Dockerfile | 46 +++++++++++++++++++++++++++++++++ init_staging.sh | 2 +- mingw_toolchain.sh | 30 +++++++++++++++++++--- 5 files changed, 135 insertions(+), 28 deletions(-) create mode 100644 docker/Dockerfile diff --git a/README.md b/README.md index dedf19493b..48045ee692 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,19 @@ # scopy-mingw-build-deps -AppVeyor script to automatically build the dependencies for Scopy under MinGW. +Script that build staging environment with dependencies to build scopy. MSYS2 - https://www.msys2.org/ is required for development. To initialize the development environment, from the mingw64 shell -## Appveyor Builds -Nightly builds for Windows are available at: https://ci.appveyor.com/project/analogdevicesinc/scopy-mingw-build-deps/build/artifacts +git clone https://github.com/analogdevicesinc/scopy-mingw-build-deps +cd scopy-mingw-build-deps +./init_staging x86_64 +source ./build.sh +install_tools +install_deps +build_deps -Each build contains two jobs: -- Dependencies for 64-bit builds. -- Dependencies for 32-bit builds. + +Dockerfile available in docker folder +To build docker image. +x86_64: + docker build --progress=plain --tag scopy-build:mingw64 --build-arg BUILD_TARGET=x86_64 --isolation=hyperv --memory=16GB . +i686: + docker build --progress=plain --tag scopy-build:mingw32 --build-arg BUILD_TARGET=i686 --isolation=hyperv --memory=16GB . diff --git a/build.sh b/build.sh index 496389958d..7e0432cc81 100755 --- a/build.sh +++ b/build.sh @@ -1,8 +1,7 @@ #!/usr/bin/bash.exe set -ex -source mingw_toolchain.sh - +source mingw_toolchain.sh $1 TOOLS_PKGS="\ mingw-w64-${ARCH}-cmake \ @@ -30,12 +29,14 @@ PACMAN_SYNC_DEPS=" \ mingw-w64-${ARCH}-doxygen\ mingw-w64-${ARCH}-qt5 \ mingw-w64-${ARCH}-zlib \ - mingw-w64-${ARCH}-breakpad-git \ + mingw-w64-${ARCH}-breakpad \ mingw-w64-${ARCH}-libusb \ " +export PATH=/bin:$MINGW_VERSION/bin:$WORKDIR/cv2pdb:/c/innosetup/:$PATH$ export PKG_CONFIG_PATH=$STAGING_DIR/lib/pkgconfig install_tools() { + pacman --noconfirm -S unzip zip mkdir -p $WORKDIR/windres pushd $WORKDIR/windres if [ ! -f windres.exe.gz ]; then @@ -44,6 +45,21 @@ install_tools() { fi popd + wget http://swdownloads.analog.com/cse/m1k/drivers/dpinst.zip + wget http://swdownloads.analog.com/cse/m1k/drivers/dfu-util.zip + unzip "dpinst.zip" + unzip "dfu-util.zip" + + # github release upload tool install + wget https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_windows_amd64.zip + unzip ghr_v0.13.0_windows_amd64.zip + export UPLOAD_TOOL=/c/ghr/ghr_v0.13.0_windows_amd64/ghr.exe + + wget https://swdownloads.analog.com/cse/scopydeps/cv2pdb-dlls.zip + unzip "cv2pdb-dlls.zip" + + wget https://jrsoftware.org/download.php/is.exe + pacman --noconfirm --needed -S $TOOLS_PKGS } install_deps() { @@ -51,6 +67,12 @@ install_deps() { $PACMAN -U https://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-boost-1.75.0-9-any.pkg.tar.zst } +recurse_submodules() { + pushd $WORKDIR + git submodule update --init --recursive --jobs 9 + popd +} + create_build_status_file() { echo "Built scopy-mingw-build-deps on Appveyor" >> $BUILD_STATUS_FILE @@ -71,7 +93,7 @@ echo $BUILD_STATUS_FILE echo "Repo deps locations/files" >> $BUILD_STATUS_FILE echo $PACMAN_REPO_DEPS >> $BUILD_STATUS_FILE -ls ${WORKDIR}/old_msys_deps_${MINGW_VERSION} +#ls ${WORKDIR}/old_msys_deps_${MINGW_VERSION} } __clean_build_dir() { @@ -83,7 +105,7 @@ __clean_build_dir() { __build_with_cmake() { INSTALL="install" - if [ $NO_INSTALL=="TRUE" ]; then + if [ ! -z $NO_INSTALL ]; then INSTALL="" fi pushd $WORKDIR/$CURRENT_BUILD @@ -129,7 +151,7 @@ build_log4cpp() { build_volk() { CURRENT_BUILD=volk CURRENT_BUILD_POST_CLEAN="git submodule update --init" - CURRENT_BUILD_CMAKE_OPTS="-DPYTHON_EXECUTABLE=/mingw64/bin/python3 -DENABLE_MODTOOL=OFF -DENABLE_TESTING=OFF ../" + CURRENT_BUILD_CMAKE_OPTS="-DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3 -DENABLE_MODTOOL=OFF -DENABLE_TESTING=OFF ../" __build_with_cmake } @@ -154,7 +176,7 @@ build_gnuradio() { -DENABLE_TESTING:BOOL=OFF \ -DENABLE_INTERNAL_VOLK:BOOL=OFF \ -DCMAKE_C_FLAGS=-fno-asynchronous-unwind-tables \ - -DPYTHON_EXECUTABLE=/mingw64/bin/python3 \ + -DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3 \ " __build_with_cmake } @@ -207,7 +229,7 @@ build_griio() { CURRENT_BUILD=gr-iio # -D_hypot=hypot: http://boost.2283326.n4.nabble.com/Boost-Python-Compile-Error-s-GCC-via-MinGW-w64-td3165793.html#a3166757 - CURRENT_BUILD_CMAKE_OPTS="-DCMAKE_CXX_FLAGS=-D_hypot=hypot -DPYTHON_EXECUTABLE=/mingw64/bin/python3 " + CURRENT_BUILD_CMAKE_OPTS="-DCMAKE_CXX_FLAGS=-D_hypot=hypot -DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3 " __build_with_cmake } @@ -215,14 +237,14 @@ build_griio() { build_grm2k() { echo "### Building gr-m2k - branch $GRM2K_BRANCH" CURRENT_BUILD=gr-m2k - CURRENT_BUILD_CMAKE_OPTS="-DPYTHON_EXECUTABLE=/mingw64/bin/python3 " + CURRENT_BUILD_CMAKE_OPTS="-DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3 " __build_with_cmake } build_grscopy() { echo "### Building gr-scopy - branch $GRSCOPY_BRANCH" CURRENT_BUILD=gr-scopy - CURRENT_BUILD_CMAKE_OPTS="-DPYTHON_EXECUTABLE=/mingw64/bin/python3 " + CURRENT_BUILD_CMAKE_OPTS="-DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3 " __build_with_cmake } @@ -231,8 +253,11 @@ build_libsigrokdecode() { CURRENT_BUILD=libsigrokdecode pushd $WORKDIR/libsigrokdecode - git reset --hard - git clean -xdf + if [ -d "$WORKDIR/libsigrokdecode/build-$ARCH" ]; then + # hack .. this gets messed up somehow in docker due to changing files to lowercase + git reset --hard + git clean -xdf + fi rm -rf ${WORKDIR}/libsigrokdecode/build-${ARCH} mkdir -p ${WORKDIR}/libsigrokdecode/build-${ARCH} @@ -310,9 +335,7 @@ appveyor PushArtifact /tmp/AllInstalledPackages echo -n ${PACMAN_SYNC_DEPS} > ${WORKDIR}/scopy-$MINGW_VERSION-build-deps-pacman.txt } -install_tools -install_deps -create_build_status_file +build_deps() { build_glog build_libiio build_libad9361 @@ -326,5 +349,12 @@ build_grm2k build_qwt build_libsigrokdecode build_libtinyiiod -build_scopy # for testing -package_and_push +} + +#recurse_submodules +#install_tools +#install_deps +#create_build_status_file +#build_deps +#build_scopy # for testing +#package_and_push diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000000..351955d29a --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,46 @@ +# select as base image matching your host to get process isolation +FROM mcr.microsoft.com/windows/servercore:2004 + +SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] +# this creates an empty file named recycle.bin which essentialy disables the recycle bin +# this hack is needed because msys seems to create some files with wierd names in recycle bin +# that freeze the docker layer when commiting +# dirty hack +RUN echo . > 'C:\$RECYCLE.BIN'; + +RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ +Invoke-WebRequest -UseBasicParsing -uri "https://github.com/msys2/msys2-installer/releases/download/2021-07-25/msys2-base-x86_64-20210725.sfx.exe" -OutFile msys2.exe; \ +.\msys2.exe -y -oC:\\; \ +Remove-Item msys2.exe; +RUN 'mkdir C:/msys64/home/docker/ && cd C:/msys64/home/docker/' + +SHELL ["cmd", "/S", "/C"] +# set envvars PATH HOME CHERE_INVOKING MSYS_SYSTEM - https://www.msys2.org/docs/ci/#other-systems +RUN setx PATH C:\msys64\bin;C:\msys64\mingw64\bin;C:\msys64\usr\bin;%PATH% & \ +setx HOME C:\msys64\home\docker & \ +setx CHERE_INVOKING yes & \ +setx MSYSTEM MINGW64 + +WORKDIR C:\\msys64\\home\\docker +RUN C:\msys64\usr\bin\bash.exe -lc " " +SHELL ["cmd", "/S", "/C"] +RUN C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu" & C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu" & C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Scc " +# install general packages needed to run build scripts +RUN C:\msys64\usr\bin\bash.exe -c 'pacman --noconfirm --needed -Sy git' +RUN C:\msys64\usr\bin\bash.exe -c "git clone https://github.com/analogdevicesinc/scopy-mingw-build-deps --branch refactor " + +# install packages and build scopy-deps +ARG BUILD_TARGET=x86_64 +ENV BUILD_TARGET=$BUILD_TARGET + +# exit 0 is required because init_staging force terminates the msys process resulting in an error - it is not an error +RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && ls && echo Building for $BUILD_TARGET &&./init_staging.sh $BUILD_TARGET" & exit 0 +RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && source build.sh $BUILD_TARGET && install_tools && install_deps && recurse_submodules" +RUN C:\msys64\home\docker\scopy-mingw-build-deps\is.exe /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART /LOG=C:\msys64\home\docker\iss.log /DIR=C:\innosetup +RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && source build.sh $BUILD_TARGET && build_deps" +# clone scopy + +# build scopy + + + diff --git a/init_staging.sh b/init_staging.sh index 8e1140ce14..939609ed84 100644 --- a/init_staging.sh +++ b/init_staging.sh @@ -1,6 +1,6 @@ #!/usr/bin/bash.exe set -x -source mingw_toolchain.sh +source mingw_toolchain.sh $1 init_staging() { rm -rf $STAGING_ENV diff --git a/mingw_toolchain.sh b/mingw_toolchain.sh index 594cdb24f9..bea65be0b0 100644 --- a/mingw_toolchain.sh +++ b/mingw_toolchain.sh @@ -9,14 +9,33 @@ touch $BUILD_STATUS_FILE #set -e #set -x +if [ $# -ne 1 ]; then + ARG1=x86_64 +else + ARG1=$1 +fi +export ARCH=$ARG1 +if [ $ARCH == "x86_64" ] +then + export MINGW_VERSION=mingw64 + export ARCH_BIT=64 +else + export MINGW_VERSION=mingw32 + export ARCH_BIT=32 +fi + +echo $STAGING_PREFIX is the staging prefix +export STAGING=${STAGING_PREFIX}_${ARCH} +export JOBS="-j9" + export PATH=/bin:/usr/bin:/${MINGW_VERSION}/bin:/c/Program\ Files/Git/cmd:/c/Windows/System32:/c/Program\ Files/Appveyor/BuildAgent export WORKDIR=${PWD} -if [ -z "$STAGING" ]; +if [ -z "$STAGING_PREFIX" ] then - export STAGING_DIR=$WORKDIR/staging/$MINGW_VERSION - export STAGING_ENV=$WORKDIR/staging + export STAGING_DIR=$WORKDIR/staging_$ARCH/$MINGW_VERSION + export STAGING_ENV=$WORKDIR/staging_$ARCH else export STAGING_DIR=$STAGING/$MINGW_VERSION export STAGING_ENV=$STAGING @@ -40,8 +59,9 @@ export CMAKE_OPTS=( \ -DCMAKE_INSTALL_PREFIX=$STAGING_DIR \ ) export QMAKE="$STAGING_DIR/bin/qmake" -export CMAKE="/mingw64/bin/cmake ${CMAKE_OPTS[@]} " +export CMAKE="/$MINGW_VERSION/bin/cmake ${CMAKE_OPTS[@]} " export PACMAN="pacman -r $STAGING_ENV --noconfirm --needed" +export PKG_CONFIG_PATH=$STAGING_DIR/lib/pkgconfig export AUTOCONF_OPTS="--prefix=$STAGING_DIR \ --host=${ARCH}-w64-mingw32 \ @@ -56,6 +76,8 @@ else fi echo -- $STAGING_DIR is the staging dir +echo -- $MINGW_VERSION - mingw version +echo -- $ARCH - target arch echo -- PATH is $PATH echo -- using cmake command echo $CMAKE From e42738629100cda3fac7a13c560e90a138929b93 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Wed, 29 Sep 2021 23:47:36 +0300 Subject: [PATCH 55/77] build.sh: reduce image size by cleaning after build Signed-off-by: Adrian Suciu --- build.sh | 2 ++ docker/Dockerfile | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index 7e0432cc81..5d3c1bedf8 100755 --- a/build.sh +++ b/build.sh @@ -116,6 +116,7 @@ __build_with_cmake() { eval $CURRENT_BUILD_POST_CMAKE $MAKE_BIN $JOBS $INSTALL eval $CURRENT_BUILD_POST_MAKE + rm -rf ${WORKDIR}/$CURRENT_BUILD/build-${ARCH} echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE # clear vars CURRENT_BUILD_CMAKE_OPTS="" @@ -269,6 +270,7 @@ build_libsigrokdecode() { CPPFLAGS="-DLIBSIGROKDECODE_EXPORT=1" ../configure ${AUTOCONF_OPTS} $MAKE_BIN $JOBS install + rm -rf ${WORKDIR}/libsigrokdecode/build-${ARCH} echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE popd } diff --git a/docker/Dockerfile b/docker/Dockerfile index 351955d29a..9be4cf01d7 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,5 +1,5 @@ # select as base image matching your host to get process isolation -FROM mcr.microsoft.com/windows/servercore:2004 +FROM mcr.microsoft.com/windows/servercore:ltsc2019 SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] # this creates an empty file named recycle.bin which essentialy disables the recycle bin @@ -27,11 +27,12 @@ SHELL ["cmd", "/S", "/C"] RUN C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu" & C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu" & C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Scc " # install general packages needed to run build scripts RUN C:\msys64\usr\bin\bash.exe -c 'pacman --noconfirm --needed -Sy git' -RUN C:\msys64\usr\bin\bash.exe -c "git clone https://github.com/analogdevicesinc/scopy-mingw-build-deps --branch refactor " +RUN C:\msys64\usr\bin\bash.exe -c "git clone https://github.com/analogdevicesinc/scopy-mingw-build-deps --branch refactor " # install packages and build scopy-deps -ARG BUILD_TARGET=x86_64 +ARG BUILD_TARGET=x86_64 ENV BUILD_TARGET=$BUILD_TARGET +RUN echo %BUILD_TARGET% # exit 0 is required because init_staging force terminates the msys process resulting in an error - it is not an error RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && ls && echo Building for $BUILD_TARGET &&./init_staging.sh $BUILD_TARGET" & exit 0 From a098a2dcc9c78b1a4ff843f8154939ac5b44cb19 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Thu, 30 Sep 2021 13:05:53 +0300 Subject: [PATCH 56/77] tree: reduce image size by not using staging for packages installed with pacman Signed-off-by: Adrian Suciu --- build.sh | 4 ++-- docker/Dockerfile | 4 ++-- init_staging.sh | 3 +++ mingw_toolchain.sh | 12 ++++++++++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index 5d3c1bedf8..2cf10afcca 100755 --- a/build.sh +++ b/build.sh @@ -115,8 +115,7 @@ __build_with_cmake() { $CMAKE $CURRENT_BUILD_CMAKE_OPTS $WORKDIR/$CURRENT_BUILD eval $CURRENT_BUILD_POST_CMAKE $MAKE_BIN $JOBS $INSTALL - eval $CURRENT_BUILD_POST_MAKE - rm -rf ${WORKDIR}/$CURRENT_BUILD/build-${ARCH} + eval $CURRENT_BUILD_POST_MAKE echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE # clear vars CURRENT_BUILD_CMAKE_OPTS="" @@ -127,6 +126,7 @@ __build_with_cmake() { CURRENT_BUILD="" NO_INSTALL="" popd + rm -rf ${WORKDIR}/$CURRENT_BUILD/build-${ARCH} } build_log4cpp() { diff --git a/docker/Dockerfile b/docker/Dockerfile index 9be4cf01d7..28ac9f8984 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -27,7 +27,7 @@ SHELL ["cmd", "/S", "/C"] RUN C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu" & C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu" & C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Scc " # install general packages needed to run build scripts RUN C:\msys64\usr\bin\bash.exe -c 'pacman --noconfirm --needed -Sy git' -RUN C:\msys64\usr\bin\bash.exe -c "git clone https://github.com/analogdevicesinc/scopy-mingw-build-deps --branch refactor " +RUN C:\msys64\usr\bin\bash.exe -c "git clone https://github.com/analogdevicesinc/scopy-mingw-build-deps --branch master " # install packages and build scopy-deps ARG BUILD_TARGET=x86_64 @@ -35,7 +35,7 @@ ENV BUILD_TARGET=$BUILD_TARGET RUN echo %BUILD_TARGET% # exit 0 is required because init_staging force terminates the msys process resulting in an error - it is not an error -RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && ls && echo Building for $BUILD_TARGET &&./init_staging.sh $BUILD_TARGET" & exit 0 +RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && ls && echo Building for $BUILD_TARGET && ./init_staging.sh $BUILD_TARGET" & exit 0 RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && source build.sh $BUILD_TARGET && install_tools && install_deps && recurse_submodules" RUN C:\msys64\home\docker\scopy-mingw-build-deps\is.exe /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART /LOG=C:\msys64\home\docker\iss.log /DIR=C:\innosetup RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && source build.sh $BUILD_TARGET && build_deps" diff --git a/init_staging.sh b/init_staging.sh index 939609ed84..1ea5c49e4e 100644 --- a/init_staging.sh +++ b/init_staging.sh @@ -3,9 +3,12 @@ set -x source mingw_toolchain.sh $1 init_staging() { + if [ -v USE_STAGING ] + then rm -rf $STAGING_ENV mkdir -p $STAGING_ENV/var/lib/pacman/local mkdir -p $STAGING_ENV/var/lib/pacman/sync /usr/bin/bash.exe -c "$PACMAN -Syuu bash filesystem mintty pacman" + fi } init_staging diff --git a/mingw_toolchain.sh b/mingw_toolchain.sh index bea65be0b0..f16c010a14 100644 --- a/mingw_toolchain.sh +++ b/mingw_toolchain.sh @@ -58,9 +58,17 @@ export CMAKE_OPTS=( \ -DCMAKE_STAGING_PREFIX=$STAGING_DIR \ -DCMAKE_INSTALL_PREFIX=$STAGING_DIR \ ) -export QMAKE="$STAGING_DIR/bin/qmake" export CMAKE="/$MINGW_VERSION/bin/cmake ${CMAKE_OPTS[@]} " -export PACMAN="pacman -r $STAGING_ENV --noconfirm --needed" +if [ -z $USE_STAGING ] +then + export PACMAN="pacman --noconfirm --needed" + export QMAKE="/$MINGW_VERSION/bin/qmake" +else + #we want to use staging + export PACMAN="pacman -r $STAGING_ENV --noconfirm --needed" + export QMAKE="$STAGING_DIR/bin/qmake" +fi + export PKG_CONFIG_PATH=$STAGING_DIR/lib/pkgconfig export AUTOCONF_OPTS="--prefix=$STAGING_DIR \ From 50df2dc96c625a7c9785bb985d92056793dfcfc0 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Tue, 25 Jan 2022 15:45:13 +0200 Subject: [PATCH 57/77] build: added qadvanceddocking dependency Used by scopy to implement dockable plots Signed-off-by: Adrian Suciu --- build.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build.sh b/build.sh index 2cf10afcca..c81ce534e5 100755 --- a/build.sh +++ b/build.sh @@ -297,6 +297,13 @@ build_libtinyiiod() { __build_with_cmake } +build_qadvanceddocking() { +echo "### Building Qt-Advanced-Docking-System " +CURRENT_BUILD=qadvanceddocking +__build_with_cmake + +} + build_scopy() { CURRENT_BUILD=scopy NO_INSTALL="TRUE" @@ -351,6 +358,7 @@ build_grm2k build_qwt build_libsigrokdecode build_libtinyiiod +build_qadvanceddocking } #recurse_submodules From 459aceabaa005e239a88f9dd308d81b1ebc0e5f7 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Tue, 25 Jan 2022 15:58:22 +0200 Subject: [PATCH 58/77] build: update qwt branch to qwt-multiaxes Scopy uses this branch to enable OpenGL rendering in plots Signed-off-by: Adrian Suciu --- build.sh | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/build.sh b/build.sh index c81ce534e5..a05b3b4711 100755 --- a/build.sh +++ b/build.sh @@ -278,16 +278,7 @@ build_libsigrokdecode() { build_qwt() { echo "### Building qwt - branch $QWT_BRANCH" CURRENT_BUILD=qwt - svn checkout svn://svn.code.sf.net/p/qwt/code/branches/qwt-6.1-multiaxes $CURRENT_BUILD - pushd $CURRENT_BUILD - svn patch $WORKDIR/qwt-config-svn.patch - - $QMAKE - make $JOBS - make INSTALL_ROOT="$STAGING_DIR" $JOBS install - cp $STAGING_DIR/lib/qwt.dll $STAGING_DIR/bin/qwt.dll - echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE - popd + __build_with_cmake } build_libtinyiiod() { From 2d852d452092357b8726841a37cdbb7397e0d3fb Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Thu, 17 Feb 2022 19:04:47 +0200 Subject: [PATCH 59/77] update submodules to latest versions Signed-off-by: Adrian Suciu --- build.sh | 13 ++++++++++--- mingw_toolchain.sh | 3 ++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index a05b3b4711..20c9641a4a 100755 --- a/build.sh +++ b/build.sh @@ -14,6 +14,7 @@ TOOLS_PKGS="\ git\ svn\ base-devel\ + mingw-w64-${ARCH}-autotools\ " #mingw-w64-${ARCH}-boost PACMAN_SYNC_DEPS=" \ @@ -114,7 +115,7 @@ __build_with_cmake() { eval $CURRENT_BUILD_PATCHES $CMAKE $CURRENT_BUILD_CMAKE_OPTS $WORKDIR/$CURRENT_BUILD eval $CURRENT_BUILD_POST_CMAKE - $MAKE_BIN $JOBS $INSTALL + make $JOBS $INSTALL eval $CURRENT_BUILD_POST_MAKE echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE # clear vars @@ -278,7 +279,13 @@ build_libsigrokdecode() { build_qwt() { echo "### Building qwt - branch $QWT_BRANCH" CURRENT_BUILD=qwt - __build_with_cmake + pushd $CURRENT_BUILD + $QMAKE + make $JOBS + make INSTALL_ROOT="$STAGING_DIR" $JOBS install + cp $STAGING_DIR/lib/qwt.dll $STAGING_DIR/bin/qwt.dll + echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE + popd } build_libtinyiiod() { @@ -349,7 +356,7 @@ build_grm2k build_qwt build_libsigrokdecode build_libtinyiiod -build_qadvanceddocking +#build_qadvanceddocking } #recurse_submodules diff --git a/mingw_toolchain.sh b/mingw_toolchain.sh index f16c010a14..bbbc0d447d 100644 --- a/mingw_toolchain.sh +++ b/mingw_toolchain.sh @@ -44,7 +44,8 @@ fi export CC=/${MINGW_VERSION}/bin/${ARCH}-w64-mingw32-gcc.exe export CXX=/${MINGW_VERSION}/bin/${ARCH}-w64-mingw32-g++.exe export JOBS="-j 9" -export MAKE_BIN=/${MINGW_VERSION}/bin/mingw32-make.exe +#export MAKE_BIN=/${MINGW_VERSION}/bin/mingw32-make.exe +export MAKE_BIN=/bin/make export MAKE_CMD="$MAKE_BIN $JOBS" export CMAKE_GENERATOR="Unix Makefiles" export CMAKE_OPTS=( \ From ebfceb4b80f35a96c1a1fa986e483604fb56be65 Mon Sep 17 00:00:00 2001 From: Adrian Suciu Date: Tue, 31 May 2022 16:47:48 +0300 Subject: [PATCH 60/77] update to qt6 and gr-3.10 Signed-off-by: Adrian Suciu --- build.sh | 86 +++++++++++++++++++++++++++++++++++----------- docker/Dockerfile | 2 +- mingw_toolchain.sh | 29 ++++++++++------ 3 files changed, 84 insertions(+), 33 deletions(-) diff --git a/build.sh b/build.sh index 20c9641a4a..017ffd69b6 100755 --- a/build.sh +++ b/build.sh @@ -11,8 +11,10 @@ TOOLS_PKGS="\ mingw-w64-${ARCH}-python-six\ mingw-w64-${ARCH}-make\ mingw-w64-${ARCH}-doxygen \ + mingw-w64-${ARCH}-pcre2\ git\ svn\ + vim\ base-devel\ mingw-w64-${ARCH}-autotools\ " @@ -28,7 +30,12 @@ PACMAN_SYNC_DEPS=" \ mingw-w64-${ARCH}-glib2 \ mingw-w64-${ARCH}-glibmm \ mingw-w64-${ARCH}-doxygen\ - mingw-w64-${ARCH}-qt5 \ + mingw-w64-${ARCH}-qt6-base \ + mingw-w64-${ARCH}-qt6-declarative \ + mingw-w64-${ARCH}-qt6-5compat\ + mingw-w64-${ARCH}-qt6-svg\ + mingw-w64-${ARCH}-pcre2\ + mingw-w64-${ARCH}-qt6-tools\ mingw-w64-${ARCH}-zlib \ mingw-w64-${ARCH}-breakpad \ mingw-w64-${ARCH}-libusb \ @@ -45,7 +52,7 @@ install_tools() { gunzip windres.exe.gz fi popd - + wget http://swdownloads.analog.com/cse/m1k/drivers/dpinst.zip wget http://swdownloads.analog.com/cse/m1k/drivers/dfu-util.zip unzip "dpinst.zip" @@ -62,10 +69,12 @@ install_tools() { wget https://jrsoftware.org/download.php/is.exe pacman --noconfirm --needed -S $TOOLS_PKGS + } install_deps() { $PACMAN -S $PACMAN_SYNC_DEPS $PACMAN -U https://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-boost-1.75.0-9-any.pkg.tar.zst + ln -s ${QMAKE}-qt6.exe ${QMAKE}.exe } recurse_submodules() { @@ -113,7 +122,7 @@ __build_with_cmake() { __clean_build_dir eval $CURRENT_BUILD_POST_CLEAN eval $CURRENT_BUILD_PATCHES - $CMAKE $CURRENT_BUILD_CMAKE_OPTS $WORKDIR/$CURRENT_BUILD + $CMAKE -DCMAKE_VERBOSE_MAKEFILE=ON $CURRENT_BUILD_CMAKE_OPTS $WORKDIR/$CURRENT_BUILD eval $CURRENT_BUILD_POST_CMAKE make $JOBS $INSTALL eval $CURRENT_BUILD_POST_MAKE @@ -150,14 +159,39 @@ build_log4cpp() { __build_with_cmake } +build_spdlog() { + ln -s /usr/bin/windres.exe /usr/bin/x86_64-w64-mingw32-windres.exe + CURRENT_BUILD=spdlog + CURRENT_BUILD_CMAKE_OPTS="-DSPDLOG_BUILD_SHARED=ON -DSPDLOG_BUILD_EXAMPLE=OFF" + __build_with_cmake +} + build_volk() { CURRENT_BUILD=volk - CURRENT_BUILD_POST_CLEAN="git submodule update --init" - CURRENT_BUILD_CMAKE_OPTS="-DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3 -DENABLE_MODTOOL=OFF -DENABLE_TESTING=OFF ../" + CURRENT_BUILD_POST_CLEAN="git submodule update --init ../cpu_features" + # for some reason the script in volk/cmake/Modules/VolkPython:132 fails - sysconfig.get_config_var("prefix") = D:/a/msys64 (?????) + CURRENT_BUILD_CMAKE_OPTS=" + -DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3\ + -DENABLE_MODTOOL=OFF\ + -DENABLE_TESTING=OFF\ + -DVOLK_PYTHON_DIR=C:/msys64/mingw64/lib/python3.9/site-packages" __build_with_cmake } +build_libsndfile() { + CURRENT_BUILD=libsndfile + CURRENT_BUILD_CMAKE_OPTS="\ + -DENABLE_EXTERNAL_LIBS=OFF\ + -DENABLE_MPEG=OFF\ + -DBUILD_PROGRAMS=OFF\ + -DBUILD_EXAMPLES=OFF\ + -DENABLE_CPACK=OFF\ + -DBUILD_SHARED_LIBS=OFF\ + -DBUILD_TESTING=OFF" + __build_with_cmake +} + build_gnuradio() { #echo gnuradio CURRENT_BUILD=gnuradio @@ -167,17 +201,18 @@ build_gnuradio() { # C:\Users\appveyor\AppData\Local\Temp\1\ccO00eqH.s:17939: Error: invalid register for .seh_savexmm # might be related to the liborc library though ... - CURRENT_BUILD_CMAKE_OPTS="-DENABLE_GR_DIGITAL:BOOL=OFF \ - -DENABLE_GR_DTV:BOOL=OFF \ - -DENABLE_GR_AUDIO:BOOL=OFF \ - -DENABLE_GR_CHANNELS:BOOL=OFF \ - -DENABLE_GR_TRELLIS:BOOL=OFF \ - -DENABLE_GR_VOCODER:BOOL=OFF \ - -DENABLE_GR_FEC:BOOL=OFF \ - -DENABLE_DOXYGEN:BOOL=OFF \ - -DENABLE_TESTING:BOOL=OFF \ - -DENABLE_INTERNAL_VOLK:BOOL=OFF \ + # for some reason the script in volk/cmake/Modules/VolkPython:132 fails - sysconfig.get_config_var("prefix") = D:/a/msys64 (?????) + + CURRENT_BUILD_CMAKE_OPTS="-DENABLE_DEFAULT=OFF\ + -DENABLE_GNURADIO_RUNTIME=ON\ + -DENABLE_GR_ANALOG=ON\ + -DENABLE_GR_BLOCKS=ON\ + -DENABLE_GR_FFT=ON\ + -DENABLE_GR_FILTER=ON\ + -DENABLE_VOLK=ON\ + -DENABLE_GR_IIO=ON\ -DCMAKE_C_FLAGS=-fno-asynchronous-unwind-tables \ + -DGR_PYTHON_DIR=C:/msys64/mingw64/lib/python3.9/site-packages\ -DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3 \ " __build_with_cmake @@ -213,7 +248,7 @@ build_libm2k() { -DENABLE_PYTHON=OFF\ -DENABLE_CSHARP=OFF\ -DBUILD_EXAMPLES=OFF\ - -DENABLE_TOOLS=OFF\ + -DENABLE_TOOLS=ON\ -DENABLE_LOG=ON\ -DINSTALL_UDEV_RULES=OFF\ " @@ -231,7 +266,10 @@ build_griio() { CURRENT_BUILD=gr-iio # -D_hypot=hypot: http://boost.2283326.n4.nabble.com/Boost-Python-Compile-Error-s-GCC-via-MinGW-w64-td3165793.html#a3166757 - CURRENT_BUILD_CMAKE_OPTS="-DCMAKE_CXX_FLAGS=-D_hypot=hypot -DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3 " + CURRENT_BUILD_CMAKE_OPTS=" + -DCMAKE_CXX_FLAGS=-D_hypot=hypot\ + -DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3\ + " __build_with_cmake } @@ -239,14 +277,20 @@ build_griio() { build_grm2k() { echo "### Building gr-m2k - branch $GRM2K_BRANCH" CURRENT_BUILD=gr-m2k - CURRENT_BUILD_CMAKE_OPTS="-DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3 " + CURRENT_BUILD_CMAKE_OPTS="\ + -DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3\ + -DGR_PYTHON_DIR=C:/msys64/mingw64/lib/python3.9/site-packages\ + " __build_with_cmake } build_grscopy() { echo "### Building gr-scopy - branch $GRSCOPY_BRANCH" CURRENT_BUILD=gr-scopy - CURRENT_BUILD_CMAKE_OPTS="-DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3 " + CURRENT_BUILD_CMAKE_OPTS="\ + -DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3\ + -DGR_PYTHON_DIR=C:/msys64/mingw64/lib/python3.9/site-packages\ + " __build_with_cmake } @@ -347,10 +391,10 @@ build_glog build_libiio build_libad9361 build_libm2k -build_log4cpp +build_spdlog +build_libsndfile build_volk build_gnuradio -build_griio build_grscopy build_grm2k build_qwt diff --git a/docker/Dockerfile b/docker/Dockerfile index 28ac9f8984..7f6085e97a 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -27,7 +27,7 @@ SHELL ["cmd", "/S", "/C"] RUN C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu" & C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu" & C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Scc " # install general packages needed to run build scripts RUN C:\msys64\usr\bin\bash.exe -c 'pacman --noconfirm --needed -Sy git' -RUN C:\msys64\usr\bin\bash.exe -c "git clone https://github.com/analogdevicesinc/scopy-mingw-build-deps --branch master " +RUN C:\msys64\usr\bin\bash.exe -c "git clone https://github.com/analogdevicesinc/scopy-mingw-build-deps --branch qt6-attempt " # install packages and build scopy-deps ARG BUILD_TARGET=x86_64 diff --git a/mingw_toolchain.sh b/mingw_toolchain.sh index bbbc0d447d..64b269c116 100644 --- a/mingw_toolchain.sh +++ b/mingw_toolchain.sh @@ -24,21 +24,28 @@ else export ARCH_BIT=32 fi -echo $STAGING_PREFIX is the staging prefix -export STAGING=${STAGING_PREFIX}_${ARCH} -export JOBS="-j9" - export PATH=/bin:/usr/bin:/${MINGW_VERSION}/bin:/c/Program\ Files/Git/cmd:/c/Windows/System32:/c/Program\ Files/Appveyor/BuildAgent export WORKDIR=${PWD} +export JOBS="-j9" + +if [ -z $USE_STAGING ] +then + echo "No staging" + export STAGING_DIR=/$MINGW_VERSION + export STAGING_ENV= +else + echo $STAGING_PREFIX is the staging prefix + export STAGING=${STAGING_PREFIX}_${ARCH} -if [ -z "$STAGING_PREFIX" ] - then - export STAGING_DIR=$WORKDIR/staging_$ARCH/$MINGW_VERSION - export STAGING_ENV=$WORKDIR/staging_$ARCH - else - export STAGING_DIR=$STAGING/$MINGW_VERSION - export STAGING_ENV=$STAGING + if [ -z "$STAGING_PREFIX" ] + then + export STAGING_DIR=$WORKDIR/staging_$ARCH/$MINGW_VERSION + export STAGING_ENV=$WORKDIR/staging_$ARCH + else + export STAGING_DIR=$STAGING/$MINGW_VERSION + export STAGING_ENV=$STAGING + fi fi export CC=/${MINGW_VERSION}/bin/${ARCH}-w64-mingw32-gcc.exe From ab02383830446ce26df1fc8d3a87f92a935c19ac Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Mon, 12 Dec 2022 12:28:15 +0200 Subject: [PATCH 61/77] use qt5 and gnuradio 3.10 --- build.sh | 8 +------- docker/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index 017ffd69b6..d1fd88491f 100755 --- a/build.sh +++ b/build.sh @@ -30,12 +30,7 @@ PACMAN_SYNC_DEPS=" \ mingw-w64-${ARCH}-glib2 \ mingw-w64-${ARCH}-glibmm \ mingw-w64-${ARCH}-doxygen\ - mingw-w64-${ARCH}-qt6-base \ - mingw-w64-${ARCH}-qt6-declarative \ - mingw-w64-${ARCH}-qt6-5compat\ - mingw-w64-${ARCH}-qt6-svg\ - mingw-w64-${ARCH}-pcre2\ - mingw-w64-${ARCH}-qt6-tools\ + mingw-w64-${ARCH}-qt5 \ mingw-w64-${ARCH}-zlib \ mingw-w64-${ARCH}-breakpad \ mingw-w64-${ARCH}-libusb \ @@ -74,7 +69,6 @@ install_tools() { install_deps() { $PACMAN -S $PACMAN_SYNC_DEPS $PACMAN -U https://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-boost-1.75.0-9-any.pkg.tar.zst - ln -s ${QMAKE}-qt6.exe ${QMAKE}.exe } recurse_submodules() { diff --git a/docker/Dockerfile b/docker/Dockerfile index 7f6085e97a..9d525b66dc 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -27,7 +27,7 @@ SHELL ["cmd", "/S", "/C"] RUN C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu" & C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu" & C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Scc " # install general packages needed to run build scripts RUN C:\msys64\usr\bin\bash.exe -c 'pacman --noconfirm --needed -Sy git' -RUN C:\msys64\usr\bin\bash.exe -c "git clone https://github.com/analogdevicesinc/scopy-mingw-build-deps --branch qt6-attempt " +RUN C:\msys64\usr\bin\bash.exe -c "git clone https://github.com/analogdevicesinc/scopy-mingw-build-deps --branch qt5-gr3.10" # install packages and build scopy-deps ARG BUILD_TARGET=x86_64 From 384e80b4f1ba41f14b88f01d5d828b85d96f20b2 Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Wed, 11 Jan 2023 09:52:44 +0200 Subject: [PATCH 62/77] docker: update packages and msys2-keyring Signed-off-by: Bindea Cristian --- docker/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 9d525b66dc..428ba077d9 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -24,6 +24,9 @@ setx MSYSTEM MINGW64 WORKDIR C:\\msys64\\home\\docker RUN C:\msys64\usr\bin\bash.exe -lc " " SHELL ["cmd", "/S", "/C"] +RUN C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syyu" +RUN C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Sy msys2-keyring" +RUN C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Su" RUN C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu" & C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu" & C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Scc " # install general packages needed to run build scripts RUN C:\msys64\usr\bin\bash.exe -c 'pacman --noconfirm --needed -Sy git' From ed3a29599e0af440c30f9552f72eb088e83fbe32 Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Thu, 2 Mar 2023 16:15:04 +0200 Subject: [PATCH 63/77] Update sigrokdecode-windows-fix file Signed-off-by: Bindea Cristian --- sigrokdecode-windows-fix.patch | 34 +++++++++++++--------------------- 1 file changed, 13 insertions(+), 21 deletions(-) diff --git a/sigrokdecode-windows-fix.patch b/sigrokdecode-windows-fix.patch index eff7c8513b..48c0981608 100644 --- a/sigrokdecode-windows-fix.patch +++ b/sigrokdecode-windows-fix.patch @@ -1,29 +1,21 @@ -From 0b21384bcd5ea71885dde8ebcb4c4d1bfd6f0187 Mon Sep 17 00:00:00 2001 -From: Paul Cercueil -Date: Mon, 3 Jul 2017 13:07:02 +0200 -Subject: [PATCH] Fix public functions visibility on Windows +commit 1b13802e324f00f4e840eff7b0f3b6761fffa1a1 +Author: Bindea Cristian +Date: Thu Mar 2 16:07:15 2023 +0200 -Signed-off-by: Paul Cercueil ---- - libsigrokdecode.h | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) + Subject: [PATCH] Update public functions visibility on Windows + + Signed-off-by: Bindea Cristian diff --git a/libsigrokdecode.h b/libsigrokdecode.h -index 03a5de0..ed25e89 100644 +index ea17cb8..acc2cbc 100644 --- a/libsigrokdecode.h +++ b/libsigrokdecode.h -@@ -108,8 +108,10 @@ enum srd_loglevel { - /* Marks public libsigrokdecode API symbols. */ - #ifndef _WIN32 - #define SRD_API __attribute__((visibility("default"))) +@@ -112,6 +112,8 @@ enum srd_loglevel { + # else + # define SRD_API extern + # endif +#elif defined(LIBSIGROKDECODE_EXPORT) -+#define SRD_API __declspec(dllexport) ++# define SRD_API __declspec(dllexport) #else --#define SRD_API -+#define SRD_API __declspec(dllimport) + # define SRD_API __attribute__((visibility("default"))) #endif - - /* Marks private, non-public libsigrokdecode symbols (not part of the API). */ --- -2.13.2 - From 1279cd4542ba64052414a60895e6163533e3c327 Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Thu, 9 Mar 2023 11:43:58 +0200 Subject: [PATCH 64/77] CI:Dockerfile: update msys2-base version Signed-off-by: Bindea Cristian --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 428ba077d9..c16275bc35 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -9,7 +9,7 @@ SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPref RUN echo . > 'C:\$RECYCLE.BIN'; RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ -Invoke-WebRequest -UseBasicParsing -uri "https://github.com/msys2/msys2-installer/releases/download/2021-07-25/msys2-base-x86_64-20210725.sfx.exe" -OutFile msys2.exe; \ +Invoke-WebRequest -UseBasicParsing -uri "https://github.com/msys2/msys2-installer/releases/download/2023-01-27/msys2-base-x86_64-20230127.sfx.exe" -OutFile msys2.exe; \ .\msys2.exe -y -oC:\\; \ Remove-Item msys2.exe; RUN 'mkdir C:/msys64/home/docker/ && cd C:/msys64/home/docker/' From c7979a9646d7e87dd7eccde3fa2668d467be810d Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Wed, 12 Apr 2023 11:38:42 +0300 Subject: [PATCH 65/77] Update build scripts for scopy2 Signed-off-by: Bindea Cristian --- build.sh | 365 +++++++++++++++++++++++---------------------- docker/Dockerfile | 14 +- init_staging.sh | 16 +- mingw_toolchain.sh | 131 ++++++++-------- 4 files changed, 268 insertions(+), 258 deletions(-) diff --git a/build.sh b/build.sh index d1fd88491f..3d6f66fbbf 100755 --- a/build.sh +++ b/build.sh @@ -1,16 +1,16 @@ #!/usr/bin/bash.exe -set -ex -source mingw_toolchain.sh $1 +#set -ex +source mingw_toolchain.sh $1 $2 $3 TOOLS_PKGS="\ - mingw-w64-${ARCH}-cmake \ - mingw-w64-${ARCH}-gcc \ + mingw-w64-${ARCH}-cmake\ + mingw-w64-${ARCH}-gcc\ mingw-w64-${ARCH}-python3\ mingw-w64-${ARCH}-python-mako\ mingw-w64-${ARCH}-python-six\ mingw-w64-${ARCH}-make\ - mingw-w64-${ARCH}-doxygen \ + mingw-w64-${ARCH}-doxygen\ mingw-w64-${ARCH}-pcre2\ git\ svn\ @@ -19,27 +19,26 @@ TOOLS_PKGS="\ mingw-w64-${ARCH}-autotools\ " #mingw-w64-${ARCH}-boost -PACMAN_SYNC_DEPS=" \ - mingw-w64-${ARCH}-fftw \ - mingw-w64-${ARCH}-orc \ - mingw-w64-${ARCH}-libxml2 \ - mingw-w64-${ARCH}-libzip \ - mingw-w64-${ARCH}-fftw \ - mingw-w64-${ARCH}-libzip \ - mingw-w64-${ARCH}-libffi \ - mingw-w64-${ARCH}-glib2 \ - mingw-w64-${ARCH}-glibmm \ +PACMAN_SYNC_DEPS="\ + mingw-w64-${ARCH}-fftw\ + mingw-w64-${ARCH}-orc\ + mingw-w64-${ARCH}-libxml2\ + mingw-w64-${ARCH}-libzip\ + mingw-w64-${ARCH}-fftw\ + mingw-w64-${ARCH}-libzip\ + mingw-w64-${ARCH}-libffi\ + mingw-w64-${ARCH}-glib2\ + mingw-w64-${ARCH}-glibmm\ mingw-w64-${ARCH}-doxygen\ - mingw-w64-${ARCH}-qt5 \ - mingw-w64-${ARCH}-zlib \ - mingw-w64-${ARCH}-breakpad \ - mingw-w64-${ARCH}-libusb \ + mingw-w64-${ARCH}-qt5\ + mingw-w64-${ARCH}-zlib\ + mingw-w64-${ARCH}-breakpad\ + mingw-w64-${ARCH}-libusb\ " -export PATH=/bin:$MINGW_VERSION/bin:$WORKDIR/cv2pdb:/c/innosetup/:$PATH$ -export PKG_CONFIG_PATH=$STAGING_DIR/lib/pkgconfig + install_tools() { - pacman --noconfirm -S unzip zip + $PACMAN -S unzip zip mkdir -p $WORKDIR/windres pushd $WORKDIR/windres if [ ! -f windres.exe.gz ]; then @@ -63,7 +62,8 @@ install_tools() { wget https://jrsoftware.org/download.php/is.exe - pacman --noconfirm --needed -S $TOOLS_PKGS + #pacman --noconfirm --needed -S $TOOLS_PKGS + $PACMAN -S $TOOLS_PKGS } install_deps() { @@ -116,7 +116,7 @@ __build_with_cmake() { __clean_build_dir eval $CURRENT_BUILD_POST_CLEAN eval $CURRENT_BUILD_PATCHES - $CMAKE -DCMAKE_VERBOSE_MAKEFILE=ON $CURRENT_BUILD_CMAKE_OPTS $WORKDIR/$CURRENT_BUILD + $CMAKE $CURRENT_BUILD_CMAKE_OPTS $WORKDIR/$CURRENT_BUILD eval $CURRENT_BUILD_POST_CMAKE make $JOBS $INSTALL eval $CURRENT_BUILD_POST_MAKE @@ -130,109 +130,39 @@ __build_with_cmake() { CURRENT_BUILD="" NO_INSTALL="" popd - rm -rf ${WORKDIR}/$CURRENT_BUILD/build-${ARCH} -} - -build_log4cpp() { - CURRENT_BUILD=log4cpp - - # this is a fix for MINGW long long long is too long - patch the config-MingW32.h - # probably not the cleanest patch - deletes this line - # https://github.com/orocos-toolchain/log4cpp/blob/359be7d88eb8a87f618620918c73ef1fc6e87242/include/log4cpp/config-MinGW32.h#L27 - # we need a better patch here or maybe use another repo - - CURRENT_BUILD_POST_CLEAN=" - git reset --hard && - sed '27d' ../include/log4cpp/config-MinGW32.h > temp && mv temp ../include/log4cpp/config-MinGW32.h; - " - # LOG4CPP puts dll in wrong file for MINGW - it should be in bin, but it puts it in lib so we copy it - CURRENT_BUILD_POST_MAKE=" - mkdir -p $STAGING_DIR/bin && - cp $STAGING_DIR/lib/liblog4cpp.dll $STAGING_DIR/bin/liblog4cpp.dll - " - __build_with_cmake -} - -build_spdlog() { - ln -s /usr/bin/windres.exe /usr/bin/x86_64-w64-mingw32-windres.exe - CURRENT_BUILD=spdlog - CURRENT_BUILD_CMAKE_OPTS="-DSPDLOG_BUILD_SHARED=ON -DSPDLOG_BUILD_EXAMPLE=OFF" - __build_with_cmake + if [ ! -z $INSTALL ]; then + rm -rf ${WORKDIR}/$CURRENT_BUILD/build-${ARCH} + fi } -build_volk() { - CURRENT_BUILD=volk - CURRENT_BUILD_POST_CLEAN="git submodule update --init ../cpu_features" - # for some reason the script in volk/cmake/Modules/VolkPython:132 fails - sysconfig.get_config_var("prefix") = D:/a/msys64 (?????) - CURRENT_BUILD_CMAKE_OPTS=" - -DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3\ - -DENABLE_MODTOOL=OFF\ - -DENABLE_TESTING=OFF\ - -DVOLK_PYTHON_DIR=C:/msys64/mingw64/lib/python3.9/site-packages" - __build_with_cmake -} - -build_libsndfile() { - CURRENT_BUILD=libsndfile +build_glog() { + CURRENT_BUILD=glog CURRENT_BUILD_CMAKE_OPTS="\ - -DENABLE_EXTERNAL_LIBS=OFF\ - -DENABLE_MPEG=OFF\ - -DBUILD_PROGRAMS=OFF\ - -DBUILD_EXAMPLES=OFF\ - -DENABLE_CPACK=OFF\ - -DBUILD_SHARED_LIBS=OFF\ - -DBUILD_TESTING=OFF" - __build_with_cmake -} - -build_gnuradio() { - #echo gnuradio - CURRENT_BUILD=gnuradio - - # Set -fno-asynchronous-unwind-tables to avoid these error messages: - # C:\Users\appveyor\AppData\Local\Temp\1\ccO00eqH.s: Assembler messages: - # C:\Users\appveyor\AppData\Local\Temp\1\ccO00eqH.s:17939: Error: invalid register for .seh_savexmm - # might be related to the liborc library though ... - - # for some reason the script in volk/cmake/Modules/VolkPython:132 fails - sysconfig.get_config_var("prefix") = D:/a/msys64 (?????) - - CURRENT_BUILD_CMAKE_OPTS="-DENABLE_DEFAULT=OFF\ - -DENABLE_GNURADIO_RUNTIME=ON\ - -DENABLE_GR_ANALOG=ON\ - -DENABLE_GR_BLOCKS=ON\ - -DENABLE_GR_FFT=ON\ - -DENABLE_GR_FILTER=ON\ - -DENABLE_VOLK=ON\ - -DENABLE_GR_IIO=ON\ - -DCMAKE_C_FLAGS=-fno-asynchronous-unwind-tables \ - -DGR_PYTHON_DIR=C:/msys64/mingw64/lib/python3.9/site-packages\ - -DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3 \ - " + -DWITH_GFLAGS=OFF\ + -DBUILD_SHARED_LIBS=ON\ + " __build_with_cmake } build_libiio() { CURRENT_BUILD=libiio CURRENT_BUILD_CMAKE_OPTS="\ - ${RC_COMPILER_OPT} \ - -DENABLE_IPV6=OFF \ - -DWITH_USB_BACKEND=ON \ - -DWITH_SERIAL_BACKEND=OFF \ - -DWITH_TESTS:BOOL=OFF \ - -DWITH_DOC:BOOL=OFF \ - -DCSHARP_BINDINGS:BOOL=OFF \ - -DPYTHON_BINDINGS:BOOL=OFF \ + ${RC_COMPILER_OPT}\ + -DENABLE_IPV6=OFF\ + -DWITH_USB_BACKEND=ON\ + -DWITH_SERIAL_BACKEND=OFF\ + -DWITH_TESTS:BOOL=OFF\ + -DWITH_DOC:BOOL=OFF\ + -DCSHARP_BINDINGS:BOOL=OFF\ + -DPYTHON_BINDINGS:BOOL=OFF\ " __build_with_cmake } -build_glog() { - CURRENT_BUILD=glog - CURRENT_BUILD_CMAKE_OPTS="\ - -DWITH_GFLAGS=OFF \ - -DBUILD_SHARED_LIBS=ON \ - " +build_libad9361() { + echo "### Building libad9361 - branch $LIBAD9361_BRANCH" + CURRENT_BUILD=libad9361 __build_with_cmake } @@ -249,45 +179,90 @@ build_libm2k() { __build_with_cmake } -build_libad9361() { - echo "### Building libad9361 - branch $LIBAD9361_BRANCH" - CURRENT_BUILD=libad9361 +build_spdlog() { + ln -s /usr/bin/windres.exe /usr/bin/x86_64-w64-mingw32-windres.exe + CURRENT_BUILD=spdlog + CURRENT_BUILD_CMAKE_OPTS="\ + -DSPDLOG_BUILD_SHARED=ON\ + -DSPDLOG_BUILD_EXAMPLE=OFF\ + " __build_with_cmake } -build_griio() { - echo "### Building gr-iio - branch $GRIIO_BRANCH" +build_libsndfile() { + CURRENT_BUILD=libsndfile + CURRENT_BUILD_CMAKE_OPTS="\ + -DENABLE_EXTERNAL_LIBS=OFF\ + -DENABLE_MPEG=OFF\ + -DBUILD_PROGRAMS=OFF\ + -DBUILD_EXAMPLES=OFF\ + -DENABLE_CPACK=OFF\ + -DBUILD_SHARED_LIBS=OFF\ + -DBUILD_TESTING=OFF" + __build_with_cmake +} - CURRENT_BUILD=gr-iio - # -D_hypot=hypot: http://boost.2283326.n4.nabble.com/Boost-Python-Compile-Error-s-GCC-via-MinGW-w64-td3165793.html#a3166757 - CURRENT_BUILD_CMAKE_OPTS=" - -DCMAKE_CXX_FLAGS=-D_hypot=hypot\ - -DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3\ - " +build_volk() { + CURRENT_BUILD=volk + CURRENT_BUILD_POST_CLEAN="git submodule update --init ../cpu_features" + CURRENT_BUILD_CMAKE_OPTS="\ + -DENABLE_MODTOOL=OFF\ + -DENABLE_TESTING=OFF\ + -DPYTHON_EXECUTABLE=$STAGING_DIR/bin/python3.exe\ + -DGR_PYTHON_DIR==$STAGING_DIR/lib/python3.10/site-packages\ + " __build_with_cmake } +build_gnuradio() { + CURRENT_BUILD=gnuradio + CURRENT_BUILD_CMAKE_OPTS="\ + -DENABLE_DEFAULT=OFF\ + -DENABLE_GNURADIO_RUNTIME=ON\ + -DENABLE_GR_ANALOG=ON\ + -DENABLE_GR_BLOCKS=ON\ + -DENABLE_GR_FFT=ON\ + -DENABLE_GR_FILTER=ON\ + -DENABLE_VOLK=ON\ + -DENABLE_GR_IIO=ON\ + -DCMAKE_C_FLAGS=-fno-asynchronous-unwind-tables\ + -DPYTHON_EXECUTABLE=$STAGING_DIR/bin/python3.exe\ + -DGR_PYTHON_DIR==$STAGING_DIR/lib/python3.10/site-packages\ + " + __build_with_cmake +} + build_grm2k() { - echo "### Building gr-m2k - branch $GRM2K_BRANCH" CURRENT_BUILD=gr-m2k CURRENT_BUILD_CMAKE_OPTS="\ - -DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3\ - -DGR_PYTHON_DIR=C:/msys64/mingw64/lib/python3.9/site-packages\ - " + -DPYTHON_EXECUTABLE=$STAGING_DIR/bin/python3.exe\ + -DGR_PYTHON_DIR==$STAGING_DIR/lib/python3.10/site-packages\ + " __build_with_cmake } build_grscopy() { - echo "### Building gr-scopy - branch $GRSCOPY_BRANCH" CURRENT_BUILD=gr-scopy CURRENT_BUILD_CMAKE_OPTS="\ - -DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3\ - -DGR_PYTHON_DIR=C:/msys64/mingw64/lib/python3.9/site-packages\ - " + -DPYTHON_EXECUTABLE=$STAGING_DIR/bin/python3.exe\ + -DGR_PYTHON_DIR=$STAGING_DIR/lib/python3.10/site-packages\ + " __build_with_cmake } +build_qwt() { + echo "### Building qwt - branch $QWT_BRANCH" + CURRENT_BUILD=qwt + pushd $CURRENT_BUILD + $QMAKE + make $JOBS + make INSTALL_ROOT="$STAGING_DIR" $JOBS install + cp $STAGING_DIR/lib/qwt.dll $STAGING_DIR/bin/qwt.dll + echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE + popd +} + build_libsigrokdecode() { echo "### Building libsigrokdecode - branch $LIBSIGROKDECODE_BRANCH" CURRENT_BUILD=libsigrokdecode @@ -314,18 +289,6 @@ build_libsigrokdecode() { popd } -build_qwt() { - echo "### Building qwt - branch $QWT_BRANCH" - CURRENT_BUILD=qwt - pushd $CURRENT_BUILD - $QMAKE - make $JOBS - make INSTALL_ROOT="$STAGING_DIR" $JOBS install - cp $STAGING_DIR/lib/qwt.dll $STAGING_DIR/bin/qwt.dll - echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE - popd -} - build_libtinyiiod() { echo "### Building libtinyiiod - branch $LIBTINYIIOD_BRANCH" CURRENT_BUILD=libtinyiiod @@ -333,51 +296,47 @@ build_libtinyiiod() { __build_with_cmake } -build_qadvanceddocking() { -echo "### Building Qt-Advanced-Docking-System " -CURRENT_BUILD=qadvanceddocking -__build_with_cmake - -} - build_scopy() { CURRENT_BUILD=scopy NO_INSTALL="TRUE" - CURRENT_BUILD_CMAKE_OPTS="$RC_COMPILER_OPT \ - -DBREAKPAD_HANDLER=ON \ - -DWITH_DOC=ON \ - -DPYTHON_EXECUTABLE=/$MINGW_VERSION/bin/python3.exe \ + CURRENT_BUILD_CMAKE_OPTS="$RC_COMPILER_OPT\ + -DBREAKPAD_HANDLER=ON\ + -DWITH_DOC=ON\ + -DPYTHON_EXECUTABLE=$STAGING_DIR/bin/python3.exe\ + -DENABLE_PLUGIN_M2K=ON + -DEMBED_PYTHON=ON " __build_with_cmake } package_and_push() { -if [ -z $APPVEYOR ]; then - echo "Appveyor environment not detected" - return -fi - -echo "" >> $BUILD_STATUS_FILE -echo "$PACMAN -Qe output - all explicitly installed packages on build machine" >> $BUILD_STATUS_FILE -$PACMAN -Qe >> $BUILD_STATUS_FILE -echo "pacman -Qm output - all packages from nonsync sources" >> $BUILD_STATUS_FILE -$PACMAN -Qm >> $BUILD_STATUS_FILE - -# Fix DLLs installed in the wrong path -#mv ${WORKDIR}/msys64/${MINGW_VERSION}/lib/qwt.dll \ -# ${WORKDIR}/msys64/${MINGW_VERSION}/lib/qwtpolar.dll \ -# ${WORKDIR}/msys64/${MINGW_VERSION}/bin - -#rm -rf ${WORKDIR}/msys64/${MINGW_VERSION}/doc \ -# ${WORKDIR}/msys64/${MINGW_VERSION}/share/doc \ -# ${WORKDIR}/msys64/${MINGW_VERSION}/lib/*.la - -echo "### Creating archive ... " -tar cavf ${WORKDIR}/scopy-${MINGW_VERSION}-build-deps.tar.xz -C ${WORKDIR} msys64 -appveyor PushArtifact $BUILD_STATUS_FILE -$PACMAN -Q > /tmp/AllInstalledPackages -appveyor PushArtifact /tmp/AllInstalledPackages -echo -n ${PACMAN_SYNC_DEPS} > ${WORKDIR}/scopy-$MINGW_VERSION-build-deps-pacman.txt + + if [ -z $APPVEYOR ]; then + echo "Appveyor environment not detected" + return + fi + + echo "" >> $BUILD_STATUS_FILE + echo "$PACMAN -Qe output - all explicitly installed packages on build machine" >> $BUILD_STATUS_FILE + $PACMAN -Qe >> $BUILD_STATUS_FILE + echo "pacman -Qm output - all packages from nonsync sources" >> $BUILD_STATUS_FILE + $PACMAN -Qm >> $BUILD_STATUS_FILE + + # Fix DLLs installed in the wrong path + #mv ${WORKDIR}/msys64/${MINGW_VERSION}/lib/qwt.dll\ + # ${WORKDIR}/msys64/${MINGW_VERSION}/lib/qwtpolar.dll\ + # ${WORKDIR}/msys64/${MINGW_VERSION}/bin + + #rm -rf ${WORKDIR}/msys64/${MINGW_VERSION}/doc\ + # ${WORKDIR}/msys64/${MINGW_VERSION}/share/doc\ + # ${WORKDIR}/msys64/${MINGW_VERSION}/lib/*.la + + echo "### Creating archive ... " + tar cavf ${WORKDIR}/scopy-${MINGW_VERSION}-build-deps.tar.xz -C ${WORKDIR} msys64 + appveyor PushArtifact $BUILD_STATUS_FILE + $PACMAN -Q > /tmp/AllInstalledPackages + appveyor PushArtifact /tmp/AllInstalledPackages + echo -n ${PACMAN_SYNC_DEPS} > ${WORKDIR}/scopy-$MINGW_VERSION-build-deps-pacman.txt } build_deps() { @@ -394,7 +353,6 @@ build_grm2k build_qwt build_libsigrokdecode build_libtinyiiod -#build_qadvanceddocking } #recurse_submodules @@ -404,3 +362,46 @@ build_libtinyiiod #build_deps #build_scopy # for testing #package_and_push + + + + +# build_griio() { +# echo "### Building gr-iio - branch $GRIIO_BRANCH" + +# CURRENT_BUILD=gr-iio +# # -D_hypot=hypot: http://boost.2283326.n4.nabble.com/Boost-Python-Compile-Error-s-GCC-via-MinGW-w64-td3165793.html#a3166757 +# CURRENT_BUILD_CMAKE_OPTS=" +# -DCMAKE_CXX_FLAGS=-D_hypot=hypot\ +# -DPYTHON_EXECUTABLE=$STAGING_DIR/bin/python3\ +# " +# __build_with_cmake + +# } + +# build_qadvanceddocking() { +# echo "### Building Qt-Advanced-Docking-System " +# CURRENT_BUILD=qadvanceddocking +# __build_with_cmake + +# } + +# build_log4cpp() { +# CURRENT_BUILD=log4cpp + +# # this is a fix for MINGW long long long is too long - patch the config-MingW32.h +# # probably not the cleanest patch - deletes this line +# # https://github.com/orocos-toolchain/log4cpp/blob/359be7d88eb8a87f618620918c73ef1fc6e87242/include/log4cpp/config-MinGW32.h#L27 +# # we need a better patch here or maybe use another repo + +# CURRENT_BUILD_POST_CLEAN=" +# git reset --hard && +# sed '27d' ../include/log4cpp/config-MinGW32.h > temp && mv temp ../include/log4cpp/config-MinGW32.h; +# " +# # LOG4CPP puts dll in wrong file for MINGW - it should be in bin, but it puts it in lib so we copy it +# CURRENT_BUILD_POST_MAKE=" +# mkdir -p $STAGING_DIR/bin && +# cp $STAGING_DIR/lib/liblog4cpp.dll $STAGING_DIR/bin/liblog4cpp.dll +# " +# __build_with_cmake +# } diff --git a/docker/Dockerfile b/docker/Dockerfile index c16275bc35..588376512e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -30,18 +30,22 @@ RUN C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Su" RUN C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu" & C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Syuu" & C:\msys64\usr\bin\bash.exe -lc "pacman --noconfirm -Scc " # install general packages needed to run build scripts RUN C:\msys64\usr\bin\bash.exe -c 'pacman --noconfirm --needed -Sy git' -RUN C:\msys64\usr\bin\bash.exe -c "git clone https://github.com/analogdevicesinc/scopy-mingw-build-deps --branch qt5-gr3.10" +RUN C:\msys64\usr\bin\bash.exe -c "git clone https://github.com/analogdevicesinc/scopy-mingw-build-deps --branch ci-for-scopy2" # install packages and build scopy-deps ARG BUILD_TARGET=x86_64 ENV BUILD_TARGET=$BUILD_TARGET -RUN echo %BUILD_TARGET% +ARG USE_STAGING=OFF +ENV USE_STAGING=$USE_STAGING + +RUN echo BUILD_TARGET=%BUILD_TARGET% +RUN echo USE_STAGING=%USE_STAGING% # exit 0 is required because init_staging force terminates the msys process resulting in an error - it is not an error -RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && ls && echo Building for $BUILD_TARGET && ./init_staging.sh $BUILD_TARGET" & exit 0 -RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && source build.sh $BUILD_TARGET && install_tools && install_deps && recurse_submodules" +RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && ls && echo Building for $BUILD_TARGET && ./init_staging.sh $BUILD_TARGET $USE_STAGING" & exit 0 +RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && source build.sh $BUILD_TARGET $USE_STAGING && install_tools && install_deps && recurse_submodules" RUN C:\msys64\home\docker\scopy-mingw-build-deps\is.exe /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART /LOG=C:\msys64\home\docker\iss.log /DIR=C:\innosetup -RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && source build.sh $BUILD_TARGET && build_deps" +RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && source build.sh $BUILD_TARGET $USE_STAGING && build_deps" # clone scopy # build scopy diff --git a/init_staging.sh b/init_staging.sh index 1ea5c49e4e..4db9e420be 100644 --- a/init_staging.sh +++ b/init_staging.sh @@ -1,14 +1,14 @@ #!/usr/bin/bash.exe -set -x -source mingw_toolchain.sh $1 +#set -ex +source mingw_toolchain.sh $1 $2 $3 init_staging() { - if [ -v USE_STAGING ] - then - rm -rf $STAGING_ENV - mkdir -p $STAGING_ENV/var/lib/pacman/local - mkdir -p $STAGING_ENV/var/lib/pacman/sync - /usr/bin/bash.exe -c "$PACMAN -Syuu bash filesystem mintty pacman" + if [ "$USE_STAGING" == "ON" ] + then + rm -rf $STAGING_ENV + mkdir -p $STAGING_ENV/var/lib/pacman/local + mkdir -p $STAGING_ENV/var/lib/pacman/sync + /usr/bin/bash.exe -c "$PACMAN -Syuu bash filesystem mintty pacman" fi } init_staging diff --git a/mingw_toolchain.sh b/mingw_toolchain.sh index 64b269c116..ca5c87cc90 100644 --- a/mingw_toolchain.sh +++ b/mingw_toolchain.sh @@ -1,83 +1,82 @@ #!/usr/bin/bash.exe -source build_system_setup.sh - -BUILD_STATUS_FILE=/tmp/scopy-mingw-build-status -touch $BUILD_STATUS_FILE +#source build_system_setup.sh #TODO: make each dep install it's own deps -# Exit immediately if an error occurs -#set -e -#set -x -if [ $# -ne 1 ]; then - ARG1=x86_64 -else - ARG1=$1 +#set -ex + +if [ $# -ne 1 ]; + then + ARG1=x86_64 + else + ARG1=$1 fi export ARCH=$ARG1 -if [ $ARCH == "x86_64" ] -then - export MINGW_VERSION=mingw64 - export ARCH_BIT=64 -else - export MINGW_VERSION=mingw32 - export ARCH_BIT=32 + +if [ "$ARCH" == "x86_64" ] + then + export MINGW_VERSION=mingw64 + export ARCH_BIT=64 + else + export MINGW_VERSION=mingw32 + export ARCH_BIT=32 fi -export PATH=/bin:/usr/bin:/${MINGW_VERSION}/bin:/c/Program\ Files/Git/cmd:/c/Windows/System32:/c/Program\ Files/Appveyor/BuildAgent +if [ -z "$HOME" ] || [ "$HOME" == "/" ]; then + export HOME=/home/docker +fi export WORKDIR=${PWD} export JOBS="-j9" -if [ -z $USE_STAGING ] -then - echo "No staging" - export STAGING_DIR=/$MINGW_VERSION - export STAGING_ENV= -else - echo $STAGING_PREFIX is the staging prefix - export STAGING=${STAGING_PREFIX}_${ARCH} +USE_STAGING=$2 +STAGING_PREFIX=$3 - if [ -z "$STAGING_PREFIX" ] - then - export STAGING_DIR=$WORKDIR/staging_$ARCH/$MINGW_VERSION - export STAGING_ENV=$WORKDIR/staging_$ARCH - else - export STAGING_DIR=$STAGING/$MINGW_VERSION - export STAGING_ENV=$STAGING - fi +if [ ! -z "$USE_STAGING" ] && [ "$USE_STAGING" == "ON" ] + then + echo -- USING STAGING + export USE_STAGING="ON" + if [ -z "$STAGING_PREFIX" ] + then + STAGING_PREFIX="staging" + export STAGING_ENV=$WORKDIR/staging_$ARCH + else + echo -- STAGING_PREFIX:$STAGING_PREFIX + export STAGING_ENV=${STAGING_PREFIX}_${ARCH} + fi + export STAGING=${STAGING_PREFIX}_${ARCH} + export STAGING_DIR=${WORKDIR}/${STAGING}/${MINGW_VERSION} + export PACMAN="pacman -r $STAGING_ENV --noconfirm --needed" + else + echo -- NO STAGING + export USE_STAGING=OFF + export STAGING_DIR=/${MINGW_VERSION} + export STAGING_ENV="" + export PACMAN="pacman --noconfirm --needed" fi -export CC=/${MINGW_VERSION}/bin/${ARCH}-w64-mingw32-gcc.exe -export CXX=/${MINGW_VERSION}/bin/${ARCH}-w64-mingw32-g++.exe -export JOBS="-j 9" -#export MAKE_BIN=/${MINGW_VERSION}/bin/mingw32-make.exe -export MAKE_BIN=/bin/make +export PATH="/bin:$STAGING_DIR/bin:$WORKDIR/cv2pdb:/c/innosetup/:/bin:/usr/bin:${STAGING_DIR}/bin:/c/Program\ Files/Git/cmd:/c/Windows/System32:/c/Program\ Files/Appveyor/BuildAgent:$PATH" +export QMAKE=${STAGING_DIR}/bin/qmake +export PKG_CONFIG_PATH=$STAGING_DIR/lib/pkgconfig +export CC=${STAGING_DIR}/bin/${ARCH}-w64-mingw32-gcc.exe +export CXX=${STAGING_DIR}/bin/${ARCH}-w64-mingw32-g++.exe +export JOBS="-j" #change number of jobs +export MAKE_BIN=$STAGING_ENV/usr/bin/make.exe export MAKE_CMD="$MAKE_BIN $JOBS" export CMAKE_GENERATOR="Unix Makefiles" export CMAKE_OPTS=( \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_VERBOSE_MAKEFILE=ON \ -DCMAKE_C_COMPILER:FILEPATH=${CC} \ -DCMAKE_CXX_COMPILER:FILEPATH=${CXX} \ -DCMAKE_MAKE_PROGRAM:FILEPATH=${MAKE_BIN}\ - -DPKG_CONFIG_EXECUTABLE=/$MINGW_VERSION/bin/pkg-config.exe \ + -DPKG_CONFIG_EXECUTABLE=${STAGING_DIR}/bin/pkg-config.exe \ -DCMAKE_MODULE_PATH=$STAGING_DIR \ -DCMAKE_PREFIX_PATH=$STAGING_DIR/lib/cmake \ - -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_STAGING_PREFIX=$STAGING_DIR \ -DCMAKE_INSTALL_PREFIX=$STAGING_DIR \ ) -export CMAKE="/$MINGW_VERSION/bin/cmake ${CMAKE_OPTS[@]} " -if [ -z $USE_STAGING ] -then - export PACMAN="pacman --noconfirm --needed" - export QMAKE="/$MINGW_VERSION/bin/qmake" -else - #we want to use staging - export PACMAN="pacman -r $STAGING_ENV --noconfirm --needed" - export QMAKE="$STAGING_DIR/bin/qmake" -fi - -export PKG_CONFIG_PATH=$STAGING_DIR/lib/pkgconfig +export CMAKE="${STAGING_DIR}/bin/cmake ${CMAKE_OPTS[@]} " export AUTOCONF_OPTS="--prefix=$STAGING_DIR \ --host=${ARCH}-w64-mingw32 \ @@ -85,15 +84,21 @@ export AUTOCONF_OPTS="--prefix=$STAGING_DIR \ --disable-static" if [ ${ARCH} == "i686" ] -then - export RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=$WORKDIR/windres/windres.exe" -else - export RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=/mingw64/bin/windres.exe" + then + export RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=$WORKDIR/windres/windres.exe" + else + export RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=/mingw64/bin/windres.exe" fi -echo -- $STAGING_DIR is the staging dir -echo -- $MINGW_VERSION - mingw version -echo -- $ARCH - target arch -echo -- PATH is $PATH -echo -- using cmake command +BUILD_STATUS_FILE=/tmp/scopy-mingw-build-status +touch $BUILD_STATUS_FILE + +echo -- MAKE_BIN:$MAKE_BIN +echo -- STAGING_DIR:$STAGING_DIR +echo -- STAGING_ENV:$STAGING_ENV +echo -- MINGW_VERSION:$MINGW_VERSION +echo -- TARGET ARCH:$ARCH +echo -- PATH:$PATH +echo -- USING CMAKE COMMAND echo $CMAKE +echo From 80133870152f4b86b29058fce9898dd544b42575 Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Mon, 26 Jun 2023 13:49:18 +0300 Subject: [PATCH 66/77] Added libserialport and enabled serial backend for libiio Signed-off-by: Bindea Cristian --- build.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 3d6f66fbbf..8eeec73396 100755 --- a/build.sh +++ b/build.sh @@ -34,6 +34,7 @@ PACMAN_SYNC_DEPS="\ mingw-w64-${ARCH}-zlib\ mingw-w64-${ARCH}-breakpad\ mingw-w64-${ARCH}-libusb\ + mingw-w64-${ARCH}-libserialport\ " @@ -151,7 +152,7 @@ build_libiio() { ${RC_COMPILER_OPT}\ -DENABLE_IPV6=OFF\ -DWITH_USB_BACKEND=ON\ - -DWITH_SERIAL_BACKEND=OFF\ + -DWITH_SERIAL_BACKEND=ON\ -DWITH_TESTS:BOOL=OFF\ -DWITH_DOC:BOOL=OFF\ -DCSHARP_BINDINGS:BOOL=OFF\ From a642401042ba09236fdd0005ea61f7537b27d64a Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Mon, 26 Jun 2023 14:31:40 +0300 Subject: [PATCH 67/77] Update boost version from 1.75.0-9 to 1.79.0-4 - the update was needed just because the download link for the previous version was broken Signed-off-by: Bindea Cristian --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 8eeec73396..7c3de7cbb9 100755 --- a/build.sh +++ b/build.sh @@ -69,7 +69,7 @@ install_tools() { } install_deps() { $PACMAN -S $PACMAN_SYNC_DEPS - $PACMAN -U https://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-boost-1.75.0-9-any.pkg.tar.zst + $PACMAN -U https://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-boost-1.79.0-4-any.pkg.tar.zst } recurse_submodules() { From 0e5780b43d74189b08daa08788bc1b8af1494c33 Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Wed, 5 Jul 2023 12:31:50 +0300 Subject: [PATCH 68/77] Update libiio and enable DNS-SD support Signed-off-by: Bindea Cristian --- build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sh b/build.sh index 7c3de7cbb9..b3a1034c3b 100755 --- a/build.sh +++ b/build.sh @@ -157,6 +157,7 @@ build_libiio() { -DWITH_DOC:BOOL=OFF\ -DCSHARP_BINDINGS:BOOL=OFF\ -DPYTHON_BINDINGS:BOOL=OFF\ + -DHAVE_DNS_SD:BOOL=ON\ " __build_with_cmake } From fac539bd4ddc51462d3b989e0b6532e355265072 Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Mon, 17 Jul 2023 15:22:57 +0300 Subject: [PATCH 69/77] Disable IPv6 support for libiio Signed-off-by: Bindea Cristian --- build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sh b/build.sh index b3a1034c3b..680824e1f3 100755 --- a/build.sh +++ b/build.sh @@ -158,6 +158,7 @@ build_libiio() { -DCSHARP_BINDINGS:BOOL=OFF\ -DPYTHON_BINDINGS:BOOL=OFF\ -DHAVE_DNS_SD:BOOL=ON\ + -DENABLE_IPV6:BOOL=OFF\ " __build_with_cmake } From a6b3a83c7f7cfb9144c054c787405e4eae5573a8 Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Fri, 8 Sep 2023 14:57:16 +0300 Subject: [PATCH 70/77] Fix missing libsigrokdecode dependency Signed-off-by: Bindea Cristian --- build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sh b/build.sh index 680824e1f3..39606109c7 100755 --- a/build.sh +++ b/build.sh @@ -17,6 +17,7 @@ TOOLS_PKGS="\ vim\ base-devel\ mingw-w64-${ARCH}-autotools\ + libtool\ " #mingw-w64-${ARCH}-boost PACMAN_SYNC_DEPS="\ From 92a5454ea0f457d1babd5bc3535279d1dd4a4bc1 Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Fri, 22 Sep 2023 15:16:56 +0300 Subject: [PATCH 71/77] Make CI scripts easily run on local machines Signed-off-by: Bindea Cristian --- build.sh | 96 +++++++++++++--------------------------------- mingw_toolchain.sh | 26 ++++++------- 2 files changed, 37 insertions(+), 85 deletions(-) diff --git a/build.sh b/build.sh index 39606109c7..dd82960d68 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,5 @@ #!/usr/bin/bash.exe -#set -ex source mingw_toolchain.sh $1 $2 $3 TOOLS_PKGS="\ @@ -41,8 +40,8 @@ PACMAN_SYNC_DEPS="\ install_tools() { $PACMAN -S unzip zip - mkdir -p $WORKDIR/windres - pushd $WORKDIR/windres + mkdir -p $WORKFOLDER/windres + pushd $WORKFOLDER/windres if [ ! -f windres.exe.gz ]; then wget http://swdownloads.analog.com/cse/build/windres.exe.gz gunzip windres.exe.gz @@ -74,7 +73,7 @@ install_deps() { } recurse_submodules() { - pushd $WORKDIR + pushd $WORKFOLDER git submodule update --init --recursive --jobs 9 popd } @@ -99,14 +98,14 @@ echo $BUILD_STATUS_FILE echo "Repo deps locations/files" >> $BUILD_STATUS_FILE echo $PACMAN_REPO_DEPS >> $BUILD_STATUS_FILE -#ls ${WORKDIR}/old_msys_deps_${MINGW_VERSION} +#ls ${WORKFOLDER}/old_msys_deps_${MINGW_VERSION} } __clean_build_dir() { git clean -xdf - rm -rf ${WORKDIR}/$CURRENT_BUILD/build-${ARCH} - mkdir ${WORKDIR}/$CURRENT_BUILD/build-${ARCH} - cd ${WORKDIR}/$CURRENT_BUILD/build-${ARCH} + rm -rf ${WORKFOLDER}/$CURRENT_BUILD/build-${ARCH} + mkdir ${WORKFOLDER}/$CURRENT_BUILD/build-${ARCH} + cd ${WORKFOLDER}/$CURRENT_BUILD/build-${ARCH} } __build_with_cmake() { @@ -114,11 +113,11 @@ __build_with_cmake() { if [ ! -z $NO_INSTALL ]; then INSTALL="" fi - pushd $WORKDIR/$CURRENT_BUILD + pushd $WORKFOLDER/$CURRENT_BUILD __clean_build_dir eval $CURRENT_BUILD_POST_CLEAN eval $CURRENT_BUILD_PATCHES - $CMAKE $CURRENT_BUILD_CMAKE_OPTS $WORKDIR/$CURRENT_BUILD + $CMAKE $CURRENT_BUILD_CMAKE_OPTS $WORKFOLDER/$CURRENT_BUILD eval $CURRENT_BUILD_POST_CMAKE make $JOBS $INSTALL eval $CURRENT_BUILD_POST_MAKE @@ -133,7 +132,7 @@ __build_with_cmake() { NO_INSTALL="" popd if [ ! -z $INSTALL ]; then - rm -rf ${WORKDIR}/$CURRENT_BUILD/build-${ARCH} + rm -rf ${WORKFOLDER}/$CURRENT_BUILD/build-${ARCH} fi } @@ -271,24 +270,24 @@ build_libsigrokdecode() { echo "### Building libsigrokdecode - branch $LIBSIGROKDECODE_BRANCH" CURRENT_BUILD=libsigrokdecode - pushd $WORKDIR/libsigrokdecode - if [ -d "$WORKDIR/libsigrokdecode/build-$ARCH" ]; then + pushd $WORKFOLDER/libsigrokdecode + if [ -d "$WORKFOLDER/libsigrokdecode/build-$ARCH" ]; then # hack .. this gets messed up somehow in docker due to changing files to lowercase git reset --hard git clean -xdf fi - rm -rf ${WORKDIR}/libsigrokdecode/build-${ARCH} - mkdir -p ${WORKDIR}/libsigrokdecode/build-${ARCH} - cd ${WORKDIR}/libsigrokdecode + rm -rf ${WORKFOLDER}/libsigrokdecode/build-${ARCH} + mkdir -p ${WORKFOLDER}/libsigrokdecode/build-${ARCH} + cd ${WORKFOLDER}/libsigrokdecode - patch -p1 < ${WORKDIR}/sigrokdecode-windows-fix.patch + patch -p1 < ${WORKFOLDER}/sigrokdecode-windows-fix.patch ./autogen.sh cd build-${ARCH} CPPFLAGS="-DLIBSIGROKDECODE_EXPORT=1" ../configure ${AUTOCONF_OPTS} $MAKE_BIN $JOBS install - rm -rf ${WORKDIR}/libsigrokdecode/build-${ARCH} + rm -rf ${WORKFOLDER}/libsigrokdecode/build-${ARCH} echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE popd } @@ -327,20 +326,20 @@ package_and_push() { $PACMAN -Qm >> $BUILD_STATUS_FILE # Fix DLLs installed in the wrong path - #mv ${WORKDIR}/msys64/${MINGW_VERSION}/lib/qwt.dll\ - # ${WORKDIR}/msys64/${MINGW_VERSION}/lib/qwtpolar.dll\ - # ${WORKDIR}/msys64/${MINGW_VERSION}/bin + #mv ${WORKFOLDER}/msys64/${MINGW_VERSION}/lib/qwt.dll\ + # ${WORKFOLDER}/msys64/${MINGW_VERSION}/lib/qwtpolar.dll\ + # ${WORKFOLDER}/msys64/${MINGW_VERSION}/bin - #rm -rf ${WORKDIR}/msys64/${MINGW_VERSION}/doc\ - # ${WORKDIR}/msys64/${MINGW_VERSION}/share/doc\ - # ${WORKDIR}/msys64/${MINGW_VERSION}/lib/*.la + #rm -rf ${WORKFOLDER}/msys64/${MINGW_VERSION}/doc\ + # ${WORKFOLDER}/msys64/${MINGW_VERSION}/share/doc\ + # ${WORKFOLDER}/msys64/${MINGW_VERSION}/lib/*.la echo "### Creating archive ... " - tar cavf ${WORKDIR}/scopy-${MINGW_VERSION}-build-deps.tar.xz -C ${WORKDIR} msys64 + tar cavf ${WORKFOLDER}/scopy-${MINGW_VERSION}-build-deps.tar.xz -C ${WORKFOLDER} msys64 appveyor PushArtifact $BUILD_STATUS_FILE $PACMAN -Q > /tmp/AllInstalledPackages appveyor PushArtifact /tmp/AllInstalledPackages - echo -n ${PACMAN_SYNC_DEPS} > ${WORKDIR}/scopy-$MINGW_VERSION-build-deps-pacman.txt + echo -n ${PACMAN_SYNC_DEPS} > ${WORKFOLDER}/scopy-$MINGW_VERSION-build-deps-pacman.txt } build_deps() { @@ -365,47 +364,4 @@ build_libtinyiiod #create_build_status_file #build_deps #build_scopy # for testing -#package_and_push - - - - -# build_griio() { -# echo "### Building gr-iio - branch $GRIIO_BRANCH" - -# CURRENT_BUILD=gr-iio -# # -D_hypot=hypot: http://boost.2283326.n4.nabble.com/Boost-Python-Compile-Error-s-GCC-via-MinGW-w64-td3165793.html#a3166757 -# CURRENT_BUILD_CMAKE_OPTS=" -# -DCMAKE_CXX_FLAGS=-D_hypot=hypot\ -# -DPYTHON_EXECUTABLE=$STAGING_DIR/bin/python3\ -# " -# __build_with_cmake - -# } - -# build_qadvanceddocking() { -# echo "### Building Qt-Advanced-Docking-System " -# CURRENT_BUILD=qadvanceddocking -# __build_with_cmake - -# } - -# build_log4cpp() { -# CURRENT_BUILD=log4cpp - -# # this is a fix for MINGW long long long is too long - patch the config-MingW32.h -# # probably not the cleanest patch - deletes this line -# # https://github.com/orocos-toolchain/log4cpp/blob/359be7d88eb8a87f618620918c73ef1fc6e87242/include/log4cpp/config-MinGW32.h#L27 -# # we need a better patch here or maybe use another repo - -# CURRENT_BUILD_POST_CLEAN=" -# git reset --hard && -# sed '27d' ../include/log4cpp/config-MinGW32.h > temp && mv temp ../include/log4cpp/config-MinGW32.h; -# " -# # LOG4CPP puts dll in wrong file for MINGW - it should be in bin, but it puts it in lib so we copy it -# CURRENT_BUILD_POST_MAKE=" -# mkdir -p $STAGING_DIR/bin && -# cp $STAGING_DIR/lib/liblog4cpp.dll $STAGING_DIR/bin/liblog4cpp.dll -# " -# __build_with_cmake -# } +#package_and_push \ No newline at end of file diff --git a/mingw_toolchain.sh b/mingw_toolchain.sh index ca5c87cc90..c62a1fc420 100644 --- a/mingw_toolchain.sh +++ b/mingw_toolchain.sh @@ -1,9 +1,11 @@ #!/usr/bin/bash.exe -#source build_system_setup.sh #TODO: make each dep install it's own deps - -#set -ex +set -x +if [ "$CI_SCRIPT" == "ON" ] + then + set -ex +fi if [ $# -ne 1 ]; then @@ -22,13 +24,7 @@ if [ "$ARCH" == "x86_64" ] export ARCH_BIT=32 fi -if [ -z "$HOME" ] || [ "$HOME" == "/" ]; then - export HOME=/home/docker -fi - -export WORKDIR=${PWD} -export JOBS="-j9" - +export WORKFOLDER=${PWD} USE_STAGING=$2 STAGING_PREFIX=$3 @@ -39,13 +35,13 @@ if [ ! -z "$USE_STAGING" ] && [ "$USE_STAGING" == "ON" ] if [ -z "$STAGING_PREFIX" ] then STAGING_PREFIX="staging" - export STAGING_ENV=$WORKDIR/staging_$ARCH + export STAGING_ENV=$WORKFOLDER/staging_$ARCH else echo -- STAGING_PREFIX:$STAGING_PREFIX export STAGING_ENV=${STAGING_PREFIX}_${ARCH} fi export STAGING=${STAGING_PREFIX}_${ARCH} - export STAGING_DIR=${WORKDIR}/${STAGING}/${MINGW_VERSION} + export STAGING_DIR=${WORKFOLDER}/${STAGING}/${MINGW_VERSION} export PACMAN="pacman -r $STAGING_ENV --noconfirm --needed" else echo -- NO STAGING @@ -55,12 +51,12 @@ if [ ! -z "$USE_STAGING" ] && [ "$USE_STAGING" == "ON" ] export PACMAN="pacman --noconfirm --needed" fi -export PATH="/bin:$STAGING_DIR/bin:$WORKDIR/cv2pdb:/c/innosetup/:/bin:/usr/bin:${STAGING_DIR}/bin:/c/Program\ Files/Git/cmd:/c/Windows/System32:/c/Program\ Files/Appveyor/BuildAgent:$PATH" +export PATH="/bin:$STAGING_DIR/bin:$WORKFOLDER/cv2pdb:/c/Program Files (x86)/Inno Setup 6:/c/innosetup/:/bin:/usr/bin:${STAGING_DIR}/bin:/c/Program\ Files/Git/cmd:/c/Windows/System32:/c/Program\ Files/Appveyor/BuildAgent:$PATH" export QMAKE=${STAGING_DIR}/bin/qmake export PKG_CONFIG_PATH=$STAGING_DIR/lib/pkgconfig export CC=${STAGING_DIR}/bin/${ARCH}-w64-mingw32-gcc.exe export CXX=${STAGING_DIR}/bin/${ARCH}-w64-mingw32-g++.exe -export JOBS="-j" #change number of jobs +export JOBS="-j9" export MAKE_BIN=$STAGING_ENV/usr/bin/make.exe export MAKE_CMD="$MAKE_BIN $JOBS" export CMAKE_GENERATOR="Unix Makefiles" @@ -85,7 +81,7 @@ export AUTOCONF_OPTS="--prefix=$STAGING_DIR \ if [ ${ARCH} == "i686" ] then - export RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=$WORKDIR/windres/windres.exe" + export RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=$WORKFOLDER/windres/windres.exe" else export RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=/mingw64/bin/windres.exe" fi From c798985549724a20b64aa2a2ad0a3fe90810b24c Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Tue, 19 Mar 2024 17:26:18 +0200 Subject: [PATCH 72/77] Improve CI scripts Signed-off-by: Bindea Cristian --- build.sh | 156 ++++++++++++++++++++------------------------- docker/Dockerfile | 14 +--- init_staging.sh | 2 +- mingw_toolchain.sh | 38 ++--------- 4 files changed, 78 insertions(+), 132 deletions(-) diff --git a/build.sh b/build.sh index dd82960d68..4d51aecdbb 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,6 @@ #!/usr/bin/bash.exe -source mingw_toolchain.sh $1 $2 $3 +source mingw_toolchain.sh $1 $2 TOOLS_PKGS="\ mingw-w64-${ARCH}-cmake\ @@ -37,36 +37,37 @@ PACMAN_SYNC_DEPS="\ mingw-w64-${ARCH}-libserialport\ " - install_tools() { $PACMAN -S unzip zip mkdir -p $WORKFOLDER/windres pushd $WORKFOLDER/windres - if [ ! -f windres.exe.gz ]; then + if [ ! -f windres.exe.gz ]; then wget http://swdownloads.analog.com/cse/build/windres.exe.gz gunzip windres.exe.gz fi popd - - wget http://swdownloads.analog.com/cse/m1k/drivers/dpinst.zip - wget http://swdownloads.analog.com/cse/m1k/drivers/dfu-util.zip - unzip "dpinst.zip" - unzip "dfu-util.zip" - - # github release upload tool install - wget https://github.com/tcnksm/ghr/releases/download/v0.13.0/ghr_v0.13.0_windows_amd64.zip - unzip ghr_v0.13.0_windows_amd64.zip - export UPLOAD_TOOL=/c/ghr/ghr_v0.13.0_windows_amd64/ghr.exe - - wget https://swdownloads.analog.com/cse/scopydeps/cv2pdb-dlls.zip - unzip "cv2pdb-dlls.zip" - - wget https://jrsoftware.org/download.php/is.exe - - #pacman --noconfirm --needed -S $TOOLS_PKGS + + if [ ! -f dpinst.zip ]; then + wget http://swdownloads.analog.com/cse/m1k/drivers/dpinst.zip + unzip "dpinst.zip" + fi + + if [ ! -f dfu-util.zip ]; then + wget http://swdownloads.analog.com/cse/m1k/drivers/dfu-util.zip + unzip "dfu-util.zip" + fi + + if [ ! -f cv2pdb-dlls.zip ]; then + wget https://swdownloads.analog.com/cse/scopydeps/cv2pdb-dlls.zip + unzip "cv2pdb-dlls.zip" + fi + + if [! -f is.exe ]; then + wget https://jrsoftware.org/download.php/is.exe + fi $PACMAN -S $TOOLS_PKGS - } + install_deps() { $PACMAN -S $PACMAN_SYNC_DEPS $PACMAN -U https://repo.msys2.org/mingw/${ARCH}/mingw-w64-${ARCH}-boost-1.79.0-4-any.pkg.tar.zst @@ -79,40 +80,37 @@ recurse_submodules() { } create_build_status_file() { - -echo "Built scopy-mingw-build-deps on Appveyor" >> $BUILD_STATUS_FILE -echo "on $(date)" >> $BUILD_STATUS_FILE -echo "url: ${APPVEYOR_URL}" >> $BUILD_STATUS_FILE -echo "api_url: ${APPVEYOR_API_URL}" >> $BUILD_STATUS_FILE -echo "acc_name: ${APPVEYOR_ACCOUNT_NAME}" >> $BUILD_STATUS_FILE -echo "prj_name: ${APPVEYOR_PROJECT_NAME}" >> $BUILD_STATUS_FILE -echo "build_id: ${APPVEYOR_BUILD_ID}" >> $BUILD_STATUS_FILE -echo "build_nr: ${APPVEYOR_BUILD_NUMBER}" >> $BUILD_STATUS_FILE -echo "build_version: ${APPVEYOR_BUILD_VERSION}" >> $BUILD_STATUS_FILE -echo "job_id: ${APPVEYOR_JOB_ID}" >> $BUILD_STATUS_FILE -echo "job_name: ${APPVEYOR_JOB_NAME}" >> $BUILD_STATUS_FILE -echo "job_nr: ${APPVEYOR_JOB_NUMBER}" >> $BUILD_STATUS_FILE -echo "job_link: ${APPVEYOR_URL}/project/${APPVEYOR_ACCOUNT_NAME}/${APPVEYOR_PROJECT_NAME}/builds/${APPVEYOR_BUILD_ID}/job/${APPVEYOR_JOB_ID}" >> $BUILD_STATUS_FILE - -echo $BUILD_STATUS_FILE - -echo "Repo deps locations/files" >> $BUILD_STATUS_FILE -echo $PACMAN_REPO_DEPS >> $BUILD_STATUS_FILE -#ls ${WORKFOLDER}/old_msys_deps_${MINGW_VERSION} + echo "Built scopy-mingw-build-deps on Appveyor" >> $BUILD_STATUS_FILE + echo "on $(date)" >> $BUILD_STATUS_FILE + echo "url: ${APPVEYOR_URL}" >> $BUILD_STATUS_FILE + echo "api_url: ${APPVEYOR_API_URL}" >> $BUILD_STATUS_FILE + echo "acc_name: ${APPVEYOR_ACCOUNT_NAME}" >> $BUILD_STATUS_FILE + echo "prj_name: ${APPVEYOR_PROJECT_NAME}" >> $BUILD_STATUS_FILE + echo "build_id: ${APPVEYOR_BUILD_ID}" >> $BUILD_STATUS_FILE + echo "build_nr: ${APPVEYOR_BUILD_NUMBER}" >> $BUILD_STATUS_FILE + echo "build_version: ${APPVEYOR_BUILD_VERSION}" >> $BUILD_STATUS_FILE + echo "job_id: ${APPVEYOR_JOB_ID}" >> $BUILD_STATUS_FILE + echo "job_name: ${APPVEYOR_JOB_NAME}" >> $BUILD_STATUS_FILE + echo "job_nr: ${APPVEYOR_JOB_NUMBER}" >> $BUILD_STATUS_FILE + echo "job_link: ${APPVEYOR_URL}/project/${APPVEYOR_ACCOUNT_NAME}/${APPVEYOR_PROJECT_NAME}/builds/${APPVEYOR_BUILD_ID}/job/${APPVEYOR_JOB_ID}" >> $BUILD_STATUS_FILE + + echo $BUILD_STATUS_FILE + + echo "Repo deps locations/files" >> $BUILD_STATUS_FILE + echo $PACMAN_REPO_DEPS >> $BUILD_STATUS_FILE + #ls ${WORKFOLDER}/old_msys_deps_${MINGW_VERSION} } __clean_build_dir() { git clean -xdf - rm -rf ${WORKFOLDER}/$CURRENT_BUILD/build-${ARCH} - mkdir ${WORKFOLDER}/$CURRENT_BUILD/build-${ARCH} - cd ${WORKFOLDER}/$CURRENT_BUILD/build-${ARCH} + rm -rf ${WORKFOLDER}/${CURRENT_BUILD}/build-${ARCH} + mkdir ${WORKFOLDER}/${CURRENT_BUILD}/build-${ARCH} + cd ${WORKFOLDER}/${CURRENT_BUILD}/build-${ARCH} } __build_with_cmake() { INSTALL="install" - if [ ! -z $NO_INSTALL ]; then - INSTALL="" - fi + [ -z $NO_INSTALL ] || INSTALL="" pushd $WORKFOLDER/$CURRENT_BUILD __clean_build_dir eval $CURRENT_BUILD_POST_CLEAN @@ -131,12 +129,10 @@ __build_with_cmake() { CURRENT_BUILD="" NO_INSTALL="" popd - if [ ! -z $INSTALL ]; then - rm -rf ${WORKFOLDER}/$CURRENT_BUILD/build-${ARCH} - fi + #clean deps folder + [ -z $INSTALL ] || rm -rf ${WORKFOLDER}/${CURRENT_BUILD}/build-${ARCH} } - build_glog() { CURRENT_BUILD=glog CURRENT_BUILD_CMAKE_OPTS="\ @@ -183,6 +179,7 @@ build_libm2k() { } build_spdlog() { + [ -f "/usr/bin/x86_64-w64-mingw32-windres.exe" ] && rm -v /usr/bin/x86_64-w64-mingw32-windres.exe ln -s /usr/bin/windres.exe /usr/bin/x86_64-w64-mingw32-windres.exe CURRENT_BUILD=spdlog CURRENT_BUILD_CMAKE_OPTS="\ @@ -258,8 +255,9 @@ build_qwt() { echo "### Building qwt - branch $QWT_BRANCH" CURRENT_BUILD=qwt pushd $CURRENT_BUILD - $QMAKE - make $JOBS + git clean -xdf + $QMAKE qwt.pro + VERBOSE=1 make LDFLAGS="-Wl,verbose" $JOBS make INSTALL_ROOT="$STAGING_DIR" $JOBS install cp $STAGING_DIR/lib/qwt.dll $STAGING_DIR/bin/qwt.dll echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE @@ -312,52 +310,36 @@ build_scopy() { __build_with_cmake } -package_and_push() { - - if [ -z $APPVEYOR ]; then - echo "Appveyor environment not detected" - return - fi +write_status_file() { echo "" >> $BUILD_STATUS_FILE echo "$PACMAN -Qe output - all explicitly installed packages on build machine" >> $BUILD_STATUS_FILE $PACMAN -Qe >> $BUILD_STATUS_FILE echo "pacman -Qm output - all packages from nonsync sources" >> $BUILD_STATUS_FILE $PACMAN -Qm >> $BUILD_STATUS_FILE - - # Fix DLLs installed in the wrong path - #mv ${WORKFOLDER}/msys64/${MINGW_VERSION}/lib/qwt.dll\ - # ${WORKFOLDER}/msys64/${MINGW_VERSION}/lib/qwtpolar.dll\ - # ${WORKFOLDER}/msys64/${MINGW_VERSION}/bin - - #rm -rf ${WORKFOLDER}/msys64/${MINGW_VERSION}/doc\ - # ${WORKFOLDER}/msys64/${MINGW_VERSION}/share/doc\ - # ${WORKFOLDER}/msys64/${MINGW_VERSION}/lib/*.la - - echo "### Creating archive ... " - tar cavf ${WORKFOLDER}/scopy-${MINGW_VERSION}-build-deps.tar.xz -C ${WORKFOLDER} msys64 - appveyor PushArtifact $BUILD_STATUS_FILE - $PACMAN -Q > /tmp/AllInstalledPackages - appveyor PushArtifact /tmp/AllInstalledPackages echo -n ${PACMAN_SYNC_DEPS} > ${WORKFOLDER}/scopy-$MINGW_VERSION-build-deps-pacman.txt } build_deps() { -build_glog -build_libiio -build_libad9361 -build_libm2k -build_spdlog -build_libsndfile -build_volk -build_gnuradio -build_grscopy -build_grm2k -build_qwt -build_libsigrokdecode -build_libtinyiiod + build_libiio + build_libad9361 + build_libm2k + build_spdlog + build_libsndfile + build_volk + build_gnuradio + build_grscopy + build_grm2k + build_qwt + build_libsigrokdecode + build_libtinyiiod } + +for arg in $@; do + $arg +done + #recurse_submodules #install_tools #install_deps diff --git a/docker/Dockerfile b/docker/Dockerfile index 588376512e..283a8811ce 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -33,19 +33,9 @@ RUN C:\msys64\usr\bin\bash.exe -c 'pacman --noconfirm --needed -Sy git' RUN C:\msys64\usr\bin\bash.exe -c "git clone https://github.com/analogdevicesinc/scopy-mingw-build-deps --branch ci-for-scopy2" # install packages and build scopy-deps -ARG BUILD_TARGET=x86_64 -ENV BUILD_TARGET=$BUILD_TARGET -ARG USE_STAGING=OFF -ENV USE_STAGING=$USE_STAGING - -RUN echo BUILD_TARGET=%BUILD_TARGET% -RUN echo USE_STAGING=%USE_STAGING% - -# exit 0 is required because init_staging force terminates the msys process resulting in an error - it is not an error -RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && ls && echo Building for $BUILD_TARGET && ./init_staging.sh $BUILD_TARGET $USE_STAGING" & exit 0 -RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && source build.sh $BUILD_TARGET $USE_STAGING && install_tools && install_deps && recurse_submodules" +RUN C:\msys64\usr\bin\bash.exe -c "/home/docker/scopy-mingw-build-deps/build.sh install_tools install_deps recurse_submodules" RUN C:\msys64\home\docker\scopy-mingw-build-deps\is.exe /VERYSILENT /SP- /SUPPRESSMSGBOXES /NORESTART /LOG=C:\msys64\home\docker\iss.log /DIR=C:\innosetup -RUN C:\msys64\usr\bin\bash.exe -c "cd /home/docker/scopy-mingw-build-deps && source build.sh $BUILD_TARGET $USE_STAGING && build_deps" +RUN C:\msys64\usr\bin\bash.exe -c "/home/docker/scopy-mingw-build-deps/build.sh build_deps" # clone scopy # build scopy diff --git a/init_staging.sh b/init_staging.sh index 4db9e420be..d0fa24fadd 100644 --- a/init_staging.sh +++ b/init_staging.sh @@ -1,10 +1,10 @@ #!/usr/bin/bash.exe #set -ex -source mingw_toolchain.sh $1 $2 $3 init_staging() { if [ "$USE_STAGING" == "ON" ] then + source mingw_toolchain.sh ON rm -rf $STAGING_ENV mkdir -p $STAGING_ENV/var/lib/pacman/local mkdir -p $STAGING_ENV/var/lib/pacman/sync diff --git a/mingw_toolchain.sh b/mingw_toolchain.sh index c62a1fc420..7eb0a34ccd 100644 --- a/mingw_toolchain.sh +++ b/mingw_toolchain.sh @@ -1,32 +1,12 @@ #!/usr/bin/bash.exe -#TODO: make each dep install it's own deps -set -x -if [ "$CI_SCRIPT" == "ON" ] - then - set -ex -fi - -if [ $# -ne 1 ]; - then - ARG1=x86_64 - else - ARG1=$1 -fi -export ARCH=$ARG1 - -if [ "$ARCH" == "x86_64" ] - then - export MINGW_VERSION=mingw64 - export ARCH_BIT=64 - else - export MINGW_VERSION=mingw32 - export ARCH_BIT=32 -fi +set -ex +export MINGW_VERSION=mingw64 +export ARCH=x86_64 export WORKFOLDER=${PWD} -USE_STAGING=$2 -STAGING_PREFIX=$3 +USE_STAGING=$1 +STAGING_PREFIX=$2 if [ ! -z "$USE_STAGING" ] && [ "$USE_STAGING" == "ON" ] then @@ -51,6 +31,7 @@ if [ ! -z "$USE_STAGING" ] && [ "$USE_STAGING" == "ON" ] export PACMAN="pacman --noconfirm --needed" fi +export RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=/mingw64/bin/windres.exe" export PATH="/bin:$STAGING_DIR/bin:$WORKFOLDER/cv2pdb:/c/Program Files (x86)/Inno Setup 6:/c/innosetup/:/bin:/usr/bin:${STAGING_DIR}/bin:/c/Program\ Files/Git/cmd:/c/Windows/System32:/c/Program\ Files/Appveyor/BuildAgent:$PATH" export QMAKE=${STAGING_DIR}/bin/qmake export PKG_CONFIG_PATH=$STAGING_DIR/lib/pkgconfig @@ -79,13 +60,6 @@ export AUTOCONF_OPTS="--prefix=$STAGING_DIR \ --enable-shared \ --disable-static" -if [ ${ARCH} == "i686" ] - then - export RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=$WORKFOLDER/windres/windres.exe" - else - export RC_COMPILER_OPT="-DCMAKE_RC_COMPILER=/mingw64/bin/windres.exe" -fi - BUILD_STATUS_FILE=/tmp/scopy-mingw-build-status touch $BUILD_STATUS_FILE From 1b81aa5d951af7183dbd3ffd7dd8a3911a375fbb Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Tue, 19 Mar 2024 17:30:46 +0200 Subject: [PATCH 73/77] Remove Glog Signed-off-by: Bindea Cristian --- build.sh | 9 --------- 1 file changed, 9 deletions(-) diff --git a/build.sh b/build.sh index 4d51aecdbb..d5c34d0aa0 100755 --- a/build.sh +++ b/build.sh @@ -133,15 +133,6 @@ __build_with_cmake() { [ -z $INSTALL ] || rm -rf ${WORKFOLDER}/${CURRENT_BUILD}/build-${ARCH} } -build_glog() { - CURRENT_BUILD=glog - CURRENT_BUILD_CMAKE_OPTS="\ - -DWITH_GFLAGS=OFF\ - -DBUILD_SHARED_LIBS=ON\ - " - __build_with_cmake -} - build_libiio() { CURRENT_BUILD=libiio CURRENT_BUILD_CMAKE_OPTS="\ From 3e949c1e7202d99ccbb2354db6ffa76660519e1a Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Tue, 19 Mar 2024 17:42:23 +0200 Subject: [PATCH 74/77] Fix appveyor workflow Signed-off-by: Bindea Cristian --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index d5c34d0aa0..a66e54c458 100755 --- a/build.sh +++ b/build.sh @@ -302,12 +302,12 @@ build_scopy() { } write_status_file() { - echo "" >> $BUILD_STATUS_FILE echo "$PACMAN -Qe output - all explicitly installed packages on build machine" >> $BUILD_STATUS_FILE $PACMAN -Qe >> $BUILD_STATUS_FILE echo "pacman -Qm output - all packages from nonsync sources" >> $BUILD_STATUS_FILE $PACMAN -Qm >> $BUILD_STATUS_FILE + cp $BUILD_STATUS_FILE ${WORKFOLDER}/scopy-$MINGW_VERSION-build-status-file.txt echo -n ${PACMAN_SYNC_DEPS} > ${WORKFOLDER}/scopy-$MINGW_VERSION-build-deps-pacman.txt } From 262efe2b7f100390c89f10f63828d6a4f745995a Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Mon, 20 May 2024 14:06:52 +0300 Subject: [PATCH 75/77] Enable libiio executable generation - WITH_TESTS=ON Signed-off-by: Bindea Cristian --- build.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index a66e54c458..d94ee9f538 100755 --- a/build.sh +++ b/build.sh @@ -137,10 +137,9 @@ build_libiio() { CURRENT_BUILD=libiio CURRENT_BUILD_CMAKE_OPTS="\ ${RC_COMPILER_OPT}\ - -DENABLE_IPV6=OFF\ - -DWITH_USB_BACKEND=ON\ - -DWITH_SERIAL_BACKEND=ON\ - -DWITH_TESTS:BOOL=OFF\ + -DWITH_USB_BACKEND:BOOL=ON\ + -DWITH_SERIAL_BACKEND:BOOL=ON\ + -DWITH_TESTS:BOOL=ON\ -DWITH_DOC:BOOL=OFF\ -DCSHARP_BINDINGS:BOOL=OFF\ -DPYTHON_BINDINGS:BOOL=OFF\ From 4f590efafb5f9f45425ac67c67d25b65de643728 Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Mon, 20 May 2024 15:56:33 +0300 Subject: [PATCH 76/77] The script is now independent of the path from which it was executed Signed-off-by: Bindea Cristian --- build.sh | 30 ++++++++++++++++-------------- mingw_toolchain.sh | 4 ++-- 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/build.sh b/build.sh index d94ee9f538..c6318a5828 100755 --- a/build.sh +++ b/build.sh @@ -1,6 +1,8 @@ #!/usr/bin/bash.exe - -source mingw_toolchain.sh $1 $2 +set -xe +# get the full directory path of the script +SRC_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +source $SRC_DIR/mingw_toolchain.sh $1 $2 TOOLS_PKGS="\ mingw-w64-${ARCH}-cmake\ @@ -39,13 +41,11 @@ PACMAN_SYNC_DEPS="\ install_tools() { $PACMAN -S unzip zip - mkdir -p $WORKFOLDER/windres - pushd $WORKFOLDER/windres - if [ ! -f windres.exe.gz ]; then + pushd $WORKFOLDER + if [ ! -f windres.exe ]; then wget http://swdownloads.analog.com/cse/build/windres.exe.gz gunzip windres.exe.gz fi - popd if [ ! -f dpinst.zip ]; then wget http://swdownloads.analog.com/cse/m1k/drivers/dpinst.zip @@ -62,10 +62,11 @@ install_tools() { unzip "cv2pdb-dlls.zip" fi - if [! -f is.exe ]; then + if [ ! -f is.exe ]; then wget https://jrsoftware.org/download.php/is.exe fi $PACMAN -S $TOOLS_PKGS + popd } install_deps() { @@ -120,6 +121,11 @@ __build_with_cmake() { make $JOBS $INSTALL eval $CURRENT_BUILD_POST_MAKE echo "$CURRENT_BUILD - $(git rev-parse --short HEAD)" >> $BUILD_STATUS_FILE + popd + + #clean deps folder + [ -z $INSTALL ] || rm -rf ${WORKFOLDER}/${CURRENT_BUILD}/build-${ARCH} + # clear vars CURRENT_BUILD_CMAKE_OPTS="" CURRENT_BUILD_POST_CLEAN="" @@ -128,9 +134,6 @@ __build_with_cmake() { CURRENT_BUILD_POST_MAKE="" CURRENT_BUILD="" NO_INSTALL="" - popd - #clean deps folder - [ -z $INSTALL ] || rm -rf ${WORKFOLDER}/${CURRENT_BUILD}/build-${ARCH} } build_libiio() { @@ -162,7 +165,6 @@ build_libm2k() { -DENABLE_CSHARP=OFF\ -DBUILD_EXAMPLES=OFF\ -DENABLE_TOOLS=ON\ - -DENABLE_LOG=ON\ -DINSTALL_UDEV_RULES=OFF\ " __build_with_cmake @@ -244,7 +246,7 @@ build_grscopy() { build_qwt() { echo "### Building qwt - branch $QWT_BRANCH" CURRENT_BUILD=qwt - pushd $CURRENT_BUILD + pushd $WORKFOLDER/$CURRENT_BUILD git clean -xdf $QMAKE qwt.pro VERBOSE=1 make LDFLAGS="-Wl,verbose" $JOBS @@ -258,7 +260,7 @@ build_libsigrokdecode() { echo "### Building libsigrokdecode - branch $LIBSIGROKDECODE_BRANCH" CURRENT_BUILD=libsigrokdecode - pushd $WORKFOLDER/libsigrokdecode + pushd $WORKFOLDER/$CURRENT_BUILD if [ -d "$WORKFOLDER/libsigrokdecode/build-$ARCH" ]; then # hack .. this gets messed up somehow in docker due to changing files to lowercase git reset --hard @@ -336,4 +338,4 @@ done #create_build_status_file #build_deps #build_scopy # for testing -#package_and_push \ No newline at end of file +#package_and_push diff --git a/mingw_toolchain.sh b/mingw_toolchain.sh index 7eb0a34ccd..c64b6cfc32 100644 --- a/mingw_toolchain.sh +++ b/mingw_toolchain.sh @@ -1,10 +1,10 @@ #!/usr/bin/bash.exe set -ex - export MINGW_VERSION=mingw64 export ARCH=x86_64 -export WORKFOLDER=${PWD} +# get the full directory path of the script +export WORKFOLDER=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) USE_STAGING=$1 STAGING_PREFIX=$2 From bfbe901500309b06239ec090ac52253fa3911b20 Mon Sep 17 00:00:00 2001 From: Bindea Cristian Date: Thu, 20 Jun 2024 16:17:40 +0300 Subject: [PATCH 77/77] ci/windows: add windows files Signed-off-by: Bindea Cristian --- README.md => ci/windows/README.md | 0 build.sh => ci/windows/build.sh | 0 {docker => ci/windows/docker}/Dockerfile | 0 init_staging.sh => ci/windows/init_staging.sh | 0 mingw_toolchain.sh => ci/windows/mingw_toolchain.sh | 0 .../windows/sigrokdecode-windows-fix.patch | 0 6 files changed, 0 insertions(+), 0 deletions(-) rename README.md => ci/windows/README.md (100%) rename build.sh => ci/windows/build.sh (100%) rename {docker => ci/windows/docker}/Dockerfile (100%) rename init_staging.sh => ci/windows/init_staging.sh (100%) rename mingw_toolchain.sh => ci/windows/mingw_toolchain.sh (100%) rename sigrokdecode-windows-fix.patch => ci/windows/sigrokdecode-windows-fix.patch (100%) diff --git a/README.md b/ci/windows/README.md similarity index 100% rename from README.md rename to ci/windows/README.md diff --git a/build.sh b/ci/windows/build.sh similarity index 100% rename from build.sh rename to ci/windows/build.sh diff --git a/docker/Dockerfile b/ci/windows/docker/Dockerfile similarity index 100% rename from docker/Dockerfile rename to ci/windows/docker/Dockerfile diff --git a/init_staging.sh b/ci/windows/init_staging.sh similarity index 100% rename from init_staging.sh rename to ci/windows/init_staging.sh diff --git a/mingw_toolchain.sh b/ci/windows/mingw_toolchain.sh similarity index 100% rename from mingw_toolchain.sh rename to ci/windows/mingw_toolchain.sh diff --git a/sigrokdecode-windows-fix.patch b/ci/windows/sigrokdecode-windows-fix.patch similarity index 100% rename from sigrokdecode-windows-fix.patch rename to ci/windows/sigrokdecode-windows-fix.patch