Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-gfx/yafaray/files/, media-gfx/yafaray/
Date: Tue, 29 May 2018 21:43:21
Message-Id: 1527630080.11bd4094e336b9ac197ac5f571cf14253c6379dc.mgorny@gentoo
1 commit: 11bd4094e336b9ac197ac5f571cf14253c6379dc
2 Author: Herb Miller Jr <herb <AT> hlmjr <DOT> com>
3 AuthorDate: Wed Mar 21 11:37:54 2018 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Tue May 29 21:41:20 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=11bd4094
7
8 media-gfx/yafaray: Create 3.3.0 ebuild.
9
10 Closes: https://bugs.gentoo.org/639046
11 Closes: https://github.com/gentoo/gentoo/pull/7530
12 Package-Manager: Portage-2.3.24, Repoman-2.3.6
13
14 media-gfx/yafaray/Manifest | 2 +
15 .../yafaray-3.3.0-blender-exporter-paths.patch | 15 +++
16 .../files/yafaray-3.3.0-respect-cflags.patch | 14 +++
17 .../files/yafaray-3.3.0-strip-debug-mode.patch | 12 +++
18 media-gfx/yafaray/metadata.xml | 23 +++++
19 media-gfx/yafaray/yafaray-3.3.0.ebuild | 101 +++++++++++++++++++++
20 6 files changed, 167 insertions(+)
21
22 diff --git a/media-gfx/yafaray/Manifest b/media-gfx/yafaray/Manifest
23 new file mode 100644
24 index 00000000000..967398bad99
25 --- /dev/null
26 +++ b/media-gfx/yafaray/Manifest
27 @@ -0,0 +1,2 @@
28 +DIST yafaray-blender-exporter-3.3.0.tar.gz 377928 BLAKE2B 7876c78ca6228282648909e566803b33304be0082fab48819340845e3927877b9734f7bc7e09702bf7cbf6477c68932637eb766dc98b9e8e4ab42ca99d2a3595 SHA512 70a1a806d97f6f3b43cdb5d6caac6104f0f63720d5920f6a623078e05e6977d065d2fabca4da1644deb97f09176b88347f0278e4bc699c783d807d3f530421d0
29 +DIST yafaray-core-3.3.0.tar.gz 1135360 BLAKE2B 67f6956a3866bfe0b4167f30a7c2c7f05ee23556e9fff7041ff3937e90011e4c2538b706ae27e02351ae555d0d05531f3eb711257591d85f779683c9c42ac6f7 SHA512 32efb87872485c4a188483ae1172cac2eca2281e7b9ab29f184c047b94f3986d65da199a74c169d0e2fd6af59cf37b7deb69dcfb1cb4763bb1ebca30d46b5b90
30
31 diff --git a/media-gfx/yafaray/files/yafaray-3.3.0-blender-exporter-paths.patch b/media-gfx/yafaray/files/yafaray-3.3.0-blender-exporter-paths.patch
32 new file mode 100644
33 index 00000000000..9bf4f2b91f6
34 --- /dev/null
35 +++ b/media-gfx/yafaray/files/yafaray-3.3.0-blender-exporter-paths.patch
36 @@ -0,0 +1,15 @@
37 +diff --git a/work/Blender-Exporter-3.3.0/__init__.py b/work/Blender-Exporter-3.3.0/__init__.py
38 +index 85dc1c2..70a79e8 100644
39 +--- a/__init__.py
40 ++++ b/__init__.py
41 +@@ -22,8 +22,8 @@ import sys
42 + import os
43 + import ctypes
44 +
45 +-PLUGIN_PATH = os.path.join(__path__[0], 'bin', 'yafaray-plugins')
46 +-BIN_PATH = os.path.join(__path__[0], 'bin')
47 ++PLUGIN_PATH = '/usr/lib/yafaray-plugins'
48 ++BIN_PATH = '/usr/bin'
49 + YAF_ID_NAME = "YAFA_V3_RENDER"
50 +
51 + # Version to be automatically populated during the cmake build process, getting the version from git tags
52
53 diff --git a/media-gfx/yafaray/files/yafaray-3.3.0-respect-cflags.patch b/media-gfx/yafaray/files/yafaray-3.3.0-respect-cflags.patch
54 new file mode 100644
55 index 00000000000..c22ff7e41ea
56 --- /dev/null
57 +++ b/media-gfx/yafaray/files/yafaray-3.3.0-respect-cflags.patch
58 @@ -0,0 +1,14 @@
59 +diff --git a/work/Core-3.3.0/CMakeLists.txt b/work/Core-3.3.0/CMakeLists.txt
60 +index 75fd2c6..94c2502 100644
61 +--- a/CMakeLists.txt
62 ++++ b/CMakeLists.txt
63 +@@ -219,9 +219,6 @@ if(NOT WIN32)
64 + set(YAF_BINDINGS_RUBY_DIR ${YAF_LIB_DIR})
65 + endif(NOT YAF_BINDINGS_RUBY_DIR)
66 +
67 +- # build flags
68 +- set(CMAKE_CXX_FLAGS "-Wall" CACHE STRING "Default compiler flags" FORCE)
69 +-
70 + if(USER_RELEASE_OPTIMIZATION_FLAGS)
71 + set(YAF_CXX_FLAGS_RELEASE ${USER_RELEASE_OPTIMIZATION_FLAGS})
72 + else(USER_RELEASE_OPTIMIZATION_FLAGS)
73
74 diff --git a/media-gfx/yafaray/files/yafaray-3.3.0-strip-debug-mode.patch b/media-gfx/yafaray/files/yafaray-3.3.0-strip-debug-mode.patch
75 new file mode 100644
76 index 00000000000..3bdb4eeef36
77 --- /dev/null
78 +++ b/media-gfx/yafaray/files/yafaray-3.3.0-strip-debug-mode.patch
79 @@ -0,0 +1,12 @@
80 +diff --git a/work/Core-3.3.0/CMakeLists.txt b/work/Core-3.3.0/CMakeLists.txt
81 +index 75fd2c6..52c6b3d 100644
82 +--- a/CMakeLists.txt
83 ++++ b/CMakeLists.txt
84 +@@ -17,7 +17,6 @@ option(WITH_YAF_PY_BINDINGS "Enable the YafaRay Python bindings" ON)
85 + option(WITH_YAF_RUBY_BINDINGS "Enable the YafaRay Ruby bindings" OFF)
86 + option(WITH_OSX_ADDON "Enable the use of blender's included python lib on OSX platforms" OFF)
87 + option(WITH_OpenCV "Build OpenCV image processing support" ON)
88 +-option(DEBUG_BUILD "Enable debug build mode" OFF)
89 + option(EMBED_FONT_QT "Embed font for QT GUI (usefull for some buggy QT installations)" OFF)
90 + option(FAST_MATH "Enable mathematic approximations to make code faster" ON)
91 + option(FAST_TRIG "Enable trigonometric approximations to make code faster" ON)
92
93 diff --git a/media-gfx/yafaray/metadata.xml b/media-gfx/yafaray/metadata.xml
94 new file mode 100644
95 index 00000000000..cee5f0b787f
96 --- /dev/null
97 +++ b/media-gfx/yafaray/metadata.xml
98 @@ -0,0 +1,23 @@
99 +<?xml version="1.0" encoding="UTF-8"?>
100 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
101 +<pkgmetadata>
102 + <maintainer type="person">
103 + <email>herb@×××××.com</email>
104 + <name>Herb Miller Jr. (herbmillerjr)</name>
105 + </maintainer>
106 + <maintainer type="project">
107 + <email>proxy-maint@g.o</email>
108 + <name>Proxy Maintainers</name>
109 + </maintainer>
110 + <longdescription lang="en">
111 + YafaRay is a raytracing open source render engine. Raytracing is a rendering technique for generating realistic images by tracing the path of light through a 3D scene.
112 + An render engine consists of a "faceless" computer program that interacts with a host 3D application to provide very specific raytracing capabilties "on demand". Blender 3D is the host application of YafaRay.
113 + </longdescription>
114 + <use>
115 + <flag name="blender">Install addon for <pkg>media-gfx/blender</pkg></flag>
116 + <flag name="fastmath">Enable mathematic approximations to make code faster</flag>
117 + <flag name="fasttrig">Enable trigonometric approximations to make code faster</flag>
118 + <flag name="opencv">Use <pkg>media-libs/opencv</pkg></flag>
119 + </use>
120 +</pkgmetadata>
121 +
122
123 diff --git a/media-gfx/yafaray/yafaray-3.3.0.ebuild b/media-gfx/yafaray/yafaray-3.3.0.ebuild
124 new file mode 100644
125 index 00000000000..3b077ecb4aa
126 --- /dev/null
127 +++ b/media-gfx/yafaray/yafaray-3.3.0.ebuild
128 @@ -0,0 +1,101 @@
129 +# Copyright 1999-2018 Gentoo Foundation
130 +# Distributed under the terms of the GNU General Public License v2
131 +
132 +EAPI=6
133 +
134 +PYTHON_COMPAT=( python3_{5,6} )
135 +inherit cmake-utils python-single-r1
136 +
137 +DESCRIPTION="A free open-source montecarlo raytracing engine"
138 +HOMEPAGE="http://www.yafaray.org"
139 +SRC_URI="https://github.com/YafaRay/Core/archive/v${PV}.tar.gz -> ${PN}-core-${PV}.tar.gz
140 + https://github.com/YafaRay/Blender-Exporter/archive/v${PV}.tar.gz -> ${PN}-blender-exporter-${PV}.tar.gz"
141 +
142 +LICENSE="LGPL-2.1"
143 +SLOT="0"
144 +KEYWORDS="~amd64 ~x86"
145 +IUSE="+blender +fastmath +fasttrig jpeg opencv openexr png +python tiff truetype"
146 +
147 +RDEPEND="dev-libs/boost:=
148 + dev-libs/libxml2
149 + sys-libs/zlib
150 + blender? ( media-gfx/blender )
151 + jpeg? ( virtual/jpeg:0 )
152 + opencv? ( >=media-libs/opencv-3.1.0:=[openexr?] )
153 + openexr? ( >=media-libs/openexr-2.2.0:= )
154 + png? ( media-libs/libpng:= )
155 + python? ( ${PYTHON_DEPS} )
156 + tiff? ( media-libs/tiff:0 )
157 + truetype? ( media-libs/freetype )"
158 +DEPEND="${RDEPEND}
159 + dev-lang/swig"
160 +
161 +S="${WORKDIR}/Core-${PV}"
162 +
163 +src_prepare() {
164 + cmake-utils_src_prepare
165 +
166 + sed -i -e "s/@YAFARAY_BLENDER_EXPORTER_VERSION@/v${PV}/" "${WORKDIR}/Blender-Exporter-${PV}/__init__.py" || die
167 +
168 + eapply "${FILESDIR}/${P}-strip-debug-mode.patch"
169 + eapply "${FILESDIR}/${P}-respect-cflags.patch"
170 + pushd "${WORKDIR}/Blender-Exporter-${PV}" || die
171 + eapply "${FILESDIR}/${P}-blender-exporter-paths.patch"
172 + popd || dir
173 + eapply_user
174 +}
175 +
176 +src_configure() {
177 + local mycmakeargs=(
178 + -DYAF_LIB_DIR=$(get_libdir)
179 + -DWITH_YAF_PY_BINDINGS=$(usex python)
180 + -DWITH_YAF_RUBY_BINDINGS=OFF
181 + -DBLENDER_ADDON=OFF # addon is a separate package called blender-exporter
182 + -DCMAKE_SKIP_RPATH=ON # NULL DT_RUNPATH security problem
183 + -DFAST_MATH=$(usex fastmath)
184 + -DFAST_TRIG=$(usex fasttrig)
185 + -DWITH_JPEG="$(usex jpeg)"
186 + -DWITH_OpenCV="$(usex opencv)"
187 + -DWITH_OpenEXR="$(usex openexr)"
188 + -DWITH_PNG="$(usex png)"
189 + -DWITH_QT=OFF # qt4 only at the moment
190 + -DWITH_TIFF="$(usex tiff)"
191 + -DWITH_Freetype="$(usex truetype)"
192 + )
193 +
194 + cmake-utils_src_configure
195 +}
196 +
197 +src_install() {
198 + cmake-utils_src_install
199 +
200 + python_domodule "${BUILD_DIR}/src/bindings/yafaray_v3_interface.py"
201 + python_domodule "${BUILD_DIR}/src/bindings/_yafaray_v3_interface.so"
202 + rm -v "${D}"usr/$(get_libdir)/{yafaray_v3_interface.py,_yafaray_v3_interface.so} || die
203 +
204 + if use blender; then
205 + pushd "${WORKDIR}/Blender-Exporter-${PV}" || die
206 + rm README LICENSES INSTALL CHANGELOG .gitignore || die
207 + # grab blender version number for plugin directory
208 + local blender_plugin_dir=$(best_version media-gfx/blender)
209 + blender_plugin_dir=${blender_plugin_dir##*/} # remove category
210 + blender_plugin_dir=${blender_plugin_dir#*-} # remove package name
211 + blender_plugin_dir=${blender_plugin_dir%%-*} # remove revision number if exists
212 + insinto /usr/share/blender/${blender_plugin_dir}/scripts/addons/yafaray_v3
213 + doins -r .
214 + popd || die
215 + fi
216 +}
217 +
218 +pkg_postinst() {
219 + elog "To confirm your installation is working as expected, run"
220 + elog "yafaray-xml with /usr/share/yafaray/tests/test01/test01.xml"
221 + elog "as an input file, then compare the result to"
222 + elog "'/usr/share/yafaray/tests/test01/test01 - expected render result.png'"
223 + if use blender; then
224 + elog
225 + elog "To use within Blender, navigate to File -> User Preferences -> Add-ons (tab)"
226 + elog "and enable 'Render: YafaRay v3 Exporter'. This will make YafaRay available"
227 + elog "in the render engines drop-down."
228 + fi
229 +}