Skip to content

Commit

Permalink
Merge pull request #175586 from alerque/sile-0.15.3
Browse files Browse the repository at this point in the history
sile 0.15.3
  • Loading branch information
BrewTestBot authored Aug 16, 2024
2 parents 87445a8 + d49ddff commit 66cca48
Showing 1 changed file with 41 additions and 55 deletions.
96 changes: 41 additions & 55 deletions Formula/s/sile.rb
Original file line number Diff line number Diff line change
@@ -1,58 +1,54 @@
class Sile < Formula
desc "Modern typesetting system inspired by TeX"
homepage "https://sile-typesetter.org"
url "https://github.com/sile-typesetter/sile/releases/download/v0.15.3/sile-0.15.3.tar.zst"
sha256 "88d24a70710e301ba3400351a82c5f28b49cebcd637b7a59d28b001a56b398c6"
license "MIT"
revision 1

# TODO: With 0.15 release:
# - Remove `cosmo` resource and corresponding references in install
# - Switch `lua` dependency to `luajit` and clean up `lua` references
stable do
url "https://github.com/sile-typesetter/sile/releases/download/v0.14.17/sile-0.14.17.tar.xz"
sha256 "7f89bedecedabb5168250ad9dd80c09ed289c8e88c3d0d756d2d1d92ee065e04"

depends_on "lua"
end

bottle do
sha256 cellar: :any, arm64_sonoma: "74bee659db3d23a9b2ab54e30d0fad09f19d02fc035987db06219c9c363a4d1f"
sha256 cellar: :any, arm64_ventura: "68e0846baebd4fa1d78da92c25f9924a805fde515c844cd1f77db75710568151"
sha256 cellar: :any, arm64_monterey: "156067d6a65fed6a0543026b924998f3d73ec95cb72388b83e925286206c6785"
sha256 cellar: :any, sonoma: "909940767d0810a28b3ea1d705a6bb120d04dd544a10e0e86f97809009ccfa0b"
sha256 cellar: :any, ventura: "8ef384866a339dcf0c9c362bca28808e7852b45fca87a3d85e86ad26769526e9"
sha256 cellar: :any, monterey: "877ee8ebca792e0b199d05c85bc901515bec45aff0d02a05aa8f4fd37e9d7ad4"
sha256 cellar: :any_skip_relocation, x86_64_linux: "46bcd748249ed2c5a45159c55d2f5133ce630a57f7fc080c9f729f4ead3d13e2"
sha256 cellar: :any, arm64_sonoma: "0450780ce9fe84b4bdfad21d3142176e9d29db3885911845f212a142e4a267f3"
sha256 cellar: :any, arm64_ventura: "80bc45a5ee156f1f7c1185bd47c61fc7b60a8c08f6909c5c5698847f0d7c39e5"
sha256 cellar: :any, arm64_monterey: "fbea588d0203b96407d23374f2774fb9c4e324453eeb6abf5c66725abd9e4a51"
sha256 cellar: :any, sonoma: "77db58362c81fb602a4a9131be488284f73d0eb9409f50d7af03c48d0ae20afd"
sha256 cellar: :any, ventura: "7b8d448f5c1d98a4e9e28aebe7dc82ffc5ddbe7fca1ccba3403c8bec5bd8176d"
sha256 cellar: :any, monterey: "6fe29599172792c630212ef8ba5c2124daf44aee5232215be8e89ec05fc71830"
sha256 cellar: :any_skip_relocation, x86_64_linux: "8bde53dfab23c1700c271e04edbdef32a2a61067504f4421212089364bd09eb4"
end

head do
url "https://github.com/sile-typesetter/sile.git", branch: "develop"
url "https://github.com/sile-typesetter/sile.git"

depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "jq" => :build
depends_on "libtool" => :build
depends_on "poppler" => :build
depends_on "rust" => :build
depends_on "luajit"

resource "compat53" do
url "https://luarocks.org/manifests/lunarmodules/compat53-0.12-1.rockspec"
sha256 "880cdad8d1789a0756f2023d2c98f36d94e6d2c1cc507190b4f9883420435746"
end
end

depends_on "jq" => :build
depends_on "pkg-config" => :build
depends_on "poppler" => :build
depends_on "rust" => :build

