From 715bfa9d073842e4e1be0a9c8121b5523fe66b1f Mon Sep 17 00:00:00 2001 From: Homebrew Mirror Date: Sun, 9 Aug 2026 17:11:13 +0000 Subject: [PATCH] Update Homebrew mirror (bottles/casks sync) --- Casks/claude-code.rb | 36 ++ Casks/codex.rb | 26 + Casks/opencode-desktop.rb | 36 ++ Formula/acl.rb | 76 +++ Formula/ada-url.rb | 88 +++ Formula/alsa-lib.rb | 41 ++ Formula/aom.rb | 63 ++ Formula/brotli.rb | 43 ++ Formula/c-ares.rb | 54 ++ Formula/cairo.rb | 82 +++ Formula/cffi.rb | 64 ++ Formula/cloc.rb | 98 +++ Formula/cryptography.rb | 55 ++ Formula/dav1d.rb | 42 ++ Formula/dbus.rb | 157 +++++ Formula/docker-compose.rb | 52 ++ Formula/ffmpeg.rb | 112 ++++ Formula/flac.rb | 53 ++ Formula/fmt.rb | 49 ++ Formula/fontconfig.rb | 80 +++ Formula/freetype.rb | 51 ++ Formula/fribidi.rb | 32 + Formula/fzf.rb | 59 ++ Formula/gettext.rb | 76 +++ Formula/giflib.rb | 37 ++ Formula/git.rb | 246 ++++++++ Formula/glib.rb | 193 ++++++ Formula/gmp.rb | 86 +++ Formula/gnupg.rb | 110 ++++ Formula/gnutls.rb | 100 +++ Formula/graphite2.rb | 45 ++ Formula/harfbuzz.rb | 66 ++ Formula/hdrhistogram_c.rb | 54 ++ Formula/hermes-agent.rb | 310 ++++++++++ Formula/icu4c@78.rb | 57 ++ Formula/iperf3.rb | 52 ++ Formula/jpeg-turbo.rb | 73 +++ Formula/json-c.rb | 49 ++ Formula/keyutils.rb | 50 ++ Formula/krb5.rb | 68 +++ Formula/lame.rb | 42 ++ Formula/libassuan.rb | 42 ++ Formula/libavif.rb | 69 +++ Formula/libcap.rb | 29 + Formula/libffi.rb | 90 +++ Formula/libgcrypt.rb | 48 ++ Formula/libgpg-error.rb | 42 ++ Formula/libidn2.rb | 78 +++ Formula/libimagequant.rb | 44 ++ Formula/libksba.rb | 51 ++ Formula/liblinear.rb | 52 ++ Formula/libnghttp2.rb | 66 ++ Formula/libnghttp3.rb | 44 ++ Formula/libngtcp2.rb | 235 +++++++ Formula/libnsl.rb | 62 ++ Formula/libogg.rb | 84 +++ Formula/libpng.rb | 67 ++ Formula/libpsl.rb | 63 ++ Formula/libraqm.rb | 45 ++ Formula/libsecret.rb | 84 +++ Formula/libsndfile.rb | 55 ++ Formula/libsoxr.rb | 60 ++ Formula/libssh2.rb | 155 +++++ Formula/libtasn1.rb | 46 ++ Formula/libtiff.rb | 92 +++ Formula/libtirpc.rb | 44 ++ Formula/libtommath.rb | 42 ++ Formula/libtool.rb | 75 +++ Formula/libunistring.rb | 51 ++ Formula/libusb.rb | 51 ++ Formula/libuv.rb | 53 ++ Formula/libvmaf.rb | 48 ++ Formula/libvorbis.rb | 67 ++ Formula/libvpx.rb | 52 ++ Formula/libx11.rb | 78 +++ Formula/libxau.rb | 45 ++ Formula/libxcb.rb | 97 +++ Formula/libxcrypt.rb | 67 ++ Formula/libxcursor.rb | 47 ++ Formula/libxdmcp.rb | 45 ++ Formula/libxext.rb | 46 ++ Formula/libxfixes.rb | 45 ++ Formula/libxi.rb | 51 ++ Formula/libxrandr.rb | 48 ++ Formula/libxrender.rb | 46 ++ Formula/libxscrnsaver.rb | 45 ++ Formula/libxtst.rb | 51 ++ Formula/little-cms2.rb | 44 ++ Formula/llhttp.rb | 59 ++ Formula/llvm.rb | 829 +++++++++++++++++++++++++ Formula/lmdb.rb | 64 ++ Formula/lpeg.rb | 62 ++ Formula/lua.rb | 101 +++ Formula/luajit.rb | 104 ++++ Formula/luv.rb | 81 +++ Formula/lzo.rb | 45 ++ Formula/m4.rb | 32 + Formula/mactop.rb | 37 ++ Formula/merve.rb | 57 ++ Formula/mpg123.rb | 44 ++ Formula/nbytes.rb | 47 ++ Formula/ncdu.rb | 54 ++ Formula/ncurses.rb | 99 +++ Formula/neovim.rb | 172 ++++++ Formula/nettle.rb | 56 ++ Formula/ninja.rb | 50 ++ Formula/nmap.rb | 81 +++ Formula/node.rb | 319 ++++++++++ Formula/npth.rb | 56 ++ Formula/opencode.rb | 43 ++ Formula/openjdk@17.rb | 176 ++++++ Formula/openjpeg.rb | 51 ++ Formula/openssl@4.rb | 120 ++++ Formula/opus.rb | 67 ++ Formula/orc.rb | 48 ++ Formula/p11-kit.rb | 51 ++ Formula/pcre2.rb | 61 ++ Formula/pillow.rb | 114 ++++ Formula/pinentry.rb | 57 ++ Formula/pixman.rb | 50 ++ Formula/pkgconf.rb | 140 +++++ Formula/popt.rb | 87 +++ Formula/pulseaudio.rb | 118 ++++ Formula/pycparser.rb | 35 ++ Formula/pydantic.rb | 68 +++ Formula/python-tk@3.14.rb | 69 +++ Formula/python@3.12.rb | 547 +++++++++++++++++ Formula/python@3.13.rb | 532 ++++++++++++++++ Formula/qwen-code.rb | 43 ++ Formula/ripgrep.rb | 39 ++ Formula/samba.rb | 193 ++++++ Formula/sdl2-compat.rb | 54 ++ Formula/sdl3.rb | 77 +++ Formula/simdjson.rb | 45 ++ Formula/simdutf.rb | 47 ++ Formula/speexdsp.rb | 56 ++ Formula/svt-av1.rb | 50 ++ Formula/systemd.rb | 129 ++++ Formula/talloc.rb | 52 ++ Formula/tcl-tk.rb | 231 +++++++ Formula/tdb.rb | 45 ++ Formula/tevent.rb | 74 +++ Formula/tree-sitter.rb | 66 ++ Formula/tree.rb | 24 + Formula/unibilium.rb | 62 ++ Formula/utf8proc.rb | 41 ++ Formula/util-linux.rb | 143 +++++ Formula/uvwasi.rb | 92 +++ Formula/webp.rb | 49 ++ Formula/wget.rb | 60 ++ Formula/x264.rb | 89 +++ Formula/x265.rb | 90 +++ Formula/xorgproto.rb | 40 ++ Formula/z3.rb | 77 +++ Formula/zoxide.rb | 30 + README.md | 4 +- manifest.json | 1219 ++++++++++++++++++++++++++++++++++++- 157 files changed, 14205 insertions(+), 3 deletions(-) create mode 100644 Casks/claude-code.rb create mode 100644 Casks/codex.rb create mode 100644 Casks/opencode-desktop.rb create mode 100644 Formula/acl.rb create mode 100644 Formula/ada-url.rb create mode 100644 Formula/alsa-lib.rb create mode 100644 Formula/aom.rb create mode 100644 Formula/brotli.rb create mode 100644 Formula/c-ares.rb create mode 100644 Formula/cairo.rb create mode 100644 Formula/cffi.rb create mode 100644 Formula/cloc.rb create mode 100644 Formula/cryptography.rb create mode 100644 Formula/dav1d.rb create mode 100644 Formula/dbus.rb create mode 100644 Formula/docker-compose.rb create mode 100644 Formula/ffmpeg.rb create mode 100644 Formula/flac.rb create mode 100644 Formula/fmt.rb create mode 100644 Formula/fontconfig.rb create mode 100644 Formula/freetype.rb create mode 100644 Formula/fribidi.rb create mode 100644 Formula/fzf.rb create mode 100644 Formula/gettext.rb create mode 100644 Formula/giflib.rb create mode 100644 Formula/git.rb create mode 100644 Formula/glib.rb create mode 100644 Formula/gmp.rb create mode 100644 Formula/gnupg.rb create mode 100644 Formula/gnutls.rb create mode 100644 Formula/graphite2.rb create mode 100644 Formula/harfbuzz.rb create mode 100644 Formula/hdrhistogram_c.rb create mode 100644 Formula/hermes-agent.rb create mode 100644 Formula/icu4c@78.rb create mode 100644 Formula/iperf3.rb create mode 100644 Formula/jpeg-turbo.rb create mode 100644 Formula/json-c.rb create mode 100644 Formula/keyutils.rb create mode 100644 Formula/krb5.rb create mode 100644 Formula/lame.rb create mode 100644 Formula/libassuan.rb create mode 100644 Formula/libavif.rb create mode 100644 Formula/libcap.rb create mode 100644 Formula/libffi.rb create mode 100644 Formula/libgcrypt.rb create mode 100644 Formula/libgpg-error.rb create mode 100644 Formula/libidn2.rb create mode 100644 Formula/libimagequant.rb create mode 100644 Formula/libksba.rb create mode 100644 Formula/liblinear.rb create mode 100644 Formula/libnghttp2.rb create mode 100644 Formula/libnghttp3.rb create mode 100644 Formula/libngtcp2.rb create mode 100644 Formula/libnsl.rb create mode 100644 Formula/libogg.rb create mode 100644 Formula/libpng.rb create mode 100644 Formula/libpsl.rb create mode 100644 Formula/libraqm.rb create mode 100644 Formula/libsecret.rb create mode 100644 Formula/libsndfile.rb create mode 100644 Formula/libsoxr.rb create mode 100644 Formula/libssh2.rb create mode 100644 Formula/libtasn1.rb create mode 100644 Formula/libtiff.rb create mode 100644 Formula/libtirpc.rb create mode 100644 Formula/libtommath.rb create mode 100644 Formula/libtool.rb create mode 100644 Formula/libunistring.rb create mode 100644 Formula/libusb.rb create mode 100644 Formula/libuv.rb create mode 100644 Formula/libvmaf.rb create mode 100644 Formula/libvorbis.rb create mode 100644 Formula/libvpx.rb create mode 100644 Formula/libx11.rb create mode 100644 Formula/libxau.rb create mode 100644 Formula/libxcb.rb create mode 100644 Formula/libxcrypt.rb create mode 100644 Formula/libxcursor.rb create mode 100644 Formula/libxdmcp.rb create mode 100644 Formula/libxext.rb create mode 100644 Formula/libxfixes.rb create mode 100644 Formula/libxi.rb create mode 100644 Formula/libxrandr.rb create mode 100644 Formula/libxrender.rb create mode 100644 Formula/libxscrnsaver.rb create mode 100644 Formula/libxtst.rb create mode 100644 Formula/little-cms2.rb create mode 100644 Formula/llhttp.rb create mode 100644 Formula/llvm.rb create mode 100644 Formula/lmdb.rb create mode 100644 Formula/lpeg.rb create mode 100644 Formula/lua.rb create mode 100644 Formula/luajit.rb create mode 100644 Formula/luv.rb create mode 100644 Formula/lzo.rb create mode 100644 Formula/m4.rb create mode 100644 Formula/mactop.rb create mode 100644 Formula/merve.rb create mode 100644 Formula/mpg123.rb create mode 100644 Formula/nbytes.rb create mode 100644 Formula/ncdu.rb create mode 100644 Formula/ncurses.rb create mode 100644 Formula/neovim.rb create mode 100644 Formula/nettle.rb create mode 100644 Formula/ninja.rb create mode 100644 Formula/nmap.rb create mode 100644 Formula/node.rb create mode 100644 Formula/npth.rb create mode 100644 Formula/opencode.rb create mode 100644 Formula/openjdk@17.rb create mode 100644 Formula/openjpeg.rb create mode 100644 Formula/openssl@4.rb create mode 100644 Formula/opus.rb create mode 100644 Formula/orc.rb create mode 100644 Formula/p11-kit.rb create mode 100644 Formula/pcre2.rb create mode 100644 Formula/pillow.rb create mode 100644 Formula/pinentry.rb create mode 100644 Formula/pixman.rb create mode 100644 Formula/pkgconf.rb create mode 100644 Formula/popt.rb create mode 100644 Formula/pulseaudio.rb create mode 100644 Formula/pycparser.rb create mode 100644 Formula/pydantic.rb create mode 100644 Formula/python-tk@3.14.rb create mode 100644 Formula/python@3.12.rb create mode 100644 Formula/python@3.13.rb create mode 100644 Formula/qwen-code.rb create mode 100644 Formula/ripgrep.rb create mode 100644 Formula/samba.rb create mode 100644 Formula/sdl2-compat.rb create mode 100644 Formula/sdl3.rb create mode 100644 Formula/simdjson.rb create mode 100644 Formula/simdutf.rb create mode 100644 Formula/speexdsp.rb create mode 100644 Formula/svt-av1.rb create mode 100644 Formula/systemd.rb create mode 100644 Formula/talloc.rb create mode 100644 Formula/tcl-tk.rb create mode 100644 Formula/tdb.rb create mode 100644 Formula/tevent.rb create mode 100644 Formula/tree-sitter.rb create mode 100644 Formula/tree.rb create mode 100644 Formula/unibilium.rb create mode 100644 Formula/utf8proc.rb create mode 100644 Formula/util-linux.rb create mode 100644 Formula/uvwasi.rb create mode 100644 Formula/webp.rb create mode 100644 Formula/wget.rb create mode 100644 Formula/x264.rb create mode 100644 Formula/x265.rb create mode 100644 Formula/xorgproto.rb create mode 100644 Formula/z3.rb create mode 100644 Formula/zoxide.rb diff --git a/Casks/claude-code.rb b/Casks/claude-code.rb new file mode 100644 index 0000000..a17c3ea --- /dev/null +++ b/Casks/claude-code.rb @@ -0,0 +1,36 @@ +cask "claude-code" do + arch arm: "arm64", intel: "x64" + os macos: "darwin", linux: "linux" + + version "2.1.220" + sha256 arm: "8addc857f3fe64d5a0368af9ee50321b50afb4a6918ba3ef018ab84f5dbbe081", + x86_64: "dca7be0aa7d3d924836d440e0c6d8e3d47ef3c8e61fa5809b54b9017170ce2f3", + arm64_linux: "159e4a51d796f3bf14677577100f7efb845611b1ceaf0c30cbd8d4650d942185", + x86_64_linux: "674f61f20ff306f3100cf9200e4c36c4b70278b5bef2884549819b942a89c863" + + url "https://homebrew.hyprnet/cask/claude-code/claude", + verified: "downloads.claude.ai/claude-code-releases/" + name "Claude Code" + desc "Terminal-based AI coding assistant" + homepage "https://claude.com/product/claude-code" + + livecheck do + url "https://downloads.claude.ai/claude-code-releases/stable" + regex(/^v?(\d+(?:\.\d+)+)$/i) + end + + conflicts_with cask: "claude-code@latest" + + binary "claude" + + zap trash: [ + "~/.cache/claude", + "~/.claude.json*", + "~/.config/claude", + "~/.local/bin/claude", + "~/.local/share/claude", + "~/.local/state/claude", + "~/Library/Caches/claude-cli-nodejs", + ], + rmdir: "~/.claude" +end diff --git a/Casks/codex.rb b/Casks/codex.rb new file mode 100644 index 0000000..1b65e0b --- /dev/null +++ b/Casks/codex.rb @@ -0,0 +1,26 @@ +cask "codex" do + arch arm: "aarch64", intel: "x86_64" + os macos: "apple-darwin", linux: "unknown-linux-musl" + + version "0.147.0" + sha256 arm: "17b2984eb22b607e3d0c25728252fc90f510e476bad39a6d9f45cdb1aa685432", + intel: "d91e59133daf923bc45d76e3da4af8ae9ef62a0231da18488da0cd573b6e9d63", + arm64_linux: "89cbf79bd5ae6f9c58da47e8079f311c84219350c9c43c070d42f3e9b2a81401", + x86_64_linux: "bd758d53d56e41dc65e045f4589df79a038ed197a011adcb52a258e6ad64cfda" + + url "https://homebrew.hyprnet/cask/codex/codex-package-aarch64-apple-darwin.tar.gz" + name "Codex" + desc "OpenAI's coding agent that runs in your terminal" + homepage "https://github.com/openai/codex" + + livecheck do + url :url + regex(/^rust[._-]v?(\d+(?:\.\d+)+)$/i) + strategy :github_latest + end + + binary "bin/codex" + generate_completions_from_executable "bin/codex", "completion" + + zap rmdir: "~/.codex" +end diff --git a/Casks/opencode-desktop.rb b/Casks/opencode-desktop.rb new file mode 100644 index 0000000..461c6f7 --- /dev/null +++ b/Casks/opencode-desktop.rb @@ -0,0 +1,36 @@ +cask "opencode-desktop" do + arch arm: "arm64", intel: "x64" + + version "1.18.15" + sha256 arm: "2b29de799c37ec7466ba066d291addd7fa49bb45815cad10538adcd4d79aee96", + intel: "f191e75113f7fe0f1618526ed05c55ebb9dc84771983f217304e5c5b09a522e8" + + url "https://homebrew.hyprnet/cask/opencode-desktop/opencode-desktop-mac-arm64.dmg", + verified: "github.com/anomalyco/opencode/" + name "OpenCode" + desc "AI coding agent desktop client" + homepage "https://opencode.ai/" + + livecheck do + url "https://github.com/anomalyco/opencode/releases/latest/download/latest.json" + strategy :json do |json| + json["version"] + end + end + + auto_updates true + depends_on macos: :monterey + + app "OpenCode.app" + + zap trash: [ + "~/Library/Application Support/ai.opencode.desktop", + "~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/ai.opencode.desktop.sfl*", + "~/Library/Caches/ai.opencode.desktop", + "~/Library/HTTPStorages/ai.opencode.desktop", + "~/Library/Logs/ai.opencode.desktop", + "~/Library/Preferences/ai.opencode.desktop.plist", + "~/Library/Saved Application State/ai.opencode.desktop.savedState", + "~/Library/WebKit/ai.opencode.desktop", + ] +end diff --git a/Formula/acl.rb b/Formula/acl.rb new file mode 100644 index 0000000..277fde9 --- /dev/null +++ b/Formula/acl.rb @@ -0,0 +1,76 @@ +class Acl < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "cf320c35f8f78b11ae1d7dfcf0dcc8e4f532755ecb13d346cffa363e5eef7f2b" + end + desc "Commands for manipulating POSIX access control lists" + homepage "https://savannah.nongnu.org/projects/acl/" + url "https://download.savannah.nongnu.org/releases/acl/acl-2.4.0.tar.gz" + sha256 "73c853c3d44e1f693e5a96a986f1bd19d3d0dac2c7d453e796177774bc4e5f6a" + license all_of: ["GPL-2.0-or-later", "LGPL-2.1-or-later"] + + livecheck do + url "https://download.savannah.nongnu.org/releases/acl/" + regex(/href=.*?acl[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "attr" => :build + depends_on :linux + + def install + system "./configure", *std_configure_args, "--disable-silent-rules" + system "make", "install" + end + + test do + assert_equal "getfacl #{version}", shell_output("#{bin}/getfacl --version").chomp + + touch testpath/"test.txt" + chmod 0654, testpath/"test.txt" + assert_equal <<~EOS, shell_output("#{bin}/getfacl --omit-header test.txt").chomp + user::rw- + group::r-x + other::r-- + EOS + + user = ENV["USER"] + system bin/"setfacl", "--modify=u:#{user}:x", "test.txt" + assert_equal <<~EOS, shell_output("#{bin}/getfacl --omit-header test.txt").chomp + user::rw- + user:#{user}:--x + group::r-x + mask::r-x + other::r-- + EOS + + system bin/"chacl", "u::rwx,g::rw-,o::r-x", "test.txt" + assert_equal <<~EOS, shell_output("#{bin}/getfacl --omit-header test.txt").chomp + user::rwx + group::rw- + other::r-x + EOS + + (testpath/"test.c").write <<~C + #include + #include + + int main() { + acl_t acl = acl_get_file("test.txt", ACL_TYPE_ACCESS); + if (acl == NULL) return 1; + char* acl_text = acl_to_text(acl, NULL); + acl_free(acl); + printf("%s\\n", acl_text); + acl_free(acl_text); + return 0; + } + C + system ENV.cc, "test.c", "-o", "test", "-I#{include}", "-L#{lib}", "-lacl" + assert_equal <<~EOS, shell_output("./test").chomp + user::rwx + group::rw- + other::r-x + EOS + end +end diff --git a/Formula/ada-url.rb b/Formula/ada-url.rb new file mode 100644 index 0000000..f10f571 --- /dev/null +++ b/Formula/ada-url.rb @@ -0,0 +1,88 @@ +class AdaUrl < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "06292729cd3fcf7e6b73704be693e10010d8231e54fe26dac091b4f8ee1c547a" + sha256 cellar: :any, arm64_tahoe: "e3b125f42e888b49edb6b7a6b65f47585d7740e170d59965ff96a2930e2c58fd" + sha256 cellar: :any, x86_64_linux: "5d9e6918837a81b750fc65b4f9315e99af2a4d8d31846611b456706adf3115e1" + end + desc "WHATWG-compliant and fast URL parser written in modern C++" + homepage "https://ada-url.com" + url "https://github.com/ada-url/ada/archive/refs/tags/v4.0.0.tar.gz" + sha256 "6d6c7ef7dd2e329320d34eb2ab29ccdc879ee3935af9dfb894a6640e58dc381d" + license any_of: ["Apache-2.0", "MIT"] + compatibility_version 2 + head "https://github.com/ada-url/ada.git", branch: "main" + + + + depends_on "cmake" => :build + depends_on "cxxopts" => :build + depends_on "fmt" + + uses_from_macos "python" => :build + + on_macos do + depends_on "llvm" if DevelopmentTools.clang_build_version <= 1500 + end + + fails_with :clang do + build 1500 + cause "Requires C++20 support" + end + + fails_with :gcc do + version "11" + cause "Requires C++20" + end + + deny_network_access! + + def install + # ld: unknown options: --gc-sections + if OS.mac? && DevelopmentTools.clang_build_version <= 1500 + inreplace "tools/cli/CMakeLists.txt", 'target_link_options(adaparse PRIVATE "-Wl,--gc-sections")', "" + end + # Do not statically link to libstdc++ + inreplace "tools/cli/CMakeLists.txt", 'target_link_options(adaparse PRIVATE "-static-libstdc++")', "" if OS.linux? + + args = %W[ + -DCMAKE_INSTALL_RPATH=#{rpath} + -DBUILD_SHARED_LIBS=ON + -DADA_TOOLS=ON + -DCPM_LOCAL_PACKAGES_ONLY=ON + -DFETCHCONTENT_FULLY_DISCONNECTED=ON + ] + + system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + (testpath/"test.cpp").write <<~CPP + #include "ada.h" + #include + + int main(int , char *[]) { + auto url = ada::parse("https://www.github.com/ada-url/ada"); + url->set_protocol("http"); + std::cout << url->get_protocol() << std::endl; + return EXIT_SUCCESS; + } + CPP + + system ENV.cxx, "test.cpp", "-std=c++20", "-I#{include}", "-L#{lib}", "-lada", "-o", "test" + assert_equal "http:", shell_output("./test").chomp + + if OS.mac? + output = shell_output("#{bin}/adaparse -d http://www.google.com/bal?a==11#fddfds") + else + require "pty" + PTY.spawn(bin/"adaparse", "-d", "http://www.google.com/bal?a==11#fddfds") do |r, _w, pid| + Process.wait(pid) + output = r.read_nonblock(1024) + end + end + assert_match "search_start 25", output + end +end diff --git a/Formula/alsa-lib.rb b/Formula/alsa-lib.rb new file mode 100644 index 0000000..2b8f7cb --- /dev/null +++ b/Formula/alsa-lib.rb @@ -0,0 +1,41 @@ +class AlsaLib < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "4324d90988f149a55f5f00b2990177981677e3edbf3196793fbba3b6ad66675f" + end + desc "Provides audio and MIDI functionality to the Linux operating system" + homepage "https://www.alsa-project.org/" + url "https://www.alsa-project.org/files/pub/lib/alsa-lib-1.2.16.1.tar.bz2" + sha256 "f740db7f488255944ffd4428416ee3390a96742856916433df468c281436480e" + license all_of: ["LGPL-2.1-or-later", "GPL-2.0-or-later"] + compatibility_version 1 + + livecheck do + url "https://www.alsa-project.org/files/pub/lib/" + regex(/href=.*?alsa-lib[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on :linux + + def install + system "./configure", "--disable-silent-rules", *std_configure_args + system "make", "install" + prefix.install "aserver/COPYING" => "COPYING-aserver" + end + + test do + (testpath/"test.c").write <<~C + #include + int main(void) + { + snd_ctl_card_info_t *info; + snd_ctl_card_info_alloca(&info); + return 0; + } + C + system ENV.cc, "test.c", "-L#{lib}", "-lasound", "-o", "test" + system "./test" + end +end diff --git a/Formula/aom.rb b/Formula/aom.rb new file mode 100644 index 0000000..92646c3 --- /dev/null +++ b/Formula/aom.rb @@ -0,0 +1,63 @@ +class Aom < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "9f6b4e0c537a11f17c28133df343f1057bc9d403c697400f199955ec6ff96661" + sha256 cellar: :any, arm64_tahoe: "beaab63a4f1daa53422eff4e1d005b95d2240ddcd3b8bffef91a72a7ed87ade3" + sha256 cellar: :any_skip_relocation, x86_64_linux: "0161fc263c240948a6075475224a8748a3c359ab7f88d88c4a24cf913c8186fd" + end + desc "Codec library for encoding and decoding AV1 video streams" + homepage "https://aomedia.googlesource.com/aom" + url "https://aomedia.googlesource.com/aom.git", + tag: "v3.14.1", + revision: "03087864cf4bea6abb0d28f95cf7843511413d8f" + license "BSD-2-Clause" + head "https://aomedia.googlesource.com/aom.git", branch: "main" + + + + depends_on "cmake" => :build + depends_on "pkgconf" => :build + depends_on "libvmaf" + + on_intel do + depends_on "nasm" => :build + end + + def install + ENV.runtime_cpu_detection + + args = %W[ + -DCMAKE_INSTALL_RPATH=#{rpath} + -DENABLE_DOCS=OFF + -DENABLE_EXAMPLES=ON + -DENABLE_TESTDATA=OFF + -DENABLE_TESTS=OFF + -DENABLE_TOOLS=OFF + -DBUILD_SHARED_LIBS=ON + -DCONFIG_TUNE_VMAF=1 + ] + + system "cmake", "-S", ".", "-B", "brewbuild", *args, *std_cmake_args + system "cmake", "--build", "brewbuild" + system "cmake", "--install", "brewbuild" + end + + test do + resource "homebrew-bus_qcif_15fps.y4m" do + url "https://media.xiph.org/video/derf/y4m/bus_qcif_15fps.y4m" + sha256 "868fc3446d37d0c6959a48b68906486bd64788b2e795f0e29613cbb1fa73480e" + end + + testpath.install resource("homebrew-bus_qcif_15fps.y4m") + + system bin/"aomenc", "--webm", + "--tile-columns=2", + "--tile-rows=2", + "--cpu-used=8", + "--output=bus_qcif_15fps.webm", + "bus_qcif_15fps.y4m" + + system bin/"aomdec", "--output=bus_qcif_15fps_decode.y4m", + "bus_qcif_15fps.webm" + end +end diff --git a/Formula/brotli.rb b/Formula/brotli.rb new file mode 100644 index 0000000..46e7db3 --- /dev/null +++ b/Formula/brotli.rb @@ -0,0 +1,43 @@ +class Brotli < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "b8e388c96be5a63a46e0335c390fecb20dda7adb1368a2ba0209b38cae17c708" + sha256 cellar: :any, arm64_tahoe: "71ffd30ccd74a9f28cfb210c21fcdc1aa5fec79e23ad2264b6dbceb73437601f" + sha256 cellar: :any_skip_relocation, x86_64_linux: "d97618daaa84b66bc783888297f1765eb6f60e6a78e9b7c2ba0406889c159c05" + end + desc "Generic-purpose lossless compression algorithm by Google" + homepage "https://github.com/google/brotli" + url "https://github.com/google/brotli/archive/refs/tags/v1.2.0.tar.gz" + mirror "http://fresh-center.net/linux/misc/brotli-1.2.0.tar.gz" + mirror "http://fresh-center.net/linux/misc/legacy/brotli-1.2.0.tar.gz" + sha256 "816c96e8e8f193b40151dad7e8ff37b1221d019dbcb9c35cd3fadbfe6477dfec" + license "MIT" + compatibility_version 1 + head "https://github.com/google/brotli.git", branch: "master" + + livecheck do + url :stable + regex(/^v?(\d+(?:\.\d+)+)$/i) + end + + + + depends_on "cmake" => :build + + def install + system "cmake", "-S", ".", "-B", "build", "-DCMAKE_INSTALL_RPATH=#{rpath}", *std_cmake_args + system "cmake", "--build", "build", "--verbose" + system "ctest", "--test-dir", "build", "--verbose" + system "cmake", "--install", "build" + system "cmake", "-S", ".", "-B", "build-static", "-DBUILD_SHARED_LIBS=OFF", *std_cmake_args + system "cmake", "--build", "build-static" + lib.install buildpath.glob("build-static/*.a") + end + + test do + (testpath/"file.txt").write("Hello, World!") + system bin/"brotli", "file.txt", "file.txt.br" + system bin/"brotli", "file.txt.br", "--output=out.txt", "--decompress" + assert_equal (testpath/"file.txt").read, (testpath/"out.txt").read + end +end diff --git a/Formula/c-ares.rb b/Formula/c-ares.rb new file mode 100644 index 0000000..515ce02 --- /dev/null +++ b/Formula/c-ares.rb @@ -0,0 +1,54 @@ +class CAres < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "cf56a78a008c16b5b430f5183178b644904fad00a55e6e57a20a835ecc45d33a" + sha256 cellar: :any, arm64_tahoe: "44bcc2e67b97daa265e168281875129161ddbbc964ab16ec0db1846c289cc376" + sha256 cellar: :any, x86_64_linux: "9225a94f66cf37b91f224c3e456d60fc59adfcfc9d28dd3c86966d1be3633687" + end + desc "Asynchronous DNS library" + homepage "https://c-ares.org/" + url "https://github.com/c-ares/c-ares/releases/download/v1.34.8/c-ares-1.34.8.tar.gz" + sha256 "c222b6d681096f9444d2c4863d2c1174019e27cacca0a4a5c114d36dd7d7bf78" + license "MIT" + compatibility_version 1 + head "https://github.com/c-ares/c-ares.git", branch: "main" + + livecheck do + url :homepage + regex(/href=.*?c-ares[._-](\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "cmake" => :build + + def install + args = %W[ + -DCARES_STATIC=ON + -DCARES_SHARED=ON + -DCMAKE_INSTALL_RPATH=#{rpath} + ] + + system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + + int main() + { + ares_library_init(ARES_LIB_INIT_ALL); + ares_library_cleanup(); + return 0; + } + C + system ENV.cc, "test.c", "-L#{lib}", "-lcares", "-o", "test" + system "./test" + + system bin/"ahost", "127.0.0.1" + end +end diff --git a/Formula/cairo.rb b/Formula/cairo.rb new file mode 100644 index 0000000..38609c5 --- /dev/null +++ b/Formula/cairo.rb @@ -0,0 +1,82 @@ +class Cairo < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 2 + sha256 cellar: :any, arm64_sequoia: "91a09ffb4c4025f8204305e25c9d16b5d9e3427c65baabe8a11c7c5e6e07e29e" + sha256 cellar: :any, arm64_tahoe: "3099d9356456b9aced4b35bfb6723c45014c09d7b090190bcd8d17053244dd3c" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "3d852e0bcef8e7bf1f4e5b9defa709da64a2dc2dcef4c35d177cebdbf552e65b" + end + desc "Vector graphics library with cross-device output support" + homepage "https://cairographics.org/" + url "https://cairographics.org/releases/cairo-1.18.4.tar.xz" + sha256 "445ed8208a6e4823de1226a74ca319d3600e83f6369f99b14265006599c32ccb" + license any_of: ["LGPL-2.1-only", "MPL-1.1"] + head "https://gitlab.freedesktop.org/cairo/cairo.git", branch: "master" + + livecheck do + url "https://cairographics.org/releases/?C=M&O=D" + regex(%r{href=(?:["']?|.*?/)cairo[._-]v?(\d+\.\d*[02468](?:\.\d+)*)\.t}i) + end + + + + depends_on "meson" => :build + depends_on "ninja" => :build + depends_on "pkgconf" => [:build, :test] + + depends_on "fontconfig" + depends_on "freetype" + depends_on "glib" + depends_on "libpng" + depends_on "libx11" + depends_on "libxcb" + depends_on "libxext" + depends_on "libxrender" + depends_on "lzo" + depends_on "pixman" + + on_macos do + depends_on "gettext" + end + + on_linux do + depends_on "zlib-ng-compat" + end + + def install + args = %w[ + --default-library=both + -Dfontconfig=enabled + -Dfreetype=enabled + -Dpng=enabled + -Dglib=enabled + -Dxcb=enabled + -Dxlib=enabled + -Dzlib=enabled + -Dglib=enabled + ] + args << "-Dquartz=enabled" if OS.mac? + + system "meson", "setup", "build", *args, *std_meson_args + system "meson", "compile", "-C", "build", "--verbose" + system "meson", "install", "-C", "build" + end + + test do + (testpath/"test.c").write <<~C + #include + + int main(int argc, char *argv[]) { + + cairo_surface_t *surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 600, 400); + cairo_t *context = cairo_create(surface); + + return 0; + } + C + + flags = shell_output("pkgconf --cflags --libs cairo").chomp.split + system ENV.cc, "test.c", "-o", "test", *flags + system "./test" + end +end diff --git a/Formula/cffi.rb b/Formula/cffi.rb new file mode 100644 index 0000000..fa17390 --- /dev/null +++ b/Formula/cffi.rb @@ -0,0 +1,64 @@ +class Cffi < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "c9529601cff7bb2ee4e727b1063cbdef22d975069c7575c6906cfa7bdaa3dcc2" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "a9f59871dac0d694d909c4d953173dff0c3058d99c5d192368a40f07d0e6deb9" + sha256 cellar: :any_skip_relocation, sequoia: "12fbc1cab5b78082948c40d7ff015a910c3ff4013c243423f9b32e02f5f0b18f" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "81811e785c1c31c464b96060339d5d173fc421f39b6cdd537bbef631dcbfabff" + end + desc "C Foreign Function Interface for Python" + homepage "https://cffi.readthedocs.io/en/latest/" + url "https://files.pythonhosted.org/packages/9e/ef/008a1939e372c06329a3fce4279c02f328488f3526744906eeec3da7ad5f/cffi-2.1.1.tar.gz" + sha256 "dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be" + license "MIT-0" + compatibility_version 1 + + + + depends_on "python@3.13" => [:build, :test] + depends_on "python@3.14" => [:build, :test] + depends_on "pycparser" + + uses_from_macos "libffi" + + pypi_packages exclude_packages: "pycparser" + + def pythons + deps.map(&:to_formula) + .select { |f| f.name.start_with?("python@") } + .map { |f| f.opt_libexec/"bin/python" } + end + + def install + pythons.each do |python| + system python, "-m", "pip", "install", *std_pip_args(build_isolation: true), "." + end + end + + test do + assert_empty resources, "This formula should not have any resources!" + (testpath/"sum.c").write <<~C + int sum(int a, int b) { return a + b; } + C + + libsum = testpath/shared_library("libsum") + system ENV.cc, "-shared", "sum.c", "-o", libsum + + (testpath/"sum.py").write <<~PYTHON + from cffi import FFI + ffi = FFI() + + declaration = """ + int sum(int a, int b); + """ + + ffi.cdef(declaration) + lib = ffi.dlopen("#{libsum}") + print(lib.sum(1, 2)) + PYTHON + + pythons.each do |python| + assert_equal 3, shell_output("#{python} sum.py").to_i + end + end +end diff --git a/Formula/cloc.rb b/Formula/cloc.rb new file mode 100644 index 0000000..9c7f3a8 --- /dev/null +++ b/Formula/cloc.rb @@ -0,0 +1,98 @@ +class Cloc < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "4ebeea424f284c38dee5dee3a3a3616a91d12c256e6b15ee7f5b38e459bd93ac" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "4ebeea424f284c38dee5dee3a3a3616a91d12c256e6b15ee7f5b38e459bd93ac" + sha256 cellar: :any_skip_relocation, x86_64_linux: "3b910e0c4b436a259954e56325baf43988867891164b4e4664ee7e87a0ef2256" + end + desc "Statistics utility to count lines of code" + homepage "https://github.com/AlDanial/cloc/" + url "https://github.com/AlDanial/cloc/archive/refs/tags/v2.10.tar.gz" + sha256 "a8fac35f4cf42728765580ba11afc2568ad205509a22204663f526169548436d" + license "GPL-2.0-or-later" + head "https://github.com/AlDanial/cloc.git", branch: "master" + + + + uses_from_macos "perl" + + resource "Regexp::Common" do + url "https://cpan.metacpan.org/authors/id/A/AB/ABIGAIL/Regexp-Common-2024080801.tar.gz" + sha256 "0677afaec8e1300cefe246b4d809e75cdf55e2cc0f77c486d13073b69ab4fbdd" + end + + resource "Algorithm::Diff" do + url "https://cpan.metacpan.org/authors/id/R/RJ/RJBS/Algorithm-Diff-1.201.tar.gz" + sha256 "0022da5982645d9ef0207f3eb9ef63e70e9713ed2340ed7b3850779b0d842a7d" + end + + resource "Parallel::ForkManager" do + url "https://cpan.metacpan.org/authors/id/Y/YA/YANICK/Parallel-ForkManager-2.04.tar.gz" + sha256 "606894fc2e9f7cd13d9ec099aaac103a8f0943d1d80c2c486bae14730a39b7fc" + end + + resource "Sub::Quote" do + url "https://cpan.metacpan.org/authors/id/H/HA/HAARG/Sub-Quote-2.006009.tar.gz" + sha256 "967282d54d2d51b198c67935594f93e4dea3e54d1e5bced158c94e29be868a4b" + end + + resource "Moo::Role" do + url "https://cpan.metacpan.org/authors/id/H/HA/HAARG/Moo-2.005005.tar.gz" + sha256 "fb5a2952649faed07373f220b78004a9c6aba387739133740c1770e9b1f4b108" + end + + resource "Module::Runtime" do + url "https://cpan.metacpan.org/authors/id/H/HA/HAARG/Module-Runtime-0.018.tar.gz" + sha256 "0bf77ef68e53721914ff554eada20973596310b4e2cf1401fc958601807de577" + end + + resource "Role::Tiny" do + url "https://cpan.metacpan.org/authors/id/H/HA/HAARG/Role-Tiny-2.002004.tar.gz" + sha256 "d7bdee9e138a4f83aa52d0a981625644bda87ff16642dfa845dcb44d9a242b45" + end + + resource "Devel::GlobalDestruction" do + on_linux do + url "https://cpan.metacpan.org/authors/id/H/HA/HAARG/Devel-GlobalDestruction-0.14.tar.gz" + sha256 "34b8a5f29991311468fe6913cadaba75fd5d2b0b3ee3bb41fe5b53efab9154ab" + end + end + + resource "Sub::Exporter::Progressive" do + on_linux do + url "https://cpan.metacpan.org/authors/id/F/FR/FREW/Sub-Exporter-Progressive-0.001013.tar.gz" + sha256 "d535b7954d64da1ac1305b1fadf98202769e3599376854b2ced90c382beac056" + end + end + + def install + ENV.prepend_create_path "PERL5LIB", libexec/"lib/perl5" + + # These are shipped as standard with OS X/macOS' default Perl, but + # because upstream has chosen to use "#!/usr/bin/env perl" cloc will + # use whichever Perl is in the PATH, which isn't guaranteed to include + # these modules. Vendor them to be safe. + resources.each do |r| + r.stage do + system "perl", "Makefile.PL", "INSTALL_BASE=#{libexec}" + system "make", "install" + end + end + + system "make", "-C", "Unix", "prefix=#{libexec}", "install" + bin.install libexec/"bin/cloc" + bin.env_script_all_files(libexec/"bin", PERL5LIB: ENV["PERL5LIB"]) + man1.install libexec/"share/man/man1/cloc.1" + end + + test do + (testpath/"test.c").write <<~C + #include + int main(void) { + return 0; + } + C + + assert_match "1,C,0,0,4", shell_output("#{bin}/cloc --csv .") + end +end diff --git a/Formula/cryptography.rb b/Formula/cryptography.rb new file mode 100644 index 0000000..a7b52c2 --- /dev/null +++ b/Formula/cryptography.rb @@ -0,0 +1,55 @@ +class Cryptography < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "4d5ae554fdd4a50163aeea97cbb383b6bfdfedd60e53c3f7971a8c9d685e7a57" + sha256 cellar: :any, arm64_tahoe: "1c0d605396f75648f713e109c6b58df9e2aa8d83691ac85524acf2f5577766f4" + sha256 cellar: :any, x86_64_linux: "2ad80d50545b09490aa1a0b7a805a96fc3465bcc5d84193ef731dc79745292b0" + end + desc "Cryptographic recipes and primitives for Python" + homepage "https://cryptography.io/en/latest/" + url "https://files.pythonhosted.org/packages/de/41/6cbdcf9142d00fe82836fbb51e503e58088575cf7a0fe1dbff6695bf0840/cryptography-50.0.0.tar.gz" + sha256 "eeac2acb5a20ed25e0ad6d1df9891a520b78b404266b6d11778f25d5d691a6c9" + license any_of: ["Apache-2.0", "BSD-3-Clause"] + compatibility_version 2 + head "https://github.com/pyca/cryptography.git", branch: "main" + + + + depends_on "maturin" => :build + depends_on "pkgconf" => :build + depends_on "python-setuptools" => :build + depends_on "python@3.13" => [:build, :test] + depends_on "python@3.14" => [:build, :test] + depends_on "rust" => :build + depends_on "cffi" + depends_on "openssl@3" + + pypi_packages exclude_packages: ["cffi", "pycparser"] + + def pythons + deps.map(&:to_formula) + .select { |f| f.name.start_with?("python@") } + .map { |f| f.opt_libexec/"bin/python" } + end + + def install + # TODO: Avoid building multiple times as binaries are already built in limited API mode + pythons.each do |python3| + system python3, "-m", "pip", "install", *std_pip_args, "." + end + end + + test do + (testpath/"test.py").write <<~PYTHON + from cryptography.fernet import Fernet + key = Fernet.generate_key() + f = Fernet(key) + token = f.encrypt(b"homebrew") + print(f.decrypt(token)) + PYTHON + + pythons.each do |python3| + assert_match "b'homebrew'", shell_output("#{python3} test.py") + end + end +end diff --git a/Formula/dav1d.rb b/Formula/dav1d.rb new file mode 100644 index 0000000..61ecdaa --- /dev/null +++ b/Formula/dav1d.rb @@ -0,0 +1,42 @@ +class Dav1d < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "5f573db161c0685ba7e8d27bd3b6a494e6952e47c7c99355a0d090b253b566af" + sha256 cellar: :any, arm64_tahoe: "d30ff747564febd643ec4b279c5adc74f708b8d6eb8e172f914b9fcdec26c464" + sha256 cellar: :any, x86_64_linux: "6c978ac8a5eb6652bd8780911ff45d73a181e6c6a9f18d60f1c7f86184d4bdb2" + end + desc "AV1 decoder targeted to be small and fast" + homepage "https://code.videolan.org/videolan/dav1d" + url "https://code.videolan.org/videolan/dav1d/-/archive/1.5.4/dav1d-1.5.4.tar.bz2" + sha256 "2abfb0c89212e6e4733a54e0ae509ec00a5b845a6360946f918806e14aedb011" + license "BSD-2-Clause" + compatibility_version 1 + + + + depends_on "meson" => :build + depends_on "ninja" => :build + + on_intel do + depends_on "nasm" => :build + end + + def install + system "meson", "setup", "build", *std_meson_args + system "meson", "compile", "-C", "build", "--verbose" + system "meson", "install", "-C", "build" + end + + test do + resource "homebrew-00000000.ivf" do + url "https://code.videolan.org/videolan/dav1d-test-data/raw/1.1.0/8-bit/data/00000000.ivf" + sha256 "52b4351f9bc8a876c8f3c9afc403d9e90f319c1882bfe44667d41c8c6f5486f3" + end + + testpath.install resource("homebrew-00000000.ivf") + system bin/"dav1d", "-i", testpath/"00000000.ivf", "-o", testpath/"00000000.md5" + + assert_path_exists (testpath/"00000000.md5") + assert_match "0b31f7ae90dfa22cefe0f2a1ad97c620", (testpath/"00000000.md5").read + end +end diff --git a/Formula/dbus.rb b/Formula/dbus.rb new file mode 100644 index 0000000..1c389b7 --- /dev/null +++ b/Formula/dbus.rb @@ -0,0 +1,157 @@ +class Dbus < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "5a51451acabb5ae56b5682e88a82dfa43cc6a2b653ca068198546bb72324bd0c" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "708eed3cc7031e486c760cc9debe777b7e8de93faf74320b66d3bc42e27499c3" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "42841a5373f596cbccd52b4cf3eae4f3ec6a853309b14e36e869a7030fabd21a" + end + # releases: even (1.12.x) = stable, odd (1.13.x) = development + desc "Message bus system, providing inter-application communication" + homepage "https://wiki.freedesktop.org/www/Software/dbus" + url "https://dbus.freedesktop.org/releases/dbus/dbus-1.16.2.tar.xz" + mirror "https://deb.debian.org/debian/pool/main/d/dbus/dbus_1.16.2.orig.tar.xz" + sha256 "0ba2a1a4b16afe7bceb2c07e9ce99a8c2c3508e5dec290dbb643384bd6beb7e2" + license any_of: ["AFL-2.1", "GPL-2.0-or-later"] + revision 1 + compatibility_version 1 + head "https://gitlab.freedesktop.org/dbus/dbus.git", branch: "main" + + livecheck do + url "https://dbus.freedesktop.org/releases/dbus/" + regex(/href=.*?dbus[._-]v?(\d+\.\d*?[02468](?:\.\d+)*)\.t/i) + end + + + + depends_on "docbook" => :build + depends_on "docbook-xsl" => :build + depends_on "meson" => :build + depends_on "ninja" => :build + depends_on "pkgconf" => :build + depends_on "xmlto" => :build + + uses_from_macos "libxslt" => :build # for xsltproc + uses_from_macos "python" => :build + uses_from_macos "expat" + + # Remove deprecated keys from launchd plist. + # PR ref: https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/179 + patch :DATA + + def install + # Fix the TMPDIR to one D-Bus doesn't reject due to odd symbols + ENV["TMPDIR"] = "/tmp" + ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog" + + args = %W[ + -Dlocalstatedir=#{var} + -Dsysconfdir=#{etc} + -Dxml_docs=enabled + -Ddoxygen_docs=disabled + -Dmodular_tests=disabled + ] + + args << "-Dlaunchd_agent_dir=#{prefix}" << "-Ddbus_user=daemon" if OS.mac? + inreplace "bus/org.freedesktop.dbus-session.plist.in", "@DBUS_DAEMONDIR@", opt_bin + + # rpath is not set for meson build + ENV.append "LDFLAGS", "-Wl,-rpath,#{lib}" + + system "meson", "setup", "build", *args, *std_meson_args + system "meson", "compile", "-C", "build", "--verbose" + system "meson", "install", "-C", "build" + + # Manually create plist for system bus service + (prefix/"org.freedesktop.dbus-system.plist").write system_plist if OS.mac? + mkdir etc/"dbus-1/system.d" + mkdir etc/"dbus-1/session.d" + end + + post_install_steps do + run "dbus-uuidgen", args: ["--ensure={{var}}/lib/dbus/machine-id"], base: :bin + end + + def caveats + on_macos do + <<~EOS + To start the session bus now and at login: + + brew services start dbus + + To start the system bus now and on boot, install and activate the included daemon: + + sudo cp -f $(brew --prefix dbus)/org.freedesktop.dbus-system.plist /Library/LaunchDaemons + sudo launchctl bootstrap system /Library/LaunchDaemons/org.freedesktop.dbus-system.plist + + If the daemon is already installed and running, restart it: + + sudo launchctl kickstart -k system/org.freedesktop.dbus-system + EOS + end + end + + service do + name macos: "org.freedesktop.dbus-session" + end + + def system_plist + <<~PLIST + + + + + Label + org.freedesktop.dbus-system + KeepAlive + + SuccessfulExit + + + ProgramArguments + + #{opt_bin}/dbus-daemon + --nofork + --system + --nopidfile + + Sockets + + unix_domain_listener + + SockPathName + #{var}/run/dbus/system_bus_socket + SockPathMode + 511 + + + + + PLIST + end + + test do + assert_match version.to_s, shell_output("#{bin}/dbus-daemon --version") + end +end + +__END__ +diff --git a/bus/org.freedesktop.dbus-session.plist.in b/bus/org.freedesktop.dbus-session.plist.in +index 40ff370..3c77fa9 100644 +--- a/bus/org.freedesktop.dbus-session.plist.in ++++ b/bus/org.freedesktop.dbus-session.plist.in +@@ -5,15 +5,6 @@ + Label + org.freedesktop.dbus-session + +- ServiceIPC +- +- +- +- +- + ProgramArguments + + @DBUS_DAEMONDIR@/dbus-daemon diff --git a/Formula/docker-compose.rb b/Formula/docker-compose.rb new file mode 100644 index 0000000..6a00b79 --- /dev/null +++ b/Formula/docker-compose.rb @@ -0,0 +1,52 @@ +class DockerCompose < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "5538df00bdbcae30b2685bc582a3c25c0e837aad75cfd049ecb1c2e8e4c55043" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "786d4102dccbd2d9eb3180416fcf480c6539866f0e8c6f434ea797819b27960a" + sha256 cellar: :any_skip_relocation, x86_64_linux: "582ff48efa606748aed6717f7b60bc8fa07bf7f0224d3030cefaabfbd02fd7f4" + end + desc "Isolated development environments using Docker" + homepage "https://docs.docker.com/compose/" + url "https://github.com/docker/compose/archive/refs/tags/v5.4.0.tar.gz" + sha256 "142f895ba74715ea0018a20b7f93fa96e36fb6c91ea66f856a61c6e3716c4ef8" + license "Apache-2.0" + head "https://github.com/docker/compose.git", branch: "main" + + # Upstream creates releases that use a stable tag (e.g., `v1.2.3`) but are + # labeled as "pre-release" on GitHub before the version is released, so it's + # necessary to use the `GithubLatest` strategy. + livecheck do + url :stable + strategy :github_latest + end + + + + depends_on "go" => :build + + conflicts_with cask: "docker-desktop" + + def install + ENV["CGO_ENABLED"] = OS.mac? ? "1" : "0" + ldflags = %W[-X github.com/docker/compose/v#{version.major}/internal.Version=#{version}] + tags = %w[fsnotify] if OS.mac? + system "go", "build", *std_go_args(ldflags:, tags:), "./cmd" + + (lib/"docker/cli-plugins").install_symlink bin/"docker-compose" + end + + def caveats + <<~EOS + Compose is a Docker plugin. For Docker to find the plugin, add "cliPluginsExtraDirs" to ~/.docker/config.json: + "cliPluginsExtraDirs": [ + "#{HOMEBREW_PREFIX}/lib/docker/cli-plugins" + ] + EOS + end + + test do + output = shell_output("#{bin}/docker-compose up 2>&1", 1) + assert_match "no configuration file provided", output + assert_match version.to_s, shell_output("#{bin}/docker-compose version") + end +end diff --git a/Formula/ffmpeg.rb b/Formula/ffmpeg.rb new file mode 100644 index 0000000..2e7b3d7 --- /dev/null +++ b/Formula/ffmpeg.rb @@ -0,0 +1,112 @@ +class Ffmpeg < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "3b1dab25100b79de074463b6b10be1266ed0d5f6eb6409fa53707f49e24bb2a7" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "90fde7486968511145ad359f060eb19adf4e4fa26184e60731dbcff3e4b0243b" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "0604736f61e5760bbeb51a161d8070d9d7733ff437d34d19b5a15f14ef597a11" + end + desc "Play, record, convert, and stream select audio and video codecs" + homepage "https://ffmpeg.org/" + url "https://ffmpeg.org/releases/ffmpeg-8.1.2.tar.xz" + sha256 "464beb5e7bf0c311e68b45ae2f04e9cc2af88851abb4082231742a74d97b524c" + # None of these parts are used by default, you have to explicitly pass `--enable-gpl` + # to configure to activate them. In this case, FFmpeg's license changes to GPL v2+. + # Passing `--enable-version3` changes the license to GPL v3+. + license "GPL-3.0-or-later" + revision 1 + compatibility_version 2 + head "https://github.com/FFmpeg/FFmpeg.git", branch: "master" + + livecheck do + url "https://ffmpeg.org/download.html" + regex(/href=.*?ffmpeg[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "pkgconf" => :build + + # Only add dependencies required for dependents in homebrew-core + # or INCREDIBLY widely used and light codecs in the current year (2026). + # Add other dependencies to ffmpeg-full formula. + # We should expect to remove e.g. x264 eventually (>=2027) when usage of it is + # negligible and has all moved to e.g. x265 instead. + depends_on "dav1d" + depends_on "lame" + depends_on "libvmaf" # dependent: ab-av1 + depends_on "libvpx" + depends_on "openssl@3" + depends_on "opus" + depends_on "sdl2-compat" + depends_on "svt-av1" + depends_on "x264" + depends_on "x265" + + uses_from_macos "bzip2" + uses_from_macos "libxml2" + + on_linux do + depends_on "alsa-lib" + depends_on "libxcb" + depends_on "xz" + depends_on "zlib-ng-compat" + end + + on_intel do + depends_on "nasm" => :build + end + + deny_network_access! + + def install + # The new linker leads to duplicate symbol issue https://github.com/homebrew-ffmpeg/homebrew-ffmpeg/issues/140 + ENV.append "LDFLAGS", "-Wl,-ld_classic" if DevelopmentTools.ld64_version.between?("1015.7", "1022.1") + + # Fine adding any new options that don't add dependencies to the formula. + args = %W[ + --prefix=#{prefix} + --enable-shared + --enable-pthreads + --enable-version3 + --cc=#{ENV.cc} + --host-cflags=#{ENV.cflags} + --host-ldflags=#{ENV.ldflags} + --enable-ffplay + --enable-gpl + --enable-libsvtav1 + --enable-libopus + --enable-libx264 + --enable-libmp3lame + --enable-libdav1d + --enable-libvmaf + --enable-libvpx + --enable-libx265 + --enable-openssl + ] + + # Needs corefoundation, coremedia, corevideo + args += %w[--enable-videotoolbox --enable-audiotoolbox] if OS.mac? + args << "--enable-neon" if Hardware::CPU.arm? + + system "./configure", *args + system "make", "install" + + # Build and install additional FFmpeg tools + system "make", "alltools" + bin.install (buildpath/"tools").children.select { |f| f.file? && f.executable? } + pkgshare.install buildpath/"tools/python" + end + + def caveats + <<~EOS + ffmpeg-full includes additional tools and libraries that are not included in the regular ffmpeg formula. + EOS + end + + test do + # Create a 5 second test MP4 + mp4out = testpath/"video.mp4" + system bin/"ffmpeg", "-filter_complex", "testsrc=rate=1:duration=5", mp4out + assert_path_exists mp4out, "Failed to create video.mp4!" + end +end diff --git a/Formula/flac.rb b/Formula/flac.rb new file mode 100644 index 0000000..4f25e68 --- /dev/null +++ b/Formula/flac.rb @@ -0,0 +1,53 @@ +class Flac < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "c9698bcebe8e99ab84adf49a347cad5a9f122c45b80622a9fe2acbaeab902545" + sha256 cellar: :any, arm64_tahoe: "82b19ded7c732c245a9e325c191de60f7d17bb3370afdc98d159852cf3f9dbd5" + sha256 cellar: :any_skip_relocation, x86_64_linux: "85f5cec1705ffb8d93fb9abbb0b7b0f197d61633d8e0de2a29de825526790006" + end + desc "Free lossless audio codec" + homepage "https://xiph.org/flac/" + url "https://ftp.osuosl.org/pub/xiph/releases/flac/flac-1.5.0.tar.xz" + mirror "https://github.com/xiph/flac/releases/download/1.5.0/flac-1.5.0.tar.xz" + sha256 "f2c1c76592a82ffff8413ba3c4a1299b6c7ab06c734dee03fd88630485c2b920" + license all_of: [ + "BSD-3-Clause", + "GPL-2.0-or-later", + "ISC", + "LGPL-2.0-or-later", + "LGPL-2.1-or-later", + :public_domain, + any_of: ["GPL-2.0-or-later", "LGPL-2.1-or-later"], + ] + + livecheck do + url "https://ftp.osuosl.org/pub/xiph/releases/flac/?C=M&O=D" + regex(%r{href=(?:["']?|.*?/)flac[._-]v?(\d+(?:\.\d+)+)\.t}i) + end + + + + head do + url "https://gitlab.xiph.org/xiph/flac.git", branch: "master" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + end + + depends_on "pkgconf" => :build + depends_on "libogg" + + def install + system "./autogen.sh" if build.head? + system "./configure", "--enable-static", *std_configure_args + system "make", "install" + end + + test do + system bin/"flac", "--decode", "--force-raw", "--endian=little", "--sign=signed", + "--output-name=out.raw", test_fixtures("test.flac") + system bin/"flac", "--endian=little", "--sign=signed", "--channels=1", "--bps=8", + "--sample-rate=8000", "--output-name=out.flac", "out.raw" + end +end diff --git a/Formula/fmt.rb b/Formula/fmt.rb new file mode 100644 index 0000000..10e6550 --- /dev/null +++ b/Formula/fmt.rb @@ -0,0 +1,49 @@ +class Fmt < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "301a1bbf99d3401d4e971d957eeab6c07d08fe304a690b269e04df5424fcc9d9" + sha256 cellar: :any, arm64_tahoe: "a218679bf77ccb0c76b316556f71a0bc5d5a1980d8cd3d2ea197a5829a140d65" + sha256 cellar: :any, x86_64_linux: "9d7617cdafe71a36c5371511cdeffbe0d171c1eb93eea555a1e4028af440f5c2" + end + desc "Open-source formatting library for C++" + homepage "https://fmt.dev/" + url "https://github.com/fmtlib/fmt/releases/download/12.2.0/fmt-12.2.0.zip" + sha256 "a2f4a8d51178f954e4c339007f77edd76ba0cb2e36f87a48e5a5403d9be5878f" + license "MIT" + compatibility_version 2 + head "https://github.com/fmtlib/fmt.git", branch: "main" + + + + depends_on "cmake" => :build + + def install + system "cmake", "-S", ".", "-B", "build", "-DBUILD_SHARED_LIBS=TRUE", *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + + system "cmake", "-S", ".", "-B", "build-static", "-DBUILD_SHARED_LIBS=FALSE", *std_cmake_args + system "cmake", "--build", "build-static" + lib.install "build-static/libfmt.a" + end + + test do + (testpath/"test.cpp").write <<~CPP + #include + #include + #include + int main() + { + std::string str = fmt::format("The answer is {}", 42); + std::cout << str; + return 0; + } + CPP + + system ENV.cxx, "test.cpp", "-std=c++11", "-o", "test", + "-I#{include}", + "-L#{lib}", + "-lfmt" + assert_equal "The answer is 42", shell_output("./test") + end +end diff --git a/Formula/fontconfig.rb b/Formula/fontconfig.rb new file mode 100644 index 0000000..228cb93 --- /dev/null +++ b/Formula/fontconfig.rb @@ -0,0 +1,80 @@ +class Fontconfig < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "a5f5df5f8d02e8a5b2587cac464c7bd45128447da06b7ab39938a9645982ef49" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "ad1c5a3054313853e9eefa9a07c32a3ff7b11c4fbcff9e73affc2a50233dbafe" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "56c35f5cc20e978189ba6693eef8ed1167de1d04ef9e5289e9a9dff8b5077049" + end + desc "XML-based font configuration API for X Windows" + homepage "https://wiki.freedesktop.org/www/Software/fontconfig/" + url "https://gitlab.freedesktop.org/fontconfig/fontconfig/-/archive/2.18.3/fontconfig-2.18.3.tar.gz" + sha256 "9ae01e1d53acdef56010c5451cd34aa41d325b2faccd8606448d8fa01b2496b3" + license all_of: [ + "HPND-sell-variant", + "Unicode-3.0", # fc-case/CaseFolding.txt + "MIT-Modern-Variant", # src/fcatomic.h, src/fcmutex.h + "MIT", # src/fcfoundry.h + :public_domain, # src/fcmd5.h, src/ftglue.[ch] + ] + compatibility_version 1 + head "https://gitlab.freedesktop.org/fontconfig/fontconfig.git", branch: "main" + + livecheck do + url :stable + regex(/v?(\d+\.\d+\.(?:\d|[0-8]\d+))/i) + end + + + + depends_on "gettext" => :build + depends_on "meson" => :build + depends_on "ninja" => :build + depends_on "pkgconf" => :build + depends_on "freetype" + + uses_from_macos "gperf" => :build + uses_from_macos "python" => :build + uses_from_macos "expat" + + on_macos do + depends_on "gettext" + end + + def install + args = %W[ + --default-library=both + --localstatedir=#{var} + --sysconfdir=#{etc} + -Ddoc=disabled + -Dtests=disabled + -Dtools=enabled + -Dcache-build=disabled + -Dadditional-fonts-dirs=no + ] + + # Cannot use default dirs on macOS due to fc-cache recursing unnecessary directories + # Issue ref: https://gitlab.freedesktop.org/fontconfig/fontconfig/-/work_items/547 + if OS.mac? + font_dirs = %w[ + /System/Library/Fonts + /Library/Fonts + ~/Library/Fonts + ] + font_dirs << Dir["/System/Library/Assets{,V2}/com_apple_MobileAsset_Font*"].max + + args << "-Ddefault-fonts-dirs=#{font_dirs}" + end + + system "meson", "setup", "build", *args, *std_meson_args + system "meson", "compile", "-C", "build", "--verbose" + system "meson", "install", "-C", "build" + end + + post_install_steps do + run "fc-cache", args: ["--force", "--really-force", "--verbose"], base: :bin + end + + test do + system bin/"fc-list" + end +end diff --git a/Formula/freetype.rb b/Formula/freetype.rb new file mode 100644 index 0000000..683af24 --- /dev/null +++ b/Formula/freetype.rb @@ -0,0 +1,51 @@ +class Freetype < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "905d44c655367754329e9fcc67630c71c03c527f5ee0d9c89794b21e9708b172" + sha256 cellar: :any, arm64_tahoe: "449e22351da81ba5c8c398f87c295decac6b396bd6fab54becbb3d18800b62d1" + sha256 cellar: :any_skip_relocation, x86_64_linux: "4dfd17e1b578e43e2200b48b3b6745e18280df3ce9c9504f365f1bcc8fe8869e" + end + desc "Software library to render fonts" + homepage "https://www.freetype.org/" + url "https://downloads.sourceforge.net/project/freetype/freetype2/2.14.3/freetype-2.14.3.tar.xz" + mirror "https://download.savannah.gnu.org/releases/freetype/freetype-2.14.3.tar.xz" + sha256 "36bc4f1cc413335368ee656c42afca65c5a3987e8768cc28cf11ba775e785a5f" + license "FTL" + compatibility_version 1 + + livecheck do + url :stable + regex(/url=.*?freetype[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "pkgconf" => :build + depends_on "libpng" + + uses_from_macos "bzip2" + + on_linux do + depends_on "zlib-ng-compat" + end + + def install + # This file will be installed to bindir, so we want to avoid embedding the + # absolute path to the pkg-config shim. + inreplace "builds/unix/freetype-config.in", "%PKG_CONFIG%", "pkg-config" + + system "./configure", "--prefix=#{prefix}", + "--enable-freetype-config", + "--without-harfbuzz" + system "make" + system "make", "install" + + inreplace [bin/"freetype-config", lib/"pkgconfig/freetype2.pc"], + prefix, opt_prefix + end + + test do + system bin/"freetype-config", "--cflags", "--libs", "--ftversion", + "--exec-prefix", "--prefix" + end +end diff --git a/Formula/fribidi.rb b/Formula/fribidi.rb new file mode 100644 index 0000000..9eba496 --- /dev/null +++ b/Formula/fribidi.rb @@ -0,0 +1,32 @@ +class Fribidi < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "4904bb3375c1b1f2539cb657fbf17b0d93c050904febbba51e9dd690f3540e3b" + sha256 cellar: :any, arm64_tahoe: "4f6b90cece7f5eb2491a4938689366c84e5cba64e4a99009f20c92aaf341d186" + sha256 cellar: :any_skip_relocation, x86_64_linux: "da83ac3be7e395ab2444c0968fb3dce389161f10c2b481ddd4b18a9056bc2d60" + end + desc "Implementation of the Unicode BiDi algorithm" + homepage "https://github.com/fribidi/fribidi" + url "https://github.com/fribidi/fribidi/releases/download/v1.0.16/fribidi-1.0.16.tar.xz" + sha256 "1b1cde5b235d40479e91be2f0e88a309e3214c8ab470ec8a2744d82a5a9ea05c" + license all_of: ["GPL-2.0-or-later", "LGPL-2.1-or-later"] + + + + def install + system "./configure", "--disable-debug", + "--disable-dependency-tracking", + "--disable-silent-rules", + "--prefix=#{prefix}", + "--enable-static" + system "make", "install" + end + + test do + (testpath/"test.input").write <<~EOS + a _lsimple _RteST_o th_oat + EOS + + assert_match "a simple TSet that", shell_output("#{bin}/fribidi --charset=CapRTL --test test.input") + end +end diff --git a/Formula/fzf.rb b/Formula/fzf.rb new file mode 100644 index 0000000..64ed033 --- /dev/null +++ b/Formula/fzf.rb @@ -0,0 +1,59 @@ +class Fzf < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "6137546bd641e541b2e37588880305e625d9b582f5fc70393109ed60f448d77f" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "6137546bd641e541b2e37588880305e625d9b582f5fc70393109ed60f448d77f" + sha256 cellar: :any_skip_relocation, x86_64_linux: "f047e92d46790a241f0b1fd860341b5c14978c2264fd04bf8cf1afb34d5fe0bd" + end + desc "Command-line fuzzy finder written in Go" + homepage "https://junegunn.github.io/fzf/" + url "https://github.com/junegunn/fzf/archive/refs/tags/v0.74.2.tar.gz" + sha256 "3ce36bd4fb0cde458a7f93c11ef534408d92c3bf19e6acc90e112f3e9e2acc60" + license "MIT" + compatibility_version 1 + head "https://github.com/junegunn/fzf.git", branch: "master" + + + + depends_on "go" => :build + + uses_from_macos "ncurses" + + def install + ENV["CGO_ENABLED"] = OS.mac? ? "1" : "0" + ldflags = %W[ + -X main.version=#{version} + -X main.revision=#{tap.user} + ] + + system "go", "build", *std_go_args(ldflags:) + man1.install "man/man1/fzf.1", "man/man1/fzf-tmux.1" + bin.install "bin/fzf-tmux" + bin.install "bin/fzf-preview.sh" + + # Please don't install these into standard locations (e.g. `zsh_completion`, etc.) + # See: https://github.com/Homebrew/homebrew-core/pull/137432 + # https://github.com/Homebrew/legacy-homebrew/pull/27348 + # https://github.com/Homebrew/homebrew-core/pull/70543 + prefix.install "install", "uninstall" + (prefix/"shell").install %w[bash zsh fish].map { |s| "shell/key-bindings.#{s}" } + (prefix/"shell").install %w[bash zsh].map { |s| "shell/completion.#{s}" } + (prefix/"plugin").install "plugin/fzf.vim" + end + + def caveats + <<~EOS + To set up shell integration, see: + https://github.com/junegunn/fzf#setting-up-shell-integration + To use fzf in Vim, add the following line to your .vimrc: + set rtp+=#{opt_prefix} + EOS + end + + test do + assert_match version.to_s, shell_output("#{bin}/fzf --version") + + (testpath/"list").write %w[hello world].join($INPUT_RECORD_SEPARATOR) + assert_equal "world", pipe_output("#{bin}/fzf -f wld", (testpath/"list").read).chomp + end +end diff --git a/Formula/gettext.rb b/Formula/gettext.rb new file mode 100644 index 0000000..95f474f --- /dev/null +++ b/Formula/gettext.rb @@ -0,0 +1,76 @@ +class Gettext < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 1 + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "dde3cd0db0d7549fadf762b901f8c548dae99e3c592a6e6d41f60e1436253e5e" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "2b713227e438f51d025d76df24cfa45a2b813b61718df7bb91a6cedb1091037b" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "2dcf2f53d79cf6beb5c0df6f880c2cb7d21890be81533b3f74fc628d7f435cac" + end + desc "GNU internationalization (i18n) and localization (l10n) library" + homepage "https://www.gnu.org/software/gettext/" + url "https://ftpmirror.gnu.org/gnu/gettext/gettext-1.0.tar.gz" + mirror "https://ftp.gnu.org/gnu/gettext/gettext-1.0.tar.gz" + sha256 "85d99b79c981a404874c02e0342176cf75c7698e2b51fe41031cf6526d974f1a" + license all_of: [ + "GPL-3.0-or-later", + "LGPL-2.1-or-later", # libintl, libasprintf + ] + compatibility_version 1 + + + + depends_on "json-c" # for spit + depends_on "libunistring" + + uses_from_macos "curl" # for spit + uses_from_macos "libxml2" + uses_from_macos "ncurses" + + on_linux do + depends_on "acl" + end + + def install + # Workaround for newer Clang + ENV.append_to_cflags "-Wno-incompatible-function-pointer-types" if DevelopmentTools.clang_build_version >= 1500 + + # macOS iconv implementation is slightly broken since Sonoma. + # upstream bug report, https://savannah.gnu.org/bugs/index.php?66541 + ENV["am_cv_func_iconv_works"] = "yes" if OS.mac? && MacOS.version >= :sequoia + + args = [ + "--with-libunistring-prefix=#{formula_opt_prefix("libunistring")}", + "--disable-silent-rules", + "--with-included-glib", + "--with-included-libcroco", + "--with-emacs", + "--with-lispdir=#{elisp}", + "--disable-java", + "--disable-csharp", + # Don't use VCS systems to create these archives + "--without-git", + "--without-cvs", + "--without-xz", + ] + args << if OS.mac? + # Ship libintl.h. Disabled on linux as libintl.h is provided by glibc + # https://gcc-help.gcc.gnu.narkive.com/CYebbZqg/cc1-undefined-reference-to-libintl-textdomain + # There should never be a need to install gettext's libintl.h on + # GNU/Linux systems using glibc. If you have it installed you've borked + # your system somehow. + "--with-included-gettext" + else + "--with-libxml2-prefix=#{formula_opt_prefix("libxml2")}" + end + + system "./configure", *std_configure_args, *args + system "make" + ENV.deparallelize # install doesn't support multiple make jobs + system "make", "install" + end + + test do + system bin/"gettext", "test" + assert_match "spit: missing --model option\n", shell_output("#{bin}/spit 2>&1", 1) + end +end diff --git a/Formula/giflib.rb b/Formula/giflib.rb new file mode 100644 index 0000000..28b44f7 --- /dev/null +++ b/Formula/giflib.rb @@ -0,0 +1,37 @@ +class Giflib < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "87a14dfa72601220313c1190505c7a4d0426b384a6a2d1ba3c5a36bdc784d1b0" + sha256 cellar: :any, arm64_tahoe: "bef1f5fb654184cce8af628e3a0c222eeab3c61fcaa4ff169974b22c22f01a8c" + sha256 cellar: :any_skip_relocation, x86_64_linux: "e349e61810df032b3fff5eaac4f0db46dcc66580a070b5640a60482d6779bf64" + end + desc "Library and utilities for processing GIFs" + homepage "https://giflib.sourceforge.net/" + url "https://downloads.sourceforge.net/project/giflib/giflib-6.x/giflib-6.1.3.tar.gz" + sha256 "b65b66b99f0424b93525f987386f22fc5efb9da2bfc92ad4a532249aaffbab0e" + license "MIT" + compatibility_version 1 + + livecheck do + url :stable + regex(%r{url=.*?/giflib[._-]v?(\d+(?:\.\d+)+)\.t}i) + end + + + + def install + args = ["PREFIX=#{prefix}"] + # Manually skipping shared libutil due to https://sourceforge.net/p/giflib/bugs/189/. + # It is currently unused (binaries link to libutil.a) and not installed. + args << "LIBUTILSO=" if OS.mac? + + system "make", "all", *args + ENV.deparallelize # avoid parallel mkdir + system "make", "install", *args + end + + test do + output = shell_output("#{bin}/giftext #{test_fixtures("test.gif")}") + assert_match "Screen Size - Width = 1, Height = 1", output + end +end diff --git a/Formula/git.rb b/Formula/git.rb new file mode 100644 index 0000000..36aca49 --- /dev/null +++ b/Formula/git.rb @@ -0,0 +1,246 @@ +class Git < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "5df08160c5e705ffcce25edfe1bb189d50fd3366a0e451fc254a8d70904adc5f" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "8cae58826d317457128023d07c07f00ac00aaf3019356ff72a837e804f5d0306" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "01365c33768a2cb170a34f8f201ea3f3a7bb8c0d2140640ff3fbc58584e9758e" + end + desc "Distributed revision control system" + homepage "https://git-scm.com" + url "https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.55.0.tar.xz" + sha256 "457fdb04dc8728e007d4688695e6912e6f680727920f2a40bf11eacc17505357" + license all_of: [ + "GPL-2.0-only", + "GPL-2.0-or-later", # imap-send.c; trace.c; ... + "LGPL-2.1-or-later", # xdiff/ + "BSD-3-Clause", # xdiff/xhistogram.c; reftable/ + "MIT", # khash.h; sha1dc/ + ] + compatibility_version 1 + head "https://github.com/git/git.git", branch: "master" + + livecheck do + url "https://mirrors.edge.kernel.org/pub/software/scm/git/" + regex(/href=.*?git[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "gettext" => :build + depends_on "pkgconf" => :build + depends_on "pcre2" + + uses_from_macos "curl" + uses_from_macos "expat" + + # Don't try to add a libiconv dependency without reading this PR first: + # https://github.com/Homebrew/homebrew-core/pull/258461 + + on_macos do + depends_on "gettext" + end + + on_linux do + depends_on "openssl@3" # for git-imap-send (GPL-2.0-or-later), uses CommonCrypto on macOS + depends_on "zlib-ng-compat" + end + + resource "Authen::SASL" do + url "https://cpan.metacpan.org/authors/id/E/EH/EHUELS/Authen-SASL-2.2000.tar.gz" + sha256 "8cdf5a7f185448b614471675dae5b26f8c6e330b62264c3ff5d91172d6889b99" + end + + resource "html" do + url "https://mirrors.edge.kernel.org/pub/software/scm/git/git-htmldocs-2.55.0.tar.xz" + sha256 "d1142c4e28b469d297d6df6519653e92a76c952f55202fde17a72a3b03d49437" + + livecheck do + formula :parent + end + end + + resource "man" do + url "https://mirrors.edge.kernel.org/pub/software/scm/git/git-manpages-2.55.0.tar.xz" + sha256 "a32d432f80df46a14a05d1104c72d5a13fe27e9feba9aa0f017e54131db6b982" + + livecheck do + formula :parent + end + end + + resource "Net::SMTP::SSL" do + url "https://cpan.metacpan.org/authors/id/R/RJ/RJBS/Net-SMTP-SSL-1.04.tar.gz" + sha256 "7b29c45add19d3d5084b751f7ba89a8e40479a446ce21cfd9cc741e558332a00" + end + + deny_network_access! [:build, :postinstall] + + def install + odie "html resource needs to be updated" if build.stable? && version != resource("html").version + odie "man resource needs to be updated" if build.stable? && version != resource("man").version + + # If these things are installed, tell Git build system not to use them + ENV["NO_FINK"] = "1" + ENV["NO_DARWIN_PORTS"] = "1" + ENV["PYTHON_PATH"] = which("python3") + ENV["PERL_PATH"] = which("perl") + ENV["USE_LIBPCRE2"] = "1" + ENV["INSTALL_SYMLINKS"] = "1" + ENV["LIBPCREDIR"] = formula_opt_prefix("pcre2") + ENV["V"] = "1" # build verbosely + + perl_version = Utils.safe_popen_read("perl", "--version")[/v(\d+\.\d+)(?:\.\d+)?/, 1] + + if OS.mac? + ENV["PERLLIB_EXTRA"] = %W[ + #{MacOS.active_developer_dir} + /Library/Developer/CommandLineTools + /Applications/Xcode.app/Contents/Developer + ].uniq.map do |p| + "#{p}/Library/Perl/#{perl_version}/darwin-thread-multi-2level" + end.join(":") + end + + # The git-gui and gitk tools are installed by a separate formula (git-gui) + # to avoid a dependency on tcl-tk and to avoid using the broken system + # tcl-tk (see https://github.com/Homebrew/homebrew-core/issues/36390) + # This is done by setting the NO_TCLTK make variable. + args = %W[ + prefix=#{prefix} + sysconfdir=#{etc} + CC=#{ENV.cc} + CFLAGS=#{ENV.cflags} + LDFLAGS=#{ENV.ldflags} + NO_TCLTK=1 + NO_RUST=1 + ] + + args += if OS.mac? + %w[NO_OPENSSL=1 APPLE_COMMON_CRYPTO=1] + else + openssl_prefix = formula_opt_prefix("openssl@3") + + %W[NO_APPLE_COMMON_CRYPTO=1 OPENSSLDIR=#{openssl_prefix}] + end + + # Make sure `git` looks in `opt_prefix` instead of the Cellar. + # Otherwise, Cellar references propagate to generated plists from `git maintenance`. + inreplace "Makefile", /(-DFALLBACK_RUNTIME_PREFIX=")[^"]+/, "\\1#{opt_prefix}" + + system "make", "install", *args + + git_core = libexec/"git-core" + rm git_core/"git-svn" + + # Install the macOS keychain credential helper + if OS.mac? + cd "contrib/credential/osxkeychain" do + system "make", *args + git_core.install "git-credential-osxkeychain" + system "make", "clean" + end + end + + # Generate diff-highlight perl script executable + cd "contrib/diff-highlight" do + system "make" + end + + # Install the netrc credential helper + cd "contrib/credential/netrc" do + system "make", "test" + git_core.install "git-credential-netrc" + end + + # Install git-subtree + cd "contrib/subtree" do + system "make", "CC=#{ENV.cc}", + "CFLAGS=#{ENV.cflags}", + "LDFLAGS=#{ENV.ldflags}" + git_core.install "git-subtree" + end + + # Install git-jump + cd "contrib/git-jump" do + git_core.install "git-jump" + end + + # install the completion script first because it is inside "contrib" + bash_completion.install "contrib/completion/git-completion.bash" + bash_completion.install "contrib/completion/git-prompt.sh" + zsh_completion.install "contrib/completion/git-completion.zsh" => "_git" + cp "#{bash_completion}/git-completion.bash", zsh_completion + cp "#{bash_completion}/git-prompt.sh", zsh_completion + + (share/"git-core").install "contrib" + + # We could build the manpages ourselves, but the build process depends + # on many other packages, and is somewhat crazy, this way is easier. + man.install resource("man") + (share/"doc/git-doc").install resource("html") + + # Make html docs world-readable + chmod 0644, Dir["#{share}/doc/git-doc/**/*.{html,txt}"] + chmod 0755, Dir["#{share}/doc/git-doc/{RelNotes,howto,technical}"] + + # git-send-email needs Net::SMTP::SSL or Net::SMTP >= 2.34 and Authen::SASL + resource("Net::SMTP::SSL").stage do + (share/"perl5").install "lib/Net" + end + + resource("Authen::SASL").stage do + (share/"perl5").install "lib/Authen" + end + + # This is only created when building against system Perl, but it isn't + # purged by Homebrew's post-install cleaner because that doesn't check + # "Library" directories. It is however pointless to keep around as it + # only contains the perllocal.pod installation file. + perl_dir = prefix/"Library/Perl" + rm_r perl_dir if perl_dir.exist? + + # Set the macOS keychain credential helper by default + # (as Apple's CLT's git also does this). + if OS.mac? + (buildpath/"gitconfig").write <<~EOS + [credential] + \thelper = osxkeychain + EOS + etc.install "gitconfig" + end + end + + def caveats + <<~EOS + The Tcl/Tk GUIs (e.g. gitk, git-gui) are now in the `git-gui` formula. + Subversion interoperability (git-svn) is now in the `git-svn` formula. + EOS + end + + test do + system bin/"git", "init" + %w[haunted house].each { |f| touch testpath/f } + system bin/"git", "add", "haunted", "house" + system bin/"git", "config", "user.name", "'A U Thor'" + system bin/"git", "config", "user.email", "author@example.com" + system bin/"git", "commit", "-a", "-m", "Initial Commit" + assert_equal "haunted\nhouse", shell_output("#{bin}/git ls-files").strip + + # Check that our `inreplace` for the `Makefile` does not break. + # If this assertion fails, please fix the `inreplace` instead of removing this test. + # The failure of this test means that `git` will generate broken launchctl plist files. + refute_match HOMEBREW_CELLAR.to_s, shell_output("#{bin}/git --exec-path") + + return unless OS.mac? + + # Check Net::SMTP or Net::SMTP::SSL works for git-send-email + %w[foo bar].each { |f| touch testpath/f } + system bin/"git", "add", "foo", "bar" + system bin/"git", "commit", "-a", "-m", "Second Commit" + assert_match "Authentication Required", pipe_output( + "#{bin}/git send-email --from=test@example.com --to=dev@null.com " \ + "--smtp-server=smtp.gmail.com --smtp-server-port=587 " \ + "--smtp-encryption=tls --confirm=never HEAD^ 2>&1", + ) + end +end diff --git a/Formula/glib.rb b/Formula/glib.rb new file mode 100644 index 0000000..4f0efae --- /dev/null +++ b/Formula/glib.rb @@ -0,0 +1,193 @@ +class Glib < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "75a92e360363ebd719c655b3170b084dc3491811188b65fce0d97a45d554414e" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "56f78bc6c2d3e68fa15a1c37e3ea6531ac90c3af20665e4a6418d285514ba5ce" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "abe7175c8efb207633f50e94b56d81ad3ce5750062da0b6fc086a2dfafea4333" + end + include Language::Python::Shebang + + desc "Core application library for C" + homepage "https://docs.gtk.org/glib/" + url "https://download.gnome.org/sources/glib/2.88/glib-2.88.3.tar.xz" + sha256 "ab24d24e698dfa1e408b7bcdb508f4aafc906185a8b8ce72fdf79bbbdc9b383b" + license "LGPL-2.1-or-later" + compatibility_version 1 + + + + depends_on "bison" => :build # for gobject-introspection + depends_on "gettext" => :build + depends_on "meson" => :build + depends_on "ninja" => :build + depends_on "pkgconf" => [:build, :test] + depends_on "python-setuptools" => :build # for gobject-introspection + depends_on "python@3.14" => :build + depends_on "pcre2" + + uses_from_macos "flex" => :build # for gobject-introspection + uses_from_macos "libffi" + uses_from_macos "python" + + on_macos do + depends_on "gettext" + end + + on_linux do + depends_on "dbus" + depends_on "util-linux" + depends_on "zlib-ng-compat" + end + + # These used to live in the now defunct `glib-utils`. + link_overwrite "bin/gdbus-codegen", "bin/glib-genmarshal", "bin/glib-mkenums", "bin/gtester-report" + link_overwrite "share/glib-2.0/codegen", "share/glib-2.0/gdb" + # These used to live in `gobject-introspection` + link_overwrite "lib/girepository-1.0/GLib-2.0.typelib", "lib/girepository-1.0/GModule-2.0.typelib", + "lib/girepository-1.0/GObject-2.0.typelib", "lib/girepository-1.0/Gio-2.0.typelib" + link_overwrite "share/gir-1.0/GLib-2.0.gir", "share/gir-1.0/GModule-2.0.gir", + "share/gir-1.0/GObject-2.0.gir", "share/gir-1.0/Gio-2.0.gir" + + resource "gobject-introspection" do + url "https://download.gnome.org/sources/gobject-introspection/1.86/gobject-introspection-1.86.0.tar.xz" + sha256 "920d1a3fcedeadc32acff95c2e203b319039dd4b4a08dd1a2dfd283d19c0b9ae" + + livecheck do + formula "gobject-introspection" + end + end + + # replace several hardcoded paths with homebrew counterparts + patch do + file "Patches/glib/hardcoded-paths.diff" + end + + def install + # Avoid the sandbox violation when an empty directory is created outside of the formula prefix. + inreplace "gio/meson.build", "install_emptydir(glib_giomodulesdir)", "" + + # Disable dtrace; see https://trac.macports.org/ticket/30413 + # and https://gitlab.gnome.org/GNOME/glib/-/issues/653 + args = %W[ + --localstatedir=#{var} + -Dgio_module_dir=#{HOMEBREW_PREFIX}/lib/gio/modules + -Dbsymbolic_functions=false + -Ddtrace=disabled + -Druntime_dir=#{var}/run + -Dtests=false + ] + + # Stage build in order to deal with circular dependency as `gobject-introspection` + # is needed to generate `glib` introspection data used by dependents; however, + # `glib` is a dependency of `gobject-introspection`. + # Ref: https://discourse.gnome.org/t/dealing-with-glib-and-gobject-introspection-circular-dependency/18701 + staging_dir = buildpath/"staging" + staging_meson_args = std_meson_args(prefix: staging_dir) + system "meson", "setup", "build_staging", "-Dintrospection=disabled", *args, *staging_meson_args + system "meson", "compile", "-C", "build_staging", "--verbose" + system "meson", "install", "-C", "build_staging" + + ENV.append_path "PKG_CONFIG_PATH", staging_dir/"lib/pkgconfig" + ENV.append_path "LD_LIBRARY_PATH", staging_dir/"lib" if OS.linux? + ENV.append_path "PATH", staging_dir/"bin" + + resource("gobject-introspection").stage do + system "meson", "setup", "build", "-Dcairo=disabled", "-Ddoctool=disabled", "-Dtests=false", *staging_meson_args + system "meson", "compile", "-C", "build", "--verbose" + system "meson", "install", "-C", "build" + end + + system "meson", "setup", "build", "--default-library=both", "-Dintrospection=enabled", *args, *std_meson_args + system "meson", "compile", "-C", "build", "--verbose" + system "meson", "install", "-C", "build" + + # ensure giomoduledir contains prefix, as this pkgconfig variable will be + # used by glib-networking and glib-openssl to determine where to install + # their modules + inreplace lib/"pkgconfig/gio-2.0.pc", + "giomoduledir=#{HOMEBREW_PREFIX}/lib/gio/modules", + "giomoduledir=${libdir}/gio/modules" + + bash_completion.install (share/"bash-completion/completions").children + return unless OS.mac? + + # `pkg-config --libs glib-2.0` includes -lintl, and gettext itself does not + # have a pkgconfig file, so we add gettext lib and include paths here. + gettext = Formula["gettext"] + inreplace lib/"pkgconfig/glib-2.0.pc" do |s| + s.gsub! "Libs: -L${libdir} -lglib-2.0 -lintl", + "Libs: -L${libdir} -lglib-2.0 -L#{gettext.opt_lib} -lintl" + s.gsub! "Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include", + "Cflags: -I${includedir}/glib-2.0 -I${libdir}/glib-2.0/include -I#{gettext.opt_include}" + end + end + + post_install_steps do + mkdir_p "{{HOMEBREW_PREFIX}}/lib/gio/modules" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + + int main(void) + { + gchar *result_1, *result_2; + char *str = "string"; + + result_1 = g_convert(str, strlen(str), "ASCII", "UTF-8", NULL, NULL, NULL); + result_2 = g_convert(result_1, strlen(result_1), "UTF-8", "ASCII", NULL, NULL, NULL); + + return (strcmp(str, result_2) == 0) ? 0 : 1; + } + C + + flags = shell_output("pkgconf --cflags --libs glib-2.0").chomp.split + system ENV.cc, "-o", "test", "test.c", *flags + system "./test" + + assert_match "This file is generated by glib-mkenum", shell_output(bin/"glib-mkenums") + + (testpath/"net.Corp.MyApp.Frobber.xml").write <<~XML + + + + + + + + + + + + + + + + + XML + + system bin/"gdbus-codegen", "--generate-c-code", "myapp-generated", + "--c-namespace", "MyApp", + "--interface-prefix", "net.corp.MyApp.", + "net.Corp.MyApp.Frobber.xml" + assert_path_exists testpath/"myapp-generated.c" + assert_match "my_app_net_corp_my_app_frobber_call_hello_world", (testpath/"myapp-generated.h").read + + # Keep (u)int64_t and g(u)int64 aligned. See install comment for details + (testpath/"typecheck.cpp").write <<~CPP + #include + #include + #include + + int main() + { + static_assert(std::is_same::value == true, "gint64 should match int64_t"); + static_assert(std::is_same::value == true, "guint64 should match uint64_t"); + return 0; + } + CPP + system ENV.cxx, "-o", "typecheck", "typecheck.cpp", "-I#{include}/glib-2.0", "-I#{lib}/glib-2.0/include" + end +end diff --git a/Formula/gmp.rb b/Formula/gmp.rb new file mode 100644 index 0000000..acc8440 --- /dev/null +++ b/Formula/gmp.rb @@ -0,0 +1,86 @@ +class Gmp < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "6683d73d6677d28e1e8d1b92d6ebfbc068c1d33e19b79114a22a648a99ba5991" + sha256 cellar: :any, arm64_tahoe: "db8075f389ca0a9f9aba54762c93760db66ef92ee989f4a32b5e13b4b987339c" + sha256 cellar: :any, sequoia: "d1192da68b2618652f4be0dd9f56b18d2d276481440ae241ce9cc17be0450e07" + sha256 cellar: :any_skip_relocation, x86_64_linux: "3dca3544faca889c7389a5fdbd2b5b00582c34a4e14607033573ad3b06ca7882" + end + desc "GNU multiple precision arithmetic library" + homepage "https://gmplib.org/" + # gmplib.org blocks GitHub server IPs, so it should not be the primary URL + url "https://ftpmirror.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz" + mirror "https://gmplib.org/download/gmp/gmp-6.3.0.tar.xz" + sha256 "a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898" + license any_of: ["LGPL-3.0-or-later", "GPL-2.0-or-later"] + compatibility_version 1 + head "https://gmplib.org/repo/gmp/", using: :hg + + livecheck do + url "https://gmplib.org/download/gmp/" + regex(/href=.*?gmp[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + + uses_from_macos "m4" => :build + + def install + if build.head? + system "./.bootstrap" + else + # Regenerate configure to avoid flat namespace linking + # Reported by email: https://gmplib.org/list-archives/gmp-bugs/2023-July/thread.html + # Remove in next version + system "autoreconf", "-i", "-s" + end + + # Enable --with-pic to avoid linking issues with the static library + args = std_configure_args + %w[--enable-cxx --with-pic] + + cpu = Hardware::CPU.arm? ? "aarch64" : Hardware.oldest_cpu + if OS.mac? + args << "--build=#{cpu}-apple-darwin#{OS.kernel_version.major}" + else + args << "--build=#{cpu}-linux-gnu" + args << "ABI=32" if Hardware::CPU.is_32_bit? + end + + system "./configure", *args + system "make" + system "make", "check" + system "make", "install" + + # Prevent brew from trying to install metafiles that + # are actually symlinks to files in autotools kegs + buildpath.children.select(&:symlink?).map(&:unlink) if build.head? + end + + test do + (testpath/"test.c").write <<~C + #include + #include + + int main() { + mpz_t i, j, k; + mpz_init_set_str (i, "1a", 16); + mpz_init (j); + mpz_init (k); + mpz_sqrtrem (j, k, i); + if (mpz_get_si (j) != 5 || mpz_get_si (k) != 1) abort(); + return 0; + } + C + + system ENV.cc, "test.c", "-L#{lib}", "-lgmp", "-o", "test" + system "./test" + + # Test the static library to catch potential linking issues + system ENV.cc, "test.c", "#{lib}/libgmp.a", "-o", "test" + system "./test" + end +end diff --git a/Formula/gnupg.rb b/Formula/gnupg.rb new file mode 100644 index 0000000..8ccebfd --- /dev/null +++ b/Formula/gnupg.rb @@ -0,0 +1,110 @@ +class Gnupg < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "8583235dd83654392b878f06833405b8bac255fb5f96c942259b1efd206b0ae8" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "77a293d5ac76a99d7ca1fca4d57860bd76bb25b3c334b2504fc9b7fc145f1502" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "2dd827488b6c6b1927cf5be2eb70638e0e59ad34ba9db3e9aaaca866c4ed3c29" + end + desc "GNU Privacy Guard (OpenPGP)" + homepage "https://gnupg.org/" + url "https://gnupg.org/ftp/gcrypt/gnupg/gnupg-2.5.21.tar.bz2" + sha256 "e3af2c8caa46a66a9329fa7c6880af260451914d819595beabc2c26597b31352" + license "GPL-3.0-or-later" + compatibility_version 1 + + # GnuPG usually indicates stable releases with an even-numbered minor but + # can declare an odd-numbered minor stable. e.g. 2.5 was stable since 2.5.16, + # see https://lists.gnupg.org/pipermail/gnupg-announce/2025q4/000500.html. + # The livecheck scrapes the version from the templated homepage which is + # manually updated by upstream when a new release series is stable, e.g. + # https://dev.gnupg.org/rD18a889b403c7a5934d5080be140a4d79e1c83332 + livecheck do + url :homepage + regex(/The current version of GnuPG is v?(\d+(?:\.\d+)+)\. /i) + end + + + + depends_on "pkgconf" => :build + depends_on "gnutls" + depends_on "libassuan" + depends_on "libgcrypt" + depends_on "libgpg-error" + depends_on "libksba" + depends_on "libusb" + depends_on "npth" + depends_on "pinentry" + depends_on "readline" + + uses_from_macos "bzip2" + uses_from_macos "openldap" + uses_from_macos "sqlite" + + on_macos do + depends_on "gettext" + end + + on_linux do + depends_on "zlib-ng-compat" + end + + conflicts_with cask: "gpg-suite" + conflicts_with cask: "gpg-suite-no-mail" + conflicts_with cask: "gpg-suite-pinentry" + conflicts_with cask: "gpg-suite@nightly" + + def install + libusb = Formula["libusb"] + ENV.append "CPPFLAGS", "-I#{libusb.opt_include}/libusb-#{libusb.version.major_minor}" + + mkdir "build" do + system "../configure", "--disable-silent-rules", + "--enable-all-tests", + "--sysconfdir=#{etc}", + "--with-pinentry-pgm=#{formula_opt_bin("pinentry")}/pinentry", + "--with-readline=#{formula_opt_prefix("readline")}", + *std_configure_args + system "make" + system "make", "check" + system "make", "install" + end + + # Configure scdaemon as recommended by upstream developers + # https://dev.gnupg.org/T5415#145864 + if OS.mac? + # write to buildpath then install to ensure existing files are not clobbered + (buildpath/"scdaemon.conf").write <<~CONF + disable-ccid + CONF + pkgetc.install "scdaemon.conf" + end + end + + post_install_steps do + mkdir_p "run", base: :var + terminate_process "gpg-agent", must_succeed: false + end + + test do + (testpath/"batch.gpg").write <<~GPG + Key-Type: RSA + Key-Length: 2048 + Subkey-Type: RSA + Subkey-Length: 2048 + Name-Real: Testing + Name-Email: testing@foo.bar + Expire-Date: 1d + %no-protection + %commit + GPG + + begin + system bin/"gpg", "--batch", "--gen-key", "batch.gpg" + (testpath/"test.txt").write "Hello World!" + system bin/"gpg", "--detach-sign", "test.txt" + system bin/"gpg", "--verify", "test.txt.sig" + ensure + system bin/"gpgconf", "--kill", "gpg-agent" + end + end +end diff --git a/Formula/gnutls.rb b/Formula/gnutls.rb new file mode 100644 index 0000000..3a8517e --- /dev/null +++ b/Formula/gnutls.rb @@ -0,0 +1,100 @@ +class Gnutls < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 1 + sha256 cellar: :any, arm64_sequoia: "0c8ba0cb42636a98b28a2c173b33c4298a286972a9838d27602f0bbc860acdbb" + sha256 cellar: :any, arm64_tahoe: "a2334eb50a165945aad7df804a3e846053de62973f6aee8060fec8c16c59446b" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "8ac010d174af7ca336b9113fa208aa05104eb6b60e4e42f86c4212ad77ff6ad2" + end + desc "GNU Transport Layer Security (TLS) Library" + homepage "https://gnutls.org/" + url "https://www.gnupg.org/ftp/gcrypt/gnutls/v3.8/gnutls-3.8.13.tar.xz" + mirror "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/gnutls/v3.8/gnutls-3.8.13.tar.xz" + sha256 "ffed8ec1bf09c2426d4f14aae377de4753b53e537d685e604e99a8b16ca9c97e" + license all_of: ["LGPL-2.1-or-later", "GPL-3.0-only"] + revision 2 + compatibility_version 2 + + # The download page links to the directory listing pages for the "Next" and + # "Current stable" versions. We use the "Next" version in the formula, so we + # match versions from the tarball links on that directory listing page. + livecheck do + url "https://www.gnutls.org/download.html" + regex(/href=.*?gnutls[._-]v?(\d+(?:\.\d+)+)\.t/i) + strategy :page_match do |page, regex| + # Find the higher version from the directory listing page URLs + highest_version = page.scan(%r{href=.*?/gnutls/v?(\d+(?:\.\d+)+)/?["' >]}i) + .map { |match| match[0] } + .max_by { |v| Version.new(v) } + next unless highest_version + + # Fetch the related directory listing page + files_page = Homebrew::Livecheck::Strategy.page_content( + "https://www.gnupg.org/ftp/gcrypt/gnutls/v#{highest_version}", + ) + next if (files_page_content = files_page[:content]).blank? + + files_page_content.scan(regex).map { |match| match[0] } + end + end + + + + depends_on "pkgconf" => :build + depends_on "texinfo" => :build + depends_on "ca-certificates" => :no_linkage + depends_on "gmp" + depends_on "libidn2" + depends_on "libtasn1" + depends_on "libunistring" + depends_on "nettle" + depends_on "p11-kit" + + on_macos do + depends_on "gettext" + end + + # Backport support for building with older clang + patch do + url "https://gitlab.com/gnutls/gnutls/-/commit/29c2027c963cf559817d0da37c1fc2efd0c1bd6a.diff" + sha256 "c0bfc0164ff131c9d2e1c4d0367430f8b767b64c9c21e0f408bd634d21fb0302" + type :backport + resolves "https://gitlab.com/gnutls/gnutls/-/merge_requests/2106" + end + + def install + # DANE support is disabled so GnuTLS does not have an indirect dependency on OpenSSL. + # If the feature is wanted, then can consider shipping as split `gnutls-dane` formula. + args = %W[ + --disable-libdane + --disable-silent-rules + --disable-static + --sysconfdir=#{etc} + --with-default-trust-store-file=#{pkgetc}/cert.pem + --disable-heartbeat-support + --with-p11-kit + ] + + system "./configure", *args, *std_configure_args + system "make", "install" + + inreplace lib/"pkgconfig/gnutls.pc", prefix, opt_prefix + + # certtool shadows the macOS certtool utility + mv bin/"certtool", bin/"gnutls-certtool" + mv man1/"certtool.1", man1/"gnutls-certtool.1" + end + + post_install_steps do + symlink "{{etc}}/ca-certificates/cert.pem", "{{pkgetc}}/cert.pem", overwrite: true + end + + def caveats + "Guile bindings are now in the `guile-gnutls` formula." + end + + test do + system bin/"gnutls-cli", "--version" + assert_match "expired certificate", shell_output("#{bin}/gnutls-cli expired.badssl.com", 1) + end +end diff --git a/Formula/graphite2.rb b/Formula/graphite2.rb new file mode 100644 index 0000000..c180d6c --- /dev/null +++ b/Formula/graphite2.rb @@ -0,0 +1,45 @@ +class Graphite2 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "bcbf8282acc59c6ed6a0c9a7cf076935735c21de1495bb4e22c3d6bf32f31ee0" + sha256 cellar: :any, arm64_tahoe: "c05e664c8872f3a9e08ada587a33d71b841673126840fe0cd301300c1f59acea" + sha256 cellar: :any, x86_64_linux: "2c2803a27eb8365e8c02726d2c2e967496044a9af06e59348b52fef23e8360fd" + end + desc "Smart font renderer for non-Roman scripts" + homepage "https://graphite.sil.org/" + url "https://github.com/silnrsi/graphite/releases/download/1.3.15/graphite2-1.3.15.tgz" + sha256 "c6bc8b4252724665297f7cad0c55897285c673f9b8e6db3522ace833593fe0b1" + license any_of: ["MIT", "MPL-2.0", "LGPL-2.1-or-later", "GPL-2.0-or-later"] + head "https://github.com/silnrsi/graphite.git", branch: "master" + + + + depends_on "cmake" => :build + + on_linux do + depends_on "freetype" => :build + end + + def install + args = %W[ + -DCMAKE_INSTALL_RPATH=#{rpath} + ] + system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + + inreplace lib/"pkgconfig/graphite2.pc", prefix.realpath, opt_prefix + end + + test do + resource "testfont" do + url "https://scripts.sil.org/pub/woff/fonts/Simple-Graphite-Font.ttf" + sha256 "7e573896bbb40088b3a8490f83d6828fb0fd0920ac4ccdfdd7edb804e852186a" + end + + resource("testfont").stage do + shape = shell_output("#{bin}/gr2fonttest Simple-Graphite-Font.ttf 'abcde'") + assert_match(/67.*36.*37.*38.*71/m, shape) + end + end +end diff --git a/Formula/harfbuzz.rb b/Formula/harfbuzz.rb new file mode 100644 index 0000000..e9c475e --- /dev/null +++ b/Formula/harfbuzz.rb @@ -0,0 +1,66 @@ +class Harfbuzz < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "a056c8d6430223a0a1f0a9d31f6b04cd96fdcb88c74da40a61892d18243d347a" + sha256 cellar: :any, arm64_tahoe: "a4d727f73af8892743817d9557e139866060de41302e1e6461908e9d31e2aa0a" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "ddec7f52274aa95bd5ca762c97024de8d4bd10e7a4233511914dfd2696b6182a" + end + desc "OpenType text shaping engine" + homepage "https://github.com/harfbuzz/harfbuzz" + url "https://github.com/harfbuzz/harfbuzz/releases/download/14.3.0/harfbuzz-14.3.0.tar.xz" + sha256 "16070d77cfc4ba1f1e7327e83bf9b3f55898081cabdb94e56a33e04fc8874eae" + license "MIT" + compatibility_version 1 + head "https://github.com/harfbuzz/harfbuzz.git", branch: "main" + + + + depends_on "gobject-introspection" => :build + depends_on "meson" => :build + depends_on "ninja" => :build + depends_on "pkgconf" => :build + depends_on "python@3.14" => [:build, :test] + depends_on "pygobject3" => :test + depends_on "cairo" + depends_on "freetype" + depends_on "glib" + depends_on "graphite2" + depends_on "icu4c@78" + depends_on "libpng" + + on_linux do + depends_on "zlib-ng-compat" + end + + def install + args = %w[ + --default-library=both + -Dcairo=enabled + -Dcoretext=enabled + -Dfreetype=enabled + -Dglib=enabled + -Dgobject=enabled + -Dgraphite=enabled + -Dicu=enabled + -Dintrospection=enabled + -Dtests=disabled + ] + + system "meson", "setup", "build", *args, *std_meson_args + system "meson", "compile", "-C", "build", "--verbose" + system "meson", "install", "-C", "build" + end + + test do + resource "homebrew-test-ttf" do + url "https://github.com/harfbuzz/harfbuzz/raw/fc0daafab0336b847ac14682e581a8838f36a0bf/test/shaping/fonts/sha1sum/270b89df543a7e48e206a2d830c0e10e5265c630.ttf" + sha256 "9535d35dab9e002963eef56757c46881f6b3d3b27db24eefcc80929781856c77" + end + + resource("homebrew-test-ttf").stage do + shape = pipe_output("#{bin}/hb-shape 270b89df543a7e48e206a2d830c0e10e5265c630.ttf", "സ്റ്റ്").chomp + assert_equal "[glyph201=0+1183|U0D4D=0+0]", shape + end + system "python3.14", "-c", "from gi.repository import HarfBuzz" + end +end diff --git a/Formula/hdrhistogram_c.rb b/Formula/hdrhistogram_c.rb new file mode 100644 index 0000000..9e68b33 --- /dev/null +++ b/Formula/hdrhistogram_c.rb @@ -0,0 +1,54 @@ +class HdrhistogramC < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "ac019705090ca3db22752a5e5e6e1c15f0fcb325b23cb01149dc79cf225328ec" + sha256 cellar: :any, arm64_tahoe: "82d614866ee4351be8d84502e69e74efb972fcaa55e2e77ea8eff259ee9f1d56" + sha256 cellar: :any, x86_64_linux: "00929c5ef0d3a7c83956877411dfe888bf7642b3001678632f9c3c840bd207de" + end + desc "C port of the HdrHistogram" + homepage "https://github.com/HdrHistogram/HdrHistogram_c" + url "https://github.com/HdrHistogram/HdrHistogram_c/archive/refs/tags/0.11.10.tar.gz" + sha256 "c3b06d077e680d112abf9f027d8a558f1176ee4a55a7c523577833391d8c2249" + license any_of: ["CC0-1.0", "BSD-2-Clause"] + compatibility_version 1 + + + + depends_on "cmake" => :build + + on_linux do + depends_on "zlib-ng-compat" + end + + def install + system "cmake", "-S", ".", "-B", "build", "-DHDR_HISTOGRAM_BUILD_PROGRAMS=OFF", *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + + int main(void) { + struct hdr_histogram* histogram; + hdr_init(1, INT64_C(3600000000), 3, &histogram); + hdr_record_value(histogram, 2); + hdr_record_values(histogram, 4, 10); + return hdr_percentiles_print(histogram, stdout, 5, 1.0, CLASSIC); + } + C + system ENV.cc, "test.c", "-o", "test", "-L#{lib}", "-lhdr_histogram" + assert_equal <<~EOS, shell_output("./test") + Value Percentile TotalCount 1/(1-Percentile) + + 2.000 0.000000 1 1.00 + 4.000 0.100000 11 1.11 + 4.000 1.000000 11 inf + #[Mean = 3.818, StdDeviation = 0.575] + #[Max = 4.000, Total count = 11] + #[Buckets = 22, SubBuckets = 2048] + EOS + end +end diff --git a/Formula/hermes-agent.rb b/Formula/hermes-agent.rb new file mode 100644 index 0000000..5de934f --- /dev/null +++ b/Formula/hermes-agent.rb @@ -0,0 +1,310 @@ +class HermesAgent < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 1 + sha256 cellar: :any, arm64_sequoia: "0934c99e0c73fac31d7f6108648a556e701efd2f9a5dcb943fd456e571e03cf5" + sha256 cellar: :any, arm64_tahoe: "1bc6279e603665a0acfa30e3ff91d3f6865cac52b0f2c6aa3bc68a0aab726b5c" + sha256 cellar: :any, x86_64_linux: "a2ec5b0ffadaf401540ca16ee1c096da45d9b7d1a8ed5f800866be4de30782fd" + end + include Language::Python::Virtualenv + + desc "Self-improving AI agent that creates skills from experience" + homepage "https://hermes-agent.nousresearch.com" + url "https://github.com/NousResearch/hermes-agent/archive/refs/tags/v2026.8.3.tar.gz" + sha256 "370542c7219faba6300905c3b419e14e6508a31ac698a1a5174e0386990834be" + license "MIT" + head "https://github.com/NousResearch/hermes-agent.git", branch: "main" + + livecheck do + url :stable + regex(/^v?(\d+(?:\.\d+)+)$/i) + end + + + + depends_on "pkgconf" => :build + depends_on "rust" => :build + depends_on "certifi" => :no_linkage + depends_on "cryptography" => :no_linkage + depends_on "libyaml" + depends_on "pillow" => :no_linkage + depends_on "pydantic" => :no_linkage + depends_on "python@3.14" + + pypi_packages exclude_packages: %w[certifi cryptography pillow pydantic] + + resource "annotated-doc" do + url "https://files.pythonhosted.org/packages/57/ba/046ceea27344560984e26a590f90bc7f4a75b06701f653222458922b558c/annotated_doc-0.0.4.tar.gz" + sha256 "fbcda96e87e9c92ad167c2e53839e57503ecfda18804ea28102353485033faa4" + end + + resource "anyio" do + url "https://files.pythonhosted.org/packages/61/cc/a381afa6efea9f496eff839d4a6a1aed3bfafc7b3ab4b0d1b243a12573dd/anyio-4.14.2.tar.gz" + sha256 "cfa139f3ed1a23ee8f88a145ddb5ac7605b8bbfd8592baacd7ce3d8bb4313c7f" + end + + resource "charset-normalizer" do + url "https://files.pythonhosted.org/packages/bd/2a/23f34ec9d04624958e137efdc394888716353190e75f25dd22c7a2c7a8aa/charset_normalizer-3.4.9.tar.gz" + sha256 "673611bbd43f0810bec0b0f028ddeaaa501190339cac411f347ac76917c3ae7b" + end + + resource "click" do + url "https://files.pythonhosted.org/packages/76/d4/81420972a676e8ffea40450d8c8c92943e7218a78fe9b64359836cc9876b/click-8.4.2.tar.gz" + sha256 "9a6cea6e60b17ebe0a44c5cc636d94f09bd66142c1cd7d8b4cd731c4917a15f6" + end + + resource "croniter" do + url "https://files.pythonhosted.org/packages/ad/2f/44d1ae153a0e27be56be43465e5cb39b9650c781e001e7864389deb25090/croniter-6.0.0.tar.gz" + sha256 "37c504b313956114a983ece2c2b07790b1f1094fe9d81cc94739214748255577" + end + + resource "distro" do + url "https://files.pythonhosted.org/packages/fc/f8/98eea607f65de6527f8a2e8885fc8015d3e6f5775df186e443e0964a11c3/distro-1.9.0.tar.gz" + sha256 "2fa77c6fd8940f116ee1d6b94a2f90b13b5ea8d019b98bc8bafdcabcdd9bdbed" + end + + resource "fastapi" do + url "https://files.pythonhosted.org/packages/cd/95/d3f0ae10836324a2eab98a52b61210ac609f08200bf4bb0dc8132d32f78a/fastapi-0.139.2.tar.gz" + sha256 "333145a6891e9b5b3cfceb69baf817e8240cde4d4588ae5a10bf56ffacb6255e" + end + + resource "fire" do + url "https://files.pythonhosted.org/packages/c0/00/f8d10588d2019d6d6452653def1ee807353b21983db48550318424b5ff18/fire-0.7.1.tar.gz" + sha256 "3b208f05c736de98fb343310d090dcc4d8c78b2a89ea4f32b837c586270a9cbf" + end + + resource "h11" do + url "https://files.pythonhosted.org/packages/01/ee/02a2c011bdab74c6fb3c75474d40b3052059d95df7e73351460c8588d963/h11-0.16.0.tar.gz" + sha256 "4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1" + end + + resource "httpcore" do + url "https://files.pythonhosted.org/packages/06/94/82699a10bca87a5556c9c59b5963f2d039dbd239f25bc2a63907a05a14cb/httpcore-1.0.9.tar.gz" + sha256 "6e34463af53fd2ab5d807f399a9b45ea31c3dfa2276f15a2c3f00afff6e176e8" + end + + resource "httptools" do + url "https://files.pythonhosted.org/packages/43/e5/d471fcb0e14523fe1c3f4ba58ca52480e7bd70ad7109a3846bc75892f7fb/httptools-0.8.0.tar.gz" + sha256 "6b2a32f18d97e16e90827d7a819ffa8dbd8cc245fc4e1fa9d1095b54ef4bd999" + end + + resource "httpx" do + url "https://files.pythonhosted.org/packages/b1/df/48c586a5fe32a0f01324ee087459e112ebb7224f646c0b5023f5e79e9956/httpx-0.28.1.tar.gz" + sha256 "75e98c5f16b0f35b567856f597f06ff2270a374470a5c2392242528e3e3e42fc" + end + + resource "idna" do + url "https://files.pythonhosted.org/packages/cd/63/9496c57188a2ee585e0f1db071d75089a11e98aa86eb99d9d7618fc1edce/idna-3.18.tar.gz" + sha256 "ffb385a7e039654cef1ab9ef32c6fafe283c0c0467bba1d9029738ce4a14a848" + end + + resource "jinja2" do + url "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz" + sha256 "0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d" + end + + resource "jiter" do + url "https://files.pythonhosted.org/packages/1d/1f/10936e16d8860c70698a1aa939a46aa0224813b782bce4e000e637da0b2d/jiter-0.16.0.tar.gz" + sha256 "7b24c3492c5f4f84a37946ad9cf504910cf6a782d6a4e0689b6673c5894b4a1c" + end + + resource "markdown" do + url "https://files.pythonhosted.org/packages/2b/f4/69fa6ed85ae003c2378ffa8f6d2e3234662abd02c10d216c0ba96081a238/markdown-3.10.2.tar.gz" + sha256 "994d51325d25ad8aa7ce4ebaec003febcce822c3f8c911e3b17c52f7f589f950" + end + + resource "markdown-it-py" do + url "https://files.pythonhosted.org/packages/06/ff/7841249c247aa650a76b9ee4bbaeae59370dc8bfd2f6c01f3630c35eb134/markdown_it_py-4.2.0.tar.gz" + sha256 "04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49" + end + + resource "markupsafe" do + url "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz" + sha256 "722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698" + end + + resource "mdurl" do + url "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz" + sha256 "bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba" + end + + resource "openai" do + url "https://files.pythonhosted.org/packages/55/13/17e87641b89b74552ed408a92b231283786523edddc95f3545809fab673c/openai-2.24.0.tar.gz" + sha256 "1e5769f540dbd01cb33bc4716a23e67b9d695161a734aff9c5f925e2bf99a673" + end + + resource "packaging" do + url "https://files.pythonhosted.org/packages/65/ee/299d360cdc32edc7d2cf530f3accf79c4fca01e96ffc950d8a52213bd8e4/packaging-26.0.tar.gz" + sha256 "00243ae351a257117b6a241061796684b084ed1c516a08c48a3f7e147a9d80b4" + end + + resource "pathspec" do + url "https://files.pythonhosted.org/packages/5a/82/42f767fc1c1143d6fd36efb827202a2d997a375e160a71eb2888a925aac1/pathspec-1.1.1.tar.gz" + sha256 "17db5ecd524104a120e173814c90367a96a98d07c45b2e10c2f3919fff91bf5a" + end + + resource "prompt-toolkit" do + url "https://files.pythonhosted.org/packages/a1/96/06e01a7b38dce6fe1db213e061a4602dd6032a8a97ef6c1a862537732421/prompt_toolkit-3.0.52.tar.gz" + sha256 "28cde192929c8e7321de85de1ddbe736f1375148b02f2e17edd840042b1be855" + end + + resource "psutil" do + url "https://files.pythonhosted.org/packages/aa/c6/d1ddf4abb55e93cebc4f2ed8b5d6dbad109ecb8d63748dd2b20ab5e57ebe/psutil-7.2.2.tar.gz" + sha256 "0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372" + end + + resource "ptyprocess" do + url "https://files.pythonhosted.org/packages/20/e5/16ff212c1e452235a90aeb09066144d0c5a6a8c0834397e03f5224495c4e/ptyprocess-0.7.0.tar.gz" + sha256 "5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220" + end + + resource "pygments" do + url "https://files.pythonhosted.org/packages/c3/b2/bc9c9196916376152d655522fdcebac55e66de6603a76a02bca1b6414f6c/pygments-2.20.0.tar.gz" + sha256 "6757cd03768053ff99f3039c1a36d6c0aa0b263438fcab17520b30a303a82b5f" + end + + resource "pyjwt" do + url "https://files.pythonhosted.org/packages/3b/81/58d0ac84e1ef3a3843791d6954d94c0b33d526c75eeb1efbce9d0a4c4077/pyjwt-2.13.0.tar.gz" + sha256 "41571c89ca91598c79e8ef18a2d07367d4810fbbd6f637794879baf1b7703423" + end + + resource "python-dateutil" do + url "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz" + sha256 "37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3" + end + + resource "python-dotenv" do + url "https://files.pythonhosted.org/packages/82/ed/0301aeeac3e5353ef3d94b6ec08bbcabd04a72018415dcb29e588514bba8/python_dotenv-1.2.2.tar.gz" + sha256 "2c371a91fbd7ba082c2c1dc1f8bf89ca22564a087c2c287cd9b662adde799cf3" + end + + resource "python-multipart" do + url "https://files.pythonhosted.org/packages/5b/42/55c32bb9b12693c092ad250a0e82edb5b31ddeda6eb772de5f308b3804ad/python_multipart-0.0.32.tar.gz" + sha256 "be54b7f3fa167bb83e4fcd936b887b708f4e57fe75911c02aebf53efaf8d938e" + end + + resource "pytz" do + url "https://files.pythonhosted.org/packages/ff/46/dd499ec9038423421951e4fad73051febaa13d2df82b4064f87af8b8c0c3/pytz-2026.2.tar.gz" + sha256 "0e60b47b29f21574376f218fe21abc009894a2321ea16c6754f3cad6eb7cdd6a" + end + + resource "pyyaml" do + url "https://files.pythonhosted.org/packages/05/8e/961c0007c59b8dd7729d542c61a4d537767a59645b82a0b521206e1e25c2/pyyaml-6.0.3.tar.gz" + sha256 "d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f" + end + + resource "requests" do + url "https://files.pythonhosted.org/packages/34/64/8860370b167a9721e8956ae116825caff829224fbca0ca6e7bf8ddef8430/requests-2.33.0.tar.gz" + sha256 "c7ebc5e8b0f21837386ad0e1c8fe8b829fa5f544d8df3b2253bff14ef29d7652" + end + + resource "rich" do + url "https://files.pythonhosted.org/packages/b3/c6/f3b320c27991c46f43ee9d856302c70dc2d0fb2dba4842ff739d5f46b393/rich-14.3.3.tar.gz" + sha256 "b8daa0b9e4eef54dd8cf7c86c03713f53241884e814f4e2f5fb342fe520f639b" + end + + resource "ruamel-yaml" do + url "https://files.pythonhosted.org/packages/3a/2b/7a1f1ebcd6b3f14febdc003e658778d81e76b40df2267904ee6b13f0c5c6/ruamel_yaml-0.18.17.tar.gz" + sha256 "9091cd6e2d93a3a4b157ddb8fabf348c3de7f1fb1381346d985b6b247dcd8d3c" + end + + resource "ruamel-yaml-clib" do + url "https://files.pythonhosted.org/packages/ea/97/60fda20e2fb54b83a61ae14648b0817c8f5d84a3821e40bfbdae1437026a/ruamel_yaml_clib-0.2.15.tar.gz" + sha256 "46e4cc8c43ef6a94885f72512094e482114a8a706d3c555a34ed4b0d20200600" + end + + resource "six" do + url "https://files.pythonhosted.org/packages/94/e7/b2c673351809dca68a0e064b6af791aa332cf192da575fd474ed7d6f16a2/six-1.17.0.tar.gz" + sha256 "ff70335d468e7eb6ec65b95b99d3a2836546063f63acc5171de367e834932a81" + end + + resource "sniffio" do + url "https://files.pythonhosted.org/packages/a2/87/a6771e1546d97e7e041b6ae58d80074f81b7d5121207425c964ddf5cfdbd/sniffio-1.3.1.tar.gz" + sha256 "f4324edc670a0f49750a81b895f35c3adb843cca46f0530f79fc1babb23789dc" + end + + resource "socksio" do + url "https://files.pythonhosted.org/packages/f8/5c/48a7d9495be3d1c651198fd99dbb6ce190e2274d0f28b9051307bdec6b85/socksio-1.0.0.tar.gz" + sha256 "f88beb3da5b5c38b9890469de67d0cb0f9d494b78b106ca1845f96c10b91c4ac" + + # Unpin flit-core<3 to support 3.14+ + patch do + url "https://github.com/sethmlarson/socksio/commit/b326406915fd98a8185c1c160165c5b8963b30c1.patch?full_index=1" + sha256 "7aefa906b62e2c9a8df255ea742ca97e155ac2e1238e49ce11e3e56e37ee1f8b" + type :backport + resolves "https://github.com/sethmlarson/socksio/pull/61" + end + end + + resource "starlette" do + url "https://files.pythonhosted.org/packages/eb/e3/7c1dc7381d9f8ab7d854328ebfa884e62cb3f3d8549ddfd37c7814f42afa/starlette-1.3.1.tar.gz" + sha256 "05d0213193f2fbaae60e2ecb593b4add4262ad4e46536b54abe36f11a71724e0" + end + + resource "tenacity" do + url "https://files.pythonhosted.org/packages/47/c6/ee486fd809e357697ee8a44d3d69222b344920433d3b6666ccd9b374630c/tenacity-9.1.4.tar.gz" + sha256 "adb31d4c263f2bd041081ab33b498309a57c77f9acf2db65aadf0898179cf93a" + end + + resource "termcolor" do + url "https://files.pythonhosted.org/packages/46/79/cf31d7a93a8fdc6aa0fbb665be84426a8c5a557d9240b6239e9e11e35fc5/termcolor-3.3.0.tar.gz" + sha256 "348871ca648ec6a9a983a13ab626c0acce02f515b9e1983332b17af7979521c5" + end + + resource "tqdm" do + url "https://files.pythonhosted.org/packages/8c/69/40407dfc835517f058b603dbf37a6df094d8582b015a51eddc988febbcb7/tqdm-4.69.0.tar.gz" + sha256 "700c5e85dcd5f009dd6222588a29180a193a748247a5d855b4d67db93d79a53b" + end + + resource "urllib3" do + url "https://files.pythonhosted.org/packages/53/0c/06f8b233b8fd13b9e5ee11424ef85419ba0d8ba0b3138bf360be2ff56953/urllib3-2.7.0.tar.gz" + sha256 "231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c" + end + + resource "uvicorn" do + url "https://files.pythonhosted.org/packages/a2/65/b7c6c443ccc58678c91e1e973bbe2a878591538655d6e1d47f24ba1c51f3/uvicorn-0.51.0.tar.gz" + sha256 "f6f4b69b657c312f516dd2d268ab9ae6f254b11e4bac504f37b2ab58b24dd0b0" + end + + resource "uvloop" do + url "https://files.pythonhosted.org/packages/06/f0/18d39dbd1971d6d62c4629cc7fa67f74821b0dc1f5a77af43719de7936a7/uvloop-0.22.1.tar.gz" + sha256 "6c84bae345b9147082b17371e3dd5d42775bddce91f885499017f4607fdaf39f" + end + + resource "watchfiles" do + url "https://files.pythonhosted.org/packages/cd/41/5e1a4bb12aac5f1493fa1bdc11154eca3b258ca4eba65d39c473fe19d8e9/watchfiles-1.2.0.tar.gz" + sha256 "c995fba777f1ea992f090f9236e9284cf7a5d1a0130dd5a3d82c598cacd76838" + end + + resource "wcwidth" do + url "https://files.pythonhosted.org/packages/34/74/c6428f875774288bec1396f5bfcbc2d925700a4dad61727fd5f2b12f249d/wcwidth-0.8.2.tar.gz" + sha256 "91fbef97204b96a3d4d421609b80340b760cf33e26da123ff243d76b1fda8dda" + end + + resource "websockets" do + url "https://files.pythonhosted.org/packages/21/e6/26d09fab466b7ca9c7737474c52be4f76a40301b08362eb2dbc19dcc16c1/websockets-15.0.1.tar.gz" + sha256 "82544de02076bafba038ce055ee6412d68da13ab47f0c60cab827346de828dee" + end + + def install + ENV["HERMES_NIX_BUILD"] = "1" + # Allow to build with Python 3.14 + inreplace "pyproject.toml", "requires-python = \">=3.11,<3.14\"", "requires-python = \">=3.11,<3.15\"" + + venv = virtualenv_install_with_resources(without: "socksio") + resource("socksio").stage do + # Cap flit-core below 4 as socksio's legacy `[tool.flit.metadata]` + # pyproject table is no longer supported since flit-core 4 + inreplace "pyproject.toml", "flit_core >=2", "flit_core >=2,<4" + venv.pip_install Pathname.pwd + end + end + + test do + assert_match version.to_s, shell_output("#{bin}/hermes version") + + assert_match "No sessions found", shell_output("#{bin}/hermes sessions list") + system bin/"hermes", "status" + system bin/"hermes", "doctor" + end +end diff --git a/Formula/icu4c@78.rb b/Formula/icu4c@78.rb new file mode 100644 index 0000000..7ec6418 --- /dev/null +++ b/Formula/icu4c@78.rb @@ -0,0 +1,57 @@ +class Icu4cAT78 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "d1206febbce23e5014f51b631afd7129b2a247ee18a9f97226cd5889e66c1686" + sha256 cellar: :any, arm64_tahoe: "0476be299494b97e50a48b0ba08811255300228aef664058e555480d6aee4fb5" + sha256 cellar: :any_skip_relocation, x86_64_linux: "b152f4b6f581af753a52bf6dc5b7a113cd9f77088dcc94deaf6c321109aa43c2" + end + desc "C/C++ and Java libraries for Unicode and globalization" + homepage "https://icu.unicode.org/home" + url "https://github.com/unicode-org/icu/releases/download/release-78.3/icu4c-78.3-sources.tgz" + sha256 "3a2e7a47604ba702f345878308e6fefeca612ee895cf4a5f222e7955fabfe0c0" + license "Unicode-3.0" + compatibility_version 1 + + # We allow the livecheck to detect new `icu4c` major versions in order to + # automate version bumps. To make sure PRs are created correctly, we output + # an error during installation to notify when a new formula is needed. + livecheck do + url :stable + regex(/^release[._-]v?(\d+(?:[.-]\d+)+)$/i) + strategy :git do |tags, regex| + tags.filter_map { |tag| tag[regex, 1]&.tr("-", ".") } + end + end + + + + keg_only :shadowed_by_macos, "macOS provides libicucore.dylib (but nothing else)" + + def install + odie "Major version bumps need a new formula!" if version.major.to_s != name[/@(\d+)$/, 1] + + args = %w[ + --disable-samples + --disable-tests + --enable-static + --with-library-bits=64 + ] + + cd "source" do + system "./configure", *args, *std_configure_args + system "make" + system "make", "install" + end + + inreplace [bin/"icu-config", *lib.glob("pkgconfig/icu-*.pc")], prefix, opt_prefix + end + + test do + if File.exist? "/usr/share/dict/words" + system bin/"gendict", "--uchars", "/usr/share/dict/words", "dict" + else + (testpath/"hello").write "hello\nworld\n" + system bin/"gendict", "--uchars", "hello", "dict" + end + end +end diff --git a/Formula/iperf3.rb b/Formula/iperf3.rb new file mode 100644 index 0000000..5e7df7a --- /dev/null +++ b/Formula/iperf3.rb @@ -0,0 +1,52 @@ +class Iperf3 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "9c2798aa7042d06364caca9fec400651d5cc5ae26446b24c308827c30649a40a" + sha256 cellar: :any, arm64_tahoe: "4c9732362cf41e8564f33fca550a9a49356ea2b54bf5b1c021ac828038c6ae46" + sha256 cellar: :any_skip_relocation, x86_64_linux: "aa5c3dae2b89ab6be2a65e6c3f90a29d4a99ef5b54254c78331d970781eb82e2" + end + desc "Update of iperf: measures TCP, UDP, and SCTP bandwidth" + homepage "https://github.com/esnet/iperf" + url "https://downloads.es.net/pub/iperf/iperf-3.21.tar.gz" + sha256 "656e4405ebd620121de7ceca3eaf43a88f79ea1b857d041a6a0b1314801acdd8" + license "BSD-3-Clause" + revision 1 + + livecheck do + url "https://downloads.es.net/pub/iperf/" + regex(/href=.*?iperf[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + head do + url "https://github.com/esnet/iperf.git", branch: "master" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + end + + depends_on "openssl@4" + + def install + system "./bootstrap.sh" if build.head? + system "./configure", "--disable-silent-rules", + "--disable-profiling", + "--with-openssl=#{formula_opt_prefix("openssl@4")}", + *std_configure_args + system "make", "clean" # there are pre-compiled files in the tarball + system "make", "install" + end + + test do + port = free_port + pid = spawn bin/"iperf3", "--server", "--port", port.to_s + sleep 1 + sleep 2 if OS.mac? && Hardware::CPU.intel? + assert_match "Bitrate", shell_output("#{bin}/iperf3 --client 127.0.0.1 --port #{port} --time 1") + ensure + Process.kill("SIGINT", pid) + Process.wait(pid) + end +end diff --git a/Formula/jpeg-turbo.rb b/Formula/jpeg-turbo.rb new file mode 100644 index 0000000..1e3e9fe --- /dev/null +++ b/Formula/jpeg-turbo.rb @@ -0,0 +1,73 @@ +class JpegTurbo < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "511445b91fe45351e3f7ae238ee7be0159fe92bb1e240a57489f62ded7fd1632" + sha256 cellar: :any, arm64_tahoe: "516f4fcf68020aea477a82ac745d5a89bff9fb4908e01c7529c191a563fd1a7b" + sha256 cellar: :any, x86_64_linux: "586635840c2b99e9e68e823ebd0b88dbd69bb2dbdeeef63f28d7202af68be9b1" + end + desc "JPEG image codec that aids compression and decompression" + homepage "https://www.libjpeg-turbo.org/" + url "https://github.com/libjpeg-turbo/libjpeg-turbo/releases/download/3.2.0/libjpeg-turbo-3.2.0.tar.gz" + sha256 "6f30092cef9fb839779646608f4ee14ae3cbac989c47fa05e841b0841f09878e" + license all_of: [ + "IJG", # libjpeg API library and programs + "Zlib", # libjpeg-turbo SIMD source code + "BSD-3-Clause", # TurboJPEG API library and programs + ] + compatibility_version 1 + head "https://github.com/libjpeg-turbo/libjpeg-turbo.git", branch: "main" + + livecheck do + url :stable + strategy :github_latest + end + + + + depends_on "cmake" => :build + + on_intel do + # Required only for x86 SIMD extensions. + depends_on "nasm" => :build + end + + # These conflict with `jpeg`, which is now keg-only. + link_overwrite "bin/cjpeg", "bin/djpeg", "bin/jpegtran", "bin/rdjpgcom", "bin/wrjpgcom" + link_overwrite "include/jconfig.h", "include/jerror.h", "include/jmorecfg.h", "include/jpeglib.h" + link_overwrite "lib/libjpeg.dylib", "lib/libjpeg.so", "lib/libjpeg.a", "lib/pkgconfig/libjpeg.pc" + link_overwrite "share/man/man1/cjpeg.1", "share/man/man1/djpeg.1", "share/man/man1/jpegtran.1", + "share/man/man1/rdjpgcom.1", "share/man/man1/wrjpgcom.1" + + def install + args = ["-DWITH_JPEG8=1", "-DCMAKE_EXE_LINKER_FLAGS=-Wl,-rpath,#{rpath}"] + if Hardware::CPU.arm? && OS.mac? + if MacOS.version >= :ventura + # https://github.com/libjpeg-turbo/libjpeg-turbo/issues/709 + args += ["-DFLOATTEST8=fp-contract", + "-DFLOATTEST12=fp-contract"] + elsif MacOS.version == :monterey + # https://github.com/libjpeg-turbo/libjpeg-turbo/issues/734 + args << "-DFLOATTEST12=no-fp-contract" + end + end + args += std_cmake_args.reject { |arg| arg["CMAKE_INSTALL_LIBDIR"].present? } + + system "cmake", "-S", ".", "-B", "build", *args + system "cmake", "--build", "build" + system "ctest", "--test-dir", "build", "--rerun-failed", "--output-on-failure", "--parallel", ENV.make_jobs + system "cmake", "--install", "build" + + # Avoid rebuilding dependents that hard-code the prefix. + inreplace [lib/"pkgconfig/libjpeg.pc", lib/"pkgconfig/libturbojpeg.pc"], + prefix, opt_prefix + end + + test do + system bin/"jpegtran", "-crop", "1x1", + "-transpose", + "-perfect", + "-outfile", "out.jpg", + test_fixtures("test.jpg") + assert_path_exists testpath/"out.jpg" + end +end diff --git a/Formula/json-c.rb b/Formula/json-c.rb new file mode 100644 index 0000000..8590685 --- /dev/null +++ b/Formula/json-c.rb @@ -0,0 +1,49 @@ +class JsonC < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "760e09935d633a49e8a25121969022ef158eed40b739bd142063aadbfed41730" + sha256 cellar: :any, arm64_tahoe: "4095feba36f7d453ae23ddb2656038e0784e857e1c860e70fe26a7c5089c36f5" + sha256 cellar: :any, x86_64_linux: "4d85c99fb83f7bdda0f79118df9605db6bfb1a0e4bfac02ffccddc645c1991d3" + end + desc "JSON parser for C" + homepage "https://github.com/json-c/json-c/wiki" + url "https://s3.amazonaws.com/json-c_releases/releases/json-c-0.19.tar.gz" + sha256 "37ad0249902e301bd9052bf712e511fcc6acff4ecaad4b5900aad9ce564e26de" + license "MIT" + head "https://github.com/json-c/json-c.git", branch: "master" + + livecheck do + url :head + regex(/^json-c[._-](\d+(?:\.\d+)+)(?:[._-]\d{6,8})?$/i) + end + + + + depends_on "cmake" => :build + + def install + # We pass `BUILD_APPS=OFF` since any built apps are never installed. See: + # https://github.com/json-c/json-c/blob/master/apps/CMakeLists.txt#L119-L121 + system "cmake", "-S", ".", "-B", "build", "-DBUILD_APPS=OFF", *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + (testpath/"test.c").write <<~'EOS' + #include + #include + + int main() { + json_object *obj = json_object_new_object(); + json_object *value = json_object_new_string("value"); + json_object_object_add(obj, "key", value); + printf("%s\n", json_object_to_json_string(obj)); + return 0; + } + EOS + + system ENV.cc, "-I#{include}", "test.c", "-L#{lib}", "-ljson-c", "-o", "test" + assert_equal '{ "key": "value" }', shell_output("./test").chomp + end +end diff --git a/Formula/keyutils.rb b/Formula/keyutils.rb new file mode 100644 index 0000000..412e9a3 --- /dev/null +++ b/Formula/keyutils.rb @@ -0,0 +1,50 @@ +class Keyutils < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, x86_64_linux: "d5b06c4e38d2c4b7decb5b7bc0431b3416993231e5fa688950e4df83686a298d" + end + desc "Linux key management utilities" + homepage "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/keyutils.git" + url "https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/keyutils.git/snapshot/keyutils-1.6.3.tar.gz" + sha256 "a61d5706136ae4c05bd48f86186bcfdbd88dd8bd5107e3e195c924cfc1b39bb4" + license all_of: ["GPL-2.0-or-later", "LGPL-2.0-or-later"] + + + + depends_on :linux + + def install + inreplace "request-key.conf" do |s| + s.gsub! %r{(\s)/bin/key}, "\\1#{opt_bin}/key" + s.gsub! %r{(\s)/sbin/key}, "\\1#{opt_sbin}/key" + s.gsub! %r{(\s)/usr/share/#{name}/}, "\\1#{opt_pkgshare}/" + end + + args = %W[ + BINDIR=#{bin} + ETCDIR=#{etc} + INCLUDEDIR=#{include} + LIBDIR=#{lib} + MANDIR=#{man} + SBINDIR=#{sbin} + SHAREDIR=#{pkgshare} + USRLIBDIR=#{lib} + ] + system "make", "install", *args + end + + test do + assert_match version.to_s, shell_output("#{bin}/keyctl --version") + system bin/"keyctl", "supports" + + # CI container doesn't have permissions to modify keys/keyrings + return if ENV["HOMEBREW_GITHUB_ACTIONS"] + + (testpath/"test.sh").write <<~SHELL + keyring=$(#{bin}/keyctl new_session) + key=$(#{bin}/keyctl add user home brew "$keyring") + #{bin}/keyctl print "$key" + SHELL + assert_equal "brew\n", shell_output("bash -e test.sh") + end +end diff --git a/Formula/krb5.rb b/Formula/krb5.rb new file mode 100644 index 0000000..f1f55bb --- /dev/null +++ b/Formula/krb5.rb @@ -0,0 +1,68 @@ +class Krb5 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "a9db2ba99f3e99279c4aac0277cdba955510d27f09bde6051b100e660c1a1c28" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "2968bf9d040cd58eb2933ddf03cd004d1f9abe8b19bd7f028ea8666ad47714ab" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "5c06477705002279f07de13c147866235a99abe1495ae4deb1eed805ec542245" + end + desc "Network authentication protocol" + homepage "https://web.mit.edu/kerberos/" + url "https://kerberos.org/dist/krb5/1.22/krb5-1.22.2.tar.gz" + mirror "http://fresh-center.net/linux/misc/krb5-1.22.2.tar.gz" + sha256 "3243ffbc8ea4d4ac22ddc7dd2a1dc54c57874c40648b60ff97009763554eaf13" + # From Fedora: https://src.fedoraproject.org/rpms/krb5/blob/rawhide/f/krb5.spec + license all_of: [ + "BSD-2-Clause", + "BSD-2-Clause-first-lines", + "BSD-3-Clause", + "BSD-4-Clause", + "Brian-Gladman-2-Clause", + "CMU-Mach-nodoc", + "FSFULLRWD", + "HPND", + "HPND-export2-US", + "HPND-export-US", + "HPND-export-US-acknowledgement", + "HPND-export-US-modify", + "ISC", + "MIT", + "MIT-CMU", + "OLDAP-2.8", + "OpenVision", + any_of: ["BSD-2-Clause", "GPL-2.0-or-later"], + ] + compatibility_version 1 + + livecheck do + url :homepage + regex(/Current release: .*?>krb5[._-]v?(\d+(?:\.\d+)+) :build + + on_linux do + depends_on "keyutils" + end + + def install + cd "src" do + system "./configure", "--disable-nls", + "--disable-silent-rules", + "--without-system-verto", + *std_configure_args + system "make" + system "make", "install" + end + end + + test do + system bin/"krb5-config", "--version" + assert_match include.to_s, shell_output("#{bin}/krb5-config --cflags") + end +end diff --git a/Formula/lame.rb b/Formula/lame.rb new file mode 100644 index 0000000..416e630 --- /dev/null +++ b/Formula/lame.rb @@ -0,0 +1,42 @@ +class Lame < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "552d24d56ff0d3255e9a3519a368d0ce45de86b5b2967b338209c1a22cd12969" + sha256 cellar: :any, arm64_tahoe: "b0fe0cfb39c74a53b7635833fe3293a62c886b084bc5ccc8ed7cd177803182e4" + sha256 cellar: :any, x86_64_linux: "260e9309ef40e8ad7373bfae07f20d5357e036d32b14ea3ce6526fdf15181a37" + end + desc "High quality MPEG Audio Layer III (MP3) encoder" + homepage "https://lame.sourceforge.io/" + url "https://downloads.sourceforge.net/project/lame/lame/4.0/lame-4.0.tar.gz" + sha256 "3df5124d5ad3a98312ffd7ba6a9b36230e4f8a3e66d3ce0f425e336c32d216eb" + license "LGPL-2.0-or-later" + + livecheck do + url :stable + regex(%r{url=.*?/lame[._-]v?(\d+(?:\.\d+)+)\.t}i) + end + + + + depends_on "pkgconf" => :build + depends_on "mpg123" + + uses_from_macos "ncurses" + + def install + # LAME still calls undeclared legacy ID3 APIs, which do not compile as C23. + # https://sourceforge.net/p/lame/bugs/517/ + ENV["ac_cv_prog_cc_c23"] = "no" + ENV.append_to_cflags "-Wno-implicit-function-declaration" + + system "./configure", "--disable-dependency-tracking", + "--disable-debug", + "--prefix=#{prefix}", + "--enable-nasm" + system "make", "install" + end + + test do + system bin/"lame", "--genre-list", test_fixtures("test.mp3") + end +end diff --git a/Formula/libassuan.rb b/Formula/libassuan.rb new file mode 100644 index 0000000..14caa63 --- /dev/null +++ b/Formula/libassuan.rb @@ -0,0 +1,42 @@ +class Libassuan < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "1430611fe9f337d6a7568a12321f125c567ca8d4d2bdcd7ff0717bdcd82a32dc" + sha256 cellar: :any, arm64_tahoe: "0561b0dae24dbd1bfb2ebcc1b6ca6b4f10cab80d30a73558b8b87ab129415dc5" + sha256 cellar: :any_skip_relocation, x86_64_linux: "620108c517ecfeb00c843bd34f86b75bf84c1bd92be9b554c86424fad3b99f08" + end + desc "Assuan IPC Library" + homepage "https://www.gnupg.org/related_software/libassuan/" + url "https://gnupg.org/ftp/gcrypt/libassuan/libassuan-3.0.2.tar.bz2" + mirror "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/libassuan/libassuan-3.0.2.tar.bz2" + sha256 "d2931cdad266e633510f9970e1a2f346055e351bb19f9b78912475b8074c36f6" + license all_of: [ + "LGPL-2.1-or-later", + "GPL-3.0-or-later", # assuan.info + "FSFULLR", # libassuan-config, libassuan.m4 + ] + compatibility_version 1 + + livecheck do + url "https://gnupg.org/ftp/gcrypt/libassuan/" + regex(/href=.*?libassuan[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "libgpg-error" + + def install + system "./configure", "--disable-silent-rules", + "--enable-static", + *std_configure_args + system "make", "install" + + # avoid triggering mandatory rebuilds of software that hard-codes this path + inreplace bin/"libassuan-config", prefix, opt_prefix + end + + test do + system bin/"libassuan-config", "--version" + end +end diff --git a/Formula/libavif.rb b/Formula/libavif.rb new file mode 100644 index 0000000..0f1da9b --- /dev/null +++ b/Formula/libavif.rb @@ -0,0 +1,69 @@ +class Libavif < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "0d1a9ce6320d9ddacb3e7ca31bb2ef3216529755ab1df24eac833fec27b25c95" + sha256 cellar: :any, arm64_tahoe: "584d41a9ad0fd601fac27735b928483c3f8494d4e08d6461599f7fabc915783b" + sha256 cellar: :any_skip_relocation, x86_64_linux: "824125e726a4ea8c4495ef60d538ef5b769037bd9c4acc7c5a757d0cd03c4819" + end + desc "Library for encoding and decoding .avif files" + homepage "https://github.com/AOMediaCodec/libavif" + url "https://github.com/AOMediaCodec/libavif/archive/refs/tags/v1.4.2.tar.gz" + sha256 "2b645287340ba5a631d268b551dc2d72bd73ac33335962dd36dcdb6d8366921d" + license "BSD-2-Clause" + compatibility_version 1 + + + + depends_on "cmake" => :build + depends_on "aom" + depends_on "dav1d" + depends_on "jpeg-turbo" + depends_on "libpng" + + on_linux do + depends_on "zlib-ng-compat" + end + + resource "libargparse" do + url "https://github.com/kmurray/libargparse/archive/ee74d1b53bd680748af14e737378de57e2a0a954.tar.gz" + version "ee74d1b53bd680748af14e737378de57e2a0a954" + sha256 "7727b0498851e5b6a6fcd734eb667a8a231897e2c86a357aec51cc0664813060" + + livecheck do + url "https://raw.githubusercontent.com/AOMediaCodec/libavif/refs/tags/v#{LATEST_VERSION}/cmake/Modules/LocalLibargparse.cmake" + regex(/\(AVIF_LIBARGPARSE_GIT_TAG (\h+)\)/i) + end + end + + def install + resource("libargparse").unpack(buildpath/"ext/libargparse") + + args = %W[ + -DCMAKE_INSTALL_RPATH=#{rpath} + -DAVIF_CODEC_AOM=SYSTEM + -DAVIF_BUILD_APPS=ON + -DAVIF_CODEC_DAV1D=SYSTEM + -DAVIF_BUILD_EXAMPLES=OFF + -DAVIF_BUILD_TESTS=OFF + -DAVIF_LIBYUV=OFF + ] + + system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + pkgshare.install "examples" + end + + test do + system bin/"avifenc", test_fixtures("test.png"), testpath/"test.avif" + assert_path_exists testpath/"test.avif" + + system bin/"avifdec", testpath/"test.avif", testpath/"test.jpg" + assert_path_exists testpath/"test.jpg" + + example = pkgshare/"examples/avif_example_decode_file.c" + system ENV.cc, example, "-I#{include}", "-L#{lib}", "-lavif", "-o", "avif_example_decode_file" + output = shell_output("#{testpath}/avif_example_decode_file #{testpath}/test.avif") + assert_match "Parsed AVIF: 8x8", output + end +end diff --git a/Formula/libcap.rb b/Formula/libcap.rb new file mode 100644 index 0000000..2651eb8 --- /dev/null +++ b/Formula/libcap.rb @@ -0,0 +1,29 @@ +class Libcap < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, x86_64_linux: "4216b7a75d21bf4e9640630417cda23d055f1aa85298d3b6941f80b12c346cab" + end + desc "User-space interfaces to POSIX 1003.1e capabilities" + homepage "https://sites.google.com/site/fullycapable/" + url "https://mirrors.edge.kernel.org/pub/linux/libs/security/linux-privs/libcap2/libcap-2.78.tar.xz" + sha256 "0d621e562fd932ccf67b9660fb018e468a683d7b827541df27813228c996bb11" + license all_of: ["BSD-3-Clause", "GPL-2.0-or-later"] + compatibility_version 1 + + livecheck do + url "https://mirrors.edge.kernel.org/pub/linux/libs/security/linux-privs/libcap2/" + regex(/href=.*?libcap[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on :linux + + def install + system "make", "install", "prefix=#{prefix}", "lib=lib", "RAISE_SETFCAP=no" + end + + test do + assert_match "usage", shell_output("#{sbin}/getcap 2>&1", 1) + end +end diff --git a/Formula/libffi.rb b/Formula/libffi.rb new file mode 100644 index 0000000..d0c972e --- /dev/null +++ b/Formula/libffi.rb @@ -0,0 +1,90 @@ +class Libffi < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "ba141e26c8d3b55fa4534317c474b34d649355d93299e35aa33a6eebf60117f8" + sha256 cellar: :any, arm64_tahoe: "a36f51cb6041fb1c5e70a6300a05a58dfc3b3503e621f83198731f1eaed63f2f" + sha256 cellar: :any, x86_64_linux: "250d5150db65018e524595cae9de93f8d72ebe8a078bfde968eae51bdc1787fc" + end + desc "Portable Foreign Function Interface library" + homepage "https://sourceware.org/libffi/" + url "https://github.com/libffi/libffi/releases/download/v3.8.0/libffi-3.8.0.tar.gz" + sha256 "7da3e2d9a171eb0a038f592ecad3ff2bb2550f3496d87b3b29ad0cf4430c0db4" + license "MIT" + compatibility_version 1 + + livecheck do + url :stable + strategy :github_latest + end + + + + head do + url "https://github.com/libffi/libffi.git", branch: "master" + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + end + + keg_only :provided_by_macos + + def install + system "./autogen.sh" if build.head? + system "./configure", *std_configure_args + system "make", "install" + end + + test do + (testpath/"closure.c").write <<~C + #include + #include + + /* Acts like puts with the file given at time of enclosure. */ + void puts_binding(ffi_cif *cif, void *ret, void** args, void *stream) + { + *(unsigned int *)ret = fputs(*(char **)args[0], (FILE *)stream); + } + + int main() + { + ffi_cif cif; + ffi_type *args[1]; + ffi_closure *closure; + + int (*bound_puts)(char *); + int rc; + + /* Allocate closure and bound_puts */ + closure = ffi_closure_alloc(sizeof(ffi_closure), &bound_puts); + + if (closure) + { + /* Initialize the argument info vectors */ + args[0] = &ffi_type_pointer; + + /* Initialize the cif */ + if (ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1, + &ffi_type_uint, args) == FFI_OK) + { + /* Initialize the closure, setting stream to stdout */ + if (ffi_prep_closure_loc(closure, &cif, puts_binding, + stdout, bound_puts) == FFI_OK) + { + rc = bound_puts("Hello World!"); + /* rc now holds the result of the call to fputs */ + } + } + } + + /* Deallocate both closure, and bound_puts */ + ffi_closure_free(closure); + + return 0; + } + C + + flags = ["-L#{lib}", "-lffi", "-I#{include}"] + system ENV.cc, "-o", "closure", "closure.c", *(flags + ENV.cflags.to_s.split) + system "./closure" + end +end diff --git a/Formula/libgcrypt.rb b/Formula/libgcrypt.rb new file mode 100644 index 0000000..f1a7178 --- /dev/null +++ b/Formula/libgcrypt.rb @@ -0,0 +1,48 @@ +class Libgcrypt < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "8f05385898305e7f3f8717aead5162962b7266d1f25f8eb6b1f1aaf5ced87139" + sha256 cellar: :any, arm64_tahoe: "a28d181fc09720c699b5fefe62d41b3c75ad8ae73a080c989faa2acf6925d06d" + sha256 cellar: :any_skip_relocation, x86_64_linux: "941be22c944a367fc59d0dac07bce43ee16b3ea8b634389813bd9d2337a01926" + end + desc "Cryptographic library based on the code from GnuPG" + homepage "https://gnupg.org/related_software/libgcrypt/" + url "https://gnupg.org/ftp/gcrypt/libgcrypt/libgcrypt-1.12.2.tar.bz2" + sha256 "7ce33c2492221a0436f96a8500215e9f3e3dcb5fd26a757cd415e7a843babd5e" + license all_of: ["LGPL-2.1-or-later", "GPL-2.0-or-later"] + compatibility_version 1 + + livecheck do + url "https://gnupg.org/ftp/gcrypt/libgcrypt/" + regex(/href=.*?libgcrypt[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "libgpg-error" + + def install + system "./configure", "--disable-asm", + "--disable-silent-rules", + "--enable-static", + "--with-libgpg-error-prefix=#{formula_opt_prefix("libgpg-error")}", + *std_configure_args + + # The jitter entropy collector must be built without optimisations + ENV.O0 { system "make", "-C", "random", "rndjent.o", "rndjent.lo" } + + # Parallel builds work, but only when run as separate steps + system "make" + system "make", "check" + system "make", "install" + + # avoid triggering mandatory rebuilds of software that hard-codes this path + inreplace bin/"libgcrypt-config", prefix, opt_prefix + end + + test do + touch "testing" + output = shell_output("#{bin}/hmac256 \"testing\" testing") + assert_match "0e824ce7c056c82ba63cc40cffa60d3195b5bb5feccc999a47724cc19211aef6", output + end +end diff --git a/Formula/libgpg-error.rb b/Formula/libgpg-error.rb new file mode 100644 index 0000000..2932d2e --- /dev/null +++ b/Formula/libgpg-error.rb @@ -0,0 +1,42 @@ +class LibgpgError < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "d209486b1890cf8194a71c00d976bdb4708ff82336232e4b7b38c64f7686de6d" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "74ecfae7911e36e85f9400931acab43770544c7826a3e7a8176c6410dfc10735" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "17c06341c6fc696e36e41d204129ea1e30e90951807194694d146bd16263af6b" + end + desc "Common error values for all GnuPG components" + homepage "https://www.gnupg.org/related_software/libgpg-error/" + url "https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.61.tar.bz2" + sha256 "7a85413f2bc354f4f8aa832b718af122e48965e9e0eb9012ee659c13c6385c93" + license "LGPL-2.1-or-later" + compatibility_version 1 + + livecheck do + url "https://gnupg.org/ftp/gcrypt/libgpg-error/" + regex(/href=.*?libgpg-error[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + on_macos do + depends_on "gettext" + end + + def install + # NOTE: gpg-error-config is deprecated upstream, so we should remove this at some point. + # https://dev.gnupg.org/T5683 + system "./configure", *std_configure_args, + "--disable-silent-rules", + "--enable-install-gpg-error-config", + "--enable-static" + system "make", "install" + + # avoid triggering mandatory rebuilds of software that hard-codes this path + inreplace [bin/"gpg-error-config", lib/"pkgconfig/gpg-error.pc"], prefix, opt_prefix + end + + test do + system bin/"gpgrt-config", "--libs" + end +end diff --git a/Formula/libidn2.rb b/Formula/libidn2.rb new file mode 100644 index 0000000..debd694 --- /dev/null +++ b/Formula/libidn2.rb @@ -0,0 +1,78 @@ +class Libidn2 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "1eb02bfa40ec00b7ea64d8608fcf2115069d99de5a35eb3e2b3ac444a695ea46" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "f8f1b459f15a4ac11d2dce786a9140509782227b7d499cbdf3a1279dd325d90b" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "9e8c065bb543ee967667db82c00185419a108555ecbd965b2e6cebe202472e7f" + end + desc "International domain name library (IDNA2008, Punycode and TR46)" + homepage "https://www.gnu.org/software/libidn/#libidn2" + url "https://ftpmirror.gnu.org/gnu/libidn/libidn2-2.3.8.tar.gz" + mirror "https://ftp.gnu.org/gnu/libidn/libidn2-2.3.8.tar.gz" + mirror "http://ftp.gnu.org/gnu/libidn/libidn2-2.3.8.tar.gz" + sha256 "f557911bf6171621e1f72ff35f5b1825bb35b52ed45325dcdee931e5d3c0787a" + license all_of: [ + { any_of: ["GPL-2.0-or-later", "LGPL-3.0-or-later"] }, # lib + { all_of: ["Unicode-TOU", "Unicode-DFS-2016"] }, # matching COPYING.unicode + "GPL-3.0-or-later", # bin + "LGPL-2.1-or-later", # parts of gnulib + "FSFAP-no-warranty-disclaimer", # man3 + ] + compatibility_version 1 + + livecheck do + url :stable + regex(/href=.*?libidn2[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + head do + url "https://gitlab.com/libidn/libidn2.git", branch: "master" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "gengetopt" => :build + depends_on "gettext" => :build + depends_on "help2man" => :build + depends_on "libtool" => :build + + uses_from_macos "gperf" => :build + + on_macos do + depends_on "coreutils" => :build + end + + on_system :linux, macos: :ventura_or_newer do + depends_on "texinfo" => :build + end + end + + depends_on "pkgconf" => :build + depends_on "libunistring" + + on_macos do + depends_on "gettext" + end + + def install + args = ["--disable-silent-rules", "--with-packager=Homebrew"] + args << "--with-libintl-prefix=#{formula_opt_prefix("gettext")}" if OS.mac? + + if build.head? + ENV.prepend_path "PATH", Formula["coreutils"].libexec/"gnubin" if OS.mac? + system "./bootstrap", "--skip-po" + end + system "./configure", *args, *std_configure_args + system "make", "install" + end + + test do + ENV.delete("LC_CTYPE") + ENV["CHARSET"] = "UTF-8" + output = shell_output("#{bin}/idn2 räksmörgås.se") + assert_equal "xn--rksmrgs-5wao1o.se", output.chomp + output = shell_output("#{bin}/idn2 blåbærgrød.no") + assert_equal "xn--blbrgrd-fxak7p.no", output.chomp + end +end diff --git a/Formula/libimagequant.rb b/Formula/libimagequant.rb new file mode 100644 index 0000000..82fc871 --- /dev/null +++ b/Formula/libimagequant.rb @@ -0,0 +1,44 @@ +class Libimagequant < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "35636b9bf13cd99e77dec879e87736122925c790fec18da07dbcbea76083bdc6" + sha256 cellar: :any, arm64_tahoe: "9fe68c59c0500f834deced30fcd58c965148988f238d51791d39c6c284d71684" + sha256 cellar: :any_skip_relocation, x86_64_linux: "f9943e809de898982fbd65821564d201a4f88d0d902d504d2b8f4a059ab9c94c" + end + desc "Palette quantization library extracted from pnquant2" + homepage "https://pngquant.org/lib/" + url "https://github.com/ImageOptim/libimagequant/archive/refs/tags/4.4.1.tar.gz" + sha256 "2464a3e922b5a220b633d674062b82f0670114f8f3dd30d1935a621c95965f1b" + license all_of: ["GPL-3.0-or-later", "HPND"] + compatibility_version 1 + + + + depends_on "cargo-c" => :build + depends_on "rust" => :build + + def install + cd "imagequant-sys" do + system "cargo", "cinstall", "--jobs", ENV.make_jobs.to_s, "--release", "--prefix", prefix, "--libdir", lib + end + end + + test do + (testpath/"test.c").write <<~C + #include + + int main() + { + liq_attr *attr = liq_attr_create(); + if (!attr) { + return 1; + } else { + liq_attr_destroy(attr); + return 0; + } + } + C + system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-limagequant", "-o", "test" + system "./test" + end +end diff --git a/Formula/libksba.rb b/Formula/libksba.rb new file mode 100644 index 0000000..c23f46c --- /dev/null +++ b/Formula/libksba.rb @@ -0,0 +1,51 @@ +class Libksba < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "0f0fe7be0551bbc43def382b1a57b6c9c0cd389d9f6ff94e4814f13d874d57ab" + sha256 cellar: :any, arm64_tahoe: "a14ed50998df34e93b8eeedea30c7b953ebd07d2de779f6f040bcb628a8c03f0" + sha256 cellar: :any_skip_relocation, x86_64_linux: "a5518938a0b0907d4d12c0153dcba08245d65442e7ee1c0a5663e5935b591305" + end + desc "X.509 and CMS library" + homepage "https://www.gnupg.org/related_software/libksba/" + url "https://gnupg.org/ftp/gcrypt/libksba/libksba-1.8.0.tar.bz2" + sha256 "296b9db9095749f2aa104202d7ab7fd09ad10710e00780a709c9754b1a1d9292" + license any_of: ["LGPL-3.0-or-later", "GPL-2.0-or-later"] + compatibility_version 1 + + livecheck do + url "https://gnupg.org/ftp/gcrypt/libksba/" + regex(/href=.*?libksba[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "libgpg-error" + + def install + system "./configure", "--disable-dependency-tracking", + "--disable-silent-rules", + "--prefix=#{prefix}" + system "make", "check" + system "make", "install" + + # avoid triggering mandatory rebuilds of software that hard-codes this path + inreplace [bin/"ksba-config", lib/"pkgconfig/ksba.pc"], prefix, opt_prefix + end + + test do + (testpath/"ksba-test.c").write <<~C + #include "ksba.h" + #include + int main() { + printf("%s", ksba_check_version(NULL)); + return 0; + } + C + + ENV.append_to_cflags shell_output("#{bin}/ksba-config --cflags").strip + ENV.append "LDLIBS", shell_output("#{bin}/ksba-config --libs").strip + + system "make", "ksba-test" + assert_equal version.to_s, shell_output("./ksba-test") + end +end diff --git a/Formula/liblinear.rb b/Formula/liblinear.rb new file mode 100644 index 0000000..f77f1e6 --- /dev/null +++ b/Formula/liblinear.rb @@ -0,0 +1,52 @@ +class Liblinear < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "1447af1433e4c22bb65f7d1483e80be28eef54f01ea4975cbaab5eeddcbf0329" + sha256 cellar: :any, arm64_tahoe: "084eda55e8b1e787d35ba4b64b07973f28c03ba3b80caf34476453bfc0aa6fd3" + sha256 cellar: :any_skip_relocation, x86_64_linux: "746b7ce2c2f425061ad373dedcf34bb5daa031ebb059bbbc9424dbcd7f9ba9c1" + end + desc "Library for large linear classification" + homepage "https://www.csie.ntu.edu.tw/~cjlin/liblinear/" + url "https://www.csie.ntu.edu.tw/~cjlin/liblinear/oldfiles/liblinear-2.50.tar.gz" + sha256 "e5eeafe2159c41148b59304da2ba0ed12648e3d491ce2b9625058e174e96ca29" + license "BSD-3-Clause" + compatibility_version 1 + head "https://github.com/cjlin1/liblinear.git", branch: "master" + + livecheck do + url "https://www.csie.ntu.edu.tw/~cjlin/liblinear/oldfiles/" + regex(/href=.*?liblinear[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + # Fix sonames + patch :p0 do + file "Patches/liblinear/patch-Makefile.diff" + end + + def install + soversion_regex = /^SHVER = (\d+)$/ + soversion = (buildpath/"Makefile").read + .lines + .grep(soversion_regex) + .first[soversion_regex, 1] + system "make", "all" + bin.install "predict", "train" + lib.install shared_library("liblinear", soversion) + lib.install_symlink shared_library("liblinear", soversion) => shared_library("liblinear") + include.install "linear.h" + end + + test do + (testpath/"train_classification.txt").write <<~EOS + +1 201:1.2 3148:1.8 3983:1 4882:1 + -1 874:0.3 3652:1.1 3963:1 6179:1 + +1 1168:1.2 3318:1.2 3938:1.8 4481:1 + +1 350:1 3082:1.5 3965:1 6122:0.2 + -1 99:1 3057:1 3957:1 5838:0.3 + EOS + + system bin/"train", "train_classification.txt" + end +end diff --git a/Formula/libnghttp2.rb b/Formula/libnghttp2.rb new file mode 100644 index 0000000..1c55b9c --- /dev/null +++ b/Formula/libnghttp2.rb @@ -0,0 +1,66 @@ +class Libnghttp2 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "98443603fa19454935158d4a65c2ab53460484a72aae6a515b24743d440f8194" + sha256 cellar: :any, arm64_tahoe: "76cdf4d391ad60a312d8819d3ce644791756e2116b630c3cc991c46090a76919" + sha256 cellar: :any, x86_64_linux: "d61e952b59bbf3f1662e57005807fb1ad7586c97bc33ec73d883eefe06ba29d3" + end + desc "HTTP/2 C Library" + homepage "https://nghttp2.org/" + url "https://github.com/nghttp2/nghttp2/releases/download/v1.70.0/nghttp2-1.70.0.tar.gz" + mirror "http://fresh-center.net/linux/www/nghttp2-1.70.0.tar.gz" + mirror "http://fresh-center.net/linux/www/legacy/nghttp2-1.70.0.tar.gz" + # this legacy mirror is for user to install from the source when https not working for them + # see discussions in here, https://github.com/Homebrew/homebrew-core/pull/133078#discussion_r1221941917 + sha256 "aa317e2cf9dca6afa0aed68f8fad6ff303ec6982e25a78c75c0b65e2b9b3ded5" + license "MIT" + compatibility_version 1 + + livecheck do + formula "nghttp2" + end + + + + head do + url "https://github.com/nghttp2/nghttp2.git", branch: "master" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + end + + depends_on "pkgconf" => :build + + # These used to live in `nghttp2`. + link_overwrite "include/nghttp2" + link_overwrite "lib/libnghttp2.a" + link_overwrite "lib/libnghttp2.dylib" + link_overwrite "lib/libnghttp2.14.dylib" + link_overwrite "lib/libnghttp2.so" + link_overwrite "lib/libnghttp2.so.14" + link_overwrite "lib/pkgconfig/libnghttp2.pc" + + def install + system "autoreconf", "--force", "--install", "--verbose" if build.head? + system "./configure", "--enable-lib-only", *std_configure_args + system "make", "-C", "lib" + system "make", "-C", "lib", "install" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + + int main() { + nghttp2_info *info = nghttp2_version(0); + printf("%s", info->version_str); + return 0; + } + C + + system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lnghttp2", "-o", "test" + assert_equal version.to_s, shell_output("./test") + end +end diff --git a/Formula/libnghttp3.rb b/Formula/libnghttp3.rb new file mode 100644 index 0000000..d7ea87c --- /dev/null +++ b/Formula/libnghttp3.rb @@ -0,0 +1,44 @@ +class Libnghttp3 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "7d805c2219e1473377ac0d7b6ba6465d278ad016e71a535d9c89308c4e7f95fd" + sha256 cellar: :any, arm64_tahoe: "896929daeacaf435ed2a119156d648526ee7ab83394f50f207b5a4dda376025a" + sha256 cellar: :any, x86_64_linux: "23d4c3f5d3b91b6fab9f77b66e96484ba9c389a88768e3d792037cbf2c46c2e4" + end + desc "HTTP/3 library written in C" + homepage "https://nghttp2.org/nghttp3/" + url "https://github.com/ngtcp2/nghttp3/releases/download/v1.18.0/nghttp3-1.18.0.tar.xz" + mirror "http://fresh-center.net/linux/www/nghttp3-1.18.0.tar.xz" + sha256 "aad782c23d3f01bd4bb52c8bac7a553b631ef8115fd1612703df6183449fef19" + license "MIT" + compatibility_version 1 + head "https://github.com/ngtcp2/nghttp3.git", branch: "main" + + + + depends_on "cmake" => :build + + def install + system "cmake", "-S", ".", "-B", "build", "-DENABLE_LIB_ONLY=1", *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + (testpath/"test.c").write <<~C + #include + + int main(void) { + nghttp3_qpack_decoder *decoder; + if (nghttp3_qpack_decoder_new(&decoder, 4096, 0, nghttp3_mem_default()) != 0) { + return 1; + } + nghttp3_qpack_decoder_del(decoder); + return 0; + } + C + + system ENV.cc, "test.c", "-o", "test", "-I#{include}", "-L#{lib}", "-lnghttp3" + system "./test" + end +end diff --git a/Formula/libngtcp2.rb b/Formula/libngtcp2.rb new file mode 100644 index 0000000..a491510 --- /dev/null +++ b/Formula/libngtcp2.rb @@ -0,0 +1,235 @@ +class Libngtcp2 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "863fe84438291c89a972d647eee6d6099620b7c77039e6d84d704076e25de21c" + sha256 cellar: :any, arm64_tahoe: "301e7664d107756e42c21a981628ef09fa9a9b86731286deba8e0ccbce89fb54" + sha256 cellar: :any, x86_64_linux: "6c5b43b89a08020041b734e63d6c7048e151726a8f9072e58ae677fb21e615e3" + end + desc "IETF QUIC protocol implementation" + homepage "https://nghttp2.org/ngtcp2/" + url "https://github.com/ngtcp2/ngtcp2/releases/download/v1.25.0/ngtcp2-1.25.0.tar.xz" + mirror "http://fresh-center.net/linux/www/ngtcp2-1.25.0.tar.xz" + sha256 "2a34d2484ba17847a5d11965704e9dd0fac4c6d8efc75ffe1ec7de66d8c6b6fb" + license "MIT" + compatibility_version 1 + head "https://github.com/ngtcp2/ngtcp2.git", branch: "main" + + + + depends_on "pkgconf" => :build + depends_on "openssl@3" + + def install + system "./configure", "--disable-silent-rules", *std_configure_args + system "make", "install" + end + + test do + # Warning: aggressive vibe-coding below. + (testpath/"test-ngtcp2.c").write <<~C + #include + #include + #include + #include + + static int recv_client_initial(ngtcp2_conn *conn, const ngtcp2_cid *dcid, void *user_data) { + // Do nothing — just return 0 to indicate success + return 0; + } + + static int recv_crypto_data(ngtcp2_conn *conn, + ngtcp2_encryption_level encryption_level, + uint64_t offset, + const uint8_t *data, + size_t datalen, + void *user_data) { + // Accept all crypto data without processing + return 0; + } + + static int encrypt_cb(uint8_t *dest, + const ngtcp2_crypto_aead *aead, + const ngtcp2_crypto_aead_ctx *ctx, + const uint8_t *plaintext, size_t plaintextlen, + const uint8_t *nonce, size_t noncelen, + const uint8_t *ad, size_t adlen) { + // Dummy encryption: just memcpy the plaintext to dest. + // Not secure! Just for smoke testing. + memcpy(dest, plaintext, plaintextlen); + return 0; // success + } + + static int decrypt_cb(uint8_t *dest, + const ngtcp2_crypto_aead *aead, + const ngtcp2_crypto_aead_ctx *ctx, + const uint8_t *ciphertext, size_t ciphertextlen, + const uint8_t *nonce, size_t noncelen, + const uint8_t *ad, size_t adlen) { + // Dummy decryption: just memcpy ciphertext to dest + memcpy(dest, ciphertext, ciphertextlen); + return 0; + } + + static int hp_mask_cb(uint8_t *dest, + const ngtcp2_crypto_cipher *hp, + const ngtcp2_crypto_cipher_ctx *hp_ctx, + const uint8_t *sample) { + // For test: zero out header protection mask + memset(dest, 0, 5); + return 0; + } + + static void rand_cb(uint8_t *dest, size_t destlen, const ngtcp2_rand_ctx *ctx) { + // Dummy randomness: fill with incrementing values + for (size_t i = 0; i < destlen; ++i) { + dest[i] = (uint8_t)i; + } + } + + static int get_new_connection_id_cb(ngtcp2_conn *conn, + ngtcp2_cid *cid, + uint8_t *token, + size_t cidlen, + void *user_data) { + // Dummy CID: fill with pattern + for (size_t i = 0; i < cidlen; ++i) { + cid->data[i] = (uint8_t)(0xA0 + i); + } + cid->datalen = cidlen; + + // Dummy stateless reset token + memset(token, 0, NGTCP2_STATELESS_RESET_TOKENLEN); + + return 0; + } + + static void delete_crypto_aead_ctx_cb(ngtcp2_conn *conn, + ngtcp2_crypto_aead_ctx *aead_ctx, + void *user_data) { + // For smoke testing, nothing to free + (void)conn; + (void)aead_ctx; + (void)user_data; + } + + static int update_key_cb(ngtcp2_conn *conn, + uint8_t *rx_secret, + uint8_t *tx_secret, + ngtcp2_crypto_aead_ctx *rx_ctx, + uint8_t *rx_key, + ngtcp2_crypto_aead_ctx *tx_ctx, + uint8_t *tx_key, + const uint8_t *current_rx_secret, + const uint8_t *current_tx_secret, + size_t secretlen, + void *user_data) { + // Dummy key update: just copy old secrets and keys + memcpy(rx_secret, current_rx_secret, secretlen); + memcpy(tx_secret, current_tx_secret, secretlen); + + memset(rx_key, 0, 32); // Dummy key + memset(tx_key, 0, 32); + + memset(rx_ctx, 0, sizeof(*rx_ctx)); + memset(tx_ctx, 0, sizeof(*tx_ctx)); + + return 0; + } + + static void delete_crypto_cipher_ctx_cb(ngtcp2_conn *conn, + ngtcp2_crypto_cipher_ctx *cipher_ctx, + void *user_data) { + // No-op for smoke testing + (void)conn; + (void)cipher_ctx; + (void)user_data; + } + + static int get_path_challenge_data_cb(ngtcp2_conn *conn, + uint8_t *data, + void *user_data) { + // Dummy 8-byte challenge + for (int i = 0; i < 8; ++i) { + data[i] = (uint8_t)(0xC0 + i); + } + return 0; + } + + int main(void) { + ngtcp2_conn *conn = NULL; + + // Initialize callbacks (all NULL for now) + ngtcp2_callbacks callbacks; + memset(&callbacks, 0, sizeof(callbacks)); + callbacks.recv_client_initial = recv_client_initial; + callbacks.recv_crypto_data = recv_crypto_data; + callbacks.encrypt = encrypt_cb; + callbacks.decrypt = decrypt_cb; + callbacks.hp_mask = hp_mask_cb; + callbacks.rand = rand_cb; + callbacks.get_new_connection_id = get_new_connection_id_cb; + callbacks.update_key = update_key_cb; + callbacks.delete_crypto_aead_ctx = delete_crypto_aead_ctx_cb; + callbacks.delete_crypto_cipher_ctx = delete_crypto_cipher_ctx_cb; + callbacks.get_path_challenge_data = get_path_challenge_data_cb; + + // Connection IDs + ngtcp2_cid dcid, scid; + ngtcp2_cid_init(&dcid, (const uint8_t *)"\x01", 1); + ngtcp2_cid_init(&scid, (const uint8_t *)"\x02", 1); + + // Settings + ngtcp2_settings settings; + ngtcp2_settings_default(&settings); + + // Transport parameters + ngtcp2_transport_params params; + memset(¶ms, 0, sizeof(params)); + params.initial_max_stream_data_bidi_local = 65535; + params.initial_max_data = 65535; + params.active_connection_id_limit = NGTCP2_DEFAULT_ACTIVE_CONNECTION_ID_LIMIT; + + // Required for server connections: + params.original_dcid_present = 1; + params.original_dcid = dcid; + + // Path (required now) + ngtcp2_path path; + memset(&path, 0, sizeof(path)); + + // QUIC version (use draft-29 as default for test; or NGTCP2_PROTO_VER_V1 if available) + uint32_t version = NGTCP2_PROTO_VER_V1; + + int rv = ngtcp2_conn_server_new( + &conn, + &dcid, + &scid, + &path, + version, + &callbacks, + &settings, + ¶ms, + NULL, // token + NULL // user_data + ); + + if (rv != 0) { + fprintf(stderr, "ngtcp2_conn_server_new failed: %s (%d)", ngtcp2_strerror(rv), rv); + return 1; + } + + printf("ngtcp2_conn_server_new succeeded."); + + ngtcp2_conn_del(conn); + return 0; + } + C + + ENV.append_to_cflags "-I#{include}" + ENV.append "LDFLAGS", "-L#{lib}" + ENV.append "LDLIBS", "-lngtcp2" + + system "make", "test-ngtcp2" + system "./test-ngtcp2" + end +end diff --git a/Formula/libnsl.rb b/Formula/libnsl.rb new file mode 100644 index 0000000..07c0b3a --- /dev/null +++ b/Formula/libnsl.rb @@ -0,0 +1,62 @@ +class Libnsl < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 1 + sha256 cellar: :any_skip_relocation, x86_64_linux: "fa7613b30e9bfe15166339d119c19115ec21f13cea259280182e0c083502ff40" + end + desc "Public client interface for NIS(YP) and NIS+" + homepage "https://github.com/thkukuk/libnsl" + url "https://github.com/thkukuk/libnsl/releases/download/v2.0.1/libnsl-2.0.1.tar.xz" + sha256 "5c9e470b232a7acd3433491ac5221b4832f0c71318618dc6aa04dd05ffcd8fd9" + license "LGPL-2.1-or-later" + compatibility_version 1 + + + + depends_on "pkgconf" => :build + depends_on "libtirpc" + depends_on :linux + + link_overwrite "include/rpcsvc" + link_overwrite "lib/libnsl.a" + link_overwrite "lib/libnsl.so" + + def install + system "./configure", *std_configure_args, + "--disable-silent-rules" + system "make" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~'EOS' + #include + + int main(int argc, char *argv[]) { + char *domain; + switch (yp_get_default_domain(&domain)) { + case YPERR_SUCCESS: + printf("Domain: %s\n", domain); + return 0; + case YPERR_NODOM: + printf("No domain\n"); + return 0; + default: + return 1; + } + } + EOS + + system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lnsl", "-o", "test" + + domain = Utils.popen_read("ypdomainname").chomp + domain_exists = $CHILD_STATUS.success? + + output = shell_output("./test").chomp + if domain_exists + assert_equal "Domain: #{domain}", output + else + assert_equal "No domain", output + end + end +end diff --git a/Formula/libogg.rb b/Formula/libogg.rb new file mode 100644 index 0000000..b15d6ce --- /dev/null +++ b/Formula/libogg.rb @@ -0,0 +1,84 @@ +class Libogg < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "2423ff6b931f0393cd314052a7328a61fdd6f1d8519b65c4dff5ab560f82c52d" + sha256 cellar: :any, arm64_tahoe: "4d9d14f8e36ed913c02201bfc01682ba3f550de412e9a24e3ef9aed4f1b8a23d" + sha256 cellar: :any_skip_relocation, x86_64_linux: "e4fb064699caad0097ce135c7212022d1dc230424fb3b63c379731ab44ea8e42" + end + desc "Ogg Bitstream Library" + homepage "https://www.xiph.org/ogg/" + url "https://ftp.osuosl.org/pub/xiph/releases/ogg/libogg-1.3.6.tar.gz" + mirror "https://github.com/xiph/ogg/releases/download/v1.3.6/libogg-1.3.6.tar.gz" + sha256 "83e6704730683d004d20e21b8f7f55dcb3383cdf84c0daedf30bde175f774638" + license "BSD-3-Clause" + compatibility_version 1 + head "https://gitlab.xiph.org/xiph/ogg.git", branch: "main" + + livecheck do + url "https://ftp.osuosl.org/pub/xiph/releases/ogg/?C=M&O=D" + regex(%r{href=(?:["']?|.*?/)libogg[._-]v?(\d+(?:\.\d+)+)\.t}i) + end + + + + depends_on "cmake" => :build + + def install + system "cmake", "-S", ".", "-B", "build", "-DBUILD_SHARED_LIBS=TRUE", *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + + system "cmake", "-S", ".", "-B", "build-static", "-DBUILD_SHARED_LIBS=FALSE", *std_cmake_args + system "cmake", "--build", "build-static" + lib.install "build-static/libogg.a" + end + + test do + resource "oggfile" do + url "https://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg" + sha256 "f57b56d8aae4c847cf01224fb45293610d801cfdac43d932b5eeab1cd318182a" + end + + (testpath/"test.c").write <<~C + #include + #include + + int main (void) { + ogg_sync_state oy; + ogg_stream_state os; + ogg_page og; + ogg_packet op; + char *buffer; + int bytes; + + ogg_sync_init (&oy); + + // Read all available input to avoid broken pipe + do { + buffer = ogg_sync_buffer (&oy, 4096); + bytes = fread(buffer, 1, 4096, stdin); + ogg_sync_wrote (&oy, bytes); + } while (bytes == 4096); + + if (ogg_sync_pageout (&oy, &og) != 1) + return 1; + ogg_stream_init (&os, ogg_page_serialno (&og)); + if (ogg_stream_pagein (&os, &og) < 0) + return 1; + if (ogg_stream_packetout (&os, &op) != 1) + return 1; + + return 0; + } + C + testpath.install resource("oggfile") + system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-logg", + "-o", "test" + + # Should work on an OGG file + pipe_output("./test", (testpath/"Example.ogg").read, 0) + + # Expected to fail on a non-OGG file + pipe_output("./test", test_fixtures("test.wav").read, 1) + end +end diff --git a/Formula/libpng.rb b/Formula/libpng.rb new file mode 100644 index 0000000..70c1b67 --- /dev/null +++ b/Formula/libpng.rb @@ -0,0 +1,67 @@ +class Libpng < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "3d976f549e04ea0695078e5d8a3ae08c62e4dccd2b92f5b83c3ee9f1708c001b" + sha256 cellar: :any, arm64_tahoe: "a28e1e29bf508ddf89800c215a013694c2751ca63e8ae40aca859aff7bf7b02c" + sha256 cellar: :any_skip_relocation, x86_64_linux: "b5099e23c861337cff22c4b5a8c4f110b5e3bb0a3f5686fcd62f6377fac894b3" + end + desc "Library for manipulating PNG images" + homepage "https://www.libpng.org/pub/png/libpng.html" + url "https://downloads.sourceforge.net/project/libpng/libpng16/1.6.58/libpng-1.6.58.tar.xz" + sha256 "28eb403f51f0f7405249132cecfe82ea5c0ef97f1b32c5a65828814ae0d34775" + license "libpng-2.0" + compatibility_version 1 + + livecheck do + url :stable + regex(%r{url=.*?/libpng[._-]v?(\d+(?:\.\d+)+)\.t}i) + end + + + + head do + url "https://github.com/pnggroup/libpng.git", branch: "libpng16" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + end + + on_linux do + depends_on "zlib-ng-compat" + + # Use Fedora's regenerated test PNG for zlib-ng-compat compression + resource "pngtest.png" do + url "https://src.fedoraproject.org/rpms/libpng/raw/49e9a06ca115aaa911dd3419ee79c1870d1428fb/f/pngtest.png" + sha256 "f925a657a5343cfb724414c01e87afd4d60b1f82a46edc0e11f016a126f84064" + end + end + + def install + resource("pngtest.png").stage(buildpath) if OS.linux? + + system "./configure", "--disable-silent-rules", *std_configure_args + system "make" + system "make", "test" + system "make", "install" + + # Avoid rebuilds of dependants that hardcode this path. + inreplace lib/"pkgconfig/libpng.pc", prefix, opt_prefix + end + + test do + (testpath/"test.c").write <<~C + #include + + int main(void) + { + png_structp png_ptr; + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + png_destroy_write_struct(&png_ptr, (png_infopp)NULL); + return 0; + } + C + system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lpng", "-o", "test" + system "./test" + end +end diff --git a/Formula/libpsl.rb b/Formula/libpsl.rb new file mode 100644 index 0000000..7b9a5ac --- /dev/null +++ b/Formula/libpsl.rb @@ -0,0 +1,63 @@ +class Libpsl < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "15d0b4ffc8d173f93e5baf76eadd797b44106e82cbb378a22793b263e78578f9" + sha256 cellar: :any, arm64_tahoe: "6c38c3245d2b76a345a811f75674bd6ead4b6c55e083bc8a968d55ea22f36d1b" + sha256 cellar: :any, x86_64_linux: "f1450e6e5c4d7d0afbc078cdcee3015885c4542bd8a6c8221bf2434f4cdf7dcb" + end + desc "C library for the Public Suffix List" + homepage "https://rockdaboot.github.io/libpsl" + url "https://github.com/rockdaboot/libpsl/releases/download/0.23.1/libpsl-0.23.1.tar.gz" + mirror "http://distfiles.macports.org/libpsl/libpsl-0.23.1.tar.gz" + mirror "http://ftp2.osuosl.org/pub/blfs/conglomeration/libpsl/libpsl-0.23.1.tar.gz" + sha256 "8fbb03054556498ba9c4cc48fcaa36a4483748c6504a65bdb9ba348f555b0e56" + license "MIT" + compatibility_version 1 + + + + depends_on "pkgconf" => :build + + on_system :linux, macos: :monterey_or_older do + depends_on "libidn2" + depends_on "libunistring" + end + + def install + runtime = (OS.linux? || MacOS.version <= :monterey) ? "libidn2" : "libicucore" + args = %W[ + --disable-silent-rules + --enable-builtin + --enable-runtime=#{runtime} + ] + system "./configure", *args, *std_configure_args + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + #include + + #include + + int main(void) + { + const psl_ctx_t *psl = psl_builtin(); + + const char *domain = ".eu"; + assert(psl_is_public_suffix(psl, domain)); + + const char *host = "www.example.com"; + const char *expected_domain = "example.com"; + const char *actual_domain = psl_registrable_domain(psl, host); + assert(strcmp(actual_domain, expected_domain) == 0); + + return 0; + } + C + system ENV.cc, "-o", "test", "test.c", "-I#{include}", "-L#{lib}", "-lpsl" + system "./test" + end +end diff --git a/Formula/libraqm.rb b/Formula/libraqm.rb new file mode 100644 index 0000000..492abbb --- /dev/null +++ b/Formula/libraqm.rb @@ -0,0 +1,45 @@ +class Libraqm < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "562eae89ec18a9e0fe45e3c3337e029802fe59263acf4fb4da8509c8a6986a43" + sha256 cellar: :any, arm64_tahoe: "cc58087be4b56fc11117a57536b22de178c9349003baa4d2d46b1f650468bbbe" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "fd5e6f285625d73d32d5869a0d364479c2251a7a7e53ecdbc477444631cf8603" + end + desc "Library for complex text layout" + homepage "https://github.com/HOST-Oman/libraqm" + url "https://github.com/HOST-Oman/libraqm/archive/refs/tags/v0.11.0.tar.gz" + sha256 "2ba3521d3f24e9696185a67a16f1a9643429d6c897d89d83dfb2aad3a398732a" + license "MIT" + compatibility_version 1 + + + + depends_on "meson" => :build + depends_on "ninja" => :build + depends_on "pkgconf" => :build + depends_on "freetype" + depends_on "fribidi" + depends_on "harfbuzz" + + def install + system "meson", "setup", "build", *std_meson_args + system "meson", "compile", "-C", "build", "--verbose" + system "meson", "install", "-C", "build" + end + + test do + (testpath/"test.c").write <<~C + #include + + int main() { + return 0; + } + C + + system ENV.cc, "test.c", + "-I#{include}", + "-I#{Formula["freetype"].include/"freetype2"}", + "-o", "test" + system "./test" + end +end diff --git a/Formula/libsecret.rb b/Formula/libsecret.rb new file mode 100644 index 0000000..c132570 --- /dev/null +++ b/Formula/libsecret.rb @@ -0,0 +1,84 @@ +class Libsecret < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "79874cb427ebe11a1e139f777e566d34c8be68ca97a25020f128c8052d7b2f7b" + sha256 cellar: :any, arm64_tahoe: "ee55da32af1c04e94e871fc0bc012524bf46c64adf3012991a6c0e2fae089135" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "223ea87975e39fd3bb9ef2d04ea31c1c13b7f797199db96d2d2796b7e7856bf5" + end + desc "Library for storing/retrieving passwords and other secrets" + homepage "https://wiki.gnome.org/Projects/Libsecret" + url "https://download.gnome.org/sources/libsecret/0.21/libsecret-0.21.7.tar.xz" + sha256 "6b452e4750590a2b5617adc40026f28d2f4903de15f1250e1d1c40bfd68ed55e" + # Excluding GPL-2.0-or-later and Apache-2.0 which are for tests + license "LGPL-2.1-or-later" + compatibility_version 1 + + # libsecret doesn't use GNOME's "even-numbered minor is stable" version + # scheme. This regex is the same as the one generated by the `Gnome` strategy + # but it's necessary to avoid the related version scheme logic. + livecheck do + url :stable + regex(/libsecret[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "docbook-xsl" => :build + depends_on "gettext" => :build + depends_on "gobject-introspection" => :build + depends_on "meson" => :build + depends_on "ninja" => :build + depends_on "pkgconf" => [:build, :test] + depends_on "vala" => :build + depends_on "glib" + depends_on "libgcrypt" + uses_from_macos "libxslt" => :build + uses_from_macos "expat" + + on_macos do + depends_on "gettext" + end + + def install + ENV["XML_CATALOG_FILES"] = "#{etc}/xml/catalog" + + system "meson", "setup", "build", "-Dbashcompdir=#{bash_completion}", + "-Dgtk_doc=false", + *std_meson_args + system "meson", "compile", "-C", "build", "--verbose" + system "meson", "install", "-C", "build" + end + + test do + (testpath/"test.c").write <<~C + #include + + const SecretSchema * example_get_schema (void) G_GNUC_CONST; + + const SecretSchema * + example_get_schema (void) + { + static const SecretSchema the_schema = { + "org.example.Password", SECRET_SCHEMA_NONE, + { + { "number", SECRET_SCHEMA_ATTRIBUTE_INTEGER }, + { "string", SECRET_SCHEMA_ATTRIBUTE_STRING }, + { "even", SECRET_SCHEMA_ATTRIBUTE_BOOLEAN }, + { "NULL", 0 }, + } + }; + return &the_schema; + } + + int main() + { + example_get_schema(); + return 0; + } + C + + flags = shell_output("pkgconf --cflags --libs libsecret-1").chomp.split + system ENV.cc, "test.c", "-o", "test", *flags + system "./test" + end +end diff --git a/Formula/libsndfile.rb b/Formula/libsndfile.rb new file mode 100644 index 0000000..698ec11 --- /dev/null +++ b/Formula/libsndfile.rb @@ -0,0 +1,55 @@ +class Libsndfile < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "2d6a8173ef41359c3da4c78a5d5eb402846e480c509b868f671b80a17726f9c4" + sha256 cellar: :any, arm64_tahoe: "7788d515f9bc665779112b28a86810a2ac4bc5fb94a763df5d1188e461efce98" + sha256 cellar: :any_skip_relocation, x86_64_linux: "b40061adc0ea00923ea38c2c472eccc172e702398c2ddd3c705bf0dd6b16cbed" + end + desc "C library for files containing sampled sound" + homepage "https://libsndfile.github.io/libsndfile/" + url "https://github.com/libsndfile/libsndfile/releases/download/1.2.2/libsndfile-1.2.2.tar.xz" + sha256 "3799ca9924d3125038880367bf1468e53a1b7e3686a934f098b7e1d286cdb80e" + license "LGPL-2.1-or-later" + revision 1 + compatibility_version 1 + livecheck do + url :stable + strategy :github_latest + end + + + + depends_on "cmake" => :build + depends_on "flac" + depends_on "lame" + depends_on "libogg" + depends_on "libvorbis" + depends_on "mpg123" + depends_on "opus" + + uses_from_macos "python" => :build + + def install + args = %W[ + -DBUILD_PROGRAMS=ON + -DENABLE_PACKAGE_CONFIG=ON + -DINSTALL_PKGCONFIG_MODULE=ON + -DBUILD_EXAMPLES=OFF + -DCMAKE_INSTALL_RPATH=#{rpath} + -DPYTHON_EXECUTABLE=#{which("python3")} + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + ] + + system "cmake", "-S", ".", "-B", "build", "-DBUILD_SHARED_LIBS=ON", *args, *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + system "cmake", "-S", ".", "-B", "static", "-DBUILD_SHARED_LIBS=OFF", *args, *std_cmake_args + system "cmake", "--build", "static" + lib.install "static/libsndfile.a" + end + + test do + output = shell_output("#{bin}/sndfile-info #{test_fixtures("test.wav")}") + assert_match "Duration : 00:00:00.064", output + end +end diff --git a/Formula/libsoxr.rb b/Formula/libsoxr.rb new file mode 100644 index 0000000..20c0401 --- /dev/null +++ b/Formula/libsoxr.rb @@ -0,0 +1,60 @@ +class Libsoxr < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 1 + sha256 cellar: :any, arm64_sequoia: "164c5e70f213a0cdd5b9a764da773e79bc35753efc54d46e0710aee172de3640" + sha256 cellar: :any, arm64_tahoe: "6fd815529e1078139d7965e7bb7e92b4fa5680e74ca671357aaf4c0e1ea1dc95" + sha256 cellar: :any_skip_relocation, x86_64_linux: "1753c0562a6494e1437dc79db88d4672bb4b2e2a2b9134ac85952b555baf8559" + end + desc "High quality, one-dimensional sample-rate conversion library" + homepage "https://sourceforge.net/projects/soxr/" + url "https://downloads.sourceforge.net/project/soxr/soxr-0.1.3-Source.tar.xz" + sha256 "b111c15fdc8c029989330ff559184198c161100a59312f5dc19ddeb9b5a15889" + license "LGPL-2.1-or-later" + compatibility_version 1 + + livecheck do + url :stable + regex(%r{url=.*?/soxr[._-]v?(\d+(?:\.\d+)+)(?:-Source)?\.t}i) + end + + + + depends_on "cmake" => :build + + # Fixes the build on 64-bit ARM macOS; the __arm__ define used in the + # code isn't defined on 64-bit Apple Silicon. + # Upstream pull request: https://sourceforge.net/p/soxr/code/merge-requests/5/ + patch do + file "Patches/libsoxr/arm64_defines.patch" + end + + def install + args = %w[ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 + ] + system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + (testpath/"test.c").write <<~C + #include + + int main() + { + char const *version = 0; + version = soxr_version(); + if (version == 0) + { + return 1; + } + return 0; + } + C + + system ENV.cc, "-L#{lib}", "test.c", "-lsoxr", "-o", "test" + system "./test" + end +end diff --git a/Formula/libssh2.rb b/Formula/libssh2.rb new file mode 100644 index 0000000..6d42548 --- /dev/null +++ b/Formula/libssh2.rb @@ -0,0 +1,155 @@ +class Libssh2 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "cb769ecbc0bbe4c71dd2c1dfd95b5b44433824065cce6e9a7ba639b835f54263" + sha256 cellar: :any, arm64_tahoe: "2700fe402d514ccc6de4d21bf893fea1f346c97ff1668a448a1db1aa2e67c900" + sha256 cellar: :any, sequoia: "77458987f6ef9dc1a0c888f0ae98705e6e8c2b1073dbf6b314042e814d18e68d" + sha256 cellar: :any, x86_64_linux: "97de8d2b3b5ba7320aa04d16f11f98e86b79b70906ac8009fe5e4249b2d3c0b0" + end + desc "C library implementing the SSH2 protocol" + homepage "https://libssh2.org/" + url "https://libssh2.org/download/libssh2-1.11.1.tar.gz" + mirror "https://github.com/libssh2/libssh2/releases/download/libssh2-1.11.1/libssh2-1.11.1.tar.gz" + mirror "http://download.openpkg.org/components/cache/libssh2/libssh2-1.11.1.tar.gz" + sha256 "d9ec76cbe34db98eec3539fe2c899d26b0c837cb3eb466a56b0f109cabf658f7" + license "BSD-3-Clause" + revision 4 + compatibility_version 1 + + livecheck do + url "https://libssh2.org/download/" + regex(/href=.*?libssh2[._-]v?(\d+(?:\.\d+)+)\./i) + end + + + + head do + url "https://github.com/libssh2/libssh2.git", branch: "master" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + end + + depends_on "openssl@3" + + on_linux do + depends_on "zlib-ng-compat" + end + + # Backport of https://github.com/libssh2/libssh2/commit/2dae3024897e1898d389835151f4e9606227721d + # with a call to `LIBSSH2_UNCONST` removed which doesn't exist in 1.11.1. + # This modification has been vetted and approved at https://github.com/libssh2/libssh2/issues/2125. + # Patch can be removed with the next release. + patch do + file "Patches/libssh2/CVE-2025-15661.patch" + type :backport + resolves "CVE-2025-15661" + end + + # Remove with the next release. + patch do + url "https://github.com/libssh2/libssh2/commit/256d04b60d80bf1190e96b0ad1e91b2174d744b1.patch?full_index=1" + sha256 "7c5fe26b0b58fb3ee3770c8a7648eddec09845fe016eff22b9074451d1a60c34" + type :backport + resolves "CVE-2026-7598" + end + + # Remove with the next release. + patch do + url "https://github.com/libssh2/libssh2/commit/17626857d20b3c9a1addfa45979dadcee1cd84a4.patch?full_index=1" + sha256 "a236d5cfe1995a85c3b036ab16cc2672aa316fd3e1d6299100bcc4c07a539fd7" + type :backport + resolves "CVE-2026-55199" + end + + # Backport of https://github.com/libssh2/libssh2/commit/97acf3dfda80c91c3a8c9f2372546301d4a1a7a8 + # with a simple conflict fixed. + # Remove with the next release. + patch do + file "Patches/libssh2/CVE-2026-55200.patch" + type :backport + resolves "CVE-2026-55200" + end + + # Backport of https://github.com/libssh2/libssh2/commit/34497525929b9a47f03dfb81887ac896202b7e12 + # with ssh2_err changed to the 1.11's _libssh2_error. + # Remove with the next release. + patch do + file "Patches/libssh2/CVE-2026-58050.patch" + type :backport + resolves "CVE-2026-58050" + end + + # Remove with the next release. + patch do + url "https://github.com/libssh2/libssh2/commit/a9758da45a52bc8c630ec9493804d0c6ea30b24a.patch?full_index=1" + sha256 "46cc7c5184d333e93c80a9cac1c86469c17340e6fc0418aecb2d0d8f6eaa5f41" + type :backport + resolves "CVE-2026-58051" + end + + # Backport of https://github.com/libssh2/libssh2/commit/5e4776146552d898b9c0e1b313cd093fa8dc92d0 + # with a simple conflict fixed. + # Remove with the next release. + patch do + file "Patches/libssh2/CVE-2026-66032.patch" + type :backport + resolves "CVE-2026-66032" + end + + # Remove with the next release. + patch do + url "https://github.com/libssh2/libssh2/commit/a2ed82d40964bbc0d64cd717aa0a5a892117d2e6.patch?full_index=1" + sha256 "378b5f95f1a410afb790c57ceb67f2d4bd15cc42fc1db58d19fe26fd6f8acbed" + type :backport + resolves "CVE-2026-66033" + end + + # Backport of https://github.com/libssh2/libssh2/commit/a13bb6c773f0d55ad1628cede57e99803cd898d9 + # with ssh2_err changed to the 1.11's _libssh2_error. + # Remove with the next release. + patch do + file "Patches/libssh2/CVE-2026-66034.patch" + type :backport + resolves "CVE-2026-66034" + end + + # Backport of https://github.com/libssh2/libssh2/commit/42e33d81577ed4b95d4b4f6f845e5ee8efe5eeb4 + # with simple conflicts fixed and SSH2_SAFEFREE changed to the 1.11's LIBSSH2_FREE + `ptr = NULL`. + # Remove with the next release. + patch do + file "Patches/libssh2/CVE-2026-66035.patch" + type :backport + resolves "CVE-2026-66035" + end + + def install + args = %W[ + --disable-silent-rules + --disable-examples-build + --with-openssl + --with-libz + --with-libssl-prefix=#{formula_opt_prefix("openssl@3")} + ] + + system "./buildconf" if build.head? + system "./configure", *std_configure_args, *args + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include + + int main(void) + { + libssh2_exit(); + return 0; + } + C + + system ENV.cc, "test.c", "-L#{lib}", "-lssh2", "-o", "test" + system "./test" + end +end diff --git a/Formula/libtasn1.rb b/Formula/libtasn1.rb new file mode 100644 index 0000000..faf92e5 --- /dev/null +++ b/Formula/libtasn1.rb @@ -0,0 +1,46 @@ +class Libtasn1 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "973e0fd7d529808f53fa9ae281020bcbcc750a1dff60e5e5bc37c0da274cca5e" + sha256 cellar: :any, arm64_tahoe: "ae01713eec0bd922b903ed2bf514dc085ec3108636c4ead84614b23a2c33f267" + sha256 cellar: :any_skip_relocation, x86_64_linux: "c0394c5c9c0b278c37eb9f817a282054d64654f7b27eb86100bb5b307a0d72b5" + end + desc "ASN.1 structure parser library" + homepage "https://www.gnu.org/software/libtasn1/" + url "https://ftpmirror.gnu.org/gnu/libtasn1/libtasn1-4.21.0.tar.gz" + mirror "https://ftp.gnu.org/gnu/libtasn1/libtasn1-4.21.0.tar.gz" + sha256 "1d8a444a223cc5464240777346e125de51d8e6abf0b8bac742ac84609167dc87" + license "LGPL-2.1-or-later" + compatibility_version 1 + + + + def install + system "./configure", "--prefix=#{prefix}", "--disable-dependency-tracking", + "--disable-silent-rules" + system "make", "check" + system "make", "install" + end + + test do + (testpath/"pkix.asn").write <<~EOS + PKIX1 { } + DEFINITIONS IMPLICIT TAGS ::= + BEGIN + Dss-Sig-Value ::= SEQUENCE { + r INTEGER, + s INTEGER + } + END + EOS + + (testpath/"assign.asn1").write <<~EOS + dp PKIX1.Dss-Sig-Value + r 42 + s 47 + EOS + + system bin/"asn1Coding", "pkix.asn", "assign.asn1" + assert_match "Decoding: SUCCESS", shell_output("#{bin}/asn1Decoding pkix.asn assign.out PKIX1.Dss-Sig-Value 2>&1") + end +end diff --git a/Formula/libtiff.rb b/Formula/libtiff.rb new file mode 100644 index 0000000..16da78c --- /dev/null +++ b/Formula/libtiff.rb @@ -0,0 +1,92 @@ +class Libtiff < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 1 + sha256 cellar: :any, arm64_sequoia: "5f4a42e711c65a9b72c426ec773c4c9a1d1daf38184fdf1a1f908573cebbcdce" + sha256 cellar: :any, arm64_tahoe: "5d1873ffd3458d6288110874c349921206349359cf6564443bf2ed92ef9e5d46" + sha256 cellar: :any, x86_64_linux: "fd184f2cda1930f320423cee490c95aecc3522f4a5cfc4f92f75432e87c2b92a" + end + desc "TIFF library and utilities" + homepage "https://libtiff.gitlab.io/libtiff/" + url "https://download.osgeo.org/libtiff/tiff-4.7.2.tar.gz" + mirror "https://ftp2.osuosl.org/pub/osgeo/download/libtiff/tiff-4.7.2.tar.gz" + sha256 "672bd7d10aee4606171afb864f3570b83340f6a33e2c186dc0512f7145ffdf6a" + license "libtiff" + compatibility_version 1 + + livecheck do + url "https://download.osgeo.org/libtiff/" + regex(/href=.*?tiff[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "jpeg-turbo" + depends_on "webp" + depends_on "xz" + depends_on "zstd" + + on_linux do + depends_on "zlib-ng-compat" + end + + def install + args = %W[ + --disable-libdeflate + --enable-webp + --with-webp-include-dir=#{formula_opt_include("webp")} + --with-webp-lib-dir=#{formula_opt_lib("webp")} + --enable-zstd + --enable-lzma + --with-jpeg-include-dir=#{formula_opt_include("jpeg-turbo")} + --with-jpeg-lib-dir=#{formula_opt_lib("jpeg-turbo")} + --without-x + ] + system "./configure", *args, *std_configure_args + system "make", "install" + + # Avoid rebuilding dependents that hard-code the prefix. + inreplace lib/"pkgconfig/libtiff-4.pc", prefix, opt_prefix + end + + test do + (testpath/"test.c").write <<~C + #include + + int main(int argc, char* argv[]) + { + TIFF *out = TIFFOpen(argv[1], "w"); + TIFFSetField(out, TIFFTAG_IMAGEWIDTH, (uint32) 10); + TIFFClose(out); + return 0; + } + C + system ENV.cc, "test.c", "-L#{lib}", "-ltiff", "-o", "test" + system "./test", "test.tif" + assert_match(/ImageWidth.*10/, shell_output("#{bin}/tiffdump test.tif")) + (testpath/"test_webp.c").write <<~C + #include + #include + + int main(int argc, char* argv[]) + { + uint8_t rgb[16 * 16 * 3] = {0}; + TIFF *out = TIFFOpen(argv[1], "w"); + if (!out) return 1; + TIFFSetField(out, TIFFTAG_IMAGEWIDTH, 16); + TIFFSetField(out, TIFFTAG_IMAGELENGTH, 16); + TIFFSetField(out, TIFFTAG_SAMPLESPERPIXEL, 3); + TIFFSetField(out, TIFFTAG_BITSPERSAMPLE, 8); + TIFFSetField(out, TIFFTAG_PHOTOMETRIC, PHOTOMETRIC_RGB); + TIFFSetField(out, TIFFTAG_COMPRESSION, COMPRESSION_WEBP); + TIFFSetField(out, TIFFTAG_ROWSPERSTRIP, 16); + if (TIFFWriteEncodedStrip(out, 0, rgb, sizeof(rgb)) < 0) return 2; + TIFFClose(out); + return 0; + } + C + system ENV.cc, "test_webp.c", "-L#{lib}", "-ltiff", "-o", "test_webp" + system "./test_webp", "webp.tif" + assert_match "Compression Scheme: WEBP", shell_output("#{bin}/tiffinfo webp.tif") + end +end diff --git a/Formula/libtirpc.rb b/Formula/libtirpc.rb new file mode 100644 index 0000000..577a181 --- /dev/null +++ b/Formula/libtirpc.rb @@ -0,0 +1,44 @@ +class Libtirpc < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "8f7acea1ebea5151f3e7b1ca7a208d2d1a78493eab4ec9052ee8ba3dabbe0c3d" + sha256 cellar: :any, arm64_tahoe: "2cf5d4f383c13b44931d5d608d807a0f3c7f2d00e93021267b40326ebc4669c7" + sha256 cellar: :any_skip_relocation, x86_64_linux: "cdf824eba64ba33fe3f47809be7c1e62e3795ff20f62b1329e5fad45071cd934" + end + desc "Port of Sun's Transport-Independent RPC library to Linux" + homepage "https://sourceforge.net/projects/libtirpc/" + url "https://downloads.sourceforge.net/project/libtirpc/libtirpc/1.3.7/libtirpc-1.3.7.tar.bz2" + sha256 "b47d3ac19d3549e54a05d0019a6c400674da716123858cfdb6d3bdd70a66c702" + license "BSD-3-Clause" + compatibility_version 1 + + + + depends_on "krb5" + + def install + ENV.append_to_cflags "-D__APPLE_USE_RFC_3542" if OS.mac? + system "./configure", "--disable-silent-rules", *std_configure_args.reject { |s| s["--disable-debug"] } + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + #include + + int main() { + XDR xdr; + char buf[256]; + xdrmem_create(&xdr, buf, sizeof(buf), XDR_ENCODE); + int i = 42; + xdr_destroy(&xdr); + printf("xdr_int succeeded"); + return 0; + } + C + system ENV.cc, "test.c", "-L#{lib}", "-I#{include}/tirpc", "-ltirpc", "-o", "test" + system "./test" + end +end diff --git a/Formula/libtommath.rb b/Formula/libtommath.rb new file mode 100644 index 0000000..a4c5d63 --- /dev/null +++ b/Formula/libtommath.rb @@ -0,0 +1,42 @@ +class Libtommath < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "180de0f47bf4ce7ec3a513db509d368e148b42e50cf310666bf9c60a78cf778b" + sha256 cellar: :any, arm64_tahoe: "fe707123e6ec8488bae4013ce49404a63b00dc6c1c11b12202e25f53a62ef586" + sha256 cellar: :any_skip_relocation, x86_64_linux: "a7023ad5964a1ccfbbbe850cb0979ffa220a65177efd87e0bb751bcf5a3832ba" + end + desc "C library for number theoretic multiple-precision integers" + homepage "https://www.libtom.net/LibTomMath/" + url "https://github.com/libtom/libtommath/releases/download/v1.3.0/ltm-1.3.0.tar.xz" + sha256 "296272d93435991308eb73607600c034b558807a07e829e751142e65ccfa9d08" + license "Unlicense" + compatibility_version 1 + head "https://github.com/libtom/libtommath.git", branch: "develop" + + + + depends_on "libtool" => :build + + # Fixes mp_set_double being missing on macOS. + # This is needed by some dependents in homebrew-core. + # NOTE: This patch has been merged upstream but we take a backport + # from a fork due to file name differences between 1.2.0 and master. + # Remove with the next version. + patch do + url "https://github.com/MoarVM/libtommath/commit/db0d387b808d557bd408a6a253c5bf3a688ef274.patch?full_index=1" + sha256 "e5eef1762dd3e92125e36034afa72552d77f066eaa19a0fd03cd4f1a656f9ab0" + type :unofficial + end + + def install + ENV["PREFIX"] = prefix + + system "make", "-f", "makefile.shared", "install" + system "make", "test" + pkgshare.install "test" + end + + test do + system pkgshare/"test" + end +end diff --git a/Formula/libtool.rb b/Formula/libtool.rb new file mode 100644 index 0000000..67a01ff --- /dev/null +++ b/Formula/libtool.rb @@ -0,0 +1,75 @@ +class Libtool < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "86f6495e08630095d0a0a4a8be76d8ba0350985a55ec13fb43a73f5473d2a410" + sha256 cellar: :any, arm64_tahoe: "719ae9c4597d0198ee77da6bb09dfcb6f68ae0302330f1a1e61503648e59fdd2" + sha256 cellar: :any, sequoia: "205e69efbbd83ca9ff421c98a0063bd20b64690b44248d0398bd6deb941cf81b" + sha256 cellar: :any, x86_64_linux: "6987dea502aa790323eeed36812983d07620595eff67992f1d6992f4de98e136" + end + desc "Generic library support script" + homepage "https://www.gnu.org/software/libtool/" + url "https://ftpmirror.gnu.org/gnu/libtool/libtool-2.6.2.tar.xz" + mirror "https://ftp.gnu.org/gnu/libtool/libtool-2.6.2.tar.xz" + sha256 "2ef1067c16c97db930fd740cc9bc3d3ba9a583804ae5ac42cc3e8719e49e191e" + license "GPL-2.0-or-later" + compatibility_version 1 + + + + depends_on "m4" + + def install + ENV["M4"] = formula_opt_bin("m4")/"m4" + + args = %w[ + --disable-silent-rules + --enable-ltdl-install + ] + args << "--program-prefix=g" if OS.mac? + + system "./configure", *args, *std_configure_args + system "make", "install" + + if OS.mac? + %w[libtool libtoolize].each do |prog| + (libexec/"gnubin").install_symlink bin/"g#{prog}" => prog + (libexec/"gnuman/man1").install_symlink man1/"g#{prog}.1" => "#{prog}.1" + end + (libexec/"gnubin").install_symlink "../gnuman" => "man" + else + bin.install_symlink "libtool" => "glibtool" + bin.install_symlink "libtoolize" => "glibtoolize" + + # Avoid references to the Homebrew shims directory + inreplace bin/"libtool", Superenv.shims_path, "/usr/bin" + end + end + + def caveats + on_macos do + <<~EOS + All commands have been installed with the prefix "g". + If you need to use these commands with their normal names, you + can add a "gnubin" directory to your PATH from your bashrc like: + PATH="#{opt_libexec}/gnubin:$PATH" + EOS + end + end + + test do + system bin/"glibtool", "execute", File.executable?("/usr/bin/true") ? "/usr/bin/true" : "/bin/true" + + (testpath/"hello.c").write <<~C + #include + int main() { puts("Hello, world!"); return 0; } + C + + system bin/"glibtool", "--mode=compile", "--tag=CC", + ENV.cc, "-c", "hello.c", "-o", "hello.o" + system bin/"glibtool", "--mode=link", "--tag=CC", + ENV.cc, "hello.o", "-o", "hello" + assert_match "Hello, world!", shell_output("./hello") + + system bin/"glibtoolize", "--ltdl" + end +end diff --git a/Formula/libunistring.rb b/Formula/libunistring.rb new file mode 100644 index 0000000..5e68e0c --- /dev/null +++ b/Formula/libunistring.rb @@ -0,0 +1,51 @@ +class Libunistring < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "463b68c92d30d845df10b1b137aa8e41a744f1ce2d2cab024dd26c766335b797" + sha256 cellar: :any, arm64_tahoe: "bae6d6d8dffc573c039a850a96e36f1b7fd846abd9ccada8260b7e888b5a3646" + sha256 cellar: :any_skip_relocation, x86_64_linux: "2491acf49407cf75d5f95a6296f2a1c0294646834022fdcad7e22471c0c9a6d4" + end + desc "C string library for manipulating Unicode strings" + homepage "https://www.gnu.org/software/libunistring/" + url "https://ftpmirror.gnu.org/gnu/libunistring/libunistring-1.4.2.tar.gz" + mirror "https://ftp.gnu.org/gnu/libunistring/libunistring-1.4.2.tar.gz" + mirror "http://ftp.gnu.org/gnu/libunistring/libunistring-1.4.2.tar.gz" + sha256 "e82664b170064e62331962126b259d452d53b227bb4a93ab20040d846fec01d8" + license any_of: ["GPL-2.0-or-later", "LGPL-3.0-or-later"] + compatibility_version 1 + + + + def install + # macOS iconv implementation is slightly broken since Sonoma. + # This is also why we skip `make check`. + # https://github.com/coreutils/gnulib/commit/bab130878fe57086921fa7024d328341758ed453 + # https://savannah.gnu.org/bugs/?65686 + use_iconv_workaround = OS.mac? && MacOS.version >= :sonoma + ENV["am_cv_func_iconv_works"] = "yes" if use_iconv_workaround + system "./configure", "--disable-silent-rules", *std_configure_args + system "make" + system "make", "check" unless use_iconv_workaround + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + #include + #include + int main (void) { + uint32_t s[2] = {}; + uint8_t buff[12] = {}; + if (u32_uctomb (s, unicode_name_character ("BEER MUG"), sizeof s) != 1) abort(); + if (u8_sprintf (buff, "%llU", s) != 4) abort(); + printf ("%s\\n", buff); + return 0; + } + C + system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lunistring", + "-o", "test" + assert_equal "🍺", shell_output("./test").chomp + end +end diff --git a/Formula/libusb.rb b/Formula/libusb.rb new file mode 100644 index 0000000..7b4458e --- /dev/null +++ b/Formula/libusb.rb @@ -0,0 +1,51 @@ +class Libusb < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "a8d271bd5d9e7065987960caa52a9130d7fe6321ff1bad751499e465d0413e38" + sha256 cellar: :any, arm64_tahoe: "184daaa6108f0a56eb72c58cc4124dbbb0b54a655632dffdf8334569d71e2a34" + sha256 cellar: :any_skip_relocation, x86_64_linux: "6ad452e6a96823fcef03781dd0980147b91690d0bb34c97f44e57130de8878f6" + end + desc "Library for USB device access" + homepage "https://libusb.info/" + url "https://github.com/libusb/libusb/releases/download/v1.0.30/libusb-1.0.30.tar.bz2" + sha256 "fea36f34f9156400209595e300840767ab1a385ede1dc7ee893015aea9c6dbaf" + license "LGPL-2.1-or-later" + compatibility_version 1 + + livecheck do + url :stable + strategy :github_latest + end + + + + head do + url "https://github.com/libusb/libusb.git", branch: "master" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + end + + on_linux do + depends_on "systemd" + end + + def install + args = %W[--disable-dependency-tracking --prefix=#{prefix}] + + system "./autogen.sh" if build.head? + system "./configure", *args + system "make", "install" + (pkgshare/"examples").install Dir["examples/*"] - Dir["examples/Makefile*"] + end + + test do + cp_r (pkgshare/"examples"), testpath + cd "examples" do + system ENV.cc, "listdevs.c", "-L#{lib}", "-I#{include}/libusb-1.0", + "-lusb-1.0", "-o", "test" + system "./test" + end + end +end diff --git a/Formula/libuv.rb b/Formula/libuv.rb new file mode 100644 index 0000000..b8c7f7c --- /dev/null +++ b/Formula/libuv.rb @@ -0,0 +1,53 @@ +class Libuv < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "495b7322c4b9d0a2e5ceb96de24f5cc10d781e99179f94ca5e31d350547a235d" + sha256 cellar: :any, arm64_tahoe: "6e8478545dc49bd505a4fac61617cd15d8fec4475d2add5ea1cc92f7281818bf" + sha256 cellar: :any_skip_relocation, x86_64_linux: "ae4d9ac18871f6a4f4250be25da29e904755fb3067c8fb08d48fdc71311c623b" + end + desc "Multi-platform support library with a focus on asynchronous I/O" + homepage "https://libuv.org/" + url "https://dist.libuv.org/dist/v1.52.1/libuv-v1.52.1.tar.gz" + sha256 "66d511b9e6e334c0e62279eb234fbfb2b3110b1479c09b95b44c7afca8cff9e7" + license "MIT" + compatibility_version 1 + head "https://github.com/libuv/libuv.git", branch: "v1.x" + + livecheck do + url :head + regex(/^v?(\d+(?:\.\d+)+)$/i) + end + + + + depends_on "cmake" => :build + depends_on "sphinx-doc" => :build + + def install + # This isn't yet handled by the make install process sadly. + system "make", "-C", "docs", "man" + man1.install "docs/build/man/libuv.1" + + system "cmake", "-S", ".", "-B", "build", *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + + int main() + { + uv_loop_t* loop = malloc(sizeof *loop); + uv_loop_init(loop); + uv_loop_close(loop); + free(loop); + return 0; + } + C + system ENV.cc, "test.c", "-L#{lib}", "-luv", "-o", "test" + system "./test" + end +end diff --git a/Formula/libvmaf.rb b/Formula/libvmaf.rb new file mode 100644 index 0000000..b2bb53d --- /dev/null +++ b/Formula/libvmaf.rb @@ -0,0 +1,48 @@ +class Libvmaf < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "dbd548d2ba16092e9c88b81cd91d7cbd1ecec84b9bb31e9c196fe3f6658ee6b3" + sha256 cellar: :any, arm64_tahoe: "bb9f00a9f9ef91d725d1fcd23205642cedf8557e132f1e38bb9d16a22086beaa" + sha256 cellar: :any, x86_64_linux: "bc908d0197dc5ae7de81cdbffb4164de779b26e13ed9fe50e583bc6ac194c3d1" + end + desc "Perceptual video quality assessment based on multi-method fusion" + homepage "https://github.com/Netflix/vmaf" + url "https://github.com/Netflix/vmaf/archive/refs/tags/v3.2.0.tar.gz" + sha256 "a28f93f3b4fa65601be324587072e32a6a704a304ba7b1aec9b70b3f709bc1dc" + license "BSD-2-Clause-Patent" + compatibility_version 1 + + + + depends_on "meson" => :build + depends_on "ninja" => :build + uses_from_macos "vim" => :build # needed for xxd + + on_intel do + depends_on "nasm" => :build + end + + def install + system "meson", "setup", "build", "libvmaf", *std_meson_args + system "meson", "compile", "-C", "build", "--verbose" + system "meson", "install", "-C", "build" + pkgshare.install "model" + end + + test do + (testpath/"test.c").write <<~C + #include + int main() { + return 0; + } + C + + flags = [ + "-I#{HOMEBREW_PREFIX}/include/libvmaf", + "-L#{lib}", + ] + + system ENV.cc, "test.c", "-o", "test", *flags + system "./test" + end +end diff --git a/Formula/libvorbis.rb b/Formula/libvorbis.rb new file mode 100644 index 0000000..b743bc5 --- /dev/null +++ b/Formula/libvorbis.rb @@ -0,0 +1,67 @@ +class Libvorbis < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 1 + sha256 cellar: :any, arm64_sequoia: "c28d1e0b461a4cf6f5aee72e664ac6f5f6f3efaab44f15b91924f08474cfafe1" + sha256 cellar: :any, arm64_tahoe: "99c0de7ff87f4648bb17acd0324a15563e975b7492dbd4f11fd656a8eb6b5622" + sha256 cellar: :any_skip_relocation, x86_64_linux: "41daf79ce53910061acbe1f63ca95f53b4149d3ebb2b97c2bb4d31845820f219" + end + desc "Vorbis general audio compression codec" + homepage "https://xiph.org/vorbis/" + url "https://ftp.osuosl.org/pub/xiph/releases/vorbis/libvorbis-1.3.7.tar.xz" + mirror "https://github.com/xiph/vorbis/releases/download/v1.3.7/libvorbis-1.3.7.tar.xz" + sha256 "b33cc4934322bcbf6efcbacf49e3ca01aadbea4114ec9589d1b1e9d20f72954b" + license "BSD-3-Clause" + compatibility_version 1 + + livecheck do + url "https://ftp.osuosl.org/pub/xiph/releases/vorbis/?C=M&O=D" + regex(%r{href=(?:["']?|.*?/)libvorbis[._-]v?(\d+(?:\.\d+)+)\.t}i) + end + + + + head do + url "https://gitlab.xiph.org/xiph/vorbis.git", branch: "master" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + end + + depends_on "pkgconf" => :build + depends_on "libogg" + + resource("oggfile") do + url "https://upload.wikimedia.org/wikipedia/commons/c/c8/Example.ogg" + sha256 "f57b56d8aae4c847cf01224fb45293610d801cfdac43d932b5eeab1cd318182a" + end + + def install + system "./autogen.sh" if build.head? + inreplace "configure", " -force_cpusubtype_ALL", "" + system "./configure", *std_configure_args + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + #include "vorbis/vorbisfile.h" + int main (void) { + OggVorbis_File vf; + assert (ov_open_callbacks (stdin, &vf, NULL, 0, OV_CALLBACKS_NOCLOSE) >= 0); + vorbis_info *vi = ov_info (&vf, -1); + printf("Bitstream is %d channel, %ldHz\\n", vi->channels, vi->rate); + printf("Encoded by: %s\\n", ov_comment(&vf,-1)->vendor); + return 0; + } + C + testpath.install resource("oggfile") + system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lvorbisfile", + "-o", "test" + assert_match "2 channel, 44100Hz\nEncoded by: Lavf59.27.100", + shell_output("./test < Example.ogg") + end +end diff --git a/Formula/libvpx.rb b/Formula/libvpx.rb new file mode 100644 index 0000000..e26d2d5 --- /dev/null +++ b/Formula/libvpx.rb @@ -0,0 +1,52 @@ +class Libvpx < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "4f72f10109e23239ba65d4e7c1eb9086a4b2cd2875f784c8f9d79d713106675d" + sha256 cellar: :any, arm64_tahoe: "38d28c66d270e2d9b1826f16ec4721b6532a1c59c9ace22811cca3aac43b06ab" + sha256 cellar: :any_skip_relocation, x86_64_linux: "980eac19f80348cc5e5f27f06410a3d724b86727ec6f128355c7ee1dd4b3b09d" + end + desc "VP8/VP9 video codec" + homepage "https://www.webmproject.org/code/" + url "https://github.com/webmproject/libvpx/archive/refs/tags/v1.16.0.tar.gz" + sha256 "7a479a3c66b9f5d5542a4c6a1b7d3768a983b1e5c14c60a9396edc9b649e015c" + license "BSD-3-Clause" + compatibility_version 1 + head "https://chromium.googlesource.com/webm/libvpx.git", branch: "main" + + + + on_intel do + depends_on "nasm" => :build + end + + def install + ENV.runtime_cpu_detection + # NOTE: `libvpx` will fail to build on new macOS versions before the + # `configure` and `build/make/configure.sh` files are updated to support + # the new target (e.g., `arm64-darwin24-gcc` for macOS 15). We [temporarily] + # patch these files to add the new target (until there is a new version). + # If we don't want to create a patch each year, we can consider using + # `--force-target=#{Hardware::CPU.arch}-darwin#{OS.kernel_version.major}-gcc` + # to force the target instead. + args = %W[ + --prefix=#{prefix} + --disable-dependency-tracking + --disable-examples + --disable-unit-tests + --enable-pic + --enable-runtime-cpu-detect + --enable-shared + --enable-vp9-highbitdepth + ] + args << "--target=#{Hardware::CPU.arch}-darwin#{OS.kernel_version.major}-gcc" if OS.mac? + + mkdir "macbuild" do + system "../configure", *args + system "make", "install" + end + end + + test do + system "ar", "-x", "#{lib}/libvpx.a" + end +end diff --git a/Formula/libx11.rb b/Formula/libx11.rb new file mode 100644 index 0000000..8242457 --- /dev/null +++ b/Formula/libx11.rb @@ -0,0 +1,78 @@ +class Libx11 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "1151df800309c229d23b41bdf27973d63619c423ce369164296af84b779482ce" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "cddc8c50c6140f0f64724e4f7c508fe7d26676b24cf7ae2b2527bf884a07a5ea" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "d7b4f02a9f494cfe80106d3ec885233e06c1c34bbfdfff06a6548869d6844ab6" + end + desc "X.Org: Core X11 protocol client library" + homepage "https://www.x.org/" + url "https://xorg.freedesktop.org/archive/individual/lib/libX11-1.8.13.tar.gz" + sha256 "acf0e7cd7541110e6330ecb539441a2d53061f386ec7be6906dfde0de2598470" + license "MIT" + compatibility_version 1 + + + + depends_on "pkgconf" => :build + depends_on "util-macros" => :build + depends_on "xtrans" => :build + depends_on "libxcb" + depends_on "xorgproto" + + def install + ENV.delete "LC_ALL" + ENV["LC_CTYPE"] = "C" + args = %W[ + --sysconfdir=#{etc} + --localstatedir=#{var} + --disable-silent-rules + --enable-unix-transport + --enable-tcp-transport + --enable-ipv6 + --enable-loadable-i18n + --enable-xthreads + --enable-specs=no + ] + + system "./configure", *args, *std_configure_args + system "make" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + int main() { + Display* disp = XOpenDisplay(NULL); + if (disp == NULL) + { + fprintf(stderr, "Unable to connect to display\\n"); + return 0; + } + + int screen_num = DefaultScreen(disp); + unsigned long background = BlackPixel(disp, screen_num); + unsigned long border = WhitePixel(disp, screen_num); + int width = 60, height = 40; + Window win = XCreateSimpleWindow(disp, DefaultRootWindow(disp), 0, 0, width, height, 2, border, background); + XSelectInput(disp, win, ButtonPressMask|StructureNotifyMask); + XMapWindow(disp, win); // display blank window + + XGCValues values; + values.foreground = WhitePixel(disp, screen_num); + values.line_width = 1; + values.line_style = LineSolid; + GC pen = XCreateGC(disp, win, GCForeground|GCLineWidth|GCLineStyle, &values); + // draw two diagonal lines + XDrawLine(disp, win, pen, 0, 0, width, height); + XDrawLine(disp, win, pen, width, 0, 0, height); + + return 0; + } + C + system ENV.cc, "test.c", "-L#{lib}", "-lX11", "-o", "test", "-I#{include}" + system "./test" + end +end diff --git a/Formula/libxau.rb b/Formula/libxau.rb new file mode 100644 index 0000000..fd42599 --- /dev/null +++ b/Formula/libxau.rb @@ -0,0 +1,45 @@ +class Libxau < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "e8a5fedbd9e5c49f10006171decc5b1e56c48fbd4267e7668f813e47c0da984f" + sha256 cellar: :any, arm64_tahoe: "503040606c5d29dd415f2c8dcba7e181d259e4cdff02d1d8bde4e9ea5244765a" + sha256 cellar: :any_skip_relocation, x86_64_linux: "eaab2aad3bf7abb8cf6f1b164cd6648731814a71b1b3cb1141055d48fa07914d" + end + desc "X.Org: A Sample Authorization Protocol for X" + homepage "https://www.x.org/" + url "https://xorg.freedesktop.org/archive/individual/lib/libXau-1.0.12.tar.xz" + sha256 "74d0e4dfa3d39ad8939e99bda37f5967aba528211076828464d2777d477fc0fb" + license "MIT" + compatibility_version 1 + + + + depends_on "pkgconf" => :build + depends_on "util-macros" => :build + depends_on "xorgproto" + + def install + args = %W[ + --sysconfdir=#{etc} + --localstatedir=#{var} + --disable-silent-rules + ] + + system "./configure", *args, *std_configure_args + system "make" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include "X11/Xauth.h" + + int main(int argc, char* argv[]) { + Xauth auth; + return 0; + } + C + system ENV.cc, "test.c" + assert_equal 0, $CHILD_STATUS.exitstatus + end +end diff --git a/Formula/libxcb.rb b/Formula/libxcb.rb new file mode 100644 index 0000000..c618e5f --- /dev/null +++ b/Formula/libxcb.rb @@ -0,0 +1,97 @@ +class Libxcb < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 1 + sha256 cellar: :any, arm64_sequoia: "cce8d9e12c3f0b2fdbffbb3f7ba02f7e25cf3fa495b3e759d34a6264599543b3" + sha256 cellar: :any, arm64_tahoe: "059edd054b17234abb0ce8a34dcbbd927e104445d09a3f5904ea82f7c5aa7ded" + sha256 cellar: :any_skip_relocation, x86_64_linux: "1ccb2f6e9f4feb73b3dbc56248554bc8ce30cb34771ed987eec1bd956f8563e2" + end + desc "X.Org: Interface to the X Window System protocol" + homepage "https://www.x.org/" + url "https://xorg.freedesktop.org/archive/individual/lib/libxcb-1.17.0.tar.xz" + sha256 "599ebf9996710fea71622e6e184f3a8ad5b43d0e5fa8c4e407123c88a59a6d55" + license "MIT" + compatibility_version 1 + + + + depends_on "pkgconf" => :build + depends_on "python@3.14" => :build # match version in `xcb-proto` + depends_on "xcb-proto" => :build + depends_on "libxau" + depends_on "libxdmcp" + + def install + python3 = "python3.14" + + args = %W[ + --sysconfdir=#{etc} + --localstatedir=#{var} + --enable-dri3 + --enable-ge + --enable-xevie + --enable-xprint + --enable-selinux + --disable-silent-rules + --enable-devel-docs=no + --with-doxygen=no + PYTHON=#{python3} + ] + + system "./configure", *args, *std_configure_args + system "make" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + #include + #include "xcb/xcb.h" + + int main() { + xcb_connection_t *connection; + xcb_atom_t *atoms; + xcb_intern_atom_cookie_t *cookies; + int count, i; + char **names; + char buf[100]; + + count = 200; + + connection = xcb_connect(NULL, NULL); + atoms = (xcb_atom_t *) malloc(count * sizeof(atoms)); + names = (char **) malloc(count * sizeof(char *)); + + for (i = 0; i < count; ++i) { + sprintf(buf, "NAME%d", i); + names[i] = strdup(buf); + memset(buf, 0, sizeof(buf)); + } + + cookies = (xcb_intern_atom_cookie_t *) malloc(count * sizeof(xcb_intern_atom_cookie_t)); + + for(i = 0; i < count; ++i) { + cookies[i] = xcb_intern_atom(connection, 0, strlen(names[i]), names[i]); + } + + for(i = 0; i < count; ++i) { + xcb_intern_atom_reply_t *r; + r = xcb_intern_atom_reply(connection, cookies[i], 0); + if(r) + atoms[i] = r->atom; + free(r); + } + + free(atoms); + free(cookies); + xcb_disconnect(connection); + return 0; + } + C + system ENV.cc, "test.c", "-o", "test", "-I#{include}", "-L#{lib}", "-lxcb" + system "./test" + assert_equal 0, $CHILD_STATUS.exitstatus + end +end diff --git a/Formula/libxcrypt.rb b/Formula/libxcrypt.rb new file mode 100644 index 0000000..09223c3 --- /dev/null +++ b/Formula/libxcrypt.rb @@ -0,0 +1,67 @@ +class Libxcrypt < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "04b6d0459d587d4137b8fdc9d7a711bf5df1405afae64997d4d8f6016df50e20" + sha256 cellar: :any, arm64_tahoe: "45b16874ed374eda84779a795aa32640f86759dd480f470567949b7639a8e3ee" + sha256 cellar: :any_skip_relocation, x86_64_linux: "9319e1e70e1e3e476e421956baaeebc0d7be9c3030897844a3c348fe4dd116a5" + end + desc "Extended crypt library for descrypt, md5crypt, bcrypt, and others" + homepage "https://github.com/besser82/libxcrypt" + url "https://github.com/besser82/libxcrypt/releases/download/v4.5.2/libxcrypt-4.5.2.tar.xz" + sha256 "71513a31c01a428bccd5367a32fd95f115d6dac50fb5b60c779d5c7942aec071" + license "LGPL-2.1-or-later" + compatibility_version 1 + + livecheck do + url :stable + strategy :github_latest + end + + + + keg_only :provided_by_macos + + link_overwrite "include/crypt.h" + link_overwrite "lib/libcrypt.so" + + def install + system "./configure", "--disable-static", + "--disable-obsolete-api", + "--disable-xcrypt-compat-files", + "--disable-failure-tokens", + "--disable-valgrind", + *std_configure_args + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + #include + #include + + int main() + { + char *hash = crypt("abc", "$2b$05$abcdefghijklmnopqrstuu"); + + if (errno) { + fprintf(stderr, "Received error: %s", strerror(errno)); + return errno; + } + if (hash == NULL) { + fprintf(stderr, "Hash is NULL"); + return -1; + } + if (strcmp(hash, "$2b$05$abcdefghijklmnopqrstuuRWUgMyyCUnsDr8evYotXg5ZXVF/HhzS")) { + fprintf(stderr, "Unexpected hash output"); + return -1; + } + + return 0; + } + C + system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lcrypt", "-o", "test" + system "./test" + end +end diff --git a/Formula/libxcursor.rb b/Formula/libxcursor.rb new file mode 100644 index 0000000..61ca0b7 --- /dev/null +++ b/Formula/libxcursor.rb @@ -0,0 +1,47 @@ +class Libxcursor < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "8e5c2f6e0290a1308db48d7588e0ce6a831cb56011491470f3592e182db4f3d2" + sha256 cellar: :any, arm64_tahoe: "e25282b8f94e56dee8e9e3ddceccab288e744db1cbad429fb89afe34e273aebd" + sha256 cellar: :any_skip_relocation, x86_64_linux: "02e5f01e4940638fbcce577f05ac3bc57f87bf272959e286a323f6fe3c2fc86d" + end + desc "X.Org: X Window System Cursor management library" + homepage "https://www.x.org/" + url "https://xorg.freedesktop.org/archive/individual/lib/libXcursor-1.2.3.tar.xz" + sha256 "fde9402dd4cfe79da71e2d96bb980afc5e6ff4f8a7d74c159e1966afb2b2c2c0" + license "MIT" + compatibility_version 1 + + + + depends_on "pkgconf" => :build + depends_on "util-macros" => :build + depends_on "libx11" + depends_on "libxfixes" + depends_on "libxrender" + + def install + args = %W[ + --sysconfdir=#{etc} + --localstatedir=#{var} + --disable-silent-rules + ] + + system "./configure", *args, *std_configure_args + system "make" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include "X11/Xcursor/Xcursor.h" + + int main(int argc, char* argv[]) { + XcursorFileHeader header; + return 0; + } + C + system ENV.cc, "test.c" + assert_equal 0, $CHILD_STATUS.exitstatus + end +end diff --git a/Formula/libxdmcp.rb b/Formula/libxdmcp.rb new file mode 100644 index 0000000..fd76d82 --- /dev/null +++ b/Formula/libxdmcp.rb @@ -0,0 +1,45 @@ +class Libxdmcp < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "b09a915dae5b45371a86f20a4ccce13c16c7a8eadc843b665e91bc5b2d2143ce" + sha256 cellar: :any, arm64_tahoe: "34ca0da1c319eeea93ce31badfb5c29c8876cea644754279e93f6cf032ab5cb1" + sha256 cellar: :any_skip_relocation, x86_64_linux: "d8b9dc2969e85e26c6d426d8865244e1416d73f7f408c9f5404a2a614a62e7d4" + end + desc "X.Org: X Display Manager Control Protocol library" + homepage "https://www.x.org/" + url "https://xorg.freedesktop.org/archive/individual/lib/libXdmcp-1.1.5.tar.xz" + sha256 "d8a5222828c3adab70adf69a5583f1d32eb5ece04304f7f8392b6a353aa2228c" + license "MIT" + compatibility_version 1 + + + + depends_on "pkgconf" => :build + depends_on "xorgproto" + + def install + args = %W[ + --sysconfdir=#{etc} + --localstatedir=#{var} + --disable-silent-rules + --enable-docs=no + ] + + system "./configure", *args, *std_configure_args + system "make" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include "X11/Xdmcp.h" + + int main(int argc, char* argv[]) { + xdmOpCode code; + return 0; + } + C + system ENV.cc, "test.c" + assert_equal 0, $CHILD_STATUS.exitstatus + end +end diff --git a/Formula/libxext.rb b/Formula/libxext.rb new file mode 100644 index 0000000..907eb26 --- /dev/null +++ b/Formula/libxext.rb @@ -0,0 +1,46 @@ +class Libxext < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "71225436c92940977248a28433951e8e26732d3a9eed954ce1999a770f93f98e" + sha256 cellar: :any, arm64_tahoe: "7cf2c8903d82f28e0e854c8d6d3dff46ea98c5512724e5349af40f1edca88e9c" + sha256 cellar: :any_skip_relocation, x86_64_linux: "7bc771ee68f57189ea941e83f2f5ff18ac94878ae35c30aed8868a906834d148" + end + desc "X.Org: Library for common extensions to the X11 protocol" + homepage "https://www.x.org/" + url "https://xorg.freedesktop.org/archive/individual/lib/libXext-1.3.7.tar.gz" + sha256 "6564608dc3b816b0cfddf0c7ddc62bc579055dd70b2f28113a618df2acb64189" + license "MIT" + compatibility_version 1 + + + + depends_on "pkgconf" => :build + depends_on "libx11" + depends_on "xorgproto" + + def install + args = %W[ + --sysconfdir=#{etc} + --localstatedir=#{var} + --disable-silent-rules + --enable-specs=no + ] + + system "./configure", *args, *std_configure_args + system "make" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include "X11/extensions/shape.h" + + int main(int argc, char* argv[]) { + XShapeEvent event; + return 0; + } + C + system ENV.cc, "test.c" + assert_equal 0, $CHILD_STATUS.exitstatus + end +end diff --git a/Formula/libxfixes.rb b/Formula/libxfixes.rb new file mode 100644 index 0000000..56766fc --- /dev/null +++ b/Formula/libxfixes.rb @@ -0,0 +1,45 @@ +class Libxfixes < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "20bde00fb1c5b48ad54118acc702fd226efd28585e058c7ecdbff8ce8b6fb34a" + sha256 cellar: :any, arm64_tahoe: "18951c8c4a266fc614d3d17798983f314230614d42184a5169d053a5d228c85c" + sha256 cellar: :any_skip_relocation, x86_64_linux: "6f33e8a88f01a7afb5a784155e4c81051fea75570635b89ddb4b3b48d2825acf" + end + desc "X.Org: Header files for the XFIXES extension" + homepage "https://www.x.org/" + url "https://xorg.freedesktop.org/archive/individual/lib/libXfixes-6.0.2.tar.xz" + sha256 "39f115d72d9c5f8111e4684164d3d68cc1fd21f9b27ff2401b08fddfc0f409ba" + license "MIT" + compatibility_version 1 + + + + depends_on "pkgconf" => :build + depends_on "libx11" + depends_on "xorgproto" + + def install + args = %W[ + --sysconfdir=#{etc} + --localstatedir=#{var} + --disable-silent-rules + ] + + system "./configure", *args, *std_configure_args + system "make" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include "X11/extensions/Xfixes.h" + + int main(int argc, char* argv[]) { + XFixesSelectionNotifyEvent event; + return 0; + } + C + system ENV.cc, "test.c" + assert_equal 0, $CHILD_STATUS.exitstatus + end +end diff --git a/Formula/libxi.rb b/Formula/libxi.rb new file mode 100644 index 0000000..229cd71 --- /dev/null +++ b/Formula/libxi.rb @@ -0,0 +1,51 @@ +class Libxi < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "b8267eff95643d75f879e222a0dee27f938bf9eac0ebd93d39abfd557a05e0e5" + sha256 cellar: :any, arm64_tahoe: "0caffca513b30f308fa1bd54682319f140ea0543397c3f61046f64a39ebcbe85" + sha256 cellar: :any_skip_relocation, x86_64_linux: "5128c5f8ad475f0115e02bd2273029d93ef90ab63dfc0bfd414cf2eb01072c89" + end + desc "X.Org: Library for the X Input Extension" + homepage "https://www.x.org/" + url "https://xorg.freedesktop.org/archive/individual/lib/libXi-1.8.3.tar.xz" + sha256 "7ad60056f01af4f786cfe93b3a7707447711626fc8da2637bec71a90409babe5" + license "MIT" + compatibility_version 1 + + + + depends_on "pkgconf" => :build + depends_on "libx11" + depends_on "libxext" + depends_on "libxfixes" + depends_on "xorgproto" + + conflicts_with "libslax", because: "both install `libxi.a`" + + def install + args = %W[ + --sysconfdir=#{etc} + --localstatedir=#{var} + --disable-silent-rules + --enable-docs=no + --enable-specs=no + ] + + system "./configure", *args, *std_configure_args + system "make" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include "X11/extensions/XInput.h" + + int main(int argc, char* argv[]) { + XDeviceButtonEvent event; + return 0; + } + C + system ENV.cc, "test.c" + assert_equal 0, $CHILD_STATUS.exitstatus + end +end diff --git a/Formula/libxrandr.rb b/Formula/libxrandr.rb new file mode 100644 index 0000000..251a837 --- /dev/null +++ b/Formula/libxrandr.rb @@ -0,0 +1,48 @@ +class Libxrandr < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "c332c9afd47eff9b36b52ab2f318e020d140179bff663d8a224897b9782ace43" + sha256 cellar: :any, arm64_tahoe: "36b7a9f0da5208be5b9b39138d0e0eba832e843d40c0f2e69f6d09b495741ddf" + sha256 cellar: :any_skip_relocation, x86_64_linux: "bed6ab672a51a09e7b6da5d5d824dba33704ce745889d4eebf4917aa009a3b02" + end + desc "X.Org: X Resize, Rotate and Reflection extension library" + homepage "https://www.x.org/" + url "https://xorg.freedesktop.org/archive/individual/lib/libXrandr-1.5.5.tar.xz" + sha256 "72b922c2e765434e9e9f0960148070bd4504b288263e2868a4ccce1b7cf2767a" + license "MIT" + compatibility_version 1 + + + + depends_on "pkgconf" => :build + depends_on "libx11" + depends_on "libxext" + depends_on "libxrender" + depends_on "xorgproto" + + def install + args = %W[ + --sysconfdir=#{etc} + --localstatedir=#{var} + --disable-silent-rules + ] + + system "./configure", *args, *std_configure_args + system "make" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include "X11/Xlib.h" + #include "X11/extensions/Xrandr.h" + + int main(int argc, char* argv[]) { + XRRScreenSize size; + return 0; + } + C + system ENV.cc, "test.c" + assert_equal 0, $CHILD_STATUS.exitstatus + end +end diff --git a/Formula/libxrender.rb b/Formula/libxrender.rb new file mode 100644 index 0000000..ff901a7 --- /dev/null +++ b/Formula/libxrender.rb @@ -0,0 +1,46 @@ +class Libxrender < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "edcb8884f9d33219d276051be3b5ad64f390cdf3abe9794d9a0050c02895c3a7" + sha256 cellar: :any, arm64_tahoe: "6405639931b8924b009e16163b7d99f50a10274189cb7f7eba12a4585d1ef255" + sha256 cellar: :any_skip_relocation, x86_64_linux: "44bddde0557643e137ddd5aa00d60bf220527719d2cb9263e397098dee2664c5" + end + desc "X.Org: Library for the Render Extension to the X11 protocol" + homepage "https://www.x.org/" + url "https://xorg.freedesktop.org/archive/individual/lib/libXrender-0.9.12.tar.gz" + sha256 "0fff64125819c02d1102b6236f3d7d861a07b5216d8eea336c3811d31494ecf7" + license "MIT" + compatibility_version 1 + + + + depends_on "pkgconf" => :build + depends_on "libx11" + depends_on "xorgproto" + + def install + args = %W[ + --sysconfdir=#{etc} + --localstatedir=#{var} + --disable-silent-rules + ] + + system "./configure", *args, *std_configure_args + system "make" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include "X11/Xlib.h" + #include "X11/extensions/Xrender.h" + + int main(int argc, char* argv[]) { + XRenderColor color; + return 0; + } + C + system ENV.cc, "test.c" + assert_equal 0, $CHILD_STATUS.exitstatus + end +end diff --git a/Formula/libxscrnsaver.rb b/Formula/libxscrnsaver.rb new file mode 100644 index 0000000..dcd699d --- /dev/null +++ b/Formula/libxscrnsaver.rb @@ -0,0 +1,45 @@ +class Libxscrnsaver < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "464b8c95cf2d758476e47dc6f774c6504b84b0265cd458d8fd33619f1386721c" + sha256 cellar: :any, arm64_tahoe: "6097790285805d792860cbcf0bb663c76b58d51a57d505346b179e52e2f7ce7c" + sha256 cellar: :any_skip_relocation, x86_64_linux: "592204a7c4aa929e51c550213e52af404a62e1e83075d48daa93e8efb9a88e36" + end + desc "X.Org: X11 Screen Saver extension client library" + homepage "https://www.x.org/" + url "https://xorg.freedesktop.org/archive/individual/lib/libXScrnSaver-1.2.5.tar.xz" + sha256 "5057365f847253e0e275871441e10ff7846c8322a5d88e1e187d326de1cd8d00" + license "MIT" + + + + depends_on "pkgconf" => :build + depends_on "libx11" + depends_on "libxext" + depends_on "xorgproto" + + def install + args = %W[ + --sysconfdir=#{etc} + --localstatedir=#{var} + --disable-silent-rules + ] + + system "./configure", *args, *std_configure_args + system "make" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include "X11/extensions/scrnsaver.h" + + int main(int argc, char* argv[]) { + XScreenSaverNotifyEvent event; + return 0; + } + C + system ENV.cc, "test.c" + assert_equal 0, $CHILD_STATUS.exitstatus + end +end diff --git a/Formula/libxtst.rb b/Formula/libxtst.rb new file mode 100644 index 0000000..3e54bc7 --- /dev/null +++ b/Formula/libxtst.rb @@ -0,0 +1,51 @@ +class Libxtst < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "28d4af1505473aed939328ace91056e111623d0c60b817d0b98dc3e00472dc4d" + sha256 cellar: :any, arm64_tahoe: "3695416abec8f1da23fddcc232bdc5e9522f822f67c7a0c69f522f54c8653617" + sha256 cellar: :any_skip_relocation, x86_64_linux: "51cacd4573d0d4e1cc33c83574cf4838d93de28276a9cd3c69496da8a4466771" + end + desc "X.Org: Client API for the XTEST & RECORD extensions" + homepage "https://www.x.org/" + url "https://xorg.freedesktop.org/archive/individual/lib/libXtst-1.2.5.tar.gz" + sha256 "244ba6e1c5ffa44f1ba251affdfa984d55d99c94bb925a342657e5e7aaf6d39c" + license "MIT" + compatibility_version 1 + + + + depends_on "pkgconf" => :build + depends_on "util-macros" => :build + + depends_on "libx11" + depends_on "libxext" + depends_on "libxi" + depends_on "xorgproto" + + def install + args = %W[ + --sysconfdir=#{etc} + --localstatedir=#{var} + --disable-silent-rules + --enable-specs=no + ] + + system "./configure", *args, *std_configure_args + system "make" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include "X11/Xlib.h" + #include "X11/extensions/record.h" + + int main(int argc, char* argv[]) { + XRecordRange8 *range; + return 0; + } + C + system ENV.cc, "test.c" + assert_equal 0, $CHILD_STATUS.exitstatus + end +end diff --git a/Formula/little-cms2.rb b/Formula/little-cms2.rb new file mode 100644 index 0000000..566cfb4 --- /dev/null +++ b/Formula/little-cms2.rb @@ -0,0 +1,44 @@ +class LittleCms2 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "be9135a585a60f84ec283d97e7a89bec9338e525679b637b171092338c5c28a0" + sha256 cellar: :any, arm64_tahoe: "09a863e549255993de3f73d705328b1202417dff324edd30c703b77fcee09b01" + sha256 cellar: :any_skip_relocation, x86_64_linux: "8df57239d5b52a119832c5b042c5a9fda56caf1692ac1377d517cb6bfc578ed8" + end + desc "Color management engine supporting ICC profiles" + homepage "https://www.littlecms.com/" + # Ensure release is announced at https://www.littlecms.com/categories/releases/ + # (or https://www.littlecms.com/blog/) + url "https://downloads.sourceforge.net/project/lcms/lcms/2.19/lcms2-2.19.tar.gz" + sha256 "49e7e134e4299733dd0eda434fa468997a28ab3d33fa397c642b03644f552216" + license "MIT" + version_scheme 1 + compatibility_version 1 + + # The Little CMS website has been redesigned and there's no longer a + # "Download" page we can check for releases. As of writing this, checking the + # "Releases" blog posts seems to be our best option and we just have to hope + # that the post URLs, headings, etc. maintain a consistent format. + livecheck do + url "https://www.littlecms.com/categories/releases/" + regex(/Little\s*CMS\s+v?(\d+(?:\.\d+)+)\s+released/im) + end + + + + depends_on "jpeg-turbo" + depends_on "libtiff" + + def install + system "./configure", *std_configure_args + system "make", "install" + + # Avoid rebuilding dependents that hard-code the prefix. + inreplace lib/"pkgconfig/lcms2.pc", prefix, opt_prefix + end + + test do + system bin/"jpgicc", test_fixtures("test.jpg"), "out.jpg" + assert_path_exists testpath/"out.jpg" + end +end diff --git a/Formula/llhttp.rb b/Formula/llhttp.rb new file mode 100644 index 0000000..46ca779 --- /dev/null +++ b/Formula/llhttp.rb @@ -0,0 +1,59 @@ +class Llhttp < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "661a11b740692ce17efa18e0d26d4c77e6e39bcdf0cc0ca53bd9a53ab4a4e71d" + sha256 cellar: :any, arm64_tahoe: "0a3866a86832c768383c04809baccccfa1293a520d3d13654d7c051f12c02c80" + sha256 cellar: :any, x86_64_linux: "064d963ed771884697010f5bee50c78a8f82289cc5b0ff5793c001e5cd7acd27" + end + desc "Port of http_parser to llparse" + homepage "https://llhttp.org/" + url "https://github.com/nodejs/llhttp/archive/refs/tags/release/v9.4.3.tar.gz" + sha256 "1eb813c7437b31a87496a1cd3ed79f00746720f5e7e29c79b42c02cb69f36c39" + license "MIT" + compatibility_version 2 + + + + depends_on "cmake" => :build + + def install + system "cmake", "-S", ".", "-B", "build", *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + (testpath/"test.c").write <<~'C' + #include + #include + #include + + int handle_on_message_complete(llhttp_t* parser) { + fprintf(stdout, "Message completed!\n"); + return 0; + } + + int main(void) { + llhttp_t parser; + llhttp_settings_t settings; + llhttp_settings_init(&settings); + settings.on_message_complete = handle_on_message_complete; + llhttp_init(&parser, HTTP_BOTH, &settings); + + const char* request = "GET / HTTP/1.1\r\n\r\n"; + int request_len = strlen(request); + enum llhttp_errno err = llhttp_execute(&parser, request, request_len); + + if (err == HPE_OK) { + fprintf(stdout, "Successfully parsed!\n"); + return 0; + } else { + fprintf(stderr, "Parse error: %s %s\n", llhttp_errno_name(err), llhttp_get_error_reason(&parser)); + return 1; + } + } + C + system ENV.cc, "test.c", "-o", "test", "-L#{lib}", "-lllhttp" + assert_equal "Message completed!\nSuccessfully parsed!\n", shell_output("./test") + end +end diff --git a/Formula/llvm.rb b/Formula/llvm.rb new file mode 100644 index 0000000..e211969 --- /dev/null +++ b/Formula/llvm.rb @@ -0,0 +1,829 @@ +class Llvm < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "5819a7751ca18dd6dd54e182464de9d3c911ccf13900ed94a631ce64e414d710" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "d83ee9d03be9f9a5e5795b3ada6b67847735615f4721d19f424dce3632075d19" + sha256 cellar: :any, x86_64_linux: "69ab817bad2fd10427709b74e13699b5ca81a190be9b740d4e903635fd878a10" + end + desc "Next-gen compiler infrastructure" + homepage "https://llvm.org/" + # The LLVM Project is under the Apache License v2.0 with LLVM Exceptions + license "Apache-2.0" => { with: "LLVM-exception" } + compatibility_version 1 + head "https://github.com/llvm/llvm-project.git", branch: "main" + + stable do + url "https://github.com/llvm/llvm-project/releases/download/llvmorg-22.1.8/llvm-project-22.1.8.src.tar.xz" + sha256 "922f1817a0df7b1489272d18134ee0087a8b068828f87ac63b9861b1a9965888" + + # Fix triple config loading for clang-cl + patch do + url "https://github.com/llvm/llvm-project/compare/1381ad497b9a6d3da630cbef53cbfa9ddf117bb6...40a8c7c0ff3f688b690e4c74db734de67f0f89e9.diff" + sha256 "f6dafd762737eb79761ab7ef814a9fc802ec4bb8d20f46691f07178053b0eb36" + type :unofficial + resolves "https://github.com/llvm/llvm-project/pull/111397" + end + end + + livecheck do + url :stable + regex(/^llvmorg[._-]v?(\d+(?:\.\d+)+)$/i) + end + + + + keg_only :provided_by_macos + + # https://llvm.org/docs/GettingStarted.html#requirement + depends_on "cmake" => :build + depends_on "ninja" => :build + depends_on "swig" => :build # for lldb + depends_on "python@3.14" + depends_on "xz" # for lldb + depends_on "zstd" + + uses_from_macos "libedit" + uses_from_macos "libffi" + uses_from_macos "ncurses" # for lldb + + # Z3 needs C++20 std::format which is only available in Xcode 15.3 or later. + # To avoid a dependency loop, we disable Z3 support on older macOS. + on_system :linux, macos: :sonoma_or_newer do + depends_on "z3" + end + + on_linux do + depends_on "binutils" => :build # needed for LLVMgold plugin + depends_on "pkgconf" => :build + depends_on "zlib-ng-compat" + end + + def python3 + "python3.14" + end + + def clang_config_file_dir + etc/"clang" + end + + def install + # The clang bindings need a little help finding keg-only libclang. + inreplace "clang/bindings/python/clang/cindex.py", + "= os.environ.get(\"LIBCLANG_LIBRARY_PATH\")", + "= os.environ.get(\"LIBCLANG_LIBRARY_PATH\", \"#{lib}\")" + + projects = %w[ + clang + clang-tools-extra + mlir + polly + ] + runtimes = %w[ + compiler-rt + libcxx + libcxxabi + libunwind + ] + + unless versioned_formula? + enable_z3 = deps.map(&:name).include?("z3") + projects << "lldb" + + if OS.mac? + runtimes << "openmp" + else + projects << "openmp" + end + end + + python_versions = Formula.names + .select { |name| name.start_with? "python@" } + .map { |py| py.delete_prefix("python@") } + site_packages = Language::Python.site_packages(python3).delete_prefix("lib/") + + # compiler-rt has some iOS simulator features that require i386 symbols + # I'm assuming the rest of clang needs support too for 32-bit compilation + # to work correctly, but if not, perhaps universal binaries could be + # limited to compiler-rt. llvm makes this somewhat easier because compiler-rt + # can almost be treated as an entirely different build from llvm. + ENV.permit_arch_flags + + # we install the lldb Python module into libexec to prevent users from + # accidentally importing it with a non-Homebrew Python or a Homebrew Python + # in a non-default prefix. See https://lldb.llvm.org/resources/caveats.html + args = %W[ + -DLLVM_ENABLE_PROJECTS=#{projects.join(";")} + -DLLVM_ENABLE_RUNTIMES=#{runtimes.join(";")} + -DLLVM_POLLY_LINK_INTO_TOOLS=ON + -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON + -DLLVM_LINK_LLVM_DYLIB=ON + -DLLVM_ENABLE_EH=OFF + -DLLVM_ENABLE_FFI=ON + -DLLVM_ENABLE_RTTI=ON + -DLLVM_INCLUDE_DOCS=OFF + -DLLVM_INCLUDE_TESTS=OFF + -DLLVM_INSTALL_UTILS=ON + -DLLVM_ENABLE_Z3_SOLVER=#{enable_z3 ? "ON" : "OFF"} + -DLLVM_OPTIMIZED_TABLEGEN=ON + -DLLVM_TARGETS_TO_BUILD=all + -DLLVM_USE_RELATIVE_PATHS_IN_FILES=ON + -DLLVM_SOURCE_PREFIX=. + -DLLDB_USE_SYSTEM_DEBUGSERVER=ON + -DLLDB_ENABLE_PYTHON=ON + -DLLDB_ENABLE_LUA=OFF + -DLLDB_ENABLE_LZMA=ON + -DLLDB_PYTHON_RELATIVE_PATH=libexec/#{site_packages} + -DLIBOMP_INSTALL_ALIASES=OFF + -DLIBCXX_INSTALL_MODULES=ON + -DCLANG_PYTHON_BINDINGS_VERSIONS=#{python_versions.join(";")} + -DLLVM_CREATE_XCODE_TOOLCHAIN=OFF + -DCLANG_FORCE_MATCHING_LIBCLANG_SOVERSION=OFF + -DCLANG_CONFIG_FILE_SYSTEM_DIR=../etc/clang + -DCLANG_CONFIG_FILE_USER_DIR=~/.config/clang + ] + + if tap.present? + args += %W[ + -DPACKAGE_VENDOR=#{tap.user} + -DBUG_REPORT_URL=#{tap.issues_url} + ] + args << "-DCLANG_VENDOR_UTI=sh.brew.clang" if tap.official? + end + + runtimes_cmake_args = [] + builtins_cmake_args = [] + + if OS.mac? + macos_sdk = MacOS.sdk_path + args << "-DFFI_INCLUDE_DIR=#{macos_sdk}/usr/include/ffi" + args << "-DFFI_LIBRARY_DIR=#{macos_sdk}/usr/lib" + + libcxx_install_libdir = lib/"c++" + libunwind_install_libdir = lib/"unwind" + libcxx_rpaths = [loader_path, rpath(source: libcxx_install_libdir, target: libunwind_install_libdir)] + + args << "-DLLVM_BUILD_LLVM_C_DYLIB=ON" + args << "-DLLVM_ENABLE_LIBCXX=ON" + args << "-DLIBCXX_ENABLE_VENDOR_AVAILABILITY_ANNOTATIONS=ON" + args << "-DLIBCXX_PSTL_BACKEND=libdispatch" + args << "-DLIBCXX_INSTALL_LIBRARY_DIR=#{libcxx_install_libdir}" + args << "-DLIBUNWIND_INSTALL_LIBRARY_DIR=#{libunwind_install_libdir}" + args << "-DLIBCXXABI_INSTALL_LIBRARY_DIR=#{libcxx_install_libdir}" + runtimes_cmake_args << "-DCMAKE_INSTALL_RPATH=#{libcxx_rpaths.join("|")}" + + # Disable builds for OSes not supported by the CLT SDK. + clt_sdk_support_flags = %w[I WATCH TV].map { |os| "-DCOMPILER_RT_ENABLE_#{os}OS=OFF" } + builtins_cmake_args += clt_sdk_support_flags + else + args << "-DFFI_INCLUDE_DIR=#{formula_opt_include("libffi")}" + args << "-DFFI_LIBRARY_DIR=#{formula_opt_lib("libffi")}" + + # Disable `libxml2` which isn't very useful. + args << "-DLLVM_ENABLE_LIBXML2=OFF" + args << "-DLLVM_ENABLE_LIBCXX=OFF" + args << "-DCLANG_DEFAULT_CXX_STDLIB=libstdc++" + # Enable llvm gold plugin for LTO + args << "-DLLVM_BINUTILS_INCDIR=#{formula_opt_include("binutils")}" + # Parts of Polly fail to correctly build with PIC when being used for DSOs. + args << "-DCMAKE_POSITION_INDEPENDENT_CODE=ON" + runtimes_cmake_args += %w[ + -DLLVM_ENABLE_PER_TARGET_RUNTIME_DIR=OFF + -DCMAKE_POSITION_INDEPENDENT_CODE=ON + + -DLIBCXX_ENABLE_STATIC_ABI_LIBRARY=ON + -DLIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY=OFF + -DLIBCXX_STATICALLY_LINK_ABI_IN_STATIC_LIBRARY=ON + -DLIBCXX_USE_COMPILER_RT=ON + -DLIBCXX_HAS_ATOMIC_LIB=OFF + + -DLIBCXXABI_ENABLE_STATIC_UNWINDER=ON + -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_SHARED_LIBRARY=OFF + -DLIBCXXABI_STATICALLY_LINK_UNWINDER_IN_STATIC_LIBRARY=ON + -DLIBCXXABI_USE_COMPILER_RT=ON + -DLIBCXXABI_USE_LLVM_UNWINDER=ON + + -DLIBUNWIND_USE_COMPILER_RT=ON + -DCOMPILER_RT_USE_BUILTINS_LIBRARY=ON + -DCOMPILER_RT_USE_LLVM_UNWINDER=ON + + -DSANITIZER_CXX_ABI=libc++ + -DSANITIZER_TEST_CXX=libc++ + ] + + # Prevent compiler-rt from building i386 targets, as this is not portable. + builtins_cmake_args << "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON" + end + + # Skip the PGO build on HEAD installs, non-bottle source builds, or versioned formulae. + # Also skip Intel macOS which is slow and will be reduced to Tier 3 in Sept 2026. + # TODO: Fix Linux PGO build which is currently dead code + pgo_build = build.stable? && build.bottle? && OS.mac? && Hardware::CPU.arm? && !versioned_formula? + lto_build = pgo_build && OS.mac? + + if ENV.cflags.present? + args << "-DCMAKE_C_FLAGS=#{ENV.cflags}" unless pgo_build + runtimes_cmake_args << "-DCMAKE_C_FLAGS=#{ENV.cflags}" + builtins_cmake_args << "-DCMAKE_C_FLAGS=#{ENV.cflags}" + end + + if ENV.cxxflags.present? + args << "-DCMAKE_CXX_FLAGS=#{ENV.cxxflags}" unless pgo_build + runtimes_cmake_args << "-DCMAKE_CXX_FLAGS=#{ENV.cxxflags}" + builtins_cmake_args << "-DCMAKE_CXX_FLAGS=#{ENV.cxxflags}" + end + + args << "-DRUNTIMES_CMAKE_ARGS=#{runtimes_cmake_args.join(";")}" if runtimes_cmake_args.present? + args << "-DBUILTINS_CMAKE_ARGS=#{builtins_cmake_args.join(";")}" if builtins_cmake_args.present? + + llvmpath = buildpath/"llvm" + if pgo_build + # We build LLVM a few times first for optimisations. See + # https://github.com/Homebrew/homebrew-core/issues/77975 + + # PGO build adapted from: + # https://llvm.org/docs/HowToBuildWithPGO.html#building-clang-with-pgo + # https://github.com/llvm/llvm-project/blob/33ba8bd2/llvm/utils/collect_and_build_with_pgo.py + # https://github.com/facebookincubator/BOLT/blob/01f471e7/docs/OptimizingClang.md + + # We build the basic parts of a toolchain to profile. + # The extra targets on macOS are part of a default Compiler-RT build. + extra_args = [ + "-DLLVM_TARGETS_TO_BUILD=Native#{";AArch64;ARM;X86" if OS.mac?}", + "-DLLVM_ENABLE_PROJECTS=clang;lld", + "-DLLVM_ENABLE_RUNTIMES=compiler-rt", + ] + + # Our stage1 compiler includes the minimum necessary to bootstrap. + # `llvm-profdata` is needed for profile data pre-processing, and + # `compiler-rt` to consume profile data. + stage1_targets = ["clang", "llvm-profdata", "compiler-rt"] + stage1_targets += if OS.mac? + extra_args << "-DLLVM_ENABLE_LIBCXX=ON" + extra_args += clt_sdk_support_flags + + args << "-DLLVM_ENABLE_LTO=Thin" if lto_build + # LTO creates object files not recognised by Apple libtool. + args << "-DCMAKE_LIBTOOL=#{llvmpath}/stage1/bin/llvm-libtool-darwin" + + # These are needed to enable LTO. + ["llvm-libtool-darwin", "LTO"] + else + # Make sure CMake doesn't try to pass C++-only flags to C compiler. + extra_args << "-DCMAKE_C_COMPILER=#{ENV.cc}" + extra_args << "-DCMAKE_CXX_COMPILER=#{ENV.cxx}" + + # We use this as the linker on Linux to control RPATH. + ["lld"] + end + + cflags = ENV.cflags&.split || [] + cxxflags = ENV.cxxflags&.split || [] + extra_args << "-DCMAKE_C_FLAGS=#{cflags.join(" ")}" unless cflags.empty? + extra_args << "-DCMAKE_CXX_FLAGS=#{cxxflags.join(" ")}" unless cxxflags.empty? + + # First, build a stage1 compiler. It might be possible to skip this step on macOS + # and use system Clang instead, but this stage does not take too long, and we want + # to avoid incompatibilities from generating profile data with a newer Clang than + # the one we consume the data with. + mkdir llvmpath/"stage1" do + system "cmake", "-G", "Ninja", "..", *extra_args, *std_cmake_args + system "cmake", "--build", ".", "--target", *stage1_targets + end + + # Barring the stage where we generate the profile data, there is no benefit to + # rebuilding these. + extra_args << "-DCLANG_TABLEGEN=#{llvmpath}/stage1/bin/clang-tblgen" + extra_args << "-DLLVM_TABLEGEN=#{llvmpath}/stage1/bin/llvm-tblgen" + + if OS.linux? + # Make sure brewed glibc will be used if it is installed. + linux_library_paths = [ + formula_opt_lib("glibc"), + HOMEBREW_PREFIX/"lib", + ] + linux_linker_flags = linux_library_paths.map { |path| "-L#{path} -Wl,-rpath,#{path}" } + # Add opt_libs for dependencies to RPATH. + linux_linker_flags += deps.map(&:to_formula).map { |dep| "-Wl,-rpath,#{dep.opt_lib}" } + + [args, extra_args].each do |arg_array| + # Add the linker paths to the arguments passed to the temporary compilers and installed toolchain. + arg_array << "-DCMAKE_EXE_LINKER_FLAGS=#{linux_linker_flags.join(" ")}" + arg_array << "-DCMAKE_MODULE_LINKER_FLAGS=#{linux_linker_flags.join(" ")}" + arg_array << "-DCMAKE_SHARED_LINKER_FLAGS=#{linux_linker_flags.join(" ")}" + + # Use stage1 lld instead of ld shim so that we can control RPATH. + arg_array << "-DLLVM_USE_LINKER=lld" + end + + # We also need to make sure we can find headers for other formulae on Linux. + linux_include_paths = [ + HOMEBREW_PREFIX/"include", + ] + linux_include_paths.each { |path| cxxflags << "-isystem#{path}" } + + # Unset CMAKE_C_COMPILER and CMAKE_CXX_COMPILER so we can set them below. + extra_args.reject! { |s| s[/CMAKE_C(XX)?_COMPILER/] } + extra_args.reject! { |s| s["CMAKE_CXX_FLAGS"] } + extra_args << "-DCMAKE_CXX_FLAGS=#{cxxflags.join(" ")}" + end + + # Next, build an instrumented stage2 compiler + mkdir llvmpath/"stage2" do + # LLVM Profile runs out of static counters + # https://reviews.llvm.org/D92669, https://reviews.llvm.org/D93281 + # Without this, the build produces many warnings of the form + # LLVM Profile Warning: Unable to track new values: Running out of static counters. + instrumented_cflags = cflags + %w[-Xclang -mllvm -Xclang -vp-counters-per-site=6] + instrumented_cxxflags = cxxflags + %w[-Xclang -mllvm -Xclang -vp-counters-per-site=6] + instrumented_extra_args = extra_args.reject { |s| s[/CMAKE_C(XX)?_FLAGS/] } + + system "cmake", "-G", "Ninja", "..", + "-DCMAKE_C_COMPILER=#{llvmpath}/stage1/bin/clang", + "-DCMAKE_CXX_COMPILER=#{llvmpath}/stage1/bin/clang++", + "-DLLVM_BUILD_INSTRUMENTED=IR", + "-DLLVM_BUILD_RUNTIME=NO", + "-DCMAKE_C_FLAGS=#{instrumented_cflags.join(" ")}", + "-DCMAKE_CXX_FLAGS=#{instrumented_cxxflags.join(" ")}", + *instrumented_extra_args, *std_cmake_args + system "cmake", "--build", ".", "--target", "clang", "lld", "runtimes" + + # We run some `check-*` targets to increase profiling + # coverage. These do not need to succeed. + # NOTE: If using `Unix Makefiles` generator, `-k 0` needs to replaced with `--keep-going`. + begin + system "cmake", "--build", ".", "--target", "check-clang", "check-llvm", "--", "-k", "0" + rescue BuildError + nil + end + end + + # Then, generate the profile data + mkdir llvmpath/"stage2-profdata" do + system "cmake", "-G", "Ninja", "..", + "-DCMAKE_C_COMPILER=#{llvmpath}/stage2/bin/clang", + "-DCMAKE_CXX_COMPILER=#{llvmpath}/stage2/bin/clang++", + "-DLLVM_BUILD_RUNTIMES=OFF", + *extra_args.reject { |s| s["TABLEGEN"] }, + *std_cmake_args + + # This build is for profiling, so it is safe to ignore errors. + # NOTE: If using `Unix Makefiles` generator, `-k 0` needs to replaced with `--keep-going`. + begin + system "cmake", "--build", ".", "--", "-k", "0" + rescue BuildError + nil + end + end + + # Merge the generated profile data + profpath = llvmpath/"stage2/profiles" + pgo_profile = profpath/"pgo_profile.prof" + system llvmpath/"stage1/bin/llvm-profdata", "merge", "-output=#{pgo_profile}", *profpath.glob("*.profraw") + + # Make sure to build with our profiled compiler and use the profile data + args << "-DCMAKE_C_COMPILER=#{llvmpath}/stage1/bin/clang" + args << "-DCMAKE_CXX_COMPILER=#{llvmpath}/stage1/bin/clang++" + args << "-DLLVM_PROFDATA_FILE=#{pgo_profile}" + # `llvm-tblgen` is an install target, so let's build that. + args << "-DCLANG_TABLEGEN=#{llvmpath}/stage1/bin/clang-tblgen" + + # Silence some warnings + cflags << "-Wno-backend-plugin" + cxxflags << "-Wno-backend-plugin" + + args << "-DCMAKE_C_FLAGS=#{cflags.join(" ")}" + args << "-DCMAKE_CXX_FLAGS=#{cxxflags.join(" ")}" + end + + # Now, we can build. + mkdir llvmpath/"build" do + system "cmake", "-G", "Ninja", "..", *(std_cmake_args + args) + system "cmake", "--build", "." + system "cmake", "--build", ".", "--target", "install" + end + + clang_config_file_dir.mkpath + touch clang_config_file_dir/".keepme" + (prefix/"etc").install_symlink clang_config_file_dir + + if OS.mac? + # Get the version from `llvm-config` to get the correct HEAD or RC version too. + llvm_version = Utils.safe_popen_read(bin/"llvm-config", "--version").strip + soversion = Version.new(llvm_version).major.to_s + soversion << "git" if llvm_version.end_with?("git") + if (match = llvm_version.match(/-rc\d*$/)) + soversion << match[0] + end + + # Install versioned symlink, or else `llvm-config` doesn't work properly + lib.install_symlink "libLLVM.dylib" => "libLLVM-#{soversion}.dylib" + + # Install Xcode toolchain. See: + # https://github.com/llvm/llvm-project/blob/main/llvm/tools/xcode-toolchain/CMakeLists.txt + # We do this manually in order to avoid: + # 1. installing duplicates of files in the prefix + # 2. requiring an existing Xcode installation + xctoolchain = prefix/"Toolchains/LLVM#{llvm_version}.xctoolchain" + + system "/usr/libexec/PlistBuddy", "-c", "Add:CFBundleIdentifier string org.llvm.#{llvm_version}", "Info.plist" + system "/usr/libexec/PlistBuddy", "-c", "Add:CompatibilityVersion integer 2", "Info.plist" + xctoolchain.install "Info.plist" + (xctoolchain/"usr").install_symlink [bin, include, lib, libexec, share] + + # Install a major-versioned symlink that can be used across minor/patch version upgrades. + xctoolchain.parent.install_symlink xctoolchain.basename.to_s => "LLVM#{soversion}.xctoolchain" + + # Write config files for each macOS major version so that this works across OS upgrades. + MacOSVersion::SYMBOLS.each_value do |v| + macos_version = MacOSVersion.new(v) + write_config_files(macos_version, MacOSVersion.kernel_major_version(macos_version), Hardware::CPU.arch) + end + + # Also write an unversioned config file as fallback + write_config_files("", "", Hardware::CPU.arch) + end + + # Install Vim plugins + %w[ftdetect ftplugin indent syntax].each do |dir| + (share/"vim/vimfiles"/dir).install Pathname.glob("*/utils/vim/#{dir}/*.vim") + end + + # Install Emacs modes + elisp.install llvmpath.glob("utils/emacs/*.el") + share.glob("clang/*.el") + + return unless lto_build + + # Convert LTO-generated bitcode in our static archives to MachO. Adapted from Fedora: + # https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/rawhide/f/brp-llvm-compile-lto-elf + lib.glob("*.a").each do |static_archive| + mktemp do + system bin/"llvm-ar", "x", static_archive + rebuilt_files = [] + + Pathname.glob("*.o").each do |bc_file| + file_type = Utils.safe_popen_read("file", "--brief", bc_file) + next unless file_type.match?(/^LLVM (IR )?bitcode/) + + rebuilt_files << bc_file + system bin/"clang", "-fno-lto", "-Wno-unused-command-line-argument", + "-x", "ir", bc_file, "-c", "-o", bc_file + end + + system bin/"llvm-ar", "r", static_archive, *rebuilt_files if rebuilt_files.present? + end + end + end + + # We use the extra layer of indirection in `arch` because the FormulaAudit/OnSystemConditionals + # doesn't want to let us use `Hardware::CPU.arch` outside of `install` or `post_install` blocks. + def write_config_files(macos_version, kernel_version, arch) + require "utils/clang" + + Utils::Clang.write_system_config_files( + config_dir: clang_config_file_dir, + macos_version:, + kernel_version:, + arch:, + ) + end + + post_install_steps do + configure_clang_system + end + + def caveats + s = <<~EOS + CLANG_CONFIG_FILE_SYSTEM_DIR: #{clang_config_file_dir} + CLANG_CONFIG_FILE_USER_DIR: ~/.config/clang + + LLD is now provided in a separate formula: + brew install lld + EOS + + on_macos do + s += <<~EOS + + Using `clang`, `clang++`, etc., requires a CLT installation at `/Library/Developer/CommandLineTools`. + If you don't want to install the CLT, you can write appropriate configuration files pointing to your + SDK at ~/.config/clang. + + To use the bundled libunwind please use the following LDFLAGS: + LDFLAGS="-L#{opt_lib}/unwind -lunwind" + + To use the bundled libc++ please use the following LDFLAGS: + LDFLAGS="-L#{opt_lib}/c++ -L#{opt_lib}/unwind -lunwind" + Features newer than system libc++ will require the following define to enable + (support for this may be removed in a future major LLVM release): + CPPFLAGS="-D_LIBCPP_DISABLE_AVAILABILITY" + + NOTE: You probably want to use the libunwind and libc++ provided by macOS unless you know what you're doing. + EOS + end + + s + end + + test do + alt_location_libs = [ + shared_library("libc++", "*"), + shared_library("libc++abi", "*"), + shared_library("libunwind", "*"), + ] + assert_empty lib.glob(alt_location_libs) if OS.mac? + + llvm_version = Utils.safe_popen_read(bin/"llvm-config", "--version").strip + llvm_version_major = Version.new(llvm_version).major.to_s + soversion = llvm_version_major.dup + + if llvm_version.end_with?("git") + soversion << "git" + elsif (match = llvm_version.match(/-rc\d*$/)) + soversion << match[0] + else + assert_equal version, llvm_version + end + + assert_equal prefix.to_s, shell_output("#{bin}/llvm-config --prefix").chomp + assert_equal "-lLLVM-#{soversion}", shell_output("#{bin}/llvm-config --libs").chomp + assert_equal (lib/shared_library("libLLVM-#{soversion}")).to_s, + shell_output("#{bin}/llvm-config --libfiles").chomp + + (testpath/"test.c").write <<~'C' + #include + int main() + { + printf("Hello World!\n"); + return 0; + } + C + + (testpath/"test.cpp").write <<~CPP + #include + #include + int main() + { + std::string str = "Hello World!"; + std::size_t str_hash = std::hash{}(str); + std::cout << str << std::endl; + return 0; + } + CPP + + system bin/"clang-cpp", "-v", "test.c" + system bin/"clang-cpp", "-v", "test.cpp" + + # Testing default toolchain and SDK location. + system bin/"clang++", "-v", "-std=c++11", "test.cpp", "-o", "test++" + assert_includes MachO::Tools.dylibs("test++"), "/usr/lib/libc++.1.dylib" if OS.mac? + assert_equal "Hello World!", shell_output("./test++").chomp + system bin/"clang", "-v", "test.c", "-o", "test" + assert_equal "Hello World!", shell_output("./test").chomp + + # These tests should ignore the usual SDK includes + with_env(CPATH: nil) do + # Testing Command Line Tools + if OS.mac? && MacOS::CLT.installed? + toolchain_path = "/Library/Developer/CommandLineTools" + cpp_base = (MacOS.version >= :big_sur) ? MacOS::CLT.sdk_path : toolchain_path + system bin/"clang++", "-v", + "--no-default-config", + "-isysroot", MacOS::CLT.sdk_path, + "-isystem", "#{cpp_base}/usr/include/c++/v1", + "-isystem", "#{MacOS::CLT.sdk_path}/usr/include", + "-isystem", "#{toolchain_path}/usr/include", + "-std=c++11", "test.cpp", "-o", "testCLT++" + assert_includes MachO::Tools.dylibs("testCLT++"), "/usr/lib/libc++.1.dylib" + assert_equal "Hello World!", shell_output("./testCLT++").chomp + system bin/"clang", "-v", "test.c", "-o", "testCLT" + assert_equal "Hello World!", shell_output("./testCLT").chomp + + targets = ["#{Hardware::CPU.arch}-apple-macosx#{MacOS.full_version}"] + + # The test tends to time out on Intel, so let's do these only for ARM macOS. + if Hardware::CPU.arm? + old_macos_version = HOMEBREW_MACOS_OLDEST_SUPPORTED.to_i - 1 + targets << "#{Hardware::CPU.arch}-apple-macosx#{old_macos_version}" + + old_kernel_version = MacOSVersion.kernel_major_version(MacOSVersion.new(old_macos_version.to_s)) + targets << "#{Hardware::CPU.arch}-apple-darwin#{old_kernel_version}" + end + + targets.each do |target| + system bin/"clang-cpp", "-v", "--target=#{target}", "test.c" + system bin/"clang-cpp", "-v", "--target=#{target}", "test.cpp" + + system bin/"clang", "-v", "--target=#{target}", "test.c", "-o", "test-macosx" + assert_equal "Hello World!", shell_output("./test-macosx").chomp + + system bin/"clang++", "-v", "--target=#{target}", "-std=c++11", "test.cpp", "-o", "test++-macosx" + assert_equal "Hello World!", shell_output("./test++-macosx").chomp + end + end + + # Testing Xcode + if OS.mac? && MacOS::Xcode.installed? + cpp_base = (MacOS::Xcode.version >= "12.5") ? MacOS::Xcode.sdk_path : MacOS::Xcode.toolchain_path + system bin/"clang++", "-v", + "--no-default-config", + "-isysroot", MacOS::Xcode.sdk_path, + "-isystem", "#{cpp_base}/usr/include/c++/v1", + "-isystem", "#{MacOS::Xcode.sdk_path}/usr/include", + "-isystem", "#{MacOS::Xcode.toolchain_path}/usr/include", + "-std=c++11", "test.cpp", "-o", "testXC++" + assert_includes MachO::Tools.dylibs("testXC++"), "/usr/lib/libc++.1.dylib" + assert_equal "Hello World!", shell_output("./testXC++").chomp + system bin/"clang", "-v", + "-isysroot", MacOS.sdk_path, + "test.c", "-o", "testXC" + assert_equal "Hello World!", shell_output("./testXC").chomp + end + + # link against installed libc++ + # related to https://github.com/Homebrew/legacy-homebrew/issues/47149 + cxx_libdir = OS.mac? ? opt_lib/"c++" : opt_lib + system bin/"clang++", "-v", + "-isystem", "#{opt_include}/c++/v1", + "-std=c++11", "-stdlib=libc++", "test.cpp", "-o", "testlibc++", + "-rtlib=compiler-rt", "-L#{cxx_libdir}", "-Wl,-rpath,#{cxx_libdir}" + assert_includes (testpath/"testlibc++").dynamically_linked_libraries, + (cxx_libdir/shared_library("libc++", "1")).to_s + (testpath/"testlibc++").dynamically_linked_libraries.each do |lib| + refute_match(/libstdc\+\+/, lib) + refute_match(/libgcc/, lib) + refute_match(/libatomic/, lib) + end + assert_equal "Hello World!", shell_output("./testlibc++").chomp + end + + if OS.linux? + # Link installed libc++, libc++abi, and libunwind archives both into + # a position independent executable (PIE), as well as into a fully + # position independent (PIC) DSO for things like plugins that export + # a C-only API but internally use C++. + # + # FIXME: It'd be nice to be able to use flags like `-static-libstdc++` + # together with `-stdlib=libc++` (the latter one we need anyways for + # headers) to achieve this but those flags don't set up the correct + # search paths or handle all of the libraries needed by `libc++` when + # linking statically. + + system bin/"clang++", "-v", "-o", "test_pie_runtimes", + "-pie", "-fPIC", "test.cpp", "-L#{opt_lib}", + "-stdlib=libc++", "-rtlib=compiler-rt", + "-static-libstdc++", "-lpthread", "-ldl" + assert_equal "Hello World!", shell_output("./test_pie_runtimes").chomp + (testpath/"test_pie_runtimes").dynamically_linked_libraries.each do |lib| + refute_match(/lib(std)?c\+\+/, lib) + refute_match(/libgcc/, lib) + refute_match(/libatomic/, lib) + refute_match(/libunwind/, lib) + end + + (testpath/"test_plugin.cpp").write <<~CPP + #include + __attribute__((visibility("default"))) + extern "C" void run_plugin() { + std::cout << "Hello Plugin World!" << std::endl; + } + CPP + (testpath/"test_plugin_main.c").write <<~C + extern void run_plugin(); + int main() { + run_plugin(); + } + C + system bin/"clang++", "-v", "-o", "test_plugin.so", + "-shared", "-fPIC", "test_plugin.cpp", "-L#{opt_lib}", + "-stdlib=libc++", "-rtlib=compiler-rt", + "-static-libstdc++", "-lpthread", "-ldl" + system bin/"clang", "-v", + "test_plugin_main.c", "-o", "test_plugin_libc++", + "test_plugin.so", "-Wl,-rpath=#{testpath}", "-rtlib=compiler-rt" + assert_equal "Hello Plugin World!", shell_output("./test_plugin_libc++").chomp + (testpath/"test_plugin.so").dynamically_linked_libraries.each do |lib| + refute_match(/lib(std)?c\+\+/, lib) + refute_match(/libgcc/, lib) + refute_match(/libatomic/, lib) + refute_match(/libunwind/, lib) + end + end + + # Testing mlir + (testpath/"test.mlir").write <<~MLIR + func.func @main() {return} + + // ----- + + // expected-note @+1 {{see existing symbol definition here}} + func.func @foo() { return } + + // ---- + + // expected-error @+1 {{redefinition of symbol named 'foo'}} + func.func @foo() { return } + MLIR + system bin/"mlir-opt", "--split-input-file", "--verify-diagnostics", "test.mlir" + + (testpath/"scanbuildtest.cpp").write <<~CPP + #include + int main() { + int *i = new int; + *i = 1; + delete i; + std::cout << *i << std::endl; + return 0; + } + CPP + assert_includes shell_output("#{bin}/scan-build make scanbuildtest 2>&1"), + "warning: Use of memory after it is released" + + (testpath/"clangformattest.c").write <<~C + int main() { + printf("Hello world!"); } + C + assert_equal "int main() { printf(\"Hello world!\"); }\n", + shell_output("#{bin}/clang-format -style=google clangformattest.c") + + # This will fail if the clang bindings cannot find `libclang`. + with_env(PYTHONPATH: prefix/Language::Python.site_packages(python3)) do + system python3, "-c", <<~PYTHON + from clang import cindex + cindex.Config().get_cindex_library() + PYTHON + end + + unless versioned_formula? + (testpath/"omptest.c").write <<~C + #include + #include + #include + int main() { + #pragma omp parallel num_threads(4) + { + printf("Hello from thread %d, nthreads %d\\n", omp_get_thread_num(), omp_get_num_threads()); + } + return EXIT_SUCCESS; + } + C + + rpath_flag = "-Wl,-rpath,#{lib/Utils.safe_popen_read(bin/"clang", "--print-target-triple").chomp}" if OS.linux? + system bin/"clang", "-L#{lib}", "-fopenmp", "-nobuiltininc", + "-I#{lib}/clang/#{llvm_version_major}/include", + rpath_flag.to_s, "omptest.c", "-o", "omptest" + testresult = shell_output("./omptest") + + sorted_testresult = testresult.split("\n").sort.join("\n") + expected_result = <<~EOS + Hello from thread 0, nthreads 4 + Hello from thread 1, nthreads 4 + Hello from thread 2, nthreads 4 + Hello from thread 3, nthreads 4 + EOS + assert_equal expected_result.strip, sorted_testresult.strip + + # Test static analyzer + (testpath/"unreachable.c").write <<~C + unsigned int func(unsigned int a) { + unsigned int *z = 0; + if ((a & 1) && ((a & 1) ^1)) + return *z; // unreachable + return 0; + } + C + system bin/"clang", "--analyze", "-Xanalyzer", "-analyzer-constraints=z3", "unreachable.c" + + # Check that lldb can use Python + lldb_script_interpreter_info = JSON.parse(shell_output("#{bin}/lldb --print-script-interpreter-info")) + assert_equal "python", lldb_script_interpreter_info["language"] + python_test_cmd = "import pathlib, sys; print(pathlib.Path(sys.prefix).resolve())" + assert_match shell_output("#{python3} -c '#{python_test_cmd}'"), + pipe_output("#{bin}/lldb", <<~EOS) + script + #{python_test_cmd} + EOS + end + + # Ensure LLVM did not regress output of `llvm-config --system-libs` which for a time + # was known to output incorrect linker flags; e.g., `-llibxml2.tbd` instead of `-lxml2`. + # On the other hand, note that a fully qualified path to `dylib` or `tbd` is OK, e.g., + # `/usr/local/lib/libxml2.tbd` or `/usr/local/lib/libxml2.dylib`. + abs_path_exts = [".tbd", ".dylib"] + shell_output("#{bin}/llvm-config --system-libs").chomp.strip.split.each do |lib| + if lib.start_with?("-l") + assert !lib.end_with?(".tbd"), "expected abs path when lib reported as .tbd" + assert !lib.end_with?(".dylib"), "expected abs path when lib reported as .dylib" + else + p = Pathname.new(lib) + if abs_path_exts.include?(p.extname) + assert p.absolute?, "expected abs path when lib reported as .tbd or .dylib" + end + end + end + + return if OS.linux? + return unless clang_config_file_dir.exist? # https://github.com/Homebrew/homebrew-test-bot/issues/805 + + assert_match("Configuration file: #{opt_prefix}/etc/clang/", + shell_output("#{opt_bin}/clang --version -no-canonical-prefixes")) + end +end diff --git a/Formula/lmdb.rb b/Formula/lmdb.rb new file mode 100644 index 0000000..007a492 --- /dev/null +++ b/Formula/lmdb.rb @@ -0,0 +1,64 @@ +class Lmdb < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "2e0d8aadbabf97148fe9c572a87add07e02d52c61669c848205b54feb2e6bc80" + sha256 cellar: :any, arm64_tahoe: "4e63ac4f1ee1a664b39877162ea66cba4761fccb868fad984bec7c3282218414" + sha256 cellar: :any, x86_64_linux: "f0b73e63e3954123ffea927bd082d1c30f5caf44e289eb870f931ae4aca84ad0" + end + desc "Lightning memory-mapped database: key-value data store" + homepage "https://www.symas.com/lmdb.php" + url "https://git.openldap.org/openldap/openldap/-/archive/LMDB_1.0.1/openldap-LMDB_1.0.1.tar.bz2" + sha256 "1ae17f11ebdeb0d69e53416bb6e0a7479a7d3d5b5ca443a474bff5b5f886a348" + license "OLDAP-2.8" + version_scheme 1 + compatibility_version 1 + head "https://git.openldap.org/openldap/openldap.git", branch: "mdb.master" + + livecheck do + url :stable + regex(/^LMDB[._-]v?(\d+(?:\.\d+)+)$/i) + end + + + + depends_on "pkgconf" => :test + + def install + cd "libraries/liblmdb" do + args = [] + if OS.mac? + args << "SOEXT=.dylib" + # Apple's ld has no -soname; upstream suggests this alternative in the Makefile + args << "VERSION_OPT=-Wl,-compatibility_version,$(LIBVER) -Wl,-current_version,$(VEREXT)" + end + system "make", *args + system "make", "install", *args, "prefix=#{prefix}" + end + + (lib/"pkgconfig/lmdb.pc").write pc_file + (lib/"pkgconfig").install_symlink "lmdb.pc" => "liblmdb.pc" + end + + def pc_file + <<~PC + prefix=#{opt_prefix} + exec_prefix=${prefix} + libdir=${prefix}/lib + includedir=${prefix}/include + + Name: lmdb + Description: #{desc} + URL: #{homepage} + Version: #{version} + Libs: -L${libdir} -llmdb + Cflags: -I${includedir} + PC + end + + test do + assert_match version.to_s, shell_output("#{bin}/mdb_dump -V") + + # Make sure our `lmdb.pc` can be read by `pkg-config`. + system "pkg-config", "lmdb" + end +end diff --git a/Formula/lpeg.rb b/Formula/lpeg.rb new file mode 100644 index 0000000..c5a51e0 --- /dev/null +++ b/Formula/lpeg.rb @@ -0,0 +1,62 @@ +class Lpeg < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "afeb8aa90c0d61871094edc33f8992b478791bb24bbe07ddfe45b3e0da38e118" + sha256 cellar: :any, arm64_tahoe: "f3ef5600e2a654aea26c48469ab8ffee9fe117c71fe4d617646939b0f74059bd" + sha256 cellar: :any_skip_relocation, x86_64_linux: "9087115cb278f1b318ca5334804948f0a44c7983d36acb0b5b171b12bd97df3f" + end + desc "Parsing Expression Grammars For Lua" + homepage "https://www.inf.puc-rio.br/~roberto/lpeg/" + url "https://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.1.0.tar.gz" + mirror "https://github.com/neovim/deps/raw/master/opt/lpeg-1.1.0.tar.gz" + sha256 "4b155d67d2246c1ffa7ad7bc466c1ea899bbc40fef0257cc9c03cecbaed4352a" + license "MIT" + revision 2 + compatibility_version 1 + + livecheck do + url :homepage + regex(/href=.*?lpeg[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "lua" => [:build, :test] + depends_on "lua@5.4" => [:build, :test] # TODO: remove once no dependents need Lua 5.4 + depends_on "luajit" => [:build, :test] + + def make_install_lpeg_so(luadir, dllflags, abi_version) + system "make", "LUADIR=#{luadir}", "DLLFLAGS=#{dllflags.join(" ")}", "lpeg.so" + (share/"lua"/abi_version).install_symlink pkgshare/"re.lua" + (lib/"lua"/abi_version).install "lpeg.so" + system "make", "clean" + end + + def luas + deps.map(&:to_formula).select { |f| f.name.match?(/^lua(@\d+(\.\d+)*)?$/) } + end + + def luajit = Formula["luajit"] + + def install + dllflags = %w[-shared -fPIC] + dllflags << "-Wl,-undefined,dynamic_lookup" if OS.mac? + + make_install_lpeg_so(luajit.opt_include/"luajit-2.1", dllflags, "5.1") + luas.each do |lua| + make_install_lpeg_so(lua.opt_include/"lua", dllflags, lua.version.major_minor) + end + + doc.install "lpeg.html", "re.html" + pkgshare.install "test.lua", "re.lua" + # Needed by neovim. + lib.install_symlink lib/"lua/5.1/lpeg.so" => shared_library("liblpeg") + end + + test do + luas.each do |lua| + system lua.bin/"lua", pkgshare/"test.lua" + end + system luajit.bin/"luajit", pkgshare/"test.lua" + end +end diff --git a/Formula/lua.rb b/Formula/lua.rb new file mode 100644 index 0000000..39e2431 --- /dev/null +++ b/Formula/lua.rb @@ -0,0 +1,101 @@ +class Lua < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "4dc6f450952c63886e1293adb7798fb8bfe9093c72400471ba160561affe6dc4" + sha256 cellar: :any, arm64_tahoe: "494c75d37ed889cd4deaf7cb40613e8ba2206b53af68a5ab3d47167c22138b50" + sha256 cellar: :any, x86_64_linux: "d221d3bf5b1ac55775e12cb147d995e6b29dc46a3e5dfc33bc3c6295fed1561e" + end + desc "Powerful, lightweight programming language" + homepage "https://www.lua.org/" + url "https://www.lua.org/ftp/lua-5.5.1.tar.gz" + sha256 "1c4b4068d67061f2a2231ad2b5422e77acea1487ea9890f6320af614f4373dce" + license "MIT" + compatibility_version 1 + + livecheck do + url "https://www.lua.org/ftp/" + regex(/href=.*?lua[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + # Be sure to build a dylib, or else runtime modules will pull in another static copy of liblua = crashy + # See: https://github.com/Homebrew/legacy-homebrew/pull/5043 + patch do + file "Patches/lua/lua-shared.patch" + end + + def install + # Fix: /usr/bin/ld: lapi.o: relocation R_X86_64_32 against `luaO_nilobject_' can not be used + # when making a shared object; recompile with -fPIC + # See https://www.linuxfromscratch.org/blfs/view/cvs/general/lua.html + ENV.append_to_cflags "-fPIC" if OS.linux? + + # Substitute formula prefix in `src/Makefile` for install name (dylib ID) from our patch + inreplace "src/Makefile", "@OPT_LIB@", opt_lib if OS.mac? + + # Fix path in the config header + inreplace "src/luaconf.h", "/usr/local", HOMEBREW_PREFIX + + args = %W[ + CC=#{ENV.cc} + INSTALL_INC=#{include}/lua + INSTALL_MAN=#{man1} + INSTALL_TOP=#{prefix} + MYCFLAGS=#{ENV.cflags} + MYLDFLAGS=#{ENV.ldflags} + PLAT=#{OS.mac? ? "macosx" : "linux"} + ] + + system "make", *args + system "make", "install", *args + lib.install Dir[shared_library("src/liblua", "*")] + + # We ship our own pkg-config file as Lua no longer provide them upstream. + libs = %w[-llua -lm] + libs << "-ldl" if OS.linux? + (lib/"pkgconfig/lua.pc").write <<~PC + V=#{version.major_minor} + R=#{version} + + prefix=#{versioned_formula? ? opt_prefix : HOMEBREW_PREFIX} + INSTALL_BIN=${prefix}/bin + INSTALL_INC=${prefix}/include/lua + INSTALL_LIB=${prefix}/lib + INSTALL_MAN=${prefix}/share/man/man1 + INSTALL_LMOD=${prefix}/share/lua/${V} + INSTALL_CMOD=${prefix}/lib/lua/${V} + exec_prefix=${prefix} + libdir=${exec_prefix}/lib + includedir=${prefix}/include/lua + + Name: Lua + Description: An Extensible Extension Language + Version: #{version} + Requires: + Libs: -L${libdir} #{libs.join(" ")} + Cflags: -I${includedir} + PC + + # Fix some software potentially hunting for different pc names. + bin.install_symlink "lua" => "lua#{version.major_minor}" + bin.install_symlink "lua" => "lua-#{version.major_minor}" + bin.install_symlink "luac" => "luac#{version.major_minor}" + bin.install_symlink "luac" => "luac-#{version.major_minor}" + (include/"lua#{version.major_minor}").install_symlink Dir[include/"lua/*"] + lib.install_symlink shared_library("liblua", version.major_minor.to_s) => shared_library("liblua#{version.major_minor}") + (lib/"pkgconfig").install_symlink "lua.pc" => "lua#{version.major_minor}.pc" + (lib/"pkgconfig").install_symlink "lua.pc" => "lua-#{version.major_minor}.pc" + end + + def caveats + <<~EOS + You may also want luarocks: + brew install luarocks + EOS + end + + test do + assert_match "Homebrew is awesome!", shell_output("#{bin}/lua -e \"print ('Homebrew is awesome!')\"") + end +end diff --git a/Formula/luajit.rb b/Formula/luajit.rb new file mode 100644 index 0000000..b304388 --- /dev/null +++ b/Formula/luajit.rb @@ -0,0 +1,104 @@ +# NOTE: We have a policy of building only from tagged commits, but make a +# singular exception for luajit. This exception will not be extended +# to other formulae. See: +# https://github.com/Homebrew/homebrew-core/pull/99580 +# TODO: Add an audit in `brew` for this. https://github.com/Homebrew/homebrew-core/pull/104765 +class Luajit < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "b7d3472050e37befea8f31e7cef2569ac5a90e4599f990c3fb661a0cd7a01931" + sha256 cellar: :any, arm64_tahoe: "3c94b56ef312c2b09ae3c0fd220b009b3a38357c58b0c09b833aca77fba06d76" + sha256 cellar: :any, x86_64_linux: "f0ba18f341edc5f50be82238640c0d58ad136169ec02b94b5b687c5cea4bd9ac" + end + desc "Just-In-Time Compiler (JIT) for the Lua programming language" + homepage "https://luajit.org/luajit.html" + # Update this to the tip of the `v2.1` branch. + # Get the latest commit with: + # `git ls-remote --heads https://github.com/LuaJIT/LuaJIT.git v2.1` + # This is a rolling release model so take care not to ignore CI failures that may be regressions. + url "https://github.com/LuaJIT/LuaJIT/archive/1edc3e52b67eaf6ce5f809be8e17d6862594b8bc.tar.gz" + # Use the version scheme `2.1.timestamp` where `timestamp` is the Unix timestamp of the + # latest commit at the time of updating. + # `brew livecheck luajit` will generate the correct version for you automatically. + version "2.1.1785763465" + sha256 "85497ea149d136afbe2d7ef222e08849248e52cecc6dc8deefd8588e551e4e00" + license "MIT" + compatibility_version 26 + head "https://github.com/LuaJIT/LuaJIT.git", branch: "v2.1" + + livecheck do + url "https://api.github.com/repos/LuaJIT/LuaJIT/branches/v2.1" + strategy :json do |json| + date = json.dig("commit", "commit", "author", "date") + "2.1.#{DateTime.parse(date).strftime("%s")}" + end + end + + no_autobump! because: :incompatible_version_format + + + + def install + # 1 - Override the hardcoded gcc. + # 2 - Remove the "-march=i686" so we can set the march in cflags. + # Both changes should persist and were discussed upstream. + inreplace "src/Makefile" do |f| + f.change_make_var! "CC", ENV.cc + f.gsub!(/-march=\w+\s?/, "") + end + + # Per https://luajit.org/install.html: If MACOSX_DEPLOYMENT_TARGET + # is not set then it's forced to 10.4, which breaks compile on Mojave. + ENV["MACOSX_DEPLOYMENT_TARGET"] = MacOS.version.to_s if OS.mac? + + # Help the FFI module find Homebrew-installed libraries. + ENV.append "LDFLAGS", "-Wl,-rpath,#{rpath(target: HOMEBREW_PREFIX/"lib")}" + + # Pass `Q= E=@:` to build verbosely. + verbose_args = %w[Q= E=@:] + + # Build with PREFIX=$HOMEBREW_PREFIX so that luajit can find modules outside its own keg. + # This allows us to avoid having to set `LUA_PATH` and `LUA_CPATH` for non-vendored modules. + system "make", "amalg", "PREFIX=#{HOMEBREW_PREFIX}", *verbose_args + system "make", "install", "PREFIX=#{prefix}", *verbose_args + doc.install (buildpath/"doc").children + + # LuaJIT doesn't automatically symlink unversioned libraries: + # https://github.com/Homebrew/homebrew/issues/45854. + lib.install_symlink lib/shared_library("libluajit-5.1") => shared_library("libluajit") + lib.install_symlink lib/"libluajit-5.1.a" => "libluajit.a" + + # Fix path in pkg-config so modules are installed + # to permanent location rather than inside the Cellar. + inreplace lib/"pkgconfig/luajit.pc" do |s| + s.gsub! "INSTALL_LMOD=${prefix}/share/lua/${abiver}", + "INSTALL_LMOD=#{HOMEBREW_PREFIX}/share/lua/${abiver}" + s.gsub! "INSTALL_CMOD=${prefix}/${multilib}/lua/${abiver}", + "INSTALL_CMOD=#{HOMEBREW_PREFIX}/${multilib}/lua/${abiver}" + end + end + + test do + assert_includes shell_output("#{bin}/luajit -v"), " #{version} " + + system bin/"luajit", "-e", <<~LUA + local ffi = require("ffi") + ffi.cdef("int printf(const char *fmt, ...);") + ffi.C.printf("Hello %s!\\n", "#{ENV["USER"]}") + LUA + + # Check that LuaJIT can find its own `jit.*` modules + touch "empty.lua" + system bin/"luajit", "-b", "-o", "osx", "empty.lua", "empty.o" + assert_path_exists testpath/"empty.o" + + # Check that we're not affected by LuaJIT/LuaJIT/issues/865. + require "macho" + machobj = MachO.open("empty.o") + # always generate 64 bit non-FAT Mach-O object files + # per https://github.com/LuaJIT/LuaJIT/commit/7110b935672489afd6ba3eef3e5139d2f3bd05b6 + assert_kind_of MachO::MachOFile, machobj + assert_predicate machobj, :object? + assert_equal Hardware::CPU.arch, machobj.cputype + end +end diff --git a/Formula/luv.rb b/Formula/luv.rb new file mode 100644 index 0000000..9a82788 --- /dev/null +++ b/Formula/luv.rb @@ -0,0 +1,81 @@ +class Luv < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "bcd21234139140236ad2a94c0dc28f78b5f810a4d96fd799dc85cc1499a22390" + sha256 cellar: :any, arm64_tahoe: "749819a8255ec6cb1ae287fc3aba617eb990301df4dc89211ce0d8b639f62c0e" + sha256 cellar: :any_skip_relocation, x86_64_linux: "ece75e8ec4e4de53025c4a2047ad3768e73a6aaa1fb093796158b69db1a9d82c" + end + desc "Bare libuv bindings for lua" + homepage "https://github.com/luvit/luv" + url "https://github.com/luvit/luv/archive/refs/tags/1.52.1-0.tar.gz" + sha256 "e8b8774b31d24be4fcf2b021b90599ecccc8e476c61efcc59c3c10cab813a885" + license "Apache-2.0" + compatibility_version 1 + head "https://github.com/luvit/luv.git", branch: "master" + + + + depends_on "cmake" => :build + depends_on "lua" => [:build, :test] + depends_on "luajit" => [:build, :test] + depends_on "libuv" + + resource "lua-compat-5.3" do + url "https://github.com/lunarmodules/lua-compat-5.3/archive/refs/tags/v0.14.4.tar.gz" + sha256 "a9afa2eb812996039a05c5101067e6a31af9a75eded998937a1ce814afe1b150" + end + + def lua + Formula["lua"] + end + + def install + resource("lua-compat-5.3").stage buildpath/"deps/lua-compat-5.3" if build.stable? + + args = %W[ + -DWITH_SHARED_LIBUV=ON + -DLUA_BUILD_TYPE=System + -DLUA_COMPAT53_DIR=#{buildpath}/deps/lua-compat-5.3 + -DBUILD_MODULE=ON + ] + + system "cmake", "-S", ".", "-B", "buildjit", + "-DWITH_LUA_ENGINE=LuaJIT", + "-DBUILD_STATIC_LIBS=ON", + "-DBUILD_SHARED_LIBS=ON", + *args, *std_cmake_args + system "cmake", "--build", "buildjit" + system "cmake", "--install", "buildjit" + + system "cmake", "-S", ".", "-B", "buildlua", + "-DWITH_LUA_ENGINE=Lua", + "-DBUILD_STATIC_LIBS=OFF", + "-DBUILD_SHARED_LIBS=OFF", + # https://github.com/luvit/luv/issues/787#issuecomment-4041758224 + "-DMODULE_INSTALL_LIB_DIR=#{lib}/lua/#{lua.version.major_minor}", + *args, *std_cmake_args + system "cmake", "--build", "buildlua" + system "cmake", "--install", "buildlua" + end + + test do + (testpath/"test.lua").write <<~LUA + local uv = require('luv') + local timer = uv.new_timer() + timer:start(1000, 0, function() + print("Awake!") + timer:close() + end) + print("Sleeping"); + uv.run() + LUA + + expected = <<~EOS + Sleeping + Awake! + EOS + + assert_equal expected, shell_output("luajit test.lua") + assert_equal expected, shell_output("#{lua.bin}/lua test.lua") + end +end diff --git a/Formula/lzo.rb b/Formula/lzo.rb new file mode 100644 index 0000000..24fe6c4 --- /dev/null +++ b/Formula/lzo.rb @@ -0,0 +1,45 @@ +class Lzo < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "6bb0401c41a18fd37071ec9591fe053a808f07552ff7ea22542faa470eb8e589" + sha256 cellar: :any, arm64_tahoe: "9863be33af38858d028657bdfbceaff00465b23a9857ce6ed93e2ad24f6adbd8" + sha256 cellar: :any_skip_relocation, x86_64_linux: "8413f94bb69f337f7e1837e7f525e703cac105d27ceeb29de5c08c7bbfa77b29" + end + desc "Real-time data compression library" + homepage "https://www.oberhumer.com/opensource/lzo/" + url "https://www.oberhumer.com/opensource/lzo/download/lzo-2.10.tar.gz" + sha256 "c0f892943208266f9b6543b3ae308fab6284c5c90e627931446fb49b4221a072" + license "GPL-2.0-or-later" + + livecheck do + url "https://www.oberhumer.com/opensource/lzo/download/" + regex(/href=.*?lzo[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + def install + system "./configure", "--disable-dependency-tracking", + "--prefix=#{prefix}", + "--enable-shared" + system "make" + system "make", "check" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + + int main() + { + printf("Testing LZO v%s in Homebrew.\\n", + LZO_VERSION_STRING); + return 0; + } + C + system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-o", "test" + assert_match "Testing LZO v#{version} in Homebrew.", shell_output("./test") + end +end diff --git a/Formula/m4.rb b/Formula/m4.rb new file mode 100644 index 0000000..445842b --- /dev/null +++ b/Formula/m4.rb @@ -0,0 +1,32 @@ +class M4 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "80f871ba39104ef553d5a15e2c70639c69dd4fb76568842f5dc1ef451918c6a8" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "81e05b29593d5a7a5dc4fe5f245fc62623a84b82c67183bf26385cb86939c6d4" + sha256 cellar: :any_skip_relocation, sequoia: "9956d5e742750c93d61a27ac209e7dfe7a6e0de2dfbc2ea73210741eb2e51461" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "ba0b5d546365710422739b622d9a2301f9096f78bc7d6dd5b3cb4cc4a55e184f" + end + desc "Macro processing language" + homepage "https://www.gnu.org/software/m4/" + url "https://ftpmirror.gnu.org/gnu/m4/m4-1.4.21.tar.xz" + mirror "https://ftp.gnu.org/gnu/m4/m4-1.4.21.tar.xz" + mirror "http://ftp.gnu.org/gnu/m4/m4-1.4.21.tar.xz" + sha256 "f25c6ab51548a73a75558742fb031e0625d6485fe5f9155949d6486a2408ab66" + license "GPL-3.0-or-later" + compatibility_version 1 + + + + keg_only :provided_by_macos + + def install + system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}" + system "make" + system "make", "install" + end + + test do + assert_match "Homebrew", + pipe_output(bin/"m4", "define(TEST, Homebrew)\nTEST\n") + end +end diff --git a/Formula/mactop.rb b/Formula/mactop.rb new file mode 100644 index 0000000..dc4d8f4 --- /dev/null +++ b/Formula/mactop.rb @@ -0,0 +1,37 @@ +class Mactop < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "a022ad6a6b766891a69ee8ab26956fb0dfe5b163cb7eaefa6032ee2f9f587cfb" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "2cd8bcc67340c0f637d6345b0a6b3ca729e6237f6e322e0d90e7bd48a8580a2f" + end + desc "Apple Silicon Monitor Top written in Go Lang" + homepage "https://github.com/metaspartan/mactop" + url "https://github.com/metaspartan/mactop/archive/refs/tags/v2.1.5.tar.gz" + sha256 "df49979c413b8a3a6e98ccfb553fafeb94fd652ec13a830205d057c8d73cace7" + license "MIT" + head "https://github.com/metaspartan/mactop.git", branch: "main" + + + + depends_on "go" => :build + depends_on arch: :arm64 + depends_on :macos + + def install + system "go", "build", *std_go_args + end + + service do + run [opt_bin/"mactop", "-p", "9101", "--headless"] + keep_alive true + log_path var/"log/mactop.log" + error_log_path var/"log/mactop.error.log" + process_type :background + nice 10 + end + + test do + test_input = "This is a test input for brew" + assert_match "Test input received: #{test_input}", shell_output("#{bin}/mactop --test '#{test_input}'") + end +end diff --git a/Formula/merve.rb b/Formula/merve.rb new file mode 100644 index 0000000..375ed3c --- /dev/null +++ b/Formula/merve.rb @@ -0,0 +1,57 @@ +class Merve < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "04998f770171f826772a0db12bc60cda32c83fcddfde1c3143c4a336062d9155" + sha256 cellar: :any, arm64_tahoe: "762282750ff31f5f38c273aa346bcaefe71d9f488b222e0e67686eb55a5187fc" + sha256 cellar: :any_skip_relocation, x86_64_linux: "ec1ac2932467d47af1c0e9441730f23ff9badf7698695d868bab4ec8738a4ddb" + end + desc "C++ lexer for extracting named exports from CommonJS modules" + homepage "https://github.com/nodejs/merve" + url "https://github.com/nodejs/merve/archive/refs/tags/v1.2.2.tar.gz" + sha256 "8f19c2132447b9113545ffd399cb2bc1e61c6166743921b04883f8e1d778d69e" + license "Apache-2.0" + revision 1 + + + + depends_on "cmake" => :build + depends_on "simdutf" + + def install + args = %w[ + -DMERVE_TESTING=OFF + -DMERVE_USE_SIMDUTF=ON + -DBUILD_SHARED_LIBS=ON + -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON + ] + system "cmake", "-S", ".", "-B", "build", *std_cmake_args, *args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + (testpath/"test-merv.c").write <<~'C' + #include "merve_c.h" + #include + #include + + int main(void) { + const char *source = "exports.foo = 1;\nexports.bar = 2;\n"; + merve_analysis result = merve_parse_commonjs(source, strlen(source), NULL); + merve_string export_name; + + if (!result || !merve_is_valid(result)) return 1; + + export_name = merve_get_export_name(result, 1); + printf("%zu %.*s %u\n", + merve_get_exports_count(result), + (int) export_name.length, export_name.data, + merve_get_export_line(result, 1)); + merve_free(result); + return 0; + } + C + system ENV.cc, "test-merv.c", "-I#{include}", "-L#{lib}", "-lmerve", "-o", "test-merv" + assert_equal "2 bar 2\n", shell_output("./test-merv") + end +end diff --git a/Formula/mpg123.rb b/Formula/mpg123.rb new file mode 100644 index 0000000..5fdfb70 --- /dev/null +++ b/Formula/mpg123.rb @@ -0,0 +1,44 @@ +class Mpg123 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "9c77394d85530cafc6a0a753e98fa2a7f00e8df87e3e3c57411a7b896ce2e0f4" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "acabaed07a2aa95e360e1047df604cb45845254f2ff136671b9fb0d4bafc69ce" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "abaf6777eb51cb88f6d56dd33e9172bc7a208ac94b892652a3b422e5efa97ce0" + end + desc "MP3 player for Linux and UNIX" + homepage "https://www.mpg123.de/" + url "https://www.mpg123.de/download/mpg123-1.33.7.tar.bz2" + mirror "https://downloads.sourceforge.net/project/mpg123/mpg123/1.33.7/mpg123-1.33.7.tar.bz2" + sha256 "31d0e35a4ca567ec9b5ebda6c3062bb4435d6d3eacd6ef0d95cadd7854dc03ee" + license "LGPL-2.1-only" + compatibility_version 1 + + livecheck do + url "https://www.mpg123.de/download/" + regex(/href=.*?mpg123[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + def install + args = %w[ + --with-module-suffix=.so + --enable-static + ] + + args << "--with-default-audio=coreaudio" if OS.mac? + + args << if Hardware::CPU.arm? + "--with-cpu=aarch64" + else + "--with-cpu=x86-64" + end + + system "./configure", *args, *std_configure_args + system "make", "install" + end + + test do + system bin/"mpg123", "--test", test_fixtures("test.mp3") + end +end diff --git a/Formula/nbytes.rb b/Formula/nbytes.rb new file mode 100644 index 0000000..8039b10 --- /dev/null +++ b/Formula/nbytes.rb @@ -0,0 +1,47 @@ +class Nbytes < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "c320de81e5ba5364dd7159fcdcbac9fe3a1475e3d8f830d2115b5390c1261a10" + sha256 cellar: :any, arm64_tahoe: "bc0a989ffab822c0ef0b5122cfc9f046be9b8c6b681dd09a3691c9963c44a282" + sha256 cellar: :any_skip_relocation, x86_64_linux: "cd60fe046720705ec370907040b03d1b47c806b0b2544612374206f50e7a502a" + end + desc "Library of byte handling functions extracted from Node.js core" + homepage "https://github.com/nodejs/nbytes" + url "https://github.com/nodejs/nbytes/archive/refs/tags/v0.1.4.tar.gz" + sha256 "67f4b8363f12abb64c07a0cecf2bf2dce7ab47b5f8b9fd2efdb852ea254c2d40" + license "MIT" + + + + depends_on "cmake" => :build + + def install + args = %w[ + -DBUILD_SHARED_LIBS=ON + -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON + ] + + system "cmake", "-S", ".", "-B", "build", *std_cmake_args, *args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + (testpath/"test-main.cpp").write <<~CPP + #include + #include + + int main() { + constexpr char input[] = "SGVsbG8sIFdvcmxkIQ=="; // "Hello, World!" + char output[64] = {}; + size_t n = nbytes::Base64Decode(output, sizeof(output), input, sizeof(input) - 1); + std::cout << output << std::endl; + return 0; + } + CPP + + system ENV.cxx, "-std=c++20", "test-main.cpp", "-I#{include}", "-L#{lib}", "-lnbytes", "-o", "test-main" + + assert_equal "Hello, World!\n", shell_output("./test-main") + end +end diff --git a/Formula/ncdu.rb b/Formula/ncdu.rb new file mode 100644 index 0000000..5b6aac6 --- /dev/null +++ b/Formula/ncdu.rb @@ -0,0 +1,54 @@ +class Ncdu < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "d56b0ffa80c15fa5758a8b7b59525687a1a04ce043d540936b6db917c7c14c30" + sha256 cellar: :any, arm64_tahoe: "9a08dd709b18d87d90b016b8685d56f2de8d537e437ab44cf4ed92203df7a245" + sha256 cellar: :any_skip_relocation, x86_64_linux: "762c13f508d0699c363f0a3a0741a19cbd14d1ef8a86fdd1d70aeaaf2f7bd851" + end + desc "NCurses Disk Usage" + homepage "https://dev.yorhel.nl/ncdu" + url "https://dev.yorhel.nl/download/ncdu-2.9.2.tar.gz" + sha256 "e91135281cb66569f2ca4c0bac277246991e7e52524c0ca8cba3de5c8e81cec9" + license "MIT" + head "https://g.blicky.net/ncdu.git", branch: "zig" + + livecheck do + url :homepage + regex(/href=.*?ncdu[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "pkgconf" => :build + depends_on "zig@0.15" => :build + # Without this, `ncdu` is unusable when `TERM=tmux-256color`. + depends_on "ncurses" + depends_on "zstd" + + def install + args = [] + args << "-Dpie=true" if OS.mac? + + # Workaround for https://github.com/Homebrew/homebrew-core/pull/141453#discussion_r1320821081 + # Remove this workaround when the same is removed in `zig.rb`. + if OS.linux? + ENV["NIX_LDFLAGS"] = ENV["HOMEBREW_RPATH_PATHS"].split(":") + .map { |p| "-rpath #{p}" } + .join(" ") + end + + # Avoid the Makefile for now so that we can pass `-Dcpu` to `zig build`. + # https://code.blicky.net/yorhel/ncdu/issues/185 + system "zig", "build", *args, *std_zig_args + man1.install "ncdu.1" + end + + test do + assert_match version.to_s, shell_output("#{bin}/ncdu -v") + system bin/"ncdu", "-o", "test" + output = JSON.parse((testpath/"test").read) + assert_equal "ncdu", output[2]["progname"] + assert_equal version.to_s, output[2]["progver"] + assert_equal Pathname.pwd.size, output[3][0]["asize"] + end +end diff --git a/Formula/ncurses.rb b/Formula/ncurses.rb new file mode 100644 index 0000000..74d24a1 --- /dev/null +++ b/Formula/ncurses.rb @@ -0,0 +1,99 @@ +class Ncurses < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "3fe0a6d4482023f880e9542af63e9229c6fcd7456b46e88b5d2d4703eb2ec943" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "b43443ba3c3c8728e79413c7c3fed4a0eb293bd77c8492c1ec4c5d05233a97f1" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "12c037b176c3300398cc53f0f278ba14195ae525cb6188dc085fd07236e5db48" + end + desc "Text-based UI library" + homepage "https://invisible-island.net/ncurses/announce.html" + url "https://invisible-mirror.net/archives/ncurses/ncurses-6.6.tar.gz" + mirror "https://ftpmirror.gnu.org/gnu/ncurses/ncurses-6.6.tar.gz" + mirror "http://invisible-mirror.net/archives/ncurses/ncurses-6.6.tar.gz" + sha256 "355b4cbbed880b0381a04c46617b7656e362585d52e9cf84a67e2009b749ff11" + license "X11-distribute-modifications-variant" + compatibility_version 1 + + livecheck do + url "https://invisible-mirror.net/archives/ncurses/" + regex(/href=.*?ncurses[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + keg_only :provided_by_macos + + def install + ENV.delete("TERMINFO") + + args = [ + "--prefix=#{prefix}", + "--enable-pc-files", + "--with-pkg-config-libdir=#{lib}/pkgconfig", + "--enable-sigwinch", + "--enable-symlinks", + "--enable-widec", + "--with-shared", + "--with-cxx-shared", + "--with-gpm=no", + "--without-ada", + ] + args << "--with-terminfo-dirs=#{share}/terminfo:/etc/terminfo:/lib/terminfo:/usr/share/terminfo" if OS.linux? + + system "./configure", *args + system "make", "install" + make_libncurses_symlinks + + # Avoid hardcoding Cellar paths in client software. + inreplace bin/"ncursesw6-config", prefix, opt_prefix + pkgshare.install "test" + (pkgshare/"test").install "install-sh", "config.sub", "config.guess" + end + + def make_libncurses_symlinks + major = version.major.to_s + + %w[form menu ncurses panel ncurses++].each do |name| + lib.install_symlink shared_library("lib#{name}w", major) => shared_library("lib#{name}") + lib.install_symlink shared_library("lib#{name}w", major) => shared_library("lib#{name}", major) + lib.install_symlink "lib#{name}w.a" => "lib#{name}.a" + lib.install_symlink "lib#{name}w_g.a" => "lib#{name}_g.a" + end + + lib.install_symlink "libncurses.a" => "libcurses.a" + lib.install_symlink shared_library("libncurses") => shared_library("libcurses") + on_linux do + # libtermcap and libtinfo are provided by ncurses and have the + # same api. Help some older packages to find these dependencies. + # https://bugs.centos.org/view.php?id=11423 + # https://bugs.launchpad.net/ubuntu/+source/ncurses/+bug/259139 + lib.install_symlink "libncurses.so" => "libtermcap.so" + lib.install_symlink "libncurses.so" => "libtinfo.so" + end + + (lib/"pkgconfig").install_symlink "ncursesw.pc" => "ncurses.pc" + (lib/"pkgconfig").install_symlink "formw.pc" => "form.pc" + (lib/"pkgconfig").install_symlink "menuw.pc" => "menu.pc" + (lib/"pkgconfig").install_symlink "panelw.pc" => "panel.pc" + + bin.install_symlink "ncursesw#{major}-config" => "ncurses#{major}-config" + + include.install_symlink "ncursesw" => "ncurses" + include.install_symlink [ + "ncursesw/curses.h", "ncursesw/form.h", "ncursesw/ncurses.h", + "ncursesw/panel.h", "ncursesw/term.h", "ncursesw/termcap.h" + ] + end + + test do + refute_match prefix.to_s, shell_output("#{bin}/ncursesw6-config --prefix") + refute_match share.to_s, shell_output("#{bin}/ncursesw6-config --terminfo-dirs") + + ENV["TERM"] = "xterm" + + system pkgshare/"test/configure", "--prefix=#{testpath}", + "--with-curses-dir=#{prefix}" + system "make", "install" + system testpath/"bin/ncurses-examples" + end +end diff --git a/Formula/neovim.rb b/Formula/neovim.rb new file mode 100644 index 0000000..d5380e8 --- /dev/null +++ b/Formula/neovim.rb @@ -0,0 +1,172 @@ +class Neovim < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "0f9d1ace756e7a05ecd2544a4efa7056a2a2faf4f50aad393815d2edb5b39ded" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "c481e54d74d8e258e00448d44bc25ffc76ff4a982dcde22e8eb0c4ffc30a66b5" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "7027be32c4847a23775a92c23e5bdcebf1a76ea1d8a8697b2659f46c0f4fd4c1" + end + desc "Ambitious Vim-fork focused on extensibility and agility" + homepage "https://neovim.io/" + license "Apache-2.0" + compatibility_version 1 + head "https://github.com/neovim/neovim.git", branch: "master" + + stable do + url "https://github.com/neovim/neovim/archive/refs/tags/v0.12.4.tar.gz" + sha256 "2727da95d2b8b809bc7c71e085452e47dfe1d8aa7cfaa15c68004e23f6f0a6dd" + + # Keep resources updated according to: + # https://github.com/neovim/neovim/blob/v#{version}/cmake.deps/deps.txt + + # TODO: Consider shipping these as separate formulae instead. See discussion at + # https://github.com/orgs/Homebrew/discussions/3611 + # NOTE: The `install` method assumes that the parser name follows the final `-`. + # Please name the resources accordingly. + resource "tree-sitter-c" do + url "https://github.com/tree-sitter/tree-sitter-c/archive/refs/tags/v0.24.1.tar.gz" + sha256 "25dd4bb3dec770769a407e0fc803f424ce02c494a56ce95fedc525316dcf9b48" + + livecheck do + url "https://raw.githubusercontent.com/neovim/neovim/refs/tags/v#{LATEST_VERSION}/cmake.deps/deps.txt" + regex(%r{https://github\.com/tree-sitter/tree-sitter-c/archive/v?(\d+(?:\.\d+)+)\.tar\.gz}i) + end + end + + resource "tree-sitter-lua" do + url "https://github.com/tree-sitter-grammars/tree-sitter-lua/archive/refs/tags/v0.5.0.tar.gz" + sha256 "cf01b93f4b61b96a6d27942cf28eeda4cbce7d503c3bef773a8930b3d778a2d9" + + livecheck do + url "https://raw.githubusercontent.com/neovim/neovim/refs/tags/v#{LATEST_VERSION}/cmake.deps/deps.txt" + regex(%r{https://github\.com/tree-sitter-grammars/tree-sitter-lua/archive/v?(\d+(?:\.\d+)+)\.tar\.gz}i) + end + end + + resource "tree-sitter-vim" do + url "https://github.com/tree-sitter-grammars/tree-sitter-vim/archive/refs/tags/v0.8.1.tar.gz" + sha256 "93cafb9a0269420362454ace725a118ff1c3e08dcdfdc228aa86334b54d53c2a" + + livecheck do + url "https://raw.githubusercontent.com/neovim/neovim/refs/tags/v#{LATEST_VERSION}/cmake.deps/deps.txt" + regex(%r{https://github\.com/tree-sitter-grammars/tree-sitter-vim/archive/v?(\d+(?:\.\d+)+)\.tar\.gz}i) + end + end + + resource "tree-sitter-vimdoc" do + url "https://github.com/neovim/tree-sitter-vimdoc/archive/refs/tags/v4.1.0.tar.gz" + sha256 "020e8f117f648c8697fca967995c342e92dbd81dab137a115cc7555207fbc84f" + + livecheck do + url "https://raw.githubusercontent.com/neovim/neovim/refs/tags/v#{LATEST_VERSION}/cmake.deps/deps.txt" + regex(%r{https://github\.com/neovim/tree-sitter-vimdoc/archive/v?(\d+(?:\.\d+)+)\.tar\.gz}i) + end + end + + resource "tree-sitter-query" do + url "https://github.com/tree-sitter-grammars/tree-sitter-query/archive/refs/tags/v0.8.0.tar.gz" + sha256 "c2b23b9a54cffcc999ded4a5d3949daf338bebb7945dece229f832332e6e6a7d" + + livecheck do + url "https://raw.githubusercontent.com/neovim/neovim/refs/tags/v#{LATEST_VERSION}/cmake.deps/deps.txt" + regex(%r{https://github\.com/tree-sitter-grammars/tree-sitter-query/archive/v?(\d+(?:\.\d+)+)\.tar\.gz}i) + end + end + + resource "tree-sitter-markdown" do + url "https://github.com/tree-sitter-grammars/tree-sitter-markdown/archive/refs/tags/v0.5.3.tar.gz" + sha256 "df845b1ab7c7c163ec57d7fa17170c92b04be199bddab02523636efec5224ab6" + + livecheck do + url "https://raw.githubusercontent.com/neovim/neovim/refs/tags/v#{LATEST_VERSION}/cmake.deps/deps.txt" + regex(%r{https://github\.com/tree-sitter-grammars/tree-sitter-markdown/archive/v?(\d+(?:\.\d+)+)\.tar\.gz}i) + end + end + end + + livecheck do + url :stable + regex(/^v?(\d+(?:\.\d+)+)$/i) + end + + + + depends_on "cmake" => :build + depends_on "gettext" => :build + depends_on "libuv" + depends_on "lpeg" + depends_on "luajit" + depends_on "luv" + depends_on "tree-sitter" + depends_on "unibilium" + depends_on "utf8proc" + + on_macos do + depends_on "gettext" + end + + def install + if build.head? + cmake_deps = (buildpath/"cmake.deps/deps.txt").read.lines + cmake_deps.each do |line| + next unless line.match?(/TREESITTER_[^_]+_URL/) + + parser, parser_url = line.split + parser_name = parser.delete_suffix("_URL") + parser_sha256 = cmake_deps.find { |l| l.include?("#{parser_name}_SHA256") }.split.last + parser_name = parser_name.downcase.tr("_", "-") + + resource parser_name do + url parser_url + sha256 parser_sha256 + end + end + end + + resources.each do |r| + source_directory = buildpath/"deps-build/build/src"/r.name + build_directory = buildpath/"deps-build/build"/r.name + + parser_name = r.name.split("-").last + cmakelists = case parser_name + when "markdown" then "MarkdownParserCMakeLists.txt" + else "TreesitterParserCMakeLists.txt" + end + + r.stage(source_directory) + cp buildpath/"cmake.deps/cmake"/cmakelists, source_directory/"CMakeLists.txt" + + system "cmake", "-S", source_directory, "-B", build_directory, "-DPARSERLANG=#{parser_name}", *std_cmake_args + system "cmake", "--build", build_directory + system "cmake", "--install", build_directory + end + + # Point system locations inside `HOMEBREW_PREFIX`. + inreplace "src/nvim/os/stdpaths.c" do |s| + s.gsub! "/etc/xdg/", "#{etc}/xdg/:\\0" + + if HOMEBREW_PREFIX.to_s != HOMEBREW_DEFAULT_PREFIX + s.gsub! "/usr/local/share/:/usr/share/", "#{HOMEBREW_PREFIX}/share/:\\0" + end + end + + # Replace `-dirty` suffix in `--version` output with `-Homebrew`. + inreplace "cmake/GenerateVersion.cmake", "--dirty", "--dirty=-Homebrew" + + args = [ + "-DLUV_LIBRARY=#{formula_opt_lib("luv")/shared_library("libluv")}", + "-DLIBUV_LIBRARY=#{formula_opt_lib("libuv")/shared_library("libuv")}", + "-DLPEG_LIBRARY=#{formula_opt_lib("lpeg")/shared_library("liblpeg")}", + ] + system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + refute_match "dirty", shell_output("#{bin}/nvim --version") + (testpath/"test.txt").write("Hello World from Vim!!") + system bin/"nvim", "--headless", "-i", "NONE", "-u", "NONE", + "+s/Vim/Neovim/g", "+wq", "test.txt" + assert_equal "Hello World from Neovim!!", (testpath/"test.txt").read.chomp + end +end diff --git a/Formula/nettle.rb b/Formula/nettle.rb new file mode 100644 index 0000000..0cc3985 --- /dev/null +++ b/Formula/nettle.rb @@ -0,0 +1,56 @@ +class Nettle < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "01050aa13ce3825fc1b81f1a3c5994a165301b9d5223a9fb9015d122bde5ca3e" + sha256 cellar: :any, arm64_tahoe: "ba11eb261bc502c28c9cd695f8354306d0a31cb1e55c3d3f1568e051293a0f10" + sha256 cellar: :any_skip_relocation, x86_64_linux: "06c75ac3e75c761b4553312c4ffc12c31eb1757b5ec3e85ce75adc9524337302" + end + desc "Low-level cryptographic library" + homepage "https://www.lysator.liu.se/~nisse/nettle/" + url "https://ftpmirror.gnu.org/gnu/nettle/nettle-4.0.tar.gz" + mirror "https://ftp.gnu.org/gnu/nettle/nettle-4.0.tar.gz" + sha256 "3addbc00da01846b232fb3bc453538ea5468da43033f21bb345cb1e9073f5094" + license any_of: ["GPL-2.0-or-later", "LGPL-3.0-or-later"] + compatibility_version 2 + + + + depends_on "gmp" + + uses_from_macos "m4" => :build + + def install + system "./configure", *std_configure_args, "--enable-shared" + system "make" + system "make", "install" + system "make", "check" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + + int main() + { + struct sha1_ctx ctx; + uint8_t digest[SHA1_DIGEST_SIZE]; + unsigned i; + + sha1_init(&ctx); + sha1_update(&ctx, 4, "test"); + sha1_digest(&ctx, digest); + + printf("SHA1(test)="); + + for (i = 0; i [:build, :test] + + def install + system "python3", "configure.py", "--bootstrap", "--verbose", "--with-python=python3" + + bin.install "ninja" + bash_completion.install "misc/bash-completion" => "ninja" + zsh_completion.install "misc/zsh-completion" => "_ninja" + doc.install "doc/manual.asciidoc" + (share/"vim/vimfiles/syntax").install "misc/ninja.vim" + end + + test do + (testpath/"build.ninja").write <<~NINJA + cflags = -Wall + + rule cc + command = gcc $cflags -c $in -o $out + + build foo.o: cc foo.c + NINJA + system bin/"ninja", "-t", "targets" + port = free_port + spawn bin/"ninja", "-t", "browse", "--port=#{port}", "--hostname=127.0.0.1", "--no-browser", "foo.o" + assert_match "foo.c", shell_output("curl --silent --retry 5 --retry-connrefused http://127.0.0.1:#{port}?foo.o") + end +end diff --git a/Formula/nmap.rb b/Formula/nmap.rb new file mode 100644 index 0000000..19bfa2c --- /dev/null +++ b/Formula/nmap.rb @@ -0,0 +1,81 @@ +class Nmap < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "53af60fb8bc2a54c94d48522bec7b90c8de5843e1057203e56d5ed922ee05f5e" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "7b44210db7bec422a6db3551c6ce37c032d549c6e4b7c1fc73dfc3fd84ffcb61" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "d3f0b702152aaba2e73585a51352ec2143ca9f1870f1849058de81fdfed7a116" + end + desc "Port scanning utility for large networks" + homepage "https://nmap.org/" + url "https://nmap.org/dist/nmap-7.991.tar.bz2" + sha256 "a5d507f29437bef3bedd4771ff9aaa8fc1c2a109ddba1f5b1cf12027456929be" + license :cannot_represent + compatibility_version 1 + head "https://svn.nmap.org/nmap/" + + livecheck do + url "https://nmap.org/download" + regex(/href=.*?nmap[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "python-setuptools" => :build + depends_on "liblinear" + depends_on "libssh2" + # Check supported Lua version at https://github.com/nmap/nmap/tree/master/liblua. + depends_on "lua" + depends_on "openssl@3" + depends_on "pcre2" + depends_on "python@3.14" # for ndiff + + uses_from_macos "bison" => :build + uses_from_macos "flex" => :build + uses_from_macos "libpcap" + + on_linux do + depends_on "zlib-ng-compat" + end + + conflicts_with "cern-ndiff", "ndiff", because: "both install `ndiff` binaries" + conflicts_with cask: "zenmap", because: "both install `nmap` binaries" + + def install + # Fix to missing VERSION file + # https://github.com/nmap/nmap/pull/3111 + mv "libpcap/VERSION.txt", "libpcap/VERSION" + + ENV.deparallelize + + libpcap_path = if OS.mac? + MacOS.sdk_path/"usr/" + else + formula_opt_prefix("libpcap") + end + + args = %W[ + --with-liblua=#{formula_opt_prefix("lua")} + --with-libpcre=#{formula_opt_prefix("pcre2")} + --with-openssl=#{formula_opt_prefix("openssl@3")} + --with-libpcap=#{libpcap_path} + --without-nmap-update + --disable-universal + --without-zenmap + --without-ndiff + ] + + system "./configure", *args, *std_configure_args + system "make" # separate steps required otherwise the build fails + system "make", "install" + + # Install `ndiff` separately so that we can use `pip` and `setuptools`. + system "python3", "-m", "pip", "install", *std_pip_args, "./ndiff" + bin.glob("uninstall_*").map(&:unlink) # Users should use brew uninstall. + end + + test do + system bin/"nmap", "-p80,443", "-oX", "scan1.xml", "google.com" + cp "scan1.xml", "scan2.xml" + system bin/"ndiff", "scan1.xml", "scan2.xml" + end +end diff --git a/Formula/node.rb b/Formula/node.rb new file mode 100644 index 0000000..610f76a --- /dev/null +++ b/Formula/node.rb @@ -0,0 +1,319 @@ +class Node < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "80f02089263fbc62215805a483fea446717e94e782c5e13b3c96261ae3c151a3" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "a33a3deba0d6f80ee138d7ffe30afecadd71eb176a881af1e4114303e1678f7d" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "96316cfb7630362c6c0e1371154475b6585371f9bea13d40fe49e21a3137930b" + end + desc "Open-source, cross-platform JavaScript runtime environment" + homepage "https://nodejs.org/" + url "https://nodejs.org/dist/v26.7.0/node-v26.7.0.tar.xz" + sha256 "e6b182cbeeab032d1082ca4ac4fe15e3a57de691d3bde78ecf8a761fd56ee356" + license "MIT" + compatibility_version 1 + head "https://github.com/nodejs/node.git", branch: "main" + + livecheck do + url "https://nodejs.org/dist/" + regex(%r{href=["']?v?(\d+(?:\.\d+)+)/?["' >]}i) + end + + + + depends_on "pkgconf" => :build + depends_on "python@3.14" => :build + depends_on "ada-url" + depends_on "brotli" + depends_on "c-ares" + depends_on "hdrhistogram_c" + depends_on "icu4c@78" + depends_on "libffi" # System `libffi` is missing some definitions used by node + depends_on "libnghttp2" + depends_on "libnghttp3" + depends_on "libngtcp2" + depends_on "libuv" + depends_on "llhttp" + depends_on "merve" + depends_on "nbytes" + depends_on "openssl@3" + depends_on "simdjson" + depends_on "sqlite" # Fails with macOS sqlite. + depends_on "uvwasi" + depends_on "zstd" + + uses_from_macos "python" + + on_macos do + depends_on "llvm" => :build if DevelopmentTools.clang_build_version <= 1699 + end + + on_linux do + depends_on "zlib-ng-compat" + end + + link_overwrite "bin/npm", "bin/npx" + + # https://github.com/swiftlang/llvm-project/commit/078651b6de4b767b91e3e6a51e5df11a06d7bc4f + fails_with :clang do + build 1699 + cause "needs SFINAE-friendly std::pointer_traits" + end + + # https://github.com/nodejs/node/blob/main/BUILDING.md#supported-toolchains + # https://github.com/ada-url/ada?tab=readme-ov-file#requirements + fails_with :gcc do + version "12" + cause "needs GCC 13 or newer" + end + + # We track major/minor from upstream Node releases. + # We will accept *important* npm patch releases when necessary. + resource "npm" do + url "https://registry.npmjs.org/npm/-/npm-11.19.0.tgz" + sha256 "31e9770f7dc71119a58509353b27917557aaf0ac9b5ef1a0465ee7d8ec67ae75" + + livecheck do + url "https://raw.githubusercontent.com/nodejs/node/refs/tags/v#{LATEST_VERSION}/deps/npm/package.json" + strategy :json do |json| + json["version"] + end + end + end + + deny_network_access! [:build, :postinstall] + + def install + # make sure subprocesses spawned by make are using our Python 3 + ENV["PYTHON"] = which("python3.14") + + # Ensure Homebrew deps are used + rm_r(["deps/icu-small", "deps/npm"]) + + # Never install the bundled "npm", always prefer our + # installation from tarball for better packaging control. + # Disable SEA as incompatible with --shared, https://github.com/nodejs/node/issues/63126 + args = %W[ + --prefix=#{prefix} + --without-npm + --with-intl=system-icu + --shared + --openssl-use-def-ca-store + --disable-single-executable-application + ] + args << "--tag=head" if build.head? + + # Devendor libraries available as formulae. The following maps the name + # used in configure (e.g. `--shared-`) to the bundled subdirectory + # and corresponding formula name as these can all differ. + { + # flag name sub-directory formula name + "ada" => ["ada", "ada-url"], + "brotli" => ["brotli", "brotli"], + "cares" => ["cares", "c-ares"], + "ffi" => ["libffi", "libffi"], + "hdr-histogram" => ["histogram", "hdrhistogram_c"], + "http-parser" => ["llhttp", "llhttp"], + "libuv" => ["uv", "libuv"], + "merve" => ["merve", "merve"], + "nbytes" => ["nbytes", "nbytes"], + "nghttp2" => ["nghttp2", "libnghttp2"], + "nghttp3" => ["ngtcp2/nghttp3", "libnghttp3"], + "ngtcp2" => ["ngtcp2", "libngtcp2"], + "openssl" => ["openssl/openssl", "openssl@3"], + "simdjson" => ["simdjson", "simdjson"], + "sqlite" => ["sqlite", "sqlite"], + "uvwasi" => ["uvwasi", "uvwasi"], + "zlib" => ["zlib", ("zlib-ng-compat" unless OS.mac?)], + "zstd" => ["zstd", "zstd"], + }.each do |flag, (subdir, formula)| + rm_r(buildpath/"deps"/subdir) + args << "--shared-#{flag}" + if formula + args << "--shared-#{flag}-includes=#{formula_opt_include(formula)}" + args << "--shared-#{flag}-libpath=#{formula_opt_lib(formula)}" + end + end + + # TODO: Try to devendor these libraries. + # - `--shared-gtest` is only used for building the test suite, which we don't run here. + # - `--shared-simdutf` seems to result in build failures. + # - `--shared-temporal_capi` is only used when building with `--v8-enable-temporal-support` + # - `--shared-lief` is only used for disabled SEA feature + ignored_shared_flags = %w[ + gtest + simdutf + temporal_capi + lief + ].map { |library| "--shared-#{library}" } + + configure_help = Utils.safe_popen_read("./configure", "--help") + shared_flag_regex = /\[(--shared-[^ \]]+)\]/ + configure_help.scan(shared_flag_regex) do |matches| + matches.each do |flag| + next if args.include?(flag) || ignored_shared_flags.include?(flag) + + message = "Unused `--shared-*` flag: #{flag}" + if build.head? + opoo message + else + odie message + end + end + end + + # Enabling LTO causes brew to error on Linux with a vague message: + # Error: Process completed with exit code 123. + # macOS also can't build with LTO when using LLVM Clang + # LTO is unpleasant if you have to build from source. + args << "--enable-lto" if OS.mac? && ENV.compiler == :clang && build.bottle? + + system "./configure", *args + system "make", "install" + + # Allow npm to find Node before installation has completed. + ENV.prepend_path "PATH", bin + + bootstrap = buildpath/"npm_bootstrap" + bootstrap.install resource("npm") + # These dirs must exists before npm install. + (libexec/"lib").mkpath + system "node", bootstrap/"bin/npm-cli.js", "install", "--loglevel=silly", "--global", + "--prefix=#{libexec}", resource("npm").cached_download + + # The `package.json` stores integrity information about the above passed + # in `cached_download` npm resource, which breaks `npm -g outdated npm`. + # This copies back over the vanilla `package.json` to fix this issue. + (libexec/"lib/node_modules/npm").install bootstrap/"package.json" + + # These symlinks are never used & they've caused issues in the past. + rm_r libexec/"share" if (libexec/"share").exist? + + # Create temporary npm and npx symlinks until post_install is done. + bin.install_symlink libexec/"lib/node_modules/npm/bin/npm-cli.js" => "npm" + bin.install_symlink libexec/"lib/node_modules/npm/bin/npx-cli.js" => "npx" + + # Use the _npm completion included in Zsh rather than generating broken completion + generate_completions_from_executable(bin/"npm", "completion", shells: [:bash], shell_parameter_format: :none) + + (libexec/"lib/node_modules/npm/npmrc").write("prefix = #{HOMEBREW_PREFIX}\n") + end + + # Replace npm but preserve all other modules across node updates/upgrades. + # The bin symlink is to overwrite the temporary npm and npx symlinks to use + # global path. Also create manpage symlinks (or overwrite the old ones). + post_install_steps do + mkdir_p "{{HOMEBREW_PREFIX}}/lib/node_modules" + mkdir_p "{{HOMEBREW_PREFIX}}/share/man/man1" + mkdir_p "{{HOMEBREW_PREFIX}}/share/man/man5" + mkdir_p "{{HOMEBREW_PREFIX}}/share/man/man7" + if_path_exists "{{HOMEBREW_PREFIX}}/lib/node_modules/npm" do + remove "{{HOMEBREW_PREFIX}}/lib/node_modules/npm", recursive: true + end + copy "{{libexec}}/lib/node_modules/npm", "{{HOMEBREW_PREFIX}}/lib/node_modules", recursive: true + symlink "{{HOMEBREW_PREFIX}}/lib/node_modules/npm/bin/npm-cli.js", "{{bin}}/npm", overwrite: true + symlink "{{HOMEBREW_PREFIX}}/lib/node_modules/npm/bin/npx-cli.js", "{{bin}}/npx", overwrite: true + symlink "{{HOMEBREW_PREFIX}}/lib/node_modules/npm/man/man1/{npm,npx,package-}*", + "{{HOMEBREW_PREFIX}}/share/man/man1", overwrite: true, source_glob: true + symlink "{{HOMEBREW_PREFIX}}/lib/node_modules/npm/man/man5/{npm,npx,package-}*", + "{{HOMEBREW_PREFIX}}/share/man/man5", overwrite: true, source_glob: true + symlink "{{HOMEBREW_PREFIX}}/lib/node_modules/npm/man/man7/{npm,npx,package-}*", + "{{HOMEBREW_PREFIX}}/share/man/man7", overwrite: true, source_glob: true + end + + # Explain why some features enabled in upstream binaries are disabled in Homebrew. + # These require fixes upstream for Homebrew to consider enabling them. Do not open issues. + def caveats + <<~EOS + Single Executable Application is disabled as it doesn't work with shared libnode. + Temporal support is disabled as it doesn't work with shared ICU library. + EOS + end + + test do + path = testpath/"test.js" + path.write "console.log('hello');" + + output = shell_output("#{bin}/node #{path}").strip + assert_equal "hello", output + output = shell_output("#{bin}/node -e 'console.log(new Intl.NumberFormat(\"en-EN\").format(1234.56))'").strip + assert_equal "1,234.56", output + + output = shell_output("#{bin}/node -e 'console.log(new Intl.NumberFormat(\"de-DE\").format(1234.56))'").strip + assert_equal "1.234,56", output + + # make sure npm can find node + ENV.prepend_path "PATH", opt_bin + ENV.delete "NVM_NODEJS_ORG_MIRROR" + assert_equal which("node"), opt_bin/"node" + assert_path_exists HOMEBREW_PREFIX/"bin/npm", "npm must exist" + assert_predicate HOMEBREW_PREFIX/"bin/npm", :executable?, "npm must be executable" + npm_args = ["-ddd", "--cache=#{HOMEBREW_CACHE}/npm_cache", "--build-from-source"] + system HOMEBREW_PREFIX/"bin/npm", *npm_args, "install", "npm@latest" + system HOMEBREW_PREFIX/"bin/npm", *npm_args, "install", "nan" + assert_path_exists HOMEBREW_PREFIX/"bin/npx", "npx must exist" + assert_predicate HOMEBREW_PREFIX/"bin/npx", :executable?, "npx must be executable" + assert_match "< hello >", shell_output("#{HOMEBREW_PREFIX}/bin/npx --yes cowsay hello") + + # Test `uvwasi` is linked correctly + (testpath/"wasi-smoke-test.mjs").write <<~JAVASCRIPT + import { WASI } from 'node:wasi'; + + // Minimal WASM that: + // - imports wasi proc_exit(i32)->() + // - exports memory (required by Node's WASI binding) + // - exports _start which calls proc_exit(42) + const wasmBytes = new Uint8Array([ + // \0asm + version + 0x00,0x61,0x73,0x6d, 0x01,0x00,0x00,0x00, + + // Type section: 2 types: (i32)->() and ()->() + 0x01,0x08, 0x02, + 0x60,0x01,0x7f,0x00, + 0x60,0x00,0x00, + + // Import section: wasi_snapshot_preview1.proc_exit : func(type 0) + 0x02,0x24, 0x01, + 0x16, // module name len = 22 + 0x77,0x61,0x73,0x69,0x5f,0x73,0x6e,0x61,0x70,0x73,0x68,0x6f,0x74,0x5f,0x70,0x72,0x65,0x76,0x69,0x65,0x77,0x31, + 0x09, // name len = 9 + 0x70,0x72,0x6f,0x63,0x5f,0x65,0x78,0x69,0x74, + 0x00, // import kind = func + 0x00, // type index 0 + + // Function section: 1 function (type index 1 = ()->()) + 0x03,0x02, 0x01, 0x01, + + // Memory section: one memory with min=1 page; export later + 0x05,0x03, 0x01, 0x00, 0x01, + + // Export section: export "_start" (func 1) and "memory" (mem 0) + 0x07,0x13, 0x02, + 0x06, 0x5f,0x73,0x74,0x61,0x72,0x74, 0x00, 0x01, + 0x06, 0x6d,0x65,0x6d,0x6f,0x72,0x79, 0x02, 0x00, + + // Code section: body for func 1: i32.const 42; call 0; end + 0x0a,0x08, 0x01, + 0x06, 0x00, 0x41,0x2a, 0x10,0x00, 0x0b + ]); + + const wasi = new WASI({ + version: 'preview1', + returnOnExit: true + }); + + const { instance } = await WebAssembly.instantiate(wasmBytes, wasi.getImportObject()); + + // This should return 42 if uvwasi is correctly linked & wired. + const rc = wasi.start(instance); + if (rc === 42) { + console.log('PASS: uvwasi proc_exit(42) worked (exitCode=42)'); + process.exit(0); + } else { + console.error('FAIL: unexpected return', rc); + process.exit(2); + } + JAVASCRIPT + + system bin/"node", "wasi-smoke-test.mjs" + end +end diff --git a/Formula/npth.rb b/Formula/npth.rb new file mode 100644 index 0000000..5052a43 --- /dev/null +++ b/Formula/npth.rb @@ -0,0 +1,56 @@ +class Npth < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "7836af0109be87ab2b8155b533cd33508eb3b738190031c8ca2e2b94df6f5c2b" + sha256 cellar: :any, arm64_tahoe: "7dc8a83801469950381677b61404e103e5fd8fb22bc6b4e0f68db292d5801e3a" + sha256 cellar: :any_skip_relocation, x86_64_linux: "dfe2b3f4f5fb1b8e05b3ddbc5dddbf44d3b03b95ca9712ff4fc33cbd045368b4" + end + desc "New GNU portable threads library" + homepage "https://gnupg.org/" + url "https://gnupg.org/ftp/gcrypt/npth/npth-1.8.tar.bz2" + mirror "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/npth/npth-1.8.tar.bz2" + sha256 "8bd24b4f23a3065d6e5b26e98aba9ce783ea4fd781069c1b35d149694e90ca3e" + license "LGPL-2.1-or-later" + + livecheck do + url "https://gnupg.org/ftp/gcrypt/npth/" + regex(/href=.*?npth[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + def install + system "./configure", "--disable-silent-rules", *std_configure_args + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + + void* thread_function(void *arg) { + printf("Hello from nPth thread!\\n"); + return NULL; + } + + int main() { + npth_t thread_id; + int status; + + status = npth_init(); + if (status != 0) { + fprintf(stderr, "Failed to initialize nPth.\\n"); + return 1; + } + + status = npth_create(&thread_id, NULL, thread_function, NULL); + npth_join(thread_id, NULL); + return 0; + } + + C + system ENV.cc, "test.c", "-L#{lib}", "-lnpth", "-o", "test" + assert_match "Hello from nPth thread!", shell_output("./test") + end +end diff --git a/Formula/opencode.rb b/Formula/opencode.rb new file mode 100644 index 0000000..f941ee5 --- /dev/null +++ b/Formula/opencode.rb @@ -0,0 +1,43 @@ +class Opencode < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "4515cb503a7889c18ffbe553e60d4505fa3601700c3639628c286eb5246d4bc0" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "4515cb503a7889c18ffbe553e60d4505fa3601700c3639628c286eb5246d4bc0" + sha256 cellar: :any_skip_relocation, x86_64_linux: "647ab92c4a4615d34638faa4e805a344b8f19f522d736e763f8e6443e8745a94" + end + desc "AI coding agent, built for the terminal" + homepage "https://opencode.ai" + url "https://registry.npmjs.org/opencode-ai/-/opencode-ai-1.18.15.tgz" + sha256 "aae2e10aa53da715d097ac109ca03c0feb451bd453dce9d21d335c6fc7a37c0a" + license "MIT" + + livecheck do + throttle 5 + end + + + + depends_on "node" + depends_on "ripgrep" + + def install + system "npm", "install", *std_npm_args(ignore_scripts: false) + bin.install_symlink libexec.glob("bin/*") + + # Remove binaries for other architectures, `-musl`, `-baseline`, and `-baseline-musl` + arch = Hardware::CPU.arm? ? "arm64" : "x64" + os = OS.linux? ? "linux" : "darwin" + (libexec/"lib/node_modules/opencode-ai/node_modules").children.each do |d| + next unless d.directory? + + rm_r d if d.basename.to_s != "opencode-#{os}-#{arch}" + end + + generate_completions_from_executable(bin/"opencode", "completion", shell_parameter_format: :none, shells: [:zsh]) + end + + test do + assert_match version.to_s, shell_output("#{bin}/opencode --version") + assert_match "opencode", shell_output("#{bin}/opencode models") + end +end diff --git a/Formula/openjdk@17.rb b/Formula/openjdk@17.rb new file mode 100644 index 0000000..1381159 --- /dev/null +++ b/Formula/openjdk@17.rb @@ -0,0 +1,176 @@ +class OpenjdkAT17 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "f92c469c7db8603afc883123c556aa0d8a2d05cc091f4c4993ad6b3b0f075cea" + sha256 cellar: :any, arm64_tahoe: "a78892bef5ec94a569e749fe6b1b39701f49df20ed7749cde7b5c9061a82d31a" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "0a9bce5ba024f7eec9b554758fbc7fb7b8736969a125782a51674c14ea56a934" + end + desc "Development kit for the Java programming language" + homepage "https://openjdk.org/" + url "https://github.com/openjdk/jdk17u/archive/refs/tags/jdk-17.0.20-ga.tar.gz" + sha256 "ba3ac4b9d7f2c050f46ddcec39b4258660a3f09836f5a71617fd3f7311d06c0b" + license "GPL-2.0-only" => { with: "Classpath-exception-2.0" } + compatibility_version 1 + + livecheck do + url :stable + regex(/^jdk[._-]v?(17(?:\.\d+)*)-ga$/i) + end + + + + keg_only :versioned_formula + + deprecate! date: "2026-09-30", because: :unmaintained + disable! date: "2029-09-30", because: :unmaintained + + depends_on "autoconf" => :build + depends_on "pkgconf" => :build + + depends_on "freetype" + depends_on "giflib" + depends_on "harfbuzz" + depends_on "jpeg-turbo" + depends_on "libpng" + depends_on "little-cms2" + + uses_from_macos "unzip" => :build + uses_from_macos "zip" => :build + uses_from_macos "cups" => :no_linkage + + on_macos do + depends_on xcode: :build # for metal + end + + on_linux do + depends_on "libxt" => :build + depends_on "alsa-lib" + depends_on "fontconfig" => :no_linkage + depends_on "libx11" + depends_on "libxext" + depends_on "libxi" + depends_on "libxrandr" => :no_linkage + depends_on "libxrender" + depends_on "libxtst" + depends_on "zlib-ng-compat" + end + + # From https://jdk.java.net/archive/ + resource "boot-jdk" do + on_macos do + on_arm do + url "https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_macos-aarch64_bin.tar.gz" + sha256 "602d7de72526368bb3f80d95c4427696ea639d2e0cc40455f53ff0bbb18c27c8" + end + on_intel do + url "https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_macos-x64_bin.tar.gz" + sha256 "b85c4aaf7b141825ad3a0ea34b965e45c15d5963677e9b27235aa05f65c6df06" + end + end + on_linux do + on_arm do + url "https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_linux-aarch64_bin.tar.gz" + sha256 "13bfd976acf8803f862e82c7113fb0e9311ca5458b1decaef8a09ffd91119fa4" + end + on_intel do + url "https://download.java.net/java/GA/jdk17.0.2/dfd4a8d0985749f896bed50d7138ee7f/8/GPL/openjdk-17.0.2_linux-x64_bin.tar.gz" + sha256 "0022753d0cceecacdd3a795dd4cea2bd7ffdf9dc06e22ffd1be98411742fbb44" + end + end + end + + def install + boot_jdk = buildpath/"boot-jdk" + resource("boot-jdk").stage boot_jdk + boot_jdk /= "Contents/Home" if OS.mac? + java_options = ENV.delete("_JAVA_OPTIONS") + + args = %W[ + --disable-warnings-as-errors + --with-boot-jdk-jvmargs=#{java_options} + --with-boot-jdk=#{boot_jdk} + --with-debug-level=release + --with-jvm-variants=server + --with-native-debug-symbols=none + --with-vendor-bug-url=#{tap.issues_url} + --with-vendor-name=#{tap.user} + --with-vendor-url=#{tap.issues_url} + --with-vendor-version-string=#{tap.user} + --with-vendor-vm-bug-url=#{tap.issues_url} + --with-version-build=#{revision} + --without-version-opt + --without-version-pre + --with-freetype=system + --with-giflib=system + --with-harfbuzz=system + --with-lcms=system + --with-libjpeg=system + --with-libpng=system + --with-zlib=system + ] + + ldflags = ["-Wl,-rpath,#{loader_path.gsub("$", "\\$$")}/server"] + args += if OS.mac? + ldflags << "-headerpad_max_install_names" + + # Allow unbundling `freetype` on macOS + inreplace "make/autoconf/lib-freetype.m4", '= "xmacosx"', '= ""' + + %W[ + --enable-dtrace + --with-freetype-include=#{formula_opt_include("freetype")} + --with-freetype-lib=#{formula_opt_lib("freetype")} + --with-sysroot=#{MacOS.sdk_path} + ] + else + %W[ + --with-x=#{HOMEBREW_PREFIX} + --with-cups=#{HOMEBREW_PREFIX} + --with-fontconfig=#{HOMEBREW_PREFIX} + --with-stdc++lib=dynamic + ] + end + args << "--with-extra-ldflags=#{ldflags.join(" ")}" + + system "bash", "configure", *args + + ENV["MAKEFLAGS"] = "JOBS=#{ENV.make_jobs}" + system "make", "images" + + jdk = libexec + if OS.mac? + libexec.install Dir["build/*/images/jdk-bundle/*"].first => "openjdk.jdk" + jdk /= "openjdk.jdk/Contents/Home" + else + libexec.install Dir["build/linux-*-server-release/images/jdk/*"] + end + + bin.install_symlink Dir[jdk/"bin/*"] + include.install_symlink Dir[jdk/"include/*.h"] + include.install_symlink Dir[jdk/"include"/OS.kernel_name.downcase/"*.h"] + man1.install_symlink Dir[jdk/"man/man1/*"] + end + + def caveats + on_macos do + <<~EOS + For the system Java wrappers to find this JDK, symlink it with + sudo ln -sfn #{opt_libexec}/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk + EOS + end + end + + test do + (testpath/"HelloWorld.java").write <<~JAVA + class HelloWorld { + public static void main(String args[]) { + System.out.println("Hello, world!"); + } + } + JAVA + + system bin/"javac", "HelloWorld.java" + + assert_match "Hello, world!", shell_output("#{bin}/java HelloWorld") + end +end diff --git a/Formula/openjpeg.rb b/Formula/openjpeg.rb new file mode 100644 index 0000000..2e652e2 --- /dev/null +++ b/Formula/openjpeg.rb @@ -0,0 +1,51 @@ +class Openjpeg < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "8e3ac331458daccf876225a4236bad7d28689ea197c6bb7d2640ec47d78a510d" + sha256 cellar: :any, arm64_tahoe: "e9becf9b440b08fd771dbaa75d4f5b06a49119f9ce163e6ad08f272f4f3b9c9d" + sha256 cellar: :any_skip_relocation, x86_64_linux: "ea1906cdeecd5edc87703596cc084dc305834b030af3847a8520f9eb8566eb1e" + end + desc "Library for JPEG-2000 image manipulation" + homepage "https://www.openjpeg.org/" + url "https://github.com/uclouvain/openjpeg/archive/refs/tags/v2.5.4.tar.gz" + sha256 "a695fbe19c0165f295a8531b1e4e855cd94d0875d2f88ec4b61080677e27188a" + license "BSD-2-Clause" + compatibility_version 1 + head "https://github.com/uclouvain/openjpeg.git", branch: "master" + + + + depends_on "cmake" => :build + depends_on "doxygen" => :build + depends_on "libpng" + depends_on "libtiff" + depends_on "little-cms2" + + def install + system "cmake", "-S", ".", "-B", "build", *std_cmake_args, + "-DCMAKE_INSTALL_RPATH=#{rpath}", + "-DBUILD_DOC=ON" + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + (testpath/"test.c").write <<~C + #include + + int main () { + opj_image_cmptparm_t cmptparm; + const OPJ_COLOR_SPACE color_space = OPJ_CLRSPC_GRAY; + + opj_image_t *image; + image = opj_image_create(1, &cmptparm, color_space); + + opj_image_destroy(image); + return 0; + } + C + system ENV.cc, "-I#{include.children.first}", + testpath/"test.c", "-L#{lib}", "-lopenjp2", "-o", "test" + system "./test" + end +end diff --git a/Formula/openssl@4.rb b/Formula/openssl@4.rb new file mode 100644 index 0000000..ed2e095 --- /dev/null +++ b/Formula/openssl@4.rb @@ -0,0 +1,120 @@ +class OpensslAT4 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 1 + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "500c12b28d754f34b36a193f3f1f8bf676e9bef0de18e641792df7a258fbad5a" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "df1f1b0af55395e4b3527b2c6d94cb2372cdca8f8414a8290e33f5b1c878e371" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "a014111c512510f60006435d7f8104e98cfbfffbfaf52e0e63252de522de7754" + end + desc "Cryptography and SSL/TLS Toolkit" + homepage "https://openssl-library.org" + url "https://github.com/openssl/openssl/releases/download/openssl-4.0.1/openssl-4.0.1.tar.gz" + mirror "http://fresh-center.net/linux/misc/openssl-4.0.1.tar.gz" + sha256 "2db3f3a0d6ea4b59e1f094ace2c8cd536dffb87cdc39084c5afa1e6f7f37dd09" + license "Apache-2.0" + + livecheck do + url "https://openssl-library.org/source/" + regex(/href=.*?openssl[._-]v?(4(?:\.\d+)+)\.t/i) + end + + + + keg_only :versioned_formula + + depends_on "ca-certificates" => :no_linkage + + uses_from_macos "perl" => :build + + # Backport commits to avoid test intermittent failures + patch do + url "https://github.com/openssl/openssl/commit/1e386aab890b52f46641ab18e1a56cabb1b8c47b.patch?full_index=1" + sha256 "636f11a33a39536c1cc69426c73863db2b57be636b5977a4076b0995c342ef30" + type :backport + end + patch do + url "https://github.com/openssl/openssl/commit/d9f73e36c5fe720b3367e0fc6501683a3f91193a.patch?full_index=1" + sha256 "3508588c5e03ba6d3898512f0e8e3aa1f177e243c026884d6c31020359cae59e" + type :backport + end + + def install + configure_args = %W[ + --prefix=#{prefix} + --openssldir=#{pkgetc} + --libdir=lib + ] + + arch_args = [] + if OS.mac? + arch_args += %W[darwin64-#{Hardware::CPU.arch}-cc enable-ec_nistp_64_gcc_128] + elsif Hardware::CPU.intel? + arch_args << (Hardware::CPU.is_64_bit? ? "linux-x86_64" : "linux-elf") + elsif Hardware::CPU.arm? + arch_args << (Hardware::CPU.is_64_bit? ? "linux-aarch64" : "linux-armv4") + end + + pkgetc.mkpath + system "perl", "./Configure", *configure_args, *arch_args + system "make" + system "make", "install", "MANDIR=#{man}", "MANSUFFIX=ssl" + system "make", "HARNESS_JOBS=#{ENV.make_jobs}", "test" + + # Prevent `brew` from pruning the `certs` and `private` directories. + touch %w[certs private].map { |subdir| pkgetc/subdir/".keepme" } + end + + post_install_steps do + symlink "{{etc}}/ca-certificates/cert.pem", "{{pkgetc}}/cert.pem", overwrite: true + end + + def caveats + <<~EOS + To add additional certificates, place .pem files in + #{pkgetc}/certs + + and run + #{opt_bin}/c_rehash + EOS + end + + test do + # Make sure the necessary .cnf file exists, otherwise OpenSSL gets moody. + assert_path_exists pkgetc/"openssl.cnf", "OpenSSL requires the .cnf file for some functionality" + assert_path_exists pkgetc/"certs", "OpenSSL throws confusing errors when this directory is missing" + + # Check OpenSSL itself functions as expected. + (testpath/"testfile.txt").write("This is a test file") + expected_checksum = "e2d0fe1585a63ec6009c8016ff8dda8b17719a637405a4e23c0ff81339148249" + system bin/"openssl", "dgst", "-sha256", "-out", "checksum.txt", "testfile.txt" + open("checksum.txt") do |f| + checksum = f.read(100).split("=").last.strip + assert_equal checksum, expected_checksum + end + + # Invalid cert from superfish.badssl.com + bad_cert = <<~PEM + -----BEGIN CERTIFICATE----- + MIIC9TCCAl6gAwIBAgIJAK5EmlK7Klu5MA0GCSqGSIb3DQEBCwUAMFsxGDAWBgNV + BAoTD1N1cGVyZmlzaCwgSW5jLjELMAkGA1UEBxMCU0YxCzAJBgNVBAgTAkNBMQsw + CQYDVQQGEwJVUzEYMBYGA1UEAxMPU3VwZXJmaXNoLCBJbmMuMB4XDTE4MDUxNjE3 + MTUyM1oXDTIwMDUxNTE3MTUyM1owajELMAkGA1UEBhMCVVMxEzARBgNVBAgMCkNh + bGlmb3JuaWExFjAUBgNVBAcMDVNhbiBGcmFuY2lzY28xDzANBgNVBAoMBkJhZFNT + TDEdMBsGA1UEAwwUc3VwZXJmaXNoLmJhZHNzbC5jb20wggEiMA0GCSqGSIb3DQEB + AQUAA4IBDwAwggEKAoIBAQDCBOz4jO4EwrPYUNVwWMyTGOtcqGhJsCK1+ZWesSss + dj5swEtgTEzqsrTAD4C2sPlyyYYC+VxBXRMrf3HES7zplC5QN6ZnHGGM9kFCxUbT + Focnn3TrCp0RUiYhc2yETHlV5NFr6AY9SBVSrbMo26r/bv9glUp3aznxJNExtt1N + wMT8U7ltQq21fP6u9RXSM0jnInHHwhR6bCjqN0rf6my1crR+WqIW3GmxV0TbChKr + 3sMPR3RcQSLhmvkbk+atIgYpLrG6SRwMJ56j+4v3QHIArJII2YxXhFOBBcvm/mtU + mEAnhccQu3Nw72kYQQdFVXz5ZD89LMOpfOuTGkyG0cqFAgMBAAGjLjAsMAkGA1Ud + EwQCMAAwHwYDVR0RBBgwFoIUc3VwZXJmaXNoLmJhZHNzbC5jb20wDQYJKoZIhvcN + AQELBQADgYEAKgHH4VD3jfwzxvtWTmIA1nwK+Fjqe9VFXyDwXiBnhqDwJp9J+/2y + r7jbXfEKf7WBS6OmnU+HTjxUCFx2ZnA4r7dU5nIsNadKEDVHDOvYEJ6mXHPkrvlt + k79iHC0DJiJX36BTXcU649wKEVjgX/kT2yy3YScPdBoN0vtzPN3yFsQ= + -----END CERTIFICATE----- + PEM + output = pipe_output("#{bin}/openssl verify 2>&1", bad_cert, 2) + assert_match "verification failed", output + refute_match "error:80000002", output + end +end diff --git a/Formula/opus.rb b/Formula/opus.rb new file mode 100644 index 0000000..0994c61 --- /dev/null +++ b/Formula/opus.rb @@ -0,0 +1,67 @@ +class Opus < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "85d6f1e885117016478e468f92033f648d9bab05210708fe195cacefe5be8266" + sha256 cellar: :any, arm64_tahoe: "5e8146a64fab2683ea447aaa7d0de0b1d717539b4cdabd1fedd4a510e4be0d1e" + sha256 cellar: :any_skip_relocation, x86_64_linux: "739c259ce69a8af064bb73412700615a4e76405344c186f056710201f6ffda7b" + end + desc "Audio codec" + homepage "https://www.opus-codec.org/" + url "https://ftp.osuosl.org/pub/xiph/releases/opus/opus-1.6.1.tar.gz" + mirror "https://github.com/xiph/opus/releases/download/v1.6.1/opus-1.6.1.tar.gz" + sha256 "6ffcb593207be92584df15b32466ed64bbec99109f007c82205f0194572411a1" + license "BSD-3-Clause" + compatibility_version 1 + + livecheck do + url "https://ftp.osuosl.org/pub/xiph/releases/opus/" + regex(%r{href=(?:["']?|.*?/)opus[._-]v?(\d+(?:\.\d+)+)\.t}i) + end + + + + head do + url "https://gitlab.xiph.org/xiph/opus.git", branch: "main" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + end + + def install + system "./autogen.sh" if build.head? + system "./configure", "--disable-doc", *std_configure_args + system "make", "install" + end + + test do + (testpath/"test.cpp").write <<~CPP + #include + + int main(int argc, char **argv) + { + int err = 0; + opus_int32 rate = 48000; + int channels = 2; + int app = OPUS_APPLICATION_AUDIO; + OpusEncoder *enc; + int ret; + + enc = opus_encoder_create(rate, channels, app, &err); + if (!(err < 0)) + { + err = opus_encoder_ctl(enc, OPUS_SET_BITRATE(OPUS_AUTO)); + if (!(err < 0)) + { + opus_encoder_destroy(enc); + return 0; + } + } + return err; + } + CPP + system ENV.cxx, "-I#{include}/opus", testpath/"test.cpp", + "-L#{lib}", "-lopus", "-o", "test" + system "./test" + end +end diff --git a/Formula/orc.rb b/Formula/orc.rb new file mode 100644 index 0000000..c4363f8 --- /dev/null +++ b/Formula/orc.rb @@ -0,0 +1,48 @@ +class Orc < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "7a0d9ba6e8e8279bc1c17502bb2384564ee63b8df3f0db9e2fdbc04084807713" + sha256 cellar: :any, arm64_tahoe: "a45340cf95a072f37cb00f9bcb8b1dfe31128fe4a9421957c9a57938a87341a1" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "f61c9e4d2bc4894d65d16c7ccedeba81ffaac9c07cbc337be00cd8d77d353c06" + end + desc "Oil Runtime Compiler (ORC)" + homepage "https://gstreamer.freedesktop.org/modules/orc.html" + url "https://gstreamer.freedesktop.org/src/orc/orc-0.4.42.tar.xz" + sha256 "7ec912ab59af3cc97874c456a56a8ae1eec520c385ec447e8a102b2bd122c90c" + license all_of: ["BSD-2-Clause", "BSD-3-Clause"] + compatibility_version 1 + + livecheck do + url "https://gstreamer.freedesktop.org/src/orc/" + regex(/href=.*?orc[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "meson" => :build + depends_on "ninja" => :build + + def install + system "meson", "setup", "build", *std_meson_args + system "meson", "compile", "-C", "build", "--verbose" + system "meson", "install", "-C", "build" + end + + test do + assert_match version.to_s, shell_output("#{bin}/orcc --version 2>&1") + + (testpath/"test.c").write <<~C + #include + + int main(int argc, char *argv[]) { + if (orc_version_string() == NULL) { + return 1; + } + return 0; + } + C + + system ENV.cc, "test.c", "-I#{include}/orc-0.4", "-L#{lib}", "-lorc-0.4", "-o", "test" + system "./test" + end +end diff --git a/Formula/p11-kit.rb b/Formula/p11-kit.rb new file mode 100644 index 0000000..c3e0456 --- /dev/null +++ b/Formula/p11-kit.rb @@ -0,0 +1,51 @@ +class P11Kit < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "9d5ad4e56eff3b53b27bb652bc19a31fa5dc1144ace4038e9d5c1dc8970c7cf9" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "0e6d34def01884f9a650e591dd8f86241c7fb90bebc827c94203c837749feed6" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "dfaaaf005b724b7c3c96584a4c40b42372e6f37ac3f5609c4a8c00411f55ec07" + end + desc "Library to load and enumerate PKCS#11 modules" + homepage "https://p11-glue.github.io/p11-glue/p11-kit.html" + url "https://github.com/p11-glue/p11-kit/releases/download/0.26.5/p11-kit-0.26.5.tar.xz" + sha256 "f2cc09111e44bf3fea58f023180b33acea90aa82d042d6fbb623fbc5ba033bb7" + license "BSD-3-Clause" + compatibility_version 1 + head "https://github.com/p11-glue/p11-kit.git", branch: "master" + + + + depends_on "meson" => :build + depends_on "ninja" => :build + depends_on "pkgconf" => :build + depends_on "ca-certificates" + depends_on "libtasn1" + + uses_from_macos "libffi" + + def install + # https://bugs.freedesktop.org/show_bug.cgi?id=91602#c1 + ENV["FAKED_MODE"] = "1" + + args = %W[ + -Dsystem_config=#{etc} + -Dmodule_config=#{etc}/pkcs11/modules + -Dtrust_paths=#{etc}/ca-certificates/cert.pem + -Dsystemd=disabled + ] + + system "meson", "setup", "_build", *args, *std_meson_args + system "meson", "compile", "-C", "_build", "--verbose" + # This formula is used with crypto libraries, so let's run the test suite. + system "meson", "test", "-C", "_build", "--timeout-multiplier=2" + system "meson", "install", "-C", "_build" + + # HACK: Work around p11-kit: couldn't load module: .../lib/pkcs11/p11-kit-trust.so + # Issue ref: https://github.com/p11-glue/p11-kit/issues/612 + (lib/"pkcs11").install_symlink "p11-kit-trust.dylib" => "p11-kit-trust.so" if OS.mac? + end + + test do + assert_match "library-manufacturer: PKCS#11 Kit", shell_output("#{bin}/p11-kit list-modules --verbose") + end +end diff --git a/Formula/pcre2.rb b/Formula/pcre2.rb new file mode 100644 index 0000000..a144e5e --- /dev/null +++ b/Formula/pcre2.rb @@ -0,0 +1,61 @@ +class Pcre2 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "bef2e718b92e5e819a51723157e60eceb76acc4efb0894a10c315cd36abca13c" + sha256 cellar: :any, arm64_tahoe: "948b00bdaf75a842341f08a949ca3d414ae5333df2c305a7e371be31a2c30963" + sha256 cellar: :any, sequoia: "167ef6d2b6337706884e23ee902cfc2ff8faeb455f2e07d23233e3061268867c" + sha256 cellar: :any_skip_relocation, x86_64_linux: "70d6e7a6d4257227d3b6c8e3b0bbcb244852eff6fc7a30fba6b6474316a4ea1d" + end + desc "Perl compatible regular expressions library with a new API" + homepage "https://www.pcre.org/" + url "https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.47/pcre2-10.47.tar.bz2" + sha256 "47fe8c99461250d42f89e6e8fdaeba9da057855d06eb7fc08d9ca03fd08d7bc7" + license "BSD-3-Clause" + revision 1 + compatibility_version 1 + + livecheck do + url :stable + regex(/^pcre2[._-]v?(\d+(?:\.\d+)+)$/i) + end + + + + head do + url "https://github.com/PCRE2Project/pcre2.git", branch: "main" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + end + + uses_from_macos "bzip2" + + on_linux do + depends_on "zlib-ng-compat" + end + + def install + args = %W[ + --disable-dependency-tracking + --prefix=#{prefix} + --enable-pcre2-16 + --enable-pcre2-32 + --enable-pcre2grep-libz + --enable-pcre2grep-libbz2 + --enable-jit + ] + + args << "--enable-pcre2test-libedit" if OS.mac? + + system "./autogen.sh" if build.head? + + system "./configure", *args + system "make" + system "make", "install" + end + + test do + system bin/"pcre2grep", "regular expression", prefix/"README" + end +end diff --git a/Formula/pillow.rb b/Formula/pillow.rb new file mode 100644 index 0000000..b6d5480 --- /dev/null +++ b/Formula/pillow.rb @@ -0,0 +1,114 @@ +class Pillow < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "3b3e8bfaa5ca2d7fc699923c86610e18c240bd8bab70e5f54bebfbdc0f7e5de1" + sha256 cellar: :any, arm64_tahoe: "368dd59ca13924d5bb3389dbc251dddc0fa4bc931f8a723cfa132ce1d31055dc" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "d7968166b5d2d7dba702ad5672f23100b47c876cfd0ef337863742894d649474" + end + desc "Friendly PIL fork (Python Imaging Library)" + homepage "https://python-pillow.github.io/" + url "https://files.pythonhosted.org/packages/1c/3d/bb7fca845737cf9d7dbde16ed1843984665ff2e0a518f5db43e77ec540b9/pillow-12.3.0.tar.gz" + sha256 "3b8182a766685eaa002637e28b4ec8d6b18819a0c71f579bf0dbaa5830297cce" + license "HPND" + compatibility_version 1 + head "https://github.com/python-pillow/Pillow.git", branch: "main" + + + + depends_on "cmake" => :build + depends_on "ninja" => :build + depends_on "pkgconf" => :build + depends_on "pybind11" => :build + depends_on "python@3.13" => [:build, :test] + depends_on "python@3.14" => [:build, :test] + depends_on "freetype" + depends_on "jpeg-turbo" + depends_on "libavif" + depends_on "libimagequant" + depends_on "libraqm" + depends_on "libtiff" + depends_on "libxcb" + depends_on "little-cms2" + depends_on "openjpeg" + depends_on "webp" + + on_linux do + depends_on "zlib-ng-compat" + end + + def pythons + deps.map(&:to_formula) + .select { |f| f.name.match?(/^python@\d\.\d+$/) } + .map { |f| f.opt_libexec/"bin/python" } + end + + def install + ENV["MAX_CONCURRENCY"] = ENV.make_jobs.to_s + deps.each do |dep| + next if dep.build? || dep.test? + + ENV.prepend "CPPFLAGS", "-I#{dep.to_formula.opt_include}" + ENV.prepend "LDFLAGS", "-L#{dep.to_formula.opt_lib}" + end + + pythons.each do |python| + system python, "-m", "pip", "install", *std_pip_args(build_isolation: true), + "-C", "debug=true", # Useful in case of build failures. + "-C", "tiff=enable", + "-C", "freetype=enable", + "-C", "lcms=enable", + "-C", "webp=enable", + "-C", "xcb=enable", + "-C", "avif=enable", + "." + end + end + + test do + (testpath/"test.py").write <<~PYTHON + from PIL import Image + im = Image.open("#{test_fixtures("test.jpg")}") + print(im.format, im.size, im.mode) + PYTHON + + pythons.each do |python| + assert_equal "JPEG (1, 1) RGB", shell_output("#{python} test.py").chomp + end + + # Test webp support + resource "test-webp" do + url "https://raw.githubusercontent.com/python-pillow/Pillow/refs/heads/main/Tests/images/flower.webp" + sha256 "af5bf1a0e420467c09d221fbfbb739646956c17f2b67f8280eacfacf87059a37" + end + + testpath.install resource("test-webp") + test_webp = testpath/"flower.webp" + (testpath/"test_webp.py").write <<~PYTHON + from PIL import Image + im = Image.open("#{test_webp}") + print(im.format, im.size, im.mode) + PYTHON + + pythons.each do |python| + assert_equal "WEBP (480, 360) RGB", shell_output("#{python} test_webp.py").chomp + end + + # Test avif support + resource "test-avif" do + url "https://raw.githubusercontent.com/python-pillow/Pillow/refs/heads/main/Tests/images/avif/exif.avif" + sha256 "438dc63eb5aa722f4b23a93ac48cd0c19b7a575865c89e666c86b7ac363cff04" + end + + testpath.install resource("test-avif") + test_avif = testpath/"exif.avif" + (testpath/"test_avif.py").write <<~PYTHON + from PIL import Image + im = Image.open("#{test_avif}") + print(im.format, im.size, im.mode) + PYTHON + + pythons.each do |python| + assert_equal "AVIF (512, 512) RGB", shell_output("#{python} test_avif.py").chomp + end + end +end diff --git a/Formula/pinentry.rb b/Formula/pinentry.rb new file mode 100644 index 0000000..cf8a28a --- /dev/null +++ b/Formula/pinentry.rb @@ -0,0 +1,57 @@ +class Pinentry < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "eb7ffd4b8a4f31ce85cf0395656bbc1fd5241fdc1b9f92d9900e813993d4e1e0" + sha256 cellar: :any, arm64_tahoe: "21e2614c38af0287f96dd0c288dea2c13bfbb7810ce1d6e659ed82e5c2073c92" + sha256 cellar: :any, x86_64_linux: "b5e23cb72d88f6ea3c9c9f95aa356231ea072dd8f91886249154366db8ea6c69" + end + desc "Passphrase entry dialog utilizing the Assuan protocol" + homepage "https://www.gnupg.org/related_software/pinentry/" + url "https://www.gnupg.org/ftp/gcrypt/pinentry/pinentry-1.3.3.tar.bz2" + mirror "https://www.mirrorservice.org/sites/ftp.gnupg.org/gcrypt/pinentry/pinentry-1.3.3.tar.bz2" + sha256 "c2970f16d6afb66ecddfca767d743936c86239bff936eed7fd7597a678414b63" + license "GPL-2.0-or-later" + compatibility_version 1 + + livecheck do + url "https://gnupg.org/ftp/gcrypt/pinentry/" + regex(/href=.*?pinentry[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "pkgconf" => :build + depends_on "libassuan" + depends_on "libgpg-error" + + uses_from_macos "ncurses" + + on_linux do + depends_on "glib" + depends_on "libsecret" + end + + def install + # Fix compile with newer Clang + ENV.append_to_cflags "-Wno-implicit-function-declaration" if DevelopmentTools.clang_build_version >= 1403 + + args = %w[ + --disable-silent-rules + --disable-pinentry-fltk + --disable-pinentry-gnome3 + --disable-pinentry-gtk2 + --disable-pinentry-qt + --disable-pinentry-qt5 + --disable-pinentry-tqt + --enable-pinentry-tty + ] + + system "./configure", *args, *std_configure_args + system "make", "install" + end + + test do + system bin/"pinentry", "--version" + system bin/"pinentry-tty", "--version" + end +end diff --git a/Formula/pixman.rb b/Formula/pixman.rb new file mode 100644 index 0000000..3903c37 --- /dev/null +++ b/Formula/pixman.rb @@ -0,0 +1,50 @@ +class Pixman < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 1 + sha256 cellar: :any, arm64_sequoia: "86f5fc013d2b22bbe41c1c14661287bf8e8e4c3ac95cd05b08b886d24918fe34" + sha256 cellar: :any, arm64_tahoe: "2b011051909d7f9ad432a76d32c0490f796ad545f7acbd6445356024f0c712e5" + sha256 cellar: :any_skip_relocation, x86_64_linux: "acad642a52a0e39159ba340f1e676c63d014422bf1d90e218ba7397b5873a2d1" + end + desc "Low-level library for pixel manipulation" + homepage "https://cairographics.org/" + url "https://cairographics.org/releases/pixman-0.46.4.tar.gz" + sha256 "d09c44ebc3bd5bee7021c79f922fe8fb2fb57f7320f55e97ff9914d2346a591c" + license "MIT" + compatibility_version 1 + + livecheck do + url "https://cairographics.org/releases/?C=M&O=D" + regex(/href=.*?pixman[._-]v?(\d+\.\d*[02468](?:\.\d+)*)\.t/i) + end + + + + depends_on "meson" => :build + depends_on "ninja" => :build + depends_on "pkgconf" => :test + + def install + system "meson", "setup", "build", "--default-library=both", *std_meson_args + system "meson", "compile", "-C", "build", "--verbose" + system "meson", "install", "-C", "build" + end + + test do + (testpath/"test.c").write <<~C + #include + + int main(int argc, char *argv[]) + { + pixman_color_t white = { 0xffff, 0xffff, 0xffff, 0xffff }; + pixman_image_t *image = pixman_image_create_solid_fill(&white); + pixman_image_unref(image); + return 0; + } + C + + pkgconf_flags = shell_output("pkgconf --cflags --libs pixman-1").chomp.split + system ENV.cc, "test.c", "-o", "test", *pkgconf_flags + system "./test" + end +end diff --git a/Formula/pkgconf.rb b/Formula/pkgconf.rb new file mode 100644 index 0000000..04d6763 --- /dev/null +++ b/Formula/pkgconf.rb @@ -0,0 +1,140 @@ +class Pkgconf < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "92e19ddd59b3a47e31534559eff0e876fbbf80766e447fc5afd5237e2b2e5e45" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "8ab132419a4c8202f811f791857576916a5a64d6d9e55123f4efd03115cc49b2" + sha256 cellar: "/usr/local/Cellar", sequoia: "33ddcb403a56549dcdf1b1df42d4be71141067a702ed91dd4299052727b27495" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "501bbf411ae3f204c110fff60bae26dc3d1ac089549e3ea333dd0677a402ef2c" + end + desc "Package compiler and linker metadata toolkit" + homepage "https://github.com/pkgconf/pkgconf" + url "https://distfiles.ariadne.space/pkgconf/pkgconf-3.0.5.tar.xz" + mirror "https://github.com/pkgconf/pkgconf/releases/download/pkgconf-3.0.5/pkgconf-3.0.5.tar.xz" + mirror "http://fresh-center.net/linux/misc/pkgconf-3.0.5.tar.xz" + sha256 "3acd3a8a3cce65a8d620321855d92fb602e026cbe8e13ee36bdec58483b59ace" + license "ISC" + compatibility_version 2 + + livecheck do + url "https://distfiles.ariadne.space/pkgconf/" + regex(/href=.*?pkgconf[._-]v?(\d+\.\d+(?:\.[1-8]?\d(?:\.\d+)*)?)\.t/i) + end + + + + head do + url "https://github.com/pkgconf/pkgconf.git", branch: "main" + + # Using a resource to avoiding dependency tree from brew `meson` or `muon`. + # The version should align to available HTTP mirror rather than latest. + # TODO: check on mirrors in future if better alternatives are available. + resource "muon" do + url "https://muon.build/releases/v0.6.0/muon-v0.6.0.tar.gz" + mirror "https://pkg.freebsd.org/ports-distfiles/muon/0.6.0/muon-v0.6.0.tar.gz" + mirror "http://pkg.freebsd.org/ports-distfiles/muon/0.6.0/muon-v0.6.0.tar.gz" + sha256 "90a8428bc2178c59b9f7ddd1cb1cc6355f4df0c3ac023f7eefd159ae4f054024" + + livecheck do + url "https://raw.githubusercontent.com/freebsd/freebsd-ports/refs/heads/main/devel/muon/distinfo" + regex(/muon[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + end + end + + def install + pc_path = %W[ + #{HOMEBREW_PREFIX}/lib/pkgconfig + #{HOMEBREW_PREFIX}/share/pkgconfig + ] + pc_path += if OS.mac? + %W[ + /usr/local/lib/pkgconfig + /usr/lib/pkgconfig + #{HOMEBREW_LIBRARY}/Homebrew/os/mac/pkgconfig/#{MacOS.version} + ] + else + ["#{HOMEBREW_LIBRARY}/Homebrew/os/linux/pkgconfig"] + end + + if build.head? + # Autotools build is planned for removal in pkgconf 3.1 + resource("muon").stage do + args = ["-Dauto_features=disabled"] + system "./bootstrap.sh", "build" + system "build/muon-bootstrap", "meson", "setup", "build", *args, *std_meson_args(prefix: buildpath/"muon") + system "build/muon-bootstrap", "-C", "build", "samu" + system "build/muon", "-C", "build", "install" + ENV.prepend_path "PATH", buildpath/"muon/bin" + end + + args = %W[ + -Dwith-pkg-config-dir=#{pc_path.uniq.join(File::PATH_SEPARATOR)} + -Dwith-system-includedir=#{MacOS.sdk_path if OS.mac?}/usr/include + -Dwith-system-libdir=/usr/lib + ] + + system "muon", "meson", "setup", "build", *args, *std_meson_args + system "muon", "-C", "build", "samu" + system "muon", "-C", "build", "install" + else + args = %W[ + --disable-silent-rules + --with-pkg-config-dir=#{pc_path.uniq.join(File::PATH_SEPARATOR)} + --with-system-includedir=#{MacOS.sdk_path if OS.mac?}/usr/include + --with-system-libdir=/usr/lib + ] + + system "./configure", *args, *std_configure_args + system "make" + system "make", "install" + end + + # Make `pkgconf` a drop-in replacement for `pkg-config` by adding symlink[^1]. + # Similar to Debian[^2], Fedora, ArchLinux and MacPorts. + # + # [^1]: https://github.com/pkgconf/pkgconf/#pkg-config-symlink + # [^2]: https://salsa.debian.org/debian/pkgconf/-/blob/debian/unstable/debian/pkgconf.links?ref_type=heads + bin.install_symlink "pkgconf" => "pkg-config" + man1.install_symlink "pkgconf.1" => "pkg-config.1" + end + + test do + (testpath/"foo.pc").write <<~PC + prefix=/usr + exec_prefix=${prefix} + includedir=${prefix}/include + libdir=${exec_prefix}/lib + + Name: foo + Description: The foo library + Version: 1.0.0 + Cflags: -I${includedir}/foo + Libs: -L${libdir} -lfoo + PC + + ENV["PKG_CONFIG_LIBDIR"] = testpath + system bin/"pkgconf", "--validate", "foo" + assert_equal "1.0.0", shell_output("#{bin}/pkgconf --modversion foo").strip + assert_equal "-lfoo", shell_output("#{bin}/pkgconf --libs-only-l foo").strip + assert_equal "-I/usr/include/foo", shell_output("#{bin}/pkgconf --cflags foo").strip + + (testpath/"test.c").write <<~C + #include + #include + + int main(void) { + assert(pkgconf_compare_version(LIBPKGCONF_VERSION_STR, LIBPKGCONF_VERSION_STR) == 0); + return 0; + } + C + + system ENV.cc, "test.c", "-I#{include}/pkgconf", "-L#{lib}", "-lpkgconf" + system "./a.out" + + # Make sure system-libdir is removed as it can cause problems in superenv + if OS.mac? + ENV.delete "PKG_CONFIG_LIBDIR" + refute_match "-L/usr/lib", shell_output("#{bin}/pkgconf --libs libcurl") + end + end +end diff --git a/Formula/popt.rb b/Formula/popt.rb new file mode 100644 index 0000000..3d7e73c --- /dev/null +++ b/Formula/popt.rb @@ -0,0 +1,87 @@ +class Popt < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "4ff5f0c8c34f510a7336b16f42a6e058d028ff2025e9b01093b294be84d90bb2" + sha256 cellar: :any, arm64_tahoe: "365d143d0d38003c60c1d6fb6d399ab4361690a64467d46a8f27c2f50d2dcfb6" + sha256 cellar: :any_skip_relocation, x86_64_linux: "eaf6aef4cf756e5ad7d75b04d51efb181e673be05bbc40053123b7e8f975db76" + end + desc "Library like getopt(3) with a number of enhancements" + homepage "https://github.com/rpm-software-management/popt" + url "https://ftp.osuosl.org/pub/rpm/popt/releases/popt-1.x/popt-1.19.tar.gz" + sha256 "c25a4838fc8e4c1c8aacb8bd620edb3084a3d63bf8987fdad3ca2758c63240f9" + license "MIT" + compatibility_version 1 + + # The stable archive is found at https://ftp.osuosl.org/pub/rpm/popt/releases/popt-1.x/ + # but it's unclear whether this would be a reliable check in the long term. + # We're simply checking the Git repository tags for the moment, as we + # shouldn't encounter problems with this method. + livecheck do + url :homepage + regex(/^(?:popt[._-])?v?(\d+(?:[._]\d+)+)(?:[._-]release)?$/i) + end + + + + def install + system "./configure", *std_configure_args + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + #include + + int main(int argc, char *argv[]) { + int optiona=-1, optionb=-1, optionc=-1, flag1=0, flag2=0; + + poptContext pc; + struct poptOption po[] = { + {"optiona", 'a', POPT_ARG_INT, &optiona, 11001, "descrip1", "argDescrip1"}, + {"optionb", 'b', POPT_ARG_INT, &optionb, 11002, "descrip2", "argDescrip2"}, + {"optionc", 'c', POPT_ARG_INT, &optionc, 11003, "descrip3", "argDescrip3"}, + {"flag1", 'f', POPT_ARG_NONE, &flag1, 11004, "descrip4", "argDescrip4"}, + {"flag2", 'g', POPT_ARG_NONE, &flag2, 11005, "descrip5", "argDescrip5"}, + POPT_AUTOHELP + {NULL} + }; + + pc = poptGetContext(NULL, argc, (const char **)argv, po, 0); + poptSetOtherOptionHelp(pc, "[ARG...]"); + if (argc < 2) { + poptPrintUsage(pc, stderr, 0); + exit(1); + } + + int val; + while ((val = poptGetNextOpt(pc)) >= 0); + + if (val != -1) { + switch(val) { + case POPT_ERROR_NOARG: + printf("Argument missing for an option\\n"); + exit(1); + case POPT_ERROR_BADOPT: + printf("Option's argument could not be parsed\\n"); + exit(1); + case POPT_ERROR_BADNUMBER: + case POPT_ERROR_OVERFLOW: + printf("Option could not be converted to number\\n"); + exit(1); + default: + printf("Unknown error in option processing\\n"); + exit(1); + } + } + + printf("%d\\n%d\\n%d\\n%d\\n%d\\n", optiona, optionb, optionc, flag1, flag2); + return 0; + } + C + system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lpopt", "-o", "test" + assert_equal "123\n456\n789\n1\n0\n", shell_output("./test -a 123 -b 456 -c 789 -f") + assert_equal "987\n654\n321\n0\n1\n", shell_output("./test --optiona=987 --optionb=654 --optionc=321 --flag2") + end +end diff --git a/Formula/pulseaudio.rb b/Formula/pulseaudio.rb new file mode 100644 index 0000000..25e2e4e --- /dev/null +++ b/Formula/pulseaudio.rb @@ -0,0 +1,118 @@ +class Pulseaudio < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 2 + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "3b0c4054a598015af0838395bfb6b96b40ff9297d4d382b80e06c6df7b76b9ab" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "73c349f7d337ebb0bdd1169325685e79f4cb4c253dd920339a7bc52c833ea4c7" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "3e8c61fa5d337d64747fb305559f1a4821d75cecfd15dc59323450cde1816d29" + end + desc "Sound system for POSIX OSes" + homepage "https://wiki.freedesktop.org/www/Software/PulseAudio/" + license all_of: ["GPL-2.0-or-later", "LGPL-2.1-or-later", "BSD-3-Clause"] + compatibility_version 1 + head "https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git", branch: "master" + + stable do + url "https://www.freedesktop.org/software/pulseaudio/releases/pulseaudio-17.0.tar.xz" + sha256 "053794d6671a3e397d849e478a80b82a63cb9d8ca296bd35b73317bb5ceb87b5" + + # Backport fix to run on macOS + patch do + url "https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/commit/c1990dd02647405b0c13aab59f75d05cbb202336.diff" + sha256 "46505b7f915a96a4e5f4c46cd8a2cfb5a74586bfd585d69f31b7b2e27e17a4c8" + type :backport + resolves "https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/issues/3808" + end + end + + # The regex here avoids x.99 releases, as they're pre-release versions. + livecheck do + url :stable + regex(/href=["']?pulseaudio[._-]v?((?!\d+\.9\d+)\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "gettext" => :build + depends_on "meson" => :build + depends_on "ninja" => :build + depends_on "pkgconf" => :build + depends_on "glib" + depends_on "libsndfile" + depends_on "libsoxr" + depends_on "libtool" + depends_on "openssl@3" + depends_on "orc" + depends_on "speexdsp" + + uses_from_macos "perl" => :build + + on_macos do + depends_on "gettext" # for libintl + end + + on_linux do + depends_on "perl-xml-parser" => :build + depends_on "alsa-lib" + depends_on "dbus" + depends_on "libcap" + end + + def install + enabled_on_linux = if OS.linux? + ENV.prepend_path "PERL5LIB", Formula["perl-xml-parser"].libexec/"lib/perl5" + "enabled" + else + "disabled" + end + + # Default `tdb` database isn't available in Homebrew + args = %W[ + --sysconfdir=#{etc} + -Ddatabase=simple + -Ddoxygen=false + -Dman=true + -Dtests=false + -Dstream-restore-clear-old-devices=true + + -Dlocalstatedir=#{var} + -Dbashcompletiondir=#{bash_completion} + -Dzshcompletiondir=#{zsh_completion} + -Dudevrulesdir=#{lib}/udev/rules.d + + -Dalsa=#{enabled_on_linux} + -Ddbus=#{enabled_on_linux} + -Dglib=enabled + -Dgtk=disabled + -Dopenssl=enabled + -Dorc=enabled + -Dsoxr=enabled + -Dspeex=enabled + -Dsystemd=disabled + -Dx11=disabled + ] + + system "meson", "setup", "build", *args, *std_meson_args + system "meson", "compile", "-C", "build", "--verbose" + system "meson", "install", "-C", "build" + + # Don't hardcode Cellar references in configuration files + inreplace etc.glob("pulse/*").select(&:file?), prefix, opt_prefix, audit_result: false + + # Create the `default.pa.d` directory to avoid error messages like + # https://github.com/Homebrew/homebrew-core/issues/224722 + (etc/"pulse/default.pa.d").mkpath + touch etc/"pulse/default.pa.d/.keepme" + end + + service do + run [opt_bin/"pulseaudio", "--exit-idle-time=-1", "--verbose"] + keep_alive true + log_path var/"log/pulseaudio.log" + error_log_path var/"log/pulseaudio.log" + end + + test do + assert_match "module-sine", shell_output("#{bin}/pulseaudio --dump-modules") + end +end diff --git a/Formula/pycparser.rb b/Formula/pycparser.rb new file mode 100644 index 0000000..480d783 --- /dev/null +++ b/Formula/pycparser.rb @@ -0,0 +1,35 @@ +class Pycparser < Formula + desc "C parser in Python" + homepage "https://github.com/eliben/pycparser" + url "https://files.pythonhosted.org/packages/1b/7d/92392ff7815c21062bea51aa7b87d45576f649f16458d78b7cf94b9ab2e6/pycparser-3.0.tar.gz" + sha256 "600f49d217304a5902ac3c37e1281c9fe94e4d0489de643a9504c5cdfdfc6b29" + license "BSD-3-Clause" + compatibility_version 1 + + bottle do + sha256 cellar: :any_skip_relocation, all: "2c10120dc7d0f6e19f7ceaa82bf41195df1541f3971a69367611f04121babec8" + end + + depends_on "python@3.13" => [:build, :test] + depends_on "python@3.14" => [:build, :test] + + def pythons + deps.map(&:to_formula) + .select { |f| f.name.start_with?("python@") } + .map { |f| f.opt_libexec/"bin/python" } + end + + def install + pythons.each do |python| + system python, "-m", "pip", "install", *std_pip_args(build_isolation: true), "." + end + pkgshare.install "examples" + end + + test do + examples = pkgshare/"examples" + pythons.each do |python| + system python, examples/"c-to-c.py", examples/"c_files/basic.c" + end + end +end diff --git a/Formula/pydantic.rb b/Formula/pydantic.rb new file mode 100644 index 0000000..08faa28 --- /dev/null +++ b/Formula/pydantic.rb @@ -0,0 +1,68 @@ +class Pydantic < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "d55b259d1303f4a83a308060283f44acce735cd8700f4b3130daab8e483aa6f5" + sha256 cellar: :any, arm64_tahoe: "5cfb42ea77db358f8b7182a230f3cd9fb5b9612540603ffa0db2d100b29a4a92" + sha256 cellar: :any_skip_relocation, x86_64_linux: "a087d54c5f0f78c384fe110baaac38a29d8d229a9c22b9dca894ad91aaa4344e" + end + include Language::Python::Virtualenv + + desc "Data validation using Python type hints" + homepage "https://pydantic.dev/docs/validation" + url "https://files.pythonhosted.org/packages/18/a5/b60d21ac674192f8ab0ba4e9fd860690f9b4a6e51ca5df118733b487d8d6/pydantic-2.13.4.tar.gz" + sha256 "c40756b57adaa8b1efeeced5c196f3f3b7c435f90e84ea7f443901bec8099ef6" + license "MIT" + version_scheme 1 + compatibility_version 1 + + + + depends_on "maturin" => :build + depends_on "python@3.13" => [:build, :test] + depends_on "python@3.14" => [:build, :test] + depends_on "rust" => :build + + def pythons + deps.map(&:to_formula) + .select { |f| f.name.start_with?("python@") } + .map { |f| f.opt_libexec/"bin/python" } + end + + resource "annotated-types" do + url "https://files.pythonhosted.org/packages/ee/67/531ea369ba64dcff5ec9c3402f9f51bf748cec26dde048a2f973a4eea7f5/annotated_types-0.7.0.tar.gz" + sha256 "aff07c09a53a08bc8cfccb9c85b05f1aa9a2a6f23728d790723543408344ce89" + end + + resource "pydantic-core" do + url "https://files.pythonhosted.org/packages/9d/56/921726b776ace8d8f5db44c4ef961006580d91dc52b803c489fafd1aa249/pydantic_core-2.46.4.tar.gz" + sha256 "62f875393d7f270851f20523dd2e29f082bcc82292d66db2b64ea71f64b6e1c1" + end + + resource "typing-extensions" do + url "https://files.pythonhosted.org/packages/72/94/1a15dd82efb362ac84269196e94cf00f187f7ed21c242792a923cdb1c61f/typing_extensions-4.15.0.tar.gz" + sha256 "0cea48d173cc12fa28ecabc3b837ea3cf6f38c6d1136f85cbaaf598984861466" + end + + resource "typing-inspection" do + url "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz" + sha256 "ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464" + end + + def install + pythons.each do |python3| + resources.each do |r| + r.stage do + system python3, "-m", "pip", "install", *std_pip_args(build_isolation: true), "." + end + end + + system python3, "-m", "pip", "install", *std_pip_args(build_isolation: true), "." + end + end + + test do + pythons.each do |python3| + system python3, "-c", "import pydantic;" + end + end +end diff --git a/Formula/python-tk@3.14.rb b/Formula/python-tk@3.14.rb new file mode 100644 index 0000000..918721e --- /dev/null +++ b/Formula/python-tk@3.14.rb @@ -0,0 +1,69 @@ +class PythonTkAT314 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "c4be42c490067ea6f5c6d6f2c6fd39d4ef30bb60d169ff3c05c658194a939b5e" + sha256 cellar: :any, arm64_tahoe: "db91272cb60b7f0121c8cb2a92c853310b3428999cb7abb4b86c8e544fe54fef" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "af2eb8c451104069ebf7e6f4c919af096bf3a1c6c684e29ba1ebb65cbcbadedb" + end + desc "Python interface to Tcl/Tk" + homepage "https://www.python.org/" + url "https://www.python.org/ftp/python/3.14.6/Python-3.14.6.tgz" + sha256 "74d0d71d0600e477651a077101d6e62d1e2e69b8e992ba18c993dd643b7ba222" + license "Python-2.0" + + livecheck do + formula "python@3.14" + end + + + + # https://devguide.python.org/versions/#versions + deprecate! date: "2030-11-01", because: :deprecated_upstream + disable! date: "2031-11-01", because: :deprecated_upstream + + depends_on "python@3.14" + depends_on "tcl-tk" + + def python3 + "python3.14" + end + + def install + xy = Language::Python.major_minor_version python3 + python_include = if OS.mac? + Formula["python@#{xy}"].opt_frameworks/"Python.framework/Versions/#{xy}/include/python#{xy}" + else + formula_opt_include("python@#{xy}")/"python#{xy}" + end + + tcltk_version = Formula["tcl-tk"].any_installed_version.major_minor + (buildpath/"Modules/pyproject.toml").write <<~TOML + [project] + name = "tkinter" + version = "#{version}" + description = "#{desc}" + + [tool.setuptools] + packages = [] + + [[tool.setuptools.ext-modules]] + name = "_tkinter" + sources = ["_tkinter.c", "tkappinit.c"] + define-macros = [["WITH_APPINIT", "1"], ["TCL_WITH_EXTERNAL_TOMMATH", "1"]] + include-dirs = ["#{python_include}/internal", "#{formula_opt_include("tcl-tk")/"tcl-tk"}"] + libraries = ["tcl#{tcltk_version}", "tcl#{tcltk_version.major}tk#{tcltk_version}"] + library-dirs = ["#{formula_opt_lib("tcl-tk")}"] + TOML + system python3, "-m", "pip", "install", *std_pip_args(prefix: false, build_isolation: true), + "--target=#{libexec}", "./Modules" + rm_r libexec.glob("*.dist-info") + end + + test do + system python3, "-c", "import tkinter" + + return if OS.linux? && ENV["HOMEBREW_GITHUB_ACTIONS"] + + system python3, "-c", "import tkinter; root = tkinter.Tk()" + end +end diff --git a/Formula/python@3.12.rb b/Formula/python@3.12.rb new file mode 100644 index 0000000..189b541 --- /dev/null +++ b/Formula/python@3.12.rb @@ -0,0 +1,547 @@ +class PythonAT312 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 2 + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "6891247b265604f1017acddf0d36a0a18ba8d22f94d152f87673a5a9d460ab62" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "659fe17ffa45737acf153b6baaf3fa735b346b8ee191610517d81bdd0b84ea48" + sha256 cellar: "/usr/local/Cellar", sequoia: "40f4b28fe9d1fb1da601046eade86ccd3eb6f59561f76d67dc19ac8c39e15057" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "8ec7b34517ec4c1210f6178cdbfa40e3f1e5d5780d7f26567593a07e425045ff" + end + desc "Interpreted, interactive, object-oriented programming language" + homepage "https://www.python.org/" + url "https://www.python.org/ftp/python/3.12.13/Python-3.12.13.tgz" + sha256 "0816c4761c97ecdb3f50a3924de0a93fd78cb63ee8e6c04201ddfaedca500b0b" + license "Python-2.0" + revision 4 + compatibility_version 1 + + livecheck do + url "https://www.python.org/downloads/source/" + regex(%r{href=.*?/Python[._-]v?(3\.12(?:\.\d+)*)\.t}i) + end + + + + # https://devguide.python.org/versions/#versions + deprecate! date: "2028-11-01", because: :deprecated_upstream + disable! date: "2029-11-01", because: :deprecated_upstream + + depends_on "pkgconf" => :build + depends_on "mpdecimal" + depends_on "openssl@3" + depends_on "sqlite" + depends_on "xz" + + uses_from_macos "bzip2" + uses_from_macos "expat", since: :sequoia + uses_from_macos "libedit" + uses_from_macos "libffi" + uses_from_macos "libxcrypt" + uses_from_macos "ncurses" + + on_linux do + depends_on "libnsl" + depends_on "libtirpc" + depends_on "zlib-ng-compat" + end + + link_overwrite "lib/python3.12/site-packages/pip*" + link_overwrite "lib/python3.12/site-packages/wheel*" + + pypi_packages package_name: "", + extra_packages: %w[flit-core pip wheel] + + resource "flit-core" do + url "https://files.pythonhosted.org/packages/69/59/b6fc2188dfc7ea4f936cd12b49d707f66a1cb7a1d2c16172963534db741b/flit_core-3.12.0.tar.gz" + sha256 "18f63100d6f94385c6ed57a72073443e1a71a4acb4339491615d0f16d6ff01b2" + end + + resource "packaging" do + url "https://files.pythonhosted.org/packages/d7/f1/e7a6dd94a8d4a5626c03e4e99c87f241ba9e350cd9e6d75123f992427270/packaging-26.2.tar.gz" + sha256 "ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661" + end + + resource "pip" do + url "https://files.pythonhosted.org/packages/01/91/47e7d486260f618783899587af63ccf7980fb60245c3e63dd4571c6b57ad/pip-26.1.2.tar.gz" + sha256 "f49cd134c61cf2fd75e0ce2676db03e4054504a5a4986d00f8299ae632dc4605" + end + + resource "wheel" do + url "https://files.pythonhosted.org/packages/39/62/75f18a0f03b4219c456652c7780e4d749b929eb605c098ce3a5b6b6bc081/wheel-0.47.0.tar.gz" + sha256 "cc72bd1009ba0cf63922e28f94d9d83b920aa2bb28f798a31d0691b02fa3c9b3" + end + + # Modify default sysconfig to match the brew install layout. + # Remove when a non-patching mechanism is added. + # We (ab)use osx_framework_library to exploit pip behaviour to allow --prefix to still work. + patch do + file "Patches/python/3.11-sysconfig.diff" + type :unofficial + resolves "https://bugs.python.org/issue43976" + end + + def lib_cellar + on_macos do + return frameworks/"Python.framework/Versions"/version.major_minor/"lib/python#{version.major_minor}" + end + on_linux do + return lib/"python#{version.major_minor}" + end + end + + def site_packages_cellar = lib_cellar/"site-packages" + + # The HOMEBREW_PREFIX location of site-packages. + def site_packages = HOMEBREW_PREFIX/"lib/python#{version.major_minor}/site-packages" + + def altinstall? = name != Formula["python3"].name + + def python3 = bin/"python#{version.major_minor}" + + def install + # Unset these so that installing pip and setuptools puts them where we want + # and not into some other Python the user has installed. + ENV["PYTHONHOME"] = nil + ENV["PYTHONPATH"] = nil + + # Override the auto-detection of libmpdec, which assumes a universal build. + # This is currently an inreplace due to https://github.com/python/cpython/issues/98557. + if OS.mac? + inreplace "configure", "libmpdec_machine=universal", + "libmpdec_machine=#{ENV["PYTHON_DECIMAL_WITH_MACHINE"] = Hardware::CPU.arm? ? "uint128" : "x64"}" + end + + # The --enable-optimization and --with-lto flags diverge from what upstream + # python does for their macOS binary releases. They have chosen not to apply + # these flags because they want one build that will work across many macOS + # releases. Homebrew is not so constrained because the bottling + # infrastructure specializes for each macOS major release. + args = %W[ + --prefix=#{prefix} + --enable-ipv6 + --datarootdir=#{share} + --datadir=#{share} + --without-ensurepip + --enable-loadable-sqlite-extensions + --with-openssl=#{formula_opt_prefix("openssl@3")} + --enable-optimizations + --with-system-expat + --with-system-libmpdec + --with-readline=editline + ] + + # Python re-uses flags when building native modules. + # Since we don't want native modules prioritizing the brew + # include path, we move them to [C|LD]FLAGS_NODIST. + # Note: Changing CPPFLAGS causes issues with dbm, so we + # leave it as-is. + cflags = [] + cflags_nodist = ["-I#{HOMEBREW_PREFIX}/include"] + ldflags = [] + ldflags_nodist = ["-L#{HOMEBREW_PREFIX}/lib", "-Wl,-rpath,#{HOMEBREW_PREFIX}/lib"] + cppflags = ["-I#{HOMEBREW_PREFIX}/include"] + + if OS.mac? + # Enabling LTO on Linux makes libpython3.*.a unusable for anyone whose GCC + # install does not match the one in CI _exactly_ (major and minor version). + # https://github.com/orgs/Homebrew/discussions/3734 + args << "--with-lto" + args << "--enable-framework=#{frameworks}" + args << "--with-dtrace" + args << "--with-dbmliborder=ndbm" + + # Avoid linking to libgcc https://mail.python.org/pipermail/python-dev/2012-February/116205.html + args << "MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}" + else + args << "--enable-shared" + args << "--with-dbmliborder=" + end + + if OS.linux? + # Python's configure adds the system ncurses include entry to CPPFLAGS + # when doing curses header check. The check may fail when there exists + # a 32-bit system ncurses (conflicts with the brewed 64-bit one). + # See https://github.com/Homebrew/linuxbrew-core/pull/22307#issuecomment-781896552 + # We want our ncurses! Override system ncurses includes! + inreplace "configure", 'CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw"', + "CPPFLAGS=\"$CPPFLAGS -I#{formula_opt_include("ncurses")}\"" + end + + # Allow python modules to use ctypes.find_library to find homebrew's stuff + # even if homebrew is not a /usr/local/lib. Try this with: + # `brew install enchant && pip install pyenchant` + inreplace "./Lib/ctypes/macholib/dyld.py" do |f| + f.gsub! "DEFAULT_LIBRARY_FALLBACK = [", + "DEFAULT_LIBRARY_FALLBACK = [ '#{HOMEBREW_PREFIX}/lib', '#{formula_opt_lib("openssl@3")}'," + f.gsub! "DEFAULT_FRAMEWORK_FALLBACK = [", "DEFAULT_FRAMEWORK_FALLBACK = [ '#{HOMEBREW_PREFIX}/Frameworks'," + end + + args << "CFLAGS=#{cflags.join(" ")}" unless cflags.empty? + args << "CFLAGS_NODIST=#{cflags_nodist.join(" ")}" unless cflags_nodist.empty? + args << "LDFLAGS=#{ldflags.join(" ")}" unless ldflags.empty? + args << "LDFLAGS_NODIST=#{ldflags_nodist.join(" ")}" unless ldflags_nodist.empty? + args << "CPPFLAGS=#{cppflags.join(" ")}" unless cppflags.empty? + + # Disabled modules - provided in separate formulae + args += %w[ + py_cv_module__tkinter=n/a + ] + + system "./configure", *args + system "make" + + ENV.deparallelize do + # The `altinstall` target prevents the installation of files with only Python's major + # version in its name. This allows us to link multiple versioned Python formulae. + # https://github.com/python/cpython#installing-multiple-versions + # + # Tell Python not to install into /Applications (default for framework builds) + target = "#{"alt" if altinstall?}install" + system "make", target, "PYTHONAPPSDIR=#{prefix}" + system "make", "frameworkinstallextras", "PYTHONAPPSDIR=#{pkgshare}" if OS.mac? + end + + if OS.mac? + # Any .app get a " 3" attached, so it does not conflict with python 2.x. + prefix.glob("*.app") { |app| mv app, app.to_s.sub(/\.app$/, " 3.app") } + + pc_dir = frameworks/"Python.framework/Versions"/version.major_minor/"lib/pkgconfig" + # Symlink the pkgconfig files into HOMEBREW_PREFIX so they're accessible. + (lib/"pkgconfig").install_symlink pc_dir.children + + # Prevent third-party packages from building against fragile Cellar paths + bad_cellar_path_files = [ + lib_cellar/"_sysconfigdata__darwin_darwin.py", + lib_cellar/"config-#{version.major_minor}-darwin/Makefile", + pc_dir/"python-#{version.major_minor}.pc", + pc_dir/"python-#{version.major_minor}-embed.pc", + ] + inreplace bad_cellar_path_files, prefix, opt_prefix + + # Help third-party packages find the Python framework + inreplace lib_cellar/"config-#{version.major_minor}-darwin/Makefile", + /^LINKFORSHARED=(.*)PYTHONFRAMEWORKDIR(.*)/, + "LINKFORSHARED=\\1PYTHONFRAMEWORKINSTALLDIR\\2" + + # Symlink the pkgconfig files into HOMEBREW_PREFIX so they're accessible. + (lib/"pkgconfig").install_symlink pc_dir.children + + # Fix for https://github.com/Homebrew/homebrew-core/issues/21212 + inreplace lib_cellar/"_sysconfigdata__darwin_darwin.py", + %r{('LINKFORSHARED': .*?)'(Python.framework/Versions/3.\d+/Python)'}m, + "\\1'#{opt_prefix}/Frameworks/\\2'" + + # For an altinstall, remove symlinks that conflict with the main Python formula. + rm frameworks.glob("Python.framework/{Headers,Python,Resources,Versions/Current}") if altinstall? + else + # Prevent third-party packages from building against fragile Cellar paths + inreplace Dir[lib_cellar/"**/_sysconfigdata_*linux_x86_64-*.py", + lib_cellar/"config*/Makefile", + bin/"python#{version.major_minor}-config", + lib/"pkgconfig/python-3*.pc"], + prefix, opt_prefix + + inreplace bin/"python#{version.major_minor}-config", + 'prefix_real=$(installed_prefix "$0")', + "prefix_real=#{opt_prefix}" + + # For an altinstall, remove symlinks that conflict with the main Python formula. + rm lib/"libpython3.so" if altinstall? + end + + # Remove the site-packages that Python created in its Cellar. + rm_r site_packages_cellar.children + + # Prepare a wheel of wheel to install later. + common_pip_args = %w[ + -v + --no-deps + --no-binary :all: + --no-index + --no-build-isolation + ] + whl_build = buildpath/"whl_build" + system python3, "-m", "venv", whl_build + %w[flit-core wheel].each do |r| + resource(r).stage do + system whl_build/"bin/pip3", "install", *common_pip_args, "." + end + end + resource("wheel").stage do + system whl_build/"bin/pip3", "wheel", *common_pip_args, + "--wheel-dir=#{libexec}", + "." + end + + # Replace bundled pip with our own. + rm lib_cellar.glob("ensurepip/_bundled/pip-*.whl") + resource("pip").stage do + system whl_build/"bin/pip3", "wheel", *common_pip_args, + "--wheel-dir=#{lib_cellar}/ensurepip/_bundled", + "." + end + + # Patch ensurepip to bootstrap our updated version of pip + inreplace lib_cellar/"ensurepip/__init__.py" do |s| + s.gsub!(/_PIP_VERSION = .*/, "_PIP_VERSION = \"#{resource("pip").version}\"") + end + + # Ensure that our new pip wheel is globally readable. + chmod "ugo+r", lib_cellar.glob("ensurepip/_bundled/pip-*.whl") + + # Install unversioned (and for an altinstall, major-versioned) symlinks in libexec/bin. + { + "idle" => "idle#{version.major_minor}", + "pydoc" => "pydoc#{version.major_minor}", + "python" => "python#{version.major_minor}", + "python-config" => "python#{version.major_minor}-config", + }.merge(altinstall? ? { + "idle3" => "idle#{version.major_minor}", + "pydoc3" => "pydoc#{version.major_minor}", + "python3" => "python#{version.major_minor}", + "python3-config" => "python#{version.major_minor}-config", + } : {}).each do |short_name, long_name| + (libexec/"bin").install_symlink (bin/long_name).realpath => short_name + end + + # Bootstrap initial install of pip. + system python3, "-Im", "ensurepip" + + # Install desired versions of pip, wheel using the version of + # pip bootstrapped by ensurepip. + # Note that while we replaced the ensurepip wheels, there's no guarantee + # ensurepip actually used them, since other existing installations could + # have been picked up (and we can't pass --ignore-installed). + root_site_packages = lib/"python#{version.major_minor}/site-packages" + bundled = lib_cellar/"ensurepip/_bundled" + system python3, "-Im", "pip", "install", "-v", + "--no-deps", + "--no-index", + "--upgrade", + "--isolated", + "--target=#{root_site_packages}", + bundled/"pip-#{resource("pip").version}-py3-none-any.whl", + libexec/"wheel-#{resource("wheel").version}-py3-none-any.whl" + + # pip install with --target flag will just place the bin folder into the + # target, so move its contents into the appropriate location + mv (root_site_packages/"bin").children, bin + rmdir root_site_packages/"bin" + + rm bin/"pip" + rm bin/"pip3" if altinstall? + mv bin/"wheel", bin/"wheel#{version.major_minor}" + bin.install_symlink "wheel#{version.major_minor}" => "wheel3" unless altinstall? + + # Install unversioned (and for an altinstall, major-versioned) symlinks in libexec/bin. + { + "pip" => "pip#{version.major_minor}", + "wheel" => "wheel#{version.major_minor}", + }.merge(altinstall? ? { + "pip3" => "pip#{version.major_minor}", + "wheel3" => "wheel#{version.major_minor}", + } : {}).each do |short_name, long_name| + (libexec/"bin").install_symlink (bin/long_name).realpath => short_name + end + + if OS.mac? + # Replace framework site-packages with a symlink to the real one. + rm_r site_packages_cellar + site_packages_cellar.parent.install_symlink root_site_packages + end + + # Write out sitecustomize.py + (lib_cellar/"sitecustomize.py").atomic_write(sitecustomize) + + # Mark Homebrew python as externally managed: https://peps.python.org/pep-0668/#marking-an-interpreter-as-using-an-external-package-manager + # Placed after ensurepip since it invokes pip in isolated mode, meaning + # we can't pass --break-system-packages. + (lib_cellar/"EXTERNALLY-MANAGED").write <<~INI + [externally-managed] + Error=To install Python packages system-wide, try brew install + xyz, where xyz is the package you are trying to + install. + + If you wish to install a Python library that isn't in Homebrew, + use a virtual environment: + + python3 -m venv path/to/venv + source path/to/venv/bin/activate + python3 -m pip install xyz + + If you wish to install a Python application that isn't in Homebrew, + it may be easiest to use 'pipx install xyz', which will manage a + virtual environment for you. You can install pipx with + + brew install pipx + + You may restore the old behavior of pip by passing + the '--break-system-packages' flag to pip, or by adding + 'break-system-packages = true' to your pip.conf file. The latter + will permanently disable this error. + + If you disable this error, we STRONGLY recommend that you additionally + pass the '--user' flag to pip, or set 'user = true' in your pip.conf + file. Failure to do this can result in a broken Homebrew installation. + + Read more about this behavior here: + INI + end + + post_install_steps do + on_macos do + set_permissions "Python.framework/Versions/{{version.major_minor}}/" \ + "lib/python{{version.major_minor}}/venv/scripts/**/*", + "u+w", base: :frameworks, recursive: false + end + on_linux do + set_permissions "python{{version.major_minor}}/venv/scripts/**/*", "u+w", base: :lib, recursive: false + end + end + + def sitecustomize + <<~PYTHON + # This file is created by Homebrew and is executed on each python startup. + # Don't print from here, or else python command line scripts may fail! + # + import re + import os + import site + import sys + if sys.version_info[:2] != (#{version.major}, #{version.minor}): + # This can only happen if the user has set the PYTHONPATH to a mismatching site-packages directory. + # Every Python looks at the PYTHONPATH variable and we can't fix it here in sitecustomize.py, + # because the PYTHONPATH is evaluated after the sitecustomize.py. Many modules (e.g. PyQt4) are + # built only for a specific version of Python and will fail with cryptic error messages. + # In the end this means: Don't set the PYTHONPATH permanently if you use different Python versions. + exit(f'Your PYTHONPATH points to a site-packages dir for Python #{version.major_minor} ' + f'but you are running Python {sys.version_info[0]}.{sys.version_info[1]}!\\n' + f' PYTHONPATH is currently: "{os.environ["PYTHONPATH"]}"\\n' + f' You should `unset PYTHONPATH` to fix this.') + # Only do this for a brewed python: + if os.path.realpath(sys.executable).startswith('#{rack}'): + # Shuffle /Library site-packages to the end of sys.path + library_site = '/Library/Python/#{version.major_minor}/site-packages' + library_packages = [p for p in sys.path if p.startswith(library_site)] + sys.path = [p for p in sys.path if not p.startswith(library_site)] + # .pth files have already been processed so don't use addsitedir + sys.path.extend(library_packages) + # the Cellar site-packages is a symlink to the HOMEBREW_PREFIX + # site_packages; prefer the shorter paths + long_prefix = re.compile(r'#{rack}/[0-9\\._abrc]+/(?:Frameworks/Python\\.framework/Versions/#{version.major_minor}/)?lib/python#{version.major_minor}/site-packages') + sys.path = [long_prefix.sub('#{site_packages}', p) for p in sys.path] + # Set the sys.executable to use the opt_prefix. Only do this if PYTHONEXECUTABLE is not + # explicitly set and we are not in a virtualenv: + if 'PYTHONEXECUTABLE' not in os.environ and sys.prefix == sys.base_prefix: + sys.executable = sys._base_executable = '#{opt_bin}/python#{version.major_minor}' + if 'PYTHONHOME' not in os.environ: + cellar_prefix = re.compile(r'#{rack}/[0-9\\._abrc]+(?=/|$)') + if os.path.realpath(sys.base_prefix).startswith('#{rack}'): + new_prefix = cellar_prefix.sub('#{opt_prefix}', sys.base_prefix) + site.PREFIXES[:] = [new_prefix if x == sys.base_prefix else x for x in site.PREFIXES] + if sys.prefix == sys.base_prefix: + sys.prefix = new_prefix + sys.base_prefix = new_prefix + if os.path.realpath(sys.base_exec_prefix).startswith('#{rack}'): + new_exec_prefix = cellar_prefix.sub('#{opt_prefix}', sys.base_exec_prefix) + site.PREFIXES[:] = [new_exec_prefix if x == sys.base_exec_prefix else x for x in site.PREFIXES] + if sys.exec_prefix == sys.base_exec_prefix: + sys.exec_prefix = new_exec_prefix + sys.base_exec_prefix = new_exec_prefix + # Make site.getsitepackages() return the HOMEBREW_PREFIX site-packages, + # but only if we are outside a venv or in one with include-system-site-packages. + if sys.base_prefix in site.PREFIXES: + site.PREFIXES.insert(site.PREFIXES.index(sys.base_prefix), '#{HOMEBREW_PREFIX}') + site.addsitedir('#{site_packages}') + # Check for and add the prefix of split Python formulae. + for split_module in ["tk", "gdbm"]: + split_prefix = f"#{HOMEBREW_PREFIX}/opt/python-{split_module}@#{version.major_minor}/libexec" + if os.path.isdir(split_prefix): + sys.path.append(split_prefix) + PYTHON + end + + def caveats + dbm_is = "`dbm.gnu` is" + on_linux do + dbm_is = "`dbm.gnu` and `dbm.ndbm` are" + end + + <<~EOS + Python is installed as + #{HOMEBREW_PREFIX}/bin/python#{version.major_minor} + + Unversioned and major-versioned symlinks `python`, `python3`, `python-config`, `python3-config`, `pip`, `pip3`, etc. pointing to + `python#{version.major_minor}`, `python#{version.major_minor}-config`, `pip#{version.major_minor}` etc., respectively, are installed into + #{opt_libexec}/bin + + If you do not need a specific version of Python, and always want Homebrew's `python3` in your PATH: + brew install python3 + + `idle#{version.major_minor}` requires tkinter, which is available separately: + brew install python-tk@#{version.major_minor} + + #{dbm_is} available separately: + brew install python-gdbm@#{version.major_minor} + + For more information about Homebrew and Python, see: https://docs.brew.sh/Homebrew-and-Python + EOS + end + + test do + # Check if sqlite is ok, because we build with --enable-loadable-sqlite-extensions + # and it can occur that building sqlite silently fails if OSX's sqlite is used. + system python3, "-c", "import sqlite3" + + # check to see if we can create a venv + system python3, "-m", "venv", testpath/"myvenv" + + # Check if some other modules import. Then the linked libs are working. + system python3, "-c", "import _ctypes" + system python3, "-c", "import _decimal" + system python3, "-c", "import pyexpat" + system python3, "-c", "import readline" + system python3, "-c", "import zlib" + + # tkinter is provided in a separate formula + assert_match "ModuleNotFoundError: No module named '_tkinter'", + shell_output("#{python3} -Sc 'import tkinter' 2>&1", 1) + + # gdbm is provided in a separate formula + assert_match "ModuleNotFoundError: No module named '_gdbm'", + shell_output("#{python3} -Sc 'import _gdbm' 2>&1", 1) + assert_match "ModuleNotFoundError: No module named '_gdbm'", + shell_output("#{python3} -Sc 'import dbm.gnu' 2>&1", 1) + + # Verify that the selected DBM interface works on macOS. + # Linux requires installing python-gdbm formula + (testpath/"dbm_test.py").write <<~PYTHON + import dbm + + with dbm.ndbm.open("test", "c") as db: + db[b"foo \\xbd"] = b"bar \\xbd" + with dbm.ndbm.open("test", "r") as db: + assert list(db.keys()) == [b"foo \\xbd"] + assert b"foo \\xbd" in db + assert db[b"foo \\xbd"] == b"bar \\xbd" + PYTHON + system python3, "dbm_test.py" if OS.mac? + + system bin/"pip#{version.major_minor}", "list", "--format=columns" + + # Check our sitecustomize.py + assert_match HOMEBREW_CELLAR.to_s, shell_output("#{python3} -Sc 'import sys; print(sys.base_prefix)'") + refute_match HOMEBREW_CELLAR.to_s, shell_output("#{python3} -c 'import sys; print(sys.base_prefix)'") + refute_match site_packages_cellar.to_s, shell_output("#{python3} -c 'import sys; print(sys.path)'") + + # Verify our sysconfig patches + sysconfig_path = "import sysconfig; print(sysconfig.get_paths(\"osx_framework_library\")[\"data\"])" + assert_equal HOMEBREW_PREFIX.to_s, shell_output("#{python3} -c '#{sysconfig_path}'").strip + linkforshared_var = "import sysconfig; print(sysconfig.get_config_var(\"LINKFORSHARED\"))" + assert_match opt_prefix.to_s, shell_output("#{python3} -c '#{linkforshared_var}'") if OS.mac? + + # Check our externally managed marker + assert_match "If you wish to install a Python library", + shell_output("#{python3} -m pip install pip 2>&1", 1) + end +end diff --git a/Formula/python@3.13.rb b/Formula/python@3.13.rb new file mode 100644 index 0000000..2f87c33 --- /dev/null +++ b/Formula/python@3.13.rb @@ -0,0 +1,532 @@ +class PythonAT313 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "a7ce66c50eeee32186f6db8054ff259cf480942e8bf10767588d47cb45a97692" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "02e3c9b06f15a5aef1509838ca3572f111588ffb395c638148b54b0cf041848e" + sha256 cellar: "/usr/local/Cellar", sequoia: "f2d7049c87cba28e4dce89c45bd3566ccf51441cad33c19e9e67525c603c1453" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "4cdbffcfe9e2b2d9a5c28597d8e00d2dc995962785c25a098b2e4d8298edec54" + end + desc "Interpreted, interactive, object-oriented programming language" + homepage "https://www.python.org/" + url "https://www.python.org/ftp/python/3.13.15/Python-3.13.15.tgz" + sha256 "c28d9d213c09b5b5ab2c29812950e12f746999e099b82894231be954b26baed9" + license "Python-2.0" + compatibility_version 1 + + livecheck do + url "https://www.python.org/downloads/source/" + regex(%r{href=.*?/Python[._-]v?(3\.13(?:\.\d+)*)\.t}i) + end + + + + # https://devguide.python.org/versions/#versions + deprecate! date: "2029-11-01", because: :deprecated_upstream + disable! date: "2030-11-01", because: :deprecated_upstream + + depends_on "pkgconf" => :build + depends_on "mpdecimal" + depends_on "openssl@3" + depends_on "sqlite" + depends_on "xz" + + uses_from_macos "bzip2" + uses_from_macos "expat", since: :sequoia + uses_from_macos "libedit" + uses_from_macos "libffi" + uses_from_macos "ncurses" + + on_linux do + depends_on "zlib-ng-compat" + end + + link_overwrite "lib/python3.13/site-packages/pip*" + link_overwrite "lib/python3.13/site-packages/wheel*" + + pypi_packages package_name: "", + extra_packages: %w[flit-core pip wheel] + + resource "flit-core" do + url "https://files.pythonhosted.org/packages/46/ef/34533186e76c526d9ec17a1ad9a10c7354cbfb20f51583cc36dfe4bdccd0/flit_core-4.0.2.tar.gz" + sha256 "b6929defd93884b584d7c87829e0e7b5c26ed6be17b0b873979019314aa841c8" + end + + resource "packaging" do + url "https://files.pythonhosted.org/packages/7d/fa/3944b40b07da9ce895c0e6303a5ab7d53da063554f534556b134a54d6093/packaging-26.3.tar.gz" + sha256 "94edc256424af38762eb31306eed28beb9f0efc50a8837492c9d6fd6004aed79" + end + + resource "pip" do + url "https://files.pythonhosted.org/packages/db/96/e6f8e9d9d7b9cc4457092712a7e919c3186aa2c2fa9ffed2c5d29cc947e8/pip-26.2.tar.gz" + sha256 "2d8542afcc84cdd8e846c2b36b2861fad1da376dd98f8e7113e9108a3c331690" + end + + resource "wheel" do + url "https://files.pythonhosted.org/packages/39/62/75f18a0f03b4219c456652c7780e4d749b929eb605c098ce3a5b6b6bc081/wheel-0.47.0.tar.gz" + sha256 "cc72bd1009ba0cf63922e28f94d9d83b920aa2bb28f798a31d0691b02fa3c9b3" + end + + # Modify default sysconfig to match the brew install layout. + # Remove when a non-patching mechanism is added. + # We (ab)use osx_framework_library to exploit pip behaviour to allow --prefix to still work. + patch do + file "Patches/python/3.13-sysconfig.diff" + type :unofficial + resolves "https://bugs.python.org/issue43976" + end + + def lib_cellar + on_macos do + return frameworks/"Python.framework/Versions"/version.major_minor/"lib/python#{version.major_minor}" + end + on_linux do + return lib/"python#{version.major_minor}" + end + end + + def site_packages_cellar = lib_cellar/"site-packages" + + # The HOMEBREW_PREFIX location of site-packages. + def site_packages = HOMEBREW_PREFIX/"lib/python#{version.major_minor}/site-packages" + + def altinstall? = name != Formula["python3"].name + + def python3 = bin/"python#{version.major_minor}" + + def install + # Unset these so that installing pip and setuptools puts them where we want + # and not into some other Python the user has installed. + ENV["PYTHONHOME"] = nil + ENV["PYTHONPATH"] = nil + + # Override the auto-detection of libmpdec, which assumes a universal build. + # This is currently an inreplace due to https://github.com/python/cpython/issues/98557. + if OS.mac? + inreplace "configure", "libmpdec_machine=universal", + "libmpdec_machine=#{ENV["PYTHON_DECIMAL_WITH_MACHINE"] = Hardware::CPU.arm? ? "uint128" : "x64"}" + end + + # The --enable-optimization and --with-lto flags diverge from what upstream + # python does for their macOS binary releases. They have chosen not to apply + # these flags because they want one build that will work across many macOS + # releases. Homebrew is not so constrained because the bottling + # infrastructure specializes for each macOS major release. + args = %W[ + --prefix=#{prefix} + --enable-ipv6 + --datarootdir=#{share} + --datadir=#{share} + --without-ensurepip + --enable-loadable-sqlite-extensions + --with-openssl=#{formula_opt_prefix("openssl@3")} + --enable-optimizations + --with-system-expat + --with-system-libmpdec + --with-readline=editline + ] + + # Python re-uses flags when building native modules. + # Since we don't want native modules prioritizing the brew + # include path, we move them to [C|LD]FLAGS_NODIST. + # Note: Changing CPPFLAGS causes issues with dbm, so we + # leave it as-is. + cflags = [] + cflags_nodist = ["-I#{HOMEBREW_PREFIX}/include"] + ldflags = [] + ldflags_nodist = ["-L#{HOMEBREW_PREFIX}/lib", "-Wl,-rpath,#{HOMEBREW_PREFIX}/lib"] + cppflags = ["-I#{HOMEBREW_PREFIX}/include"] + + if OS.mac? + # Enabling LTO on Linux makes libpython3.*.a unusable for anyone whose GCC + # install does not match the one in CI _exactly_ (major and minor version). + # https://github.com/orgs/Homebrew/discussions/3734 + args << "--with-lto" + args << "--enable-framework=#{frameworks}" + args << "--with-dtrace" + args << "--with-dbmliborder=ndbm" + + # Avoid linking to libgcc https://mail.python.org/pipermail/python-dev/2012-February/116205.html + args << "MACOSX_DEPLOYMENT_TARGET=#{MacOS.version}" + else + args << "--enable-shared" + args << "--with-dbmliborder=" + end + + # Allow python modules to use ctypes.find_library to find homebrew's stuff + # even if homebrew is not a /usr/local/lib. Try this with: + # `brew install enchant && pip install pyenchant` + inreplace "./Lib/ctypes/macholib/dyld.py" do |f| + f.gsub! "DEFAULT_LIBRARY_FALLBACK = [", + "DEFAULT_LIBRARY_FALLBACK = [ '#{HOMEBREW_PREFIX}/lib', '#{formula_opt_lib("openssl@3")}'," + f.gsub! "DEFAULT_FRAMEWORK_FALLBACK = [", "DEFAULT_FRAMEWORK_FALLBACK = [ '#{HOMEBREW_PREFIX}/Frameworks'," + end + + args << "CFLAGS=#{cflags.join(" ")}" unless cflags.empty? + args << "CFLAGS_NODIST=#{cflags_nodist.join(" ")}" unless cflags_nodist.empty? + args << "LDFLAGS=#{ldflags.join(" ")}" unless ldflags.empty? + args << "LDFLAGS_NODIST=#{ldflags_nodist.join(" ")}" unless ldflags_nodist.empty? + args << "CPPFLAGS=#{cppflags.join(" ")}" unless cppflags.empty? + + # Disabled modules - provided in separate formulae + args += %w[ + py_cv_module__tkinter=n/a + ] + + system "./configure", *args + system "make" + + ENV.deparallelize do + # The `altinstall` target prevents the installation of files with only Python's major + # version in its name. This allows us to link multiple versioned Python formulae. + # https://github.com/python/cpython#installing-multiple-versions + # + # Tell Python not to install into /Applications (default for framework builds) + target = "#{"alt" if altinstall?}install" + system "make", target, "PYTHONAPPSDIR=#{prefix}" + system "make", "frameworkinstallextras", "PYTHONAPPSDIR=#{pkgshare}" if OS.mac? + end + + if OS.mac? + # Any .app get a " 3" attached, so it does not conflict with python 2.x. + prefix.glob("*.app") { |app| mv app, app.to_s.sub(/\.app$/, " 3.app") } + + pc_dir = frameworks/"Python.framework/Versions"/version.major_minor/"lib/pkgconfig" + # Symlink the pkgconfig files into HOMEBREW_PREFIX so they're accessible. + (lib/"pkgconfig").install_symlink pc_dir.children + + # Prevent third-party packages from building against fragile Cellar paths + bad_cellar_path_files = [ + lib_cellar/"_sysconfigdata__darwin_darwin.py", + lib_cellar/"config-#{version.major_minor}-darwin/Makefile", + pc_dir/"python-#{version.major_minor}.pc", + pc_dir/"python-#{version.major_minor}-embed.pc", + ] + inreplace bad_cellar_path_files, prefix, opt_prefix + + # Help third-party packages find the Python framework + inreplace lib_cellar/"config-#{version.major_minor}-darwin/Makefile", + /^LINKFORSHARED=(.*)PYTHONFRAMEWORKDIR(.*)/, + "LINKFORSHARED=\\1PYTHONFRAMEWORKINSTALLDIR\\2" + + # Symlink the pkgconfig files into HOMEBREW_PREFIX so they're accessible. + (lib/"pkgconfig").install_symlink pc_dir.children + + # Fix for https://github.com/Homebrew/homebrew-core/issues/21212 + inreplace lib_cellar/"_sysconfigdata__darwin_darwin.py", + %r{('LINKFORSHARED': .*?) (Python.framework/Versions/3.\d+/Python)'}m, + "\\1 #{opt_prefix}/Frameworks/\\2'" + + # For an altinstall, remove symlinks that conflict with the main Python formula. + rm frameworks.glob("Python.framework/{Headers,Python,Resources,Versions/Current}") if altinstall? + else + # Prevent third-party packages from building against fragile Cellar paths + inreplace Dir[lib_cellar/"**/_sysconfigdata_*linux_x86_64-*.py", + lib_cellar/"config*/Makefile", + bin/"python#{version.major_minor}-config", + lib/"pkgconfig/python-3*.pc"], + prefix, opt_prefix + + inreplace bin/"python#{version.major_minor}-config", + 'prefix_real=$(installed_prefix "$0")', + "prefix_real=#{opt_prefix}" + + # For an altinstall, remove symlinks that conflict with the main Python formula. + rm lib/"libpython3.so" if altinstall? + end + + # Remove the site-packages that Python created in its Cellar. + rm_r site_packages_cellar.children + + # Prepare a wheel of wheel to install later. + common_pip_args = %w[ + -v + --no-deps + --no-binary :all: + --no-index + --no-build-isolation + ] + whl_build = buildpath/"whl_build" + system python3, "-m", "venv", whl_build + %w[flit-core wheel].each do |r| + resource(r).stage do + system whl_build/"bin/pip3", "install", *common_pip_args, "." + end + end + resource("wheel").stage do + system whl_build/"bin/pip3", "wheel", *common_pip_args, + "--wheel-dir=#{libexec}", + "." + end + + # Replace bundled pip with our own. + rm lib_cellar.glob("ensurepip/_bundled/pip-*.whl") + resource("pip").stage do + system whl_build/"bin/pip3", "wheel", *common_pip_args, + "--wheel-dir=#{lib_cellar}/ensurepip/_bundled", + "." + end + + # Patch ensurepip to bootstrap our updated version of pip + inreplace lib_cellar/"ensurepip/__init__.py" do |s| + s.gsub!(/_PIP_VERSION = .*/, "_PIP_VERSION = \"#{resource("pip").version}\"") + end + + # Ensure that our new pip wheel is globally readable. + chmod "ugo+r", lib_cellar.glob("ensurepip/_bundled/pip-*.whl") + + # Install unversioned (and for an altinstall, major-versioned) symlinks in libexec/bin. + { + "idle" => "idle#{version.major_minor}", + "pydoc" => "pydoc#{version.major_minor}", + "python" => "python#{version.major_minor}", + "python-config" => "python#{version.major_minor}-config", + }.merge(altinstall? ? { + "idle3" => "idle#{version.major_minor}", + "pydoc3" => "pydoc#{version.major_minor}", + "python3" => "python#{version.major_minor}", + "python3-config" => "python#{version.major_minor}-config", + } : {}).each do |short_name, long_name| + (libexec/"bin").install_symlink (bin/long_name).realpath => short_name + end + + # Bootstrap initial install of pip. + system python3, "-Im", "ensurepip" + + # Install desired versions of pip, wheel using the version of + # pip bootstrapped by ensurepip. + # Note that while we replaced the ensurepip wheels, there's no guarantee + # ensurepip actually used them, since other existing installations could + # have been picked up (and we can't pass --ignore-installed). + root_site_packages = lib/"python#{version.major_minor}/site-packages" + bundled = lib_cellar/"ensurepip/_bundled" + system python3, "-Im", "pip", "install", "-v", + "--no-deps", + "--no-index", + "--upgrade", + "--isolated", + "--target=#{root_site_packages}", + bundled/"pip-#{resource("pip").version}-py3-none-any.whl", + libexec/"wheel-#{resource("wheel").version}-py3-none-any.whl" + + # pip install with --target flag will just place the bin folder into the + # target, so move its contents into the appropriate location + mv (root_site_packages/"bin").children, bin + rmdir root_site_packages/"bin" + + rm bin/"pip" + rm bin/"pip3" if altinstall? + mv bin/"wheel", bin/"wheel#{version.major_minor}" + bin.install_symlink "wheel#{version.major_minor}" => "wheel3" unless altinstall? + + # Install unversioned (and for an altinstall, major-versioned) symlinks in libexec/bin. + { + "pip" => "pip#{version.major_minor}", + "wheel" => "wheel#{version.major_minor}", + }.merge(altinstall? ? { + "pip3" => "pip#{version.major_minor}", + "wheel3" => "wheel#{version.major_minor}", + } : {}).each do |short_name, long_name| + (libexec/"bin").install_symlink (bin/long_name).realpath => short_name + end + + if OS.mac? + # Replace framework site-packages with a symlink to the real one. + rm_r site_packages_cellar + site_packages_cellar.parent.install_symlink root_site_packages + end + + # Write out sitecustomize.py + (lib_cellar/"sitecustomize.py").atomic_write(sitecustomize) + + # Mark Homebrew python as externally managed: https://peps.python.org/pep-0668/#marking-an-interpreter-as-using-an-external-package-manager + # Placed after ensurepip since it invokes pip in isolated mode, meaning + # we can't pass --break-system-packages. + (lib_cellar/"EXTERNALLY-MANAGED").write <<~INI + [externally-managed] + Error=To install Python packages system-wide, try brew install + xyz, where xyz is the package you are trying to + install. + + If you wish to install a Python library that isn't in Homebrew, + use a virtual environment: + + python3 -m venv path/to/venv + source path/to/venv/bin/activate + python3 -m pip install xyz + + If you wish to install a Python application that isn't in Homebrew, + it may be easiest to use 'pipx install xyz', which will manage a + virtual environment for you. You can install pipx with + + brew install pipx + + You may restore the old behavior of pip by passing + the '--break-system-packages' flag to pip, or by adding + 'break-system-packages = true' to your pip.conf file. The latter + will permanently disable this error. + + If you disable this error, we STRONGLY recommend that you additionally + pass the '--user' flag to pip, or set 'user = true' in your pip.conf + file. Failure to do this can result in a broken Homebrew installation. + + Read more about this behavior here: + INI + end + + post_install_steps do + on_macos do + set_permissions "Python.framework/Versions/{{version.major_minor}}/" \ + "lib/python{{version.major_minor}}/venv/scripts/**/*", + "u+w", base: :frameworks, recursive: false + end + on_linux do + set_permissions "python{{version.major_minor}}/venv/scripts/**/*", "u+w", base: :lib, recursive: false + end + end + + def sitecustomize + <<~PYTHON + # This file is created by Homebrew and is executed on each python startup. + # Don't print from here, or else python command line scripts may fail! + # + import re + import os + import site + import sys + if sys.version_info[:2] != (#{version.major}, #{version.minor}): + # This can only happen if the user has set the PYTHONPATH to a mismatching site-packages directory. + # Every Python looks at the PYTHONPATH variable and we can't fix it here in sitecustomize.py, + # because the PYTHONPATH is evaluated after the sitecustomize.py. Many modules (e.g. PyQt4) are + # built only for a specific version of Python and will fail with cryptic error messages. + # In the end this means: Don't set the PYTHONPATH permanently if you use different Python versions. + exit(f'Your PYTHONPATH points to a site-packages dir for Python #{version.major_minor} ' + f'but you are running Python {sys.version_info[0]}.{sys.version_info[1]}!\\n' + f' PYTHONPATH is currently: "{os.environ["PYTHONPATH"]}"\\n' + f' You should `unset PYTHONPATH` to fix this.') + # Only do this for a brewed python: + if os.path.realpath(sys.executable).startswith('#{rack}'): + # Shuffle /Library site-packages to the end of sys.path + library_site = '/Library/Python/#{version.major_minor}/site-packages' + library_packages = [p for p in sys.path if p.startswith(library_site)] + sys.path = [p for p in sys.path if not p.startswith(library_site)] + # .pth files have already been processed so don't use addsitedir + sys.path.extend(library_packages) + # the Cellar site-packages is a symlink to the HOMEBREW_PREFIX + # site_packages; prefer the shorter paths + long_prefix = re.compile(r'#{rack}/[0-9\\._abrc]+/(?:Frameworks/Python\\.framework/Versions/#{version.major_minor}/)?lib/python#{version.major_minor}/site-packages') + sys.path = [long_prefix.sub('#{site_packages}', p) for p in sys.path] + # Set the sys.executable to use the opt_prefix. Only do this if PYTHONEXECUTABLE is not + # explicitly set and we are not in a virtualenv: + if 'PYTHONEXECUTABLE' not in os.environ and sys.prefix == sys.base_prefix: + sys.executable = sys._base_executable = '#{opt_bin}/python#{version.major_minor}' + if 'PYTHONHOME' not in os.environ: + cellar_prefix = re.compile(r'#{rack}/[0-9\\._abrc]+(?=/|$)') + if os.path.realpath(sys.base_prefix).startswith('#{rack}'): + new_prefix = cellar_prefix.sub('#{opt_prefix}', sys.base_prefix) + site.PREFIXES[:] = [new_prefix if x == sys.base_prefix else x for x in site.PREFIXES] + if sys.prefix == sys.base_prefix: + sys.prefix = new_prefix + sys.base_prefix = new_prefix + if os.path.realpath(sys.base_exec_prefix).startswith('#{rack}'): + new_exec_prefix = cellar_prefix.sub('#{opt_prefix}', sys.base_exec_prefix) + site.PREFIXES[:] = [new_exec_prefix if x == sys.base_exec_prefix else x for x in site.PREFIXES] + if sys.exec_prefix == sys.base_exec_prefix: + sys.exec_prefix = new_exec_prefix + sys.base_exec_prefix = new_exec_prefix + # Make site.getsitepackages() return the HOMEBREW_PREFIX site-packages, + # but only if we are outside a venv or in one with include-system-site-packages. + if sys.base_prefix in site.PREFIXES: + site.PREFIXES.insert(site.PREFIXES.index(sys.base_prefix), '#{HOMEBREW_PREFIX}') + site.addsitedir('#{site_packages}') + # Check for and add the prefix of split Python formulae. + for split_module in ["tk", "gdbm"]: + split_prefix = f"#{HOMEBREW_PREFIX}/opt/python-{split_module}@#{version.major_minor}/libexec" + if os.path.isdir(split_prefix): + sys.path.append(split_prefix) + PYTHON + end + + def caveats + dbm_is = "`dbm.gnu` is" + on_linux do + dbm_is = "`dbm.gnu` and `dbm.ndbm` are" + end + + <<~EOS + Python is installed as + #{HOMEBREW_PREFIX}/bin/python#{version.major_minor} + + Unversioned and major-versioned symlinks `python`, `python3`, `python-config`, `python3-config`, `pip`, `pip3`, etc. pointing to + `python#{version.major_minor}`, `python#{version.major_minor}-config`, `pip#{version.major_minor}` etc., respectively, are installed into + #{opt_libexec}/bin + + If you do not need a specific version of Python, and always want Homebrew's `python3` in your PATH: + brew install python3 + + `idle#{version.major_minor}` requires tkinter, which is available separately: + brew install python-tk@#{version.major_minor} + + #{dbm_is} available separately: + brew install python-gdbm@#{version.major_minor} + + For more information about Homebrew and Python, see: https://docs.brew.sh/Homebrew-and-Python + EOS + end + + test do + # Check if sqlite is ok, because we build with --enable-loadable-sqlite-extensions + # and it can occur that building sqlite silently fails if OSX's sqlite is used. + system python3, "-c", "import sqlite3" + + # check to see if we can create a venv + system python3, "-m", "venv", testpath/"myvenv" + + # Check if some other modules import. Then the linked libs are working. + system python3, "-c", "import _ctypes" + system python3, "-c", "import _decimal" + system python3, "-c", "import pyexpat" + system python3, "-c", "import readline" + system python3, "-c", "import zlib" + + # tkinter is provided in a separate formula + assert_match "ModuleNotFoundError: No module named '_tkinter'", + shell_output("#{python3} -Sc 'import tkinter' 2>&1", 1) + + # gdbm is provided in a separate formula + assert_match "ModuleNotFoundError: No module named '_gdbm'", + shell_output("#{python3} -Sc 'import _gdbm' 2>&1", 1) + assert_match "ModuleNotFoundError: No module named '_gdbm'", + shell_output("#{python3} -Sc 'import dbm.gnu' 2>&1", 1) + + # Verify that the selected DBM interface works on macOS. + # Linux requires installing python-gdbm formula + (testpath/"dbm_test.py").write <<~PYTHON + import dbm + + with dbm.ndbm.open("test", "c") as db: + db[b"foo \\xbd"] = b"bar \\xbd" + with dbm.ndbm.open("test", "r") as db: + assert list(db.keys()) == [b"foo \\xbd"] + assert b"foo \\xbd" in db + assert db[b"foo \\xbd"] == b"bar \\xbd" + PYTHON + system python3, "dbm_test.py" if OS.mac? + + system bin/"pip#{version.major_minor}", "list", "--format=columns" + + # Check our sitecustomize.py + assert_match HOMEBREW_CELLAR.to_s, shell_output("#{python3} -Sc 'import sys; print(sys.base_prefix)'") + refute_match HOMEBREW_CELLAR.to_s, shell_output("#{python3} -c 'import sys; print(sys.base_prefix)'") + refute_match site_packages_cellar.to_s, shell_output("#{python3} -c 'import sys; print(sys.path)'") + + # Verify our sysconfig patches + sysconfig_path = "import sysconfig; print(sysconfig.get_paths(\"osx_framework_library\")[\"data\"])" + assert_equal HOMEBREW_PREFIX.to_s, shell_output("#{python3} -c '#{sysconfig_path}'").strip + linkforshared_var = "import sysconfig; print(sysconfig.get_config_var(\"LINKFORSHARED\"))" + assert_match opt_prefix.to_s, shell_output("#{python3} -c '#{linkforshared_var}'") if OS.mac? + + # Check our externally managed marker + assert_match "If you wish to install a Python library", + shell_output("#{python3} -m pip install pip 2>&1", 1) + end +end diff --git a/Formula/qwen-code.rb b/Formula/qwen-code.rb new file mode 100644 index 0000000..6754436 --- /dev/null +++ b/Formula/qwen-code.rb @@ -0,0 +1,43 @@ +class QwenCode < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "3bbc3e0bedd5d40641572f8efd83b1b08eb2a756919d27b201ebbd9c7c1698e3" + sha256 cellar: :any, arm64_tahoe: "3bbc3e0bedd5d40641572f8efd83b1b08eb2a756919d27b201ebbd9c7c1698e3" + sha256 cellar: :any, x86_64_linux: "b49ec9479459ca4c1c13afd96a06b7129ee44aa0c5e45da6aedf96d1d5ff8b2c" + end + desc "AI-powered command-line workflow tool for developers" + homepage "https://github.com/QwenLM/qwen-code" + url "https://registry.npmjs.org/@qwen-code/qwen-code/-/qwen-code-0.21.7.tgz" + sha256 "9a5c6efa1e8632f8e3243455f553d8749360d97f958750b6666b622ce2cc1d25" + license "Apache-2.0" + + + + depends_on "node" + depends_on "ripgrep" + + def install + system "npm", "install", *std_npm_args + bin.install_symlink libexec.glob("bin/*") + + qwen_code = libexec/"lib/node_modules/@qwen-code/qwen-code" + + # Remove incompatible pre-built binaries + rm_r(qwen_code/"vendor/ripgrep") + + os = OS.mac? ? "darwin" : "linux" + arch = Hardware::CPU.intel? ? "x64" : "arm64" + (qwen_code/"node_modules/node-pty/prebuilds").glob("*").each do |dir| + rm_r(dir) if dir.basename.to_s != "#{os}-#{arch}" + end + + qwen_code.glob("node_modules/@qwen-code/audio-capture/prebuilds/*").each do |dir| + rm_r(dir) if dir.basename.to_s != "#{os}-#{arch}" + end + end + + test do + assert_match version.to_s, shell_output("#{bin}/qwen --version") + assert_match "No MCP servers configured.", shell_output("#{bin}/qwen mcp list") + end +end diff --git a/Formula/ripgrep.rb b/Formula/ripgrep.rb new file mode 100644 index 0000000..c727307 --- /dev/null +++ b/Formula/ripgrep.rb @@ -0,0 +1,39 @@ +class Ripgrep < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "aa54bb41d674d2872cd1586f4a71b9a712ab20dc5e80b58d464bb64462732fcc" + sha256 cellar: :any, arm64_tahoe: "70d2dd4c77e3095797b768a1b6c1d092a1ef6db5ba81b38b422920b7b87c9886" + sha256 cellar: :any, x86_64_linux: "1380aa0ce79e4e494201d66b55fa4301c4e23d72d70ceceb2c1c61e7613bf59f" + end + desc "Search tool like grep and The Silver Searcher" + homepage "https://github.com/BurntSushi/ripgrep" + url "https://github.com/BurntSushi/ripgrep/archive/refs/tags/15.2.0.tar.gz" + sha256 "7605249d3eb0d5f170e3414498e3344e26b1e7a147aec518b57090b80036a562" + license "Unlicense" + compatibility_version 1 + head "https://github.com/BurntSushi/ripgrep.git", branch: "master" + + livecheck do + url :stable + strategy :github_latest + end + + + + depends_on "asciidoctor" => :build + depends_on "pkgconf" => :build + depends_on "rust" => :build + depends_on "pcre2" + + def install + system "cargo", "install", *std_cargo_args(features: "pcre2") + + generate_completions_from_executable(bin/"rg", "--generate", shell_parameter_format: "complete-") + (man1/"rg.1").write Utils.safe_popen_read(bin/"rg", "--generate", "man") + end + + test do + (testpath/"Hello.txt").write("Hello World!") + system bin/"rg", "Hello World!", testpath + end +end diff --git a/Formula/samba.rb b/Formula/samba.rb new file mode 100644 index 0000000..e162efc --- /dev/null +++ b/Formula/samba.rb @@ -0,0 +1,193 @@ +class Samba < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "65560254b8ca9ef658e128bb80faae5fef62434dcc20a2df68be88e59f546c62" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "7b1745352d76f8e5ee7138192f2e36023e6692ab46b6231c6ea95a6077b3492b" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "e4631b59ff66e98a54ea8dfe778f3d6b679038a149914d4ee244308696ef9a41" + end + # Samba can be used to share directories with the guest in QEMU user-mode + # (SLIRP) networking with the `-net nic -net user,smb=/share/this/with/guest` + # option. The shared folder appears in the guest as "\\10.0.2.4\qemu". + desc "SMB/CIFS file, print, and login server for UNIX" + homepage "https://www.samba.org/" + url "https://download.samba.org/pub/samba/stable/samba-4.24.5.tar.gz" + sha256 "6d5d7ee82f5ce9da4135086c9b184e47a58b4b023565f58abbb1f8c8a922306b" + license "GPL-3.0-or-later" + compatibility_version 2 + + livecheck do + url "https://www.samba.org/samba/download/" + regex(/href=.*?samba[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "bison" => :build + depends_on "cmocka" => :build + depends_on "pkgconf" => :build + depends_on "gnutls" + # icu4c can get linked if detected by pkg-config and there isn't a way to force disable + # without disabling spotlight support. So we just enable the feature for all systems. + depends_on "icu4c@78" + depends_on "krb5" + depends_on "libtasn1" + depends_on "libxcrypt" + depends_on "lmdb" + depends_on "popt" + depends_on "readline" + depends_on "talloc" + depends_on "tdb" + depends_on "tevent" + + uses_from_macos "flex" => :build + uses_from_macos "perl" => :build + uses_from_macos "python" => :build # configure requires python3 binary + uses_from_macos "libxcrypt" + + on_macos do + depends_on "gettext" + depends_on "openssl@3" + end + + on_linux do + depends_on "libtirpc" + depends_on "zlib-ng-compat" + end + + conflicts_with "jena", because: "both install `tdbbackup` binaries" + conflicts_with "puzzles", because: "both install `net` binaries" + + resource "Parse::Yapp" do + url "https://cpan.metacpan.org/authors/id/W/WB/WBRASWELL/Parse-Yapp-1.21.tar.gz" + sha256 "3810e998308fba2e0f4f26043035032b027ce51ce5c8a52a8b8e340ca65f13e5" + end + + # upstream bug report, https://bugzilla.samba.org/show_bug.cgi?id=10791 + # https://bugzilla.samba.org/show_bug.cgi?id=10626 + # https://bugzilla.samba.org/show_bug.cgi?id=9665 + patch do + url "https://gitlab.com/samba-team/samba/-/commit/a2736fe78a4e75e71b9bc53dc24c36d71b911d2a.diff" + sha256 "7d1bf9eb26211e2ab9e3e67ae32308a3704ff9904ab2369e5d863e079ea8a03f" + type :unofficial + resolves "https://gitlab.com/samba-team/samba/-/merge_requests/3902" + end + + def install + # Skip building test that fails on ARM with error: initializer element is not a compile-time constant + inreplace "lib/ldb/wscript", /\('test_ldb_comparison_fold',$/, "\\0 enabled=False," if Hardware::CPU.arm? + + # avoid `perl module "Parse::Yapp::Driver" not found` error on macOS 10.xx (not required on 11) + if !OS.mac? || MacOS.version < :big_sur + ENV.prepend_create_path "PERL5LIB", buildpath/"lib/perl5" + ENV.prepend_path "PATH", buildpath/"bin" + resource("Parse::Yapp").stage do + system "perl", "Makefile.PL", "INSTALL_BASE=#{buildpath}" + system "make" + system "make", "install" + end + end + ENV.append "LDFLAGS", "-Wl,-rpath,#{lib}/private" if OS.linux? + + bundled_libs_list = [] + # Upstream (https://github.com/lxin/quic) has no tagged releases, so we would have to add an arbitrary + # commit as a resource. That's not really better than just using the vendored copy. Consider breaking + # it out into a resource or formula once tagged releases become available. + bundled_libs_list << "libquic" if OS.linux? + bundled_libs = bundled_libs_list.empty? ? "NONE" : bundled_libs_list.join(",") + + system "./configure", + "--bundled-libraries=#{bundled_libs}", + "--private-libraries=!ldb", + "--disable-cephfs", + "--disable-cups", + "--disable-iprint", + "--disable-glusterfs", + "--disable-python", + "--without-acl-support", + "--without-ad-dc", + "--without-ads", + "--without-ldap", + "--without-libarchive", + "--without-json", + "--without-pam", + "--without-regedit", + "--without-syslog", + "--without-utmp", + "--without-winbind", + "--with-shared-modules=!vfs_snapper", + "--with-system-mitkrb5", + "--prefix=#{prefix}", + "--libdir=#{lib}", + "--sysconfdir=#{etc}", + "--localstatedir=#{var}" + system "make" + system "make", "install" + return unless OS.mac? + + # macOS has its own SMB daemon as /usr/sbin/smbd, so rename our smbd to samba-dot-org-smbd to avoid conflict. + # samba-dot-org-smbd is used by qemu.rb . + # Rename profiles as well to avoid conflicting with /usr/bin/profiles + mv sbin/"smbd", sbin/"samba-dot-org-smbd" + mv bin/"profiles", bin/"samba-dot-org-profiles" + end + + def caveats + on_macos do + <<~EOS + To avoid conflicting with macOS system binaries, some files were installed with non-standard name: + - smbd: #{HOMEBREW_PREFIX}/sbin/samba-dot-org-smbd + - profiles: #{HOMEBREW_PREFIX}/bin/samba-dot-org-profiles + EOS + end + end + + test do + smbd = if OS.mac? + sbin/"samba-dot-org-smbd" + else + sbin/"smbd" + end + + system smbd, "--build-options", "--configfile=/dev/null" + system smbd, "--version" + + mkdir_p "samba/state" + mkdir_p "samba/data" + (testpath/"samba/data/hello").write "hello" + + # mimic smb.conf generated by qemu + # https://github.com/qemu/qemu/blob/v6.0.0/net/slirp.c#L862 + (testpath/"smb.conf").write <<~CONF + [global] + private dir=#{testpath}/samba/state + interfaces=127.0.0.1 + bind interfaces only=yes + pid directory=#{testpath}/samba/state + lock directory=#{testpath}/samba/state + state directory=#{testpath}/samba/state + cache directory=#{testpath}/samba/state + ncalrpc dir=#{testpath}/samba/state/ncalrpc + log file=#{testpath}/samba/state/log.smbd + smb passwd file=#{testpath}/samba/state/smbpasswd + security = user + map to guest = Bad User + load printers = no + printing = bsd + disable spoolss = yes + usershare max shares = 0 + [test] + path=#{testpath}/samba/data + read only=no + guest ok=yes + force user=#{ENV["USER"]} + CONF + + port = free_port + spawn smbd, "--debug-stdout", "-F", "--configfile=smb.conf", "--port=#{port}", "--debuglevel=4", in: "/dev/null" + + sleep 5 + mkdir_p "got" + system bin/"smbclient", "-p", port.to_s, "-N", "//127.0.0.1/test", "-c", "get hello #{testpath}/got/hello" + assert_equal "hello", (testpath/"got/hello").read + end +end diff --git a/Formula/sdl2-compat.rb b/Formula/sdl2-compat.rb new file mode 100644 index 0000000..062f649 --- /dev/null +++ b/Formula/sdl2-compat.rb @@ -0,0 +1,54 @@ +class Sdl2Compat < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "b5da3b02dfd9a68368f62a317b29f845dad4f29e067fc4aa81a351ca527a82c3" + sha256 cellar: :any, arm64_tahoe: "72e2c794f8408fba73fd0345a4eeb4cac49badc134e91c680c6aa7fd685d5492" + sha256 cellar: :any, x86_64_linux: "710527b5b729316426641d49adb065f9c4c8a07f741682329955e9d3ead7a18e" + end + desc "SDL2 compatibility layer that uses SDL3 behind the scenes" + homepage "https://github.com/libsdl-org/sdl2-compat" + url "https://github.com/libsdl-org/sdl2-compat/releases/download/release-2.32.70/sdl2-compat-2.32.70.tar.gz" + sha256 "998fa62557eb46ffe7e5c3e2c123bc332f7df9d9f593b3ceed88ed1158428a44" + license "Zlib" + head "https://github.com/libsdl-org/sdl2-compat.git", branch: "main" + + + + depends_on "cmake" => :build + depends_on "sdl3" => :no_linkage + + def install + args = ["-DCMAKE_INSTALL_RPATH=#{rpath(target: formula_opt_lib("sdl3"))}"] if OS.mac? + + # We override install_prefix to make sure substituted CMAKE_INSTALL_FULL_* use + # HOMEBREW_PREFIX path because most build scripts assume that all SDL modules + # are installed to the same prefix. Consequently SDL stuff cannot be keg-only + system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args(install_prefix: HOMEBREW_PREFIX) + system "cmake", "--build", "build" + system "cmake", "--install", "build", "--prefix", prefix + (lib/"pkgconfig").install_symlink "sdl2-compat.pc" => "sdl2.pc" + end + + test do + (testpath/"test.c").write <<~C + #include + + int main(void) { + if (SDL_Init(SDL_INIT_VIDEO) < 0) { + SDL_Log("SDL_Init failed: %s", SDL_GetError()); + return 1; + } + SDL_Quit(); + return 0; + } + C + + flags = shell_output("#{bin}/sdl2-config --cflags --libs").chomp + refute_match prefix.realpath.to_s, flags + refute_match opt_prefix.to_s, flags + + system ENV.cc, "test.c", "-o", "test", *flags.split + ENV["SDL_VIDEODRIVER"] = "dummy" + system "./test" + end +end diff --git a/Formula/sdl3.rb b/Formula/sdl3.rb new file mode 100644 index 0000000..4ebc70c --- /dev/null +++ b/Formula/sdl3.rb @@ -0,0 +1,77 @@ +class Sdl3 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "012d5bb068548cb42df1fd6ab231a8ef76e706a82822d84ed71a10be7f155263" + sha256 cellar: :any, arm64_tahoe: "259aa68688ef848e5c44755eb021b6024b3f6e68e3449a5d74d8bdad7df3b0d6" + sha256 cellar: :any, x86_64_linux: "3d24a575e814b1f349e4df8aa0b2657acfcf2fef7ab2cbf34b44d485e981b6d9" + end + desc "Low-level access to audio, keyboard, mouse, joystick, and graphics" + homepage "https://libsdl.org/" + url "https://github.com/libsdl-org/SDL/releases/download/release-3.4.14/SDL3-3.4.14.tar.gz" + sha256 "30d4aa2b3037718142b32dffd4e72f917ebb6cc5227150e7bb9c45efb2153aeb" + license "Zlib" + compatibility_version 1 + head "https://github.com/libsdl-org/SDL.git", branch: "main" + + livecheck do + url :stable + regex(/release[._-](\d+(?:\.\d+)+)/i) + strategy :github_latest + end + + + + depends_on "cmake" => :build + depends_on "pkgconf" => :build + + on_linux do + # Features are built into library if dependency is found at build-time. + # These are then enabled at runtime if library can be dynamically loaded, + # so we can provide extra features via build-only dependencies. This includes + # PipeWire and Wayland used on modern Linux which have large dependency trees. + depends_on "libxkbcommon" => :build + depends_on "mesa" => :build + depends_on "pipewire" => :build + depends_on "wayland" => :build + + # Runtime dependencies are for older PulseAudio and X11. These are used if + # running a Linux container on macOS and should have higher compatibility + depends_on "libx11" => :no_linkage + depends_on "libxcursor" => :no_linkage + depends_on "libxext" => :no_linkage + depends_on "libxfixes" => :no_linkage + depends_on "libxi" => :no_linkage + depends_on "libxrandr" => :no_linkage + depends_on "libxscrnsaver" => :no_linkage + depends_on "pulseaudio" => :no_linkage + end + + def install + inreplace "cmake/sdl3.pc.in", "@SDL_PKGCONFIG_PREFIX@", HOMEBREW_PREFIX + + args = %w[ + -DSDL_TESTS=OFF + -DSDL_X11_XTEST=OFF + ] + + system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + (testpath/"test.c").write <<~CPP + #include + int main() { + if (SDL_Init(SDL_INIT_VIDEO) != 1) { + return 1; + } + SDL_Quit(); + return 0; + } + CPP + system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lSDL3", "-o", "test" + ENV["SDL_VIDEODRIVER"] = "dummy" + system "./test" + end +end diff --git a/Formula/simdjson.rb b/Formula/simdjson.rb new file mode 100644 index 0000000..ce6f052 --- /dev/null +++ b/Formula/simdjson.rb @@ -0,0 +1,45 @@ +class Simdjson < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "a824a28ffc068be855d204b0b76fc096453013a76e84ccfc200acf3289197095" + sha256 cellar: :any, arm64_tahoe: "da88957275c7f0fd3f47f6e183da15eda1c4fd013515c59d8a75316fbf8ddeff" + sha256 cellar: :any, x86_64_linux: "4ae6ad35a77df021c89c62d6bb82fb2b3b9b962143761a9a840d8492b69cbb2a" + end + desc "SIMD-accelerated C++ JSON parser" + homepage "https://simdjson.org" + url "https://github.com/simdjson/simdjson/archive/refs/tags/v4.6.6.tar.gz" + sha256 "1cd4c4c18263d2ae1f0cd5d4ba8b14e679b5a419ca15988a0da4cf43c514f28d" + license "Apache-2.0" + compatibility_version 3 + head "https://github.com/simdjson/simdjson.git", branch: "master" + + + + depends_on "cmake" => :build + + def install + system "cmake", "-S", ".", "-B", "build", + "-DBUILD_SHARED_LIBS=ON", + "-DSIMDJSON_BUILD_STATIC_LIB=ON", + *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + (testpath/"test.json").write({ name: "Homebrew", isNull: nil }.to_json) + (testpath/"test.cpp").write <<~CPP + #include + #include + int main(void) { + simdjson::dom::parser parser; + simdjson::dom::element json = parser.load("test.json"); + std::cout << json["name"] << std::endl; + } + CPP + + system ENV.cxx, "test.cpp", "-std=c++11", + "-I#{include}", "-L#{lib}", "-lsimdjson", "-o", "test" + assert_equal "\"Homebrew\"\n", shell_output("./test") + end +end diff --git a/Formula/simdutf.rb b/Formula/simdutf.rb new file mode 100644 index 0000000..445de51 --- /dev/null +++ b/Formula/simdutf.rb @@ -0,0 +1,47 @@ +class Simdutf < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "33afb526dbf507b29803dcb95bb330e7ffebefbae91a163adac64de941a0fa76" + sha256 cellar: :any, arm64_tahoe: "a38c1bba8d023f968b80abdb392c149c2f5ae6930ddc1c929fb802a722c6aa54" + sha256 cellar: :any_skip_relocation, x86_64_linux: "504e010ed49eddea6eab84fa38590da902dc798d33bce2a1e5469ccede396083" + end + desc "Unicode conversion routines, fast" + homepage "https://simdutf.github.io/simdutf/" + url "https://github.com/simdutf/simdutf/archive/refs/tags/v9.0.0.tar.gz" + sha256 "fd2ce975f29809a975a8da8843cfb3a7265af3f71be548f199d23cf65e101764" + license any_of: ["Apache-2.0", "MIT"] + compatibility_version 3 + head "https://github.com/simdutf/simdutf.git", branch: "master" + + livecheck do + url :stable + regex(/^v?(\d+(?:\.\d+)+)$/i) + end + + + + depends_on "aklomp-base64" => :build + depends_on "cmake" => :build + depends_on "icu4c@78" + + uses_from_macos "python" => :build + + def install + args = %W[ + -DBUILD_SHARED_LIBS=ON + -DCMAKE_INSTALL_RPATH=#{rpath} + -DCMAKE_BUILD_WITH_INSTALL_RPATH=ON + -DCPM_LOCAL_PACKAGES_ONLY=ON + -DPython3_EXECUTABLE=#{which("python3")} + -DSIMDUTF_BENCHMARKS=ON + ] + system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + bin.install "build/benchmarks/benchmark" => "sutf-benchmark" + end + + test do + system bin/"sutf-benchmark", "--random-utf8", "10240", "-I", "100" + end +end diff --git a/Formula/speexdsp.rb b/Formula/speexdsp.rb new file mode 100644 index 0000000..9eaac2d --- /dev/null +++ b/Formula/speexdsp.rb @@ -0,0 +1,56 @@ +class Speexdsp < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "c19e5962197be02c5124dc4c2cef39ef6a6b00bddb5f3cb7dca9c3e31929d086" + sha256 cellar: :any, arm64_tahoe: "e7647620836f6c58957deb0c5994b29b087c0574b5feca71fbaa9dd67d15a092" + sha256 cellar: :any_skip_relocation, x86_64_linux: "c417e96a3739f41fb59aca0ceba32fd45b07f79175d8eda837dd125159098453" + end + desc "Speex audio processing library" + homepage "https://speex.org/" + url "https://ftp.osuosl.org/pub/xiph/releases/speex/speexdsp-1.2.1.tar.gz" + mirror "https://mirror.csclub.uwaterloo.ca/xiph/releases/speex/speexdsp-1.2.1.tar.gz" + sha256 "8c777343e4a6399569c72abc38a95b24db56882c83dbdb6c6424a5f4aeb54d3d" + license "BSD-3-Clause" + + livecheck do + url "https://ftp.osuosl.org/pub/xiph/releases/speex/?C=M&O=D" + regex(%r{href=(?:["']?|.*?/)speexdsp[._-]v?(\d+(?:\.\d+)+)\.t}i) + end + + + + head do + url "https://gitlab.xiph.org/xiph/speexdsp.git", branch: "master" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + end + + depends_on "pkgconf" => :build + + def install + system "./autogen.sh" if build.head? + system "./configure", *std_configure_args + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + + int main() + { + SpeexResamplerState *st = speex_resampler_init(1, 8000, 12000, 10, NULL); + speex_resampler_set_rate(st, 96000, 44100); + speex_resampler_skip_zeros(st); + speex_resampler_destroy(st); + + return 0; + } + C + system ENV.cc, "test.c", "-L#{lib}", "-lspeexdsp", "-o", "test" + system "./test" + end +end diff --git a/Formula/svt-av1.rb b/Formula/svt-av1.rb new file mode 100644 index 0000000..fc6f663 --- /dev/null +++ b/Formula/svt-av1.rb @@ -0,0 +1,50 @@ +class SvtAv1 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "2e6f7cbf3ff42f59ca251f3c84d4ad5a3ecfd518340237a6f70a54a428de1676" + sha256 cellar: :any, arm64_tahoe: "bd6186cc963d1980f0d81d59ecef58c8fa6263eb1124211dd3537b224e04c9e0" + sha256 cellar: :any, x86_64_linux: "ac3f7f9240381b15060529d4fed8ee1945afddb74a44f0cee8e8741e1d29c6a4" + end + desc "AV1 encoder" + homepage "https://gitlab.com/AOMediaCodec/SVT-AV1" + url "https://gitlab.com/AOMediaCodec/SVT-AV1/-/archive/v4.2.0/SVT-AV1-v4.2.0.tar.bz2" + sha256 "512f2ea5649e3e76c2dddcc25c2556fb67a9582baaab207c9c96161c94659dad" + license "BSD-3-Clause" + compatibility_version 1 + head "https://gitlab.com/AOMediaCodec/SVT-AV1.git", branch: "master" + + livecheck do + url :stable + regex(/^v?(\d+(?:\.\d+)+)$/i) + end + + + + depends_on "cmake" => :build + + on_intel do + depends_on "nasm" => :build + end + + def install + # Features are enabled based on compiler support, and then the appropriate + # implementations are chosen at runtime. + # See https://gitlab.com/AOMediaCodec/SVT-AV1/-/blob/master/Source/Lib/Codec/common_dsp_rtcd.c + ENV.runtime_cpu_detection + + system "cmake", "-S", ".", "-B", "build", "-DCMAKE_INSTALL_RPATH=#{rpath}", *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + resource "homebrew-testvideo" do + url "https://github.com/grusell/svt-av1-homebrew-testdata/raw/main/video_64x64_yuv420p_25frames.yuv" + sha256 "0c5cc90b079d0d9c1ded1376357d23a9782a704a83e01731f50ccd162e246492" + end + + testpath.install resource("homebrew-testvideo") + system bin/"SvtAv1EncApp", "-w", "64", "-h", "64", "-i", "video_64x64_yuv420p_25frames.yuv", "-b", "output.ivf" + assert_path_exists testpath/"output.ivf" + end +end diff --git a/Formula/systemd.rb b/Formula/systemd.rb new file mode 100644 index 0000000..4edc1c6 --- /dev/null +++ b/Formula/systemd.rb @@ -0,0 +1,129 @@ +class Systemd < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "0b69145eb07e6cea8ba539dc479952e193eb2debe281ad920adac59ae762d04c" + end + include Language::Python::Virtualenv + + desc "System and service manager" + homepage "https://systemd.io" + url "https://github.com/systemd/systemd/archive/refs/tags/v261.2.tar.gz" + sha256 "ed1059ff964f5df35b6056434cc17cc83f86dc913f10489948a0b19b6081c5ec" + license all_of: [ + # Main license is LGPL-2.1-or-later while systemd-udevd is GPL-2.0-or-later + "LGPL-2.1-or-later", + "GPL-2.0-or-later", + # The remaining licenses encompass various exceptions as defined using + # file-specific SPDX-License-Identifier. Note that we exclude: + # 1. "BSD-3-Clause" - it is for an unused build script (gen_autosuspend_rules.py) + # 2. "OFL-1.1" - we do not install HTML documentation + "CC0-1.0", + "LGPL-2.0-or-later", + "MIT", + "MIT-0", + :public_domain, + { "LGPL-2.0-or-later" => { with: "Linux-syscall-note" } }, + { "GPL-1.0-or-later" => { with: "Linux-syscall-note" } }, + { "GPL-2.0-or-later" => { with: "Linux-syscall-note" } }, + { "GPL-2.0-only" => { with: "Linux-syscall-note" } }, + { any_of: ["BSD-3-Clause", "GPL-2.0-only" => { with: "Linux-syscall-note" }] }, + { any_of: ["MIT", "GPL-2.0-only" => { with: "Linux-syscall-note" }] }, + { any_of: ["MIT", "GPL-2.0-or-later" => { with: "Linux-syscall-note" }] }, + { any_of: ["GPL-2.0-only", "BSD-2-Clause"] }, + ] + compatibility_version 1 + head "https://github.com/systemd/systemd.git", branch: "main" + + + + keg_only "it will shadow system systemd if linked" + + depends_on "coreutils" => :build + depends_on "docbook-xsl" => :build + depends_on "gettext" => :build + depends_on "gperf" => :build + depends_on "icu4c@78" => :build # FIXME: brew should add to PKG_CONFIG_PATH as dependency of libxml2 + depends_on "libxml2" => :build + depends_on "libxslt" => :build + depends_on "meson" => :build + depends_on "ninja" => :build + depends_on "pkgconf" => :build + depends_on "python@3.14" => :build + depends_on "glib" + depends_on "libcap" + depends_on "libxcrypt" + depends_on :linux + depends_on "lz4" + depends_on "openssl@3" + depends_on "util-linux" # for libmount + depends_on "xz" + depends_on "zstd" + + pypi_packages package_name: "", + extra_packages: %w[jinja2 lxml] + + resource "jinja2" do + url "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz" + sha256 "0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d" + end + + resource "lxml" do + url "https://files.pythonhosted.org/packages/05/3b/aab6728cae887456f409b4d75e8a01856e4f04bd510de38052a47768b680/lxml-6.1.1.tar.gz" + sha256 "ba96ae44888e0185281e937633a743ea90d5a196c6000f82565ebb0580012d40" + end + + resource "markupsafe" do + url "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz" + sha256 "722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698" + end + + def install + venv = virtualenv_create(buildpath/"venv", "python3.14") + venv.pip_install resources + ENV.prepend_path "PATH", venv.root/"bin" + ENV.append "LDFLAGS", "-Wl,-rpath,#{lib}/systemd" + ENV["XML_CATALOG_FILES"] = etc/"xml/catalog" + + args = %W[ + --localstatedir=#{var} + --sysconfdir=#{etc} + -Dsysvinit-path=#{etc}/init.d + -Dsysvrcnd-path=#{etc}/rc.d + -Drc-local=#{etc}/rc.local + -Dpamconfdir=#{etc}/pam.d + -Dbashcompletiondir=#{bash_completion} + -Dmode=release + -Dsshconfdir=no + -Dsshdconfdir=no + -Dcreate-log-dirs=false + -Dhwdb=false + -Dtests=false + -Dlz4=enabled + -Dman=enabled + -Dacl=disabled + -Dgcrypt=disabled + -Dgnutls=disabled + -Dlibcurl=disabled + -Dmicrohttpd=disabled + -Dp11kit=disabled + -Dpam=disabled + -Dshellprofiledir=no + ] + + # D-Bus dirs default to the read-only dbus keg via pkg-config; use our own prefix + args += %W[ + -Ddbuspolicydir=#{share}/dbus-1/system.d + -Ddbussessionservicedir=#{share}/dbus-1/services + -Ddbussystemservicedir=#{share}/dbus-1/system-services + -Ddbus-interfaces-dir=#{share}/dbus-1/interfaces + ] + + system "meson", "setup", "build", *args, *std_meson_args + system "meson", "compile", "-C", "build" + system "meson", "install", "-C", "build" + end + + test do + assert_match %r{temporary: (/var)?/tmp}, shell_output(bin/"systemd-path") + end +end diff --git a/Formula/talloc.rb b/Formula/talloc.rb new file mode 100644 index 0000000..a9ab744 --- /dev/null +++ b/Formula/talloc.rb @@ -0,0 +1,52 @@ +class Talloc < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "a1fc4bfee8a04ad313398302be7f1dfbed915faa22740d574fd6a32730830c4c" + sha256 cellar: :any, arm64_tahoe: "33f78a2e466b5dd0585e61e12afb348d23c9f9c13a1b15372b0cd2580063fb10" + sha256 cellar: :any, x86_64_linux: "3490cf833175989808b2f38118a501a5e6895069f7385dd0145abe0185a5dfdd" + end + desc "Hierarchical, reference-counted memory pool with destructors" + homepage "https://talloc.samba.org/" + url "https://www.samba.org/ftp/talloc/talloc-2.5.0.tar.gz" + sha256 "912afa237510ae542a7733998eb18a12bcda35ab6729c8e2ddb43e8d0ebab007" + license "GPL-3.0-or-later" + compatibility_version 1 + + livecheck do + url "https://www.samba.org/ftp/talloc/" + regex(/href=.*?talloc[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + uses_from_macos "python" => :build + + def install + system "./configure", "--prefix=#{prefix}", + "--disable-rpath", + "--without-gettext", + "--disable-python" + system "make", "install" + end + + test do + (testpath/"test.c").write <<~C + #include + int main() + { + int ret; + TALLOC_CTX *tmp_ctx = talloc_new(NULL); + if (tmp_ctx == NULL) { + ret = 1; + goto done; + } + ret = 0; + done: + talloc_free(tmp_ctx); + return ret; + } + C + system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-ltalloc", "-o", "test" + system testpath/"test" + end +end diff --git a/Formula/tcl-tk.rb b/Formula/tcl-tk.rb new file mode 100644 index 0000000..16f86d8 --- /dev/null +++ b/Formula/tcl-tk.rb @@ -0,0 +1,231 @@ +class TclTk < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "337f7db2e9c5b41a61cde887db2d02fe6293f76eedf81502783014b9922bef1e" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "5f827b236bad97d36743a3abfa75f746f998ccf4d6cf46e55b4ad167cccf14d6" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "bb4f5dc50224e0e6ef9da8fd743964cf26dc43edaf9702c728272f8c839ed0b1" + end + desc "Tool Command Language" + homepage "https://www.tcl-lang.org" + url "https://downloads.sourceforge.net/project/tcl/Tcl/9.0.4/tcl9.0.4-src.tar.gz" + mirror "https://fossies.org/linux/misc/tcl9.0.4-src.tar.gz" + sha256 "d0aed49230bc02a65c1e0229e65f34590a4b037ec40d546f32573b467f7551ea" + license "TCL" + compatibility_version 1 + + livecheck do + url :stable + regex(%r{url=.*?/(?:tcl|tk).?v?(\d+(?:\.\d+)+)[._-]src\.t}i) + end + + + + depends_on "libtommath" + depends_on "openssl@3" + + on_linux do + depends_on "freetype" => :build + depends_on "pkgconf" => :build + depends_on "libx11" + depends_on "libxext" + depends_on "zlib-ng-compat" + end + + conflicts_with "page", because: "both install `page` binaries" + conflicts_with "the_platinum_searcher", because: "both install `pt` binaries" + + resource "critcl" do + url "https://github.com/andreas-kupries/critcl/archive/refs/tags/3.3.1.tar.gz" + sha256 "d970a06ae1cdee7854ca1bc571e8b5fe7189788dc5a806bce67e24bbadbe7ae2" + + livecheck do + url :url + regex(/^v?(\d+(?:\.\d+)+)$/i) + end + end + + resource "tcllib" do + url "https://downloads.sourceforge.net/project/tcllib/tcllib/2.0/tcllib-2.0.tar.xz" + sha256 "642c2c679c9017ab6fded03324e4ce9b5f4292473b62520e82aacebb63c0ce20" + + livecheck do + url "https://sourceforge.net/projects/tcllib/rss?path=/tcllib" + regex(%r{url=.*?/tcllib[._-]v?(\d+(?:\.\d+)+)\.t}i) + end + end + + resource "tcltls" do + url "https://core.tcl-lang.org/tcltls/uv/tcltls-2.0-src.tar.gz" + sha256 "f1fa46067984c4096976f04f131fdea54c07ba45ce2b03a0697a0ea801e3a23a" + + livecheck do + url "https://core.tcl-lang.org/tcltls/wiki/Download" + regex(/href=.*?tcltls[._-]v?(\d+(?:\.\d+)+)(?:[._-]src)?\.t/i) + end + end + + resource "tk" do + url "https://downloads.sourceforge.net/project/tcl/Tcl/9.0.4/tk9.0.4-src.tar.gz" + mirror "https://fossies.org/linux/misc/tk9.0.4-src.tar.gz" + sha256 "d7a146d2917eb8b5cc95276dbf0e3d03c7464d2b19c1675357857c989301dbb4" + + livecheck do + formula :parent + end + end + + # "https://downloads.sourceforge.net/project/incrtcl/%5Bincr%20Tcl_Tk%5D-4-source/itk%204.1.0/itk4.1.0.tar.gz" + # would cause `bad URI(is not URI?)` error on 12/13 builds + # Also need a newer release than available on SourceForce for TCL 9 + # so we use the GitHub mirror which is easier to access than Fossil + resource "itk4" do + url "https://github.com/tcltk/itk/archive/refs/tags/itk-4-2-3.tar.gz" + version "4.2.3" + sha256 "bc5ed347212fce403e04d3161cd429319af98da47effd3e32e20d2f04293b036" + + livecheck do + url :url + regex(/^itk[._-]v?(\d+(?:[._-]\d+)+)$/i) + strategy :git do |tags, regex| + tags.filter_map { |tag| tag[regex, 1]&.tr("_-", ".") } + end + end + end + + def install + odie "tk resource needs to be updated" if version != resource("tk").version + + # Remove bundled libraries. Some private headers are still needed + ["compat/zlib", "libtommath"].each do |dir| + (buildpath/dir).find do |path| + rm(path) if path.file? && path.extname != ".h" + end + end + + args = %W[ + --prefix=#{prefix} + --includedir=#{include}/tcl-tk + --mandir=#{man} + --disable-zipfs + --enable-man-suffix + --enable-64bit + ] + + ENV["TCL_PACKAGE_PATH"] = "#{HOMEBREW_PREFIX}/lib" + cd "unix" do + system "./configure", *args, "--with-system-libtommath" + # Install the core first so the bundled packages' configure can run tclsh + system "make", "install-binaries" + system "make", "install" + system "make", "install-private-headers" + bin.install_symlink "tclsh#{version.to_f}" => "tclsh" + end + + # Let tk finds our new tclsh + ENV.prepend_path "PATH", bin + + resource("tk").stage do + cd "unix" do + args << "--enable-aqua=yes" if OS.mac? + system "./configure", *args, "--without-x", "--with-tcl=#{lib}" + system "make" + system "make", "install" + system "make", "install-private-headers" + bin.install_symlink "wish#{version.to_f}" => "wish" + end + end + + resource("critcl").stage do + system bin/"tclsh", "build.tcl", "install" + end + + resource("tcllib").stage do + system "./configure", "--prefix=#{prefix}", "--mandir=#{man}" + system "make", "install" + system "make", "critcl" + cp_r "modules/tcllibc", "#{lib}/" + ln_s "#{lib}/tcllibc/macosx-x86_64-clang", "#{lib}/tcllibc/macosx-x86_64" if OS.mac? + end + + resource("tcltls").stage do + system "./configure", "--with-openssl-dir=#{formula_opt_prefix("openssl@3")}", + "--prefix=#{prefix}", + "--with-tcl=#{lib}", + "--with-tclinclude=#{include}/tcl-tk", + "--includedir=#{include}/tcl-tk", + "--mandir=#{man}" + system "make", "install" + end + + resource("itk4").stage do + itcl_dir = lib.glob("itcl*").last + # Workaround to build non-release tarball by using TEA files from itcl + odie "Update `itk4` build step!" if Pathname("tclconfig").exist? + Pathname.pwd.install_symlink buildpath/"pkgs/#{itcl_dir.basename}/tclconfig" + + args = %W[ + --prefix=#{prefix} + --exec-prefix=#{prefix} + --with-tcl=#{lib} + --with-tclinclude=#{include}/tcl-tk + --with-tk=#{lib} + --with-tkinclude=#{include}/tcl-tk + --with-itcl=#{itcl_dir} + ] + system "./configure", *args + system "make" + system "make", "install" + end + + # Use the sqlite-analyzer formula instead + # https://github.com/Homebrew/homebrew-core/pull/82698 + rm bin/"sqlite3_analyzer" + end + + def caveats + <<~EOS + The sqlite3_analyzer binary is in the `sqlite-analyzer` formula. + EOS + end + + test do + assert_match "#{HOMEBREW_PREFIX}/lib", pipe_output("#{bin}/tclsh", "puts $auto_path\n") + assert_equal "honk", pipe_output("#{bin}/tclsh", "puts honk\n").chomp + + # Fails with: no display name and no $DISPLAY environment variable + return if OS.linux? && ENV["HOMEBREW_GITHUB_ACTIONS"] + + test_itk = <<~TCL + # Check that Itcl and Itk load, and that we can define, instantiate, + # and query the properties of a widget. + + + # If anything errors, just exit + catch { + package require Itcl + package require Itk + + # Define class + itcl::class TestClass { + inherit itk::Toplevel + constructor {args} { + itk_component add bye { + button $itk_interior.bye -text "Bye" + } + eval itk_initialize $args + } + } + + # Create an instance + set testobj [TestClass .#auto] + + # Check the widget has a bye component with text property "Bye" + if {[[$testobj component bye] cget -text]=="Bye"} { + puts "OK" + } + } + exit + TCL + assert_equal "OK\n", pipe_output("#{bin}/wish", test_itk), "Itk test failed" + end +end diff --git a/Formula/tdb.rb b/Formula/tdb.rb new file mode 100644 index 0000000..1b2ce5b --- /dev/null +++ b/Formula/tdb.rb @@ -0,0 +1,45 @@ +class Tdb < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "73ab9ee5b4a954338efb2cded87651f64984a2ea27b898f4b4f584a8fa3776ea" + sha256 cellar: :any, arm64_tahoe: "263f2b310f2be1f0aeb5b98357dc28c88fbb6a46d116def650e7a30c05f3608e" + sha256 cellar: :any_skip_relocation, x86_64_linux: "b07d10b7909161e804d6d707d300249a23bb86f9aee2cdf313cf92be772a1f47" + end + desc "Trivial DataBase, by the Samba project" + homepage "https://tdb.samba.org/" + url "https://www.samba.org/ftp/tdb/tdb-1.4.15.tar.gz" + sha256 "fba09d8df1f1b9072aeae8e78b2bd43c5afef20b2f6deefa633aa14a377a8dd2" + license all_of: [ + "LGPL-3.0-or-later", + "GPL-3.0-or-later", # tools/ + ] + + livecheck do + url "https://www.samba.org/ftp/tdb/" + regex(/href=.*?tdb[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + uses_from_macos "python" => :build + + conflicts_with "jena", because: "both install `tdbbackup`, `tdbdump` binaries" + + def install + system "./configure", "--bundled-libraries=NONE", + "--disable-python", + "--disable-rpath", + "--prefix=#{prefix}" + system "make", "install" + end + + test do + testdb = "test-db.tdb" + + # database creation + pipe_output("#{bin}/tdbtool", "create #{testdb}\ninsert foo bar\n", 0) + assert_path_exists testpath/testdb + assert_match "Database integrity is OK and has 1 records.", pipe_output("#{bin}/tdbtool #{testdb}", "check\n") + assert_match "key 3 bytes: foo", pipe_output("#{bin}/tdbtool #{testdb}", "keys\n") + end +end diff --git a/Formula/tevent.rb b/Formula/tevent.rb new file mode 100644 index 0000000..ffa7643 --- /dev/null +++ b/Formula/tevent.rb @@ -0,0 +1,74 @@ +class Tevent < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "cc86cdef215a345a3d4700060d47f3568f05794797fa20829cd94fc86098d9f2" + sha256 cellar: :any, arm64_tahoe: "61d735b0f3f2b5b6d4fdda58810b10dd286bd3a584f1fb3abde8285aed6b7a40" + sha256 cellar: :any, x86_64_linux: "7d46173c3b86ada8d64d36e36616de9e246204978cd726e93515db10b22ac2be" + end + desc "Event system based on the talloc memory management library" + homepage "https://tevent.samba.org" + url "https://www.samba.org/ftp/tevent/tevent-0.17.2.tar.gz" + sha256 "e53b1ac288d017d66dde0471cd429a806168ecf07179d7f019572d7a7e05f0d6" + license "LGPL-3.0-or-later" + + livecheck do + url "https://www.samba.org/ftp/tevent/" + regex(/href=.*?tevent[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "cmocka" => :build + depends_on "pkgconf" => :build + depends_on "talloc" + + uses_from_macos "python" => :build + + def install + system "./configure", "--bundled-libraries=NONE", + "--disable-python", + "--disable-rpath", + "--prefix=#{prefix}" + system "make", "install" + end + + test do + # https://tevent.samba.org/tevent_events.html#Immediate + (testpath/"test.c").write <<~C + #include + #include + #include + struct info_struct { + int counter; + }; + static void foo(struct tevent_context *ev, struct tevent_immediate *im, void *private_data) { + struct info_struct *data = talloc_get_type_abort(private_data, struct info_struct); + printf("Data value: %d\\n", data->counter); + } + int main (void) { + struct tevent_context *event_ctx; + TALLOC_CTX *mem_ctx; + struct tevent_immediate *im; + printf("INIT\\n"); + mem_ctx = talloc_new(NULL); + event_ctx = tevent_context_init(mem_ctx); + struct info_struct *data = talloc(mem_ctx, struct info_struct); + // setting up private data + data->counter = 1; + // first immediate event + im = tevent_create_immediate(mem_ctx); + if (im == NULL) { + fprintf(stderr, "FAILED\\n"); + return EXIT_FAILURE; + } + tevent_schedule_immediate(im, event_ctx, foo, data); + tevent_loop_wait(event_ctx); + talloc_free(mem_ctx); + return 0; + } + C + + system ENV.cc, "test.c", "-o", "test", "-L#{lib}", "-ltevent", "-L#{formula_opt_lib("talloc")}", "-ltalloc" + system "./test" + end +end diff --git a/Formula/tree-sitter.rb b/Formula/tree-sitter.rb new file mode 100644 index 0000000..acf9ca8 --- /dev/null +++ b/Formula/tree-sitter.rb @@ -0,0 +1,66 @@ +class TreeSitter < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "de0700ba2202f2dd9b9a19c50074dd7bd17856d853a916b8addbc50bb51c1c81" + sha256 cellar: :any, arm64_tahoe: "80d16fc3dc8a354225de3bf1eea82365a76ad5b08592780faf31b1035147719c" + sha256 cellar: :any, x86_64_linux: "05ff81adff3c4950a76674f94135ce9674103b9eb8092864a692ab9528be6e58" + end + desc "Incremental parsing library" + homepage "https://tree-sitter.github.io/" + url "https://github.com/tree-sitter/tree-sitter/archive/refs/tags/v0.26.12.tar.gz" + sha256 "428e2b182fe38eddc100d8bd851e47c96921a69281b66abafc25ba4b0aaeeeab" + license "MIT" + compatibility_version 1 + head "https://github.com/tree-sitter/tree-sitter.git", branch: "master" + + livecheck do + url :stable + regex(/^v?(\d+(?:\.\d+)+)$/i) + end + + + + def install + system "make", "install", "AMALGAMATED=1", "PREFIX=#{prefix}" + end + + def caveats + <<~EOS + This formula now installs only the `tree-sitter` library (`libtree-sitter`). + To install the CLI tool: + brew install tree-sitter-cli + EOS + end + + test do + (testpath/"test_program.c").write <<~C + #include + #include + #include + int main(int argc, char* argv[]) { + TSParser *parser = ts_parser_new(); + if (parser == NULL) { + return 1; + } + // Because we have no language libraries installed, we cannot + // actually parse a string successfully. But, we can verify + // that it can at least be attempted. + const char *source_code = "empty"; + TSTree *tree = ts_parser_parse_string( + parser, + NULL, + source_code, + strlen(source_code) + ); + if (tree == NULL) { + printf("tree creation failed"); + } + ts_tree_delete(tree); + ts_parser_delete(parser); + return 0; + } + C + system ENV.cc, "test_program.c", "-L#{lib}", "-ltree-sitter", "-o", "test_program" + assert_equal "tree creation failed", shell_output("./test_program") + end +end diff --git a/Formula/tree.rb b/Formula/tree.rb new file mode 100644 index 0000000..c158351 --- /dev/null +++ b/Formula/tree.rb @@ -0,0 +1,24 @@ +class Tree < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "ef367d0a5e74970e2f5042479fe4000a8b324ac075520c66f8457f1cb06ca668" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "d1967d2ed08717f963addb249ea6b8ca11c26ecb59efba34f2860853a06bedc7" + sha256 cellar: :any_skip_relocation, x86_64_linux: "b98eef11e53b024a3e9422fbeabeb6c9b13d70ea884087703e7e1536820b3c5c" + end + desc "Display directories as trees (with optional color/HTML output)" + homepage "https://oldmanprogrammer.net/source.php?dir=projects/tree" + url "https://github.com/Old-Man-Programmer/tree/archive/refs/tags/2.3.2.tar.gz" + sha256 "22cf32e84e3eb508d97a9e991c2c3cc006b9dcf4afed201d96311c5c57d08fcf" + license "GPL-2.0-or-later" + compatibility_version 1 + + + + def install + system "make", "install", "PREFIX=#{prefix}", "MANDIR=#{man}" + end + + test do + system bin/"tree", prefix + end +end diff --git a/Formula/unibilium.rb b/Formula/unibilium.rb new file mode 100644 index 0000000..3c92a72 --- /dev/null +++ b/Formula/unibilium.rb @@ -0,0 +1,62 @@ +class Unibilium < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "c154ef3c2f532ebb1e73372a76230d144057983813624abbad7ca85d1ce3a2b8" + sha256 cellar: :any, arm64_tahoe: "a4e4de62f7bd54a11da5b031f9c831040eef3790b9e111f40332feaea4cdd682" + sha256 cellar: :any_skip_relocation, x86_64_linux: "62bf69d2c9fe15ec8c9fe12e690befc1d8971c05b7f3f2fb890e2f4740e88798" + end + desc "Very basic terminfo library" + homepage "https://github.com/neovim/unibilium" + url "https://github.com/neovim/unibilium/archive/refs/tags/v2.1.2.tar.gz" + sha256 "370ecb07fbbc20d91d1b350c55f1c806b06bf86797e164081ccc977fc9b3af7a" + license "LGPL-3.0-or-later" + + + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + + def install + system "autoreconf", "--force", "--install", "--verbose" + system "./configure", *std_configure_args + + # Check Homebrew ncurses terminfo if available. + terminfo_dirs = [Formula["ncurses"].opt_share/"terminfo"] + + terminfo_dirs += if OS.mac? + [Utils.safe_popen_read("ncurses5.4-config", "--terminfo-dirs").strip] + else + # Unibilium's default terminfo path + %w[ + /etc/terminfo + /lib/terminfo + /usr/share/terminfo + /usr/lib/terminfo + /usr/local/share/terminfo + /usr/local/lib/terminfo + ] + end + + system "make", "TERMINFO_DIRS=\"#{terminfo_dirs.join(":")}\"" + system "make", "install", "PREFIX=#{prefix}" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + + int main() + { + setvbuf(stdout, NULL, _IOLBF, 0); + unibi_term *ut = unibi_dummy(); + unibi_destroy(ut); + printf("%s", unibi_terminfo_dirs); + return 0; + } + C + system ENV.cc, "-I#{include}", "test.c", "-L#{lib}", "-lunibilium", "-o", "test" + assert_match %r{\A#{Formula["ncurses"].opt_share}/terminfo:}o, shell_output("./test") + end +end diff --git a/Formula/utf8proc.rb b/Formula/utf8proc.rb new file mode 100644 index 0000000..5847cfc --- /dev/null +++ b/Formula/utf8proc.rb @@ -0,0 +1,41 @@ +class Utf8proc < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 1 + sha256 cellar: :any, arm64_sequoia: "3e044d7b72b8fbf7d260cd9a1145cccc32e5f1ad4c93ff7d3cb0e4bd04fa5b37" + sha256 cellar: :any, arm64_tahoe: "f3b03f1fb1f7da91b28d6b7edb0a8ff056378b689e5c904877dfb6d1cb9da5fc" + sha256 cellar: :any_skip_relocation, x86_64_linux: "c44de6245cc5167aa4ec1b8c56d2d2e60378e421db4768a9842283a7602d2561" + end + desc "Clean C library for processing UTF-8 Unicode data" + homepage "https://juliastrings.github.io/utf8proc/" + url "https://github.com/JuliaStrings/utf8proc/archive/refs/tags/v2.11.3.tar.gz" + sha256 "abfed50b6d4da51345713661370290f4f4747263ee73dc90356299dfc7990c78" + license all_of: ["MIT", "Unicode-DFS-2015"] + compatibility_version 1 + head "https://github.com/JuliaStrings/utf8proc.git", branch: "master" + + + + depends_on "cmake" => :build + + def install + system "cmake", "-S", ".", "-B", "build", "-DBUILD_SHARED_LIBS=ON", *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + (testpath/"test.c").write <<~C + #include + #include + + int main() { + const char *version = utf8proc_version(); + return strnlen(version, sizeof("1.3.1-dev")) > 0 ? 0 : -1; + } + C + + system ENV.cc, "test.c", "-I#{include}", "-L#{lib}", "-lutf8proc", "-o", "test" + system "./test" + end +end diff --git a/Formula/util-linux.rb b/Formula/util-linux.rb new file mode 100644 index 0000000..19045fb --- /dev/null +++ b/Formula/util-linux.rb @@ -0,0 +1,143 @@ +class UtilLinux < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "190141242ffdeb5cf236a3b040342097019fce761e655a4c5a12eae18591d628" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "3b2174542f34178348f62bccf804a06d8a1adb3dbd6767ce6b01fd618d63f9db" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "2508e06eafa3451e885cc7bdfd6af035bf1aee5a7af090c22d5f4c6474f3fa50" + end + desc "Collection of Linux utilities" + homepage "https://github.com/util-linux/util-linux" + url "https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/v2.42/util-linux-2.42.2.tar.xz" + sha256 "03a05d3adf9602ef128f2da05b84b3205ce60c351e5737c0370f74000679ce8a" + license all_of: [ + "BSD-3-Clause", + "BSD-4-Clause-UC", + "GPL-2.0-only", + "GPL-2.0-or-later", + "GPL-3.0-or-later", + "LGPL-2.1-or-later", + :public_domain, + ] + compatibility_version 1 + + # The directory listing where the `stable` archive is found uses major/minor + # version directories, where it's necessary to check inside a directory to + # find the full version. The newest directory can contain unstable versions, + # so it could require more than two requests to identify the newest stable + # version. With this in mind, we simply check the Git tags as a best effort. + livecheck do + url :homepage + regex(/^v?(\d+(?:\.\d+)+)$/i) + end + + + + keg_only :shadowed_by_macos, "macOS provides the uuid.h header" + + depends_on "pkgconf" => :build + + uses_from_macos "libxcrypt" + uses_from_macos "ncurses" + uses_from_macos "sqlite" + + on_macos do + depends_on "gettext" # for libintl + end + + on_linux do + depends_on "readline" + depends_on "zlib-ng-compat" + + conflicts_with "bash-completion", because: "both install `mount`, `rfkill`, and `rtcwake` completions" + conflicts_with "flock", because: "both install `flock` binaries" + conflicts_with "ossp-uuid", because: "both install `uuid.3` file" + conflicts_with "rename", because: "both install `rename` binaries" + end + + # Fix macOS builds + patch do + url "https://github.com/util-linux/util-linux/commit/d22edc2f100eb8dd83d3515758565cb73b0d2eed.patch?full_index=1" + sha256 "2fb01154faa3fd8b0fce27eb88049ed9c8f839e706e412399c19c087f7f3b5e1" + type :unofficial + resolves "https://github.com/util-linux/util-linux/pull/4173" + end + + def install + args = %W[--disable-silent-rules --disable-asciidoc --with-bashcompletiondir=#{bash_completion}] + + if OS.mac? + # Support very old ncurses used on macOS 13 and earlier + # https://github.com/util-linux/util-linux/issues/2389 + ENV.append_to_cflags "-D_XOPEN_SOURCE_EXTENDED" if MacOS.version <= :ventura + + args << "--disable-bits" # does not build on macOS + args << "--disable-ipcs" # does not build on macOS + args << "--disable-ipcrm" # does not build on macOS + args << "--disable-wall" # already comes with macOS + args << "--disable-liblastlog2" # does not build on macOS + args << "--disable-libmount" # does not build on macOS + args << "--enable-libuuid" # conflicts with ossp-uuid + else + args << "--disable-use-tty-group" # Fix chgrp: changing group of 'wall': Operation not permitted + args << "--disable-kill" # Conflicts with coreutils. + args << "--without-systemd" # Do not install systemd files + args << "--disable-chfn-chsh" + args << "--disable-login" + args << "--disable-su" + args << "--disable-runuser" + args << "--disable-makeinstall-chown" + args << "--disable-makeinstall-setuid" + args << "--without-python" + end + + system "./configure", *args, *std_configure_args + + install_args = [] + install_args << "LDFLAGS=-lm" if OS.linux? + system "make", "install", *install_args + end + + def caveats + linux_only_bins = %w[ + addpart agetty + blkdiscard blkzone blockdev + chcpu chmem choom chrt ctrlaltdel + delpart dmesg + eject + fallocate fdformat fincore findmnt fsck fsfreeze fstrim + hwclock + ionice ipcrm ipcs + kill + last ldattach losetup lsblk lscpu lsipc lslocks lslogins lsmem lsns + mount mountpoint + nsenter + partx pivot_root prlimit + raw readprofile resizepart rfkill rtcwake + script scriptlive setarch setterm sulogin swapoff swapon switch_root + taskset + umount unshare utmpdump uuidd + wall wdctl + zramctl + ] + on_macos do + <<~EOS + The following tools are not supported for macOS, and are therefore not included: + #{Formatter.columns(linux_only_bins)} + EOS + end + end + + test do + stat = File.stat "/usr" + owner = Etc.getpwuid(stat.uid).name + group = Etc.getgrgid(stat.gid).name + + flags = ["x", "w", "r"] * 3 + perms = flags.each_with_index.reduce("") do |sum, (flag, index)| + sum.insert 0, (stat.mode.nobits?(2 ** index) ? "-" : flag) + end + + out = shell_output("#{bin}/namei -lx /usr").split("\n").last.split + assert_equal ["d#{perms}", owner, group, "usr"], out + end +end diff --git a/Formula/uvwasi.rb b/Formula/uvwasi.rb new file mode 100644 index 0000000..87cefbf --- /dev/null +++ b/Formula/uvwasi.rb @@ -0,0 +1,92 @@ +class Uvwasi < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 1 + sha256 cellar: :any, arm64_sequoia: "3bbe2380eb184f540f5b23a9cd2f92ef21a4779b04ff6068b6c3a0b4e7865c7e" + sha256 cellar: :any, arm64_tahoe: "c2742f168c40ecdcf97566b4bbca3419dc010995edbd25fd2805c45cccbe11fd" + sha256 cellar: :any_skip_relocation, x86_64_linux: "2befd108f0cf4fffab4832dc834e0b7c4b8aec470ad95994435792c6b3ab9bcc" + end + desc "WASI syscall API built atop libuv" + homepage "https://github.com/nodejs/uvwasi" + url "https://github.com/nodejs/uvwasi/archive/refs/tags/v0.0.23.tar.gz" + sha256 "cdb148aac298883b51da887657deca910c7c02f35435e24f125cef536fe8d5e1" + license "MIT" + compatibility_version 1 + head "https://github.com/nodejs/uvwasi.git", branch: "main" + + + + depends_on "cmake" => :build + depends_on "libuv" + + # Remove find_dependency for a not-installed module in CMake config + patch do + url "https://github.com/nodejs/uvwasi/commit/fcc0be004867939389aba3cc715ea90b86ab869c.patch?full_index=1" + sha256 "4a3a388e9831709089270b7c6bc779d86257857192dee247d32ec360cd7819cc" + type :unofficial + resolves "https://github.com/nodejs/uvwasi/pull/313" + end + + def install + system "cmake", "-S", ".", "-B", "build", *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + end + + test do + # Adapted from "Example Usage" in README. + (testpath/"test-uvwasi.c").write <<~C + #include + #include + #include "uv.h" + #include "uvwasi.h" + + int main(void) { + uvwasi_t uvwasi; + uvwasi_options_t init_options; + uvwasi_errno_t err; + + memset(&init_options, 0, sizeof(init_options)); + + /* Setup the initialization options. */ + init_options.in = 0; + init_options.out = 1; + init_options.err = 2; + init_options.fd_table_size = 4; + + init_options.argc = 1; + init_options.argv = calloc(init_options.argc, sizeof(char*)); + init_options.argv[0] = strdup("test-uvwasi"); + + init_options.envp = calloc(1, sizeof(char*)); + init_options.envp[0] = NULL; + + init_options.preopenc = 1; + init_options.preopens = calloc(1, sizeof(uvwasi_preopen_t)); + init_options.preopens[0].mapped_path = strdup("/sandbox"); + init_options.preopens[0].real_path = strdup("/tmp"); + + init_options.allocator = NULL; + + /* Initialize the sandbox. */ + err = uvwasi_init(&uvwasi, &init_options); + + if (err != UVWASI_ESUCCESS) { + fprintf(stderr, "uvwasi_init() failed: %d\\n", err); + return 1; + } + + /* Clean up resources. */ + uvwasi_destroy(&uvwasi); + return 0; + } + C + + ENV.append_to_cflags "-I#{include} -I#{formula_opt_include("libuv")}" + ENV.append "LDFLAGS", "-L#{lib}" + ENV.append "LDLIBS", "-luvwasi" + + system "make", "test-uvwasi" + system "./test-uvwasi" + end +end diff --git a/Formula/webp.rb b/Formula/webp.rb new file mode 100644 index 0000000..ab4a827 --- /dev/null +++ b/Formula/webp.rb @@ -0,0 +1,49 @@ +class Webp < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "ad74e4538a799bc21e85fb2899c2267f7b6c8761212d195ec3cb3583062ad19e" + sha256 cellar: :any, arm64_tahoe: "11a19ac5db13a8485d4d6f712d65d48531f99e8d7237407ab42718777eefacb3" + sha256 cellar: :any_skip_relocation, x86_64_linux: "5520d52bce6d837491accd768420cb44e9c64b6bcd4063817668fd5245fc9cfc" + end + desc "Image format providing lossless and lossy compression for web images" + homepage "https://developers.google.com/speed/webp/" + url "https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.6.0.tar.gz" + sha256 "e4ab7009bf0629fd11982d4c2aa83964cf244cffba7347ecd39019a9e38c4564" + license "BSD-3-Clause" + compatibility_version 1 + head "https://chromium.googlesource.com/webm/libwebp.git", branch: "main" + + livecheck do + url "https://developers.google.com/speed/webp/docs/compiling" + regex(/libwebp[._-]v?(\d+(?:\.\d+)+)\.t/i) + end + + + + depends_on "cmake" => :build + depends_on "giflib" + depends_on "jpeg-turbo" + depends_on "libpng" + + def install + args = %W[ + -DCMAKE_INSTALL_RPATH=#{rpath} + -DCMAKE_DISABLE_FIND_PACKAGE_TIFF=ON + ] + system "cmake", "-S", ".", "-B", "build", *std_cmake_args, "-DBUILD_SHARED_LIBS=ON", *args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + system "cmake", "-S", ".", "-B", "static", *std_cmake_args, "-DBUILD_SHARED_LIBS=OFF", *args + system "cmake", "--build", "static" + lib.install buildpath.glob("static/*.a") + + # Avoid rebuilding dependents that hard-code the prefix. + inreplace (lib/"pkgconfig").glob("*.pc"), prefix, opt_prefix + end + + test do + system bin/"cwebp", test_fixtures("test.png"), "-o", "webp_test.png" + system bin/"dwebp", "webp_test.png", "-o", "webp_test.webp" + assert_path_exists testpath/"webp_test.webp" + end +end diff --git a/Formula/wget.rb b/Formula/wget.rb new file mode 100644 index 0000000..102607c --- /dev/null +++ b/Formula/wget.rb @@ -0,0 +1,60 @@ +class Wget < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + rebuild 2 + sha256 cellar: "/opt/homebrew/Cellar", arm64_sequoia: "aa19cf5de262d5b67631af8288cce233a075c251c68050a1e73699314a911e7b" + sha256 cellar: "/opt/homebrew/Cellar", arm64_tahoe: "27e15ca14afaaa7c2016bba7a098452cf66d1d8a74330ed6195a0b6ae7a4dada" + sha256 cellar: "/home/linuxbrew/.linuxbrew/Cellar", x86_64_linux: "8f58b44e7482ee12e910df582cf43a4dadb808e4db70bfc760aaf258942652a5" + end + desc "Internet file retriever" + homepage "https://www.gnu.org/software/wget/" + url "https://ftpmirror.gnu.org/gnu/wget/wget-1.25.0.tar.gz" + sha256 "766e48423e79359ea31e41db9e5c289675947a7fcf2efdcedb726ac9d0da3784" + license "GPL-3.0-or-later" + compatibility_version 1 + + + + head do + url "https://git.savannah.gnu.org/git/wget.git", branch: "master" + + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "xz" => :build + end + + depends_on "pkgconf" => :build + depends_on "libidn2" + depends_on "libpsl" + depends_on "openssl@3" + + on_macos do + depends_on "gettext" + depends_on "libunistring" + end + + on_linux do + depends_on "util-linux" + depends_on "zlib-ng-compat" + end + + def install + system "./bootstrap", "--skip-po" if build.head? + system "./configure", "--prefix=#{prefix}", + "--sysconfdir=#{etc}", + "--with-ssl=openssl", + "--with-libssl-prefix=#{formula_opt_prefix("openssl@3")}", + "--disable-pcre", + "--disable-pcre2", + "--with-libpsl", + "--without-included-regex" + system "make", "install" + end + + test do + system bin/"wget", "-O", File::NULL, "https://google.com" + + # Verify PSL support is built in via libpsl + assert_match "+psl", shell_output("#{bin}/wget --version") + end +end diff --git a/Formula/x264.rb b/Formula/x264.rb new file mode 100644 index 0000000..ce02ee9 --- /dev/null +++ b/Formula/x264.rb @@ -0,0 +1,89 @@ +class X264 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "a613d44ead5d3999270970f41283eadfad8001061faf063945def6b8fb5145f4" + sha256 cellar: :any, arm64_tahoe: "b631667b5ad55c6c3ae383484f658c5b4ba14da8a2fbb1d537975695852529ca" + sha256 cellar: :any_skip_relocation, x86_64_linux: "4ec18379e16e4e5fd740518dd8964472392725b10dcde1e726f02a34bcba813e" + end + desc "H.264/AVC encoder" + homepage "https://www.videolan.org/developers/x264.html" + # the latest commit on the stable branch + url "https://code.videolan.org/videolan/x264.git", + revision: "b35605ace3ddf7c1a5d67a2eb553f034aef41d55" + version "r3222" + license "GPL-2.0-or-later" + compatibility_version 1 + head "https://code.videolan.org/videolan/x264.git", branch: "master" + + # Cross-check the abbreviated commit hashes from the release filenames with + # the latest commits in the `stable` Git branch: + # https://code.videolan.org/videolan/x264/-/commits/stable + livecheck do + url "https://artifacts.videolan.org/x264/release-macos-arm64/" + regex(%r{href=.*?x264[._-](r\d+)[._-]([\da-z]+)/?["' >]}i) + strategy :page_match do |page, regex| + # Match the version and abbreviated commit hash in filenames + matches = page.scan(regex) + + # Fetch the `stable` Git branch Atom feed + stable_page_data = Homebrew::Livecheck::Strategy.page_content("https://code.videolan.org/videolan/x264/-/commits/stable?format=atom") + next if stable_page_data[:content].blank? + + # Extract commit hashes from the feed content + commit_hashes = stable_page_data[:content].scan(%r{/commit/([\da-z]+)}i).flatten + next if commit_hashes.blank? + + # Only keep versions with a matching commit hash in the `stable` branch + matches.map do |match| + release_hash = match[1] + commit_in_stable = commit_hashes.any? do |commit_hash| + commit_hash.start_with?(release_hash) + end + + match[0] if commit_in_stable + end + end + end + + no_autobump! because: :incompatible_version_format + + + + on_intel do + depends_on "nasm" => :build + end + + def install + args = %W[ + --prefix=#{prefix} + --disable-lsmash + --disable-swscale + --disable-ffms + --enable-shared + --enable-static + --enable-strip + ] + + system "./configure", *args + system "make", "install" + end + + test do + assert_match version.to_s.delete("r"), shell_output("#{bin}/x264 --version").lines.first + (testpath/"test.c").write <<~C + #include + #include + + int main() + { + x264_picture_t pic; + x264_picture_init(&pic); + x264_picture_alloc(&pic, 1, 1, 1); + x264_picture_clean(&pic); + return 0; + } + C + system ENV.cc, "-L#{lib}", "test.c", "-lx264", "-o", "test" + system "./test" + end +end diff --git a/Formula/x265.rb b/Formula/x265.rb new file mode 100644 index 0000000..d645acd --- /dev/null +++ b/Formula/x265.rb @@ -0,0 +1,90 @@ +class X265 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "29300af7c34c7bc5fd84549b2e0173909026c264060d56bf6d35d79da3808506" + sha256 cellar: :any, arm64_tahoe: "ee3075f8af9807bdb30a890b22c1e948a5930f6001c7123eb57faa87c4d15c85" + sha256 cellar: :any_skip_relocation, x86_64_linux: "828f429ad04ef1e539d1539de78b84e3c10c295edee9b512ba64e8d029abf0d1" + end + desc "H.265/HEVC encoder" + homepage "https://bitbucket.org/multicoreware/x265_git" + url "https://bitbucket.org/multicoreware/x265_git/downloads/x265_4.2.tar.gz" + sha256 "40b1ea0453e0309f0eba934e0ddf533f8f6295966679e8894e8f1c1c8d5e1210" + license "GPL-2.0-or-later" + compatibility_version 1 + head "https://bitbucket.org/multicoreware/x265_git.git", branch: "master" + + + + depends_on "cmake" => :build + + on_intel do + depends_on "nasm" => :build + end + + def install + ENV.runtime_cpu_detection + # Build based off the script at ./build/linux/multilib.sh + args = %W[ + -DLINKED_10BIT=ON + -DLINKED_12BIT=ON + -DEXTRA_LINK_FLAGS=-L. + -DEXTRA_LIB=x265_main10.a;x265_main12.a + -DCMAKE_INSTALL_RPATH=#{rpath} + ] + args << "-DENABLE_SVE2=OFF" if OS.linux? && Hardware::CPU.arm? + high_bit_depth_args = %w[ + -DHIGH_BIT_DEPTH=ON -DEXPORT_C_API=OFF + -DENABLE_SHARED=OFF -DENABLE_CLI=OFF + ] + high_bit_depth_args << "-DENABLE_SVE2=OFF" if OS.linux? && Hardware::CPU.arm? + + (buildpath/"8bit").mkpath + system "cmake", "-S", buildpath/"source", "-B", "10bit", + "-DENABLE_HDR10_PLUS=ON", + *high_bit_depth_args, + *std_cmake_args + system "cmake", "--build", "10bit" + mv "10bit/libx265.a", buildpath/"8bit/libx265_main10.a" + + system "cmake", "-S", buildpath/"source", "-B", "12bit", + "-DMAIN12=ON", + *high_bit_depth_args, + *std_cmake_args + system "cmake", "--build", "12bit" + mv "12bit/libx265.a", buildpath/"8bit/libx265_main12.a" + + system "cmake", "-S", buildpath/"source", "-B", "8bit", *args, *std_cmake_args + system "cmake", "--build", "8bit" + + cd "8bit" do + mv "libx265.a", "libx265_main.a" + + if OS.mac? + system "libtool", "-static", "-o", "libx265.a", "libx265_main.a", + "libx265_main10.a", "libx265_main12.a" + else + system "ar", "cr", "libx265.a", "libx265_main.a", "libx265_main10.a", + "libx265_main12.a" + system "ranlib", "libx265.a" + end + + system "make", "install" + end + end + + test do + resource "homebrew-test_video" do + url "https://raw.githubusercontent.com/fraunhoferhhi/vvenc/master/test/data/RTn23_80x44p15_f15.yuv" + sha256 "ecd2ef466dd2975f4facc889e0ca128a6bea6645df61493a96d8e7763b6f3ae9" + end + + resource("homebrew-test_video").stage testpath + yuv_path = testpath/"RTn23_80x44p15_f15.yuv" + x265_path = testpath/"x265.265" + system bin/"x265", "--input-res", "360x640", "--fps", "60", "--input", yuv_path, "-o", x265_path + header = "AAAAAUABDAH//w==" + assert_equal header.unpack("m"), [x265_path.read(10)] + + assert_match "version #{version}", shell_output("#{bin}/x265 -V 2>&1") + end +end diff --git a/Formula/xorgproto.rb b/Formula/xorgproto.rb new file mode 100644 index 0000000..6621465 --- /dev/null +++ b/Formula/xorgproto.rb @@ -0,0 +1,40 @@ +class Xorgproto < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "c65163b3daadd9160d9e2ba92f0541800577833c6b06b50c10aab69c1ce38f25" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "c65163b3daadd9160d9e2ba92f0541800577833c6b06b50c10aab69c1ce38f25" + sha256 cellar: :any_skip_relocation, x86_64_linux: "22b221145e4420b8d0444ff4699d93726fc20c63ec1c789b41acf35075174a6d" + end + desc "X.Org: Protocol Headers" + homepage "https://www.x.org/" + url "https://xorg.freedesktop.org/archive/individual/proto/xorgproto-2025.1.tar.gz" + sha256 "d6f89f65bafb8c9b735e0515882b8a1511e8e864dde5e9513e191629369f2256" + license "MIT" + compatibility_version 1 + + livecheck do + url :stable + regex(/href=.*?xorgproto[._-]v?(\d+\.\d+(?:\.([0-8]\d*?)?\d(?:\.\d+)*)?)\.t/i) + end + + + + depends_on "pkgconf" => [:build, :test] + depends_on "util-macros" => :build + + def install + args = %W[ + --sysconfdir=#{etc} + --localstatedir=#{var} + --disable-silent-rules + ] + + system "./configure", *args, *std_configure_args + system "make", "install" + end + + test do + assert_equal "-I#{include}", shell_output("pkg-config --cflags xproto").chomp + assert_equal "-I#{include}/X11/dri", shell_output("pkg-config --cflags xf86driproto").chomp + end +end diff --git a/Formula/z3.rb b/Formula/z3.rb new file mode 100644 index 0000000..2147b97 --- /dev/null +++ b/Formula/z3.rb @@ -0,0 +1,77 @@ +class Z3 < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any, arm64_sequoia: "08478660968932e8353796d24fee205a57321a4945d48991e8f82dae723d97a3" + sha256 cellar: :any, arm64_tahoe: "ee99aab378c77dfd90c002bcceb28164c1c78d9705df789151e781dfa26f0177" + sha256 cellar: :any, x86_64_linux: "3cbce2db8b73bd7095b0ad82606a338e4ef7c262f0d6e6f182c32141d53f9ac2" + end + desc "High-performance theorem prover" + homepage "https://github.com/Z3Prover/z3" + url "https://github.com/Z3Prover/z3/archive/refs/tags/z3-4.16.0.tar.gz" + sha256 "c68c3e5e4810b16126b8cb4c47eee85c1ac3e24a81914c8e371b40de9dd33ac7" + license "MIT" + compatibility_version 2 + head "https://github.com/Z3Prover/z3.git", branch: "master" + + livecheck do + url :stable + regex(/z3[._-]v?(\d+(?:\.\d+)+)/i) + strategy :github_latest + end + + + + depends_on "cmake" => :build + # Has Python bindings but are supplementary to the main library + # which does not need Python. + depends_on "python@3.14" => [:build, :test] + + # The following macOS conditional should be the inverse of LLVM's Z3 conditional + on_ventura :or_older do + fails_with :clang do + cause "Requires C++20 std::format, https://developer.apple.com/xcode/cpp/#c++20" + end + end + + fails_with :gcc do + version "12" + cause "Requires C++20 std::format, https://gcc.gnu.org/gcc-13/changes.html#libstdcxx" + end + + def python3 + which("python3.14") + end + + def install + args = %W[ + -DZ3_LINK_TIME_OPTIMIZATION=ON + -DZ3_INCLUDE_GIT_DESCRIBE=OFF + -DZ3_INCLUDE_GIT_HASH=OFF + -DZ3_INSTALL_PYTHON_BINDINGS=ON + -DZ3_BUILD_EXECUTABLE=ON + -DZ3_BUILD_TEST_EXECUTABLES=OFF + -DZ3_BUILD_PYTHON_BINDINGS=ON + -DZ3_BUILD_DOTNET_BINDINGS=OFF + -DZ3_BUILD_JAVA_BINDINGS=OFF + -DZ3_USE_LIB_GMP=OFF + -DPYTHON_EXECUTABLE=#{python3} + -DCMAKE_INSTALL_PYTHON_PKG_DIR=#{Language::Python.site_packages(python3)} + ] + + system "cmake", "-S", ".", "-B", "build", *args, *std_cmake_args + system "cmake", "--build", "build" + system "cmake", "--install", "build" + + system "make", "-C", "contrib/qprofdiff" + bin.install "contrib/qprofdiff/qprofdiff" + + pkgshare.install "examples" + end + + test do + system ENV.cc, pkgshare/"examples/c/test_capi.c", "-I#{include}", + "-L#{lib}", "-lz3", "-o", testpath/"test" + system "./test" + assert_equal version.to_s, shell_output("#{python3} -c 'import z3; print(z3.get_version_string())'").strip + end +end diff --git a/Formula/zoxide.rb b/Formula/zoxide.rb new file mode 100644 index 0000000..a9f338d --- /dev/null +++ b/Formula/zoxide.rb @@ -0,0 +1,30 @@ +class Zoxide < Formula + bottle do + root_url "https://homebrew.hyprnet/bottles" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "9547dc2a1830e3900f7915b47ac7fa42a3d2d5ee9b125007e7e860920d0e899f" + sha256 cellar: :any_skip_relocation, arm64_tahoe: "dc0c0099a4fa529d296ccb9e295e1816ded39a89ab816ba7fccec2e739f46974" + sha256 cellar: :any, x86_64_linux: "2c8a3b3c72267d9ecc0ba764e9338ce6da34dd8eaeb828743f025c9d1c94befa" + end + desc "Shell extension to navigate your filesystem faster" + homepage "https://github.com/ajeetdsouza/zoxide" + url "https://github.com/ajeetdsouza/zoxide/archive/refs/tags/v0.10.0.tar.gz" + sha256 "4fcd4272b013a10b637dbcc299c58a9924b94470a9042677ca1a204cc2e9150e" + license "MIT" + + + + depends_on "rust" => :build + + def install + system "cargo", "install", *std_cargo_args + bash_completion.install "contrib/completions/zoxide.bash" => "zoxide" + zsh_completion.install "contrib/completions/_zoxide" + fish_completion.install "contrib/completions/zoxide.fish" + share.install "man" + end + + test do + assert_empty shell_output("#{bin}/zoxide add /").strip + assert_equal "/", shell_output("#{bin}/zoxide query").strip + end +end diff --git a/README.md b/README.md index b346ac0..b4eb8de 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ Mirrored packages from upstream Homebrew taps, served from this repository. - Bottles: https://homebrew.hyprnet/bottles - Casks: https://homebrew.hyprnet/cask -- Formulas mirrored: 15 -- Casks mirrored: 2 +- Formulas mirrored: 167 +- Casks mirrored: 5 ## Usage diff --git a/manifest.json b/manifest.json index f7a18a1..4954f74 100644 --- a/manifest.json +++ b/manifest.json @@ -1,9 +1,37 @@ { - "generated": "2026-08-08T15:47:58.196213912Z", + "generated": "2026-08-09T17:10:54.047906821Z", "domain": "homebrew.hyprnet", "bottle_base_url": "https://homebrew.hyprnet/bottles", "cask_base_url": "https://homebrew.hyprnet/cask", "formulas": { + "acl": { + "version": "2.4.0", + "targets": [ + "x86_64_linux" + ] + }, + "ada-url": { + "version": "4.0.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "alsa-lib": { + "version": "1.2.16.1", + "targets": [ + "x86_64_linux" + ] + }, + "aom": { + "version": "3.14.1", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, "atuin": { "version": "18.19.0", "targets": [ @@ -12,6 +40,39 @@ "x86_64_linux" ] }, + "brotli": { + "version": "1.2.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "c-ares": { + "version": "1.34.8", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "cairo": { + "version": "1.18.4", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "cffi": { + "version": "2.1.1", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "sequoia", + "x86_64_linux" + ] + }, "clang-format": { "version": "22.1.8", "targets": [ @@ -20,6 +81,14 @@ "x86_64_linux" ] }, + "cloc": { + "version": "2.10", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, "conan": { "version": "2.31.2", "targets": [ @@ -28,6 +97,603 @@ "x86_64_linux" ] }, + "cryptography": { + "version": "50.0.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "dav1d": { + "version": "1.5.4", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "dbus": { + "version": "1.16.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "docker-compose": { + "version": "5.4.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "ffmpeg": { + "version": "8.1.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "flac": { + "version": "1.5.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "fmt": { + "version": "12.2.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "fontconfig": { + "version": "2.18.3", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "freetype": { + "version": "2.14.3", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "fribidi": { + "version": "1.0.16", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "fzf": { + "version": "0.74.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "gettext": { + "version": "1.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "giflib": { + "version": "6.1.3", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "git": { + "version": "2.55.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "glib": { + "version": "2.88.3", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "gmp": { + "version": "6.3.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "sequoia", + "x86_64_linux" + ] + }, + "gnupg": { + "version": "2.5.21", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "gnutls": { + "version": "3.8.13", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "graphite2": { + "version": "1.3.15", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "harfbuzz": { + "version": "14.3.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "hdrhistogram_c": { + "version": "0.11.10", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "hermes-agent": { + "version": "2026.8.3", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "icu4c@78": { + "version": "78.3", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "iperf3": { + "version": "3.21", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "jpeg-turbo": { + "version": "3.2.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "json-c": { + "version": "0.19", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "keyutils": { + "version": "1.6.3", + "targets": [ + "x86_64_linux" + ] + }, + "krb5": { + "version": "1.22.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "lame": { + "version": "4.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libassuan": { + "version": "3.0.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libavif": { + "version": "1.4.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libcap": { + "version": "2.78", + "targets": [ + "x86_64_linux" + ] + }, + "libffi": { + "version": "3.8.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libgcrypt": { + "version": "1.12.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libgpg-error": { + "version": "1.61", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libidn2": { + "version": "2.3.8", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libimagequant": { + "version": "4.4.1", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libksba": { + "version": "1.8.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "liblinear": { + "version": "2.50", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libnghttp2": { + "version": "1.70.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libnghttp3": { + "version": "1.18.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libngtcp2": { + "version": "1.25.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libnsl": { + "version": "2.0.1", + "targets": [ + "x86_64_linux" + ] + }, + "libogg": { + "version": "1.3.6", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libpng": { + "version": "1.6.58", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libpsl": { + "version": "0.23.1", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libraqm": { + "version": "0.11.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libsecret": { + "version": "0.21.7", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libsndfile": { + "version": "1.2.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libsoxr": { + "version": "0.1.3", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libssh2": { + "version": "1.11.1", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "sequoia", + "x86_64_linux" + ] + }, + "libtasn1": { + "version": "4.21.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libtiff": { + "version": "4.7.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libtirpc": { + "version": "1.3.7", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libtommath": { + "version": "1.3.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libtool": { + "version": "2.6.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "sequoia", + "x86_64_linux" + ] + }, + "libunistring": { + "version": "1.4.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libusb": { + "version": "1.0.30", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libuv": { + "version": "1.52.1", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libvmaf": { + "version": "3.2.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libvorbis": { + "version": "1.3.7", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libvpx": { + "version": "1.16.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libx11": { + "version": "1.8.13", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libxau": { + "version": "1.0.12", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libxcb": { + "version": "1.17.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libxcrypt": { + "version": "4.5.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libxcursor": { + "version": "1.2.3", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libxdmcp": { + "version": "1.1.5", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libxext": { + "version": "1.3.7", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libxfixes": { + "version": "6.0.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libxi": { + "version": "1.8.3", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libxrandr": { + "version": "1.5.5", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libxrender": { + "version": "0.9.12", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libxscrnsaver": { + "version": "1.2.5", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "libxtst": { + "version": "1.2.5", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, "libyaml": { "version": "0.2.5", "targets": [ @@ -36,6 +702,70 @@ "x86_64_linux" ] }, + "little-cms2": { + "version": "2.19", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "llhttp": { + "version": "9.4.3", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "llvm": { + "version": "22.1.8", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "lmdb": { + "version": "1.0.1", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "lpeg": { + "version": "1.1.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "lua": { + "version": "5.5.1", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "luajit": { + "version": "2.1.1785763465", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "luv": { + "version": "1.52.1-0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, "lz4": { "version": "1.10.0", "targets": [ @@ -45,6 +775,38 @@ "x86_64_linux" ] }, + "lzo": { + "version": "2.10", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "m4": { + "version": "1.4.21", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "sequoia", + "x86_64_linux" + ] + }, + "mactop": { + "version": "2.1.5", + "targets": [ + "arm64_sequoia", + "arm64_tahoe" + ] + }, + "merve": { + "version": "1.2.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, "mpdecimal": { "version": "4.0.1", "targets": [ @@ -54,6 +816,111 @@ "x86_64_linux" ] }, + "mpg123": { + "version": "1.33.7", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "nbytes": { + "version": "0.1.4", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "ncdu": { + "version": "2.9.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "ncurses": { + "version": "6.6", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "neovim": { + "version": "0.12.4", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "nettle": { + "version": "4.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "ninja": { + "version": "1.13.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "sequoia", + "x86_64_linux" + ] + }, + "nmap": { + "version": "7.991", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "node": { + "version": "26.7.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "npth": { + "version": "1.8", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "opencode": { + "version": "1.18.15", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "openjdk@17": { + "version": "17.0.20", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "openjpeg": { + "version": "2.5.4", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, "openssl@3": { "version": "3.6.3", "targets": [ @@ -63,6 +930,130 @@ "x86_64_linux" ] }, + "openssl@4": { + "version": "4.0.1", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "opus": { + "version": "1.6.1", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "orc": { + "version": "0.4.42", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "p11-kit": { + "version": "0.26.5", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "pcre2": { + "version": "10.47", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "sequoia", + "x86_64_linux" + ] + }, + "pillow": { + "version": "12.3.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "pinentry": { + "version": "1.3.3", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "pixman": { + "version": "0.46.4", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "pkgconf": { + "version": "3.0.5", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "sequoia", + "x86_64_linux" + ] + }, + "popt": { + "version": "1.19", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "pulseaudio": { + "version": "17.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "pydantic": { + "version": "2.13.4", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "python-tk@3.14": { + "version": "3.14.6", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "python@3.12": { + "version": "3.12.13", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "sequoia", + "x86_64_linux" + ] + }, + "python@3.13": { + "version": "3.13.15", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "sequoia", + "x86_64_linux" + ] + }, "python@3.14": { "version": "3.14.6", "targets": [ @@ -72,6 +1063,14 @@ "x86_64_linux" ] }, + "qwen-code": { + "version": "0.21.7", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, "readline": { "version": "8.3.3", "targets": [ @@ -81,6 +1080,62 @@ "x86_64_linux" ] }, + "ripgrep": { + "version": "15.2.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "samba": { + "version": "4.24.5", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "sdl2-compat": { + "version": "2.32.70", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "sdl3": { + "version": "3.4.14", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "simdjson": { + "version": "4.6.6", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "simdutf": { + "version": "9.0.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "speexdsp": { + "version": "1.2.1", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, "sqlite": { "version": "3.53.4", "targets": [ @@ -90,6 +1145,140 @@ "x86_64_linux" ] }, + "svt-av1": { + "version": "4.2.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "systemd": { + "version": "261.2", + "targets": [ + "x86_64_linux" + ] + }, + "talloc": { + "version": "2.5.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "tcl-tk": { + "version": "9.0.4", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "tdb": { + "version": "1.4.15", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "tevent": { + "version": "0.17.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "tree": { + "version": "2.3.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "tree-sitter": { + "version": "0.26.12", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "unibilium": { + "version": "2.1.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "utf8proc": { + "version": "2.11.3", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "util-linux": { + "version": "2.42.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "uvwasi": { + "version": "0.0.23", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "webp": { + "version": "1.6.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "wget": { + "version": "1.25.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "x264": { + "version": "r3222", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "x265": { + "version": "4.2", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, + "xorgproto": { + "version": "2025.1", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, "xz": { "version": "5.8.3", "targets": [ @@ -99,6 +1288,14 @@ "x86_64_linux" ] }, + "z3": { + "version": "4.16.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, "zlib-ng-compat": { "version": "2.3.3", "targets": [ @@ -107,6 +1304,14 @@ "x86_64_linux" ] }, + "zoxide": { + "version": "0.10.0", + "targets": [ + "arm64_sequoia", + "arm64_tahoe", + "x86_64_linux" + ] + }, "zstd": { "version": "1.5.7", "targets": [ @@ -122,9 +1327,21 @@ "version": "37.0.1", "file": "platform-tools_r37.0.1-darwin.zip" }, + "claude-code": { + "version": "2.1.220", + "file": "claude" + }, + "codex": { + "version": "0.147.0", + "file": "codex-package-aarch64-apple-darwin.tar.gz" + }, "macfuse": { "version": "5.3.3", "file": "macfuse-5.3.3.dmg" + }, + "opencode-desktop": { + "version": "1.18.15", + "file": "opencode-desktop-mac-arm64.dmg" } }, "skipped": {