Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / swiften / default.nix
blobf839021c949eaef922022443a9ef07a02ca8945c
1 { stdenv
2 , lib
3 , libidn
4 , lua
5 , miniupnpc
6 , expat
7 , zlib
8 , fetchurl
9 , fetchpatch
10 , openssl
11 , boost
12 , scons
15 stdenv.mkDerivation rec {
16   pname = "swiften";
17   version = "4.0.3";
19   src = fetchurl {
20     url = "http://swift.im/git/swift/snapshot/swift-${version}.tar.bz2";
21     hash = "sha256-aj+T6AevtR8birbsj+83nfzFC6cf72q+7nwSM0jaZrA=";
22   };
24   patches = [
25     ./scons.patch
26     ./build-fix.patch
28     # Fix build with latest boost
29     # https://swift.im/git/swift/commit/Swiften/Base/Platform.h?id=3666cbbe30e4d4e25401a5902ae359bc2c24248b
30     (fetchpatch {
31       name = "3666cbbe30e4d4e25401a5902ae359bc2c24248b.patch";
32       url = "https://swift.im/git/swift/patch/Swiften/Base/Platform.h?id=3666cbbe30e4d4e25401a5902ae359bc2c24248b";
33       sha256 = "Wh8Nnfm0/EppSJ7aH2vTNObHtodE5tM19kV1oDfm70w=";
34     })
35   ];
37   nativeBuildInputs = [
38     scons
39   ];
41   buildInputs = [
42     libidn
43     lua
44     miniupnpc
45     expat
46     zlib
47   ];
49   propagatedBuildInputs = [
50     openssl
51     boost
52   ];
54   sconsFlags = [
55     "openssl=${openssl.dev}"
56     "boost_includedir=${boost.dev}/include"
57     "boost_libdir=${boost.out}/lib"
58     "boost_bundled_enable=false"
59     "max_jobs=1"
60     "optimize=1"
61     "debug=0"
62     "swiften_dll=1"
63   ];
65   postPatch = ''
66     # Ensure bundled dependencies cannot be used.
67     rm -rf 3rdParty
69     find . \( \
70       -name '*.py' -o -name SConscript -o -name SConstruct \
71       \) -exec 2to3 -w {} +
72   '';
74   installTargets = "${placeholder "out"}";
76   installFlags = [
77     "SWIFTEN_INSTALLDIR=${placeholder "out"}"
78   ];
80   enableParallelBuilding = true;
82   meta = with lib; {
83     description = "An XMPP library for C++, used by the Swift client";
84     homepage = "http://swift.im/swiften.html";
85     license = licenses.gpl2Plus;
86     platforms = platforms.linux;
87     maintainers = [ maintainers.twey ];
88   };