Skip to content

Commit

Permalink
Add meson+setuptools as alternative build system
Browse files Browse the repository at this point in the history
X-Thanks: David Seifert <SoapZA@users.noreply.github.com>
X-Thanks: Ivan Blagoev Topolsky <ivan.topolsky@bsse.ethz.ch>
  • Loading branch information
ozagordi committed Apr 19, 2018
1 parent 18af265 commit d52eb6e
Show file tree
Hide file tree
Showing 37 changed files with 843 additions and 4,244 deletions.
24 changes: 12 additions & 12 deletions .gitignore
Expand Up @@ -4,6 +4,7 @@
# Autotools cruft (NEVER check this into VCS)
Makefile
Makefile.in
.version
aclocal.m4
.deps/
.dirstamp
Expand All @@ -17,37 +18,36 @@ configure
depcomp
install-sh
missing
py-compile
ar-lib
/shorah

# generated tarball
shorah*.tar.bz2

# executables
b2w
contain
diri_sampler
fil
freqEst

# samtools lib
libbam.a

# python/perl scripts are generated by Autoconf from *.{py,pl}.in
# files, replacing the shebang in the process
fas2read.pl
src/scripts/amplian.py
src/scripts/dec.py
src/scripts/mm.py
src/scripts/shorah.py
src/scripts/snv.py

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class
py-compile

# OS X temporary files that should never be committed
.DS_Store
*.swp
*.lock
profile

# other intermediate stuff
build
.eggs
src/ShoRAH.egg-info/

# shorah output
shorah.log
8 changes: 6 additions & 2 deletions .travis.yml
@@ -1,13 +1,17 @@
language: c cpp
language: c cpp python

python:
- "3.6"

# GSL and Autotools needed
before_install:
- sudo add-apt-repository ppa:ondrej/autotools -y
- sudo apt-get update -qq
- sudo apt-get install -y gsl-bin libgsl0-dev autoconf automake-1.15 pkg-config m4
- source ~/virtualenv/python3.6/bin/activate

compiler:
- gcc

before_script: autoreconf -vif
script: ./configure && make -j1 && make distcheck
script: ./configure && make -j1 distcheck
File renamed without changes.
69 changes: 30 additions & 39 deletions Makefile.am
@@ -1,48 +1,38 @@
# install scripts in ${bindir}
bin_SCRIPTS = \
src/scripts/amplian.py \
src/scripts/dec.py \
src/scripts/mm.py \
src/scripts/shorah.py \
src/scripts/snv.py \
fas2read.pl
shorah
CLEANFILES = $(bin_SCRIPTS)
EXTRA_DIST = \
src/scripts/amplian.py.in \
src/scripts/dec.py.in \
src/scripts/mm.py.in \
src/scripts/shorah.py.in \
src/scripts/snv.py.in \
src/scripts/fas2read.pl.in \
src/samtools/COPYING
.version \
meson.build \
setup.py \
src/meson.build \
src/cpp/meson.build \
src/samtools/COPYING \
src/samtools/meson.build
BUILT_SOURCES = .version

fas2read.pl: src/scripts/fas2read.pl.in Makefile
$(SED) 's,[@]perldir[@],$(perldir),g' $< > $@
shorah: $(top_srcdir)/src/shorah/__main__.py Makefile
$(SED) 's,#!/usr/bin/env python3,#!/usr/bin/env $(PYTHON),g' $(top_srcdir)/src/shorah/__main__.py > $@

# actual C/C++ programs doing the real computation
bin_PROGRAMS = diri_sampler contain freqEst b2w fil
bin_PROGRAMS = diri_sampler b2w fil

diri_sampler_SOURCES = \
src/shorah/data_structures.hpp \
src/shorah/dpm_sampler.hpp \
src/shorah/dpm_sampler.cpp
src/cpp/data_structures.hpp \
src/cpp/dpm_sampler.hpp \
src/cpp/dpm_sampler.cpp
diri_sampler_CPPFLAGS = $(GSL_CFLAGS)
diri_sampler_LDADD = $(GSL_LIBS)

contain_SOURCES = \
src/shorah/contain.cpp

freqEst_SOURCES = \
src/shorah/freqEst.cpp

b2w_SOURCES = \
src/shorah/b2w.cpp
src/cpp/b2w.cpp
b2w_CXXFLAGS = $(PTHREAD_CFLAGS)
b2w_CPPFLAGS = -I$(top_srcdir)/src/samtools
b2w_LDADD = libbam.a $(ZLIB_LIBS) $(PTHREAD_LIBS)

fil_SOURCES = \
src/shorah/fil.cpp
src/cpp/fil.cpp
fil_CXXFLAGS = $(PTHREAD_CFLAGS)
fil_CPPFLAGS = $(GSL_CFLAGS) -I$(top_srcdir)/src/samtools
fil_LDADD = libbam.a $(ZLIB_LIBS) $(GSL_LIBS) $(PTHREAD_LIBS)
Expand Down Expand Up @@ -85,19 +75,14 @@ libbam_a_SOURCES = \
libbam_a_CPPFLAGS = $(ZLIB_CFLAGS) -D_USE_KNETFILE
libbam_a_CFLAGS = $(PTHREAD_CFLAGS)

# perl modules
dist_perl_DATA = \
src/perl/DNA.pm \
src/perl/NikoUtil.pm \
src/perl/ReadUtil.pm \
src/perl/Util.pm

# python modules
python_PYTHON = \
src/python/shorah_dec.py \
src/python/shorah_matching.py \
src/python/shorah_mm.py \
src/python/shorah_snv.py
dist_pkgpython_PYTHON = \
src/shorah/__main__.py \
src/shorah/amplicon.py \
src/shorah/cli.py \
src/shorah/shorah_snv.py \
src/shorah/shotgun.py
pkgpython_PYTHON = .version

# example files
dist_pkgdata_DATA = \
Expand All @@ -110,3 +95,9 @@ dist_ampliconpkgdata_DATA = \
examples/amplicon_test/ampli_sorted.bam \
examples/amplicon_test/amplicon_reads.fastq \
examples/amplicon_test/reference.fasta

# version handling
$(top_srcdir)/.version:
echo $(VERSION) > $@-t && mv $@-t $@
dist-hook:
echo $(VERSION) > $(distdir)/.tarball-version
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -132,10 +132,10 @@ These can be run one after the other, or one can invoke `shorah.py`, that runs
the whole process from bam file to frequency estimation and SNV calling.

## Coding style
All changes to the C++ code in `src/shorah` should always be formatted according to the included `.clang-format` style by doing
All changes to the C++ code in `src/cpp` should always be formatted according to the included `.clang-format` style by doing

clang-format -style=file -i src/shorah/*.[ch]pp
clang-format -style=file -i src/cpp/*.[ch]pp

in the root of the repository.

All changes to the python code in `src/python` and `src/scripts` should always be formatted conforming to the [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide. To this end, we advise to use [autopep8](https://pypi.python.org/pypi/autopep8).
All changes to the python code in `src/shorah` should always be formatted conforming to the [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide. To this end, we advise to use [autopep8](https://pypi.python.org/pypi/autopep8).

0 comments on commit d52eb6e

Please sign in to comment.