2022-01-13 20:06:32 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, libidn
|
|
|
|
, lua
|
|
|
|
, miniupnpc
|
|
|
|
, expat
|
|
|
|
, zlib
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, openssl
|
|
|
|
, boost
|
|
|
|
, sconsPackages
|
|
|
|
}:
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "swiften";
|
2022-11-27 09:42:12 +00:00
|
|
|
version = "4.0.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-11-27 09:42:12 +00:00
|
|
|
url = "http://swift.im/git/swift/snapshot/swift-${version}.tar.bz2";
|
|
|
|
hash = "sha256-aj+T6AevtR8birbsj+83nfzFC6cf72q+7nwSM0jaZrA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
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 = [
|
2022-11-27 09:42:12 +00:00
|
|
|
sconsPackages.scons_latest
|
2022-01-13 20:06:32 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libidn
|
|
|
|
lua
|
|
|
|
miniupnpc
|
|
|
|
expat
|
|
|
|
zlib
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
openssl
|
|
|
|
boost
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
sconsFlags = [
|
|
|
|
"openssl=${openssl.dev}"
|
|
|
|
"boost_includedir=${boost.dev}/include"
|
|
|
|
"boost_libdir=${boost.out}/lib"
|
|
|
|
"boost_bundled_enable=false"
|
2020-06-18 07:06:33 +00:00
|
|
|
"max_jobs=1"
|
|
|
|
"optimize=1"
|
|
|
|
"debug=0"
|
|
|
|
"swiften_dll=1"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
2022-01-13 20:06:32 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Ensure bundled dependencies cannot be used.
|
|
|
|
rm -rf 3rdParty
|
2022-11-27 09:42:12 +00:00
|
|
|
|
|
|
|
find . \( \
|
|
|
|
-name '*.py' -o -name SConscript -o -name SConstruct \
|
|
|
|
\) -exec 2to3 -w {} +
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-01-13 20:06:32 +00:00
|
|
|
installTargets = "${placeholder "out"}";
|
|
|
|
|
|
|
|
installFlags = [
|
|
|
|
"SWIFTEN_INSTALLDIR=${placeholder "out"}"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "An XMPP library for C++, used by the Swift client";
|
2022-01-13 20:06:32 +00:00
|
|
|
homepage = "http://swift.im/swiften.html";
|
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = [ maintainers.twey ];
|
|
|
|
};
|
|
|
|
}
|