Skip to content

Commit

Permalink
add macos conda build
Browse files Browse the repository at this point in the history
  • Loading branch information
cjw85 committed Aug 9, 2021
1 parent fa355d3 commit 556f6a4
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 13 deletions.
9 changes: 8 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,16 @@ deploy-checks:
- if: '$CI_COMMIT_TAG =~ /^v[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+$/'

conda:
extends: .deploy-conda
extends: .deploy-conda-linux
before_script:
- *prep-image
- export CONDA_PKG=${CI_PROJECT_NAME}
- export CONDA_PKG_VERSION=${CI_COMMIT_TAG/v/}
- cd conda

conda-mac:
extends: .deploy-conda-mac
before_script:
- export CONDA_PKG=${CI_PROJECT_NAME}
- export CONDA_PKG_VERSION=${CI_COMMIT_TAG/v/}
- cd conda
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [v0.1.1]
### Fixed
- Check input files are present and readable rather than segfaulting.
### Changed
- Clearer error messaging.


## [v0.1.0]

First release.
10 changes: 3 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
OS := $(shell uname)
ifeq ($(OS), Darwin)
SEDI=sed -i '.bak'
# mainly for dev builds using homebrew things
export LIBRARY_PATH=/usr/local/Cellar/[email protected]/1.1.1k/lib
ARGP ?= /usr/local/Cellar/argp-standalone/1.3/lib/libargp.a
else
SEDI=sed -i
ARGP ?=
EXTRA_LDFLAGS ?= -L/usr/local/Cellar/[email protected]/1.1.1k/lib
ARGP ?= /usr/local/Cellar/argp-standalone/1.3/lib/libargp.a
endif

CC ?= gcc
Expand All @@ -26,7 +22,7 @@ htslib/libhts.a:
cd htslib/ \
&& autoheader \
&& autoconf \
&& CFLAGS="$(CFLAGS)" ./configure $(HTS_CONF_ARGS) \
&& CFLAGS="$(CFLAGS) $(EXTRA_CFLAGS)" ./configure $(HTS_CONF_ARGS) \
&& make -j 4


Expand Down
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Modified-base BAM to bedMethyl
------------------------------

Simple demonstration program of aggregating modified base counts stored in a
Simple program to aggregate modified base counts stored in a
[modified-base BAM](https://circle-production-customer-artifacts.s3.amazonaws.com/picard/548f4caff7d0cea1406e35e3/60e6b57a449db620ab0ea9b7-0-build/artifacts/pdfs/SAMtags.pdf?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20210725T133456Z&X-Amz-SignedHeaders=host&X-Amz-Expires=60&X-Amz-Credential=AKIAJR3Q6CR467H7Z55A%2F20210725%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=0590263dd0113d97f83c533f1e3633cdba6a9652a8a9f457d6a0eb0d188037ef) (Section 2.1) file to
a [bedMethyl](https://www.encodeproject.org/data-standards/wgbs/) file.

Expand All @@ -10,7 +10,13 @@ The code uses the `methylation` branch of htslib from

### Installation

Clone the repository and then use make:
The program is available from our conda channel, so can be installed with:

mamba create -n modbam2bed -c conda-forge -c epi2melabs modbam2bed

Packages are available for bothe Linux and MacOS.

Alternatively to install from the source code, clone the repository and then use make:

git clone --recursive <repository>
make modbam2bed
Expand Down
8 changes: 8 additions & 0 deletions conda/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ export HTS_CONF_ARGS="--prefix=${PREFIX} --enable-libcurl --with-libdeflate --en
export EXTRA_CFLAGS="-I$PREFIX/include"
export EXTRA_LDFLAGS="-L$PREFIX/lib"
export EXTRA_LIBS="-ldl -ldeflate"

OS=$(uname)
if [[ "$OS" == "Darwin" ]]; then
echo "Setting Darwin args"
export ARGP=${PREFIX}/lib/libargp.a
export EXTRA_CFLAGS="${EXTRA_CFLAGS} -isysroot ${CONDA_BUILD_SYSROOT} -mmacosx-version-min=${MACOSX_DEPLOYMENT_TARGET}"
fi

make clean $NAME

mkdir -p $PREFIX/bin
Expand Down
2 changes: 2 additions & 0 deletions conda/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CONDA_BUILD_SYSROOT:
- /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk # [osx]
4 changes: 2 additions & 2 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ requirements:
- {{ compiler('c') }}
host:
- autoconf
- argp-standalone # [osx]
- make
- binutils
- binutils # [not osx]
- libcurl
- bzip2
- xz
Expand Down Expand Up @@ -48,4 +49,3 @@ about:
extra:
recipe-maintainers:
- cjw85

2 changes: 1 addition & 1 deletion src/args.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "htslib/faidx.h"
#include "args.h"

const char *argp_program_version = "0.1.0";
const char *argp_program_version = "0.1.1";
const char *argp_program_bug_address = "[email protected]";
static char doc[] =
"modbam2bed -- summarise a BAM with modified base tags to bedMethyl.\
Expand Down

0 comments on commit 556f6a4

Please sign in to comment.