Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[email protected]_py310 update formula to build on linux #517

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 44 additions & 12 deletions Formula/[email protected]_py310.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class FreecadAT0202Py310 < Formula

Check warning on line 1 in Formula/[email protected]_py310.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-14)

`brew linkage --cached --test --strict freecad/freecad/[email protected]_py310` failed on macOS Sonoma (14) on Apple Silicon!

Indirect dependencies with linkage: freecad/freecad/[email protected] freeimage hdf5 [email protected] tbb

Check warning on line 1 in Formula/[email protected]_py310.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-13)

`brew linkage --cached --test --strict freecad/freecad/[email protected]_py310` failed on macOS Ventura (13)!

Indirect dependencies with linkage: freecad/freecad/[email protected] freeimage hdf5 [email protected] tbb

Check warning on line 1 in Formula/[email protected]_py310.rb

View workflow job for this annotation

GitHub Actions / test-bot (macos-12)

`brew linkage --cached --test --strict freecad/freecad/[email protected]_py310` failed on macOS Monterey (12)!

Indirect dependencies with linkage: freecad/freecad/[email protected] freeimage hdf5 [email protected] tbb
desc "Parametric 3D modeler"
homepage "https://www.freecadweb.org"
url "https://github.com/FreeCAD/FreeCAD/archive/refs/tags/0.20.2.tar.gz"
Expand All @@ -22,7 +22,7 @@
depends_on "hdf5" => :build # requires fortran compiler
# epends_on "llvm" => :build
depends_on "mesa" => :build if OS.linux?
depends_on "ninja" => :build
depends_on "ninja" => :build if OS.linux?
depends_on "pkg-config" => :build
depends_on "[email protected]" => :build
depends_on "tbb" => :build
Expand All @@ -39,7 +39,8 @@
depends_on "freetype"
depends_on "glew"
depends_on "icu4c"
depends_on macos: :high_sierra # no access to sierra test box
depends_on macos: :high_sierra
depends_on "mesa-glu" if OS.linux? # no access to sierra test box
depends_on "openblas"
depends_on "opencascade"
depends_on "orocos-kdl"
Expand Down Expand Up @@ -123,23 +124,26 @@
sha256 "f27576bf167d6989536307dc9ac330a582a0bc3eb69b97c6b2563ea84e93f406"
end

def install

Check warning on line 127 in Formula/[email protected]_py310.rb

View workflow job for this annotation

GitHub Actions / test-bot (ubuntu-22.04)

`brew install --verbose --formula --build-bottle freecad/freecad/[email protected]_py310` failed on Linux!

