2020-04-23 18:19:12 +00:00
|
|
|
#
|
|
|
|
# This prepares status-go build file called Statusgo.framework for XCode.
|
|
|
|
# It copies the status-go build result to 'modules/react-native-status/ios/RCTStatus'.
|
|
|
|
#
|
|
|
|
|
2020-04-26 12:40:06 +00:00
|
|
|
{ lib, mkShell, status-go }:
|
2019-11-29 10:20:08 +00:00
|
|
|
|
2020-04-23 18:19:12 +00:00
|
|
|
mkShell {
|
|
|
|
shellHook = ''
|
2022-03-02 14:30:27 +00:00
|
|
|
export STATUS_GO_IOS_LIBDIR=${status-go {}}/Statusgo.framework
|
2019-11-29 10:20:08 +00:00
|
|
|
|
2020-04-23 18:19:12 +00:00
|
|
|
RCTSTATUS_DIR="$STATUS_REACT_HOME/modules/react-native-status/ios/RCTStatus"
|
|
|
|
targetBasename='Statusgo.framework'
|
2019-11-29 10:20:08 +00:00
|
|
|
|
2020-04-23 18:19:12 +00:00
|
|
|
# Compare target folder with source to see if copying is required
|
|
|
|
if [ -d "$RCTSTATUS_DIR/$targetBasename" ] && [ -d $STATUS_REACT_HOME/ios/Pods/ ] && \
|
|
|
|
diff -qr --no-dereference $RCTSTATUS_DIR/$targetBasename/ $STATUS_GO_IOS_LIBDIR/ > /dev/null; then
|
|
|
|
echo "$RCTSTATUS_DIR/$targetBasename already in place"
|
|
|
|
else
|
|
|
|
sourceBasename="$(basename $STATUS_GO_IOS_LIBDIR)"
|
|
|
|
echo "Copying $sourceBasename from Nix store to $RCTSTATUS_DIR"
|
|
|
|
rm -rf "$RCTSTATUS_DIR/$targetBasename/"
|
|
|
|
cp -a $STATUS_GO_IOS_LIBDIR $RCTSTATUS_DIR
|
|
|
|
chmod -R 755 "$RCTSTATUS_DIR/$targetBasename"
|
|
|
|
if [ "$sourceBasename" != "$targetBasename" ]; then
|
|
|
|
mv "$RCTSTATUS_DIR/$sourceBasename" "$RCTSTATUS_DIR/$targetBasename"
|
2019-11-29 10:20:08 +00:00
|
|
|
fi
|
2020-04-23 18:19:12 +00:00
|
|
|
fi
|
|
|
|
'';
|
|
|
|
}
|