Initial commit

This commit is contained in:
sid 2026-04-13 10:03:41 -06:00
commit ddb1c4d7b0
7 changed files with 801 additions and 0 deletions

29
Formula/fgj-sid.rb Normal file
View file

@ -0,0 +1,29 @@
class FgjSid < Formula
desc "Forgejo/Gitea CLI tool - like gh for GitHub, but for Forgejo and Gitea"
homepage "https://forgejo.zerova.net/public/fgj-sid"
license "MIT"
url "ssh://git@forgejo.zerova.net/public/fgj-sid.git",
tag: "v0.3.0f",
revision: "c2251d9932b9bc3014233f97cfe1c43249a0e22c"
head "ssh://git@forgejo.zerova.net/public/fgj-sid.git", branch: "main"
depends_on "go" => :build
def install
ldflags = "-s -w"
system "go", "build", *std_go_args(ldflags:)
generate_completions_from_executable(bin/"fgj", "completion")
# Generate man pages
mkdir "man" do
system bin/"fgj", "manpages", "--dir", "."
man1.install Dir["*.1"]
end
end
test do
assert_match "0.3.0f", shell_output("#{bin}/fgj --version")
end
end

124
Formula/qemu-iscsi.rb Normal file
View file

@ -0,0 +1,124 @@
class QemuIscsi < Formula
desc "Generic machine emulator and virtualizer (with libiscsi support)"
homepage "https://www.qemu.org/"
url "https://download.qemu.org/qemu-10.2.2.tar.xz"
sha256 "784b296ff29c1417aa72323abcb2d2ea9ab9771724f577dcd785c3b04f21e176"
license "GPL-2.0-only"
head "https://gitlab.com/qemu-project/qemu.git", branch: "master"
livecheck do
url "https://www.qemu.org/download/"
regex(/href=.*?qemu[._-]v?(\d+(?:\.\d+)+)\.t/i)
end
conflicts_with "qemu", because: "qemu-iscsi installs the same binaries as qemu"
depends_on "libtool" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkgconf" => :build
depends_on "python@3.14" => :build
depends_on "spice-protocol" => :build
depends_on "capstone"
depends_on "dtc"
depends_on "glib"
depends_on "gnutls"
depends_on "jpeg-turbo"
depends_on "libiscsi"
depends_on "libpng"
depends_on "libslirp"
depends_on "libssh"
depends_on "libusb"
depends_on "lzo"
depends_on "ncurses"
depends_on "pixman"
depends_on "snappy"
depends_on "vde"
depends_on "zstd"
uses_from_macos "bison" => :build
uses_from_macos "flex" => :build
uses_from_macos "bzip2"
on_linux do
depends_on "attr"
depends_on "cairo"
depends_on "elfutils"
depends_on "gdk-pixbuf"
depends_on "gtk+3"
depends_on "keyutils"
depends_on "libcap-ng"
depends_on "libepoxy"
depends_on "libx11"
depends_on "libxkbcommon"
depends_on "mesa"
depends_on "systemd"
depends_on "zlib-ng-compat"
end
def install
ENV["LIBTOOL"] = "glibtool"
rm(Dir["python/wheels/*"] - Dir["python/wheels/pycotap-*-none-any.whl"])
args = %W[
--prefix=#{prefix}
--cc=#{ENV.cc}
--host-cc=#{ENV.cc}
--disable-bsd-user
--disable-download
--disable-guest-agent
--enable-slirp
--enable-capstone
--enable-curses
--enable-fdt=system
--enable-libiscsi
--enable-libssh
--enable-vde
--enable-virtfs
--enable-zstd
--extra-cflags=-DNCURSES_WIDECHAR=1
--disable-sdl
]
args << "--smbd=#{HOMEBREW_PREFIX}/sbin/samba-dot-org-smbd"
args += if OS.mac?
["--disable-gtk", "--enable-cocoa"]
else
["--enable-gtk"]
end
system "./configure", *args
system "make", "V=1", "install"
end
test do
resource "homebrew-test-image" do
url "https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.2/official/FD12FLOPPY.zip"
sha256 "81237c7b42dc0ffc8b32a2f5734e3480a3f9a470c50c14a9c4576a2561a35807"
end
archs = %w[
aarch64 alpha arm avr hppa i386 loongarch64 m68k microblaze microblazeel mips
mips64 mips64el mipsel or1k ppc ppc64 riscv32 riscv64 rx
s390x sh4 sh4eb sparc sparc64 tricore x86_64 xtensa xtensaeb
]
archs.each do |guest_arch|
assert_match version.to_s, shell_output("#{bin}/qemu-system-#{guest_arch} --version")
end
resource("homebrew-test-image").stage testpath
assert_match "file format: raw", shell_output("#{bin}/qemu-img info FLOPPY.img")
assert_match "libiscsi",
shell_output("#{bin}/qemu-system-x86_64 -drive format=? 2>&1", 1)
if OS.mac?
output = shell_output("codesign --verify --verbose #{bin}/qemu-system-x86_64 2>&1")
assert_match "valid on disk", output
assert_match "satisfies its Designated Requirement", output
end
end
end

