ocamlsdl 0.9.1 (new formula) #31092

Closed
wants to merge 6 commits into from

3 participants

@pp5x

Added SDL OCaml binding ocamlsdl.

@mistydemeo mistydemeo commented on an outdated diff Jul 24, 2014
Library/Formula/ocamlsdl.rb
@@ -0,0 +1,23 @@
+require "formula"
+
+class Ocamlsdl < Formula
+ homepage "http://ocamlsdl.sourceforge.net/"
+ # URL that has been tested:

Don't need this comment here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@MikeMcQuaid MikeMcQuaid commented on an outdated diff Jul 24, 2014
Library/Formula/ocamlsdl.rb
+
+class Ocamlsdl < Formula
+ homepage "http://ocamlsdl.sourceforge.net/"
+ # URL that has been tested:
+ # "http://sourceforge.net/projects/ocamlsdl/files/OCamlSDL/ocamlsdl-0.9.1/ocamlsdl-0.9.1.tar.gz"
+ url "https://downloads.sourceforge.net/projects/ocamlsdl/files/OCamlSDL/ocamlsdl-0.9.1/ocamlsdl-0.9.1.tar.gz"
+ sha1 "2e54f8984b06cede493c3ad29006dde17077a79a"
+
+ depends_on "sdl"
+ depends_on "sdl_mixer" => :recommended
+ depends_on "sdl_image" => :recommended
+ depends_on "sdl_gfx" => :recommended
+ depends_on "sdl_ttf" => :recommended
+ depends_on "objective-caml"
+
+
@MikeMcQuaid
Homebrew member

Remove one of these blank lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@MikeMcQuaid MikeMcQuaid and 1 other commented on an outdated diff Jul 24, 2014
Library/Formula/ocamlsdl.rb
+ sha1 "2e54f8984b06cede493c3ad29006dde17077a79a"
+
+ depends_on "sdl"
+ depends_on "sdl_mixer" => :recommended
+ depends_on "sdl_image" => :recommended
+ depends_on "sdl_gfx" => :recommended
+ depends_on "sdl_ttf" => :recommended
+ depends_on "objective-caml"
+
+
+ def install
+ system "./configure", "--prefix=#{prefix}"
+ system "make"
+ system "make", "install"
+ end
+end
@MikeMcQuaid
Homebrew member

Can a test be added to do something more substantial then e.g. --version or --help? See cmake.rb for an example of a formula with a good test. Thanks!

@pp5x
pp5x added a note Jul 24, 2014

Actually it's a library for the OCaml language that bind SDL C functions. How can I add a test without use a sample program to compile ?

@MikeMcQuaid
Homebrew member

Check tinyxml2.rb which creates a test program to compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
pp5x added some commits Jul 24, 2014
@pp5x pp5x ocamlsdl
Fixed wrong URL on sourceforge (but do not pass brew audit command).
3146835
@pp5x pp5x ocamlsdl
Added unit test that compile a sample program.
df7308f
@adamv adamv added the new formula label Jul 24, 2014
@pp5x pp5x ocamlsdl
Fixed download URL properly.
29cd4eb
@pp5x

Bottles are empty: library files are copied and not symlinked. The brew remove ocamlsdl command won't work.

@MikeMcQuaid
Homebrew member

@PierrePagnoux That sounds like it will need fixed?

@pp5x

@mikemcquaid By now the installation works (a sample program can be compiled). But the ./configure script is a bit tricky to me. I compared the formula with lablgtk.rb that is the GTK binding for OCaml, it's simpler and symlinked properly.

I found the --with-installdir option so I can now decide where the SDL OCaml library is installed. For example the /Users/Pierre/Downloads/ocamlsdl-0.9.1/test/ folder.

/Library/Developer/CommandLineTools/usr/bin/make -C src install
/usr/bin/install -c -d /Users/Pierre/Downloads/ocamlsdl-0.9.1/test
/usr/bin/install -c -m 644 *.cma lib*.a *.cmi *.mli /Users/Pierre/Downloads/ocamlsdl-0.9.1/test
/usr/bin/install -c -m 644 *.cmxa sdl*.a *.cmx /Users/Pierre/Downloads/ocamlsdl-0.9.1/test
/usr/bin/install -c -d /usr/local/lib/ocaml/stublibs
/usr/bin/install -c dll*.so /usr/local/lib/ocaml/stublibs

But I notice the last 2 lines are not changed and files are copied in /usr/local/lib/ocaml/stublibs. By now I can not tell if I will succeed to do that.

How are symlinks created by homebrew?

@MikeMcQuaid
Homebrew member

In that case we should perhaps patch the ./configure to install them in the right place and then submit this upstream.

@pp5x pp5x ocamlsdl
Set environment variable OCAMLLIB. Symlink works.
1f23a4b
@pp5x

I finally found that the OCAMLLIB variable was the answer to my problems.

    system "./configure", "--prefix=#{prefix}",
                          "OCAMLLIB=#{lib}/ocaml"

Now (really) it should be ok ! :-)
Thanks for your help !

@pp5x pp5x ocamlsdl
brew audit fix.
fa35dd5
@BrewTestBot BrewTestBot added a commit that closed this pull request Jul 25, 2014
@BrewTestBot BrewTestBot ocamlsdl: add 0.9.1 bottle.
Closes #31092.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
5af56e2
@aerickson aerickson added a commit to aerickson/homebrew that referenced this pull request Aug 3, 2014
@BrewTestBot BrewTestBot ocamlsdl: add 0.9.1 bottle.
Closes #31092.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
5fe7d29
@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.