sile 0.9.5-alpha
Closes #12326. Signed-off-by: ilovezfs <ilovezfs@icloud.com>
This commit is contained in:
parent
3153ed3af7
commit
51513faa41
1 changed files with 54 additions and 16 deletions
|
@ -1,18 +1,16 @@
|
|||
class Sile < Formula
|
||||
desc "Modern typesetting system inspired by TeX"
|
||||
homepage "http://www.sile-typesetter.org/"
|
||||
url "https://github.com/simoncozens/sile/releases/download/v0.9.4/sile-0.9.4.tar.bz2"
|
||||
sha256 "1c696679e5243d0448705db86227eec57a000846f02a964f882b7978c46954d5"
|
||||
revision 2
|
||||
# This should return to using a release tarball when >0.9.4 is released.
|
||||
url "https://github.com/simoncozens/sile.git",
|
||||
:revision => "befcd813e1dd46f7af6d11ffd0b0ee525e8db1fc"
|
||||
version "0.9.5-alpha"
|
||||
head "https://github.com/simoncozens/sile.git"
|
||||
|
||||
head do
|
||||
url "https://github.com/simoncozens/sile.git"
|
||||
depends_on "automake" => :build
|
||||
depends_on "autoconf" => :build
|
||||
depends_on "libtool" => :build
|
||||
end
|
||||
|
||||
bottle :disable, "LuaRocks requirements preclude bottling"
|
||||
# These three should return to being head-only when >0.9.4 is released.
|
||||
depends_on "automake" => :build
|
||||
depends_on "autoconf" => :build
|
||||
depends_on "libtool" => :build
|
||||
|
||||
depends_on "pkg-config" => :build
|
||||
depends_on "harfbuzz"
|
||||
|
@ -21,12 +19,44 @@ class Sile < Formula
|
|||
depends_on "lua"
|
||||
depends_on "icu4c"
|
||||
|
||||
depends_on "lpeg" => :lua
|
||||
depends_on "luaexpat" => :lua
|
||||
depends_on "luafilesystem" => :lua
|
||||
resource "lpeg" do
|
||||
url "http://www.inf.puc-rio.br/~roberto/lpeg/lpeg-1.0.1.tar.gz"
|
||||
sha256 "62d9f7a9ea3c1f215c77e0cadd8534c6ad9af0fb711c3f89188a8891c72f026b"
|
||||
end
|
||||
|
||||
resource "lua-zlib" do
|
||||
url "https://github.com/brimworks/lua-zlib/archive/v1.2.tar.gz"
|
||||
sha256 "26b813ad39c94fc930b168c3418e2e746af3b2e80b92f94f306f6f954cc31e7d"
|
||||
end
|
||||
|
||||
resource "luaexpat" do
|
||||
url "https://matthewwild.co.uk/projects/luaexpat/luaexpat-1.3.0.tar.gz"
|
||||
sha256 "d060397960d87b2c89cf490f330508b7def1a0677bdc120531c571609fc57dc3"
|
||||
end
|
||||
|
||||
resource "luafilesystem" do
|
||||
url "https://github.com/keplerproject/luafilesystem/archive/v1_7_0_2.tar.gz"
|
||||
sha256 "23b4883aeb4fb90b2d0f338659f33a631f9df7a7e67c54115775a77d4ac3cc59"
|
||||
end
|
||||
|
||||
def install
|
||||
system "./bootstrap.sh" if build.head?
|
||||
luapath = libexec/"vendor"
|
||||
ENV["LUA_PATH"] = "#{luapath}/share/lua/5.2/?.lua;;#{luapath}/share/lua/5.2/lxp/?.lua"
|
||||
ENV["LUA_CPATH"] = "#{luapath}/lib/lua/5.2/?.so"
|
||||
|
||||
resources.each do |r|
|
||||
r.stage do
|
||||
if r.name == "lua-zlib"
|
||||
# https://github.com/brimworks/lua-zlib/commit/08d6251700965
|
||||
mv "lua-zlib-1.1-0.rockspec", "lua-zlib-1.2-0.rockspec"
|
||||
system "luarocks", "make", "#{r.name}-#{r.version}-0.rockspec", "--tree=#{luapath}"
|
||||
else
|
||||
system "luarocks", "build", r.name, "--tree=#{luapath}"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
system "./bootstrap.sh" # Should be head-only when >0.9.4 is released.
|
||||
system "./configure", "--disable-debug",
|
||||
"--disable-dependency-tracking",
|
||||
"--disable-silent-rules",
|
||||
|
@ -34,9 +64,17 @@ class Sile < Formula
|
|||
"--prefix=#{prefix}"
|
||||
system "make"
|
||||
system "make", "install"
|
||||
|
||||
(libexec/"bin").install bin/"sile"
|
||||
(bin/"sile").write <<~EOS
|
||||
#!/bin/bash
|
||||
export LUA_PATH="#{ENV["LUA_PATH"]}"
|
||||
export LUA_CPATH="#{ENV["LUA_CPATH"]}"
|
||||
"#{libexec}/bin/sile" "$@"
|
||||
EOS
|
||||
end
|
||||
|
||||
test do
|
||||
assert_match "SILE #{version}", shell_output("#{bin}/sile --version")
|
||||
assert_match "SILE #{version.to_s.match(/\d\.\d\.\d/)}", shell_output("#{bin}/sile --version")
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue