Skip to content

Commit

Permalink
Merge pull request #520 from keithj/remove-c-src
Browse files Browse the repository at this point in the history
Removed C utilities, replaced from Conda channel.
  • Loading branch information
dkj authored Jun 2, 2018
2 parents 0eeda38 + 19e00d6 commit d2995fb
Show file tree
Hide file tree
Showing 28 changed files with 45 additions and 5,760 deletions.
8 changes: 6 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,29 @@ env:
- TRAVIS_NODE_VERSION="6.12.2"
- TRAVIS_NPM_VERSION="4.5.0"
- TRAVIS_YARN_VERSION="1.3.2"
- TRAVIS_PYTHON_VERSION="2.7"
- WTSI_NPG_GITHUB_URL=https://github.com/wtsi-npg
- IRODS_VERSION=4.1.10 PG_PLUGIN_VERSION=1.10 PLATFORM=ubuntu12
- CONDA_CHANNEL=https://dnap.cog.sanger.ac.uk/npg/conda/test/Ubuntu/12.04/
- CONDA_TEST_ENV=test-environment

before_install:
# workaround for iRODS buffer overflow
# see https://github.com/travis-ci/travis-ci/issues/5227
- sudo hostname "$(hostname | cut -c1-63)"
- sed -e "s/^\\(127\\.0\\.0\\.1.*\\)/\\1 $(hostname | cut -c1-63)/" /etc/hosts > /tmp/hosts
- sudo mv /tmp/hosts /etc/hosts
- ./.travis/before_install_conda.sh
- ./.travis/before_install_mysql57.sh
- ./.travis/before_install.sh

install:
- ./.travis/install.sh

script:
- export PATH=$IRODS_RIP_DIR/iRODS/clients/icommands/bin:$PATH
- ienv
- ils
- ilsresc -l
- export PATH="$HOME/miniconda/bin:$PATH"
- source activate "$CONDA_TEST_ENV"
- ./.travis/script.sh

20 changes: 20 additions & 0 deletions .travis/before_install_conda.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then
wget -q -w 30 https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh;
else
wget -q -w 30 https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
fi

/bin/bash miniconda.sh -b -p "$HOME/miniconda"
export PATH="$HOME/miniconda/bin:$PATH"
hash -r

conda config --set always_yes yes
conda config --set changeps1 no
conda config --set show_channel_urls true
conda update -q conda

conda config --add channels $CONDA_CHANNEL

# Useful for debugging any issues with conda
conda info -a
12 changes: 6 additions & 6 deletions .travis/before_install_mysql57.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ sudo rm -rf /var/log/mysql

# Get packages from oracle
sudo -E apt-get install libaio1 apparmor
wget http://downloads.mysql.com/archives/get/file/mysql-common_5.7.13-1ubuntu12.04_amd64.deb
wget http://downloads.mysql.com/archives/get/file/libmysqlclient20_5.7.13-1ubuntu12.04_amd64.deb
wget http://downloads.mysql.com/archives/get/file/mysql-community-client_5.7.13-1ubuntu12.04_amd64.deb
wget http://downloads.mysql.com/archives/get/file/mysql-client_5.7.13-1ubuntu12.04_amd64.deb
wget http://downloads.mysql.com/archives/get/file/mysql-community-server_5.7.13-1ubuntu12.04_amd64.deb
wget http://downloads.mysql.com/archives/get/file/mysql-server_5.7.13-1ubuntu12.04_amd64.deb
wget -q http://downloads.mysql.com/archives/get/file/mysql-common_5.7.13-1ubuntu12.04_amd64.deb
wget -q http://downloads.mysql.com/archives/get/file/libmysqlclient20_5.7.13-1ubuntu12.04_amd64.deb
wget -q http://downloads.mysql.com/archives/get/file/mysql-community-client_5.7.13-1ubuntu12.04_amd64.deb
wget -q http://downloads.mysql.com/archives/get/file/mysql-client_5.7.13-1ubuntu12.04_amd64.deb
wget -q http://downloads.mysql.com/archives/get/file/mysql-community-server_5.7.13-1ubuntu12.04_amd64.deb
wget -q http://downloads.mysql.com/archives/get/file/mysql-server_5.7.13-1ubuntu12.04_amd64.deb
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password password \"''\""
sudo debconf-set-selections <<< "mysql-server mysql-server/root_password_again password \"''\""
sudo dpkg-preconfigure mysql-community-server_5.7.13-1ubuntu12.04_amd64.deb
Expand Down
6 changes: 5 additions & 1 deletion .travis/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ WTSI_NPG_BUILD_BRANCH=${WTSI_NPG_BUILD_BRANCH:=$TRAVIS_BRANCH}
IRODS_RIP_DIR=${IRODS_RIP_DIR:+$IRODS_RIP_DIR}

