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.patch10
-rw-r--r--nixpkgs/pkgs/development/libraries/swiften/default.nix72
2 files changed, 69 insertions, 13 deletions
diff --git a/nixpkgs/pkgs/development/libraries/swiften/build-fix.patch b/nixpkgs/pkgs/development/libraries/swiften/build-fix.patch
index 01814cadfbd4..d0ce099973c2 100644
--- a/nixpkgs/pkgs/development/libraries/swiften/build-fix.patch
+++ b/nixpkgs/pkgs/development/libraries/swiften/build-fix.patch
@@ -30,3 +30,13 @@ diff -wbBur swift-4.0.2/Swiften/Network/PlatformNATTraversalWorker.cpp swift-4.0
      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
index 980d034682f5..ef30c5916eab 100644
--- a/nixpkgs/pkgs/development/libraries/swiften/default.nix
+++ b/nixpkgs/pkgs/development/libraries/swiften/default.nix
@@ -1,18 +1,57 @@
-{ lib, stdenv, python, fetchurl, openssl, boost, sconsPackages }:
+{ stdenv
+, lib
+, python2
+, libidn
+, lua
+, miniupnpc
+, expat
+, zlib
+, fetchurl
+, fetchpatch
+, openssl
+, boost
+, sconsPackages
+}:
+
 stdenv.mkDerivation rec {
   pname = "swiften";
   version = "4.0.2";
 
-  nativeBuildInputs = [ sconsPackages.scons_3_1_2 ];
-  buildInputs           = [ python ];
-  propagatedBuildInputs = [ openssl boost ];
-
   src = fetchurl {
-    url    = "https://swift.im/downloads/releases/swift-${version}/swift-${version}.tar.gz";
+    url = "https://swift.im/downloads/releases/swift-${version}/swift-${version}.tar.gz";
     sha256 = "0w0aiszjd58ynxpacwcgf052zpmbpcym4dhci64vbfgch6wryz0w";
   };
 
-  patches = [ ./scons.patch ./build-fix.patch ];
+  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 = [
+    sconsPackages.scons_3_1_2
+  ];
+
+  buildInputs = [
+    python2
+    libidn
+    lua
+    miniupnpc
+    expat
+    zlib
+  ];
+
+  propagatedBuildInputs = [
+    openssl
+    boost
+  ];
 
   sconsFlags = [
     "openssl=${openssl.dev}"
@@ -24,18 +63,25 @@ stdenv.mkDerivation rec {
     "debug=0"
     "swiften_dll=1"
   ];
-  preInstall = ''
-    installTargets="$out"
-    installFlags+=" SWIFTEN_INSTALLDIR=$out"
+
+  postPatch = ''
+    # Ensure bundled dependencies cannot be used.
+    rm -rf 3rdParty
   '';
 
+  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;
+    homepage = "http://swift.im/swiften.html";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
     maintainers = [ maintainers.twey ];
   };
 }