diff options
| author | spl3g <spleefer6@yandex.ru> | 2023-11-30 12:56:28 +0300 |
|---|---|---|
| committer | spl3g <spleefer6@yandex.ru> | 2023-11-30 12:56:28 +0300 |
| commit | c4ca6029b870bd4b6a4c4c5552b809fa1c38a811 (patch) | |
| tree | bc8fbc036136768a08749aab69f2a31a1a899d58 /pkgs | |
| parent | 2fcdab89e98354f5a69cfe1c3dfa23e9d04f60b8 (diff) | |
some tweaks
Diffstat (limited to 'pkgs')
| -rw-r--r-- | pkgs/default.nix | 1 | ||||
| -rw-r--r-- | pkgs/tdlib/default.nix | 40 |
2 files changed, 41 insertions, 0 deletions
diff --git a/pkgs/default.nix b/pkgs/default.nix index 1f436d8..fa41c73 100644 --- a/pkgs/default.nix +++ b/pkgs/default.nix @@ -5,4 +5,5 @@ ansel = pkgs.callPackage ./ansel { }; g-ls = pkgs.callPackage ./g-ls { }; draw = pkgs.callPackage ./draw { }; + tdlib = pkgs.callPackage ./tdlib { }; } 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 ]; + }; +} |
