diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 495ce05e..d2f5c246 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -26,6 +26,8 @@ jobs: brew install bison libxml2 meson ninja xkeyboardconfig xorg-server brew link bison --force brew link libxml2 --force + # brew install autoconf automake libtool + brew reinstall --build-from-source --verbose --formula ./xkbcomp.rb # https://docs.brew.sh/Homebrew-and-Python#pep-668-python312-and-virtual-environments python3 -m venv venv source venv/bin/activate @@ -33,6 +35,10 @@ jobs: env: HOMEBREW_NO_AUTO_UPDATE: 1 HOMEBREW_NO_INSTALL_CLEANUP: 1 + - name: Debug + if: '!cancelled()' + run: | + cat /Users/runner/Library/Logs/Homebrew/xkbcomp/* - name: Setup run: | PATH="/usr/local/opt/bison/bin:${PATH}" \ diff --git a/xkbcomp.rb b/xkbcomp.rb new file mode 100644 index 00000000..3448e73b --- /dev/null +++ b/xkbcomp.rb @@ -0,0 +1,55 @@ +class Xkbcomp < Formula + desc "XKB keyboard description compiler" + homepage "https://www.x.org" + url "https://gitlab.freedesktop.org/wismill/xkbcomp/-/archive/actions-out-of-bounds/xkbcomp-actions-out-of-bounds.zip" + sha256 "23a385b73ae3a69c02f1df3d3b52254e098a535033b28fd80eccccc2c9f1e999" + version "1.4.7" + license all_of: ["HPND", "MIT-open-group"] + + bottle do + sha256 cellar: :any, arm64_sequoia: "a0b770e6a7ef934ac5b4fc86d683013e9ec4b1813852884b27362129357ffc57" + sha256 cellar: :any, arm64_sonoma: "21f807d7ff040f4f919aa8b785e84589013a24e492618fb2f68867a20b83ff85" + sha256 cellar: :any, arm64_ventura: "fac529997c4a64e907d0bbfa31c5d7b4223bcb978f139de89a5a57d904280279" + sha256 cellar: :any, arm64_monterey: "8005d7a24f88589b10d4b305668a0daf00c3262096cf2824b33b9ee2b820cb57" + sha256 cellar: :any, sonoma: "748bc8b2b4367a4a2a429939d866cad1d3f2c39827d817dcc8005677decfdec4" + sha256 cellar: :any, ventura: "64d4dd5de94b681390d9488addba6c89d1d2cfdc64fc84d3daa7c308868bf3d7" + sha256 cellar: :any, monterey: "4bf88bfe3df2a85e6a4e16cb61b92f7a1e91b4e7b1f526014912fc789de34205" + sha256 cellar: :any_skip_relocation, x86_64_linux: "6be95ca9ca5cb1c2afaa4e0d2cf31d75f5daa5e543a824c3c9cb9f6d895c25e2" + end + + depends_on "pkgconf" => :build + + depends_on "libx11" + depends_on "libxkbfile" + depends_on "autoconf" => :build + depends_on "automake" => :build + depends_on "libtool" => :build + depends_on "gcc" + + def install + system "autoreconf", "--force", "--install", "--verbose", "--verbose" + system "./configure", "--with-xkb-config-root=#{HOMEBREW_PREFIX}/share/X11/xkb", *std_configure_args + system "make" + system "make", "install" + # avoid cellar in bindir + inreplace lib/"pkgconfig/xkbcomp.pc", prefix, opt_prefix + end + + test do + (testpath/"test.xkb").write <<~EOS + xkb_keymap { + xkb_keycodes "empty+aliases(qwerty)" { + minimum = 8; + maximum = 255; + virtual indicator 1 = "Caps Lock"; + }; + xkb_types "complete" {}; + xkb_symbols "unknown" {}; + xkb_compatibility "complete" {}; + }; + EOS + + system bin/"xkbcomp", "./test.xkb" + assert_predicate testpath/"test.xkm", :exist? + end +end