Update net-im/spectral to latest upstream release.

After this afternoon's accidental update, fix the port and complete
the update.

- Spectral expects some unreleased and unpackaged dependencies, which
  is why the DISTFILES are a mess: it's gitlab, except this one
  dependency on github, and this other one.
- libQuotient is net-im/libQuaternion, except that spectral needs a
  newer-than-the-latest-unreleased version.
- there is a rather arbitrary and hackish patch to avoid a compile
  error -- during template expansion of visit() I sometimes got
  a compiler crash, more often an error about returning a value in
  a void function. Since the whole package is glued together with
  unreleased submodules, I spent some time trying to fix it, and
  then decided that this is non-essential functionality. Two
  events trigger the compile error, so I commented them out.

PORTREVISION bumped because there's a tiny chance that something
might have built out of the mess that there was earlier.
This commit is contained in:
Adriaan de Groot 2020-06-15 21:14:46 +00:00
parent ef408eef87
commit 8c48f47bcd
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=539290
5 changed files with 101 additions and 13 deletions

View file

@ -2,6 +2,7 @@
PORTNAME= spectral
PORTVERSION= 817
PORTREVISION= 1
CATEGORIES= net-im
MAINTAINER= adridg@FreeBSD.org
@ -10,7 +11,8 @@ COMMENT= Glossy Matrix IM client based on Qt technologies
LICENSE= GPLv3
LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= libqmatrixclient>=0.5.3.2:net-im/libqmatrixclient
LIB_DEPENDS= libqt5keychain.so:security/qtkeychain \
libcmark.so:textproc/cmark
USES= cmake compiler:c++17-lang gl pkgconfig qt:5 tar:bz2
USE_GL= gl
@ -18,11 +20,23 @@ USE_QT= core dbus declarative graphicaleffects gui imageformats \
multimedia network quickcontrols quickcontrols2 svg widgets \
buildtools_build linguist_build qmake_build
USE_GITLAB= yes
GL_ACCOUNT= spectral-im
GL_PROJECT= spectral \
SortFilterProxyModel:sfpm
GL_COMMIT= 8d6e69d5529b932b85a2f5e6774de27a267a2ace \
c61f2bdb0da48804a596a9a3a9382eebdba764dc:sfpm
CMAKE_ON= USE_INTREE_LIBQMC
SFPMNAME= SortFilterProxyModel
SFPMVERSION= 36befddf5d57faad990e72c88c5844794f274145
QUOTNAME= libQuotient
QUOTVERSION= 58dfe74390ebdd8ec6611d3b8fecfe7d051ff955
DISTFILES= ${PORTNAME}-${PORTVERSION}.tar.bz2:spectral \
${SFPMVERSION}.zip:sfpm \
${QUOTVERSION}.zip:quot
MASTER_SITES= https://gitlab.com/spectral-im/spectral/-/archive/${PORTVERSION}/:spectral \
https://github.com/oKcerG/${SFPMNAME}/archive/:sfpm \
https://github.com/quotient-im/${QUOTNAME}/archive/:quot
post-extract:
${RMDIR} ${WRKSRC}/include/${SFPMNAME} ${WRKSRC}/include/${QUOTNAME}
${LN} -s ${WRKDIR}/${SFPMNAME}-${SFPMVERSION} ${WRKSRC}/include/${SFPMNAME}
${LN} -s ${WRKDIR}/${QUOTNAME}-${QUOTVERSION} ${WRKSRC}/include/${QUOTNAME}
.include <bsd.port.mk>

View file

@ -1,5 +1,7 @@
TIMESTAMP = 1588512516
SHA256 (spectral-im-spectral-8d6e69d5529b932b85a2f5e6774de27a267a2ace_GL0.tar.gz) = cc6ed91feb4af8078f0185fd64570c43d5c877030c255a011c7bfe9522e2505b
SIZE (spectral-im-spectral-8d6e69d5529b932b85a2f5e6774de27a267a2ace_GL0.tar.gz) = 845196
SHA256 (spectral-im-SortFilterProxyModel-c61f2bdb0da48804a596a9a3a9382eebdba764dc_GL0.tar.gz) = 2403a578fc5b3e46ad1c3b14e71590ca4aaa00c521958020cd925e05fadc32c1
SIZE (spectral-im-SortFilterProxyModel-c61f2bdb0da48804a596a9a3a9382eebdba764dc_GL0.tar.gz) = 18483
TIMESTAMP = 1592232908
SHA256 (spectral-817.tar.bz2) = e49ec45b4a112beef173ca739905ee82e0af12827e67a552cb671d11d8c481df
SIZE (spectral-817.tar.bz2) = 850228
SHA256 (36befddf5d57faad990e72c88c5844794f274145.zip) = 9be60ac00b0671e678f8dd5b986aaa729baf4ec16fd0c65f71d2918cfeb159ce
SIZE (36befddf5d57faad990e72c88c5844794f274145.zip) = 133452
SHA256 (58dfe74390ebdd8ec6611d3b8fecfe7d051ff955.zip) = b5c25dc4e42b811b00e2aa799e5d166c5660d0d831e4656e315eb7b91a4b12b9
SIZE (58dfe74390ebdd8ec6611d3b8fecfe7d051ff955.zip) = 714335

