Skip to content

Commit

Permalink
fix static builds
Browse files Browse the repository at this point in the history
  • Loading branch information
brentp committed Sep 27, 2019
1 parent c34614c commit bdce63b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
22 changes: 9 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,35 @@
FROM alpine:3.10

ENV CFLAGS="-DCURL_STATICLIB -fPIC -O3"
ENV CFLAGS="-fPIC -O3"

RUN apk add wget git xz bzip2 musl m4 autoconf tar xz-dev bzip2-dev \
build-base libpthread-stubs libssh2-dev \
openssl-dev nghttp2-static \
curl-dev curl-static libssh2-static && \
mkdir -p /usr/local/include && \
RUN apk add wget git xz bzip2 musl m4 autoconf tar xz-dev bzip2-dev build-base libpthread-stubs # gcc abuild binutils binutils-doc gcc-doc

RUN mkdir -p /usr/local/include && \
git clone --depth 1 https://github.com/ebiggers/libdeflate.git && \
cd libdeflate && make -j 2 libdeflate.a && \
cp libdeflate.a /usr/local/lib && cp libdeflate.h /usr/local/include && \
cd libdeflate && make -j4 CFLAGS="-fPIC -O3" install && \
cd .. && rm -rf libdeflate && \
git clone https://github.com/cloudflare/zlib cloudflare-zlib && \
cd cloudflare-zlib && ./configure && make install && \
cd .. && \
rm -rf cloudflare-zlib

RUN cd / && \
git clone -b v0.20.2 git://github.com/nim-lang/nim nim && \
git clone -b v1.0.0 git://github.com/nim-lang/nim nim && \
cd nim && sh ./build_all.sh && \
rm -rf csources && \
echo 'PATH=/nim/bin:$PATH' >> ~/.bashrc && \
echo 'PATH=/nim/bin:$PATH' >> ~/.bash_profile && \
echo 'PATH=/nim/bin:$PATH' >> /etc/environment

ENV PATH=/nim/bin:/root/.nimble/bin:$PATH
ENV PATH=:/root/.nimble/bin:/nim/bin/:$PATH

RUN \
git clone https://github.com/samtools/htslib && \
cd htslib && git checkout 1.9 && autoheader && autoconf && \
CFLAGS="-fPIC -O3 -DCURL_STATICLIB" ./configure --enable-libcurl --with-libdeflate CFLAGS="-fPIC -O3 -DCURL_STATICLIB" && \
make -j4 CFLAGS="-fPIC -O3 -DCURL_STATICLIB" install && \
./configure --disable-s3 --disable-libcurl --with-libdeflate && \
make -j4 CFLAGS="-fPIC -O3" install && \
cd ../ && rm -rf htslib

#nimble install -y c2nim@#3ec45c24585ebaed && \
ADD . /src/
RUN cat /src/docker/docker.nim.cfg >> /nim/config/nim.cfg && \
source ~/.bashrc && cd /src/ && nimble install -y && \
Expand Down
15 changes: 8 additions & 7 deletions docker/docker.nim.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,25 @@
@if nsb_static:
passC:"-static"
passl:"-static"
passl:"-no-pie"

passl:"/usr/local/lib/libhts.a"
passl:"/usr/lib/libm.a"
#passl:"/usr/local/lib/libnghttp2.a"
passl:"/usr/local/lib/libhts.a"
passl:"/usr/local/lib/libdeflate.a"
passl:"/usr/lib/liblzma.a"
passl:"/usr/lib/libcurl.a"
passl:"/usr/local/lib/libz.a"
passl:"/usr/lib/libbz2.a"
passl:"/usr/lib/libpthread.a"
passl:"/usr/lib/libdl.a"
passl:"/usr/lib/libc.a"
passl:"/usr/lib/librt.a"

passl:"/usr/lib/libssl.a"
passl:"/usr/lib/libcrypto.a"
passl:"/usr/lib/libssh2.a"
passl:"/usr/lib/libnghttp2.a"
# passl:"/usr/local/lib/libnghttp2.a"
# passl:"/usr/lib/libcurl.a"
# passl:"/usr/lib/libssl.a"
# passl:"/usr/lib/libcrypto.a"
# passl:"/usr/lib/libssh2.a"
# passl:"/usr/lib/libnghttp2.a"

dynlibOverride:"hts"
@end
2 changes: 1 addition & 1 deletion hts.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ skipFiles = @["teloage.nim"]
import ospaths,strutils

task test, "run the tests":
exec "nim c --lineDir:on --debuginfo -r tests/all"
exec "nim c -d:useSysAssert -d:useGcAssert --lineDir:on --debuginfo -r tests/all"

#before test:
# exec "c2nim src/hts/private/hts_concat.h"
Expand Down

0 comments on commit bdce63b

Please sign in to comment.