67 lines
2.0 KiB
Ruby
67 lines
2.0 KiB
Ruby
class Onscripter < Formula
|
|
desc "NScripter-compatible visual novel engine"
|
|
homepage "https://onscripter.osdn.jp/onscripter.html"
|
|
url "https://onscripter.osdn.jp/onscripter-20220123.tar.gz"
|
|
sha256 "5da41dc3471eeec8c93153906b39dac0a32edbb2bcefce0fa0a976c148b448ca"
|
|
license "GPL-2.0-or-later"
|
|
|
|
livecheck do
|
|
url :homepage
|
|
regex(/href=.*?onscripter[._-]v?(\d+(?:\.\d+)*)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 cellar: :any, arm64_monterey: "6df121cc439c63ec6804ab3c781c0062b4bca08af5362bc866a1ca0565da8982"
|
|
sha256 cellar: :any, arm64_big_sur: "608b9e37d9da7ec4edb68d3542fe45d0593b6bd52d64e234caa5c681086ff993"
|
|
sha256 cellar: :any, monterey: "4b917a20089f1917708e638862a7b09034409e65b6309b2cce72351d62fff52d"
|
|
sha256 cellar: :any, big_sur: "a76c2fb8593c7e5d66c281ba69b59e8c4ee763eef572763ec44c2cca1bace610"
|
|
sha256 cellar: :any, catalina: "be36e240be9435dc871afeddb024aa23aec53364d8843d19ba88a7bd260915c7"
|
|
end
|
|
|
|
depends_on "pkg-config" => :build
|
|
depends_on "jpeg"
|
|
depends_on "lua"
|
|
depends_on "sdl"
|
|
depends_on "sdl_image"
|
|
depends_on "sdl_mixer"
|
|
depends_on "sdl_ttf"
|
|
depends_on "smpeg"
|
|
|
|
def install
|
|
incs = [
|
|
`pkg-config --cflags sdl SDL_ttf SDL_image SDL_mixer`.chomp,
|
|
`smpeg-config --cflags`.chomp,
|
|
"-I#{Formula["jpeg"].include}",
|
|
"-I#{Formula["lua"].opt_include}/lua",
|
|
]
|
|
|
|
libs = [
|
|
`pkg-config --libs sdl SDL_ttf SDL_image SDL_mixer`.chomp,
|
|
`smpeg-config --libs`.chomp,
|
|
"-ljpeg",
|
|
"-lbz2",
|
|
"-L#{Formula["lua"].opt_lib} -llua",
|
|
]
|
|
|
|
defs = %w[
|
|
-DMACOSX
|
|
-DUSE_CDROM
|
|
-DUSE_LUA
|
|
-DUTF8_CAPTION
|
|
-DUTF8_FILESYSTEM
|
|
]
|
|
|
|
ext_objs = ["LUAHandler.o"]
|
|
|
|
k = %w[INCS LIBS DEFS EXT_OBJS]
|
|
v = [incs, libs, defs, ext_objs].map { |x| x.join(" ") }
|
|
args = k.zip(v).map { |x| x.join("=") }
|
|
system "make", "-f", "Makefile.MacOSX", *args
|
|
bin.install %w[onscripter sardec nsadec sarconv nsaconv]
|
|
end
|
|
|
|
test do
|
|
assert shell_output("#{bin}/onscripter -v").start_with? "ONScripter version #{version}"
|
|
end
|
|
end
|