feat: add ahfail formula v0.1.0
This commit is contained in:
48
Formula/ahfail.rb
Normal file
48
Formula/ahfail.rb
Normal file
@@ -0,0 +1,48 @@
|
||||
class Ahfail < Formula
|
||||
desc "Plays 'ah ah ah, you didn't say the magic word' on failed screen lock attempts"
|
||||
homepage "https://gitea.weircon.dk/agw/gtk-ahfail"
|
||||
url "https://gitea.weircon.dk/agw/gtk-ahfail/archive/v0.1.0.tar.gz"
|
||||
sha256 "d693e27933007023cfcbc1882187084e186435261c78461353457d5e765a9045"
|
||||
license "AGPL-3.0-only"
|
||||
|
||||
depends_on "meson" => :build
|
||||
depends_on "ninja" => :build
|
||||
depends_on "rust" => :build
|
||||
depends_on "gtk+3"
|
||||
depends_on "gstreamer"
|
||||
depends_on "gst-plugins-base"
|
||||
depends_on "gst-plugins-good"
|
||||
depends_on :macos
|
||||
|
||||
def install
|
||||
# Pass libdir so the PAM module has DEFAULT_PATH baked in correctly for
|
||||
# both Intel (/usr/local/lib) and Apple Silicon (/opt/homebrew/lib).
|
||||
system "meson", "setup", "builddir",
|
||||
"--buildtype=release",
|
||||
"-Dlibdir=#{lib}"
|
||||
system "meson", "compile", "-C", "builddir"
|
||||
(lib/"ahfail").install "builddir/libahfail_pam.so"
|
||||
(lib/"ahfail").install "builddir/ahfail-display"
|
||||
end
|
||||
|
||||
def caveats
|
||||
pam_file = if MacOS.version >= :ventura
|
||||
"/etc/pam.d/screensaverui"
|
||||
else
|
||||
"/etc/pam.d/screensaver"
|
||||
end
|
||||
<<~EOS
|
||||
Add this line to #{pam_file} after the existing auth entries (requires sudo):
|
||||
|
||||
auth optional #{lib}/ahfail/libahfail_pam.so
|
||||
|
||||
After upgrading ahfail, re-run `brew install ahfail` and update the path
|
||||
in #{pam_file} if it changed.
|
||||
EOS
|
||||
end
|
||||
|
||||
test do
|
||||
assert_predicate lib/"ahfail/libahfail_pam.so", :exist?
|
||||
assert_predicate lib/"ahfail/ahfail-display", :exist?
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user