View file

@ -0,0 +1,38 @@
Replace the linked libraries for QtKeychain by expanded ones.
This is a workaround for QtKeychain installing a Config.cmake file
that refers to libraries that are **not** expanded or in the
default search path (e.g. glib). Without this expansion,
we end up with -lglib in the final link line -- and no
corresponding -L/usr/local/lib to make sure it is actually found.
--- CMakeLists.txt.orig 2020-01-11 18:26:51 UTC
+++ CMakeLists.txt
@@ -206,6 +210,26 @@ endif(APPLE)
add_executable(${PROJECT_NAME} WIN32 MACOSX_BUNDLE
${spectral_SRCS} ${spectral_QRC_SRC} $<TARGET_OBJECTS:SortFilterProxyModel>
${spectral_WINRC} ${${PROJECT_NAME}_MAC_ICON})
+
+get_target_property(_libs
+ ${QTKEYCHAIN_LIBRARIES}
+ IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE)
+set(_expanded_libs "")
+foreach(d ${_libs})
+ if(TARGET ${d})
+ list(APPEND _expanded_libs ${d})
+ else()
+ find_library(_expanded_d ${d})
+ if(_expanded_d)
+ list(APPEND _expanded_libs ${_expanded_d})
+ else()
+ list(APPEND _expanded_libs ${d})
+ endif()
+ unset(_expanded_d)
+ endif()
+endforeach()
+set_target_properties(${QTKEYCHAIN_LIBRARIES} PROPERTIES
+ IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE ${_expanded_libs})
target_link_libraries(${PROJECT_NAME}
Qt5::Widgets Qt5::Quick Qt5::Qml Qt5::Gui Qt5::Network Qt5::Svg Qt5::QuickControls2

View file

@ -0,0 +1,35 @@
Avoid compiler error.
These two events cause template substitution errors. Since the
effect of removing them is that we don't get a nice name for
the events (user-facing), it's not essential.
--- src/spectralroom.cpp.orig 2020-06-15 18:48:37 UTC
+++ src/spectralroom.cpp
@@ -354,11 +354,13 @@ QString SpectralRoom::eventToString(const RoomEvent& e
return tr("has set room aliases on server %1 to: %2")
.arg(e.stateKey(), QLocale().createSeparatedList(e.aliases()));
},
+/*
[](const RoomCanonicalAliasEvent& e) {
return (e.alias().isEmpty())
? tr("cleared the room main alias")
: tr("set the room main alias to: %1").arg(e.alias());
},
+*/
[](const RoomNameEvent& e) {
return (e.name().isEmpty()) ? tr("cleared the room name")
: tr("set the room name to: %1")
@@ -372,9 +374,11 @@ QString SpectralRoom::eventToString(const RoomEvent& e
: e.topic());
},
[](const RoomAvatarEvent&) { return tr("changed the room avatar"); },
+/*
[](const EncryptionEvent&) {
return tr("activated End-to-End Encryption");
},
+*/
[](const RoomCreateEvent& e) {
return (e.isUpgrade() ? tr("upgraded the room to version %1")
: tr("created the room, version %1"))

View file

@ -1,7 +1,6 @@
bin/spectral
share/applications/org.eu.encom.spectral.desktop
share/icons/hicolor/128x128/apps/org.eu.encom.spectral.png
share/icons/hicolor/16x16/apps/org.eu.encom.spectral.png
share/icons/hicolor/256x256/apps/org.eu.encom.spectral.png
share/icons/hicolor/32x32/apps/org.eu.encom.spectral.png
share/icons/hicolor/512x512/apps/org.eu.encom.spectral.png