2021-02-05 17:12:51 +00:00
|
|
|
{ fetchFromGitHub, gperf, openssl, readline, zlib, cmake, lib, stdenv }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "tdlib";
|
2023-02-02 18:25:31 +00:00
|
|
|
version = "1.8.10";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tdlib";
|
|
|
|
repo = "td";
|
2022-10-30 15:09:59 +00:00
|
|
|
|
|
|
|
# The tdlib authors do not set tags for minor versions, but
|
|
|
|
# external programs depending on tdlib constrain the minor
|
|
|
|
# version, hence we set a specific commit with a known version.
|
2023-02-02 18:25:31 +00:00
|
|
|
rev = "93c42f6d7c1209937431469f80427d48907f1b8d";
|
|
|
|
hash = "sha256-vdaVnC26txUBp8rlqx1CdLHlNlack3XXYdfFal1VLh4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ gperf openssl readline zlib ];
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
# https://github.com/tdlib/td/issues/1974
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMake/GeneratePkgConfig.cmake \
|
|
|
|
--replace 'function(generate_pkgconfig' \
|
|
|
|
'include(GNUInstallDirs)
|
|
|
|
function(generate_pkgconfig' \
|
|
|
|
--replace '\$'{prefix}/'$'{CMAKE_INSTALL_LIBDIR} '$'{CMAKE_INSTALL_FULL_LIBDIR} \
|
|
|
|
--replace '\$'{prefix}/'$'{CMAKE_INSTALL_INCLUDEDIR} '$'{CMAKE_INSTALL_FULL_INCLUDEDIR}
|
2022-10-21 18:38:19 +00:00
|
|
|
'' + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
|
|
|
|
sed -i "/vptr/d" test/CMakeLists.txt
|
2022-09-30 11:47:45 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Cross-platform library for building Telegram clients";
|
|
|
|
homepage = "https://core.telegram.org/tdlib/";
|
|
|
|
license = [ licenses.boost ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.vyorkin ];
|
|
|
|
};
|
|
|
|
}
|