depends_on "fontconfig"
depends_on "harfbuzz"
depends_on "icu4c"
depends_on "libpng"
depends_on "luajit"
depends_on "luarocks"
depends_on "openssl@3"

uses_from_macos "unzip" => :build
uses_from_macos "expat"
uses_from_macos "zlib"

on_macos do
depends_on "freetype"
end

resource "compat53" do
url "https://luarocks.org/manifests/lunarmodules/compat53-0.12-1.rockspec"
sha256 "880cdad8d1789a0756f2023d2c98f36d94e6d2c1cc507190b4f9883420435746"
end

resource "linenoise" do
url "https://luarocks.org/manifests/hoelzro/linenoise-0.9-1.rockspec"
sha256 "e4f942e0079092993832cf6e78a1f019dad5d8d659b9506692d718d0c0432c72"
Expand All @@ -63,12 +59,6 @@ class Sile < Formula
sha256 "6637fcf4d3ddef7be490a2f0155bd2dcd053272d1bb78c015498709ef9fa75dd"
end

# depends on lpeg
resource "cosmo" do
url "https://luarocks.org/manifests/mascarenhas/cosmo-16.06.04-1.src.rock"
sha256 "9c83d50c8b734c0d405f97df9940ddb27578214033fd0e3cfc3e7420c999b9a9"
end

resource "loadkit" do
url "https://luarocks.org/manifests/leafo/loadkit-1.1.0-1.src.rock"
sha256 "6a631cb08a78324cb5f92b1cb8e2f59502d7113407d0d9b0d95045d8a4febccb"
Expand Down Expand Up @@ -153,15 +143,8 @@ class Sile < Formula
end

def install
if build.head?
lua = Formula["luajit"]
luaversion = "5.1"
luainclude = lua.opt_include/"luajit-2.1"
else
lua = Formula["lua"]
luaversion = lua.version.major_minor
luainclude = lua.opt_include/"lua"
end
lua = Formula["luajit"]
luaversion = "5.1"
luapath = libexec/"vendor"

paths = %W[
Expand All @@ -173,7 +156,7 @@ def install
ENV["LUA_PATH"] = paths.join(";")
ENV["LUA_CPATH"] = "#{luapath}/lib/lua/#{luaversion}/?.so"

ENV.prepend "CPPFLAGS", "-I#{luainclude}"
ENV.prepend "CPPFLAGS", "-I#{lua.opt_include}/luajit-2.1"
ENV.prepend "LDFLAGS", "-L#{lua.opt_lib}"

if OS.mac?
Expand All @@ -183,7 +166,7 @@ def install
expat_dir = Formula["expat"].opt_prefix
end

args = %W[
luarocks_args = %W[
ZLIB_DIR=#{zlib_dir}
EXPAT_DIR=#{expat_dir}
OPENSSL_DIR=#{Formula["openssl@3"].opt_prefix}
Expand All @@ -192,28 +175,31 @@ def install
]

resources.each do |r|
# TODO: Remove this line when `cosmo` resource is removed
next if r.name == "cosmo" && build.head?

r.stage do
rock = Pathname.pwd.children(false).first
unpack_dir = Utils.safe_popen_read("luarocks", "unpack", rock).split("\n")[-2]

spec = "#{r.name}-#{r.version}.rockspec"
cd(unpack_dir) { system "luarocks", "make", *args, spec }
cd(unpack_dir) { system "luarocks", "make", *luarocks_args, spec }
end
end

args = %w[
configure_args = %w[
FCMATCH=true
--disable-silent-rules
--with-system-luarocks
--with-system-lua-sources
--disable-embeded-resources
]
if build.head?
args += %w[--with-system-lua-sources --disable-embeded-resources]
system "./bootstrap.sh"
end
system "./configure", *args, *std_configure_args

# Upstream bug https://github.com/sile-typesetter/sile/issues/2078 triggers
# a useless automake cycle when building from the source tarball. This
# argument avoids needing the dependency by just making it a noop. Remove
# on the next release.
configure_args += %w[AUTOMAKE=:]

system "./bootstrap.sh" if build.head?
system "./configure", *configure_args, *std_configure_args
system "make"
system "make", "install"

Expand Down

0 comments on commit 66cca48

Please sign in to comment.