Skip to content

Commit

Permalink
clean up formula a little bit
Browse files Browse the repository at this point in the history
Closes #29.

Signed-off-by: Chris <chris.r.jones.1983@gmail.com>
  • Loading branch information
ipatch committed Nov 1, 2024
1 parent 0994bae commit 800b177
Showing 1 changed file with 4 additions and 24 deletions.
28 changes: 4 additions & 24 deletions Formula/hello_world_opengl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ class HelloWorldOpengl < Formula
depends_on "cmake" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "xorg-server" => :build if OS.linux?
depends_on "glew"
depends_on "glfw"
depends_on "mesa" if OS.linux?
depends_on "mesa-glu"
depends_on "xorg-server" if OS.linux?

# NOTE: ipatch, run below cmd to get latest commit hash to update stable URL
# curl -s "https://api.github.com/gists/8517a5914d56c45b0ebc4dd4df5160c4" | jq -r '.history[0].version'
Expand All @@ -39,19 +39,6 @@ def install
#----
# l $bp/opt/xorg-server/lib/xorg/modules/extensions/libglx.so
#---
# CMake Error at CMakeLists.txt:17 (target_link_libraries):
# Target "hello_world_opengl" links to:
#
# OpenGL::GLU
#
# but the target was not found. Possible reasons include:
#
# * There is a typo in the target name.
# * A find_package call is missing for an IMPORTED target.
# * An ALIAS target is missing.
#
# -- Generating done (0.0s)
# CMake Generate step failed. Build files cannot be regenerated correctly.

# NOTE: ipatch, tshooting oct 27, 2024
# TODO: fill in below dirs
Expand All @@ -74,28 +61,21 @@ def install
else # macos
macos_sdk =
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
macos_opengl_lib =
"#{macos_sdk}/Library/Frameworks/OpenGL.framework/Versions/Current/Libraries/libGL.tbd"

apl_sdk = "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk"
apl_frmwks ="#{apl_sdk}/System/Library/Frameworks"
macos_opengl_lib
macos_frmwks = "#{macos_sdk}/Library/Frameworks"
end

# TODO: remove refs to /library/developer/commandlinetools/
ENV.delete("CMAKE_LIBRARY_PATH")
ENV.delete("CMAKE_INCLUDE_PATH")

# -DOPENGL_GLU_INCLUDE_DIR=#{apl_frmwks}/OpenGL.framework
# -DOPENGL_glu_LIBRARY=#{apl_frmwks}/OpenGL.framework
args_macos_only = %W[
-DOPENGL_INCLUDE_DIR=#{apl_frmwks}/OpenGL.framework
-DOPENGL_gl_LIBRARY=#{apl_frmwks}/OpenGL.framework
-DOPENGL_INCLUDE_DIR=#{macos_frmwks}/OpenGL.framework
-DOPENGL_gl_LIBRARY=#{macos_frmwks}/OpenGL.framework
-DCMAKE_OSX_SYSROOT=#{macos_sdk}
-DCMAKE_IGNORE_PATH=/Library/Developer/CommandLineTools/SDKs
]

cmake_prefix_paths = []
cmake_prefix_paths << Formula["mesa-glu"].prefix
cmake_prefix_path_string = cmake_prefix_paths.join(";")

Expand Down

0 comments on commit 800b177

Please sign in to comment.