]> git.bitcoin.ninja Git - ldk-java/commitdiff
Fix genbindings.sh sed call on OSX
authorMatt Corallo <git@bluematt.me>
Thu, 22 Apr 2021 17:27:25 +0000 (17:27 +0000)
committerMatt Corallo <git@bluematt.me>
Sat, 1 May 2021 00:11:31 +0000 (00:11 +0000)
genbindings.sh

index e208785f2156acac8ed0ad58b2b31e13615b0c58..b06f9c40bed55d8b6e2144319f97a9f106633d1d 100755 (executable)
@@ -19,7 +19,12 @@ fi
 set -e
 
 cp "$1/lightning-c-bindings/include/lightning.h" ./
-sed -i "s/TransactionOutputs/C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ/g" ./lightning.h
+if [ "$(rustc --version --verbose | grep "host:")" = "host: x86_64-apple-darwin" ]; then
+       # OSX sed is for some reason not compatible with GNU sed
+       sed -i '' "s/TransactionOutputs/C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ/g" ./lightning.h
+else
+       sed -i "s/TransactionOutputs/C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ/g" ./lightning.h
+fi
 
 echo "Creating Java bindings..."
 mkdir -p src/main/java/org/ldk/{enums,structs}