diff --git a/.github/workflows/linux-mingw.yml b/.github/workflows/linux-mingw.yml new file mode 100644 index 0000000..66ec822 --- /dev/null +++ b/.github/workflows/linux-mingw.yml @@ -0,0 +1,31 @@ +name: Linux MinGW + +on: [push, pull_request] + +env: + QTIFWVER: 4.1.0 + ARCH_ROOT_DATE: 2021.05.01 + ARCH_ROOT_URL: https://mirror.rackspace.com/archlinux + NSIS_VERSION: 3.06.1 + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + chmod +x ports/ci/travis/install_deps.sh + ports/ci/travis/install_deps.sh + - name: Build + run: | + chmod +x ports/ci/travis/build.sh + ports/ci/travis/build.sh + - name: Deploy + run: | + chmod +x ports/ci/travis/deploy.sh + ports/ci/travis/deploy.sh + - name: Upload + run: | + chmod +x ports/ci/travis/upload.sh + ports/ci/travis/upload.sh diff --git a/.github/workflows/mac.yml b/.github/workflows/mac.yml new file mode 100644 index 0000000..d46a72c --- /dev/null +++ b/.github/workflows/mac.yml @@ -0,0 +1,28 @@ +name: Mac + +on: [push, pull_request] + +env: + QTIFWVER: 4.1.0 + +jobs: + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v2 + - name: Install dependencies + run: | + chmod +x ports/ci/travis/install_deps.sh + ports/ci/travis/install_deps.sh + - name: Build + run: | + chmod +x ports/ci/travis/build.sh + ports/ci/travis/build.sh + - name: Deploy + run: | + chmod +x ports/ci/travis/deploy.sh + ports/ci/travis/deploy.sh + - name: Upload + run: | + chmod +x ports/ci/travis/upload.sh + ports/ci/travis/upload.sh diff --git a/.github/workflows/windows-msys.yml b/.github/workflows/windows-msys.yml new file mode 100644 index 0000000..c2e6458 --- /dev/null +++ b/.github/workflows/windows-msys.yml @@ -0,0 +1,32 @@ +name: Windows MSYS + +on: [push, pull_request] + +jobs: + build: + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + steps: + - uses: msys2/setup-msys2@v2 + with: + update: true + install: >- + cmake + git + make + pkgconf + python3 + mingw-w64-x86_64-binutils + mingw-w64-i686-binutils + mingw-w64-x86_64-cmake + mingw-w64-i686-cmake + mingw-w64-x86_64-pkgconf + mingw-w64-i686-pkgconf + - name: Build + run: ports/ci/appveyor/build.sh + - name: Deploy + run: ports/ci/appveyor/deploy.sh + - name: Upload + run: ports/ci/appveyor/upload.sh diff --git a/.github/workflows/windows-vs.yml b/.github/workflows/windows-vs.yml new file mode 100644 index 0000000..6059efd --- /dev/null +++ b/.github/workflows/windows-vs.yml @@ -0,0 +1,22 @@ +name: Windows Visual Studio + +on: [push, pull_request] + +env: + CMAKE_GENERATOR: Visual Studio 16 2019 + PYTHON_VERSION: Python39 + +jobs: + build: + runs-on: windows-latest + defaults: + run: + shell: cmd + steps: + - uses: actions/checkout@v2 + - name: Build + run: ports\ci\appveyor\build.bat + - name: Deploy + run: ports\ci\appveyor\deploy.bat + - name: Upload + run: ports\ci\appveyor\upload.bat diff --git a/ports/ci/linux-mingw/build.sh b/ports/ci/linux-mingw/build.sh new file mode 100644 index 0000000..7b3aab6 --- /dev/null +++ b/ports/ci/linux-mingw/build.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +BUILDSCRIPT=dockerbuild.sh +SOURCES_DIR=${PWD} +INSTALL_PREFIX=${SOURCES_DIR}/webcamoid-data + +sudo mount --bind root.x86_64 root.x86_64 +sudo mount --bind "$HOME" "root.x86_64/$HOME" +cat << EOF > ${BUILDSCRIPT} +#!/bin/sh + +export LC_ALL=C +export HOME=$HOME +cd "${SOURCES_DIR}" +echo +echo "Building x64 virtual camera driver" +echo +mkdir build-x64 +cd build-x64 +x86_64-w64-mingw32-cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ + .. +cmake --build . +cd .. +echo +echo "Building x86 virtual camera driver" +echo +mkdir build-x86 +cd build-x86 +i686-w64-mingw32-cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ + .. +cmake --build . +EOF +chmod +x ${BUILDSCRIPT} +sudo cp -vf ${BUILDSCRIPT} "root.x86_64/$HOME/" + +EXEC='sudo ./root.x86_64/bin/arch-chroot root.x86_64' +${EXEC} bash "$HOME/${BUILDSCRIPT}" + +sudo umount "root.x86_64/$HOME" +sudo umount root.x86_64 diff --git a/ports/ci/linux-mingw/deploy.sh b/ports/ci/linux-mingw/deploy.sh new file mode 100644 index 0000000..afc1092 --- /dev/null +++ b/ports/ci/linux-mingw/deploy.sh @@ -0,0 +1,78 @@ +#!/bin/bash + +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +SOURCES_DIR=${PWD} +EXEC='sudo ./root.x86_64/bin/arch-chroot root.x86_64' + +git clone https://github.com/webcamoid/DeployTools.git + +DEPLOYSCRIPT=deployscript.sh + +sudo mount --bind root.x86_64 root.x86_64 +sudo mount --bind "$HOME" "root.x86_64/$HOME" + +cat << EOF > package_info_strip.conf +[System] +stripCmd = x86_64-w64-mingw32-strip +EOF + +cat << EOF > ${DEPLOYSCRIPT} +#!/bin/sh + +export LC_ALL=C +export HOME=${HOME} +export PATH="${SOURCES_DIR}/.local/bin:\$PATH" +export INSTALL_PREFIX="${SOURCES_DIR}/webcamoid-data" +export PACKAGES_DIR="${SOURCES_DIR}/webcamoid-packages" +export PYTHONPATH="${SOURCES_DIR}/DeployTools" +export BUILD_PATH="${SOURCES_DIR}/build-x64" +export WINEPREFIX=/opt/.wine +cd "${SOURCES_DIR}" +EOF + +if [ ! -z "${DAILY_BUILD}" ]; then + cat << EOF >> ${DEPLOYSCRIPT} +export DAILY_BUILD=1 +EOF +fi + +cat << EOF >> ${DEPLOYSCRIPT} +cd build-x64 +cmake --build . --target install +cd .. +cd build-x86 +cmake --build . --target install +cd .. + +i686-w64-mingw32-strip \${INSTALL_PREFIX}/x86/* +x86_64-w64-mingw32-strip \${INSTALL_PREFIX}/x64/* + +python ./DeployTools/deploy.py \ + -d "\${INSTALL_PREFIX}" \ + -c "\${BUILD_PATH}/package_info.conf" \ + -c "./package_info_strip.conf" \ + -o "\${PACKAGES_DIR}" +EOF +chmod +x ${DEPLOYSCRIPT} +sudo cp -vf ${DEPLOYSCRIPT} "root.x86_64/$HOME/" + +${EXEC} bash "$HOME/${DEPLOYSCRIPT}" +sudo umount "root.x86_64/$HOME" +sudo umount root.x86_64 diff --git a/ports/ci/linux-mingw/install_deps.sh b/ports/ci/linux-mingw/install_deps.sh new file mode 100644 index 0000000..bbda9fb --- /dev/null +++ b/ports/ci/linux-mingw/install_deps.sh @@ -0,0 +1,110 @@ +#!/bin/bash + +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +SOURCES_DIR=${PWD} + +if [ ! -z "${USE_WGET}" ]; then + export DOWNLOAD_CMD="wget -nv -c" +else + export DOWNLOAD_CMD="curl --retry 10 -sS -kLOC -" +fi + +EXEC='sudo ./root.x86_64/bin/arch-chroot root.x86_64' + +# Download chroot image +archImage=archlinux-bootstrap-${ARCH_ROOT_DATE}-x86_64.tar.gz +${DOWNLOAD_CMD} "${ARCH_ROOT_URL}/iso/${ARCH_ROOT_DATE}/$archImage" +sudo tar xzf "$archImage" + +# Configure mirrors +cp -vf root.x86_64/etc/pacman.conf . +cat << EOF >> pacman.conf + +[multilib] +Include = /etc/pacman.d/mirrorlist + +[ownstuff] +Server = https://ftp.f3l.de/~martchus/\$repo/os/\$arch +Server = http://martchus.no-ip.biz/repo/arch/\$repo/os/\$arch +EOF +sed -i 's/Required DatabaseOptional/Never/g' pacman.conf +sed -i 's/#TotalDownload/TotalDownload/g' pacman.conf +sudo cp -vf pacman.conf root.x86_64/etc/pacman.conf + +cp -vf root.x86_64/etc/pacman.d/mirrorlist . +cat << EOF >> mirrorlist + +Server = ${ARCH_ROOT_URL}/\$repo/os/\$arch +EOF +sudo cp -vf mirrorlist root.x86_64/etc/pacman.d/mirrorlist + +# Install packages +sudo mkdir -pv "root.x86_64/$HOME" +sudo mount --bind root.x86_64 root.x86_64 +sudo mount --bind "$HOME" "root.x86_64/$HOME" + +${EXEC} pacman-key --init +${EXEC} pacman-key --populate archlinux +${EXEC} pacman -Syu \ + --noconfirm \ + --ignore linux,linux-api-headers,linux-docs,linux-firmware,linux-headers,pacman + +${EXEC} pacman --noconfirm --needed -S \ + ccache \ + clang \ + file \ + git \ + make \ + pkgconf \ + python \ + sed \ + xorg-server-xvfb \ + wine \ + mingw-w64-pkg-config \ + mingw-w64-gcc \ + mingw-w64-cmake + + # Install NSIS + + nsis=nsis-${NSIS_VERSION}-setup.exe + ${DOWNLOAD_CMD} "https://sourceforge.net/projects/nsis/files/NSIS%20${NSIS_VERSION:0:1}/${NSIS_VERSION}/${nsis}" + + if [ -e "${nsis}" ]; then + INSTALLSCRIPT=installscript.sh + + cat << EOF > ${INSTALLSCRIPT} +#!/bin/sh + +export LC_ALL=C +export HOME=$HOME +export WINEPREFIX=/opt/.wine +cd "${SOURCES_DIR}" + +wine ./${nsis} /S +EOF + + chmod +x ${INSTALLSCRIPT} + sudo cp -vf ${INSTALLSCRIPT} "root.x86_64/$HOME/" + ${EXEC} bash "$HOME/${INSTALLSCRIPT}" +fi + +# Finish +sudo umount "root.x86_64/$HOME" +sudo umount root.x86_64 diff --git a/ports/ci/linux-mingw/upload.sh b/ports/ci/linux-mingw/upload.sh new file mode 100644 index 0000000..3853eaf --- /dev/null +++ b/ports/ci/linux-mingw/upload.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +SOURCES_DIR=${PWD} + +if [ ! -z "${USE_WGET}" ]; then + export DOWNLOAD_CMD="wget -nv -c" +else + export DOWNLOAD_CMD="curl --retry 10 -sS -kLOC -" +fi + +if [[ ! -z "$DAILY_BUILD" || ! -z "$RELEASE_BUILD" ]]; then + # Upload to Github Releases + hub=hub-linux-amd64-${GITHUB_HUBVER} + + cd "${SOURCES_DIR}" + ${DOWNLOAD_CMD} "https://github.com/github/hub/releases/download/v${GITHUB_HUBVER}/${hub}.tgz" || true + tar xzf "${hub}.tgz" + mkdir -p .local + cp -rf "${hub}"/* .local/ + + export PATH="${PWD}/.local/bin:${PATH}" + path=webcamoid-packages + + for f in $(find $path -type f); do + hub release edit -m 'Daily Build' -a "$f" daily-build + done +fi diff --git a/ports/ci/mac/build.sh b/ports/ci/mac/build.sh new file mode 100644 index 0000000..4e99fae --- /dev/null +++ b/ports/ci/mac/build.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +BUILDSCRIPT=dockerbuild.sh +SOURCES_DIR=${PWD} +INSTALL_PREFIX=${SOURCES_DIR}/webcamoid-data + +mkdir build +cd build +cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ + .. +cmake --build . diff --git a/ports/ci/mac/deploy.sh b/ports/ci/mac/deploy.sh new file mode 100644 index 0000000..2414f14 --- /dev/null +++ b/ports/ci/mac/deploy.sh @@ -0,0 +1,38 @@ +#!/bin/bash + +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +SOURCES_DIR=${PWD} + +git clone https://github.com/webcamoid/DeployTools.git + +DEPLOYSCRIPT=deployscript.sh + +cd build +cmake --build . --target install +cd .. + +export INSTALL_PREFIX="${SOURCES_DIR}/webcamoid-data" +export PACKAGES_DIR="${SOURCES_DIR}/webcamoid-packages" +export PYTHONPATH="${SOURCES_DIR}/DeployTools" +export BUILD_PATH="${SOURCES_DIR}/build" +python3 ./DeployTools/deploy.py \ + -d "${INSTALL_PREFIX}" \ + -c "${BUILD_PATH}/package_info.conf" \ + -o "${PACKAGES_DIR}" diff --git a/ports/ci/mac/install_deps.sh b/ports/ci/mac/install_deps.sh new file mode 100644 index 0000000..a3bd467 --- /dev/null +++ b/ports/ci/mac/install_deps.sh @@ -0,0 +1,55 @@ +#!/bin/bash + +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +if [ ! -z "${USE_WGET}" ]; then + export DOWNLOAD_CMD="wget -nv -c" +else + export DOWNLOAD_CMD="curl --retry 10 -sS -kLOC -" +fi + +brew update +brew upgrade +brew link --overwrite numpy +brew install \ + ccache \ + cmake \ + p7zip \ + pkg-config \ + python +brew link --overwrite python +brew link python + +# Install Qt Installer Framework +qtIFW=QtInstallerFramework-macOS-x86_64-${QTIFWVER}.dmg +${DOWNLOAD_CMD} "http://download.qt.io/official_releases/qt-installer-framework/${QTIFWVER}/${qtIFW}" || true + +if [ -e "${qtIFW}" ]; then + hdiutil convert "${qtIFW}" -format UDZO -o qtifw + 7z x -oqtifw qtifw.dmg -bb + 7z x -oqtifw qtifw/5.hfsx -bb + installer=qtifw/QtInstallerFramework-macOS-x86_64-${QTIFWVER}/QtInstallerFramework-macOS-x86_64-${QTIFWVER}.app/Contents/MacOS/QtInstallerFramework-macOS-x86_64-${QTIFWVER} + chmod +x "${installer}" + ${installer} \ + --verbose \ + --accept-licenses \ + --accept-messages \ + --confirm-command \ + install +fi diff --git a/ports/ci/mac/upload.sh b/ports/ci/mac/upload.sh new file mode 100644 index 0000000..e03e103 --- /dev/null +++ b/ports/ci/mac/upload.sh @@ -0,0 +1,45 @@ +#!/bin/bash + +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +SOURCES_DIR=${PWD} + +if [ ! -z "${USE_WGET}" ]; then + export DOWNLOAD_CMD="wget -nv -c" +else + export DOWNLOAD_CMD="curl --retry 10 -sS -kLOC -" +fi + +if [[ ! -z "$DAILY_BUILD" || ! -z "$RELEASE_BUILD" ]]; then + # Upload to Github Releases + hub=hub-darwin-amd64-${GITHUB_HUBVER} + + cd "${SOURCES_DIR}" + ${DOWNLOAD_CMD} "https://github.com/github/hub/releases/download/v${GITHUB_HUBVER}/${hub}.tgz" || true + tar xzf "${hub}.tgz" + mkdir -p .local + cp -rf "${hub}"/* .local/ + + export PATH="${PWD}/.local/bin:${PATH}" + path=webcamoid-packages + + for f in $(find $path -type f); do + hub release edit -m 'Daily Build' -a "$f" daily-build + done +fi diff --git a/ports/ci/windows-msys/build.sh b/ports/ci/windows-msys/build.sh new file mode 100644 index 0000000..f166f4b --- /dev/null +++ b/ports/ci/windows-msys/build.sh @@ -0,0 +1,57 @@ +#!/bin/bash + +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +SOURCES_DIR=${PWD} +INSTALL_PREFIX=${SOURCES_DIR}/webcamoid-data +ORIG_PATH=${PATH} + +echo +echo Building x64 virtual camera driver +echo + +mkdir build-x64 +cd build-x64 + +export PATH=/c/msys64/mingw64/bin:/c/msys64/usr/bin:${ORIG_PATH} +cmake ^ + -G "MSYS Makefiles" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ + .. +cmake --build . +cmake --build . --target install + +cd .. + +echo +echo Building x86 virtual camera driver +echo + +mkdir build-x86 +cd build-x86 + +export PATH=/c/msys64/mingw32/bin:/c/msys64/usr/bin:${ORIG_PATH} +cmake ^ + -G "MSYS Makefiles" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="${INSTALL_PREFIX}" \ + .. +cmake --build . +cmake --build . --target install diff --git a/ports/ci/windows-msys/deploy.sh b/ports/ci/windows-msys/deploy.sh new file mode 100644 index 0000000..3e43240 --- /dev/null +++ b/ports/ci/windows-msys/deploy.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +SOURCES_DIR=${PWD} +INSTALL_PREFIX=${SOURCES_DIR}/webcamoid-data +PACKAGES_DIR=${SOURCES_DIR}/webcamoid-packages + +git clone https://github.com/webcamoid/DeployTools.git + +/c/msys64/mingw32/bin/strip "${INSTALL_PREFIX}"/x86/* +/c/msys64/mingw64/bin/strip "${INSTALL_PREFIX}"/x64/* + +PYTHONPATH=${SOURCES_DIR}/DeployTools +BUILD_PATH=${SOURCES_DIR}/build-x64 +python DeployTools/deploy.py \ + -d "${INSTALL_PREFIX}" \ + -c "${BUILD_PATH}\package_info.conf" \ + -o "${PACKAGES_DIR}" diff --git a/ports/ci/windows-msys/upload.sh b/ports/ci/windows-msys/upload.sh new file mode 100644 index 0000000..0f5b2af --- /dev/null +++ b/ports/ci/windows-msys/upload.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +# akvirtualcamera, virtual camera for Mac and Windows. +# Copyright (C) 2021 Gonzalo Exequiel Pedone +# +# akvirtualcamera is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# akvirtualcamera is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with akvirtualcamera. If not, see . +# +# Web-Site: http://webcamoid.github.io/ + +SOURCES_DIR=${PWD} +PACKAGES_DIR=${SOURCES_DIR}/webcamoid-packages + +if [ ! -z "${USE_WGET}" ]; then + export DOWNLOAD_CMD="wget -nv -c" +else + export DOWNLOAD_CMD="curl --retry 10 -sS -kLOC -" +fi + +if [[ ! -z "$DAILY_BUILD" || ! -z "$RELEASE_BUILD" ]]; then + # Upload to Github Releases + hub=hub-windows-amd64-${GITHUB_HUBVER} + + cd "${SOURCES_DIR}" + ${DOWNLOAD_CMD} "https://github.com/github/hub/releases/download/v${GITHUB_HUBVER}/${hub}.zip" || true + unzip "${hub}.zip" + mkdir -p .local + cp -rf "${hub}"/* .local/ + + export PATH="${PWD}/.local/bin:${PATH}" + path=webcamoid-packages + + for f in $(find $path -type f); do + hub release edit -m 'Daily Build' -a "$f" daily-build + done +fi diff --git a/ports/ci/windows-vs/build.bat b/ports/ci/windows-vs/build.bat new file mode 100644 index 0000000..3b07a14 --- /dev/null +++ b/ports/ci/windows-vs/build.bat @@ -0,0 +1,56 @@ +REM akvirtualcamera, virtual camera for Mac and Windows. +REM Copyright (C) 2021 Gonzalo Exequiel Pedone +REM +REM akvirtualcamera is free software: you can redistribute it and/or modify +REM it under the terms of the GNU General Public License as published by +REM the Free Software Foundation, either version 3 of the License, or +REM (at your option) any later version. +REM +REM akvirtualcamera is distributed in the hope that it will be useful, +REM but WITHOUT ANY WARRANTY; without even the implied warranty of +REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +REM GNU General Public License for more details. +REM +REM You should have received a copy of the GNU General Public License +REM along with akvirtualcamera. If not, see . +REM +REM Web-Site: http://webcamoid.github.io/ + +set SOURCES_DIR=%cd% +set INSTALL_PREFIX=%SOURCES_DIR%\webcamoid-data + +echo. +echo Building x64 virtual camera driver +echo. + +mkdir build-x64 +cd build-x64 + +cmake ^ + -G "%CMAKE_GENERATOR%" ^ + -A x64 ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%" ^ + .. +cmake --build . --config Release +cmake --build . --config Release --target install + +cd .. + +echo. +echo Building x86 virtual camera driver +echo. + +mkdir build-x86 +cd build-x86 + +cmake ^ + -G "%CMAKE_GENERATOR%" ^ + -A Win32 ^ + -DCMAKE_BUILD_TYPE=Release ^ + -DCMAKE_INSTALL_PREFIX="%INSTALL_PREFIX%" ^ + .. +cmake --build . --config Release +cmake --build . --config Release --target install + +cd .. diff --git a/ports/ci/windows-vs/deploy.bat b/ports/ci/windows-vs/deploy.bat new file mode 100644 index 0000000..845f599 --- /dev/null +++ b/ports/ci/windows-vs/deploy.bat @@ -0,0 +1,40 @@ +REM akvirtualcamera, virtual camera for Mac and Windows. +REM Copyright (C) 2021 Gonzalo Exequiel Pedone +REM +REM akvirtualcamera is free software: you can redistribute it and/or modify +REM it under the terms of the GNU General Public License as published by +REM the Free Software Foundation, either version 3 of the License, or +REM (at your option) any later version. +REM +REM akvirtualcamera is distributed in the hope that it will be useful, +REM but WITHOUT ANY WARRANTY; without even the implied warranty of +REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +REM GNU General Public License for more details. +REM +REM You should have received a copy of the GNU General Public License +REM along with akvirtualcamera. If not, see . +REM +REM Web-Site: http://webcamoid.github.io/ + +set SOURCES_DIR=%cd% + +if "%PLATFORM%" == "x86" ( + set PYTHON_PATH=C:\%PYTHON_VERSION% +) else ( + set PYTHON_PATH=C:\%PYTHON_VERSION%-x64 +) + +set INSTALL_PREFIX=%SOURCES_DIR%\webcamoid-data +set PACKAGES_DIR=%SOURCES_DIR%\webcamoid-packages + +git clone https://github.com/webcamoid/DeployTools.git + +C:\msys64\mingw32\bin\strip.exe "%INSTALL_PREFIX%"\x86\* +C:\msys64\mingw64\bin\strip.exe "%INSTALL_PREFIX%"\x64\* + +set PYTHONPATH=%cd%\DeployTools +set BUILD_PATH=%cd%\build-x64 +%PYTHON_PATH%\python.exe DeployTools\deploy.py ^ + -d "%INSTALL_PREFIX%" ^ + -c "%BUILD_PATH%\package_info.conf" ^ + -o "%PACKAGES_DIR%" diff --git a/ports/ci/windows-vs/upload.bat b/ports/ci/windows-vs/upload.bat new file mode 100644 index 0000000..5beaecb --- /dev/null +++ b/ports/ci/windows-vs/upload.bat @@ -0,0 +1,47 @@ +REM akvirtualcamera, virtual camera for Mac and Windows. +REM Copyright (C) 2021 Gonzalo Exequiel Pedone +REM +REM akvirtualcamera is free software: you can redistribute it and/or modify +REM it under the terms of the GNU General Public License as published by +REM the Free Software Foundation, either version 3 of the License, or +REM (at your option) any later version. +REM +REM akvirtualcamera is distributed in the hope that it will be useful, +REM but WITHOUT ANY WARRANTY; without even the implied warranty of +REM MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +REM GNU General Public License for more details. +REM +REM You should have received a copy of the GNU General Public License +REM along with akvirtualcamera. If not, see . +REM +REM Web-Site: http://webcamoid.github.io/ + +set SOURCES_DIR=%cd% +set PACKAGES_DIR=%SOURCES_DIR%\webcamoid-packages + +if not "%USE_WGET%" == "" ( + set DOWNLOAD_CMD="wget -nv -c" +) else ( + set DOWNLOAD_CMD="curl --retry 10 -sS -kLOC -" +) + +set upload= +if not "%DAILY_BUILD%" == "" set upload=true +if not "%RELEASE_BUILD%" == "" set upluad=true +if defined upload ( + REM Upload to Github Releases + set hub=hub-windows-amd64-%GITHUB_HUBVER% + + cd "%SOURCES_DIR%" + %DOWNLOAD_CMD% "https://github.com/github/hub/releases/download/v%GITHUB_HUBVER%/%hub%.zip" + unzip "%hub%.zip" + mkdir .local + xcopy "%hub%"\* .local /i /y + + set PATH="%cd%/.local/bin;%PATH%" + set path=webcamoid-packages + + for %%f in (%path%\*) do ( + hub release edit -m "Daily Build" -a %%f daily-build + ) +)