about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/swiften
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/swiften')
-rw-r--r--nixpkgs/pkgs/development/libraries/swiften/build-fix.patch42
-rw-r--r--nixpkgs/pkgs/development/libraries/swiften/default.nix89
-rw-r--r--nixpkgs/pkgs/development/libraries/swiften/scons.patch9
3 files changed, 140 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/swiften/build-fix.patch b/nixpkgs/pkgs/development/libraries/swiften/build-fix.patch
new file mode 100644
index 000000000000..d0ce099973c2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/swiften/build-fix.patch
@@ -0,0 +1,42 @@
+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;
+     }
+--- a/Swift/Controllers/ShowProfileController.h
++++ b/Swift/Controllers/ShowProfileController.h
+@@ -12,6 +12,7 @@
+ 
+ #pragma once
+ 
++#include <map>
+ #include <Swiften/Elements/ErrorPayload.h>
+ #include <Swiften/Elements/VCard.h>
+ #include <Swiften/JID/JID.h>
diff --git a/nixpkgs/pkgs/development/libraries/swiften/default.nix b/nixpkgs/pkgs/development/libraries/swiften/default.nix
new file mode 100644
index 000000000000..f839021c949e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/swiften/default.nix
@@ -0,0 +1,89 @@
+{ stdenv
+, lib
+, libidn
+, lua
+, miniupnpc
+, expat
+, zlib
+, fetchurl
+, fetchpatch
+, openssl
+, boost
+, scons
+}:
+
+stdenv.mkDerivation rec {
+  pname = "swiften";
+  version = "4.0.3";
+
+  src = fetchurl {
+    url = "http://swift.im/git/swift/snapshot/swift-${version}.tar.bz2";
+    hash = "sha256-aj+T6AevtR8birbsj+83nfzFC6cf72q+7nwSM0jaZrA=";
+  };
+
+  patches = [
+    ./scons.patch
+    ./build-fix.patch
+
+    # Fix build with latest boost
+    # https://swift.im/git/swift/commit/Swiften/Base/Platform.h?id=3666cbbe30e4d4e25401a5902ae359bc2c24248b
+    (fetchpatch {
+      name = "3666cbbe30e4d4e25401a5902ae359bc2c24248b.patch";
+      url = "https://swift.im/git/swift/patch/Swiften/Base/Platform.h?id=3666cbbe30e4d4e25401a5902ae359bc2c24248b";
+      sha256 = "Wh8Nnfm0/EppSJ7aH2vTNObHtodE5tM19kV1oDfm70w=";
+    })
+  ];
+
+  nativeBuildInputs = [
+    scons
+  ];
+
+  buildInputs = [
+    libidn
+    lua
+    miniupnpc
+    expat
+    zlib
+  ];
+
+  propagatedBuildInputs = [
+    openssl
+    boost
+  ];
+
+  sconsFlags = [
+    "openssl=${openssl.dev}"
+    "boost_includedir=${boost.dev}/include"
+    "boost_libdir=${boost.out}/lib"
+    "boost_bundled_enable=false"
+    "max_jobs=1"
+    "optimize=1"
+    "debug=0"
+    "swiften_dll=1"
+  ];
+
+  postPatch = ''
+    # Ensure bundled dependencies cannot be used.
+    rm -rf 3rdParty
+
+    find . \( \
+      -name '*.py' -o -name SConscript -o -name SConstruct \
+      \) -exec 2to3 -w {} +
+  '';
+
+  installTargets = "${placeholder "out"}";
+
+  installFlags = [
+    "SWIFTEN_INSTALLDIR=${placeholder "out"}"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "An XMPP library for C++, used by the Swift client";
+    homepage = "http://swift.im/swiften.html";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.twey ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/swiften/scons.patch b/nixpkgs/pkgs/development/libraries/swiften/scons.patch
new file mode 100644
index 000000000000..d956767696d0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/swiften/scons.patch
@@ -0,0 +1,9 @@
+--- a/BuildTools/SCons/SConscript.boot
++++ b/BuildTools/SCons/SConscript.boot
+@@ -129,5 +129 @@ vars.Add(PathVariable("sparkle_public_dsa_key", "Optional path to a public DSA k
+-env_ENV = {
+-    'PATH' : os.environ['PATH'],
+-    'LD_LIBRARY_PATH' : os.environ.get("LD_LIBRARY_PATH", ""),
+-    'TERM' : os.environ.get("TERM", ""),
+-}
++env_ENV = os.environ