diff --git a/Aliases/sfml@3 b/Aliases/sfml@3 new file mode 120000 index 0000000000000..483217603bdf4 --- /dev/null +++ b/Aliases/sfml@3 @@ -0,0 +1 @@ +../Formula/s/sfml.rb \ No newline at end of file diff --git a/Formula/c/csfml.rb b/Formula/c/csfml.rb index c5853f413942b..671d39b40ac32 100644 --- a/Formula/c/csfml.rb +++ b/Formula/c/csfml.rb @@ -5,25 +5,24 @@ class Csfml < Formula url "https://github.com/SFML/CSFML/archive/refs/tags/2.6.1.tar.gz" sha256 "f3f3980f6b5cad85b40e3130c10a2ffaaa9e36de5f756afd4aacaed98a7a9b7b" license "Zlib" + revision 1 head "https://github.com/SFML/CSFML.git", branch: "master" bottle do - sha256 cellar: :any, arm64_sequoia: "02e7a77b215a808cd2948b295752ea660f0a9ce2065c4ebae68ff20dbfcf6364" - sha256 cellar: :any, arm64_sonoma: "51106a18de295924740040dfe451298bf81642b99085741ab536200be362a270" - sha256 cellar: :any, arm64_ventura: "49eef8514705e01c7bdaf6fb3c82aacee098eb42bcdbc671a937e100e51dec23" - sha256 cellar: :any, arm64_monterey: "99aa119e5df305ad65af18397978c39e2f2ea88c3aaafbd9e4c62fb92a5e24b0" - sha256 cellar: :any, sonoma: "41a00b5ee1f4c5210ebbf52210c29738921466d3de8c0144a225b47f1376bd0b" - sha256 cellar: :any, ventura: "cf5c4fc6532d7ccd3efe857e3f0bbf472bcb105f38dbf9c58a7cbd2e0a77b4a5" - sha256 cellar: :any, monterey: "517ba2b6d220a8b0a8520959439299feb154edb343fcb7ed2c63842db250ca5e" - sha256 cellar: :any_skip_relocation, x86_64_linux: "a820796c52b40aeab5cd532d5a4eb51920783e5571c5621824b23d0f452947ea" + sha256 cellar: :any, arm64_sequoia: "e1e1172b80909989105f3813e7d1dba2ce0caca2a7efdd2717724e624b7e9cb0" + sha256 cellar: :any, arm64_sonoma: "1a1763c3710588f2e1eff5569802b195f89582cdc9e5dd842cd818135fede023" + sha256 cellar: :any, arm64_ventura: "0f5543e8c4f83ba20d16b986870afdb4d127326e9b4545b2d98bab4430be4000" + sha256 cellar: :any, sonoma: "c63caf00bb7ab923a8d49448b410dd7c269fc1a6e8f194326286d610b972f6af" + sha256 cellar: :any, ventura: "d2d7e9b7eef45f2cd6fa0a48c3f0e606f9690945c8bc7ef396eeeb6640bd62e1" + sha256 cellar: :any_skip_relocation, x86_64_linux: "d4c772a79cfa52cd66d37f85c6964473519693d3661f593ede05b4103ae09983" end depends_on "cmake" => :build - depends_on "sfml" + depends_on "sfml@2" # milestone to support sfml 3.0, https://github.com/SFML/CSFML/milestone/1 def install args = %W[ - -DCMAKE_MODULE_PATH=#{Formula["sfml"].share}/SFML/cmake/Modules/ + -DCMAKE_MODULE_PATH=#{Formula["sfml@2"].share}/SFML/cmake/Modules/ ] system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args diff --git a/Formula/s/sfml.rb b/Formula/s/sfml.rb index 1a60e576923de..a1aff1cca22b5 100644 --- a/Formula/s/sfml.rb +++ b/Formula/s/sfml.rb @@ -2,22 +2,23 @@ class Sfml < Formula # Don't update SFML until there's a corresponding CSFML release desc "Multi-media library with bindings for multiple languages" homepage "https://www.sfml-dev.org/" - url "https://www.sfml-dev.org/files/SFML-2.6.2-sources.zip" - sha256 "19d6dbd9c901c74441d9888c13cb1399f614fe8993d59062a72cfbceb00fed04" + url "https://www.sfml-dev.org/files/SFML-3.0.0-sources.zip" + sha256 "8cc41db46b59f07c44ecf21c74a0f956d37735dec9d90ff4522856cb162ba642" license "Zlib" head "https://github.com/SFML/SFML.git", branch: "master" bottle do - sha256 cellar: :any, arm64_sequoia: "dad951fee57489386b190487b5618f951d8fc6dac4f4dd52b8a6d4803c431312" - sha256 cellar: :any, arm64_sonoma: "1048b1b45f046e04ba0315e2897385975beda5aa9c66c964df3ee934d744b46d" - sha256 cellar: :any, arm64_ventura: "9c017c1f6caf97f54ecc06b9c86ce65a5e3b70ec6a1d2d61c61ddb0e8b2ae255" - sha256 cellar: :any, sonoma: "37ea58ff8e945e950cb4f41c17947ccb09d1f844d2d3b3e2422b3cbefa6d3832" - sha256 cellar: :any, ventura: "e60f193727509cc7f80fb52cc4cb7cfff9df3b86fea68d4322dd3d68ccc4cc79" - sha256 cellar: :any_skip_relocation, x86_64_linux: "266b693f97a6ebffefc662517d1805b2ce00dd6383a9488e4d760d89afc819f5" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "a4f2a550dbf8f0c738a0039806aac58e953715dd805ecca883c592d5a483a055" + sha256 cellar: :any_skip_relocation, arm64_sonoma: "678b1824ead3b9369afab1951dcbcd49615065af6667c1080d9129feafc1ee71" + sha256 cellar: :any_skip_relocation, arm64_ventura: "24af4cff3a8441b1630e4eda8603b610a45d22ab22d11b78d0749ef47b3be276" + sha256 cellar: :any_skip_relocation, sonoma: "4d5cde2d922d35bc77ed993e51785f882fc837e9e5a662462f10870c3f8a595f" + sha256 cellar: :any_skip_relocation, ventura: "4465dd4a2c23ee8ee49005cfe6bb143d1b85b820afef770b31477324de854790" + sha256 cellar: :any_skip_relocation, x86_64_linux: "8af3036c52506067f3418e28926596831d6c304fe06a57318cdb11a1a9d55337" end depends_on "cmake" => :build depends_on "doxygen" => :build + depends_on "pkgconf" => :build depends_on "flac" depends_on "freetype" depends_on "libogg" @@ -26,6 +27,7 @@ class Sfml < Formula on_linux do depends_on "libx11" depends_on "libxcursor" + depends_on "libxi" depends_on "libxrandr" depends_on "mesa" depends_on "mesa-glu" @@ -47,12 +49,12 @@ def install args = ["-DCMAKE_INSTALL_RPATH=#{lib}", "-DSFML_MISC_INSTALL_PREFIX=#{share}/SFML", "-DSFML_INSTALL_PKGCONFIG_FILES=TRUE", - "-DSFML_BUILD_DOC=TRUE"] - - args << "-DSFML_USE_SYSTEM_DEPS=ON" if OS.linux? + "-DSFML_BUILD_DOC=TRUE", + "-DSFML_USE_SYSTEM_DEPS=ON"] system "cmake", "-S", ".", "-B", "build", *std_cmake_args, *args system "cmake", "--build", "build" + system "cmake", "--build", "build", "--target=doc" system "cmake", "--install", "build" end @@ -64,8 +66,8 @@ def install return 0; } CPP - system ENV.cxx, "-I#{include}/SFML/System", testpath/"test.cpp", - "-L#{lib}", "-lsfml-system", "-o", "test" + system ENV.cxx, "-I#{include}/SFML/System", "-std=c++17", testpath/"test.cpp", + "-L#{lib}", "-o", "test" system "./test" end end diff --git a/Formula/s/sfml@2.rb b/Formula/s/sfml@2.rb new file mode 100644 index 0000000000000..8e9276a91a491 --- /dev/null +++ b/Formula/s/sfml@2.rb @@ -0,0 +1,72 @@ +class SfmlAT2 < Formula + desc "Multi-media library with bindings for multiple languages" + homepage "https://www.sfml-dev.org/" + url "https://www.sfml-dev.org/files/SFML-2.6.2-sources.zip" + sha256 "19d6dbd9c901c74441d9888c13cb1399f614fe8993d59062a72cfbceb00fed04" + license "Zlib" + + bottle do + sha256 cellar: :any, arm64_sequoia: "81de83008ed518d05566483013d6bd9fcf2deb990a9c573e196e63d3010cc630" + sha256 cellar: :any, arm64_sonoma: "1a4898bf9ea25abe225a1eb962e24881917c2f849ac8132537eec72b12ad919d" + sha256 cellar: :any, arm64_ventura: "5e5b2f83eec7708a256fab87bc043860b5fc9893acd6e72e016fac2b01f654f7" + sha256 cellar: :any, sonoma: "16a4f0fdc73c761f4559ea19eb8dc5d41436db882b2c38309484212f88e0e2b2" + sha256 cellar: :any, ventura: "6c889bce31b21d4b1c127923f98042b0a37588cc89ae4353ab0a4f9d7deaadea" + sha256 cellar: :any_skip_relocation, x86_64_linux: "14656fa808b17eed41a0dff41bb3d0dd0aacea4d03c8651ebbb8402e9109d507" + end + + keg_only :versioned_formula + + depends_on "cmake" => :build + depends_on "doxygen" => :build + depends_on "flac" + depends_on "freetype" + depends_on "libogg" + depends_on "libvorbis" + + on_linux do + depends_on "libx11" + depends_on "libxcursor" + depends_on "libxrandr" + depends_on "mesa" + depends_on "mesa-glu" + depends_on "openal-soft" + depends_on "systemd" + end + + def install + # Fix "fatal error: 'os/availability.h' file not found" on 10.11 and + # "error: expected function body after function declarator" on 10.12 + # Requires the CLT to be the active developer directory if Xcode is installed + ENV["SDKROOT"] = MacOS.sdk_path if OS.mac? && MacOS.version <= :high_sierra + + # Always remove the "extlibs" to avoid install_name_tool failure + # (https://github.com/Homebrew/homebrew/pull/35279) but leave the + # headers that were moved there in https://github.com/SFML/SFML/pull/795 + rm_r(Dir["extlibs/*"] - ["extlibs/headers"]) + + args = %W[ + -DCMAKE_INSTALL_RPATH=#{lib} + -DSFML_MISC_INSTALL_PREFIX=#{share}/SFML + -DSFML_INSTALL_PKGCONFIG_FILES=TRUE + -DSFML_BUILD_DOC=TRUE + ] + args << "-DSFML_USE_SYSTEM_DEPS=ON" if OS.linux? + + system "cmake", "-S", ".", "-B", "build", *std_cmake_args, *args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + (testpath/"test.cpp").write <<~CPP + #include "SFML/System/Time.hpp" + int main() { + sf::Time t1 = sf::milliseconds(10); + return 0; + } + CPP + + system ENV.cxx, testpath/"test.cpp", "-I#{include}", "-L#{lib}", "-lsfml-system", "-o", "test" + system "./test" + end +end diff --git a/Formula/t/tgui.rb b/Formula/t/tgui.rb index 53ac2ee3e27a9..d34ab0d0d2127 100644 --- a/Formula/t/tgui.rb +++ b/Formula/t/tgui.rb @@ -4,6 +4,7 @@ class Tgui < Formula url "https://github.com/texus/TGUI/archive/refs/tags/v1.7.0.tar.gz" sha256 "7d40359770e2f8e534a57332c99fd56c72cf79a8b59642676e01394fe05cb1fa" license "Zlib" + revision 1 livecheck do url :stable @@ -11,16 +12,16 @@ class Tgui < Formula end bottle do - sha256 cellar: :any, arm64_sequoia: "90d6c28e6b997ca35cdff3fec9d975cb13fabb8d5414d5d3df099017d40178b7" - sha256 cellar: :any, arm64_sonoma: "6788040409873afe34bef9f3c78af753967452644ea81a4b639078a6b803c9d5" - sha256 cellar: :any, arm64_ventura: "8c7f17dc0db7ef819fddc51958ed586c9713a1731933af201c43a20a9d137814" - sha256 cellar: :any, sonoma: "d116111ee1c1d2b1bcdf3156c0537999ddf6a02ef5a1bd36c01e0c95b59666c5" - sha256 cellar: :any, ventura: "15f48330201de8009cb8f79c6d0be0a2bea00d0a0cd21dffb6f77c133297b4b5" - sha256 cellar: :any_skip_relocation, x86_64_linux: "adb09f2ae11fe708c1b9fda03590f2483f490535d9e6572778e10f3996df45a3" + sha256 cellar: :any, arm64_sequoia: "68d876aecf41558861d2e17ff3ea4aded9773977350015de1b9b0f71cf46e8fe" + sha256 cellar: :any, arm64_sonoma: "3a24d3b020a457f65ae2dde489267629d190acf8136f330096daf341d5eace2f" + sha256 cellar: :any, arm64_ventura: "aef7806f9a2d5f54c0c052c5b5b2ae1c9447b0492b362e4d6669f0eabd6a7ab5" + sha256 cellar: :any, sonoma: "4ad63bf9364d7d9b52674b4927448a88a287fcd9d8769fb6daee8f1cac9a3e28" + sha256 cellar: :any, ventura: "5f96c17afffd6e3497c694e864d9202cbbac1abd3923393258ccfc5427fa524d" + sha256 cellar: :any_skip_relocation, x86_64_linux: "f46837a2ada4a9bff27b178d758b8ad2c6c78215f7c25837f64f6f7b356bc463" end depends_on "cmake" => :build - depends_on "sfml" + depends_on "sfml@2" # sfml 3.0 build issue report, https://github.com/texus/TGUI/issues/249 def install args = %W[ @@ -49,8 +50,10 @@ def install return 0; } CPP - system ENV.cxx, "test.cpp", "-std=c++17", "-I#{include}", - "-L#{lib}", "-L#{Formula["sfml"].opt_lib}", + + ENV.append_path "LD_LIBRARY_PATH", Formula["sfml@2"].opt_lib if OS.linux? + system ENV.cxx, "test.cpp", "-std=c++17", "-I#{include}", "-I#{Formula["sfml@2"].opt_include}", + "-L#{lib}", "-L#{Formula["sfml@2"].opt_lib}", "-ltgui", "-lsfml-graphics", "-lsfml-system", "-lsfml-window", "-o", "test" system "./test"