diff options
author | mandree <mandree@FreeBSD.org> | 2017-01-15 03:39:00 +0800 |
---|---|---|
committer | mandree <mandree@FreeBSD.org> | 2017-01-15 03:39:00 +0800 |
commit | 6b102b4c113db2fb9ef2b1b0d4f1086270a116b0 (patch) | |
tree | 9f6df91a2caf71fae876f8d8a524f70c7ef170cf /graphics | |
parent | 6dd2a7f95c1349003c529dfd8502ceb2dbb7405f (diff) | |
download | freebsd-ports-gnome-6b102b4c113db2fb9ef2b1b0d4f1086270a116b0.tar.gz freebsd-ports-gnome-6b102b4c113db2fb9ef2b1b0d4f1086270a116b0.tar.zst freebsd-ports-gnome-6b102b4c113db2fb9ef2b1b0d4f1086270a116b0.zip |
Further cleanup, 11-RELEASE build fixes.
Prune unused dependencies via -Wl,--as-needed.
Build with as few requirements as works for 10.3-RELEASE and
11.0-RELEASE, i386 and amd64. This should use the base CC on anything
but 10.3-RELEASE amd64, where we use GCC 4.9 for OpenMP support.
Specifically, 11.0-RELEASE compilations do *not* work with GCC 4.9 and
the result fails with SIGBUS with apparent bogus SSE code generation and
misalignment.
Fix sound theme support via libcanberra (change Linux ifdefs to !Apple
ifdefs).
Apply -DPROC_TARGET_NUMBER="1" (i. e. build an executable with generic
tuning) only when building packages and unless -march is in CFLAGS.
USE_GNOME upgraded from gtkmm20 to gtkm24, and add devel/openmp as
requisite on amd64 (rather than implicit clang or gcc libs), bumping
PORTREVISION.
Silence cmake developer warnings, and be sure to export linker flags to
cmake (so it finds -lomp in its configuration phase)
[-DCMAKE_POLICY_DEFAULT_CMP0056:STRING=NEW]
Cleanups: leverage USES=localbase, and drop/avoid duplicate definitions
and dead code from the Makefile and support for unsupported older
FreeBSD releases.
Based in part on v0.3 patch of...
PR: 215675
Submitted by: jbeich@
MFH: 2017Q1
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/rawtherapee/Makefile | 76 | ||||
-rw-r--r-- | graphics/rawtherapee/files/patch-CMakeLists.txt | 13 | ||||
-rw-r--r-- | graphics/rawtherapee/files/patch-rtengine_dcraw.cc | 12 | ||||
-rw-r--r-- | graphics/rawtherapee/files/patch-rtengine_improcfun.h | 14 | ||||
-rw-r--r-- | graphics/rawtherapee/files/patch-rtengine_safegtk.cc | 20 | ||||
-rw-r--r-- | graphics/rawtherapee/files/patch-rtgui_soundman.cc | 22 | ||||
-rw-r--r-- | graphics/rawtherapee/files/rawtherapee.in | 8 | ||||
-rw-r--r-- | graphics/rawtherapee/pkg-message | 1 |
8 files changed, 89 insertions, 77 deletions
diff --git a/graphics/rawtherapee/Makefile b/graphics/rawtherapee/Makefile index 01fb2b193d66..41e1bbf2bbe2 100644 --- a/graphics/rawtherapee/Makefile +++ b/graphics/rawtherapee/Makefile @@ -3,7 +3,7 @@ PORTNAME= rawtherapee PORTVERSION= 4.2 -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= graphics MASTER_SITES= http://rawtherapee.com/shared/source/ @@ -12,39 +12,43 @@ COMMENT= Powerful RAW image processing application LICENSE= GPLv3 -LIB_DEPENDS= libgtkmm-2.4.so:x11-toolkits/gtkmm24 \ +LIB_DEPENDS= libcanberra-gtk.so:audio/libcanberra \ + libexpat.so:textproc/expat2 \ + libfftw3.so:math/fftw3 \ + libfftw3f.so:math/fftw3-float \ + libfontconfig.so:x11-fonts/fontconfig \ + libfreetype.so:print/freetype2 \ libiptcdata.so:graphics/libiptcdata \ liblcms2.so:graphics/lcms2 \ libpng.so:graphics/png \ - libtiff.so:graphics/tiff \ libsigc-2.0.so:devel/libsigc++20 \ - libfftw3.so:math/fftw3 \ - libfftw3f.so:math/fftw3-float \ - libcanberra-gtk3.so:audio/libcanberra-gtk3 + libtiff.so:graphics/tiff -USES= cmake:outsource compiler:gcc-c++11-lib desktop-file-utils dos2unix \ - jpeg pkgconfig tar:xz +USES= cmake:outsource desktop-file-utils dos2unix \ + jpeg localbase:ldflags pkgconfig tar:xz DOS2UNIX_REGEX= .*\.(cc|h) -USE_GNOME= gtk20 glib20 +LDFLAGS+= -Wl,--as-needed # fontconfig, freetype, gettext, libX11 +USE_GNOME= gtkmm24 USE_LDCONFIG= yes CFLAGS+= -I${LOCALBASE}/include -fPIC CXXFLAGS+= -I${LOCALBASE}/include -fPIC -LDFLAGS+= -lpthread -L${LOCALBASE}/lib -CONFIGURE_ENV= CFLAGS="${CFLAGS}" \ - LDFLAGS="${LDFLAGS:C|-Wl,-rpath=${_GCC_RUNTIME}||:C|-L${_GCC_RUNTIME}||}" +LDFLAGS+= -lpthread CMAKE_ARGS+= -DDOCDIR="${DOCSDIR}" \ -DCREDITSDIR="${DOCSDIR}" \ -DLICENCEDIR="${DOCSDIR}" \ -DDESKTOPDIR="${DESKTOPDIR}" \ -DDATADIR="${DATADIR}" \ - -DCMAKE_C_FLAGS="${CFLAGS:C|-Wl,-rpath=${_GCC_RUNTIME}||:C|-L${_GCC_RUNTIME}||}" \ - -DCMAKE_CXX_FLAGS="${CXXFLAGS:C|-Wl,-rpath=${_GCC_RUNTIME}||:C|-L${_GCC_RUNTIME}||}" \ - -DCACHE_NAME_SUFFIX="4.1" -SUB_FILES= rawtherapee -SUB_LIST= RTDIR="${RTDIR}" + -DCACHE_NAME_SUFFIX="4.1" \ + -Wno-dev \ + -DCMAKE_POLICY_DEFAULT_CMP0056:STRING=NEW +# 3.4.x: CMAKE_EXE_LINKER_FLAGS is not passed to TRY_COMPILE by default +# any more. The CMP0056 policy must be explicitly set to NEW to ensure +# linker flags are passed. Else -lomp is not found with clang. +# See: https://cmake.org/cmake/help/v3.4/policy/CMP0056.html + INSTALLS_ICONS= yes -.if defined(PACKAGE_BUILDING) +.if defined(PACKAGE_BUILDING) && empty(CFLAGS:M-march*) CMAKE_ARGS+= -DPROC_TARGET_NUMBER="1" .endif @@ -52,31 +56,41 @@ RTDIR= ${PREFIX}/libdata/${PORTNAME} OPTIONS_DEFINE= OPTIMIZED_CFLAGS OPENMP OPTIONS_DEFAULT= OPTIMIZED_CFLAGS OPENMP -OPENMP_DESC= Enable multicore processing using OpenMP +OPENMP_DESC= Enable multicore processing using OpenMP (amd64) OPTIMIZED_CFLAGS_DESC= Use extra compiler optimizations (requires SSE2 support) OPENMP_CMAKE_BOOL= OPTION_OMP -.include <bsd.port.pre.mk> +OPTIMIZED_CFLAGS_CFLAGS= -O3 -funroll-loops \ + ${OPTIMIZED_CFLAGS_CFLAGS_${CHOSEN_COMPILER_TYPE}} +OPTIMIZED_CFLAGS_CFLAGS_gcc= -fexpensive-optimizations -# ------------------------------------------------------------------- +.include <bsd.port.options.mk> -.if ${ARCH} == "amd64" || ${ARCH} == "i386" -.if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS} -CFLAGS+= -O3 -fexpensive-optimizations \ - -funroll-loops -msse2 -CXXFLAGS+= -O3 \ - -funroll-loops -msse2 +# ------------------------------------------------------------------- +# + +.if !empty(PORT_OPTIONS:MOPENMP) && ${ARCH} == "amd64" +LIB_DEPENDS+= libomp.so.0:devel/openmp +OPENMP_FLAGS= -lm -lomp +LDFLAGS+= ${OPENMP_FLAGS} +.if ${OSVERSION} < 1100101 +# clang 3.4 doesn't support OpenMP, +# OTOH gcc 4.9 doesn't generate usable code on FreeBSD 11. +USES+= compiler:gcc-c++11-lib +.endif .endif + +.if defined(WITH_DEBUG) +CMAKE_BUILD_TYPE= RelWithDebInfo +STRIP= .endif # ------------------------------------------------------------------- +.include <bsd.port.pre.mk> + post-patch: - @${REINPLACE_CMD} -e 's#<auto_ptr.h>#<memory>#g' \ - ${WRKSRC}/rtgui/darkframe.h \ - ${WRKSRC}/rtgui/flatfield.h \ - ${WRKSRC}/rtgui/icmpanel.h @${REINPLACE_CMD} -e 's#DESTINATION "$${CMAKE_INSTALL_PREFIX}/share/man/man1"#DESTINATION "${MANPREFIX}/man/man1/"#' \ ${WRKSRC}/CMakeLists.txt ${RM} ${WRKSRC}/rtengine/dcraw.patch \ diff --git a/graphics/rawtherapee/files/patch-CMakeLists.txt b/graphics/rawtherapee/files/patch-CMakeLists.txt deleted file mode 100644 index 65b0f3627f70..000000000000 --- a/graphics/rawtherapee/files/patch-CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -# This is required so that the RPATH information for libgcc/libgomp is -# not stripped during CMake's install phase: -- mandree - ---- ./CMakeLists.txt.orig 2013-06-15 19:16:41.000000000 +0200 -+++ ./CMakeLists.txt 2013-06-15 19:17:02.000000000 +0200 -@@ -6,6 +6,7 @@ - endif (WIN32) - - PROJECT(RawTherapee) -+SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) - - # the default target is 'Debug' - if (CMAKE_BUILD_TYPE STREQUAL "") diff --git a/graphics/rawtherapee/files/patch-rtengine_dcraw.cc b/graphics/rawtherapee/files/patch-rtengine_dcraw.cc new file mode 100644 index 000000000000..cf1eb897c31b --- /dev/null +++ b/graphics/rawtherapee/files/patch-rtengine_dcraw.cc @@ -0,0 +1,12 @@ +--- rtengine/dcraw.cc.orig 2017-01-14 17:35:19 UTC ++++ rtengine/dcraw.cc +@@ -8726,7 +8726,8 @@ static void decodeFPDeltaRow(Bytef * src + dst[col*3 + 2] = src[col + realTileWidth*2]; + } + } else { +- if (((union { uint32_t x; uint8_t c; }){1}).c) { ++ union X { uint32_t x; uint8_t c; }; ++ if (((union X){1}).c) { + for (size_t col = 0; col < tileWidth; ++col) { + for (size_t byte = 0; byte < bytesps; ++byte) + dst[col*bytesps + byte] = src[col + realTileWidth*(bytesps-byte-1)]; // Little endian diff --git a/graphics/rawtherapee/files/patch-rtengine_improcfun.h b/graphics/rawtherapee/files/patch-rtengine_improcfun.h deleted file mode 100644 index 39275d147b3f..000000000000 --- a/graphics/rawtherapee/files/patch-rtengine_improcfun.h +++ /dev/null @@ -1,14 +0,0 @@ ---- ./rtengine/improcfun.h.orig 2012-01-31 05:00:05.000000000 +0400 -+++ ./rtengine/improcfun.h 2012-03-31 11:46:27.000000000 +0400 -@@ -19,6 +19,11 @@ - #ifndef _IMPROCFUN_H_ - #define _IMPROCFUN_H_ - -+#include <sys/param.h> -+#if __FreeBSD_version <= 704100 || (__FreeBSD_version >= 800000 && __FreeBSD_version < 802502) || (__FreeBSD_version >= 900000 && __FreeBSD_version < 900027) -+#define log2(x) (log(x) / M_LN2) -+#endif -+ - #include "imagefloat.h" - #include "image16.h" - #include "image8.h" diff --git a/graphics/rawtherapee/files/patch-rtengine_safegtk.cc b/graphics/rawtherapee/files/patch-rtengine_safegtk.cc index 1e4826308aa7..10dc300ff935 100644 --- a/graphics/rawtherapee/files/patch-rtengine_safegtk.cc +++ b/graphics/rawtherapee/files/patch-rtengine_safegtk.cc @@ -1,6 +1,6 @@ ---- ./rtengine/safegtk.cc.orig 2012-01-31 05:00:05.000000000 +0400 -+++ ./rtengine/safegtk.cc 2012-03-29 19:31:25.000000000 +0400 -@@ -98,7 +98,7 @@ +--- rtengine/safegtk.cc.orig 2017-01-14 17:35:18 UTC ++++ rtengine/safegtk.cc +@@ -184,7 +184,7 @@ void safe_build_file_list (Glib::RefPtr< Glib::RefPtr<Gio::FileEnumerator> dirList; if (dir) { SAFE_ENUMERATOR_CODE_START @@ -9,7 +9,7 @@ SAFE_ENUMERATOR_CODE_END; } } -@@ -113,7 +113,7 @@ +@@ -199,7 +199,7 @@ void safe_build_file_list (Glib::RefPtr< if (dir) { if (!extensions) { SAFE_ENUMERATOR_CODE_START @@ -18,25 +18,25 @@ SAFE_ENUMERATOR_CODE_END; } else { -@@ -124,7 +124,7 @@ +@@ -210,7 +210,7 @@ void safe_build_file_list (Glib::RefPtr< SAFE_ENUMERATOR_CODE_START // convert the current filename to lowercase in a new ustring - Glib::ustring fname = Glib::ustring(info->get_name()).lowercase(); + Glib::ustring fname = Glib::ustring(info->get_display_name()).lowercase(); - int pos = fname.find_last_of('.'); - if (pos > -1 && pos < (fname.length()-1)) { -@@ -135,7 +135,7 @@ + size_t pos = fname.find_last_of('.'); + if (pos < (fname.length()-1)) { +@@ -221,7 +221,7 @@ void safe_build_file_list (Glib::RefPtr< // look out if it has one of the retained extensions - for (unsigned int i=0; i<lcExtensions.size(); i++) { + for (size_t i=0; i<lcExtensions.size(); i++) { if (lcFileExt == lcExtensions[i]) { - names.push_back (Glib::build_filename (directory, info->get_name())); + names.push_back (Glib::build_filename (directory, info->get_display_name())); break; } } -@@ -156,7 +156,7 @@ +@@ -242,7 +242,7 @@ void safe_build_subdir_list (Glib::RefPt SAFE_ENUMERATOR_CODE_START if (info->get_file_type() == Gio::FILE_TYPE_DIRECTORY && (!info->is_hidden() || add_hidden)) diff --git a/graphics/rawtherapee/files/patch-rtgui_soundman.cc b/graphics/rawtherapee/files/patch-rtgui_soundman.cc new file mode 100644 index 000000000000..db4ca89a1ed1 --- /dev/null +++ b/graphics/rawtherapee/files/patch-rtgui_soundman.cc @@ -0,0 +1,22 @@ +--- rtgui/soundman.cc.orig 2017-01-14 17:35:19 UTC ++++ rtgui/soundman.cc +@@ -24,9 +24,7 @@ + #ifdef WIN32 + #include <windows.h> + #include <mmsystem.h> +-#endif +- +-#ifdef __linux__ ++#elif !defined(__APPLE__) + #include <canberra-gtk.h> + #endif + +@@ -65,7 +63,7 @@ void SoundManager::playSoundAsync(const + wchar_t *wfilename = (wchar_t*)g_utf8_to_utf16 (sound.c_str(), -1, NULL, NULL, NULL); + PlaySoundW(wfilename, NULL, sndParam); + g_free( wfilename ); +-#elif defined(__linux__) ++#elif !defined(__APPLE__) + ca_context_play(ca_gtk_context_get(), 0, CA_PROP_EVENT_ID, sound.c_str(), CA_PROP_MEDIA_FILENAME, sound.c_str(), NULL); + #endif + } diff --git a/graphics/rawtherapee/files/rawtherapee.in b/graphics/rawtherapee/files/rawtherapee.in deleted file mode 100644 index 3e625f01ab39..000000000000 --- a/graphics/rawtherapee/files/rawtherapee.in +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/csh -# -# $FreeBSD$ - -set RTH = "%%RTDIR%%/rth" -set CONFDIR = "%%RTDIR%%" - -exec "${RTH}" ${CONFDIR} diff --git a/graphics/rawtherapee/pkg-message b/graphics/rawtherapee/pkg-message index ccb1877aaf65..ac0e1ed156a7 100644 --- a/graphics/rawtherapee/pkg-message +++ b/graphics/rawtherapee/pkg-message @@ -10,4 +10,3 @@ remove older cache directories. Also, after configurations have been moved to the new version's directory, older $HOME/.config/RawTherapee* directories may be removed. ====================================================================== - |