File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change 1010 writeShellApplication ,
1111 common-updater-scripts ,
1212 jq ,
13+ buildPackages ,
1314} :
1415
1516let
@@ -49,12 +50,28 @@ stdenv.mkDerivation {
4950 } ;
5051
5152 buildInputs = [
52- gperf
5353 openssl
5454 readline
5555 zlib
5656 ] ;
57- nativeBuildInputs = [ cmake ] ;
57+
58+ nativeBuildInputs = [
59+ cmake
60+ gperf
61+ ] ;
62+
63+ depsBuildBuild = [ buildPackages . stdenv . cc ] ;
64+
65+ preConfigure = lib . optionalString ( stdenv . buildPlatform != stdenv . hostPlatform ) ''
66+ cmake -B native-build \
67+ -DCMAKE_C_COMPILER=$CC_FOR_BUILD \
68+ -DCMAKE_CXX_COMPILER=$CXX_FOR_BUILD \
69+ -DCMAKE_AR=$(command -v $AR_FOR_BUILD) \
70+ -DCMAKE_RANLIB=$(command -v $RANLIB_FOR_BUILD) \
71+ -DCMAKE_STRIP=$(command -v $STRIP_FOR_BUILD) \
72+ -DTD_GENERATE_SOURCE_FILES=ON .
73+ cmake --build native-build -j $NIX_BUILD_CORES
74+ '' ;
5875
5976 # https://github.com/tdlib/td/issues/1974
6077 postPatch =
You can’t perform that action at this time.
0 commit comments