Skip to content

Commit

Permalink
build(vips): meson build for libvips (cshum#87)
Browse files Browse the repository at this point in the history
* build(vips): meson build for libvips
  • Loading branch information
cshum authored Jul 26, 2022
1 parent d2dd888 commit a735516
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
env:
VIPS_VERSION: 8.13.0
name: test

on: [push, pull_request]
Expand All @@ -10,6 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
env:
CGO_CFLAGS_ALLOW: -Xpreprocessor
VIPS_VERSION: 8.13.0
strategy:
matrix:
os: [ubuntu-20.04]
Expand All @@ -31,12 +30,14 @@ jobs:
sudo add-apt-repository -y ppa:strukturag/libheif
sudo apt-get update
sudo apt-get install -y \
python3-pip ninja-build \
glib-2.0-dev libexpat-dev librsvg2-dev libpng-dev \
libjpeg-turbo8-dev libimagequant-dev libfftw3-dev \
libpoppler-glib-dev libxml2-dev \
libopenslide-dev libcfitsio-dev liborc-0.4-dev \
libtiff5-dev libgsf-1-dev giflib-tools libwebp-dev libheif-dev \
libopenjp2-7 libcgif-dev
sudo pip3 install meson
- name: Vips cache
uses: actions/cache@v1
with:
Expand All @@ -50,17 +51,15 @@ jobs:
wget https://github.com/libvips/libvips/releases/download/v${{ env.VIPS_VERSION }}/vips-${{ env.VIPS_VERSION }}.tar.gz
tar xf vips-${{ env.VIPS_VERSION }}.tar.gz
cd vips-${{ env.VIPS_VERSION }}
CFLAGS="-g -O3" CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -g -O3" \
./configure \
--disable-debug \
--disable-dependency-tracking \
--disable-introspection \
--disable-static \
--enable-gtk-doc-html=no \
--enable-gtk-doc=no \
--enable-pyvips8=no
make
sudo make install
meson setup _build \
--buildtype=release \
--strip \
--prefix=/usr/local \
--libdir=lib \
-Dgtk_doc=false \
-Dintrospection=false
ninja -C _build
sudo ninja -C _build install
sudo ldconfig
- name: Get dependencies
Expand Down
25 changes: 13 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,20 @@ RUN DEBIAN_FRONTEND=noninteractive \
curl -fsSLO https://github.com/libvips/libvips/releases/download/v${VIPS_VERSION}/vips-${VIPS_VERSION}.tar.gz && \
tar zvxf vips-${VIPS_VERSION}.tar.gz && \
cd /tmp/vips-${VIPS_VERSION} && \
CFLAGS="-g -O3" CXXFLAGS="-D_GLIBCXX_USE_CXX11_ABI=0 -g -O3" \
./configure \
--disable-debug \
--disable-dependency-tracking \
--disable-introspection \
--disable-static \
--enable-gtk-doc-html=no \
--enable-gtk-doc=no \
--enable-pyvips8=no && \
make && \
make install && \
meson setup _build \
--buildtype=release \
--strip \
--prefix=/usr/local \
--libdir=lib \
-Dgtk_doc=false \
-Dintrospection=false && \
ninja -C _build && \
ninja -C _build install && \
ldconfig && \
rm -rf /usr/local/lib/python*
rm -rf /usr/local/lib/python* && \
rm -rf /usr/local/lib/libvips-cpp.* && \
rm -rf /usr/local/lib/*.a && \
rm -rf /usr/local/lib/*.la

WORKDIR ${GOPATH}/src/github.com/cshum/imagor

Expand Down

0 comments on commit a735516

Please sign in to comment.