Skip to content

Commit

Permalink
Automatically download a statically-linked copy of Pandoc during `mak…
Browse files Browse the repository at this point in the history
…e deps`

This removes a big (optional) dep and makes it easier to generate
documentation on a variety of machines.  It also guarantees us a
specific version.
  • Loading branch information
tsibley committed Mar 5, 2018
1 parent 6765891 commit 593693e
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/bin/liftOver.Linux
/config_local.*
/bin/cpanm
/bin/pandoc
/local
29 changes: 24 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,25 @@ export SHELLOPTS:=errexit:pipefail
SYS := $(shell uname -s)
ARCH := $(shell uname -m)

PANDOC_VERSION ?= 2.1.1

ifeq ($(SYS), Darwin)
OS := macOSX
LIFTOVER_SYS := macOSX
PANDOC_PKG := pandoc-$(PANDOC_VERSION)-macOS.zip
PANDOC_EXTRACT := unzip -DD -o
else ifeq ($(SYS), Linux)
OS := linux
LIFTOVER_SYS := linux
PANDOC_PKG := pandoc-$(PANDOC_VERSION)-linux.tar.gz
PANDOC_EXTRACT := tar xzvmf
else
OS := $(SYS)
LIFTOVER_SYS := $(SYS)
endif

cpanm := bin/cpanm

curl := curl -fsSL

deps: $(cpanm) liftover perl-deps hg-data
deps: $(cpanm) pandoc liftover perl-deps hg-data

perl-deps: cpanfile
mkdir -p local
Expand All @@ -27,6 +33,19 @@ $(cpanm):
$(curl) https://raw.githubusercontent.com/miyagawa/cpanminus/master/cpanm > $@
chmod +x $@

pandoc: bin/pandoc

bin/pandoc: cache/pandoc-$(PANDOC_VERSION)/bin/pandoc
ln -snvf ../$< $@

cache/pandoc-$(PANDOC_VERSION)/bin/pandoc: cache/$(PANDOC_PKG)
cd cache && $(PANDOC_EXTRACT) $(<:cache/%=%) $(@:cache/%=%)
chmod +x $@

cache/$(PANDOC_PKG):
mkdir -p cache
$(curl) https://github.com/jgm/pandoc/releases/download/$(PANDOC_VERSION)/$(PANDOC_PKG) > $@

liftover: bin/liftOver.$(SYS) cache/hg19ToHg38.over.chain.gz

bin/liftOver.$(SYS):
Expand All @@ -35,7 +54,7 @@ bin/liftOver.$(SYS):
@echo
@echo "Type Ctrl-C (^C) to abort or enter to proceed."
@read
$(curl) http://hgdownload.soe.ucsc.edu/admin/exe/$(OS).$(ARCH)/liftOver > $@
$(curl) http://hgdownload.soe.ucsc.edu/admin/exe/$(LIFTOVER_SYS).$(ARCH)/liftOver > $@
chmod +x $@

cache/hg19ToHg38.over.chain.gz:
Expand Down
2 changes: 1 addition & 1 deletion bin/generate-website
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ if [[ $refresh_docs == yes ]]; then
done

if [[ $doc_failed -eq 1 ]]; then
echo "Warning: Couldn't generate documentation, but succeeding anyway. Is pandoc installed?"
echo "Warning: Couldn't generate documentation but continuing on…"
fi

echo "Indexing documentation"
Expand Down
11 changes: 4 additions & 7 deletions doc/Install.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ contacting a local expert familiar with your computing systems.

[Perl](https://www.perl.org) 5.14 or later, standard Unix tools including
`make`, and [libcurl](https://curl.haxx.se) are all required to run the ISDB
tools. [Pandoc](http://pandoc.org) 2.0 or later is used for generating
documentation web pages. It is optional but recommended.
tools.

ISDB is designed to use [PostgreSQL](https://www.postgresql.org) as the
database server. You must either have "superuser" access to a PostgreSQL
Expand All @@ -33,17 +32,14 @@ server, or access to the owner role of a database set up for your use.

2. Download and install [Postgres.app](http://postgresapp.com)

3. Install [pandoc](http://pandoc.org/installing.html) with its installer
package

MacOS versions starting with 10.9 (Mavericks), released in 2013, include a
sufficiently new version of Perl to run all the ISDB tools. libcurl is included
with macOS as well.

## Installing prerequisites on Debian or Ubuntu

1. Install packaged dependencies:
`apt-get install build-essential pkg-config libcurl4-gnutls-dev pandoc`
`apt-get install build-essential pkg-config libcurl4-gnutls-dev`

2. Set up the PostgreSQL APT repository appropriate for your system
[Debian](https://www.postgresql.org/download/linux/debian/),
Expand All @@ -62,7 +58,7 @@ These instructions should also work on Fedora and other RHEL variants, although
they've only been tested on CentOS 7.

1. Install packaged dependencies:
`yum install @development libcurl-devel pandoc perl-core`
`yum install @development libcurl-devel perl-core`

2. Set up the [PostgreSQL yum repository](https://www.postgresql.org/download/linux/redhat/)
for at least Pg 9.4 or newer following their instructions
Expand All @@ -83,6 +79,7 @@ directory:
* The UCSC Genome Browser's `liftOver` tool
* The `liftOver` chain file for mapping hg19 to hg38 coordinates
* Gene annotation and chromosome metadata from the [NCBI](https://www.ncbi.nlm.nih.gov)
* [Pandoc](http://pandoc.org) for generating documentation web pages

# Create the database

Expand Down

0 comments on commit 593693e

Please sign in to comment.