83
Formula/tinc-feth.rb Normal file
View file

@ -0,0 +1,83 @@
class TincFeth < Formula
desc "Virtual Private Network (VPN) tool with feth-based TAP support for macOS"
homepage "https://www.tinc-vpn.org/"
url "https://www.tinc-vpn.org/packages/tinc-1.0.37.tar.gz"
sha256 "f63b7e21c32c4c637576d85f36bdd28ea678b5aa17fad02427645dea30e52ac7"
license "GPL-2.0-or-later" => { with: "OpenSSL-exception" }
conflicts_with "tinc", because: "tinc-feth is a patched version of tinc with macOS feth device support"
depends_on "lzo"
depends_on "openssl@3"
def patches_dir
# Resolve patches relative to the tap root
File.expand_path("../patches", __dir__)
end
def install
# Apply patches: macOS struct ifreq fixes + feth device support
system "patch", "-p1", "-i", "#{patches_dir}/net-socket-fix.patch"
system "patch", "-p1", "-i", "#{patches_dir}/raw-socket-fix.patch"
system "patch", "-p1", "-i", "#{patches_dir}/feth-device.patch"
system "./configure", "--prefix=#{prefix}",
"--sysconfdir=#{etc}",
"--with-openssl=#{Formula["openssl@3"].opt_prefix}",
"--with-lzo=#{Formula["lzo"].opt_prefix}"
system "make", "install"
# Install wrapper script that auto-detects the network name
(bin/"tinc-feth-start").write <<~SH
#!/bin/sh
TINC_DIR="#{etc}/tinc"
if [ -n "$1" ]; then
NETWORK="$1"
else
NETWORK=$(find "$TINC_DIR" -mindepth 1 -maxdepth 1 -type d ! -name '.*' -exec basename {} \\; | head -1)
fi
if [ -z "$NETWORK" ]; then
echo "No tinc network found in $TINC_DIR" >&2
exit 1
fi
exec #{opt_sbin}/tincd -n "$NETWORK" -D
SH
end
def caveats
<<~EOS
tinc-feth adds macOS feth (fake ethernet) device support for Layer 2 / switch mode.
To use feth mode, set in your tinc.conf:
DeviceType = feth
Mode = switch
Optionally specify a device number (default is feth0):
Device = feth0
This creates a feth interface pair:
feth0 - primary interface (configure IPs in tinc-up)
feth5000 - peer interface (used internally for packet I/O)
Requires root privileges to create feth interfaces and open BPF devices.
Example tinc-up script:
#!/bin/sh
ifconfig $INTERFACE 10.0.0.1 netmask 255.255.255.0 up
Configuration directory: #{etc}/tinc/
EOS
end
service do
run [opt_bin/"tinc-feth-start"]
require_root true
keep_alive true
log_path var/"log/tinc/tinc.log"
error_log_path var/"log/tinc/tinc.log"
end
test do
assert_match version.to_s, shell_output("#{sbin}/tincd --version")
end
end