Skip to content

Commit

Permalink
Add CI for fritzing app
Browse files Browse the repository at this point in the history
  Use static linking for libgit2 on mac os and linux
  Enable multi core builds
  Generate dmg file in deploy_fritzing_mac script
  Add MSVC2017 target
  Add travis + docker config to build on trusty, bionic
  Add travis config xcode10.1 and xcode10.2
  Add appveyor config to build on MSVC2017
  • Loading branch information
KjellMorgenstern authored and Ovidiu-Florin BOGDAN committed Apr 30, 2019
1 parent 884f9c1 commit cc9d974
Show file tree
Hide file tree
Showing 14 changed files with 243 additions and 26 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
release
debug
core
71 changes: 71 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
23 changes: 23 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -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
27 changes: 27 additions & 0 deletions docker/build_bionic/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 [email protected]

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
27 changes: 27 additions & 0 deletions docker/build_trusty/Dockerfile
Original file line number Diff line number Diff line change
@@ -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 [email protected]

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
18 changes: 18 additions & 0 deletions docker/docker-build.sh
Original file line number Diff line number Diff line change
@@ -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

12 changes: 12 additions & 0 deletions docker/fritzing_bionic/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM registry.gitlab.com/fritzing/fritzing-app_playground/build:bionic

MAINTAINER Kjell [email protected]

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
12 changes: 12 additions & 0 deletions docker/fritzing_trusty/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM registry.gitlab.com/fritzing/fritzing-app_playground/build:trusty

MAINTAINER Kjell [email protected]

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
10 changes: 10 additions & 0 deletions docker/fritzing_trusty/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
set -e

ls
cd /fritzing
qmake phoenix.pro
make

# make test
# echo "Tests ran successful!"
5 changes: 3 additions & 2 deletions phoenix.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -184,7 +185,7 @@ packagesExist(libgit2) {
message($$PKGCONFIG)
}
} else {
include(pri/libgit2detect.pri)
include(pri/libgit2detect.pri)
}


Expand Down
20 changes: 11 additions & 9 deletions pri/libgit2detect.pri
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,35 @@ 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) {
message("found libgit2 library in $$LIBGIT2LIB")
} 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
}
18 changes: 9 additions & 9 deletions tools/deploy_fritzing_mac.sh
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -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!"
17 changes: 11 additions & 6 deletions tools/release_fritzing.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 (
Expand All @@ -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.
Expand Down

0 comments on commit cc9d974

Please sign in to comment.