@@ -12,6 +12,9 @@ class Freecad < Formula
12
12
# Should work with OCE (OpenCascade Community Edition) or Open Cascade
13
13
# OCE is the prefered option
14
14
option 'with-opencascade' , 'Build with OpenCascade'
15
+
16
+ # Build without external pivy (use old bundled version)
17
+ option 'without-external-pivy' , 'Build without external Pivy (use old bundled version)'
15
18
16
19
occ_options = [ ]
17
20
if MacOS . version < 10.7
@@ -44,7 +47,12 @@ class Freecad < Formula
44
47
45
48
# Recommended dependencies
46
49
depends_on 'freetype' => :recommended
47
- depends_on 'pivy' => [ :recommended , '--HEAD' ]
50
+
51
+ # v0.14 vs HEAD fixes
52
+ # TODO: When v0.15 is released, these fixes will be removed
53
+ unless build . without? 'external-pivy' or not build . head?
54
+ depends_on 'pivy' => [ :recommended , '--HEAD' ]
55
+ end
48
56
49
57
# Optional Dependencies
50
58
depends_on :x11 => :optional
@@ -54,6 +62,14 @@ def install
54
62
ohai "Creating debugging build..."
55
63
end
56
64
65
+ # v0.14 vs HEAD fixes
66
+ # TODO: When v0.15 is released, these fixes will be removed
67
+ use_external_pivy = 'ON'
68
+ if build . without? 'external-pivy' or not build . head?
69
+ ohai "Building without external Pivy"
70
+ use_external_pivy = 'OFF'
71
+ end
72
+
57
73
# Enable Fortran
58
74
libgfortran = `$FC --print-file-name libgfortran.a` . chomp
59
75
ENV . append 'LDFLAGS' , "-L#{ File . dirname libgfortran } -lgfortran"
@@ -68,6 +84,8 @@ def install
68
84
# TODO add opencascade support/detection
69
85
oce_dir = "#{ Formula [ 'oce' ] . opt_prefix } /OCE.framework/Versions/#{ Formula [ 'oce' ] . version } /Resources"
70
86
87
+ # v0.14 vs HEAD fixes
88
+ # TODO: When v0.15 is released, these fixes will be removed
71
89
# Handle recent CMAKE build prefix changes
72
90
cmake_build_robot_arg = ''
73
91
if build . head?
@@ -85,7 +103,7 @@ def install
85
103
# Set up needed cmake args
86
104
args = std_cmake_args + %W[
87
105
#{ cmake_build_robot_arg }
88
- -DFREECAD_USE_EXTERNAL_PIVY=ON
106
+ -DFREECAD_USE_EXTERNAL_PIVY=#{ use_external_pivy }
89
107
-DPYTHON_LIBRARY=#{ python_library }
90
108
-DPYTHON_INCLUDE_DIR=#{ python_include_dir }
91
109
-DOCE_DIR=#{ oce_dir }
0 commit comments