summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz Gozdek2020-07-06 13:45:22 +0200
committerMateusz Gozdek2020-09-19 19:21:28 +0200
commit7d335c85637aa032a441b2f631dac282af30692b (patch)
tree21fdf9c0cc7a77a3bd03ec07f128bde0047bcc87
parent50b5f249347dae109f108eb77e46d3e69b3f3544 (diff)
downloadaur-7d335c85637aa032a441b2f631dac282af30692b.tar.gz
Add Dockerfile and .travis.yml
This commit adds Dockerfile, which can simulate building the package on bare Arch Linux installation and .travis.yml file, which will tell Travis CI to build this image on every commit to make sure that the package builds properly. Signed-off-by: Mateusz Gozdek <mgozdekof@gmail.com>
-rw-r--r--.travis.yml4
-rw-r--r--Dockerfile25
2 files changed, 29 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 000000000000..f81563eaa5d9
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,4 @@
+services:
+- docker
+script:
+- docker build --pull .
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 000000000000..eb2e4373baf2
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,25 @@
+FROM archlinux
+
+# base-devel is required for building.
+#
+# gtk3 is an optional dependency, but to that all linked libraries are satisfied,
+# we also install it.
+RUN pacman -Syy --noconfirm base-devel gtk3
+
+RUN useradd build
+
+RUN bash -c "echo 'build ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/build"
+
+COPY . /home/build/src/droidcam
+
+WORKDIR /home/build/src/droidcam
+
+RUN chown build: -R /home/build/src
+
+RUN sudo -u build makepkg -scir --noconfirm
+
+# List all linked dependencies.
+RUN bash -c 'ldd $(which droidcam) $(which droidcam-cli)'
+
+# If some linked libraries are not found, fail.
+RUN bash -c '(ldd $(which droidcam) $(which droidcam-cli) | grep "not found" && exit 1) || exit 0'