···11{ lib
22, stdenv
33+, darwin
34, fetchurl
45, autoconf
56, automake
···2728 sha256 = "3c9dcb686217b2efe0e988e90b95777c4591e3335e259e01a94af87e0bf01809";
2829 };
29303030- nativeBuildInputs = [ autogen autoconf automake gettext libtool pkg-config py3 unzip which ];
3131+ # when building on darwin we need dawin.cctools to provide the correct libtool
3232+ # as libwally-core detects the host as darwin and tries to add the -static
3333+ # option to libtool, also we have to add the modified gsed package.
3434+ nativeBuildInputs = [ autogen autoconf automake gettext pkg-config py3 unzip which ]
3535+ ++ lib.optionals stdenv.isDarwin [ darwin.cctools darwin.autoSignDarwinBinariesHook ] ++ [ libtool ];
31363237 buildInputs = [ gmp libsodium sqlite zlib ];
33383434- postPatch = ''
3939+ # this causes some python trouble on a darwin host so we skip this step.
4040+ # also we have to tell libwally-core to use sed instead of gsed.
4141+ postPatch = if !stdenv.isDarwin then ''
3542 patchShebangs \
3643 tools/generate-wire.py \
3744 tools/update-mocks.sh \
3845 tools/mockup.sh \
3946 devtools/sql-rewrite.py
4747+ '' else ''
4848+ substituteInPlace external/libwally-core/tools/autogen.sh --replace gsed sed && \
4949+ substituteInPlace external/libwally-core/configure.ac --replace gsed sed
4050 '';
41514252 configureFlags = [ "--disable-developer" "--disable-valgrind" ];
···5666 homepage = "https://github.com/ElementsProject/lightning";
5767 maintainers = with maintainers; [ jb55 prusnak ];
5868 license = licenses.mit;
5959- platforms = platforms.linux;
6969+ platforms = platforms.linux ++ platforms.darwin;
6070 };
6171}