Update CI to not require git tags checked in and fix WASM32 paths.
[ldk-java] / genbindings.sh
index e208785f2156acac8ed0ad58b2b31e13615b0c58..cd549d792f9efb6bf7c8e9ddc8bb86e579a7f926 100755 (executable)
@@ -18,8 +18,17 @@ fi
 
 set -e
 
+if [ "$LDK_GARBAGECOLLECTED_GIT_OVERRIDE" = "" ]; then
+       export LDK_GARBAGECOLLECTED_GIT_OVERRIDE=$(git describe --tag --dirty)
+fi
+
 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}