Skip to content

Commit

Permalink
media-gfx/gmic: version bump to 1.7.8
Browse files Browse the repository at this point in the history
Move to using cmake for building and combine library/cli/gimp builds
into one ebuild.
  • Loading branch information
radhermit committed Oct 29, 2016
1 parent eb97b37 commit 0784a51
Show file tree
Hide file tree
Showing 4 changed files with 168 additions and 0 deletions.
1 change: 1 addition & 0 deletions media-gfx/gmic/Manifest
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
DIST gmic_1.6.5.0.tar.gz 3005945 SHA256 ebc98c4f5848b8343d581104e072299529ac3edbcea7b565ffd6e1fb4bfd66ed SHA512 3feb5589dcc341106ce1305ce2d3f90776f074607bec3b8413519aa5f2c9dc9554a9ee7a5ba1d52d1a9e7676e6bff135d444276c989511f973cd456136d0e4e1 WHIRLPOOL 02f3f711fa9c876fba39e56a42c30f62a6c2d0848ae836f9635d7df0ef57f48f2a8f09ca361232c2239e473046fe7d085260ac365d2e7b6d49e65c3c0aa2e9bc
DIST gmic_1.6.5.1.tar.gz 3092777 SHA256 63737973848c292ef3877e1f6af3839e20fa209dd7a1bbacbdbac03bbb6fce85 SHA512 cfbb8db9a3f884ac27b4929a774c94372523a1e59a205180dde452d34310d32df4ef76c9cdfcc4ef5adf0ba72c5e1e44564cfeb2e9bc003ec8fae45df9c606c4 WHIRLPOOL e5e0e9d4dfff7a5b0da9d613bc998e32f71925cc44eb504519811327697fd13edf2abb1b94bd22619b17fa111d1e984944a01d7417ff0e328950b4258a7172fb
DIST gmic_1.7.8.tar.gz 3013635 SHA256 3a2f32d79714239cfa56ecb10799b7d73362b4e2a852444bc24866272cd041a4 SHA512 2bfa7bb9ff3a99a76c71f7c4e0d619e9c205dafc02b5a2d1f097b6285c141e5413f7016b92d974327f787010a6832d272ab21a89842eee2484151072c2d4c559 WHIRLPOOL a81e135031ac095e700302d1b59428b6f86df4543643d17e759fcde3bcd7ceac950b7418d89854d2ee8c55af18efc67efc65f41984ca1dbbe5c12c3a12c36539
76 changes: 76 additions & 0 deletions media-gfx/gmic/files/gmic-1.7.8-cmake.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
--- gmic-1.7.8/CMakeLists.txt
+++ gmic-1.7.8/CMakeLists.txt
@@ -3,9 +3,11 @@
project(gmic CXX C)

find_package(PkgConfig)
+include(GNUInstallDirs)

# options controlling the build process
option(BUILD_LIB "Build the GMIC shared library" ON)
+option(BUILD_LIB_STATIC "Build the GMIC static library" ON)
option(BUILD_CLI "Build the CLI interface" ON)
option(BUILD_PLUGIN "Build the GIMP plug-in" ON)
option(ENABLE_X "Add support for X11" ON)
@@ -44,7 +46,7 @@
if(ENABLE_OPENMP)
if(NOT APPLE)
set(COMPILE_FLAGS " ${COMPILE_FLAGS} -fopenmp -Dcimg_use_openmp ")
- set(EXTRA_LIBRARIES "-lgomp ${EXTRA_LIBRARIES}")
+ set(EXTRA_LIBRARIES "${EXTRA_LIBRARIES} -lgomp")
endif(NOT APPLE)
endif(ENABLE_OPENMP)

@@ -187,9 +189,9 @@
"Choose the type of build, options are: Debug Release RelWithDebInfo."
FORCE)
endif(NOT CMAKE_BUILD_TYPE)
-SET(CMAKE_CXX_FLAGS_DEBUG " -O0 -g -ansi -pedantic -Dcimg_verbosity=3 ${COMPILE_FLAGS}")
-SET(CMAKE_CXX_FLAGS_RELEASE " -O3 -mtune=generic ${COMPILE_FLAGS}")
-SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO " -O3 -g -mtune=generic ${COMPILE_FLAGS}")
+SET(CMAKE_CXX_FLAGS_DEBUG " -ansi -pedantic -Dcimg_verbosity=3 ${COMPILE_FLAGS}")
+SET(CMAKE_CXX_FLAGS_RELEASE " ${COMPILE_FLAGS}")
+SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO " ${COMPILE_FLAGS}")


