Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build #99

Merged
merged 12 commits into from
May 10, 2023
2 changes: 2 additions & 0 deletions ios/HaskellShelley.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@
"$(SRCROOT)/../../../React/**",
"$(SRCROOT)/../../react-native/React/**",
);
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = HaskellShelley;
Expand All @@ -326,6 +327,7 @@
"$(SRCROOT)/../../../React/**",
"$(SRCROOT)/../../react-native/React/**",
);
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = HaskellShelley;
Expand Down
15 changes: 7 additions & 8 deletions ios/Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions ios/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ if [ "${HAS_CARGO_IN_PATH}" -ne "0" ]; then
source $HOME/.cargo/env
fi

if [[ -n "${DEVELOPER_SDK_DIR:-}" ]] && [[ "$MAC_OS_VERSION" != "11" ]]; then
# Assume we're in Xcode, which means we're probably cross-compiling.
# In this case, we need to add an extra library search path for build scripts and proc-macros,
# which run on the host instead of the target.
# (macOS Big Sur does not have linkable libraries in /usr/lib/.)
export LIBRARY_PATH="${DEVELOPER_SDK_DIR}/MacOSX.sdk/usr/lib:${LIBRARY_PATH:-}"
fi

if [ -z "${PODS_TARGET_SRCROOT}" ]; then
ROOT_DIR="${SRCROOT}/../rust"
else
Expand All @@ -33,10 +25,14 @@ cd "${ROOT_DIR}"
if [[ "$TARGET_DEVICE_PLATFORM_NAME" == "iphonesimulator" ]] && [[ "$MAC_CURRENT_ARCH" == "arm64" ]]; then
# If we're building for the arm simulator on an M1 Mac, we need to use the x86_64-apple-ios-sim target.
# Otherwise, lipo will compile for arm64 iphone that can't run on the simulator.
ACTUAL_SDK_PATH=$(xcrun --sdk iphonesimulator --show-sdk-path)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stackchain I found more general way to retrieve sdk path. Revert it if won't work for you.

export LIBRARY_PATH="${ACTUAL_SDK_PATH}/usr/lib:${LIBRARY_PATH:-}"
cargo lipo --targets="aarch64-apple-ios-sim"
LIPO_BIN_TARGET_DIR="aarch64-apple-ios-sim"
else
cargo lipo --xcode-integ
ACTUAL_SDK_PATH=$(xcrun --sdk iphoneos --show-sdk-path)
export LIBRARY_PATH="${ACTUAL_SDK_PATH}/usr/lib:${LIBRARY_PATH:-}"
cargo lipo --xcode-intem
fi

mkdir -p "${CONFIGURATION_BUILD_DIR}"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@emurgo/react-native-haskell-shelley",
"title": "React Native Haskell Shelley",
"version": "5.0.0",
"version": "5.0.2",
"description": "React-native bindings for Emurgo's cardano-serialization-lib (Cardano haskell Shelley)",
"main": "index.js",
"files": [
Expand Down
3 changes: 1 addition & 2 deletions react-native-haskell-shelley.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@ Pod::Spec.new do |s|
react-native-haskell-shelley
DESC
s.homepage = "https://github.com/Emurgo/react-native-haskell-shelley"
# brief license entry:
s.license = "MIT"
# optional - use expanded license entry instead:
# s.license = { :type => "MIT", :file => "LICENSE" }
s.authors = { "emurgo" => "[email protected]" }
s.platforms = { :ios => "11.0" }
s.platforms = { :ios => "12.4" }
s.source = { :git => "https://github.com/Emurgo/react-native-haskell-shelley.git", :tag => "#{s.version}" }

s.source_files = "ios/**/*.{h,c,m,swift,sh}"
Expand Down
9 changes: 0 additions & 9 deletions react-native.config.js
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file was deleted.