aboutsummaryrefslogtreecommitdiff
path: root/pkgs/tdlib
diff options
context:
space:
mode:
authorspl3g <spleefer6@yandex.ru>2023-11-30 12:56:28 +0300
committerspl3g <spleefer6@yandex.ru>2023-11-30 12:56:28 +0300
commitc4ca6029b870bd4b6a4c4c5552b809fa1c38a811 (patch)
treebc8fbc036136768a08749aab69f2a31a1a899d58 /pkgs/tdlib
parent2fcdab89e98354f5a69cfe1c3dfa23e9d04f60b8 (diff)
some tweaks
Diffstat (limited to 'pkgs/tdlib')
-rw-r--r--pkgs/tdlib/default.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/tdlib/default.nix b/pkgs/tdlib/default.nix
new file mode 100644
index 0000000..d81747e
--- /dev/null
+++ b/pkgs/tdlib/default.nix
@@ -0,0 +1,40 @@
+{ fetchFromGitHub, gperf, openssl, readline, zlib, cmake, lib, stdenv }:
+
+stdenv.mkDerivation rec {
+ pname = "tdlib";
+ version = "1.8.23";
+
+ 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 = "404761c525d933df813702c863828058cd26111a";
+ hash = "sha256-wyuGsLZFDRgziBPD9kvn2BJpPcVQCY2kU4j7Qy+9H6o==";
+ };
+
+ 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 ];
+ };
+}