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 { lib 2 , stdenv 3 , fetchurl 4 , autoconf 5 , automake ··· 27 sha256 = "3c9dcb686217b2efe0e988e90b95777c4591e3335e259e01a94af87e0bf01809"; 28 }; 29 30 - nativeBuildInputs = [ autogen autoconf automake gettext libtool pkg-config py3 unzip which ]; 31 32 buildInputs = [ gmp libsodium sqlite zlib ]; 33 34 - postPatch = '' 35 patchShebangs \ 36 tools/generate-wire.py \ 37 tools/update-mocks.sh \ 38 tools/mockup.sh \ 39 devtools/sql-rewrite.py 40 ''; 41 42 configureFlags = [ "--disable-developer" "--disable-valgrind" ]; ··· 56 homepage = "https://github.com/ElementsProject/lightning"; 57 maintainers = with maintainers; [ jb55 prusnak ]; 58 license = licenses.mit; 59 - platforms = platforms.linux; 60 }; 61 }
··· 1 { lib 2 , stdenv 3 + , darwin 4 , fetchurl 5 , autoconf 6 , automake ··· 28 sha256 = "3c9dcb686217b2efe0e988e90b95777c4591e3335e259e01a94af87e0bf01809"; 29 }; 30 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 ]; 36 37 buildInputs = [ gmp libsodium sqlite zlib ]; 38 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 '' 42 patchShebangs \ 43 tools/generate-wire.py \ 44 tools/update-mocks.sh \ 45 tools/mockup.sh \ 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 50 ''; 51 52 configureFlags = [ "--disable-developer" "--disable-valgrind" ]; ··· 66 homepage = "https://github.com/ElementsProject/lightning"; 67 maintainers = with maintainers; [ jb55 prusnak ]; 68 license = licenses.mit; 69 + platforms = platforms.linux ++ platforms.darwin; 70 }; 71 }