sudo apt-get install libgd2-xpm-dev # For npg_tracking
sudo apt-get install liblzma-dev # For npg_qc

# CPAN as in npg_npg_deploy
cpanm --notest --reinstall App::cpanminus
Expand All @@ -26,6 +25,11 @@ cpanm --quiet --notest Alien::Tidyp
cpanm --quiet --notest LWP::Protocol::https
cpanm --quiet --notest https://github.com/chapmanb/vcftools-cpan/archive/v0.953.tar.gz

# Conda
export PATH="$HOME/miniconda/bin:$PATH"
conda create -q --name "$CONDA_TEST_ENV" python=$TRAVIS_PYTHON_VERSION
conda install --name "$CONDA_TEST_ENV" npg_qc_utils

# iRODS
wget -q https://github.com/wtsi-npg/disposable-irods/releases/download/${DISPOSABLE_IRODS_VERSION}/disposable-irods-${DISPOSABLE_IRODS_VERSION}.tar.gz -O /tmp/disposable-irods-${DISPOSABLE_IRODS_VERSION}.tar.gz
tar xfz /tmp/disposable-irods-${DISPOSABLE_IRODS_VERSION}.tar.gz -C /tmp
Expand Down
123 changes: 4 additions & 119 deletions Build.PL
Original file line number Diff line number Diff line change
Expand Up @@ -10,131 +10,16 @@ my $class = npg_tracking::util::build->subclass(code => <<'EOF');
use npg_tracking::util::abs_path qw(abs_path);
use File::Basename;
my $C_SOURCE_DIR = q[src];
my $c_tools = {};
if (which('lsb_release') and `lsb_release -a` =~ /precise/ismx) {
$c_tools->{'fastq_summ'} = {'copy' => [qw/fastq_summ/],
'samtools' => 1};
$c_tools->{'fastqcheck'} = {'copy' => [qw/fastqcheck/],
'samtools' => 1};
$c_tools->{'gt_utils'} = {'copy' => [qw/find_gt_match gt_pack/], };
$c_tools->{'norm_fit'} = {'copy' => [qw/norm_fit/], };
}
sub _c_build_dir {
return join(q[/], $C_SOURCE_DIR, shift, 'build');
}
sub _c_src_dir {
return join(q[/], $C_SOURCE_DIR, shift);
}
sub _samtools_option {
my $self = shift;
my ($samtools, $htslib);
# Requires the samtools source code to build
if ($ENV{SAMTOOLS_SOURCE_PATH}) {
$samtools = $ENV{SAMTOOLS_SOURCE_PATH};
} else {
$samtools = _relative_to_bin('samtools')
}
if ($ENV{HTSLIB_INSTALL_PATH}) {
$htslib = $ENV{HTSLIB_INSTALL_PATH};
} else {
$htslib = _relative_to_bin('htsfile')
}
my @pkgs;
if ($samtools && $htslib) {
push @pkgs, "SAMTOOLS_LOC=$samtools";
push @pkgs, "HTSLIB_LOC=$htslib";
if ($self->verbose) {
warn "Found samtools source $samtools\n";
warn "Found htslib installed $htslib\n";
}
}
return \@pkgs;
}
sub _relative_to_bin {
my ($executable) = @_;
my $path;
my @found = which($executable);
if (@found) {
$path = dirname abs_path($found[0]);
if ($path =~ m{/bin\Z}smx) {
$path = dirname $path;
}
}
return $path;
}
sub ACTION_build {
my $self = shift;
$self->SUPER::ACTION_build;
# Build C executables
foreach my $tool ( keys %{$c_tools} ) {
if ($self->verbose) {
warn "Building $tool\n";
}
my $bdir = _c_build_dir($tool);
make_path $bdir;
my $silent = $self->verbose ? q[] : '--silent';
my $extra_info = q[];
if ($c_tools->{$tool}->{'samtools'}) {
my @pkgs = @{$self->_samtools_option()};
if (!@pkgs) {
warn 'samtools and htslib locations not declared or detected, ' .
"skipping $tool build\n";
next;
}
$extra_info = join q[ ], @pkgs;
}
my $command = sprintf 'make %s --directory %s %s',
$silent, _c_src_dir($tool), $extra_info;
if (system $command) {
die "Failed to compile $tool";
}
foreach my $ename ( @{$c_tools->{$tool}->{'copy'}} ) {
$self->copy_if_modified(
from => join(q[/], $bdir, $ename),
to_dir => join(q[/], $self->base_dir(), $self->blib(), 'script'),
flatten => 1);
}
}
# Build R script
$self->copy_if_modified(
from => 'lib/R/gc_bias_data.R',
to_dir => join(q[/], $self->base_dir(), $self->blib()),
flatten => 0);
}
sub ACTION_clean {
my $self = shift;
$self->SUPER::ACTION_clean;
foreach my $tool ( keys %{$c_tools} ) {
if ($self->verbose) {
warn "Cleaning $tool\n";
}
my $silent = $self->verbose ? q[] : '--silent';
system "make clean $silent --directory " . _c_src_dir($tool);
remove_tree _c_build_dir($tool);
}
}
EOF

