depot/third_party/nixpkgs/pkgs/development/libraries/tdlib/default.nix
Default email 83627f9931 Project import generated by Copybara.
GitOrigin-RevId: 2893f56de08021cffd9b6b6dfc70fd9ccd51eb60
2024-06-24 14:47:55 -04:00

40 lines
1.4 KiB
Nix

{ fetchFromGitHub, gperf, openssl, readline, zlib, cmake, lib, stdenv }:
stdenv.mkDerivation {
pname = "tdlib";
version = "1.8.31";
src = fetchFromGitHub {
owner = "tdlib";
repo = "td";
# 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.
rev = "8f19c751dc296cedb9a921badb7a02a8c0cb1aeb";
hash = "sha256-M9EFNgWIpBz276moCG3qJ1WDIEP5j24vuYHio9jc8W0=";
};
buildInputs = [ gperf openssl readline zlib ];
nativeBuildInputs = [ cmake ];
# 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}
'' + lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
sed -i "/vptr/d" test/CMakeLists.txt
'';
meta = with lib; {
description = "Cross-platform library for building Telegram clients";
homepage = "https://core.telegram.org/tdlib/";
license = [ licenses.boost ];
platforms = platforms.unix;
maintainers = [ maintainers.vyorkin ];
};
}