summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cimg-1-add-option-exe-suffix-exesfx.patch52
-rw-r--r--src/cimg-2-split-cflags-to-define-and-incdir.patch169
-rw-r--r--src/cimg.mk58
3 files changed, 279 insertions, 0 deletions
diff --git a/src/cimg-1-add-option-exe-suffix-exesfx.patch b/src/cimg-1-add-option-exe-suffix-exesfx.patch
new file mode 100644
index 0000000..5760bc1
--- /dev/null
+++ b/src/cimg-1-add-option-exe-suffix-exesfx.patch
@@ -0,0 +1,52 @@
+This file is part of MXE.
+See index.html for further information.
+
+From 68ca8760276836154d4cc09585c21771856c1cf8 Mon Sep 17 00:00:00 2001
+From: Boris Nagaev <bnagaev@gmail.com>
+Date: Sun, 20 Sep 2015 18:18:36 +0300
+Subject: [PATCH] examples Makefile: add option exe suffix (EXESFX)
+
+On MinGW, `make Mwindows` produces executables without
+.exe suffix. Makefile did not provide an option to set
+the suffix of executables.
+
+ $ make CC=i686-w64-mingw32.static-gcc EXESFX=.exe ...
+---
+ examples/Makefile | 13 +++++++------
+ 1 file changed, 7 insertions(+), 6 deletions(-)
+
+diff --git a/examples/Makefile b/examples/Makefile
+index af16fdb..fda92d2 100644
+--- a/examples/Makefile
++++ b/examples/Makefile
+@@ -88,6 +88,11 @@ CIMG_VERSION = _cimg_version
+ X11PATH = /usr/X11R6
+ CC = g++
+ EXEPFX =
++ifeq ($(MSYSTEM),MINGW32)
++EXESFX = .exe
++else
++EXESFX =
++endif
+ CCVER = $(CC)
+ ifeq ($(notdir $(CC)),g++)
+ CCVER = `$(CC) -v 2>&1 | tail -n 1`
+@@ -248,13 +253,9 @@ endif
+ @echo
+ @echo "** Compiling '$* ($(CIMG_VERSION))' with '$(CCVER)'"
+ @echo
+- $(CC) -o $(EXEPFX)$* $< $(CFLAGS) $(CONF_CFLAGS) $(LIBS) $(CONF_LIBS)
++ $(CC) -o $(EXEPFX)$*$(EXESFX) $< $(CFLAGS) $(CONF_CFLAGS) $(LIBS) $(CONF_LIBS)
+ ifeq ($(STRIP_EXE),true)
+-ifeq ($(MSYSTEM),MINGW32)
+- strip $(EXEPFX)$*.exe
+-else
+- strip $(EXEPFX)$*
+-endif
++ strip $(EXEPFX)$*$(EXESFX)
+ endif
+ menu:
+ @echo
+--
+1.9.1
+
diff --git a/src/cimg-2-split-cflags-to-define-and-incdir.patch b/src/cimg-2-split-cflags-to-define-and-incdir.patch
new file mode 100644
index 0000000..0bb79fd
--- /dev/null
+++ b/src/cimg-2-split-cflags-to-define-and-incdir.patch
@@ -0,0 +1,169 @@
+This file is part of MXE.
+See index.html for further information.
+
+From db2da6e11d917fae648af3cd3c31190bc0fc8b74 Mon Sep 17 00:00:00 2001
+From: Boris Nagaev <bnagaev@gmail.com>
+Date: Sun, 20 Sep 2015 18:57:34 +0300
+Subject: [PATCH] examples Makefile: split CFLAGS to DEFINE, INCDIR
+
+Changes of INCDIR (-I) and DEFINE (-D, -m, -f) are now independent.
+It is convenient for cross-compilation with MinGW.
+---
+ examples/Makefile | 68 +++++++++++++++++++++++++++++++++++++++++--------------
+ 1 file changed, 51 insertions(+), 17 deletions(-)
+
+diff --git a/examples/Makefile b/examples/Makefile
+index af16fdb..81afc91 100644
+--- a/examples/Makefile
++++ b/examples/Makefile
+@@ -137,11 +137,15 @@ endif
+ ifeq ($(notdir $(CC)),icpc)
+ CIMG_OPENMP_CFLAGS = #-Dcimg_use_openmp -openmp -i-static # -> Seems to bug the compiler!
+ else
+-CIMG_OPENMP_CFLAGS = -Dcimg_use_openmp -fopenmp
++CIMG_OPENMP_DEFINE = -Dcimg_use_openmp -fopenmp
++CIMG_OPENMP_INCDIR =
++CIMG_OPENMP_CFLAGS = $(CIMG_OPENMP_DEFINE) $(CIMG_OPENMP_INCDIR)
+ endif
+
+ # Flags to enable OpenCV support.
+-CIMG_OPENCV_CFLAGS = -Dcimg_use_opencv -I/usr/include/opencv
++CIMG_OPENCV_DEFINE = -Dcimg_use_opencv
++CIMG_OPENCV_INCDIR = -I/usr/include/opencv
++CIMG_OPENCV_CFLAGS = $(CIMG_OPENCV_DEFINE) $(CIMG_OPENCV_INCDIR)
+ CIMG_OPENCV_LIBS = -lopencv_core -lopencv_highgui
+ #CIMG_OPENCV_LIBS = -lcv -lhighgui #-> Use this for OpenCV < 2.2.0
+
+@@ -151,7 +155,9 @@ CIMG_NODISPLAY_CFLAGS = -Dcimg_display=0
+ # Flags to enable the use of the X11 library.
+ # (X11 is used by CImg to handle display windows)
+ # !!! For 64bits systems : replace -L$(X11PATH)/lib by -L$(X11PATH)/lib64 !!!
+-CIMG_X11_CFLAGS = -I$(X11PATH)/include
++CIMG_X11_DEFINE =
++CIMG_X11_INCDIR = -I$(X11PATH)/include
++CIMG_X11_CFLAGS = $(CIMG_X11_DEFINE) $(CIMG_X11_INCDIR)
+ CIMG_X11_LIBS = -L$(X11PATH)/lib -lpthread -lX11
+
+ # Flags to enable fast image display, using the XSHM library (when using X11).
+@@ -160,63 +166,87 @@ CIMG_XSHM_CFLAGS = # -Dcimg_use_xshm
+ CIMG_XSHM_LIBS = # -lXext
+
+ # Flags to enable GDI32 display (Windows native).
+-CIMG_GDI32_CFLAGS = -mwindows
++CIMG_GDI32_DEFINE = -mwindows
++CIMG_GDI32_INCDIR =
++CIMG_GDI32_CFLAGS = $(CIMG_GDI32_DEFINE) $(CIMG_GDI32_INCDIR)
+ CIMG_GDI32_LIBS = -lgdi32
+
+ # Flags to enable screen mode switching, using the XRandr library (when using X11).
+ # ( http://www.x.org/wiki/Projects/XRandR )
+ # !!! Not supported by the X11 server on MacOSX, so do not use it on MacOSX !!!
+-CIMG_XRANDR_CFLAGS = -Dcimg_use_xrandr
++CIMG_XRANDR_DEFINE = -Dcimg_use_xrandr
++CIMG_XRANDR_INCDIR =
++CIMG_XRANDR_CFLAGS = $(CIMG_XRANDR_DEFINE) $(CIMG_XRANDR_INCDIR)
+ CIMG_XRANDR_LIBS = -lXrandr
+
+ # Flags to enable native support for PNG image files, using the PNG library.
+ # ( http://www.libpng.org/ )
+-CIMG_PNG_CFLAGS = -Dcimg_use_png
++CIMG_PNG_DEFINE = -Dcimg_use_png
++CIMG_PNG_INCDIR =
++CIMG_PNG_CFLAGS = $(CIMG_PNG_DEFINE) $(CIMG_PNG_INCDIR)
+ CIMG_PNG_LIBS = -lpng -lz
+
+ # Flags to enable native support for JPEG image files, using the JPEG library.
+ # ( http://www.ijg.org/ )
+-CIMG_JPEG_CFLAGS = -Dcimg_use_jpeg
++CIMG_JPEG_DEFINE = -Dcimg_use_jpeg
++CIMG_JPEG_INCDIR =
++CIMG_JPEG_CFLAGS = $(CIMG_JPEG_DEFINE) $(CIMG_JPEG_INCDIR)
+ CIMG_JPEG_LIBS = -ljpeg
+
+ # Flags to enable native support for TIFF image files, using the TIFF library.
+ # ( http://www.libtiff.org/ )
+-CIMG_TIFF_CFLAGS = -Dcimg_use_tiff
++CIMG_TIFF_DEFINE = -Dcimg_use_tiff
++CIMG_TIFF_INCDIR =
++CIMG_TIFF_CFLAGS = $(CIMG_TIFF_DEFINE) $(CIMG_TIFF_INCDIR)
+ CIMG_TIFF_LIBS = -ltiff
+
+ # Flags to enable native support for MINC2 image files, using the MINC2 library.
+ # ( http://en.wikibooks.org/wiki/MINC/Reference/MINC2.0_Users_Guide )
+-CIMG_MINC2_CFLAGS = -Dcimg_use_minc2 -I${HOME}/local/include
++CIMG_MINC2_DEFINE = -Dcimg_use_minc2
++CIMG_MINC2_INCDIR = -I${HOME}/local/include
++CIMG_MINC2_CFLAGS = $(CIMG_MINC2_DEFINE) $(CIMG_MINC2_INCDIR)
+ CIMG_MINC2_LIBS = -lminc_io -lvolume_io2 -lminc2 -lnetcdf -lhdf5 -lz -L${HOME}/local/lib
+
+ # Flags to enable native support for EXR image files, using the OpenEXR library.
+ # ( http://www.openexr.com/ )
+-CIMG_EXR_CFLAGS = -Dcimg_use_openexr -I/usr/include/OpenEXR
++CIMG_EXR_DEFINE = -Dcimg_use_openexr
++CIMG_EXR_INCDIR = -I/usr/include/OpenEXR
++CIMG_EXR_CFLAGS = $(CIMG_EXR_DEFINE) $(CIMG_EXR_INCDIR)
+ CIMG_EXR_LIBS = -lIlmImf -lHalf
+
+ # Flags to enable native support for various video files, using the FFMPEG library.
+ # ( http://www.ffmpeg.org/ )
+-CIMG_FFMPEG_CFLAGS = -Dcimg_use_ffmpeg -D__STDC_CONSTANT_MACROS -I/usr/include/libavcodec -I/usr/include/libavformat -I/usr/include/libswscale -I/usr/include/ffmpeg
++CIMG_FFMPEG_DEFINE = -Dcimg_use_ffmpeg -D__STDC_CONSTANT_MACROS
++CIMG_FFMPEG_INCDIR = -I/usr/include/libavcodec -I/usr/include/libavformat -I/usr/include/libswscale -I/usr/include/ffmpeg
++CIMG_FFMPEG_CFLAGS = $(CIMG_FFMPEG_DEFINE) $(CIMG_FFMPEG_INCDIR)
+ CIMG_FFMPEG_LIBS = -lavcodec -lavformat -lswscale
+
+ # Flags to enable native support for compressed .cimgz files, using the Zlib library.
+ # ( http://www.zlib.net/ )
+-CIMG_ZLIB_CFLAGS = -Dcimg_use_zlib
++CIMG_ZLIB_DEFINE = -Dcimg_use_zlib
++CIMG_ZLIB_INCDIR =
++CIMG_ZLIB_CFLAGS = $(CIMG_ZLIB_DEFINE) $(CIMG_ZLIB_INCDIR)
+ CIMG_ZLIB_LIBS = -lz
+
+ # Flags to enable native support for downloading files from the network.
+ # ( http://curl.haxx.se/libcurl/ )
+-CIMG_CURL_CFLAGS = -Dcimg_use_curl
++CIMG_CURL_DEFINE = -Dcimg_use_curl
++CIMG_CURL_INCDIR =
++CIMG_CURL_CFLAGS = $(CIMG_CURL_DEFINE)
+ CIMG_CURL_LIBS = -lcurl
+
+ # Flags to enable native support of most classical image file formats, using the Magick++ library.
+ # ( http://www.imagemagick.org/Magick++/ )
+-CIMG_MAGICK_CFLAGS = -Dcimg_use_magick `Magick++-config --cppflags` `Magick++-config --cxxflags`
++CIMG_MAGICK_DEFINE = -Dcimg_use_magick
++CIMG_MAGICK_INCDIR = `Magick++-config --cppflags` `Magick++-config --cxxflags`
++CIMG_MAGICK_CFLAGS = $(CIMG_MAGICK_DEFINE) $(CIMG_MAGICK_INCDIR)
+ CIMG_MAGICK_LIBS = `Magick++-config --ldflags` `Magick++-config --libs`
+
+ # Flags to enable faster Discrete Fourier Transform computation, using the FFTW3 library
+ # ( http://www.fftw.org/ )
+-CIMG_FFTW3_CFLAGS = -Dcimg_use_fftw3
++CIMG_FFTW3_DEFINE = -Dcimg_use_fftw3
++CIMG_FFTW3_INCDIR =
++CIMG_FFTW3_CFLAGS = $(CIMG_FFTW3_DEFINE) $(CIMG_FFTW3_INCDIR)
+ ifeq ($(OSTYPE),msys)
+ CIMG_FFTW3_LIBS = -lfftw3-3
+ else
+@@ -225,12 +255,16 @@ endif
+
+ # Flags to enable the use of LAPACK routines for matrix computation
+ # ( http://www.netlib.org/lapack/ )
+-CIMG_LAPACK_CFLAGS = -Dcimg_use_lapack
++CIMG_LAPACK_DEFINE = -Dcimg_use_lapack
++CIMG_LAPACK_INCDIR =
++CIMG_LAPACK_CFLAGS = $(CIMG_LAPACK_DEFINE) $(CIMG_LAPACK_INCDIR)
+ CIMG_LAPACK_LIBS = -lblas -lg2c -llapack
+
+ # Flags to enable the use of the Board library
+ # ( http://libboard.sourceforge.net/ )
+-CIMG_BOARD_CFLAGS = -Dcimg_use_board -I/usr/include/board
++CIMG_BOARD_DEFINE = -Dcimg_use_board
++CIMG_BOARD_INCDIR = -I/usr/include/board
++CIMG_BOARD_CFLAGS = $(CIMG_BOARD_DEFINE) $(CIMG_BOARD_INCDIR)
+ CIMG_BOARD_LIBS = -lboard
+
+ # Flags to compile on Sun Solaris
+--
+1.9.1
+
diff --git a/src/cimg.mk b/src/cimg.mk
new file mode 100644
index 0000000..7f81ddd
--- /dev/null
+++ b/src/cimg.mk
@@ -0,0 +1,58 @@
+# This file is part of MXE.
+# See index.html for further information.
+
+PKG := cimg
+$(PKG)_IGNORE :=
+$(PKG)_VERSION := 1.6.3
+$(PKG)_CHECKSUM := 04096e5339441443bf8305fccccc6be58690047d
+$(PKG)_SUBDIR := CImg-$($(PKG)_VERSION)
+$(PKG)_FILE := CImg_$($(PKG)_VERSION).zip
+$(PKG)_URL := http://cimg.eu/files/$($(PKG)_FILE)
+$(PKG)_DEPS := gcc tiff openexr libpng jpeg zlib opencv imagemagick fftw
+
+define $(PKG)_UPDATE
+ $(WGET) -q -O- 'http://cimg.eu/files/' | \
+ $(SED) -n 's,.*CImg_\([0-9][^"]*\)\.zip.*,\1,p' | \
+ head -1
+endef
+
+define $(PKG)_BUILD
+ cp -r '$(1)/CImg.h' '$(1)/plugins' '$(PREFIX)/$(TARGET)/include/'
+
+ # Build examples
+
+ # use Mlinux instead of Mwindows to get more features
+ # Mlinux does not link against CIMG_GDI32_LIBS,
+ # so set CIMG_X11_LIBS to -lgdi32
+
+ # no colored terminal, no X server, no minc2
+ # curl is not used by any example
+
+ $(MAKE) -C '$(1)/examples' -j '$(JOBS)' \
+ 'CIMG_VERSION=$($(PKG)_VERSION)' \
+ 'CC=$(TARGET)-g++' \
+ 'EXESFX=.exe' \
+ 'CIMG_VT100_CFLAGS=' \
+ 'CIMG_X11_CFLAGS=-mwindows' 'CIMG_X11_LIBS=-lgdi32' \
+ 'CIMG_XSHM_CFLAGS=' 'CIMG_XSHM_LIBS=' \
+ 'CIMG_XRANDR_CFLAGS=' 'CIMG_XRANDR_LIBS=' \
+ 'CIMG_MINC2_CFLAGS=' 'CIMG_MINC2_LIBS=' \
+ 'CIMG_CURL_CFLAGS=' 'CIMG_CURL_LIBS=' \
+ 'CIMG_TIFF_INCDIR=`$(TARGET)-pkg-config --cflags libtiff-4`' \
+ 'CIMG_TIFF_LIBS=`$(TARGET)-pkg-config --libs libtiff-4`' \
+ 'CIMG_EXR_INCDIR=`$(TARGET)-pkg-config --cflags OpenEXR`' \
+ 'CIMG_EXR_LIBS=`$(TARGET)-pkg-config --libs OpenEXR`' \
+ 'CIMG_PNG_INCDIR=`$(TARGET)-pkg-config --cflags libpng`' \
+ 'CIMG_PNG_LIBS=`$(TARGET)-pkg-config --libs libpng`' \
+ 'CIMG_JPEG_INCDIR=`$(TARGET)-pkg-config --cflags jpeg`' \
+ 'CIMG_JPEG_LIBS=`$(TARGET)-pkg-config --libs jpeg`' \
+ 'CIMG_ZLIB_INCDIR=`$(TARGET)-pkg-config --cflags zlib`' \
+ 'CIMG_ZLIB_LIBS=`$(TARGET)-pkg-config --libs zlib`' \
+ 'CIMG_OPENCV_INCDIR=`$(TARGET)-pkg-config --cflags opencv`' \
+ 'CIMG_OPENCV_LIBS=`$(TARGET)-pkg-config --libs opencv`' \
+ 'CIMG_MAGICK_INCDIR=`$(TARGET)-pkg-config --cflags ImageMagick++`' \
+ 'CIMG_MAGICK_LIBS=`$(TARGET)-pkg-config --libs ImageMagick++`' \
+ 'CIMG_FFTW3_INCDIR=`$(TARGET)-pkg-config --cflags fftw3`' \
+ 'CIMG_FFTW3_LIBS=`$(TARGET)-pkg-config --libs fftw3`' \
+ Mlinux
+endef