gmic: workaround libunwind.a linking issue with a better approach
also building variant that does not make use of graphicsmagick
This commit is contained in:
parent
dcf097e527
commit
308d14fdba
@ -1,60 +1,42 @@
|
|||||||
--- ./src/Makefile.orig 2019-04-16 14:41:09.000000000 +0000
|
diff --git a/src/Makefile~ b/src/Makefile
|
||||||
+++ ./src/Makefile 2019-05-07 01:09:58.583727894 +0000
|
index 4df1c97..4d2659a 100644
|
||||||
@@ -60,7 +60,7 @@
|
--- a/src/Makefile~
|
||||||
|
+++ b/src/Makefile
|
||||||
# Try to auto-detect target OS.
|
@@ -199,7 +199,7 @@ endif
|
||||||
OS = $(shell uname)
|
|
||||||
-USR = /usr
|
|
||||||
+USR = $(PREFIX)
|
|
||||||
LIB = lib
|
|
||||||
BIN = bin
|
|
||||||
INCLUDE = include
|
|
||||||
@@ -146,9 +146,7 @@
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifdef NOSTRIP
|
|
||||||
-STRIP = echo skip strip
|
|
||||||
-else
|
|
||||||
-STRIP = strip
|
|
||||||
+STRIP = echo skip stripe
|
|
||||||
endif
|
|
||||||
|
|
||||||
ifndef QMAKE
|
|
||||||
@@ -199,7 +197,7 @@
|
|
||||||
# Enable multi-threading support.
|
# Enable multi-threading support.
|
||||||
PARALLEL_CFLAGS = -Dgmic_is_parallel
|
PARALLEL_CFLAGS = -Dgmic_is_parallel
|
||||||
ifneq ($(OS),Windows)
|
ifneq ($(OS),Windows)
|
||||||
-PARALLEL_LIBS = -lpthread
|
-PARALLEL_LIBS = -lpthread
|
||||||
+PARALLEL_LIBS = #-lpthread
|
+#PARALLEL_LIBS = -lpthread
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Enable parallelization in CImg, using OpenMP.
|
# Enable parallelization in CImg, using OpenMP.
|
||||||
@@ -339,8 +337,8 @@
|
@@ -339,8 +339,8 @@ native:
|
||||||
GMIC_CLI_CFLAGS = $(MANDATORY_CFLAGS) $(ABORT_CFLAGS) $(PARALLEL_CFLAGS) $(EIGEN_CFLAGS) $(FFTW_CFLAGS) $(CURL_CFLAGS) $(PNG_CFLAGS) $(JPEG_CFLAGS) $(TIFF_CFLAGS)
|
GMIC_CLI_CFLAGS = $(MANDATORY_CFLAGS) $(ABORT_CFLAGS) $(PARALLEL_CFLAGS) $(EIGEN_CFLAGS) $(FFTW_CFLAGS) $(CURL_CFLAGS) $(PNG_CFLAGS) $(JPEG_CFLAGS) $(TIFF_CFLAGS)
|
||||||
GMIC_CLI_LIBS = $(MANDATORY_LIBS) $(PARALLEL_LIBS) $(EIGEN_LIBS) $(FFTW_LIBS) $(CURL_LIBS) $(PNG_LIBS) $(JPEG_LIBS) $(TIFF_LIBS)
|
GMIC_CLI_LIBS = $(MANDATORY_LIBS) $(PARALLEL_LIBS) $(EIGEN_LIBS) $(FFTW_LIBS) $(CURL_LIBS) $(PNG_LIBS) $(JPEG_LIBS) $(TIFF_LIBS)
|
||||||
ifeq ($(OS),Unix) # Unix.
|
ifeq ($(OS),Unix) # Unix.
|
||||||
-GMIC_CLI_CFLAGS += $(OPENMP_CFLAGS) $(X11_CFLAGS) $(OPENEXR_CFLAGS) $(OPENCV_CFLAGS) # $(XSHM_CFLAGS) $(MAGICK_CFLAGS)
|
-GMIC_CLI_CFLAGS += $(OPENMP_CFLAGS) $(X11_CFLAGS) $(OPENEXR_CFLAGS) $(OPENCV_CFLAGS) # $(XSHM_CFLAGS) $(MAGICK_CFLAGS)
|
||||||
-GMIC_CLI_LIBS += $(OPENMP_LIBS) $(X11_LIBS) $(OPENEXR_LIBS) $(OPENCV_LIBS) # $(XSHM_LIBS) # $(MAGICK_LIBS)
|
-GMIC_CLI_LIBS += $(OPENMP_LIBS) $(X11_LIBS) $(OPENEXR_LIBS) $(OPENCV_LIBS) # $(XSHM_LIBS) # $(MAGICK_LIBS)
|
||||||
+GMIC_CLI_CFLAGS += $(MAGICK_CFLAGS) # $(OPENMP_CFLAGS) $(X11_CFLAGS) $(OPENEXR_CFLAGS) $(OPENCV_CFLAGS) # $(XSHM_CFLAGS) $(MAGICK_CFLAGS)
|
+#GMIC_CLI_CFLAGS += $(OPENMP_CFLAGS) $(X11_CFLAGS) $(OPENEXR_CFLAGS) $(OPENCV_CFLAGS) # $(XSHM_CFLAGS) $(MAGICK_CFLAGS)
|
||||||
+GMIC_CLI_LIBS += $(MAGICK_LIBS) # $(OPENMP_LIBS) $(X11_LIBS) $(OPENEXR_LIBS) $(OPENCV_LIBS) # $(XSHM_LIBS) # $(MAGICK_LIBS)
|
+#GMIC_CLI_LIBS += $(OPENMP_LIBS) $(X11_LIBS) $(OPENEXR_LIBS) $(OPENCV_LIBS) # $(XSHM_LIBS) # $(MAGICK_LIBS)
|
||||||
else
|
else
|
||||||
ifeq ($(OS),Darwin) # MacOSX.
|
ifeq ($(OS),Darwin) # MacOSX.
|
||||||
GMIC_CLI_CFLAGS += $(X11_CFLAGS) $(OPENEXR_CFLAGS) $(OPENCV_CFLAGS)
|
GMIC_CLI_CFLAGS += $(X11_CFLAGS) $(OPENEXR_CFLAGS) $(OPENCV_CFLAGS)
|
||||||
@@ -352,15 +350,14 @@
|
@@ -353,7 +353,7 @@ endif
|
||||||
endif
|
|
||||||
|
|
||||||
cli:
|
cli:
|
||||||
- $(MAKE) "CFLAGS+=$(GMIC_CLI_CFLAGS) $(OPT_CFLAGS)" "LIBS+=$(GMIC_CLI_LIBS)" _cli
|
$(MAKE) "CFLAGS+=$(GMIC_CLI_CFLAGS) $(OPT_CFLAGS)" "LIBS+=$(GMIC_CLI_LIBS)" _cli
|
||||||
- $(STRIP) gmic$(EXE)
|
- $(STRIP) gmic$(EXE)
|
||||||
+ $(MAKE) "CFLAGS+= $(CXXFLAGS) $(GMIC_CLI_CFLAGS) $(OPT_CFLAGS)" "LIBS+=$(GMIC_CLI_LIBS)" _cli
|
+ $(STRIP) gmic$(EXE) gmic-gm$(EXE)
|
||||||
|
|
||||||
debug:
|
debug:
|
||||||
$(MAKE) "CFLAGS+=$(GMIC_CLI_CFLAGS) $(DEBUG_CFLAGS)" "LIBS+=$(GMIC_CLI_LIBS)" _cli
|
$(MAKE) "CFLAGS+=$(GMIC_CLI_CFLAGS) $(DEBUG_CFLAGS)" "LIBS+=$(GMIC_CLI_LIBS)" _cli
|
||||||
|
@@ -361,6 +361,8 @@ debug:
|
||||||
_cli: check_versions gmic.cpp gmic.h gmic_stdlib.h CImg.h
|
_cli: check_versions gmic.cpp gmic.h gmic_stdlib.h CImg.h
|
||||||
$(CXX) -o gmic_cli.o -c gmic.cpp $(CFLAGS)
|
$(CXX) -o gmic_cli.o -c gmic.cpp $(CFLAGS)
|
||||||
- $(CXX) -o gmic gmic_cli.cpp gmic_cli.o $(CFLAGS) $(LIBS)
|
$(CXX) -o gmic gmic_cli.cpp gmic_cli.o $(CFLAGS) $(LIBS)
|
||||||
+ $(CXX) -o gmic gmic_cli.cpp gmic_cli.o $(CFLAGS) $(LIBS) $(LDFLAGS)
|
+ $(CXX) -o gmic_cli_gm.o -c gmic.cpp $(CFLAGS) $(MAGICK_CFLAGS)
|
||||||
|
+ $(CXX) -o gmic-gm gmic_cli.cpp gmic_cli_gm.o $(CFLAGS) $(MAGICK_CFLAGS) $(LIBS) $(MAGICK_LIBS)
|
||||||
|
|
||||||
# CLI (static)
|
# CLI (static)
|
||||||
#-------------
|
#-------------
|
@ -2,10 +2,11 @@ TERMUX_PKG_HOMEPAGE=https://gmic.eu
|
|||||||
TERMUX_PKG_DESCRIPTION="Full-featured framework for image processing"
|
TERMUX_PKG_DESCRIPTION="Full-featured framework for image processing"
|
||||||
TERMUX_PKG_LICENSE="CeCILL-2.1"
|
TERMUX_PKG_LICENSE="CeCILL-2.1"
|
||||||
TERMUX_PKG_VERSION=2.6.1
|
TERMUX_PKG_VERSION=2.6.1
|
||||||
TERMUX_PKG_REVISION=2
|
TERMUX_PKG_REVISION=3
|
||||||
TERMUX_PKG_SHA256=48de7045a36eb718d55b0dfd68a797380b5390af99c9737a4dfba0fb678ed2b4
|
TERMUX_PKG_SHA256=48de7045a36eb718d55b0dfd68a797380b5390af99c9737a4dfba0fb678ed2b4
|
||||||
TERMUX_PKG_SRCURL=https://gmic.eu/files/source/gmic_$TERMUX_PKG_VERSION.tar.gz
|
TERMUX_PKG_SRCURL=https://gmic.eu/files/source/gmic_$TERMUX_PKG_VERSION.tar.gz
|
||||||
TERMUX_PKG_DEPENDS="graphicsmagick, libcurl, fftw, libpng, libjpeg-turbo, libtiff, zlib"
|
TERMUX_PKG_DEPENDS="libcurl, fftw, libpng, libjpeg-turbo, libtiff, zlib"
|
||||||
|
TERMUX_PKG_BUILD_DEPENDS="graphicsmagick"
|
||||||
TERMUX_PKG_NO_DEVELSPLIT=yes
|
TERMUX_PKG_NO_DEVELSPLIT=yes
|
||||||
TERMUX_PKG_BUILD_IN_SRC=yes
|
TERMUX_PKG_BUILD_IN_SRC=yes
|
||||||
|
|
||||||
@ -15,17 +16,14 @@ termux_step_configure() {
|
|||||||
|
|
||||||
termux_step_make() {
|
termux_step_make() {
|
||||||
cd src/
|
cd src/
|
||||||
if [ $TERMUX_ARCH = "arm" ]; then
|
make USR="$TERMUX_PREFIX" STRIP="$STRIP" \
|
||||||
make cli LIBS=" -lunwind -L/data/data/com.termux/files/usr/lib -lfftw3 -lfftw3_threads -lcurl -lpng16 -lz -ljpeg -ltiff -lGraphicsMagick++ -lGraphicsMagick"
|
CFLAGS="$CXXFLAGS" LIBS="$LDFLAGS -lgcc" cli
|
||||||
else
|
|
||||||
make cli
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
termux_step_make_install() {
|
termux_step_make_install() {
|
||||||
cp src/gmic $TERMUX_PREFIX/bin/gmic
|
cp src/gmic $TERMUX_PREFIX/bin/
|
||||||
cp src/*.h $TERMUX_PREFIX/include/
|
cp src/gmic-gm $TERMUX_PREFIX/bin/
|
||||||
gunzip man/gmic.1.gz
|
cp man/gmic.1.gz $TERMUX_PREFIX/share/man/man1/
|
||||||
cp man/gmic.1 $TERMUX_PREFIX/share/man/man1
|
cp man/gmic.1.gz $TERMUX_PREFIX/share/man/man1/gmic-gm.1.gz
|
||||||
}
|
}
|
||||||
|
|
||||||
|
4
packages/gmic/gmic-gm.subpackage.sh
Normal file
4
packages/gmic/gmic-gm.subpackage.sh
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
TERMUX_SUBPKG_INCLUDE="bin/gmic-gm share/man/man1/gmic-gm.1.gz"
|
||||||
|
TERMUX_SUBPKG_DESCRIPTION="Full-featured framework for image processing (GraphicsMagick variant)"
|
||||||
|
TERMUX_SUBPKG_DEPENDS="graphicsmagick"
|
||||||
|
TERMUX_SUBPKG_DEPEND_ON_PARENT=deps
|
Loading…
Reference in New Issue
Block a user