Skip to content

Commit 70f0d83

Browse files
committed
Added without-external-pivy option to allow v0.14 to build
1 parent 143eb1b commit 70f0d83

File tree

1 file changed

+20
-2
lines changed

1 file changed

+20
-2
lines changed

freecad.rb

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ class Freecad < Formula
1212
# Should work with OCE (OpenCascade Community Edition) or Open Cascade
1313
# OCE is the prefered option
1414
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)'
1518

1619
occ_options = []
1720
if MacOS.version < 10.7
@@ -44,7 +47,12 @@ class Freecad < Formula
4447

4548
# Recommended dependencies
4649
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
4856

4957
# Optional Dependencies
5058
depends_on :x11 => :optional
@@ -54,6 +62,14 @@ def install
5462
ohai "Creating debugging build..."
5563
end
5664

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+
5773
# Enable Fortran
5874
libgfortran = `$FC --print-file-name libgfortran.a`.chomp
5975
ENV.append 'LDFLAGS', "-L#{File.dirname libgfortran} -lgfortran"
@@ -68,6 +84,8 @@ def install
6884
# TODO add opencascade support/detection
6985
oce_dir = "#{Formula['oce'].opt_prefix}/OCE.framework/Versions/#{Formula['oce'].version}/Resources"
7086

87+
# v0.14 vs HEAD fixes
88+
# TODO: When v0.15 is released, these fixes will be removed
7189
# Handle recent CMAKE build prefix changes
7290
cmake_build_robot_arg = ''
7391
if build.head?
@@ -85,7 +103,7 @@ def install
85103
# Set up needed cmake args
86104
args = std_cmake_args + %W[
87105
#{cmake_build_robot_arg}
88-
-DFREECAD_USE_EXTERNAL_PIVY=ON
106+
-DFREECAD_USE_EXTERNAL_PIVY=#{use_external_pivy}
89107
-DPYTHON_LIBRARY=#{python_library}
90108
-DPYTHON_INCLUDE_DIR=#{python_include_dir}
91109
-DOCE_DIR=#{oce_dir}

0 commit comments

Comments
 (0)