2_py310-20240605-50190-mubqiu/build -I/home/linuxbrew/.linuxbrew/opt/xerces-c/include -I/tmp/freecadA0.20.2_py310-20240605-50190-mubqiu/build/src -I/tmp/freecadA0.20.2_py310-20240605-50190-mubqiu/FreeCAD-0.20.2/src -I/tmp/freecadA0.20.2_py310-20240605-50190-mubqiu/FreeCAD-0.20.2/src/Gui -I/tmp/freecadA0.20.2_py310-20240605-50190-mubqiu/FreeCAD-0.20.2/src/Gui/Quarter -I/tmp/freecadA0.20.2_py310-20240605-50190-mubqiu/build/src/Gui -I/tmp/freecadA0.20.2_py310-20240605-50190-mubqiu/FreeCAD-0.20.2/src/Gui/.. -I/tmp/freecadA0.20.2_py310-20240605-50190-mubqiu/build/src/Gui/.. -I/tmp/freecadA0.20.2_py310-20240605-50190-mubqiu/build/src/Gui/Language -I/tmp/freecadA0.20.2_py310-20240605-50190-mubqiu/build/src/Gui/propertyeditor -I/tmp/freecadA0.20.2_py310-20240605-50190-mubqiu/build/src/Gui/TaskView -I/tmp/freecadA0.20.2_py310-20240605-50190-mubqiu/build/src/Gui/Quarter -I/tmp/freecadA0.20.2_py310-20240605-50190-mubqiu/build/src/Gui/DAGView -I/home/linuxbrew/.linuxbrew/opt/eigen/include/eigen3 -I/home/linuxbrew/.linuxbrew/Cellar/coin3d_py310/4.0.2/include -I/home/linuxbrew/.linuxbrew/opt/zlib/include -I/home/linuxbrew/.linuxbrew/opt/[email protected]_py310/include/PySide2/QtCore -I/home/linuxbrew/.linuxbrew/opt/[email protected]_py310/include/PySide2/QtGui -I/home/linuxbrew/.linuxbrew/opt/[email protected]_py310/include/PySide2/QtWidgets -isystem /home/linuxbrew/.linuxbrew/Cellar/boost/1.85.0/include -isystem /home/linuxbrew/.linuxbrew/opt/[email protected]/include/python3.10 -isystem /home/linuxbrew/.linuxbrew/opt/qt@5/include -isystem /home/linuxbrew/.linuxbrew/opt/qt@5/include/QtCore -isystem /home/linuxbrew/.linuxbrew/opt/qt@5/./mkspecs/linux-g++ -isystem /home/linuxbrew/.linuxbrew/opt/qt@5/include/QtWidgets -isystem /home/linuxbrew/.linuxbrew/opt/qt@5/include/QtGui -isystem /home/linuxbrew/.linuxbrew/opt/mesa/include -isystem /home/linuxbrew/.linuxbrew/opt/qt@5/include/QtOpenGL -isystem /home/linuxbrew/.linuxbrew/opt/qt@5/include/QtPrintSupport -isystem /home/linuxbrew/.linuxbrew/opt/qt@5/include/QtSvg -isystem /home/linuxbrew/.linuxbrew/opt/qt@5/include/QtNetwork -isystem /home/linuxbrew/.linuxbrew/opt/qt@5/include/QtUiTools -isystem /home/linuxbrew/.linuxbrew/opt/[email protected]_py310/include/shiboken2 -isystem /home/linuxbrew/.linuxbrew/opt/[email protected]_py310/include/PySide2 -isystem /home/linuxbrew/.linuxbrew/opt/qt@5/include/QtXml -Wall -Wextra -Wpedantic -Wno-write-strings -Wno-undefined-var-template -O2 -g -DNDEBUG -std=gnu++17 -fPIC -I/home/linuxbrew/.linuxbrew/opt/open-mpi/include -fPIC -MD -MT src/Gui/CMakeFiles/FreeCADGui.dir/SoFCUnifiedSelection.cpp.o -MF src/Gui/CMakeFiles/FreeCADGui.dir/SoFCUnifiedSelection.cpp.o.d -o src/Gui/CMakeFiles/FreeCADGui.dir/SoFCUnifiedSelection.cpp.o -c /tmp/freecadA0.20.2_py310-20240605-50190-mubqiu/FreeCAD-0.20.2/src/Gui/SoFCUnifiedSelection.cpp In file included from /tmp/freecadA0.20.2_py310-20240605-50190-mubqiu/FreeCAD-0.20.2/src/Gui/SoFCUnifiedSelection.cpp:79: In file included from /tmp/freecadA0.20.2_py310-20240605-50190-mubqiu/FreeCAD-0.20.2/src/Gui/Document.h:33: /tmp/freecadA0.20.2_py310-20240605-50190-mubqiu/FreeCAD-0.20.2/src/Gui/TreeItemMode.h:2:26: warning: invalid UTF-8 in comment [-Winvalid-utf8] 2 | * Copyright (c) 2004 J<FC>rgen Riegel <[email protected]> * | ^ 1 warning generated. ninja: build stopped: subcommand failed. ==> Formula Tap: freecad/freecad Path: /home/linuxbrew/.linuxbrew/Homebrew/Library/Taps/freecad/homebrew-freecad/Formula/[email protected]_py310.rb ==> Configuration HOMEBREW_VERSION: 4.3.3-41-gc2c5eb3 ORIGIN: https://github.com/Homebrew/brew HEAD: c2c5eb3ec321f698246a3e414c680a22b56a755d Last commit: 6 hours ago Core tap JSON: 05 Jun 21:30 UTC HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew HOMEBREW_BOOTSNAP: set HOMEBREW_CACHE: /home/runner/.cache/Homebrew HOMEBREW_CASK_OPTS: [] HOMEBREW_CLEANUP_PERIODIC_FULL_DAYS: 3650 HOMEBREW_COLOR: set HOMEBREW_CURL_PATH: /usr/bin/curl HOMEBREW_FAIL_LOG_LINES: 150 HOMEBREW_GIT_EMAIL: [email protected] HOMEBREW_GIT_NAME: BrewTestBot HOMEBRE
hbp = HOMEBREW_PREFIX

