I am trying to build a static linked binary of my some tool I wrote that utilizes readline. I am using alpine:edge docker image - here is the dockerfile content (basically it is durosoft/crystal-alpine):
FROM alpine:edge
RUN apk add --update --no-cache --force-overwrite \
openssl openssl-dev crystal shards g++ gc-dev \
libc-dev libevent-dev libxml2-dev llvm llvm-dev \
llvm-static make pcre-dev readline-dev \
yaml-dev zlib-dev zlib ncurses-dev
But it fails complaining about cannot find -lncursesw (this usually means you need to install the development package for libncursesw):
# shards build --static
Dependencies are satisfied
Building: ootb
Error target ootb failed to compile:
/usr/lib/gcc/x86_64-alpine-linux-musl/8.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lncursesw (this usually means you need to install the development package for libncursesw)
collect2: error: ld returned 1 exit status
Error: execution of command failed with code: 1: `cc "${@}" -o '/work/ootb/bin/ootb' -rdynamic -static /usr/lib/libreadline.a -lncursesw -lz `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'` `command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'` /usr/lib/libpcre.a /usr/lib/libm.a /usr/lib/libgc.a /usr/lib/libpthread.a /usr/lib/crystal/core/ext/libcrystal.a /usr/lib/libevent.a /usr/lib/librt.a -L/usr/lib -L/usr/local/lib`
Can somebody please help? What is “cursesw” lib? I tried to “apk add” it but it fails anyway:
# apk add ncursesw
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
ncursesw (missing):
required by: world[ncursesw]