diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 1cb7f8d7bc8..88ec918a7f4 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -4,14 +4,14 @@ PODS: - React - CryptoSwift (1.5.1) - DoubleConversion (1.1.6) - - FBLazyVector (0.63.4) - - FBReactNativeSpec (0.63.4): + - FBLazyVector (0.63.5) + - FBReactNativeSpec (0.63.5): - Folly (= 2020.01.13.00) - - RCTRequired (= 0.63.4) - - RCTTypeSafety (= 0.63.4) - - React-Core (= 0.63.4) - - React-jsi (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) + - RCTRequired (= 0.63.5) + - RCTTypeSafety (= 0.63.5) + - React-Core (= 0.63.5) + - React-jsi (= 0.63.5) + - ReactCommon/turbomodule/core (= 0.63.5) - Folly (2020.01.13.00): - boost-for-react-native - DoubleConversion @@ -40,172 +40,172 @@ PODS: - RNPermissions - Permission-Microphone (2.1.5): - RNPermissions - - RCTRequired (0.63.4) - - RCTTypeSafety (0.63.4): - - FBLazyVector (= 0.63.4) + - RCTRequired (0.63.5) + - RCTTypeSafety (0.63.5): + - FBLazyVector (= 0.63.5) - Folly (= 2020.01.13.00) - - RCTRequired (= 0.63.4) - - React-Core (= 0.63.4) - - React (0.63.4): - - React-Core (= 0.63.4) - - React-Core/DevSupport (= 0.63.4) - - React-Core/RCTWebSocket (= 0.63.4) - - React-RCTActionSheet (= 0.63.4) - - React-RCTAnimation (= 0.63.4) - - React-RCTBlob (= 0.63.4) - - React-RCTImage (= 0.63.4) - - React-RCTLinking (= 0.63.4) - - React-RCTNetwork (= 0.63.4) - - React-RCTSettings (= 0.63.4) - - React-RCTText (= 0.63.4) - - React-RCTVibration (= 0.63.4) - - React-callinvoker (0.63.4) - - React-Core (0.63.4): + - RCTRequired (= 0.63.5) + - React-Core (= 0.63.5) + - React (0.63.5): + - React-Core (= 0.63.5) + - React-Core/DevSupport (= 0.63.5) + - React-Core/RCTWebSocket (= 0.63.5) + - React-RCTActionSheet (= 0.63.5) + - React-RCTAnimation (= 0.63.5) + - React-RCTBlob (= 0.63.5) + - React-RCTImage (= 0.63.5) + - React-RCTLinking (= 0.63.5) + - React-RCTNetwork (= 0.63.5) + - React-RCTSettings (= 0.63.5) + - React-RCTText (= 0.63.5) + - React-RCTVibration (= 0.63.5) + - React-callinvoker (0.63.5) + - React-Core (0.63.5): - Folly (= 2020.01.13.00) - glog - - React-Core/Default (= 0.63.4) - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-Core/Default (= 0.63.5) + - React-cxxreact (= 0.63.5) + - React-jsi (= 0.63.5) + - React-jsiexecutor (= 0.63.5) - Yoga - - React-Core/CoreModulesHeaders (0.63.4): + - React-Core/CoreModulesHeaders (0.63.5): - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.63.5) + - React-jsi (= 0.63.5) + - React-jsiexecutor (= 0.63.5) - Yoga - - React-Core/Default (0.63.4): + - React-Core/Default (0.63.5): - Folly (= 2020.01.13.00) - glog - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.63.5) + - React-jsi (= 0.63.5) + - React-jsiexecutor (= 0.63.5) - Yoga - - React-Core/DevSupport (0.63.4): + - React-Core/DevSupport (0.63.5): - Folly (= 2020.01.13.00) - glog - - React-Core/Default (= 0.63.4) - - React-Core/RCTWebSocket (= 0.63.4) - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) - - React-jsinspector (= 0.63.4) + - React-Core/Default (= 0.63.5) + - React-Core/RCTWebSocket (= 0.63.5) + - React-cxxreact (= 0.63.5) + - React-jsi (= 0.63.5) + - React-jsiexecutor (= 0.63.5) + - React-jsinspector (= 0.63.5) - Yoga - - React-Core/RCTActionSheetHeaders (0.63.4): + - React-Core/RCTActionSheetHeaders (0.63.5): - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.63.5) + - React-jsi (= 0.63.5) + - React-jsiexecutor (= 0.63.5) - Yoga - - React-Core/RCTAnimationHeaders (0.63.4): + - React-Core/RCTAnimationHeaders (0.63.5): - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.63.5) + - React-jsi (= 0.63.5) + - React-jsiexecutor (= 0.63.5) - Yoga - - React-Core/RCTBlobHeaders (0.63.4): + - React-Core/RCTBlobHeaders (0.63.5): - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.63.5) + - React-jsi (= 0.63.5) + - React-jsiexecutor (= 0.63.5) - Yoga - - React-Core/RCTImageHeaders (0.63.4): + - React-Core/RCTImageHeaders (0.63.5): - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.63.5) + - React-jsi (= 0.63.5) + - React-jsiexecutor (= 0.63.5) - Yoga - - React-Core/RCTLinkingHeaders (0.63.4): + - React-Core/RCTLinkingHeaders (0.63.5): - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.63.5) + - React-jsi (= 0.63.5) + - React-jsiexecutor (= 0.63.5) - Yoga - - React-Core/RCTNetworkHeaders (0.63.4): + - React-Core/RCTNetworkHeaders (0.63.5): - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.63.5) + - React-jsi (= 0.63.5) + - React-jsiexecutor (= 0.63.5) - Yoga - - React-Core/RCTSettingsHeaders (0.63.4): + - React-Core/RCTSettingsHeaders (0.63.5): - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.63.5) + - React-jsi (= 0.63.5) + - React-jsiexecutor (= 0.63.5) - Yoga - - React-Core/RCTTextHeaders (0.63.4): + - React-Core/RCTTextHeaders (0.63.5): - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.63.5) + - React-jsi (= 0.63.5) + - React-jsiexecutor (= 0.63.5) - Yoga - - React-Core/RCTVibrationHeaders (0.63.4): + - React-Core/RCTVibrationHeaders (0.63.5): - Folly (= 2020.01.13.00) - glog - React-Core/Default - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-cxxreact (= 0.63.5) + - React-jsi (= 0.63.5) + - React-jsiexecutor (= 0.63.5) - Yoga - - React-Core/RCTWebSocket (0.63.4): + - React-Core/RCTWebSocket (0.63.5): - Folly (= 2020.01.13.00) - glog - - React-Core/Default (= 0.63.4) - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsiexecutor (= 0.63.4) + - React-Core/Default (= 0.63.5) + - React-cxxreact (= 0.63.5) + - React-jsi (= 0.63.5) + - React-jsiexecutor (= 0.63.5) - Yoga - - React-CoreModules (0.63.4): - - FBReactNativeSpec (= 0.63.4) + - React-CoreModules (0.63.5): + - FBReactNativeSpec (= 0.63.5) - Folly (= 2020.01.13.00) - - RCTTypeSafety (= 0.63.4) - - React-Core/CoreModulesHeaders (= 0.63.4) - - React-jsi (= 0.63.4) - - React-RCTImage (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - React-cxxreact (0.63.4): + - RCTTypeSafety (= 0.63.5) + - React-Core/CoreModulesHeaders (= 0.63.5) + - React-jsi (= 0.63.5) + - React-RCTImage (= 0.63.5) + - ReactCommon/turbomodule/core (= 0.63.5) + - React-cxxreact (0.63.5): - boost-for-react-native (= 1.63.0) - DoubleConversion - Folly (= 2020.01.13.00) - glog - - React-callinvoker (= 0.63.4) - - React-jsinspector (= 0.63.4) - - React-jsi (0.63.4): + - React-callinvoker (= 0.63.5) + - React-jsinspector (= 0.63.5) + - React-jsi (0.63.5): - boost-for-react-native (= 1.63.0) - DoubleConversion - Folly (= 2020.01.13.00) - glog - - React-jsi/Default (= 0.63.4) - - React-jsi/Default (0.63.4): + - React-jsi/Default (= 0.63.5) + - React-jsi/Default (0.63.5): - boost-for-react-native (= 1.63.0) - DoubleConversion - Folly (= 2020.01.13.00) - glog - - React-jsiexecutor (0.63.4): + - React-jsiexecutor (0.63.5): - DoubleConversion - Folly (= 2020.01.13.00) - glog - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) - - React-jsinspector (0.63.4) + - React-cxxreact (= 0.63.5) + - React-jsi (= 0.63.5) + - React-jsinspector (0.63.5) - react-native-background-timer (2.2.0): - React - react-native-blob-util (0.13.18): @@ -243,66 +243,66 @@ PODS: - React - react-native-webview (11.16.0): - React-Core - - React-RCTActionSheet (0.63.4): - - React-Core/RCTActionSheetHeaders (= 0.63.4) - - React-RCTAnimation (0.63.4): - - FBReactNativeSpec (= 0.63.4) + - React-RCTActionSheet (0.63.5): + - React-Core/RCTActionSheetHeaders (= 0.63.5) + - React-RCTAnimation (0.63.5): + - FBReactNativeSpec (= 0.63.5) - Folly (= 2020.01.13.00) - - RCTTypeSafety (= 0.63.4) - - React-Core/RCTAnimationHeaders (= 0.63.4) - - React-jsi (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - React-RCTBlob (0.63.4): - - FBReactNativeSpec (= 0.63.4) + - RCTTypeSafety (= 0.63.5) + - React-Core/RCTAnimationHeaders (= 0.63.5) + - React-jsi (= 0.63.5) + - ReactCommon/turbomodule/core (= 0.63.5) + - React-RCTBlob (0.63.5): + - FBReactNativeSpec (= 0.63.5) - Folly (= 2020.01.13.00) - - React-Core/RCTBlobHeaders (= 0.63.4) - - React-Core/RCTWebSocket (= 0.63.4) - - React-jsi (= 0.63.4) - - React-RCTNetwork (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - React-RCTImage (0.63.4): - - FBReactNativeSpec (= 0.63.4) + - React-Core/RCTBlobHeaders (= 0.63.5) + - React-Core/RCTWebSocket (= 0.63.5) + - React-jsi (= 0.63.5) + - React-RCTNetwork (= 0.63.5) + - ReactCommon/turbomodule/core (= 0.63.5) + - React-RCTImage (0.63.5): + - FBReactNativeSpec (= 0.63.5) - Folly (= 2020.01.13.00) - - RCTTypeSafety (= 0.63.4) - - React-Core/RCTImageHeaders (= 0.63.4) - - React-jsi (= 0.63.4) - - React-RCTNetwork (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - React-RCTLinking (0.63.4): - - FBReactNativeSpec (= 0.63.4) - - React-Core/RCTLinkingHeaders (= 0.63.4) - - React-jsi (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - React-RCTNetwork (0.63.4): - - FBReactNativeSpec (= 0.63.4) + - RCTTypeSafety (= 0.63.5) + - React-Core/RCTImageHeaders (= 0.63.5) + - React-jsi (= 0.63.5) + - React-RCTNetwork (= 0.63.5) + - ReactCommon/turbomodule/core (= 0.63.5) + - React-RCTLinking (0.63.5): + - FBReactNativeSpec (= 0.63.5) + - React-Core/RCTLinkingHeaders (= 0.63.5) + - React-jsi (= 0.63.5) + - ReactCommon/turbomodule/core (= 0.63.5) + - React-RCTNetwork (0.63.5): + - FBReactNativeSpec (= 0.63.5) - Folly (= 2020.01.13.00) - - RCTTypeSafety (= 0.63.4) - - React-Core/RCTNetworkHeaders (= 0.63.4) - - React-jsi (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - React-RCTSettings (0.63.4): - - FBReactNativeSpec (= 0.63.4) + - RCTTypeSafety (= 0.63.5) + - React-Core/RCTNetworkHeaders (= 0.63.5) + - React-jsi (= 0.63.5) + - ReactCommon/turbomodule/core (= 0.63.5) + - React-RCTSettings (0.63.5): + - FBReactNativeSpec (= 0.63.5) - Folly (= 2020.01.13.00) - - RCTTypeSafety (= 0.63.4) - - React-Core/RCTSettingsHeaders (= 0.63.4) - - React-jsi (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - React-RCTText (0.63.4): - - React-Core/RCTTextHeaders (= 0.63.4) - - React-RCTVibration (0.63.4): - - FBReactNativeSpec (= 0.63.4) + - RCTTypeSafety (= 0.63.5) + - React-Core/RCTSettingsHeaders (= 0.63.5) + - React-jsi (= 0.63.5) + - ReactCommon/turbomodule/core (= 0.63.5) + - React-RCTText (0.63.5): + - React-Core/RCTTextHeaders (= 0.63.5) + - React-RCTVibration (0.63.5): + - FBReactNativeSpec (= 0.63.5) - Folly (= 2020.01.13.00) - - React-Core/RCTVibrationHeaders (= 0.63.4) - - React-jsi (= 0.63.4) - - ReactCommon/turbomodule/core (= 0.63.4) - - ReactCommon/turbomodule/core (0.63.4): + - React-Core/RCTVibrationHeaders (= 0.63.5) + - React-jsi (= 0.63.5) + - ReactCommon/turbomodule/core (= 0.63.5) + - ReactCommon/turbomodule/core (0.63.5): - DoubleConversion - Folly (= 2020.01.13.00) - glog - - React-callinvoker (= 0.63.4) - - React-Core (= 0.63.4) - - React-cxxreact (= 0.63.4) - - React-jsi (= 0.63.4) + - React-callinvoker (= 0.63.5) + - React-Core (= 0.63.5) + - React-cxxreact (= 0.63.5) + - React-jsi (= 0.63.5) - ReactNativeAudioToolkit (2.0.3): - React - ReactNativeNavigation (7.27.1): @@ -637,8 +637,8 @@ SPEC CHECKSUMS: BVLinearGradient: e3aad03778a456d77928f594a649e96995f1c872 CryptoSwift: c4f2debceb38bf44c80659afe009f71e23e4a082 DoubleConversion: cde416483dac037923206447da6e1454df403714 - FBLazyVector: 3bb422f41b18121b71783a905c10e58606f7dc3e - FBReactNativeSpec: f2c97f2529dd79c083355182cc158c9f98f4bd6e + FBLazyVector: 352a8ca9bbc8e2f097d680747a8c97ecef12d469 + FBReactNativeSpec: 7dfb84f624136a45727c813ed21d130cd3e61beb Folly: b73c3869541e86821df3c387eb0af5f65addfab4 glog: 997518ea2aa2d8cd5df9797b641b758d52ecf2bc HMSegmentedControl: 34c1f54d822d8308e7b24f5d901ec674dfa31352 @@ -646,16 +646,16 @@ SPEC CHECKSUMS: libwebp: 60305b2e989864154bd9be3d772730f08fc6a59c Permission-Camera: afad27bf90337684d4a86f3825112d648c8c4d3b Permission-Microphone: 0ffabc3fe1c75cfb260525ee3f529383c9f4368c - RCTRequired: 082f10cd3f905d6c124597fd1c14f6f2655ff65e - RCTTypeSafety: 8c9c544ecbf20337d069e4ae7fd9a377aadf504b - React: b0a957a2c44da4113b0c4c9853d8387f8e64e615 - React-callinvoker: c3f44dd3cb195b6aa46621fff95ded79d59043fe - React-Core: d3b2a1ac9a2c13c3bcde712d9281fc1c8a5b315b - React-CoreModules: 0581ff36cb797da0943d424f69e7098e43e9be60 - React-cxxreact: c1480d4fda5720086c90df537ee7d285d4c57ac3 - React-jsi: a0418934cf48f25b485631deb27c64dc40fb4c31 - React-jsiexecutor: 93bd528844ad21dc07aab1c67cb10abae6df6949 - React-jsinspector: 58aef7155bc9a9683f5b60b35eccea8722a4f53a + RCTRequired: 5520387431beaa5f32aa8726bf746cd5353119fe + RCTTypeSafety: bc90d6e287fa427c50ed770922bac30faf0bbfa3 + React: 83a7f231f462b09260a53c5c51005e7659c66890 + React-callinvoker: 1c3fdb5562c792212e149637b8a167516bb4b58e + React-Core: 8baca8644a516e772c77e3923697cfe2b58c1606 + React-CoreModules: 200c931e17b332024c2e9d878f67b87c00c2c83b + React-cxxreact: 9096ebaeebf6a1475a14448fa8bfc380c13d7882 + React-jsi: 7d908b17758178b076a05a254523f1a4227b53d2 + React-jsiexecutor: e06a32e42affb2bd89e4c8369349b5fcf787710c + React-jsinspector: fdbc08866b34ae8e1b788ea1cbd9f9d1ca2aa3d6 react-native-background-timer: 1f7d560647b40e6a60b01c452ba29c54bf581fc4 react-native-blob-util: 600972b1782380a5a7d5db61a3817ea32349dae9 react-native-blur: 4568dd93d1d82748c180df8beb2d929c97b13b47 @@ -673,16 +673,16 @@ SPEC CHECKSUMS: react-native-status: 21f75d492fd311dc111303da38a7a2b23a8a8466 react-native-status-keycard: f60ca57d789aad6875c64ece81ab06ef0609e0d3 react-native-webview: 28a8636d97ee641f2ee8f20492d7a6c269c1d703 - React-RCTActionSheet: 89a0ca9f4a06c1f93c26067af074ccdce0f40336 - React-RCTAnimation: 1bde3ecc0c104c55df246eda516e0deb03c4e49b - React-RCTBlob: a97d378b527740cc667e03ebfa183a75231ab0f0 - React-RCTImage: c1b1f2d3f43a4a528c8946d6092384b5c880d2f0 - React-RCTLinking: 35ae4ab9dc0410d1fcbdce4d7623194a27214fb2 - React-RCTNetwork: 29ec2696f8d8cfff7331fac83d3e893c95ef43ae - React-RCTSettings: 60f0691bba2074ef394f95d4c2265ec284e0a46a - React-RCTText: 5c51df3f08cb9dedc6e790161195d12bac06101c - React-RCTVibration: ae4f914cfe8de7d4de95ae1ea6cc8f6315d73d9d - ReactCommon: 73d79c7039f473b76db6ff7c6b159c478acbbb3b + React-RCTActionSheet: e911b99f0d6fa7711ffc2f62d236b12a32771835 + React-RCTAnimation: ad8b853170a059faf31d6add34f67d22391bbe01 + React-RCTBlob: 134c7270b6672c9c05383b2e0f7f044ba39d7dda + React-RCTImage: c5c74ba8850a193d73aef8efb8fcbb4f9cad7653 + React-RCTLinking: 12468e952704555c8cb4e3de94c7b5a266811326 + React-RCTNetwork: e9cfaeb9f3657ae91f895e798734141db6e1af5b + React-RCTSettings: 9a09419bd5e8494f6e146e2c9f5c8e2c6e90ed58 + React-RCTText: 393f059d7ec02c733da57240694201e734f0dc84 + React-RCTVibration: 3e83f53610d63d3c1fc4db303305e934e73047cc + ReactCommon: b9ff54b6dd22ba4a776eda22d7f83ec27544ca35 ReactNativeAudioToolkit: de9610f323e855ac6574be8c99621f3d57c5df06 ReactNativeNavigation: 94979dd1572a3f093fc85d4599360530a1bed8c8 RNCAsyncStorage: b2489b49e38c85e10ed45a888d13a2a4c7b32ea1 @@ -708,7 +708,7 @@ SPEC CHECKSUMS: SSZipArchive: fe6a26b2a54d5a0890f2567b5cc6de5caa600aef TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863 TouchID: ba4c656d849cceabc2e4eef722dea5e55959ecf4 - Yoga: 4bd86afe9883422a7c4028c00e34790f560923d6 + Yoga: 0276e9f20976c8568e107cfc1163a8629051adc0 PODFILE CHECKSUM: a1de9468266e7f0b5273acea713782ab759690f1 diff --git a/nix/config.nix b/nix/config.nix index 0790641a225..9565913467a 100644 --- a/nix/config.nix +++ b/nix/config.nix @@ -14,6 +14,7 @@ status-go = { src-override = null; + gomobile-src-override = null; ipfs-gateway-url = "https://ipfs.status.im/"; }; }; diff --git a/nix/overlay.nix b/nix/overlay.nix index 8175841d128..f33b8bc62ae 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -9,17 +9,47 @@ self: super: let inherit (super) stdenv stdenvNoCC callPackage; + lib = (super.lib or { }) // (import ./lib { + inherit (super) lib; + inherit (self) config; + }); + + gomobileSrcOverride = "/Users/vvlasov/c/mobile"; + # Warning message about using local sources + localSrcWarn = (path: "Using local gomobile sources from ${path}"); + localGomobileSrc = rec { + owner = "status-im"; + repo = "mobile"; + rev = "unknown"; + shortRev = rev; + rawVersion = "develop"; + cleanVersion = rawVersion; + goPackagePath = "github.com/${owner}/${repo}"; + # We use builtins.path so that we can name the resulting derivation, + # Normally the name would not be deterministic, taken from the checkout directory. + src = builtins.path rec { + path = lib.traceValFn localSrcWarn gomobileSrcOverride; + name = "${repo}-source-${shortRev}"; + # Keep this filter as restrictive as possible in order + # to avoid unnecessary rebuilds and limit closure size + filter = lib.mkFilter { + root = path; + include = [ ".*" ]; + exclude = [ + ".*/[.]git.*" ".*[.]md" ".*[.]yml" ".*/.*_test.go$" + "VERSION" "_assets/.*" "build/.*" + ".*/.*LICENSE.*" ".*/CONTRIB.*" ".*/AUTHOR.*" + ]; + }; + }; + }; in { + inherit lib; # Fix for MacOS mkShell = super.mkShell.override { stdenv = stdenvNoCC; }; # Various utilities utils = callPackage ./tools/utils.nix { }; - lib = (super.lib or { }) // (import ./lib { - inherit (super) lib; - inherit (self) config; - }); - # Project dependencies deps = { clojure = callPackage ./deps/clojure { }; @@ -45,11 +75,17 @@ in { buildGoPackage = super.buildGo118Package; buildGoModule = super.buildGo118Module; gomobile = (super.gomobile.overrideAttrs (old: { - patches = self.fetchurl { # https://github.com/golang/mobile/pull/84 - url = "https://github.com/golang/mobile/commit/f20e966e05b8f7e06bed500fa0da81cf6ebca307.patch"; - sha256 = "sha256-TZ/Yhe8gMRQUZFAs9G5/cf2b9QGtTHRSObBFD5Pbh7Y="; - }; - })).override { + src = "/Users/vvlasov/c/mobile"; + vendorSha256 = "sha256-TZ/Yhe8gMRQUZFAs9G5/cf2b9QGtTHRSObBFD5Pbh7Y="; + # patches = self.fetchurl { # https://github.com/golang/mobile/pull/84 + # url = "https://github.com/golang/mobile/commit/f20e966e05b8f7e06bed500fa0da81cf6ebca307.patch"; + # sha256 = "sha256-TZ/Yhe8gMRQUZFAs9G5/cf2b9QGtTHRSObBFD5Pbh7Y="; + # }; + })).override rec { + buildGoModule = args: super.buildGoModule ( args // { + src = "/Users/vvlasov/c/mobile"; + vendorSha256 = "sha256-C6GD3NMolRIve1siG8wpcQav7ZWTugjce8K22EQDD7M="; + }); # FIXME: No Android SDK packages for aarch64-darwin. withAndroidPkgs = stdenv.system != "aarch64-darwin"; androidPkgs = self.androidEnvCustom.compose; diff --git a/nix/scripts/shell.sh b/nix/scripts/shell.sh index 4c61a21ef65..de57d66ec6e 100755 --- a/nix/scripts/shell.sh +++ b/nix/scripts/shell.sh @@ -46,6 +46,9 @@ config='' if [[ -n "${STATUS_GO_SRC_OVERRIDE}" ]]; then config+="status-im.status-go.src-override=\"${STATUS_GO_SRC_OVERRIDE}\";" fi +if [[ -n "${GOMOBILE_SRC_OVERRIDE}" ]]; then + config+="status-im.status-go.gomobile-src-override=\"${GOMOBILE_SRC_OVERRIDE}\";" +fi config+="status-im.build-type=\"${BUILD_TYPE}\";" if [[ -n "$config" ]]; then diff --git a/nix/status-go/default.nix b/nix/status-go/default.nix index 4de9a647866..27aa3b9cabc 100644 --- a/nix/status-go/default.nix +++ b/nix/status-go/default.nix @@ -12,6 +12,7 @@ let # Source can be changed with a local override from config source = callPackage ./source.nix { }; + nimbusSource = callPackage ./nimbus_source.nix { }; # Params to be set at build time, important for About section and metrics goBuildParams = { @@ -31,14 +32,55 @@ let "-w" # -w disables DWARF debugging information ]; in rec { + inherit nimbusSource; + mobile = callPackage ./mobile { - inherit meta source goBuildLdFlags; + inherit meta source nimbusSource nimCompiler goBuildLdFlags; }; library = callPackage ./library { inherit meta source; }; + nimCompiler = callPackage ./mobile/buildNim.nix { + srcRaw = nimbusSource; + }; + + liblcproxy-android-arm = callPackage ./mobile/buildNimbus.nix { + srcRaw = nimbusSource; + nimCompiler = nimCompiler; + platform = "android"; + arch = "arm"; + }; + + liblcproxy-android-arm64 = callPackage ./mobile/buildNimbus.nix { + srcRaw = nimbusSource; + nimCompiler = nimCompiler; + platform = "android"; + arch = "arm64"; + }; + + liblcproxy-android-x86 = callPackage ./mobile/buildNimbus.nix { + srcRaw = nimbusSource; + nimCompiler = nimCompiler; + platform = "android"; + arch = "x86"; + }; + + liblcproxy-ios-x86 = callPackage ./mobile/buildNimbus.nix { + srcRaw = nimbusSource; + nimCompiler = nimCompiler; + platform = "ios"; + arch = "x86"; + }; + + liblcproxy-ios-arm64 = callPackage ./mobile/buildNimbus.nix { + srcRaw = nimbusSource; + nimCompiler = nimCompiler; + platform = "ios"; + arch = "arm64"; + }; + shell = mkShell { inputsFrom = [ mobile.android mobile.ios ]; }; diff --git a/nix/status-go/mobile/build.nix b/nix/status-go/mobile/build.nix index ffd1d644708..efabc8049eb 100644 --- a/nix/status-go/mobile/build.nix +++ b/nix/status-go/mobile/build.nix @@ -2,6 +2,7 @@ , androidPkgs, openjdk, gomobile, xcodeWrapper, removeReferencesTo , meta , source +, buildNimbusLc , platform ? "android" , platformVersion ? "23" , targets ? [ "android/arm64" "android/arm" ] @@ -13,7 +14,14 @@ let inherit (lib) concatStringsSep optionalString optional; isIOS = platform == "ios"; isAndroid = platform == "android"; + lc = buildNimbusLc {inherit platform targets;}; + cgoCflags = "-I" + (builtins.elemAt lc 0); + lcDirs = (builtins.concatStringsSep " " (builtins.map (s: "-L" + s) lc)); + + goBuildLdFlagsModified = + goBuildLdFlags ++ [("-extldflags \"-lverifproxy " + lcDirs + "\"")]; + ldflags = concatStringsSep " " goBuildLdFlagsModified; in buildGoPackage { pname = source.repo; version = "${source.cleanVersion}-${source.shortRev}-${platform}"; @@ -30,8 +38,6 @@ in buildGoPackage { ++ optional isAndroid openjdk ++ optional isIOS xcodeWrapper; - ldflags = concatStringsSep " " goBuildLdFlags; - ANDROID_HOME = optionalString isAndroid androidPkgs.sdk; # Ensure XCode is present for iOS, instead of failing at the end of the build. @@ -40,11 +46,13 @@ in buildGoPackage { buildPhase = '' runHook preBuild echo -e "\nBuilding $pname for: ${concatStringsSep "," targets}" - + echo -e "\n LC dirs: ${lcDirs}" + echo -e "\n ldflags: ${ldflags}" set -x + export CGO_CFLAGS=\"${cgoCflags}\" gomobile bind \ ${concatStringsSep " " goBuildFlags} \ - -ldflags="$ldflags" \ + -ldflags ''\'${ldflags}''\' \ -target=${concatStringsSep "," targets} \ ${optionalString isAndroid "-androidapi=${platformVersion}" } \ ${optionalString isIOS "-iosversion=${platformVersion}" } \ diff --git a/nix/status-go/mobile/buildNim.nix b/nix/status-go/mobile/buildNim.nix new file mode 100644 index 00000000000..907822cf7a4 --- /dev/null +++ b/nix/status-go/mobile/buildNim.nix @@ -0,0 +1,67 @@ +{ pkgs, stdenv, lib, fetchFromGitHub +# Dependencies +, xcodeWrapper +, srcRaw +, writeScript +, writeTextFile +, androidPkgs +, git +, platform ? "android" +, arch ? "386" +, api ? "29" }: + +let + osId = builtins.elemAt (builtins.split "\-" stdenv.hostPlatform.system) 2; + osArch = builtins.elemAt (builtins.split "\-" stdenv.hostPlatform.system) 0; + + nimHostOs = if osId == "darwin" then "Darwin" + else if osId == "linux" then "Linux" + else "Windows_NT"; + + createNimbleLink = writeTextFile { + name = "createNimbleLink.sh"; + text = '' + mkdir -p vendor/.nimble/pkgs + + curdir=`pwd` + for dir in vendor/*/; + do + baseDirName=`basename ''${dir}` + dirName=vendor/.nimble/pkgs/$baseDirName-\#head + echo $dirName + mkdir -p $dirName + + packageDir="''${curdir}/vendor/''${baseDirName}" + if [ -d "''${packageDir}/src" ]; then + packageDir="''${packageDir}/src" + fi + echo "''${packageDir}" > ''${dirName}/''${baseDirName}.nimble-link + echo "''${packageDir}" >> ''${dirName}/''${baseDirName}.nimble-link + done + ''; + executable = true; + }; + +in stdenv.mkDerivation rec { + pname = "nimCompiler"; + name = "nimCompiler"; + src = srcRaw.src; + #version = lib.strings.substring 0 7 src.rev; + buildInputs = with pkgs; [ wget git clang which tcl curl]; + + phases = [ "unpackPhase" "buildPhase" "installPhase" ]; + + + buildPhase = '' + ${createNimbleLink} + export HOME=$PWD + unset SSL_CERT_FILE + make V=3 CC=clang build-nim + ''; + + installPhase = '' + mkdir -p $out + cp -r vendor/nimbus-build-system/vendor/Nim/* $out/ + ''; +} + diff --git a/nix/status-go/mobile/buildNimbus.nix b/nix/status-go/mobile/buildNimbus.nix new file mode 100644 index 00000000000..b9cfe15492c --- /dev/null +++ b/nix/status-go/mobile/buildNimbus.nix @@ -0,0 +1,231 @@ +{ pkgs, stdenv, lib, fetchFromGitHub +# Dependencies +, xcodeWrapper +, srcRaw +, writeScript +, writeTextFile +, androidPkgs +, git +, nimCompiler +, platform ? "android" +, arch ? "386" +, api ? "29" }: + +let + osId = builtins.elemAt (builtins.split "\-" stdenv.hostPlatform.system) 2; + osArch = builtins.elemAt (builtins.split "\-" stdenv.hostPlatform.system) 0; + + + # Arg arch -> Nim arch + nimCpuMap = { + "x86" = "i386"; + "x86-64" = "amd64"; + "arm" = "arm"; + "arm64" = "arm64"; + }; + + iosArchMap = { + "x86" = "x86_64"; + "x86-64" = "x86_64"; + "arm" = "armv7"; + "arm64" = "arm64"; + }; + + nimCpu = if platform == "ios" && arch == "x86" + then "amd64" else "${lib.getAttr arch nimCpuMap}"; + nimPlatform = "${(if platform == "ios" then "ios" else "android")}"; + + iosSdk = if arch == "x86" then "iphonesimulator" else "iphoneos"; + iosArch = lib.getAttr arch iosArchMap; + + isAndroid = lib.hasPrefix "android" platform; + isIOS = platform == "ios"; + + + buildType = lib.getConfig "build-type" ""; + + + routeHeader = builtins.readFile ./route.h; + + PROJECT_ROOT = srcRaw.src; + + iosIncludes = stdenv.mkDerivation { + name = "nim-status-ios-includes"; + buildInputs = [ pkgs.coreutils ]; + builder = writeScript "nim-ios-includes.sh" + '' + export PATH=${pkgs.coreutils}/bin + mkdir $out + cd $out + mkdir net + echo "${routeHeader}" > net/route.h + ''; + }; + + + ANDROID_NDK_HOME = "${androidPkgs.sdk}/ndk-bundle"; + + + androidToolchain = "${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/${osId}-${osArch}"; + androidTargetArchMap = { + "x86" = "i686-linux-android"; + "x86-64" = "x86_64-linux-android"; + "arm" = "armv7a-linux-androideabi"; + "arm64" = "aarch64-linux-android"; + }; + + androidTargetArch = lib.getAttr arch androidTargetArchMap; + + iosVersion = "9.0"; + + sysroot = if isAndroid then "${androidToolchain}/sysroot" else "$(xcrun --sdk ${iosSdk} --show-sdk-path)"; + compilerFlags = if isAndroid then + "--sysroot ${sysroot} -fPIC -target ${androidTargetArch}${api}" + else if isIOS then + # TODO The conditional for -miphoneos-version-min=8.0 is required, + # otherwise Nim will complain that thread-local storage is not supported for the current target + # when expanding 'NIM_THREADVAR' macro + "-isysroot ${sysroot} -fembed-bitcode -target ${iosArch}-apple-ios${iosVersion} ${if arch == "arm" then "" else "-miphoneos-version-min=${iosVersion}"} -I${iosIncludes}" + else throw "Unsupported platform!"; + + linkerFlags = if isAndroid then + "--sysroot ${sysroot} -target ${androidTargetArch}${api}" + else if isIOS then + "--sysroot ${sysroot} -fembed-bitcode -target ${iosArch}-apple-ios${iosVersion} ${if arch == "arm" then "" else "-miphoneos-version-min=${iosVersion}"} -v" + else throw "Unsupported platform!"; + + ldDirMap = { + "x86" = "i686"; + "x86-64" = "x86_64"; + "arm" = "armeabi-v7a"; + "arm64" = "arm64-v8a"; + }; + + cmakeArgs = if isAndroid then + "-DCMAKE_SYSTEM_NAME=Android -DCMAKE_SYSTEM_VERSION=${api} -DCMAKE_ANDROID_ARCH_ABI=${lib.getAttr arch ldDirMap} -DCMAKE_ANDROID_NDK=${ANDROID_NDK_HOME}" + else if isIOS then "-DCMAKE_SYSTEM_NAME=iOS -DCMAKE_OSX_SYSROOT=\"$(CMAKE_SYSROOT)\" -DCMAKE_OSX_ARCHITECTURES=${iosArch} -DCMAKE_OSX_DEPLOYMENT_TARGET=9.3 -DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO -DCMAKE_IOS_INSTALL_COMBINED=YES" + else throw "Unsupported platform!"; + #clangPath = if isAndroid then "${androidToolchain}/bin" else ""; + #clangName = if isAndroid then "${androidTargetArch}${api}-clang" else ""; + + compilerVars = if isAndroid then + '' + export PATH=${androidToolchain}/bin:$PATH + export CC=clang + export CXX=clang++ + export AR=${androidToolchain}/bin/llvm-ar + export NM=${androidToolchain}/bin/llvm-nm + export RANLIB=${androidToolchain}/bin/llvm-ranlib + export LD=${androidToolchain}/bin/ld + export AS=$CC + export CFLAGS="${compilerFlags}" + export LDFLAGS="${linkerFlags}" + + mkdir bin + touch bin/git + chmod +x bin/git + export PATH=./bin:$PATH + '' + else if isIOS then + '' + export PATH=${xcodeWrapper}/bin:$PATH + export CC=clang #$(xcrun --sdk ${iosSdk} --find clang) + export CXX=clang++ #$(xcrun --sdk ${iosSdk} --find clang++) + export LD=clang + export CFLAGS="${compilerFlags}" + export LDFLAGS="${linkerFlags}" + + mkdir bin + touch bin/git + chmod +x bin/git + export PATH=./bin:$PATH + + export CMAKE_SYSROOT=${sysroot} + '' + else throw "Unsupported platform!"; + + src = srcRaw; + + + nimHostOs = if osId == "darwin" then "Darwin" + else if osId == "linux" then "Linux" + else "Windows_NT"; + createNimbleLink = writeTextFile { + name = "createNimbleLink.sh"; + text = '' + mkdir -p vendor/.nimble/pkgs + + curdir=`pwd` + for dir in vendor/*/; + do + baseDirName=`basename ''${dir}` + dirName=vendor/.nimble/pkgs/$baseDirName-\#head + echo $dirName + mkdir -p $dirName + + packageDir="''${curdir}/vendor/''${baseDirName}" + if [ -d "''${packageDir}/src" ]; then + packageDir="''${packageDir}/src" + fi + echo "''${packageDir}" > ''${dirName}/''${baseDirName}.nimble-link + echo "''${packageDir}" >> ''${dirName}/''${baseDirName}.nimble-link + done + ''; + executable = true; + }; + +in stdenv.mkDerivation rec { + pname = "libverifproxy"; + name = "libverifproxy"; + src = srcRaw.src; + #version = lib.strings.substring 0 7 src.rev; + buildInputs = with pkgs; [ wget git which tcl cmake libtool binutils]; + + phases = [ "unpackPhase" "preBuildPhase" "buildPhase" "installPhase" ]; + + preBuildPhase = '' + + sed -E -i 's|^(LIBBACKTRACE_SED := true.*)|\1\nCMAKE_ARGS := ${cmakeArgs}|g' vendor/nim-libbacktrace/Makefile + + sed -E -i 's|^(.*)(useNews\* = )(.*)|\1\2 false|g' vendor/nim-json-rpc/json_rpc/clients/config.nim + sed -E -i 's|(.*XOPEN_SOURCE.*)|#\1|g' vendor/nim-nat-traversal/vendor/miniupnp/miniupnpc/Makefile + + export HOME=$PWD + + ${createNimbleLink} + + ${compilerVars} + export PATH=${nimCompiler}/bin:$PATH + #export PATH=${pkgs.binutils}/bin:$PATH + ln -sf ${pkgs.binutils}/bin/ar bin/ar + ''; + + + buildPhase = '' + which ar + make V=3 OS=${nimHostOs} \ + CC=clang CXX=clang USE_SYSTEM_NIM=1 \ + NIMFLAGS="\ + --passC:\"${compilerFlags}\" \ + --passL:\"${linkerFlags}\" \ + --debuginfo:off \ + --cc:clang \ + --listcmd \ + --cpu:${nimCpu} \ + --os:${nimPlatform} \ + -d:disableMarchNative" \ + libverifproxy + + echo "### ls build/libverifproxy" + ls -l build/libverifproxy/* + ''; + + installPhase = '' + set -x + mkdir -p $out + cp libverifproxy* $out/ + cp build/libverifproxy/verifproxy.h $out/ + cp build/libverifproxy/nimbase.h $out/ + ''; +} + diff --git a/nix/status-go/mobile/default.nix b/nix/status-go/mobile/default.nix index 8252d27252f..7ce19fbc3dd 100644 --- a/nix/status-go/mobile/default.nix +++ b/nix/status-go/mobile/default.nix @@ -1,19 +1,44 @@ -{ callPackage, meta, source, goBuildLdFlags }: +{ stdenv, callPackage, meta, source, nimbusSource, nimCompiler, goBuildLdFlags }: + +let + buildNimbusLc = { platform, targets }: builtins.map + (target: + let + arch = + if platform == "ios" then + (if target == "iossimulator" && stdenv.hostPlatform.isx86 + then "x86" else "arm64") + else builtins.elemAt (builtins.split "\/" target) 2 ; + in + callPackage ./buildNimbus.nix { + inherit nimCompiler platform arch; + srcRaw = nimbusSource; + } + ) + targets; +in { + + #ios-x86 = buildNimbusLc {platform = "ios"; targets = ["ios" "iossimulator"];}; + ios-x86 = buildNimbusLc {platform = "ios"; targets = ["iossimulator"];}; + ios-arm = buildNimbusLc {platform = "ios"; targets = ["ios"];}; + android-arm64 = buildNimbusLc {platform = "android"; targets = ["android/arm64"];}; + android-arm = buildNimbusLc {platform = "android"; targets = ["android/arm"];}; + -{ android = callPackage ./build.nix { platform = "android"; platformVersion = "23"; - targets = [ "android/arm" "android/arm64" "android/386" ]; + #targets = [ "android/arm" "android/arm64" "android/386" ]; + targets = [ "android/arm64" ]; outputFileName = "status-go-${source.shortRev}.aar"; - inherit meta source goBuildLdFlags; + inherit meta source buildNimbusLc goBuildLdFlags; }; ios = callPackage ./build.nix { platform = "ios"; platformVersion = "8.0"; - targets = [ "ios" "iossimulator" ]; + targets = [ "iossimulator" ]; outputFileName = "Statusgo.xcframework"; - inherit meta source goBuildLdFlags; + inherit meta source buildNimbusLc goBuildLdFlags; }; } diff --git a/nix/status-go/mobile/route.h b/nix/status-go/mobile/route.h new file mode 100644 index 00000000000..b01c0bda84d --- /dev/null +++ b/nix/status-go/mobile/route.h @@ -0,0 +1,259 @@ +/* + * Copyright (c) 2000-2017 Apple Inc. All rights reserved. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_START@ + * + * This file contains Original Code and/or Modifications of Original Code + * as defined in and that are subject to the Apple Public Source License + * Version 2.0 (the 'License'). You may not use this file except in + * compliance with the License. The rights granted to you under the License + * may not be used to create, or enable the creation or redistribution of, + * unlawful or unlicensed copies of an Apple operating system, or to + * circumvent, violate, or enable the circumvention or violation of, any + * terms of an Apple operating system software license agreement. + * + * Please obtain a copy of the License at + * http://www.opensource.apple.com/apsl/ and read it before using this file. + * + * The Original Code and all software distributed under the License are + * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, + * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. + * Please see the License for the specific language governing rights and + * limitations under the License. + * + * @APPLE_OSREFERENCE_LICENSE_HEADER_END@ + */ +/* + * Copyright (c) 1980, 1986, 1993 + * The Regents of the University of California. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * 3. All advertising materials mentioning features or use of this software + * must display the following acknowledgement: + * This product includes software developed by the University of + * California, Berkeley and its contributors. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * @(#)route.h 8.3 (Berkeley) 4/19/94 + * $FreeBSD: src/sys/net/route.h,v 1.36.2.1 2000/08/16 06:14:23 jayanth Exp $ + */ + +#ifndef _NET_ROUTE_H_ +#define _NET_ROUTE_H_ +#include +#include +#include +#include + +/* + * These numbers are used by reliable protocols for determining + * retransmission behavior and are included in the routing structure. + */ +struct rt_metrics { + u_int32_t rmx_locks; /* Kernel leaves these values alone */ + u_int32_t rmx_mtu; /* MTU for this path */ + u_int32_t rmx_hopcount; /* max hops expected */ + int32_t rmx_expire; /* lifetime for route, e.g. redirect */ + u_int32_t rmx_recvpipe; /* inbound delay-bandwidth product */ + u_int32_t rmx_sendpipe; /* outbound delay-bandwidth product */ + u_int32_t rmx_ssthresh; /* outbound gateway buffer limit */ + u_int32_t rmx_rtt; /* estimated round trip time */ + u_int32_t rmx_rttvar; /* estimated rtt variance */ + u_int32_t rmx_pksent; /* packets sent using this route */ + u_int32_t rmx_state; /* route state */ + u_int32_t rmx_filler[3]; /* will be used for T/TCP later */ +}; + +/* + * rmx_rtt and rmx_rttvar are stored as microseconds; + */ +#define RTM_RTTUNIT 1000000 /* units for rtt, rttvar, as units per sec */ + + + +#define RTF_UP 0x1 /* route usable */ +#define RTF_GATEWAY 0x2 /* destination is a gateway */ +#define RTF_HOST 0x4 /* host entry (net otherwise) */ +#define RTF_REJECT 0x8 /* host or net unreachable */ +#define RTF_DYNAMIC 0x10 /* created dynamically (by redirect) */ +#define RTF_MODIFIED 0x20 /* modified dynamically (by redirect) */ +#define RTF_DONE 0x40 /* message confirmed */ +#define RTF_DELCLONE 0x80 /* delete cloned route */ +#define RTF_CLONING 0x100 /* generate new routes on use */ +#define RTF_XRESOLVE 0x200 /* external daemon resolves name */ +#define RTF_LLINFO 0x400 /* DEPRECATED - exists ONLY for backward + * compatibility */ +#define RTF_LLDATA 0x400 /* used by apps to add/del L2 entries */ +#define RTF_STATIC 0x800 /* manually added */ +#define RTF_BLACKHOLE 0x1000 /* just discard pkts (during updates) */ +#define RTF_NOIFREF 0x2000 /* not eligible for RTF_IFREF */ +#define RTF_PROTO2 0x4000 /* protocol specific routing flag */ +#define RTF_PROTO1 0x8000 /* protocol specific routing flag */ + +#define RTF_PRCLONING 0x10000 /* protocol requires cloning */ +#define RTF_WASCLONED 0x20000 /* route generated through cloning */ +#define RTF_PROTO3 0x40000 /* protocol specific routing flag */ + /* 0x80000 unused */ +#define RTF_PINNED 0x100000 /* future use */ +#define RTF_LOCAL 0x200000 /* route represents a local address */ +#define RTF_BROADCAST 0x400000 /* route represents a bcast address */ +#define RTF_MULTICAST 0x800000 /* route represents a mcast address */ +#define RTF_IFSCOPE 0x1000000 /* has valid interface scope */ +#define RTF_CONDEMNED 0x2000000 /* defunct; no longer modifiable */ +#define RTF_IFREF 0x4000000 /* route holds a ref to interface */ +#define RTF_PROXY 0x8000000 /* proxying, no interface scope */ +#define RTF_ROUTER 0x10000000 /* host is a router */ +#define RTF_DEAD 0x20000000 /* Route entry is being freed */ + /* 0x40000000 and up unassigned */ + +#define RTPRF_OURS RTF_PROTO3 /* set on routes we manage */ +#define RTF_BITS \ + "\020\1UP\2GATEWAY\3HOST\4REJECT\5DYNAMIC\6MODIFIED\7DONE" \ + "\10DELCLONE\11CLONING\12XRESOLVE\13LLINFO\14STATIC\15BLACKHOLE" \ + "\16NOIFREF\17PROTO2\20PROTO1\21PRCLONING\22WASCLONED\23PROTO3" \ + "\25PINNED\26LOCAL\27BROADCAST\30MULTICAST\31IFSCOPE\32CONDEMNED" \ + "\33IFREF\34PROXY\35ROUTER" + +#define IS_DIRECT_HOSTROUTE(rt) \ + (((rt)->rt_flags & (RTF_HOST | RTF_GATEWAY)) == RTF_HOST) +/* + * Routing statistics. + */ +struct rtstat { + short rts_badredirect; /* bogus redirect calls */ + short rts_dynamic; /* routes created by redirects */ + short rts_newgateway; /* routes modified by redirects */ + short rts_unreach; /* lookups which failed */ + short rts_wildcard; /* lookups satisfied by a wildcard */ + short rts_badrtgwroute; /* route to gateway is not direct */ +}; + +/* + * Structures for routing messages. + */ +struct rt_msghdr { + u_short rtm_msglen; /* to skip over non-understood messages */ + u_char rtm_version; /* future binary compatibility */ + u_char rtm_type; /* message type */ + u_short rtm_index; /* index for associated ifp */ + int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ + int rtm_addrs; /* bitmask identifying sockaddrs in msg */ + pid_t rtm_pid; /* identify sender */ + int rtm_seq; /* for sender to identify action */ + int rtm_errno; /* why failed */ + int rtm_use; /* from rtentry */ + u_int32_t rtm_inits; /* which metrics we are initializing */ + struct rt_metrics rtm_rmx; /* metrics themselves */ +}; + +struct rt_msghdr2 { + u_short rtm_msglen; /* to skip over non-understood messages */ + u_char rtm_version; /* future binary compatibility */ + u_char rtm_type; /* message type */ + u_short rtm_index; /* index for associated ifp */ + int rtm_flags; /* flags, incl. kern & message, e.g. DONE */ + int rtm_addrs; /* bitmask identifying sockaddrs in msg */ + int32_t rtm_refcnt; /* reference count */ + int rtm_parentflags; /* flags of the parent route */ + int rtm_reserved; /* reserved field set to 0 */ + int rtm_use; /* from rtentry */ + u_int32_t rtm_inits; /* which metrics we are initializing */ + struct rt_metrics rtm_rmx; /* metrics themselves */ +}; + + +#define RTM_VERSION 5 /* Up the ante and ignore older versions */ + +/* + * Message types. + */ +#define RTM_ADD 0x1 /* Add Route */ +#define RTM_DELETE 0x2 /* Delete Route */ +#define RTM_CHANGE 0x3 /* Change Metrics or flags */ +#define RTM_GET 0x4 /* Report Metrics */ +#define RTM_LOSING 0x5 /* RTM_LOSING is no longer generated by xnu + * and is deprecated */ +#define RTM_REDIRECT 0x6 /* Told to use different route */ +#define RTM_MISS 0x7 /* Lookup failed on this address */ +#define RTM_LOCK 0x8 /* fix specified metrics */ +#define RTM_OLDADD 0x9 /* caused by SIOCADDRT */ +#define RTM_OLDDEL 0xa /* caused by SIOCDELRT */ +#define RTM_RESOLVE 0xb /* req to resolve dst to LL addr */ +#define RTM_NEWADDR 0xc /* address being added to iface */ +#define RTM_DELADDR 0xd /* address being removed from iface */ +#define RTM_IFINFO 0xe /* iface going up/down etc. */ +#define RTM_NEWMADDR 0xf /* mcast group membership being added to if */ +#define RTM_DELMADDR 0x10 /* mcast group membership being deleted */ +#define RTM_IFINFO2 0x12 /* */ +#define RTM_NEWMADDR2 0x13 /* */ +#define RTM_GET2 0x14 /* */ + +/* + * Bitmask values for rtm_inits and rmx_locks. + */ +#define RTV_MTU 0x1 /* init or lock _mtu */ +#define RTV_HOPCOUNT 0x2 /* init or lock _hopcount */ +#define RTV_EXPIRE 0x4 /* init or lock _expire */ +#define RTV_RPIPE 0x8 /* init or lock _recvpipe */ +#define RTV_SPIPE 0x10 /* init or lock _sendpipe */ +#define RTV_SSTHRESH 0x20 /* init or lock _ssthresh */ +#define RTV_RTT 0x40 /* init or lock _rtt */ +#define RTV_RTTVAR 0x80 /* init or lock _rttvar */ + +/* + * Bitmask values for rtm_addrs. + */ +#define RTA_DST 0x1 /* destination sockaddr present */ +#define RTA_GATEWAY 0x2 /* gateway sockaddr present */ +#define RTA_NETMASK 0x4 /* netmask sockaddr present */ +#define RTA_GENMASK 0x8 /* cloning mask sockaddr present */ +#define RTA_IFP 0x10 /* interface name sockaddr present */ +#define RTA_IFA 0x20 /* interface addr sockaddr present */ +#define RTA_AUTHOR 0x40 /* sockaddr for author of redirect */ +#define RTA_BRD 0x80 /* for NEWADDR, broadcast or p-p dest addr */ + +/* + * Index offsets for sockaddr array for alternate internal encoding. + */ +#define RTAX_DST 0 /* destination sockaddr present */ +#define RTAX_GATEWAY 1 /* gateway sockaddr present */ +#define RTAX_NETMASK 2 /* netmask sockaddr present */ +#define RTAX_GENMASK 3 /* cloning mask sockaddr present */ +#define RTAX_IFP 4 /* interface name sockaddr present */ +#define RTAX_IFA 5 /* interface addr sockaddr present */ +#define RTAX_AUTHOR 6 /* sockaddr for author of redirect */ +#define RTAX_BRD 7 /* for NEWADDR, broadcast or p-p dest addr */ +#define RTAX_MAX 8 /* size of array to allocate */ + +struct rt_addrinfo { + int rti_addrs; + struct sockaddr *rti_info[RTAX_MAX]; +}; + + +#endif /* _NET_ROUTE_H_ */ + + diff --git a/nix/status-go/nimbus_source.nix b/nix/status-go/nimbus_source.nix new file mode 100644 index 00000000000..0b5a7662a5a --- /dev/null +++ b/nix/status-go/nimbus_source.nix @@ -0,0 +1,64 @@ +{ utils, lib, fetchFromGitHub }: + +let + inherit (lib) strings traceValFn importJSON getConfig; + + srcOverride = getConfig "nimbus-eth1.src-override" null; + # Warning message about using local sources + localSrcWarn = (path: "Using local nimbus-eth1 sources from ${path}"); + + localSrc = rec { + owner = "status-im"; + repo = "nimbus-eth1"; + rev = "unknown"; + shortRev = rev; + rawVersion = "develop"; + cleanVersion = rawVersion; + goPackagePath = "github.com/${owner}/${repo}"; + # We use builtins.path so that we can name the resulting derivation, + # Normally the name would not be deterministic, taken from the checkout directory. + src = builtins.path rec { + path = traceValFn localSrcWarn srcOverride; + name = "${repo}-source-${shortRev}"; + # Keep this filter as restrictive as possible in order + # to avoid unnecessary rebuilds and limit closure size + filter = lib.mkFilter { + root = path; + include = [ ".*" ]; + exclude = [ + ".*/[.]git.*" ".*[.]md" ".*[.]yml" ".*/.*_test.go$" + "VERSION" "_assets/.*" "build/.*" + ".*/.*LICENSE.*" ".*/CONTRIB.*" ".*/AUTHOR.*" + ]; + }; + }; + }; + + githubSrc = let + owner = "status-im"; + repo = "nimbus-eth1"; + # Static lib + # rev = "211a0ed1e89bc836a79759e35db4a45f23a79b14"; + # sha256 = "sha256-Z+PoQMoYJK9ort2ZiXE1oLeoNu2H44HHNnL4pbp+uI8="; + # Dynamic lib + rev = "1199e476397e271b889e54680dc632e47bc01dd6"; + sha256 = "sha256-egx+I4h/V/56QRBtlaZffc3hrq7IaZCqL2Lm5XNqH1c="; + version = "0.1"; + in rec { + inherit owner repo rev sha256 version; + shortRev = strings.substring 0 7 rev; + rawVersion = version; + cleanVersion = utils.sanitizeVersion version; + src = fetchFromGitHub { + inherit rev owner repo sha256; + name = "${repo}-${shortRev}-source-with-submodules"; + fetchSubmodules = true; + }; + }; +in + if srcOverride != null + # If config.status-im.status-go.src-override is defined, + # instruct Nix to use that path to build status-go + then localSrc + # Otherwise grab it from the location defined by status-go-version.json + else githubSrc diff --git a/status-go-version.json b/status-go-version.json index 7961fa723cb..4633767c508 100644 --- a/status-go-version.json +++ b/status-go-version.json @@ -3,7 +3,7 @@ "_comment": "Instead use: scripts/update-status-go.sh ", "owner": "status-im", "repo": "status-go", - "version": "v0.114.3", - "commit-sha1": "7662cd613a9d8bdda4927e583c429b362e3d3815", - "src-sha256": "1ldlwhpwdwjxkx9imjinzcw3x5a6wcs70w13kypsfaf4hv17ipmb" + "version": "lc-proxy", + "commit-sha1": "5aad6fa064fedbdfec6e8ae438377999a38b3fec", + "src-sha256": "0vgm84a56i5mhgh7ml81dcc6z86a030ihb1fimkrzc7gi34d7ccs" }