Skip to content

Commit 2e8b347

Browse files
authored
Merge pull request #3 from OpenWebCAD/UseGitAction
update to 7.6.2 and use GitActions
2 parents 1c598d9 + 9fdb527 commit 2e8b347

File tree

10 files changed

+265
-39
lines changed

10 files changed

+265
-39
lines changed

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: [erossignon]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/workflows/workflow.yml

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
# Heavily inspired (i.e. copy/paste) from https://gist.github.com/NickNaso/0d478f1481686d5bcc868cac06620a60
2+
name: CMake Build Matrix
3+
4+
# Controls when the action will run. Triggers the workflow on push
5+
on:
6+
# push:
7+
pull_request:
8+
release:
9+
# tags:
10+
# - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
11+
12+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
13+
jobs:
14+
# This workflow contains a single job called "build"
15+
build:
16+
# The type of runner that the job will run on
17+
name: ${{ matrix.config.name }}
18+
runs-on: ${{ matrix.config.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
config:
23+
- {
24+
name: "Windows Latest MSVC (C++17)",
25+
os: windows-latest,
26+
build_type: "Debug",
27+
cc: "cl",
28+
cxx: "cl",
29+
environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Auxiliary/Build/vcvars64.bat",
30+
generators: "Visual Studio 16 2019"
31+
}
32+
- {
33+
name: "Ubuntu Latest GCC (C++17)",
34+
os: ubuntu-latest,
35+
build_type: "Debug",
36+
cc: "gcc",
37+
cxx: "g++",
38+
generators: "Ninja"
39+
}
40+
- {
41+
name: "macOS Latest Clang (C++17)",
42+
os: macos-latest,
43+
build_type: "Debug",
44+
cc: "clang",
45+
cxx: "clang++",
46+
generators: "Xcode"
47+
}
48+
49+
steps:
50+
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
51+
- uses: actions/checkout@v2
52+
53+
- name: Print env
54+
run: |
55+
echo github.event.action: ${{ github.event.action }}
56+
echo github.event_name: ${{ github.event_name }}
57+
58+
59+
- name: Install dependencies on windows
60+
if: startsWith(matrix.config.os, 'windows')
61+
run: |
62+
choco install ninja cmake
63+
ninja --version
64+
cmake --version
65+
66+
67+
- name: Install dependencies on ubuntu
68+
if: startsWith(matrix.config.name, 'Ubuntu Latest GCC')
69+
run: |
70+
sudo apt-get update
71+
sudo apt-get install ninja-build cmake libtbb-dev g++ libgl1-mesa-dev libxmu-dev libfreetype6-dev libxi-dev libfontconfig1-dev
72+
ninja --version
73+
cmake --version
74+
gcc --version
75+
76+
- name: Install dependencies on macos
77+
if: startsWith(matrix.config.os, 'macos')
78+
run: |
79+
brew install cmake ninja tbb freetype
80+
ninja --version
81+
cmake --version
82+
83+
- name: Build Ubuntu
84+
if: startsWith(matrix.config.name, 'Ubuntu')
85+
shell: bash
86+
run: |
87+
bash ./build_occt.sh
88+
make package
89+
90+
- name: Build MacOS
91+
if: startsWith(matrix.config.name, 'macOS')
92+
shell: bash
93+
run: |
94+
# SKIP for now !
95+
# echo bash ./build_occt.sh
96+
# echo make package
97+
98+
- name: Add msbuild to PATH
99+
if: startsWith(matrix.config.name, 'Windows')
100+
uses: microsoft/[email protected]
101+
102+
- name: Build Windows
103+
if: startsWith(matrix.config.name, 'Windows')
104+
run: |
105+
cmd /k build_occt.bat
106+
107+
- name: Deploy (Windows)
108+
uses: actions/upload-artifact@v3
109+
if: startsWith(matrix.config.name, 'Windows')
110+
with:
111+
name: artifact
112+
path: dist/win64/*
113+
- name: Deploy
114+
uses: actions/upload-artifact@v3
115+
if: startsWith(matrix.config.name, 'Ubuntu')
116+
with:
117+
name: artifact
118+
path: dist/occt-*
119+
120+
- name: Create Release
121+
id: create_release
122+
if: startsWith(github.event.ref, 'refs/tags/v')
123+
uses: actions/create-release@v1
124+
env:
125+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
126+
with:
127+
tag_name: ${{ github.ref }}
128+
release_name: Release ${{ github.ref }}
129+
draft: false
130+
prerelease: false
131+
132+
- name: Upload Release Asset
133+
id: upload-release-asset
134+
if: startsWith(github.event.ref, 'refs/tags/v')
135+
uses: softprops/action-gh-release@v1
136+
env:
137+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
138+
with:
139+
files: |
140+
dist/win64/*.tgz
141+
dist/win64/*.zip
142+
# with:
143+
# upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
144+
# asset_path: dist/win64/
145+
# asset_name: occt-${{github.ref_name}}${{runner.os}}.zip
146+
# asset_content_type: application/zip

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
build/
1+
build*/
22
occt-7*
33
occt7.*
4-
occt*.
4+
occt.*/
55
dist/

Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ prebuild:
22
bash build_occt.sh
33
make:
44
cd build_linux && make -j4
5+
56
install:
67
cd build_linux && ( make install -j4 > /dev/null ) && cd ..
7-
package: install
8-
(export OCCT_VERSION=`ls -d occt-[[:digit:]].[[:digit:]].[[:digit:]]` ; echo "OCCT_VERSION=$${OCCT_VERSION}" ; cd dist && tar -cf $${OCCT_VERSION}-${TRAVIS_OS_NAME}.tgz $${OCCT_VERSION} )
8+
9+
package: install
10+
(export OCCT_VERSION=`ls -d occt-[[:digit:]].[[:digit:]].[[:digit:]]` ; echo "OCCT_VERSION=$${OCCT_VERSION}" ; cd dist && tar -cf $${OCCT_VERSION}-${RUNNER_OS}.tgz $${OCCT_VERSION} )
911
.PHONY: prebuild make install package

README.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# occt_builder
22

33

4-
Learning how to build the Official OpenCascade OCCT at the speed of the light , using Travis and AppVeyor !
5-
6-
[![Travis Build Status](https://travis-ci.org/OpenWebCAD/occt_builder.svg?branch=master)](https://travis-ci.org/OpenWebCAD/occt_builder)
7-
[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/4ml9w8qjhir7m5qt/branch/master?svg=true)](https://ci.appveyor.com/project/erossignon/occt-builder/branch/master)
4+
Learning how to build the Official OpenCascade OCCT at the speed of the light , using GitHub Actions !
85

add_cotire_to_7.6.2.patch

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
diff --git a/adm/MODULES b/adm/MODULES
2+
index 724bf81776..5fb8d61607 100644
3+
--- a/adm/MODULES
4+
+++ b/adm/MODULES
5+
@@ -1,7 +1,7 @@
6+
FoundationClasses TKernel TKMath
7+
ModelingData TKG2d TKG3d TKGeomBase TKBRep
8+
-ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKXMesh TKShHealing
9+
-Visualization TKService TKV3d TKOpenGl TKOpenGles TKMeshVS TKIVtk TKD3DHost
10+
+ModelingAlgorithms TKGeomAlgo TKTopAlgo TKPrim TKBO TKBool TKHLR TKFillet TKOffset TKFeat TKMesh TKShHealing
11+
+Visualization TKV3d TKOpenGl TKMeshVS TKIVtk TKD3DHost
12+
ApplicationFramework TKCDF TKLCAF TKCAF TKBinL TKXmlL TKBin TKXml TKStdL TKStd TKTObj TKBinTObj TKXmlTObj TKVCAF
13+
-DataExchange TKXSBase TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKXCAF TKXDEIGES TKXDESTEP TKSTL TKVRML TKXmlXCAF TKBinXCAF TKRWMesh
14+
+DataExchange TKXSBase TKService TKXCAF TKSTEPBase TKSTEPAttr TKSTEP209 TKSTEP TKIGES TKSTL TKVRML TKRWMesh
15+
Draw TKDraw TKTopTest TKOpenGlTest TKOpenGlesTest TKD3DHostTest TKViewerTest TKXSDRAW TKDCAF TKXDEDRAW TKTObjDRAW TKQADraw TKIVtkDraw DRAWEXE
16+
diff --git a/src/Aspect/Aspect_DisplayConnection.cxx b/src/Aspect/Aspect_DisplayConnection.cxx
17+
index 288c067546..31da4bf7d5 100755
18+
--- a/src/Aspect/Aspect_DisplayConnection.cxx
19+
+++ b/src/Aspect/Aspect_DisplayConnection.cxx
20+
@@ -36,7 +36,7 @@ Aspect_DisplayConnection::Aspect_DisplayConnection()
21+
myIsOwnDisplay = false;
22+
OSD_Environment anEnv ("DISPLAY");
23+
myDisplayName = anEnv.Value();
24+
- Init (NULL);
25+
+ Init ((Aspect_XDisplay*)NULL);
26+
#endif
27+
}
28+
29+
@@ -70,7 +70,7 @@ Aspect_DisplayConnection::Aspect_DisplayConnection (const TCollection_AsciiStrin
30+
myIsOwnDisplay (false)
31+
{
32+
myDisplayName = theDisplayName;
33+
- Init (NULL);
34+
+ Init ((Aspect_XDisplay*)NULL);
35+
}
36+
37+
// =======================================================================
38+
diff --git a/src/Font/Font_FontMgr.cxx b/src/Font/Font_FontMgr.cxx
39+
index 3e31c207eb..9c833d6ba1 100644
40+
--- a/src/Font/Font_FontMgr.cxx
41+
+++ b/src/Font/Font_FontMgr.cxx
42+
@@ -28,6 +28,8 @@
43+
#include <Standard_Type.hxx>
44+
#include <TCollection_HAsciiString.hxx>
45+
46+
+#undef HAVE_FREETYPE
47+
+
48+
#ifdef HAVE_FREETYPE
49+
#include "Font_DejavuSans_Latin_woff.pxx"
50+

build_occt.bat

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
ECHO ON
22

3-
SET OCCT_VER=occt-7.4.0
3+
SET VERSION=7.6.2
4+
SET OCCT_VER=occt-%VERSION%
5+
SET HASH=bb368e271e24f63078129283148ce83db6b9670a
6+
SET HASHL=bb368e2
7+
8+
if exist %VCINSTALLDIR% ( goto skip_vc_install )
9+
CALL "C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Auxiliary/Build/vcvars64.bat"
10+
11+
:skip_vc_install
412

513
SET PLATFORM=win64
614
SET ROOTFOLDER=%~dp0
715
SET ARCHIVE_FOLDER=%ROOTFOLDER%dist\%PLATFORM%
816
SET DISTFOLDER=%ARCHIVE_FOLDER%\%OCCT_VER%
917
SET ARCHIVE=%OCCT_VER%-%PLATFORM%.zip
1018
SET FULL_ARCHIVE=%ARCHIVE_FOLDER%\%ARCHIVE%
19+
SET BUILDFOLDER=build_%OCCT_VER%
20+
set GENERATOR=Visual Studio 16 2019
1121

12-
ECHO ---------------------------------------------------------------------------
13-
ECHO Compiling with Visual Studio 2017 - X64
14-
ECHO ---------------------------------------------------------------------------
15-
SET VSVER=2017
16-
REM CALL "%~dp0"/SETENV.BAT 64
17-
set GENERATOR=Visual Studio 15 2017 Win64
18-
set VisualStudioVersion=15.0
19-
CALL "%VS150COMNTOOLS%\..\..\VC\vcvarsall.bat" amd64
22+
ECHO OFF
2023

2124
ECHO skip downloading if %OCCT_VER% folder exists
2225
if exist %OCCT_VER% ( goto generate_solution )
@@ -26,10 +29,12 @@ ECHO -----------------------------------------------------------------
2629
ECHO DOWNLOADING OFFICIAL OCCT %OCCT_VER% SOURCE
2730
ECHO -----------------------------------------------------------------
2831
ECHO ON
29-
SET SNAPSHOT="http://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=8662560e2c9c83de9ed97b522bebcad2cfc87b92;sf=tgz"
30-
CALL curl -L -o %OCCT_VER%.tgz %SNAPSHOT%
31-
CALL tar -xf %OCCT_VER%.tgz
32-
CALL mv occt-8662560 %OCCT_VER%
32+
SET SNAPSHOT="http://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=%HASH%;sf=tgz"
33+
curl -L -o %OCCT_VER%.tgz %SNAPSHOT%
34+
tar -xf %OCCT_VER%.tgz
35+
36+
:generate_solution1
37+
MOVE occt-%HASHL% %OCCT_VER%
3338

3439

3540
ECHO OFF
@@ -38,7 +43,9 @@ ECHO PATCHING %OCCT_VER% TO SPEEDUP BUILD
3843
ECHO -----------------------------------------------------------------
3944
ECHO ON
4045
CD %OCCT_VER%
41-
CALL patch -p1 < ../add_cotire_to_7.2.0.patch
46+
47+
REM patch -p1 < ../add_cotire_to_%VERSION%.patch
48+
4249
CD %ROOTFOLDER%
4350

4451
:generate_solution
@@ -50,11 +57,11 @@ ECHO -----------------------------------------------------------------
5057
ECHO GENERATING SOLUTION
5158
ECHO -----------------------------------------------------------------
5259
ECHO ON
53-
CALL mkdir build
54-
CALL cd build
60+
mkdir %BUILDFOLDER%
61+
cd %BUILDFOLDER%
5562
ECHO "DISTFOLDER = "%DISTFOLDER%
5663

57-
CALL cmake -INSTALL_DIR:STRING="%DISTFOLDER%" ^
64+
cmake -DINSTALL_DIR:STRING="%DISTFOLDER%" ^
5865
-DCMAKE_INSTALL_PREFIX="%DISTFOLDER%" ^
5966
-DCMAKE_SUPPRESS_REGENERATION:BOOLEAN=OFF ^
6067
-DUSE_TCL:BOOLEAN=OFF ^
@@ -72,9 +79,10 @@ CALL cmake -INSTALL_DIR:STRING="%DISTFOLDER%" ^
7279
-DBUILD_MODULE_ModelingAlgorithms:BOOLEAN=ON ^
7380
-DBUILD_MODULE_ModelingData:BOOLEAN=ON ^
7481
-DBUILD_MODULE_Visualization:BOOLEAN=OFF ^
75-
-G "%GENERATOR%" ^
7682
../%OCCT_VER%
7783

84+
REM -G "%GENERATOR%" ^
85+
7886
ECHO OFF
7987
ECHO -----------------------------------------------------------------
8088
ECHO BUILDING SOLUTION
@@ -84,12 +92,12 @@ SET VERBOSITY=quiet
8492
REM SET VERBOSITY=minimal
8593

8694
REM msbuild /m oce.sln
87-
CALL msbuild /m occt.sln /p:Configuration=Debug /p:Platform="x64" /verbosity:%VERBOSITY% ^
95+
msbuild /m occt.sln /p:Configuration=Debug /p:Platform="x64" /verbosity:%VERBOSITY% ^
8896
/consoleloggerparameters:Summary;ShowTimestamp
8997
ECHO ERROR LEVEL = %ERRORLEVEL%
9098
if NOT '%ERRORLEVEL%'=='0' goto handle_msbuild_error
9199

92-
CALL msbuild /m occt.sln /p:Configuration=Release /p:Platform="x64" /verbosity:%VERBOSITY% ^
100+
msbuild /m occt.sln /p:Configuration=Release /p:Platform="x64" /verbosity:%VERBOSITY% ^
93101
/consoleloggerparameters:Summary;ShowTimestamp
94102
ECHO ERROR LEVEL = %ERRORLEVEL%
95103
if NOT '%ERRORLEVEL%'=='0' goto handle_msbuild_error
@@ -106,17 +114,18 @@ ECHO -----------------------------------------------------------------
106114
ECHO INSTALING TO %DISTFOLDER%
107115
ECHO -----------------------------------------------------------------
108116
ECHO ON
109-
CALL msbuild /m INSTALL.vcxproj /p:Configuration=Release /p:Platform="x64" /verbosity:%VERBOSITY% ^
117+
msbuild /m INSTALL.vcxproj /p:Configuration=Release /p:Platform="x64" /verbosity:%VERBOSITY% ^
110118
/consoleloggerparameters:Summary;ShowTimestamp
111119

112120
ECHO ERROR LEVEL = %ERRORLEVEL%
113121
if NOT '%ERRORLEVEL%'=='0' goto handle_install_error
114122

115123
ECHO OFF
116124
ECHO -----------------------------------------------------------------
117-
ECHO CREATING ARCHIVE %DISTFOLDER%
125+
ECHO CREATING ARCHIVE %DISTFOLDER% %ARCHIVE%
118126
ECHO -----------------------------------------------------------------
119127
ECHO ON
128+
SET PATH=%PATH%;C:\Tools\7-Zip
120129
CD %ARCHIVE_FOLDER%
121130
7z a %ARCHIVE% %OCCT_VER%
122131
CD %ROOTFOLDER%
@@ -133,5 +142,5 @@ exit 0
133142

134143
:handle_install_error
135144
:handle_msbuild_error
145+
ECHO exit 1
136146
exit 1
137-

0 commit comments

Comments
 (0)