my $requires = {
Expand All @@ -159,21 +44,21 @@ my $requires = {
'Fcntl' => 0,
'File::Basename' => 0,
'File::Glob' => 0,
'File::Path' => 0,
'File::Path' => 0,
'File::Spec' => 0,
'File::Spec::Functions' => 0,
'File::Slurp' => 0,
'File::Temp' => 0,
'FindBin' => '1.47',
'Getopt::Long' => '2.37',
'Getopt::Std' => 0,
'HTTP::Request' => 0,
'Getopt::Std' => 0,
'HTTP::Request' => 0,
'IPC::SysV' => 0,
'IO::Compress::Xz' => '2.068',
'IO::Uncompress::UnXz' => '2.068',
'JSON' => '2.12',
'JSON::XS' => 0,
'lib' => 0,
'lib' => 0,
'List::MoreUtils' => 0,
'List::Util' => 0,
'LWP::UserAgent' => 0,
Expand Down
16 changes: 0 additions & 16 deletions MANIFEST
Original file line number Diff line number Diff line change
Expand Up @@ -173,22 +173,6 @@ lib/R/gc_bias_data.R
MANIFEST
README
scripts/npgqc_dbix_schema_loader.pl
src/fastq_summ/Makefile
src/fastq_summ/fastq_summ.c
src/fastq_summ/fastqcheck.c
src/fastq_summ/fastqcheck.h
src/gt_utils/Makefile
src/gt_utils/README
src/gt_utils/find_gt_match.c
src/gt_utils/fld_desc.c
src/gt_utils/fld_desc.h
src/gt_utils/gt_pack.c
src/gt_utils/gt_pack.h
src/gt_utils/intvec.c
src/gt_utils/intvec.h
src/window_depth.d
src/norm_fit/Makefile
src/norm_fit/norm_fit.c
t/00-critic.t
t/00-distribution.t
t/00-podcoverage.t
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ scripts directory:

src directory:
--------------
source code for C utilities
Moved to https://github.com/wtsi-npg/npg_qc_utils

t directory:
------------
Expand Down
45 changes: 0 additions & 45 deletions src/fastq_summ/Makefile

This file was deleted.

Loading

0 comments on commit d2995fb

Please sign in to comment.