61 lines
1.7 KiB
Ruby
61 lines
1.7 KiB
Ruby
class Onscripter < Formula
|
|
desc "NScripter-compatible visual novel engine"
|
|
homepage "https://onscripter.osdn.jp/"
|
|
url "https://onscripter.osdn.jp/onscripter-20200722.tar.gz"
|
|
sha256 "12e5f4ac336ae3da46bf166ff1d439840be6336b19401a76c7d788994a9cd35e"
|
|
license "GPL-2.0"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "d886def76e269ded54ad9b5c128d6c8d6b40d26814ef7c3a1e46113101e61088" => :catalina
|
|
sha256 "67ad8935801c205450775f3abb6f8ae318da8110835fa10bf984538b1ef963b3" => :mojave
|
|
sha256 "27471aca0f4b1bc08721ef8ee650a4fb2b42085c0eba7ecf7d281fa050f64b65" => :high_sierra
|
|
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
|