commit:     d2ca547e88fab4cffb9a2d70a7e85f194d164995
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Feb  4 22:16:28 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Feb  4 22:49:36 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d2ca547e

media-gfx/opentoonz: add build fixes

Closes: https://bugs.gentoo.org/723946
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/opentoonz-1.4.0-fix-header.patch         | 13 ++++
 .../opentoonz/files/opentoonz-1.4.0-qt-5.15.patch  | 22 ++++++
 media-gfx/opentoonz/opentoonz-1.4.0-r1.ebuild      | 91 ++++++++++++++++++++++
 3 files changed, 126 insertions(+)

diff --git a/media-gfx/opentoonz/files/opentoonz-1.4.0-fix-header.patch 
b/media-gfx/opentoonz/files/opentoonz-1.4.0-fix-header.patch
new file mode 100644
index 000000000000..299c927a5817
--- /dev/null
+++ b/media-gfx/opentoonz/files/opentoonz-1.4.0-fix-header.patch
@@ -0,0 +1,13 @@
+https://bugs.gentoo.org/723946k
+--- a/toonz/sources/common/twain/twain.h
++++ b/toonz/sources/common/twain/twain.h
+@@ -2209,7 +2209,7 @@ typedef struct {
+ #elif defined(TWH_CMP_GNU)
+ #pragma pack(pop, before_twain)
+ #elif defined(TWH_CMP_BORLAND)
+-#pragma option –a.
++#pragma option_a.
+ #elif defined(TWH_CMP_XCODE)
+ #if PRAGMA_STRUCT_ALIGN
+ #pragma options align = reset
+ 

diff --git a/media-gfx/opentoonz/files/opentoonz-1.4.0-qt-5.15.patch 
b/media-gfx/opentoonz/files/opentoonz-1.4.0-qt-5.15.patch
new file mode 100644
index 000000000000..1a4f54e2ebb4
--- /dev/null
+++ b/media-gfx/opentoonz/files/opentoonz-1.4.0-qt-5.15.patch
@@ -0,0 +1,22 @@
+https://bugs.gentoo.org/723946
+--- a/toonz/sources/tnztools/toolutils.cpp
++++ b/toonz/sources/tnztools/toolutils.cpp
+@@ -42,6 +42,7 @@
+ #include "tools/strokeselection.h"
+ 
+ #include <QPainter>
++#include <QPainterPath>
+ #include <QGLWidget>  // for QGLWidget::convertToGLFormat
+ #include <QFont>
+ #include <QFontMetrics>
+--- a/toonz/sources/toonzqt/functionpanel.cpp
++++ b/toonz/sources/toonzqt/functionpanel.cpp
+@@ -28,6 +28,7 @@
+ #include <QWheelEvent>
+ #include <QMenu>
+ #include <QSettings>
++#include <QPainterPath>
+ 
+ #include <cmath>
+ 
+

diff --git a/media-gfx/opentoonz/opentoonz-1.4.0-r1.ebuild 
b/media-gfx/opentoonz/opentoonz-1.4.0-r1.ebuild
new file mode 100644
index 000000000000..4d3987c46011
--- /dev/null
+++ b/media-gfx/opentoonz/opentoonz-1.4.0-r1.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CMAKE_MAKEFILE_GENERATOR=emake
+inherit cmake xdg-utils
+
+DESCRIPTION="An open-source full-featured 2D animation creation software"
+HOMEPAGE="https://github.com/opentoonz/opentoonz";
+SRC_URI="https://github.com/opentoonz/opentoonz/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="BSD libtiff"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+BDEPEND="
+       dev-qt/linguist-tools:5
+       virtual/pkgconfig
+"
+RDEPEND="
+       app-arch/lz4:=
+       dev-libs/boost:=
+       dev-libs/lzo:2
+       >=dev-qt/qtcore-5.9:5
+       >=dev-qt/qtgui-5.9:5
+       >=dev-qt/qtmultimedia-5.9:5[widgets]
+       >=dev-qt/qtnetwork-5.9:5
+       >=dev-qt/qtopengl-5.9:5
+       >=dev-qt/qtprintsupport-5.9:5
+       >=dev-qt/qtscript-5.9:5
+       >=dev-qt/qtsvg-5.9:5
+       >=dev-qt/qtwidgets-5.9:5
+       >=dev-qt/qtxml-5.9:5
+       media-libs/freeglut
+       media-libs/freetype:2
+       media-libs/glew:=
+       media-libs/libjpeg-turbo
+       >=media-libs/libmypaint-1.3.0:=
+       media-libs/libpng:=
+       >=sci-libs/superlu-4.1:=
+       sys-libs/zlib
+       virtual/cblas
+       virtual/libusb:1
+       virtual/opengl
+"
+DEPEND="
+       ${RDEPEND}
+"
+
+CMAKE_USE_DIR="${S}"/toonz/sources
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.4.0-fix-header.patch
+       "${FILESDIR}"/${PN}-1.4.0-qt-5.15.patch
+)
+
+src_configure() {
+       local mycmakeargs=(
+               
-DTIFF_LIBRARY="${S}/thirdparty/tiff-4.0.3/libtiff/.libs/libtiff.a"
+               -DSUPERLU_INCLUDE_DIR="${EPREFIX}/usr/include/superlu"
+               -DLZO_INCLUDE_DIR="${EPREFIX}/usr/include/lzo"
+               -DCMAKE_SKIP_RPATH=ON
+       )
+
+       # The upstream uses their own modified libtiff
+       # See: 
https://github.com/opentoonz/opentoonz/blob/master/doc/how_to_build_linux.md#building-libtiff
+       cd thirdparty/tiff-4.0.3 || die
+       CONFIG_SHELL="${BROOT}"/bin/bash econf \
+               --with-pic \
+               --disable-jbig \
+               --enable-static \
+               --disable-shared
+
+       cmake_src_configure
+}
+
+src_compile() {
+       cd "${S}"/thirdparty/tiff-4.0.3 || die
+       emake
+
+       cmake_src_compile
+}
+
+pkg_postinst() {
+       xdg_icon_cache_update
+}
+
+pkg_postrm() {
+       xdg_icon_cache_update
+}

Reply via email to