FROM archlinux:latest

ARG BUILD_PACKAGES="\
	benchmark \
	clang \
	cmake \
	boost \
	ffmpeg \
	gtest \
	graphicsmagick \
	libarchive \
	libconfig \
	make \
	pkgconfig \
	taglib \
	wt"

RUN	pacman -Syu --noconfirm
RUN pacman -S --noconfirm ${BUILD_PACKAGES}

# LMS
COPY . /tmp/lms/
ARG LMS_BUILD_TYPE="Release"
RUN \
	DIR=/tmp/lms/build && mkdir -p ${DIR} && cd ${DIR}  && \
		cmake /tmp/lms/ -DCMAKE_BUILD_TYPE=${LMS_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=/usr -DLMS_IMAGE_BACKEND=graphicsmagick -DBUILD_BENCHMARKS=ON && \
		VERBOSE=1 make -j$(nproc) && \
		make test
