Skip to content
Permalink
Browse files

nomacs: incorporate upstream bug fix

  • Loading branch information
MarcusCalhoun-Lopez committed Apr 21, 2018
1 parent d4e453e commit 5eac50ab142d1af6628620d37062bbd2caa260da
Showing with 84 additions and 0 deletions.
  1. +4 −0 aqua/nomacs/Portfile
  2. +80 −0 aqua/nomacs/files/patch-vtable.diff
@@ -39,6 +39,10 @@ configure.args-append -DQT_QMAKE_EXECUTABLE=${qt_qmake_cmd}
patchfiles-append patch-name.diff \
patch-Info.plist.in.diff

# see https://trac.macports.org/ticket/56275
# see https://github.com/nomacs/nomacs/issues/203
patchfiles-append patch-vtable.diff

post-destroot {
move {*}[glob ${destroot}${applications_dir}/*.dylib ${destroot}${prefix}/lib]
xinstall -d -m 0755 ${destroot}${applications_dir}/Nomacs.app/Contents/Resources
@@ -0,0 +1,80 @@
From 92a95cd288dd64829e33aeb5d8c6e9725219e6bd Mon Sep 17 00:00:00 2001
From: Raphael Kubo da Costa <rakuco@FreeBSD.org>
Date: Mon, 29 Jan 2018 12:01:50 +0100
Subject: [PATCH] cmake: Stop calling QT5_WRAP_CPP() when building quazip and
libqpsd.

cmake/Utils.cmake already sets CMAKE_AUTOMOC to on.

Calling QT5_WRAP_CPP() used to be just redundant, as QUAZIP_MOC_SRC and
LIBQPSD_MOC_SRC were never actually added as source dependencies in
MacBuildTarget.cmake and UnixBuildTarget.cmake. In other words, CMake's own
automoc infrastructure was actually being used and the moc invocations from
QT5_WRAP_CPP() were not being made at all.

Starting with Qt 5.9.4, calling QT5_WRAP_CPP() disables the AUTOMOC property
on the macro's input files, which means neither CMake's automoc
infrastructure not QT5_WRAP_CPP()'s code were being used and we ended up
with several 'undefined reference to vtable' errors when linking.
---
ImageLounge/cmake/Mac.cmake | 5 -----
ImageLounge/cmake/Unix.cmake | 5 -----
2 files changed, 10 deletions(-)

diff --git a/ImageLounge/cmake/Mac.cmake b/ImageLounge/cmake/Mac.cmake
index 73c01430..14e9494d 100644
--- cmake/Mac.cmake
+++ cmake/Mac.cmake
@@ -104,7 +104,6 @@ unset(QUAZIP_LIBRARIES CACHE)

unset(QUAZIP_HEADERS CACHE)
unset(QUAZIP_SOURCES CACHE)
-unset(QUAZIP_MOCS CACHE)
unset(QT_ROOT CACHE)

if(ENABLE_QUAZIP)
@@ -123,9 +122,7 @@ if(ENABLE_QUAZIP)

file(GLOB QUAZIP_SOURCES "3rdparty/quazip-0.7/quazip/*.c" "3rdparty/quazip-0.7/quazip/*.cpp")
file(GLOB QUAZIP_HEADERS "3rdparty/quazip-0.7/quazip/*.h")
- file(GLOB QUAZIP_MOCS "3rdparty/quazip-0.7/quazip/*.h")

- QT5_WRAP_CPP(QUAZIP_MOC_SRC ${QUAZIP_MOCS})
add_definitions(-DWITH_QUAZIP)
endif(USE_SYSTEM_QUAZIP)
endif(ENABLE_QUAZIP)
@@ -134,5 +131,3 @@ endif(ENABLE_QUAZIP)
# add libqpsd
file(GLOB LIBQPSD_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libqpsd/*.cpp")
file(GLOB LIBQPSD_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libqpsd/*.h")
-file(GLOB LIBQPSD_MOCS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libqpsd/*.h")
-QT5_WRAP_CPP(LIBQPSD_MOC_SRC ${LIBQPSD_MOCS})
diff --git a/ImageLounge/cmake/Unix.cmake b/ImageLounge/cmake/Unix.cmake
index 4cf2c0ec..5297d48c 100644
--- cmake/Unix.cmake
+++ cmake/Unix.cmake
@@ -97,7 +97,6 @@ unset(QUAZIP_LIBRARIES CACHE)

unset(QUAZIP_HEADERS CACHE)
unset(QUAZIP_SOURCES CACHE)
-unset(QUAZIP_MOCS CACHE)
unset(QT_ROOT CACHE)

if(ENABLE_QUAZIP)
@@ -116,9 +115,7 @@ if(ENABLE_QUAZIP)

file(GLOB QUAZIP_SOURCES "3rdparty/quazip-0.7/quazip/*.c" "3rdparty/quazip-0.7/quazip/*.cpp")
file(GLOB QUAZIP_HEADERS "3rdparty/quazip-0.7/quazip/*.h")
- file(GLOB QUAZIP_MOCS "3rdparty/quazip-0.7/quazip/*.h")

- QT5_WRAP_CPP(QUAZIP_MOC_SRC ${QUAZIP_MOCS})
add_definitions(-DWITH_QUAZIP)
endif(USE_SYSTEM_QUAZIP)
endif(ENABLE_QUAZIP)
@@ -132,6 +129,4 @@ IF(USE_SYSTEM_LIBQPSD)
ELSE()
file(GLOB LIBQPSD_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libqpsd/*.cpp")
file(GLOB LIBQPSD_HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libqpsd/*.h")
- file(GLOB LIBQPSD_MOCS "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/libqpsd/*.h")
- QT5_WRAP_CPP(LIBQPSD_MOC_SRC ${LIBQPSD_MOCS})
ENDIF(USE_SYSTEM_LIBQPSD)

0 comments on commit 5eac50a

Please sign in to comment.
You can’t perform that action at this time.