clightning: add darwin support

- Patch usage of gsed to sed
- Add darwin natives
main
Peter Neuroth 2 years ago
parent de7939d6cf
commit 72d265d548
No known key found for this signature in database
GPG Key ID: C3F21EE387FF4CD2
  1. 16
      pkgs/applications/blockchains/clightning/default.nix

@ -1,5 +1,6 @@
{ lib
, stdenv
, darwin
, fetchurl
, autoconf
, automake
@ -27,16 +28,25 @@ stdenv.mkDerivation rec {
sha256 = "3c9dcb686217b2efe0e988e90b95777c4591e3335e259e01a94af87e0bf01809";
};
nativeBuildInputs = [ autogen autoconf automake gettext libtool pkg-config py3 unzip which ];
# when building on darwin we need dawin.cctools to provide the correct libtool
# as libwally-core detects the host as darwin and tries to add the -static
# option to libtool, also we have to add the modified gsed package.
nativeBuildInputs = [ autogen autoconf automake gettext pkg-config py3 unzip which ]
++ lib.optionals stdenv.isDarwin [ darwin.cctools ] ++ [ libtool ];
buildInputs = [ gmp libsodium sqlite zlib ];
postPatch = ''
# this causes some python trouble on a darwin host so we skip this step.
# also we have to tell libwally-core to use sed instead of gsed.
postPatch = if !stdenv.isDarwin then ''
patchShebangs \
tools/generate-wire.py \
tools/update-mocks.sh \
tools/mockup.sh \
devtools/sql-rewrite.py
'' else ''
substituteInPlace external/libwally-core/tools/autogen.sh --replace gsed sed && \
substituteInPlace external/libwally-core/configure.ac --replace gsed sed
'';
configureFlags = [ "--disable-developer" "--disable-valgrind" ];
@ -56,6 +66,6 @@ stdenv.mkDerivation rec {
homepage = "https://github.com/ElementsProject/lightning";
maintainers = with maintainers; [ jb55 prusnak ];
license = licenses.mit;
platforms = platforms.linux;
platforms = platforms.linux ++ [ "x86_64-darwin" ];
};
}

Loading…
Cancel
Save