swiften: unbreak package using Arch patch and scons flags

The `swiften` XMPP library was broken as of 2019. This commit
fixes it, by copying a patch from the Arch Linux PKGBUILD
(https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/swift)
and by using the same scons flags in that PKGBUILD.
Additionally, we use the SWIFTEN_INSTALLDIR env variable to actually
put something in the output.

Of note is the flag swiften_dll=1, which means that the library
is now built dynamically.
This commit is contained in:
eta 2020-06-16 16:24:18 +01:00
parent 138c2dc5be
commit 557644a125
2 changed files with 38 additions and 3 deletions

View File

@ -0,0 +1,32 @@
diff -wbBur swift-4.0.2/Swift/QtUI/UserSearch/QtUserSearchWindow.h swift-4.0.2.my/Swift/QtUI/UserSearch/QtUserSearchWindow.h
--- swift-4.0.2/Swift/QtUI/UserSearch/QtUserSearchWindow.h 2018-04-06 13:06:46.000000000 +0300
+++ swift-4.0.2.my/Swift/QtUI/UserSearch/QtUserSearchWindow.h 2019-10-08 20:52:23.171475337 +0300
@@ -9,6 +9,7 @@
#include <set>
#include <QWizard>
+#include <QAbstractItemModel>
#include <Swiften/Base/Override.h>
diff -wbBur swift-4.0.2/Swiften/Network/PlatformNATTraversalWorker.cpp swift-4.0.2.my/Swiften/Network/PlatformNATTraversalWorker.cpp
--- swift-4.0.2/Swiften/Network/PlatformNATTraversalWorker.cpp 2018-04-06 13:06:46.000000000 +0300
+++ swift-4.0.2.my/Swiften/Network/PlatformNATTraversalWorker.cpp 2019-10-08 21:12:25.284754131 +0300
@@ -157,7 +157,7 @@
miniUPnPInterface = new MiniUPnPInterface();
miniUPnPSupported = miniUPnPInterface->isAvailable();
}
- SWIFT_LOG(debug) << "UPnP NAT traversal supported: " << miniUPnPSupported << std::endl;
+// SWIFT_LOG(debug) << "UPnP NAT traversal supported: " << miniUPnPSupported << std::endl;
if (miniUPnPSupported) {
return miniUPnPInterface;
}
@@ -168,7 +168,7 @@
natPMPInterface = new NATPMPInterface();
natPMPSupported = natPMPInterface->isAvailable();
}
- SWIFT_LOG(debug) << "NAT-PMP NAT traversal supported: " << natPMPSupported << std::endl;
+// SWIFT_LOG(debug) << "NAT-PMP NAT traversal supported: " << natPMPSupported << std::endl;
if (natPMPSupported) {
return natPMPInterface;
}

View File

@ -12,17 +12,21 @@ stdenv.mkDerivation rec {
sha256 = "0w0aiszjd58ynxpacwcgf052zpmbpcym4dhci64vbfgch6wryz0w"; sha256 = "0w0aiszjd58ynxpacwcgf052zpmbpcym4dhci64vbfgch6wryz0w";
}; };
patches = [ ./scons.patch ]; patches = [ ./scons.patch ./build-fix.patch ];
sconsFlags = [ sconsFlags = [
"openssl=${openssl.dev}" "openssl=${openssl.dev}"
"boost_includedir=${boost.dev}/include" "boost_includedir=${boost.dev}/include"
"boost_libdir=${boost.out}/lib" "boost_libdir=${boost.out}/lib"
"boost_bundled_enable=false" "boost_bundled_enable=false"
"max_jobs=1"
"optimize=1"
"debug=0"
"swiften_dll=1"
]; ];
preInstall = '' preInstall = ''
installTargets="$out" installTargets="$out"
installFlags+=" SWIFT_INSTALLDIR=$out" installFlags+=" SWIFTEN_INSTALLDIR=$out"
''; '';
enableParallelBuilding = true; enableParallelBuilding = true;
@ -33,6 +37,5 @@ stdenv.mkDerivation rec {
license = licenses.gpl2Plus; license = licenses.gpl2Plus;
platforms = platforms.linux; platforms = platforms.linux;
maintainers = [ maintainers.twey ]; maintainers = [ maintainers.twey ];
broken = true; # Broken since 2019-11-20 (https://hydra.nixos.org/build/114681755)
}; };
} }