# source files
@@ -220,7 +222,7 @@
if(BUILD_LIB)
add_library(libgmic SHARED ${CLI_Includes} ${CLI_Sources})
add_dependencies(libgmic gmic_extra_headers)
- set_target_properties(libgmic PROPERTIES OUTPUT_NAME "gmic")
+ set_target_properties(libgmic PROPERTIES SOVERSION "1" OUTPUT_NAME "gmic")
IF(NOT APPLE)
set_target_properties(libgmic PROPERTIES LINK_FLAGS "-Wl,-soname,libgmic.so.1")
ENDIF(NOT APPLE)
@@ -236,7 +238,13 @@
${FFTW3_LIBRARIES}
${EXTRA_LIBRARIES}
)
-
+
+ INSTALL(TARGETS libgmic LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+ INSTALL(FILES src/gmic.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
+endif(BUILD_LIB)
+
+
+if(BUILD_LIB_STATIC)
add_library(libgmicstatic STATIC ${CLI_Includes} ${CLI_Sources})
add_dependencies(libgmicstatic gmic_extra_headers)
set_target_properties(libgmicstatic PROPERTIES OUTPUT_NAME "gmic")
@@ -252,11 +260,10 @@
${FFTW3_LIBRARIES}
${EXTRA_LIBRARIES}
)
-
- INSTALL(TARGETS libgmic LIBRARY DESTINATION lib)
- INSTALL(TARGETS libgmicstatic ARCHIVE DESTINATION lib)
- INSTALL(FILES src/gmic.h DESTINATION include)
-endif(BUILD_LIB)
+
+ INSTALL(TARGETS libgmicstatic ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
+ INSTALL(FILES src/gmic.h DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
+endif(BUILD_LIB_STATIC)


if(BUILD_CLI)
90 changes: 90 additions & 0 deletions media-gfx/gmic/gmic-1.7.8.ebuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=6

inherit cmake-utils bash-completion-r1

DESCRIPTION="GREYC's Magic Image Converter"
HOMEPAGE="http://gmic.eu/ https://github.com/dtschump/gmic"
SRC_URI="http://gmic.eu/files/source/${PN}_${PV}.tar.gz"

LICENSE="CeCILL-2 FDL-1.3"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+cli ffmpeg fftw gimp graphicsmagick jpeg opencv openexr openmp png static-libs tiff X zlib"
REQUIRED_USE="|| ( cli gimp )"

COMMON_DEPEND="
fftw? ( sci-libs/fftw:3.0[threads] )
gimp? ( >=media-gfx/gimp-2.4.0 )
graphicsmagick? ( media-gfx/graphicsmagick )
jpeg? ( virtual/jpeg:0 )
opencv? ( >=media-libs/opencv-2.3.1a-r1 )
openexr? (
media-libs/ilmbase
media-libs/openexr
)
png? ( media-libs/libpng:0= )
tiff? ( media-libs/tiff:0 )
X? (
x11-libs/libX11
x11-libs/libXext
)
zlib? ( sys-libs/zlib )"
RDEPEND="${COMMON_DEPEND}
ffmpeg? ( media-video/ffmpeg:0 )
gimp? ( !media-plugins/gimp-gmic )
"
DEPEND="${COMMON_DEPEND}
virtual/pkgconfig
"

PATCHES=( "${FILESDIR}"/${P}-cmake.patch )

src_prepare() {
default
gunzip man/${PN}.1.gz || die
}

pkg_pretend() {
if use openmp ; then
tc-has-openmp || die "Please switch to an openmp compatible compiler"
fi

if ! test-flag-CXX -std=c++11 ; then
die "You need at least GCC 4.7.x or Clang >= 3.3 for C++11-specific compiler flags"
fi
}

src_configure() {
local mycmakeargs=(
-DBUILD_LIB=ON
-DBUILD_LIB_STATIC=$(usex static-libs)
-DBUILD_CLI=$(usex cli)
-DBUILD_PLUGIN=$(usex gimp)
-DENABLE_X=$(usex X)
-DENABLE_FFMPEG=$(usex ffmpeg)
-DENABLE_FFTW=$(usex fftw)
-DENABLE_GRAPHICSMAGICK=$(usex graphicsmagick)
-DENABLE_JPEG=$(usex jpeg)
-DENABLE_OPENCV=$(usex opencv)
-DENABLE_OPENEXR=$(usex openexr)
-DENABLE_OPENMP=$(usex openmp)
-DENABLE_PNG=$(usex png)
-DENABLE_TIFF=$(usex tiff)
-DENABLE_ZLIB=$(usex zlib)
)

local CMAKE_BUILD_TYPE="Release"
cmake-utils_src_configure
}

src_install() {
cmake-utils_src_install

dodoc README
doman man/${PN}.1
use cli && newbashcomp resources/${PN}_bashcompletion.sh ${PN}
}
1 change: 1 addition & 0 deletions media-gfx/gmic/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
<name>Gentoo Graphics Project</name>
</maintainer>
<use>
<flag name="cli">Build CLI interface</flag>
<flag name="graphicsmagick">Enable support for many common image file formats using the GraphicsMagick++ library</flag>
<flag name="opencv">Enable support for webcams using the OpenCV library</flag>
</use>
Expand Down

0 comments on commit 0784a51

Please sign in to comment.