Files

130 lines
4.5 KiB
Ruby

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