Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

GDAL Java Swig bindings #39105

Closed
pauldaustin opened this issue Apr 27, 2015 · 1 comment
Closed

GDAL Java Swig bindings #39105

pauldaustin opened this issue Apr 27, 2015 · 1 comment

Comments

@pauldaustin
Copy link
Contributor

I'm looking at modifying the gdal build to be able to enable building the java bindings using swig.

One thing I've noticed is that there is some inconsistency in the naming of options in this script. Some use --enable-* and others use --with-*. Is there a preferred home-brew naming.

I was thinking that as there are other swig bindings (e.g. perl, php etc) that the options to enable them would be --enable-swig-* (e.g. --enable-swig-java).

Why not use --enable-java. The reason for this is that for some languages the main GDAL code can be compiled to support that language. The swig bindings are additional libraries that use the main GDAL library. In theory someone might want to compile GDAL to support python. But not have the python libraries to use GDAL.

I read the home-brew docs and it as easy as this to get this change into the code.

  1. Fork homebrew
  2. Edit the /usr/local/Library/Formula/gdal.rb
  3. Update the revision number
  4. Make other changes
  5. Commit and push to my fork
  6. Create pull request

The following code shows the diff from version 1.11.2_1.

<   option 'enable-swig-java', 'Build the swig java bindings'
74,75d72
<   depends_on 'swig'
< 
290,302d286
<     if 'enable-swig-java'
<       cd 'swig/java' do
<         system "echo 'JAVA_HOME='`/usr/libexec/java_home -v 1.7` > java.opt"
<         system "echo 'JAVADOC=$(JAVA_HOME)/bin/javadoc' >> java.opt"
<         system "echo 'JAVAC=$(JAVA_HOME)/bin/javac' >> java.opt"
<         system "echo 'JAVA=$(JAVA_HOME)/bin/java' >> java.opt"
<         system "echo 'JAR=$(JAVA_HOME)/bin/jar' >> java.opt"
<         system "echo 'JAVA_INCLUDE=-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/darwin' >> java.opt"
<         system "make"
<         system "make install"
<       end
<     end
< 
@MikeMcQuaid
Copy link
Member

One thing I've noticed is that there is some inconsistency in the naming of options in this script. Some use --enable-* and others use --with-*. Is there a preferred home-brew naming.

Yup, the with form.

Otherwise: all sounds good!

@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants