Skip to content

Commit

Permalink
Desupport perl, ruby bindings-- move them to /contrib
Browse files Browse the repository at this point in the history
Summary:
Moved the Perl and Ruby bindings to an attic-type area
called "contrib" to mark them as not-officially supported parts
of the SDK distribution. The idea is that if someone (either a
DNAnexan or not) wants to revive it at some point, they would
have a useful starting point to consult, but otherwise this code
isn't presumed to have any guarantees and people shouldn't be
thinking about "will I break this" if they want to make other
changes.

* Stop building the corresponding Debian packages too

Test Plan:
* Ran make targets by hand
* Verified that no applets rely on the deb packages in their execDepends

Reviewers: gduggal

Reviewed By: gduggal

Differential Revision: https://dnanexus.phacility.com/D1224
  • Loading branch information
Phil Sung committed Dec 22, 2016
1 parent a02b456 commit ee24f96
Show file tree
Hide file tree
Showing 33 changed files with 110 additions and 104 deletions.
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,11 @@
/src/.setup_doc_virtualenv
/src/java/target/
/src/java/src/main/java/com/dnanexus/DXToolkitVersion.java
/src/perl/DNAnexus-*
/src/python/dxpy/toolkit_version.py
/src/python/coverage-reports/
/src/ruby/lib/dxruby/version.rb
/src/R/install_dxR_deps.Rout
/src/R/dxR*.tar.gz
/src/R/roxygen2_*
/src/ruby/*.gem
/src/ruby/.yardoc

/src/openssl*.tar.gz
/src/openssl
Expand Down
1 change: 0 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ The Platform SDK contains API language bindings for the following platforms:

* [Python](src/python/Readme.md) (requires Python 2.7)
* C++
* Perl
* [Java](src/java/Readme.md) (requires Java 7 or higher)
* [R](src/R/Readme.md)

Expand Down
10 changes: 5 additions & 5 deletions build/Prebuilt-Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ Supported languages
* Python (requires Python 2.7)
* C++

If you wish to use bindings for the other supported languages (Java, Perl, R,
Ruby), please see the [DNAnexus developer
portal](https://wiki.dnanexus.com/Developer-Portal) for specific instructions
for your language. In general you can either build from the source
distribution, or install a prebuilt package specific to the language.
If you wish to use bindings for the other supported languages (Java, R), please
see the [DNAnexus developer portal](https://wiki.dnanexus.com/Developer-Portal)
for specific instructions for your language. In general you can either build
from the source distribution, or install a prebuilt package specific to the
language.

Runtime dependencies
--------------------
Expand Down
2 changes: 1 addition & 1 deletion build/package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ cd "${DNANEXUS_HOME}"
make clean
make
rm Makefile
rm -rf debian src/{java,javascript,perl,R,ruby,ua,python/build,{dx-verify-file,dx-contigset-to-fasta}/build} build/*_env share/dnanexus/lib/javascript
rm -rf debian src/{java,javascript,R,ua,python/build,{dx-verify-file,dx-contigset-to-fasta}/build} build/*_env share/dnanexus/lib/javascript
mv build/Prebuilt-Readme.md Readme.md

"$(dirname $0)/fix_shebang_lines.sh" bin "/usr/bin/env python2.7"
Expand Down
5 changes: 5 additions & 0 deletions contrib/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
api_wrappers:
$(MAKE) -C ./perl lib/DNAnexus/API.pm
$(MAKE) -C ./ruby lib/dxruby/api.rb

.PHONY: api_wrappers
11 changes: 11 additions & 0 deletions contrib/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Contributed components
======================

The components in this directory are **unsupported**, even though they
are in the official source distribution.

The intent of this space is to provide a centralized place where
somewhat experimental or unsupported ideas can be maintained. You can
use them as a starting point for your own work. If you can make a case
for something in here to be fully supported, it can graduate and be
moved out of this directory and into `/src`.
1 change: 1 addition & 0 deletions contrib/perl/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/DNAnexus-*
7 changes: 7 additions & 0 deletions contrib/perl/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SHELL=/bin/bash -e

all: lib/DNAnexus/API.pm
(source ../../environment; dzil build; cd DNAnexus-0.0.1; perl Makefile.PL; make install DESTDIR="$(DNANEXUS_HOME)/lib/perl5" DESTINSTALLSITELIB="$(DNANEXUS_HOME)/lib/perl5")

lib/DNAnexus/API.pm: ../../src/api_wrappers/wrapper_table.json generatePerlAPIWrappers.py
cat ../../src/api_wrappers/wrapper_table.json | ./generatePerlAPIWrappers.py > lib/DNAnexus/API.pm
22 changes: 22 additions & 0 deletions contrib/perl/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
DNAnexus Perl API
=================

Building
--------

make all

Using the package
-----------------

Before the Perl bindings can be initialized, you must set environment
variables that supply DNAnexus configuration (including a token that
authenticates you). You can do this with:

dx login
source <(dx env --bash)

Tests / Sample Code
-------------------

perl t/10-basics.t
2 changes: 1 addition & 1 deletion src/perl/dist.ini → contrib/perl/dist.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ author = Andrey Kislyuk <[email protected]>
license = Perl_5
copyright_holder = DNAnexus
copyright_year = 2012
version = 0.1
version = 0.0.1

[GatherDir]
[MetaYAML]
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/perl/lib/DNAnexus.pm → contrib/perl/lib/DNAnexus.pm
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ sub DXHTTPRequest($;$%) {
$request->authorization($$SECURITY_CONTEXT{auth_token_type}.' '.$$SECURITY_CONTEXT{auth_token});

$request->content(encode_json($data));

my $ua = LWP::UserAgent->new;
my $response = $ua->request($request);

Expand All @@ -81,7 +81,7 @@ sub set_api_server_info(;$$$) {
$host ||= 'api.dnanexus.com';
$port ||= 443;
$protocol ||= 'https';

$APISERVER_HOST = $host;
$APISERVER_PORT = $port;
$APISERVER = $protocol . "://" . $host . ":" . $port;
Expand Down Expand Up @@ -114,7 +114,7 @@ sub _initialize() {
set_security_context(decode_json($ENV{DX_SECURITY_CONTEXT}));
}

print $APISERVER_HOST, $APISERVER_PORT, $APISERVER_PROTOCOL, $APISERVER, $SECURITY_CONTEXT, $PROJECT_CONTEXT_ID, $_DEBUG;
# print $APISERVER_HOST, $APISERVER_PORT, $APISERVER_PROTOCOL, $APISERVER, $SECURITY_CONTEXT, $PROJECT_CONTEXT_ID, $_DEBUG;
}

_initialize();
Expand Down
File renamed without changes.
File renamed without changes.
7 changes: 3 additions & 4 deletions src/perl/t/10-basics.t → contrib/perl/t/10-basics.t
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,11 @@ use Test::More;

use DNAnexus::API;

$f = DNAnexus::API::systemFindDataObjects();
for $i (@{$$f{results}}) {
print "$_\t$$i{$_}\n" for keys %$i;
$resp = DNAnexus::API::systemFindDataObjects();
for $result (@{$$resp{results}}) {
print "$_\t$$result{$_}\n" for keys %$result;
}

ok( 1 == 1 );

done_testing();

3 changes: 3 additions & 0 deletions contrib/ruby/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/lib/dxruby/version.rb
/*.gem
/.yardoc/
File renamed without changes.
24 changes: 24 additions & 0 deletions contrib/ruby/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
SHELL=/bin/bash -e

default: ruby

ruby: lib/dxruby/api.rb lib/dxruby/version.rb
gem build dxruby.gemspec
export GEM_HOME="$(DNANEXUS_HOME)/lib/rubygems"; gem install dxruby*.gem

contrib/ruby/lib/dxruby/version.rb:
(if [ ! -e lib/dxruby/version.rb ]; then \
echo -e "module DX\n VERSION = \"0.0.0\"\nend\n" > lib/dxruby/version.rb; \
fi)
(if [ -d "$(DNANEXUS_HOME)/.git" ]; then \
perl -e '$$ENV{GIT_TOOLKIT_VERSION} =~ /^v(\d+.\d+.\d+)/ and print "module DX\n VERSION = \"$$1\"\nend\n"' > lib/dxruby/version.rb; \
fi)

lib/dxruby/api.rb: ../../src/api_wrappers/wrapper_table.json generateRubyAPIWrappers.py
cat ../../src/api_wrappers/wrapper_table.json | ./generateRubyAPIWrappers.py > lib/dxruby/api.rb

doc:
rm -rf ../../doc/ruby
yard --output-dir ../../doc/ruby

.PHONY: default ruby doc
File renamed without changes.
28 changes: 17 additions & 11 deletions src/ruby/Readme.md → contrib/ruby/Readme.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
dxruby: DNAnexus Ruby API
=========================

[API Documentation](http://autodoc.dnanexus.com/bindings/ruby/current/)
DNAnexus Ruby API
=================

Build dependencies
------------------
Expand All @@ -24,17 +22,25 @@ toolchain. Instead, use `brew install ruby` to install the
Building
--------

make ruby
make
# For API documentation...
make doc

Using the package
-----------------

The `environment` file will prepend to your `GEM_PATH` (see
[Installing the toolkit](#installing-the-toolkit)). To use `dxruby`, run:
Set `GEM_PATH` appropriately:

export GEM_PATH="${DNANEXUS_HOME}/lib/rubygems:$GEM_PATH"

Then, in your Ruby code:

```
require 'rubygems'
require 'dxruby'
```
require 'rubygems'
require 'dxruby'

In Ruby 1.9, `require 'rubygems'` is not necessary.

Tests / Sample Code
-------------------

ruby test/test_dxruby.rb
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 0 additions & 4 deletions debian/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
/dx-toolkit.*
/dx-java-bindings/
/dx-java-bindings.*
/dx-perl-bindings/
/dx-perl-bindings.*
/dx-r-bindings/
/dx-r-bindings.*
/dx-ruby-bindings/
/dx-ruby-bindings.*
/files
14 changes: 1 addition & 13 deletions debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Maintainer: Phil Sung <[email protected]>
Section: science
Priority: optional
Standards-Version: 3.9.3
Build-Depends: debhelper (>= 8), python-virtualenv, libboost1.55-all-dev | libboost1.48-all-dev, r-base-core, libdist-zilla-perl, openjdk-7-jdk, maven2
Build-Depends: debhelper (>= 8), python-virtualenv, libboost1.55-all-dev | libboost1.48-all-dev, r-base-core, openjdk-7-jdk, maven2

Package: dx-toolkit
Architecture: any
Expand All @@ -18,15 +18,3 @@ Architecture: any
Depends: ${misc:Depends}, openjdk-7-jre-headless | openjdk-8-jre-headless, dx-toolkit
Description: Java bindings to DNAnexus Platform
Bindings for interacting with the DNAnexus platform from Java.

Package: dx-perl-bindings
Architecture: any
Depends: ${misc:Depends}, ${perl:Depends}, perl, dx-toolkit
Description: Perl bindings to DNAnexus Platform
Bindings for interacting with the DNAnexus platform from Perl.

Package: dx-ruby-bindings
Architecture: any
Depends: ${misc:Depends}, ruby1.9.1, dx-toolkit, ruby-json
Description: Ruby bindings to DNAnexus Platform
Bindings for interacting with the DNAnexus platform from Ruby.
2 changes: 0 additions & 2 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,5 @@ override_dh_auto_build:
override_dh_auto_install:
DESTDIR="$(CURDIR)/debian/dx-toolkit" PREFIX="/usr" $(MAKE) -C src debian_install
DESTDIR="$(CURDIR)/debian/dx-java-bindings" PREFIX="/usr" $(MAKE) -C src debian_java_install
DESTDIR="$(CURDIR)/debian/dx-perl-bindings" PREFIX="/usr" $(MAKE) -C src debian_perl_install
DESTDIR="$(CURDIR)/debian/dx-ruby-bindings" PREFIX="/usr" $(MAKE) -C src debian_ruby_install

override_dh_auto_test:
3 changes: 0 additions & 3 deletions environment
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,12 @@ if [ "$DNANEXUS_HOME" == "/etc/profile.d" ]; then
# Private Python packages. We really ought not pollute PYTHONPATH with these though.
export PYTHONPATH="/usr/share/dnanexus/lib/python2.7/site-packages:$PYTHONPATH"
export CLASSPATH="/usr/share/java/dnanexus-api-0.1.0.jar:${CLASSPATH}"
export GEM_PATH="/usr/share/dnanexus/lib/rubygems:$GEM_PATH"

else

export PATH="${DNANEXUS_HOME}/bin:$PATH"
export PYTHONPATH="${DNANEXUS_HOME}/share/dnanexus/lib/python2.7/site-packages:${DNANEXUS_HOME}/lib/python:$PYTHONPATH"
export PERL5LIB="${DNANEXUS_HOME}/lib/perl5:$PERL5LIB"
export CLASSPATH="${DNANEXUS_HOME}/lib/java/*:${CLASSPATH}"
export GEM_PATH="${DNANEXUS_HOME}/lib/rubygems:$GEM_PATH"

fi

Expand Down
12 changes: 0 additions & 12 deletions environment.csh
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,10 @@ else
setenv PYTHONPATH "$DNANEXUS_HOME/share/dnanexus/lib/python2.7/site-packages:$DNANEXUS_HOME/lib/python"
endif

if $?PERL5LIB then
setenv PERL5LIB "$DNANEXUS_HOME/lib/perl5:$PERL5LIB"
else
setenv PERL5LIB "$DNANEXUS_HOME/lib/perl5"
endif

if $?CLASSPATH then
setenv CLASSPATH "$DNANEXUS_HOME/lib/java/*:$CLASSPATH"
else
setenv CLASSPATH "$DNANEXUS_HOME/lib/java/*"
endif

if $?GEM_PATH then
setenv GEM_PATH "$DNANEXUS_HOME/lib/rubygems:$GEM_PATH"
else
setenv GEM_PATH "$DNANEXUS_HOME/lib/rubygems"
endif

setenv PYTHONIOENCODING UTF-8
Loading

0 comments on commit ee24f96

Please sign in to comment.