Merge pull request #162395 from nepet/clightning/darwin

clightning: add darwin support

authored by Pavol Rusnak and committed by GitHub b2f1f708 d44916d1

+13 -3
+13 -3
pkgs/applications/blockchains/clightning/default.nix
··· 1 1 { lib 2 2 , stdenv 3 + , darwin 3 4 , fetchurl 4 5 , autoconf 5 6 , automake ··· 27 28 sha256 = "3c9dcb686217b2efe0e988e90b95777c4591e3335e259e01a94af87e0bf01809"; 28 29 }; 29 30 30 - nativeBuildInputs = [ autogen autoconf automake gettext libtool pkg-config py3 unzip which ]; 31 + # when building on darwin we need dawin.cctools to provide the correct libtool 32 + # as libwally-core detects the host as darwin and tries to add the -static 33 + # option to libtool, also we have to add the modified gsed package. 34 + nativeBuildInputs = [ autogen autoconf automake gettext pkg-config py3 unzip which ] 35 + ++ lib.optionals stdenv.isDarwin [ darwin.cctools darwin.autoSignDarwinBinariesHook ] ++ [ libtool ]; 31 36 32 37 buildInputs = [ gmp libsodium sqlite zlib ]; 33 38 34 - postPatch = '' 39 + # this causes some python trouble on a darwin host so we skip this step. 40 + # also we have to tell libwally-core to use sed instead of gsed. 41 + postPatch = if !stdenv.isDarwin then '' 35 42 patchShebangs \ 36 43 tools/generate-wire.py \ 37 44 tools/update-mocks.sh \ 38 45 tools/mockup.sh \ 39 46 devtools/sql-rewrite.py 47 + '' else '' 48 + substituteInPlace external/libwally-core/tools/autogen.sh --replace gsed sed && \ 49 + substituteInPlace external/libwally-core/configure.ac --replace gsed sed 40 50 ''; 41 51 42 52 configureFlags = [ "--disable-developer" "--disable-valgrind" ]; ··· 56 66 homepage = "https://github.com/ElementsProject/lightning"; 57 67 maintainers = with maintainers; [ jb55 prusnak ]; 58 68 license = licenses.mit; 59 - platforms = platforms.linux; 69 + platforms = platforms.linux ++ platforms.darwin; 60 70 }; 61 71 }