commit:     3d0a1fedd1fc7d02a81179718903c097f7403887
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 18 13:26:54 2020 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Thu Jun 18 16:29:04 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d0a1fed

media-gfx/darktable: allow enabling LTO in RawSpeed via USE=lto

Recommended by upstream but for now very much experimental on the Gentoo side
and will almost certainly fall over for some compiler/linker combinations.
Do let us know if that happens!

Closes: https://bugs.gentoo.org/674762
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 ...table-9999.ebuild => darktable-3.0.2-r1.ebuild} | 28 ++++++++++++++++++----
 media-gfx/darktable/darktable-9999.ebuild          |  3 ++-
 media-gfx/darktable/metadata.xml                   |  1 +
 3 files changed, 26 insertions(+), 6 deletions(-)

diff --git a/media-gfx/darktable/darktable-9999.ebuild 
b/media-gfx/darktable/darktable-3.0.2-r1.ebuild
similarity index 78%
copy from media-gfx/darktable/darktable-9999.ebuild
copy to media-gfx/darktable/darktable-3.0.2-r1.ebuild
index 20617da3c0a..0d3a07d8b76 100644
--- a/media-gfx/darktable/darktable-9999.ebuild
+++ b/media-gfx/darktable/darktable-3.0.2-r1.ebuild
@@ -3,20 +3,24 @@
 
 EAPI=7
 
-inherit cmake flag-o-matic git-r3 pax-utils toolchain-funcs xdg
+inherit cmake flag-o-matic pax-utils toolchain-funcs xdg
 
-EGIT_REPO_URI="https://github.com/darktable-org/${PN}.git";
+DOC_PV="3.0.0"
+MY_PV="${PV/_/}"
+MY_P="${P/_/.}"
 
 DESCRIPTION="A virtual lighttable and darkroom for photographers"
 HOMEPAGE="https://www.darktable.org/";
+SRC_URI="https://github.com/darktable-org/${PN}/releases/download/release-${MY_PV}/${MY_P}.tar.xz
+       doc? ( 
https://github.com/darktable-org/${PN}/releases/download/release-${DOC_PV}/${PN}-usermanual.pdf
 -> ${PN}-usermanual-${DOC_PV}.pdf )"
 
 LICENSE="GPL-3 CC-BY-3.0"
 SLOT="0"
-#KEYWORDS="~amd64 ~x86"
-LANGS=" af ca cs da de el es fi fr gl he hu it ja nb nl pl pt-BR pt-PT ro ru 
sk sl sq sv th uk zh-CN zh-TW"
+KEYWORDS="~amd64 ~x86"
+LANGS=" ca cs da de es fr he hu it ja nb nl pl ru sl"
 # TODO add lua once dev-lang/lua-5.2 is unmasked
 IUSE="colord cups cpu_flags_x86_sse3 doc flickr geolocation gnome-keyring 
gphoto2 graphicsmagick jpeg2k kwallet
-nls opencl openmp openexr pax_kernel webp
+lto nls opencl openmp openexr pax_kernel webp
 ${LANGS// / l10n_}"
 
 BDEPEND="
@@ -67,8 +71,11 @@ RDEPEND="${COMMON_DEPEND}
 
 PATCHES=(
        "${FILESDIR}"/"${PN}"-find-opencl-header.patch
+       "${FILESDIR}"/${PN}-3.0.2_cmake-opencl-kernel-loop.patch
 )
 
+S="${WORKDIR}/${P/_/~}"
+
 pkg_pretend() {
        if use openmp ; then
                tc-has-openmp || die "Please switch to an openmp compatible 
compiler"
@@ -87,6 +94,7 @@ src_configure() {
        local mycmakeargs=(
                -DBUILD_PRINT=$(usex cups)
                -DCUSTOM_CFLAGS=ON
+               -DRAWSPEED_ENABLE_LTO=$(usex lto)
                -DUSE_CAMERA_SUPPORT=$(usex gphoto2)
                -DUSE_COLORD=$(usex colord)
                -DUSE_FLICKR=$(usex flickr)
@@ -127,3 +135,13 @@ src_install() {
                eqawarn "please open a bug."
        fi
 }
+
+pkg_postinst() {
+       xdg_pkg_postinst
+
+       elog "when updating a major version,"
+       elog "please bear in mind that your edits will be preserved during this 
process,"
+       elog "but it will not be possible to downgrade any more."
+       echo
+       ewarn "It will not be possible to downgrade!"
+}

diff --git a/media-gfx/darktable/darktable-9999.ebuild 
b/media-gfx/darktable/darktable-9999.ebuild
index 20617da3c0a..6236b05ef1d 100644
--- a/media-gfx/darktable/darktable-9999.ebuild
+++ b/media-gfx/darktable/darktable-9999.ebuild
@@ -16,7 +16,7 @@ SLOT="0"
 LANGS=" af ca cs da de el es fi fr gl he hu it ja nb nl pl pt-BR pt-PT ro ru 
sk sl sq sv th uk zh-CN zh-TW"
 # TODO add lua once dev-lang/lua-5.2 is unmasked
 IUSE="colord cups cpu_flags_x86_sse3 doc flickr geolocation gnome-keyring 
gphoto2 graphicsmagick jpeg2k kwallet
-nls opencl openmp openexr pax_kernel webp
+lto nls opencl openmp openexr pax_kernel webp
 ${LANGS// / l10n_}"
 
 BDEPEND="
@@ -87,6 +87,7 @@ src_configure() {
        local mycmakeargs=(
                -DBUILD_PRINT=$(usex cups)
                -DCUSTOM_CFLAGS=ON
+               -DRAWSPEED_ENABLE_LTO=$(usex lto)
                -DUSE_CAMERA_SUPPORT=$(usex gphoto2)
                -DUSE_COLORD=$(usex colord)
                -DUSE_FLICKR=$(usex flickr)

diff --git a/media-gfx/darktable/metadata.xml b/media-gfx/darktable/metadata.xml
index 7144702bb77..85970342832 100644
--- a/media-gfx/darktable/metadata.xml
+++ b/media-gfx/darktable/metadata.xml
@@ -9,6 +9,7 @@
                <flag name="flickr">Add support for uploading photos to 
flickr</flag>
                <flag name="geolocation">Enable geotagging support</flag>
                <flag name="kwallet">Enable encrypted storage of passwords with 
<pkg>kde-frameworks/kwallet</pkg></flag>
+               <flag name="lto">Enable link-time optimisations in the RawSpeed 
library</flag>
                <flag name="opencl">Enable opencl support</flag>
                <flag name="pax_kernel">Triggers paxmarking of main darktable 
binary</flag>
        </use>

Reply via email to