# NOTE: taken from node@14 formula, node uses autoconf and not cmake
# NOTE: ref'd from node@14 formula, node uses autoconf instead of cmake
# make sure subprocesses spawned by make are using our Python 3
#
# NOTE: `which` cmd is not installed by default on some OSes
# ENV["PYTHON"] = which("python3.10")
#
# Get the Python includes directory without duplicates
ENV["PYTHON"] = Formula["[email protected]"].opt_bin/"python3.10"

# Get the Python includes directory without duplicates
py_inc_output = `python3.10-config --includes`
py_inc_dirs = py_inc_output.scan(/-I([^\s]+)/).flatten.uniq
py_inc_dir = py_inc_dirs.join(" ")

py_lib_path = `python3.10-config --configdir`.strip + "/libpython3.10.dylib"
py_lib_path = if OS.mac?
`python3.10-config --configdir`.strip + "/libpython3.10.dylib"
else
`python3.10-config --configdir`.strip + "/libpython3.10.a"
end

puts "--------------------------------------------"
puts "PYTHON=#{ENV["PYTHON"]}"
Expand Down Expand Up @@ -198,6 +202,14 @@
# cmake_prefix_paths << Formula["svn"].prefix
# cmake_prefix_paths << Formula["llvm"].prefix
cmake_prefix_paths << Formula["tbb"].prefix
cmake_prefix_paths << Formula["icu4c"].prefix

if OS.linux?
cmake_prefix_paths << Formula["mesa-glu"].prefix
cmake_prefix_paths << Formula["mesa"].prefix
cmake_prefix_paths << Formula["libx11"].prefix
cmake_prefix_paths << Formula["libxcb"].prefix
end

cmake_prefix_path_string = cmake_prefix_paths.join(";")

Expand Down Expand Up @@ -252,6 +264,30 @@
]
end

if OS.linux?
ninja_bin = Formula["ninja"].opt_bin/"ninja"
clang_cc = Formula["llvm"].opt_bin/"clang"
clang_cxx = Formula["llvm"].opt_bin/"clang++"
clang_ld = Formula["llvm"].opt_bin/"lld"
clang_ar = Formula["llvm"].opt_bin/"llvm-ar"
openglu_inc_dir = Formula["mesa"].opt_include

puts "----------------------------------------------------"
puts openglu_inc_dir
puts "----------------------------------------------------"

args_linux_only = %W[
-GNinja
-DCMAKE_MAKE_PROGRAM=#{ninja_bin}
-DX11_X11_INCLUDE_PATH=#{hbp}/opt/libx11/include/X11
-DCMAKE_C_COMPILER=#{clang_cc}
-DCMAKE_CXX_COMPILER=#{clang_cxx}
-DCMAKE_LINKER=#{clang_ld}
-DCMAKE_AR=#{clang_ar}
-DOPENGL_GLU_INCLUDE_DIR=#{openglu_inc_dir}
]
end

args = %W[
-DHOMEBREW_PREFIX=#{hbp}
-DCMAKE_PREFIX_PATH=#{cmake_prefix_path_string}
Expand Down Expand Up @@ -282,15 +318,11 @@

ENV.remove "CMAKE_FRAMEWORK_PATH", Formula["qt"].opt_prefix/"Frameworks"

# TODO: ipatch, causes audit exception, ie. `brew style freecad/freecad`
# TODO: ipatch, below cause audit exceptions, ie. `brew style freecad/freecad`
# ENV.remove "PATH", Formula["[email protected]"].opt_prefix/"bin"
# ENV.remove "PATH", Formula["[email protected]"].opt_prefix/"libexec/bin"
# ENV.remove "PKG_CONFIG_PATH", Formula["[email protected]"].opt_prefix/"lib/pkgconfig"

# NOTE: ipatch, required for successful build
# ENV.prepend_path "PYTHONPATH", Formula["[email protected]"].opt_prefix/Language::Python.site_packages(python3)
# ENV.prepend_path "PYTHONPATH", Formula["[email protected]"].opt_prefix/Language::Python.site_packages(python3)

# NOTE: ipatch, do not make build dir a sub dir of the src dir
puts "current working directory: #{Dir.pwd}"
src_dir = Dir.pwd.to_s
Expand All @@ -308,7 +340,7 @@
if OS.mac?
system "cmake", *args, *args_macos_only, src_dir.to_s
else
system "cmake", *args, src_dir.to_s
system "cmake", *args, *args_linux_only, src_dir.to_s
end
system "cmake", "--build", build_dir.to_s
system "cmake", "--install", build_dir.to_s
Expand Down
Loading