libxmp 4.3.8
Closes Homebrew/homebrew#38367. Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
This commit is contained in:
parent
bbf7c25dc9
commit
d0b7c6464e
1 changed files with 39 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
|||
class Libxmp < Formula
|
||||
homepage "http://xmp.sourceforge.net"
|
||||
url "https://downloads.sourceforge.net/project/xmp/libxmp/4.3.6/libxmp-4.3.6.tar.gz"
|
||||
sha256 "9894456dd3a8cea9b77de084c29f7cbb6ec16fd4d0005389913e8b205c02b750"
|
||||
url "https://downloads.sourceforge.net/project/xmp/libxmp/4.3.8/libxmp-4.3.8.tar.gz"
|
||||
sha256 "de9a25b5f28e5f82010ade423bb63adc6ad235c2aeca4b7433ec5d0a43020640"
|
||||
|
||||
bottle do
|
||||
cellar :any
|
||||
|
@ -10,6 +10,13 @@ class Libxmp < Formula
|
|||
sha256 "615b556b2c0cb26f624c483db529a29add9cfe44ec168a562d90705a09af9d7d" => :mountain_lion
|
||||
end
|
||||
|
||||
# CC BY-NC-ND licensed set of five mods by Keith Baylis/Vim! for testing purposes
|
||||
# Mods from Mod Soul Brother: http://web.archive.org/web/20120215215707/http://www.mono211.com/modsoulbrother/vim.html
|
||||
resource "demo_mods" do
|
||||
url "https://files.scene.org/get:us-http/mirrors/modsoulbrother/vim/vim-best-of.zip"
|
||||
sha256 "df8fca29ba116b10485ad4908cea518e0f688850b2117b75355ed1f1db31f580"
|
||||
end
|
||||
|
||||
head do
|
||||
url "git://git.code.sf.net/p/xmp/libxmp"
|
||||
depends_on "autoconf" => :build
|
||||
|
@ -19,5 +26,35 @@ class Libxmp < Formula
|
|||
system "autoconf" if build.head?
|
||||
system "./configure", "--prefix=#{prefix}"
|
||||
system "make install"
|
||||
|
||||
(share/"libxmp").install resource("demo_mods")
|
||||
end
|
||||
|
||||
test do
|
||||
test_mod = share/"libxmp/give-me-an-om.mod"
|
||||
(testpath/"libxmp_test.c").write <<-EOS.undent
|
||||
#include <stdio.h>
|
||||
#include "xmp.h"
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
char* mod = argv[1];
|
||||
xmp_context context;
|
||||
struct xmp_module_info mi;
|
||||
|
||||
context = xmp_create_context();
|
||||
if (xmp_load_module(context, mod) != 0) {
|
||||
puts("libxmp failed to open module!");
|
||||
return 1;
|
||||
}
|
||||
|
||||
xmp_get_module_info(context, &mi);
|
||||
puts(mi.mod->name);
|
||||
return 0;
|
||||
}
|
||||
EOS
|
||||
|
||||
system ENV.cc, "libxmp_test.c", "-lxmp", "-o", "libxmp_test"
|
||||
assert_equal "give me an om", shell_output("\"#{testpath}/libxmp_test\" #{test_mod}").chomp
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue