Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

gnat 2012 (compiler + IDE) #15095

Closed
wants to merge 2 commits into from

6 participants

@sebn

Hello,

I started working on a formula to install the GNAT Ada compiler.
It may not be ready yet, but I supposed a pull request was a good way to get some feedback...

The formula works for me, but I still have the following issues:

  • It also installs the IDE, because I couldn't find a way to download it separately... Should I move it to a separate formula, or is it ok ?
  • It also installs a custom gcc version (since GNAT is gcc-based) in /usr/local/bin, which may conflict with both MacOS version and other formulas... Is it ok, or should I try to build it from sources using the system gcc ? Or maybe not installing it to /usr/local/bin and adding PATH configuration instructions (which is what their install script does actually) ?

I also plan to add formulas for other libraries soon (ASIS, AUnit, GNATColl, SPARK and XMLAda).

Any comment ?

Sebastien Nicouleaud gnat 2012 (compiler + IDE) e257242
@sebn

Looks like I can get separate tarballs for compiler and IDE sources, but not for binaries.
Also, I need a working gnat install to compile gnat...

Should all of this move to a separate repository like homebrew-dupes ?

@cooljeanius

iirc previous versions of GNAT made a directory called /usr/local/ada-$(VERSION); maybe making it a bottle-only formula would be a good way to go about doing something similar?

@Sharpie
Collaborator

Should all of this move to a separate repository like homebrew-dupes ?

Seems like the most logical approach is to integrate this into the gcc formula in homebrew-dupes since GNAT is a component of GCC.

@sebn

Thank you both for the insights.

I looked at both the qt formula and the corresponding bottle to understand how it works, but I'm still not sure to understand what controls the binary generation, and I didn't find so much documentation... (will look further)

I also found the following gcc formulae that could include GNAT as a component:

I'll try 4.7 first, and eventually fallback to 4.5 (since it's the version used for the binary distribution).

@mikemcquaid
Owner

The binaries are currently manually generated (mostly by me) by running brew install qt --build-bottle && brew bottle qt

@sebn

What about the "gnat needs gnat" issue?

I mean, if the gcc formula downloads and uses a totally different gcc stack to build when given an --enable-ada option, couldn't this lead to unexpected issue with other gcc components?

@adamv
Owner

What's the status here? We can't allow in a formula with a caveat about "messing up gcc".

@sebn

I'm not sure how to fix this, and I don't have time to work on it at the moment, so unless someone knows the right way to package gnat for homebrew, you can close this pull request.

@adamv
Owner

Passing on this for now, sorry.

@adamv adamv closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 25, 2012
  1. gnat 2012 (compiler + IDE)

    Sebastien Nicouleaud authored
Commits on Sep 27, 2012
  1. @indentman

    aunit 2012

    indentman authored
This page is out of date. Refresh to see the latest.
Showing with 57 additions and 0 deletions.
  1. +28 −0 Library/Formula/aunit.rb
  2. +29 −0 Library/Formula/gnat.rb
View
28 Library/Formula/aunit.rb
@@ -0,0 +1,28 @@
+require 'formula'
+
+class Aunit < Formula
+ homepage 'http://libre.adacore.com/tools/aunit/'
+ url 'http://mirrors.cdn.adacore.com/art/d1fa4a0eb6665edb5b330c50e82041e4923b208c'
+ sha1 '4f367f7b65a20f46fd0543d89d1608253a27dda7'
+ version '2012'
+
+ depends_on 'gnat'
+
+ def install
+ system "make install INSTALL=#{prefix}"
+ end
+
+ def test
+ mktemp do
+ (Pathname.pwd + 'test.adb').write <<-ADA.undent
+ with AUnit;
+
+ procedure Test is
+ begin
+ null;
+ end Test;
+ ADA
+ system "gnat compile -aI#{prefix}/include/aunit/framework/ test.adb"
+ end
+ end
+end
View
29 Library/Formula/gnat.rb
@@ -0,0 +1,29 @@
+require 'formula'
+
+class Gnat < Formula
+ homepage 'http://libre.adacore.com/tools/gnat-gpl-edition/'
+ url 'http://mirrors.cdn.adacore.com/art-bundle?prefix=x86_64-darwin%2F2012%2F&f=729192a1ebe222e3e21a189c04ac23e4bd58fbe0&format=tar'
+ version '2012'
+ sha1 '69a8a4a01bc394c628e799225f07f04d9b017f88'
+
+ def install
+ system 'tar zxf 2012/gnatgpl/gnat-gpl-2012-x86_64-apple-darwin10.8.0-bin.tar.gz'
+ system "make -C gnat-2012-x86_64-apple-darwin10.8.0-bin ins-all prefix=#{prefix}"
+ end
+
+ def caveats; <<-EOS.undent
+ Includes:
+ - GNAT GPL Edition
+ - GNAT Programming Studio
+
+ To prevent the custom gcc version to mess up with MacOS included one:
+
+ export PATH="/usr/local/bin:$PATH"
+
+ EOS
+ end
+
+ def test
+ system 'gnatmake --version'
+ end
+end
Something went wrong with that request. Please try again.