diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..4090cefaa --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +release +debug +core diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..4a197896a --- /dev/null +++ b/.travis.yml @@ -0,0 +1,71 @@ +matrix: + include: + - os: linux + language: generic + services: + - docker + before_install: + - docker pull registry.gitlab.com/fritzing/fritzing-app_playground/build:trusty + script: + - TARGET=trusty docker/docker-build.sh + + - os: linux + language: generic + services: + - docker + before_install: + - docker pull registry.gitlab.com/fritzing/fritzing-app_playground/build:bionic + script: + - TARGET=bionic docker/docker-build.sh + + - os: osx + language: cpp + osx_image: xcode10.2 + cache: + directories: + ../libgit2/build + + addons: + homebrew: + packages: + - qt5 + + before_install: + - mkdir -p ../libgit2/build + - wget -q -O - https://github.com/libgit2/libgit2/archive/v0.28.1.tar.gz | tar xz && mv libgit2-0.28.1/* ../libgit2/ + - (cd ../libgit2/build && cmake -D BUILD_SHARED_LIBS=OFF .. && cmake --build .) + - (cd src/lib && wget -q -O - https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.bz2 | tar xj) + - xcrun -sdk macosx --show-sdk-path + script: + - tools/deploy_fritzing_mac.sh + + - os: osx + language: objective-c + osx_image: xcode10.1 + cache: + directories: + ../libgit2/build + + addons: + homebrew: + packages: + - qt5 + + before_install: + - mkdir -p ../libgit2/build + - wget -q -O - https://github.com/libgit2/libgit2/archive/v0.28.1.tar.gz | tar xz && mv libgit2-0.28.1/* ../libgit2/ + - (cd ../libgit2/build && cmake -D BUILD_SHARED_LIBS=OFF .. && cmake --build .) + - (cd src/lib && wget -q -O - https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.bz2 | tar xj) + - xcrun -sdk macosx --show-sdk-path + script: + - tools/deploy_fritzing_mac.sh + + + # Fails. We did nor find a good way to install qt and start a developer command prompt yet. + # - os: windows + # language: cpp + # before_install: + # - choco install -y qtcreator + + # script: + # - tools/release_fritzing.bat 0.9.4b 64 2017 diff --git a/README.md b/README.md index bd68ccea8..2a92d2c7d 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,9 @@ +[![Build Status](https://travis-ci.org/fritzing/fritzing-app.svg?branch=master)](https://travis-ci.org/fritzing/fritzing-app) +[![Build status](https://ci.appveyor.com/api/projects/status/0lu0nm71k930nar1/branch/master?svg=true)](https://ci.appveyor.com/project/KjellMorgenstern/fritzing-app/branch/master) + +[![Build Status](https://travis-ci.org/KjellMorgenstern/fritzing-app.svg?branch=travis)](https://travis-ci.org/KjellMorgenstern/fritzing-app) +[![Build status](https://ci.appveyor.com/api/projects/status/0lu0nm71k930nar1/branch/travis?svg=true)](https://ci.appveyor.com/project/KjellMorgenstern/fritzing-app/branch/travis) + # Fritzing The Fritzing application is an Electronic Design Automation software with a low entry barrier, suited for the needs of makers and hobbyists. It offers a unique real-life "breadboard" view, and a parts library with many commonly used high-level components. Fritzing makes it very easy to communicate about circuits, as well as to turn them into PCB layouts ready for production. It is particularly popular among Arduino and Raspberry Pi users, and is widely used in education and creative tinkering. diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..852f68776 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,23 @@ +image: Visual Studio 2017 + +cache: + - ../libgit2/build64 -> appveyor.yml + +install: + - set BOOST_ROOT=C:\Libraries\boost_1_67_0 + - cd .. + - curl -fsSL https://github.com/libgit2/libgit2/archive/maint/v0.28.zip -o libgit2.zip + - 7z x libgit2.zip + - xcopy libgit2-maint-v0.28 libgit2 /c /d /e /h /i /q /s /y + - cd libgit2 + - if not exist build64 mkdir build64 + - cd build64 + - cmake -DBUILD_CLAR=OFF -DTHREADSAFE=ON -G "Visual Studio 15 2017 Win64" .. + - cmake --build . + - cd c:\projects\fritzing-app\src\lib + - curl -fsSL https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.zip -o boost_1_70_0.zip + - 7z x boost_1_70_0.zip + - cd ../.. +build_script: + - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" + - tools/release_fritzing.bat 0.9.4ci 64 2017 diff --git a/docker/build_bionic/Dockerfile b/docker/build_bionic/Dockerfile new file mode 100644 index 000000000..a7353b9c7 --- /dev/null +++ b/docker/build_bionic/Dockerfile @@ -0,0 +1,27 @@ +# A new image must to be pushed, to make changes to this file valid: +# docker build -t registry.gitlab.com/fritzing/fritzing-app_playground/build:bionic docker/build_bionic +# docker push registry.gitlab.com/fritzing/fritzing-app_playground/build:bionic + +FROM ubuntu:bionic-20190307 + +MAINTAINER Kjell kjell@gmx.de + +RUN apt-get update -y && apt-get install -y build-essential cmake wget git libjpeg-dev flex bison libz-dev libpng-dev libncurses5-dev genparse python-dev libssl-dev libudev-dev qt5-default libqt5serialport5-dev libqt5svg5-dev + +ENV BOOST_ROOT /usr/local + +RUN cd /home && wget -q -O - https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.bz2 | tar xj + +RUN cd /home/boost_1_70_0 \ + && ./bootstrap.sh --prefix=${BOOST_ROOT} \ + && ./b2 -j 16 install \ + && cd /home \ + && rm -rf boost_1_70_0 + +RUN cd / && wget -q -O - https://github.com/libgit2/libgit2/archive/v0.28.1.tar.gz | tar xz && mv libgit2-0.28.1 libgit2 + +RUN cd /libgit2 \ + && mkdir build \ + && cd build \ + && cmake -D BUILD_SHARED_LIBS=OFF .. \ + && cmake --build . -- -j16 diff --git a/docker/build_trusty/Dockerfile b/docker/build_trusty/Dockerfile new file mode 100644 index 000000000..75d6a5cc8 --- /dev/null +++ b/docker/build_trusty/Dockerfile @@ -0,0 +1,27 @@ +# A new image must to be pushed, to make changes to this file valid: +# docker build -t registry.gitlab.com/fritzing/fritzing-app_playground/build:trusty docker/build_trusty +# docker push registry.gitlab.com/fritzing/fritzing-app_playground/build:trusty + +FROM ubuntu:trusty-20190305 + +MAINTAINER Kjell kjell@gmx.de + +RUN apt-get update -y && apt-get install -y build-essential cmake wget git libjpeg-dev flex bison libz-dev libpng-dev libncurses5-dev genparse python-dev libssl-dev libudev-dev qt5-default libqt5serialport5-dev libqt5svg5-dev + +ENV BOOST_ROOT /usr/local + +RUN cd /home && wget -q -O - https://dl.bintray.com/boostorg/release/1.70.0/source/boost_1_70_0.tar.bz2 | tar xj + +RUN cd /home/boost_1_70_0 \ + && ./bootstrap.sh --prefix=${BOOST_ROOT} \ + && ./b2 -j 16 install \ + && cd /home \ + && rm -rf boost_1_70_0 + +RUN cd / && wget -q -O - https://github.com/libgit2/libgit2/archive/v0.28.1.tar.gz | tar xz && mv libgit2-0.28.1 libgit2 + +RUN cd /libgit2 \ + && mkdir build \ + && cd build \ + && cmake -D BUILD_SHARED_LIBS=OFF .. \ + && cmake --build . -- -j16 diff --git a/docker/docker-build.sh b/docker/docker-build.sh new file mode 100755 index 000000000..5fb90b588 --- /dev/null +++ b/docker/docker-build.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e + +# Currently supported values for ${TARGET} are 'bionic' or 'trusty' +# pwd should be the repos root. +# +# Example: +# +# /home/user/git/fritzing-app:$ TARGET=trusty ./docker/docker-build.sh +# +# Step 1/7 : FROM registry.gitlab.com/fritzing/fritzing-app_playground/build:trusty +# ---> 2c4428f29501 +# .... + +docker build -t fritzing_${TARGET} docker/fritzing_${TARGET} --build-arg user_id=`id -u` +docker run -v "$(pwd):/fritzing" fritzing_${TARGET} qmake phoenix.pro +docker run -v "$(pwd):/fritzing" fritzing_${TARGET} make -j16 + diff --git a/docker/fritzing_bionic/Dockerfile b/docker/fritzing_bionic/Dockerfile new file mode 100644 index 000000000..6eb0b9f22 --- /dev/null +++ b/docker/fritzing_bionic/Dockerfile @@ -0,0 +1,12 @@ +FROM registry.gitlab.com/fritzing/fritzing-app_playground/build:bionic + +MAINTAINER Kjell kjell@gmx.de + +ARG user_id=1000 +ENV env_user_id=${user_id} + +RUN groupadd -g ${env_user_id} builder && \ + useradd -r -u ${env_user_id} -g builder builder + +USER builder +WORKDIR fritzing diff --git a/docker/fritzing_trusty/Dockerfile b/docker/fritzing_trusty/Dockerfile new file mode 100644 index 000000000..e5241049b --- /dev/null +++ b/docker/fritzing_trusty/Dockerfile @@ -0,0 +1,12 @@ +FROM registry.gitlab.com/fritzing/fritzing-app_playground/build:trusty + +MAINTAINER Kjell kjell@gmx.de + +ARG user_id=1000 +ENV env_user_id=${user_id} + +RUN groupadd -g ${env_user_id} builder && \ + useradd -r -u ${env_user_id} -g builder builder + +USER builder +WORKDIR fritzing diff --git a/docker/fritzing_trusty/docker-entrypoint.sh b/docker/fritzing_trusty/docker-entrypoint.sh new file mode 100644 index 000000000..dd35f8498 --- /dev/null +++ b/docker/fritzing_trusty/docker-entrypoint.sh @@ -0,0 +1,10 @@ +#!/bin/bash +set -e + +ls +cd /fritzing +qmake phoenix.pro +make + +# make test +# echo "Tests ran successful!" diff --git a/phoenix.pro b/phoenix.pro index ac6a8d894..64a376a54 100644 --- a/phoenix.pro +++ b/phoenix.pro @@ -84,7 +84,7 @@ macx { Debug:RCC_DIR = $${DEBDIR} Debug:UI_DIR = $${DEBDIR} - QMAKE_MAC_SDK = macosx10.11 # uncomment/adapt for your version of OSX + #QMAKE_MAC_SDK = macosx10.11 # uncomment/adapt for your version of OSX CONFIG += x86_64 # x86 ppc QMAKE_INFO_PLIST = FritzingInfo.plist #DEFINES += QT_NO_DEBUG # uncomment this for xcode @@ -93,6 +93,7 @@ macx { LIBS += /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation LIBS += /System/Library/Frameworks/Carbon.framework/Carbon LIBS += /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit + LIBS += -liconv } unix { !macx { # unix is defined on mac @@ -184,7 +185,7 @@ packagesExist(libgit2) { message($$PKGCONFIG) } } else { -include(pri/libgit2detect.pri) + include(pri/libgit2detect.pri) } diff --git a/pri/libgit2detect.pri b/pri/libgit2detect.pri index 2b3892338..87a85812d 100644 --- a/pri/libgit2detect.pri +++ b/pri/libgit2detect.pri @@ -28,9 +28,9 @@ INCLUDEPATH += $$LIBGIT2INCLUDE win32 { contains(QMAKE_TARGET.arch, x86_64) { - LIBGIT2LIB = "$$_PRO_FILE_PWD_/../libgit2/build64" + LIBGIT2LIB = "$$_PRO_FILE_PWD_/../libgit2/build64/Debug" } else { - LIBGIT2LIB = "$$_PRO_FILE_PWD_/../libgit2/build32" + LIBGIT2LIB = "$$_PRO_FILE_PWD_/../libgit2/build32/Debug" } exists($$LIBGIT2LIB/git2.lib) { @@ -38,23 +38,25 @@ win32 { } else { error("libgit2 library not found in $$LIBGIT2LIB") } + + LIBS += -L$$LIBGIT2LIB -lgit2 } unix { LIBGIT2LIB = $$_PRO_FILE_PWD_/../libgit2/build macx { - exists($$LIBGIT2LIB/libgit2.dylib) { + exists($$LIBGIT2LIB/libgit2.a) { message("found libgit2 library in $$LIBGIT2LIB") } else { - error("libgit2 library not found in $$LIBGIT2LIB") + error("static libgit2 library not found in $$LIBGIT2LIB") } + LIBS += $$LIBGIT2LIB/libgit2.a /System/Library/Frameworks/Security.framework/Versions/A/Security } else { - exists($$LIBGIT2LIB/libgit2.so) { + exists($$LIBGIT2LIB/libgit2.a) { message("found libgit2 library in $$LIBGIT2LIB") } else { - error("libgit2 library not found in $$LIBGIT2LIB") + error("static libgit2 library not found in $$LIBGIT2LIB") } + LIBS += $$LIBGIT2LIB/libgit2.a -lssl -lcrypto } -} - -LIBS += -L$$LIBGIT2LIB -lgit2 +} \ No newline at end of file diff --git a/tools/deploy_fritzing_mac.sh b/tools/deploy_fritzing_mac.sh index 1af5ad961..2d3442207 100755 --- a/tools/deploy_fritzing_mac.sh +++ b/tools/deploy_fritzing_mac.sh @@ -1,5 +1,5 @@ -#!/bin/bash -QTBIN=/Users/andre/Qt/5.6/clang_64/bin +#!/bin/bash -e +QTBIN=/usr/local/opt/qt5/bin toolsdir=`dirname $BASH_SOURCE` cd $toolsdir @@ -24,10 +24,6 @@ $QTBIN/qmake -o Makefile phoenix.pro make "-j$(sysctl -n machdep.cpu.thread_count)" release # release is the type of build cp -r $builddir/Fritzing.app $deploydir -echo ">> add .app dependencies" -cd $deploydir -$QTBIN/macdeployqt Fritzing.app -verbose=2 - supportdir=$deploydir/Fritzing.app/Contents/MacOS echo ">> support directory" echo $supportdir @@ -38,16 +34,20 @@ cp -rf sketches help translations readme.md LICENSE.CC-BY-SA LICENSE.GPL2 LICENS echo ">> clean translations" cd $supportdir -rm ./translations/*.ts # remove translation xml files, since we only need the binaries in the release +rm -f ./translations/*.ts # remove translation xml files, since we only need the binaries in the release find ./translations -name "*.qm" -size -128c -delete # delete empty translation binaries echo ">> clone parts repository" git clone --branch master --single-branch https://github.com/fritzing/fritzing-parts.git -echo ">> build parts database and run fritzing" +echo ">> build parts database" ./Fritzing -db "fritzing-parts/parts.db" # -pp "fritzing-parts" -f "." +echo ">> add .app dependencies" +cd $deploydir +$QTBIN/macdeployqt Fritzing.app -verbose=2 -dmg + echo ">> launch Fritzing" cd $deploydir -open Fritzing.app +open Fritzing.dmg echo ">> done!" diff --git a/tools/release_fritzing.bat b/tools/release_fritzing.bat index 4c7c6fdef..5224d2a14 100644 --- a/tools/release_fritzing.bat +++ b/tools/release_fritzing.bat @@ -21,17 +21,17 @@ echo. IF .%1 == . ( echo first parameter--release version--is missing, should be something like 0.8.6b - EXIT /B + EXIT /B 1 ) IF .%2 == . ( echo second parameter--target architecture--is missing, should be either "32" for a 32-bit build or "64" for a 64-bit build - EXIT /B + EXIT /B 1 ) IF .%3 == . ( - echo third parameter--visual studio version--is missing, should be "2012", "2013", "2015" - EXIT /B + echo third parameter--visual studio version--is missing, should be "2012", "2013", "2015", "2017" + EXIT /B 1 ) echo add the path for your git installation if it's not already there @@ -45,6 +45,8 @@ IF %2==64 ( set QTBIN=C:\Qt\5.6\msvc2013_64\bin ) ELSE IF %3==2015 ( set QTBIN=C:\Qt\5.6\msvc2015_64\bin + ) ELSE IF %3==2017 ( + set QTBIN=C:\Qt\5.9.7\msvc2017_64\bin ) set arch=""QMAKE_TARGET.arch=x86_64"" ) ELSE ( @@ -55,18 +57,21 @@ IF %2==64 ( set QTBIN=C:\Qt\5.6\msvc2013\bin ) ELSE IF %3==2015 ( set QTBIN=C:\Qt\5.6\msvc2015\bin + ) ELSE IF %3==2017 ( + set QTBIN=C:\Qt\5.9.7\msvc2015\bin ) set arch=. ) ELSE ( echo second parameter--target architecture--should be either "32" for a 32-bit build or "64" for a 64-bit build - EXIT /B + dir C:\Qt + EXIT /B 1 ) ) set QMAKE=%QTBIN%\qmake.exe if not exist %QMAKE% echo '%QMAKE%' not found--please change the path to Qt\bin -if not exist %QMAKE% EXIT /B n +if not exist %QMAKE% EXIT /B 1 echo found qmake.exe echo.