1 class Widelands < Formula
2 desc "Free real-time strategy game like Settlers II"
3 homepage "https://www.widelands.org/"
4 url "https://github.com/widelands/widelands/archive/refs/tags/v1.2.1.tar.gz"
5 sha256 "799bfd32048ef20118c48e21f3fc843ae0451c42bb8bf2eabcb9b26bf6fe54b4"
6 license "GPL-2.0-or-later"
11 regex(/^v?(\d+(?:\.\d+)+)$/i)
15 sha256 arm64_sequoia: "8f6a42336d2463fa5fb780b1d0a265f58e83c8011f90b635a994b39fe2382c69"
16 sha256 arm64_sonoma: "f81d945d7bdb3961c2c808294496a42d29c78133850e6ff9578451c68524d043"
17 sha256 arm64_ventura: "fde531ff4c5c0bd673dcefdc64caf3598b4c43fdc02b75a93464862054c7f96e"
18 sha256 sonoma: "506d22d26f4c3e2ab5893a116fbbb9a298073ac8fbb66ddb230874c495ff88a9"
19 sha256 ventura: "974a1506ca44d90f468e681ac4f29aed05fd0a2a3847b301600de2fd33c74cf2"
20 sha256 x86_64_linux: "68877518c427d75cf1a45005a2ee32258df2a587eadbfd6429af2626d90c51f7"
23 depends_on "asio" => :build
24 depends_on "cmake" => :build
25 depends_on "doxygen" => :build
26 depends_on "gettext" => :build
27 depends_on "pkgconf" => :build
35 depends_on "sdl2_image"
36 depends_on "sdl2_mixer"
39 uses_from_macos "python" => :build
40 uses_from_macos "zlib"
51 system "cmake", "-S", ".", "-B", "build",
52 "-DWL_INSTALL_BASEDIR=#{pkgshare}",
53 "-DWL_INSTALL_BINDIR=#{bin}",
54 "-DWL_INSTALL_DATADIR=#{pkgshare}/data",
55 "-DOPTION_BUILD_CODECHECK=OFF",
56 "-DOPTION_BUILD_TESTS=OFF",
57 "-DOPTION_BUILD_WEBSITE_TOOLS=OFF",
58 "-DPYTHON_EXECUTABLE=#{which("python3") || which("python")}",
60 system "cmake", "--build", "build"
61 system "cmake", "--install", "build"
66 # Unable to start Widelands, because we were unable to add the home directory:
67 # RealFSImpl::make_directory: No such file or directory: /tmp/widelands-test/.local/share/widelands
68 mkdir_p ".local/share/widelands"
69 mkdir_p ".config/widelands"
72 system bin/"widelands", "--version"