Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit d66cad5

Browse files
committed
install venv in /tmp - bundle gmp for fastecsda extension
1 parent a9ad10e commit d66cad5

File tree

6 files changed

+49
-49
lines changed

6 files changed

+49
-49
lines changed

native/macos/Blockstack/Blockstack.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
463EBBE61E2528170054FD49 /* browser in Resources */ = {isa = PBXBuildFile; fileRef = 463EBBE51E2528170054FD49 /* browser */; };
1414
4649DD931E50CB9000E2084C /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4649DD921E50CB9000E2084C /* Security.framework */; };
1515
4691B0051E3A102F00DF0353 /* blockstack-venv.tar.gz in Resources */ = {isa = PBXBuildFile; fileRef = 4691B0041E3A102F00DF0353 /* blockstack-venv.tar.gz */; };
16-
46DE9D151E533B9600275197 /* blockstack-wrapper-mac.sh in Resources */ = {isa = PBXBuildFile; fileRef = 46DE9D141E533B9600275197 /* blockstack-wrapper-mac.sh */; };
1716
DD4F7C0913C30F9F00825C6E /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD4F7C0813C30F9F00825C6E /* Cocoa.framework */; };
1817
DD4F7C1513C30F9F00825C6E /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = DD4F7C1413C30F9F00825C6E /* main.m */; };
1918
DD4F7C1C13C30F9F00825C6E /* ApplicationDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = DD4F7C1B13C30F9F00825C6E /* ApplicationDelegate.m */; };
@@ -29,7 +28,6 @@
2928
463EBBE51E2528170054FD49 /* browser */ = {isa = PBXFileReference; lastKnownFileType = folder; path = browser; sourceTree = "<group>"; };
3029
4649DD921E50CB9000E2084C /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
3130
4691B0041E3A102F00DF0353 /* blockstack-venv.tar.gz */ = {isa = PBXFileReference; lastKnownFileType = archive.gzip; path = "blockstack-venv.tar.gz"; sourceTree = "<group>"; };
32-
46DE9D141E533B9600275197 /* blockstack-wrapper-mac.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = "blockstack-wrapper-mac.sh"; sourceTree = "<group>"; };
3331
DD4F7C0413C30F9F00825C6E /* Blockstack.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Blockstack.app; sourceTree = BUILT_PRODUCTS_DIR; };
3432
DD4F7C0813C30F9F00825C6E /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
3533
DD4F7C0B13C30F9F00825C6E /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = System/Library/Frameworks/AppKit.framework; sourceTree = SDKROOT; };
@@ -105,7 +103,6 @@
105103
DD4F7C0F13C30F9F00825C6E /* Supporting Files */ = {
106104
isa = PBXGroup;
107105
children = (
108-
46DE9D141E533B9600275197 /* blockstack-wrapper-mac.sh */,
109106
4691B0041E3A102F00DF0353 /* blockstack-venv.tar.gz */,
110107
463EBBE51E2528170054FD49 /* browser */,
111108
463EBBE31E25273D0054FD49 /* blockstackProxy */,
@@ -222,7 +219,6 @@
222219
buildActionMask = 2147483647;
223220
files = (
224221
DD4F7C1F13C30F9F00825C6E /* MainMenu.xib in Resources */,
225-
46DE9D151E533B9600275197 /* blockstack-wrapper-mac.sh in Resources */,
226222
463EBBE11E2526A20054FD49 /* corsproxy in Resources */,
227223
463EBBDA1E2506CC0054FD49 /* Images.xcassets in Resources */,
228224
463EBBE41E25273D0054FD49 /* blockstackProxy in Resources */,

native/macos/Blockstack/Blockstack/ApplicationDelegate.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010

1111
@property (strong) NSString *blockstackCoreConfigFilePath;
1212

13-
@property (strong) NSString *blockstackWrapperScriptPath;
14-
@property (strong) NSString *blockstackVenvPath;
13+
@property (strong) NSString *blockstackPath;
1514

1615

1716
- (IBAction)handleClick:(id)sender;

native/macos/Blockstack/Blockstack/ApplicationDelegate.m

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ @implementation ApplicationDelegate
66
@synthesize blockstackProxyTask;
77
@synthesize corsProxyTask;
88
@synthesize blockstackCoreConfigFilePath;
9-
@synthesize blockstackWrapperScriptPath;
10-
@synthesize blockstackVenvPath;
9+
@synthesize blockstackPath;
1110

1211

1312

@@ -116,19 +115,20 @@ - (void)startBlockstackCoreApiwithCoreWalletPassword:(NSString*)coreWalletPasswo
116115
NSString*archivePath=[mainBundle pathForResource:@"blockstack-venv.tar" ofType:@"gz"];
117116
NSLog(@"Blockstack Virtualenv archive path: %@", archivePath);
118117

119-
self.blockstackWrapperScriptPath = [mainBundle pathForResource:@"blockstack-wrapper-mac" ofType:@"sh"];
120-
NSLog(@"Blockstack wrapper script path: %@", self.blockstackWrapperScriptPath);
121-
122118

123-
NSString *extractToPath = [self blockstackDataPath];
119+
120+
//NSString *extractToPath = [self blockstackDataPath];
121+
NSString* extractToPath = @"/tmp";
124122
NSLog(@"Extract Blockstack venv to: %@", extractToPath);
125123

126124
self.blockstackCoreConfigFilePath = [NSString stringWithFormat:@"%@/config/client.ini", [self blockstackDataPath]];
127125
NSLog(@"Blockstack Core config file path: %@", self.blockstackCoreConfigFilePath);
128126

129-
self.blockstackVenvPath = [NSString stringWithFormat:@"%@/blockstack-venv", extractToPath];
130-
NSLog(@"Blockstack Virtualenv Path: %@", self.blockstackVenvPath);
127+
NSString* blockstackVenvPath = [NSString stringWithFormat:@"%@/blockstack-venv", extractToPath];
128+
NSLog(@"Blockstack Virtualenv Path: %@", blockstackVenvPath);
131129

130+
self.blockstackPath = [NSString stringWithFormat:@"%@/bin/blockstack", blockstackVenvPath];
131+
NSLog(@"Blockstack Path: %@", blockstackPath);
132132

133133
NSTask *extractTask = [[NSTask alloc] init];
134134
NSTask* blockstackCoreApiSetupTask = [[NSTask alloc] init];
@@ -161,10 +161,9 @@ - (void)startBlockstackCoreApiwithCoreWalletPassword:(NSString*)coreWalletPasswo
161161

162162
/* Blockstack Core setup task */
163163

164-
blockstackCoreApiSetupTask.launchPath = @"/bin/bash";
164+
blockstackCoreApiSetupTask.launchPath = blockstackPath;
165165

166-
blockstackCoreApiSetupTask.arguments = @[self.blockstackWrapperScriptPath, self.blockstackVenvPath, @"--debug", @"-y", @"--config", self.blockstackCoreConfigFilePath, @"setup", @"--password", coreWalletPassword];
167-
NSLog(@"HERE!!!");
166+
blockstackCoreApiSetupTask.arguments = @[@"--debug", @"-y", @"--config", self.blockstackCoreConfigFilePath, @"setup", @"--password", coreWalletPassword];
168167

169168
NSPipe *setupPipe = [[NSPipe alloc] init];
170169
[blockstackCoreApiSetupTask setStandardOutput:setupPipe];
@@ -186,9 +185,9 @@ - (void)startBlockstackCoreApiwithCoreWalletPassword:(NSString*)coreWalletPasswo
186185
/* Blockstack Core api start task */
187186

188187

189-
blockstackCoreApiStartTask.launchPath = @"/bin/bash";
188+
blockstackCoreApiStartTask.launchPath = self.blockstackPath;
190189

191-
blockstackCoreApiStartTask.arguments = @[self.blockstackWrapperScriptPath, self.blockstackVenvPath, @"--debug", @"-y", @"--config", self.blockstackCoreConfigFilePath, @"api", @"start", @"--password", coreWalletPassword];
190+
blockstackCoreApiStartTask.arguments = @[@"--debug", @"-y", @"--config", self.blockstackCoreConfigFilePath, @"api", @"start", @"--password", coreWalletPassword];
192191

193192
NSPipe *startPipe = [[NSPipe alloc] init];
194193
[blockstackCoreApiStartTask setStandardOutput:startPipe];
@@ -216,9 +215,9 @@ -(void)stopBlockstackCoreApiAndExit
216215

217216
NSTask* blockstackCoreApiStopTask = [[NSTask alloc] init];
218217

219-
blockstackCoreApiStopTask.launchPath = @"/bin/bash";
218+
blockstackCoreApiStopTask.launchPath = self.blockstackPath;
220219

221-
blockstackCoreApiStopTask.arguments = @[self.blockstackWrapperScriptPath, self.blockstackVenvPath, @"--debug", @"-y", @"--config", self.blockstackCoreConfigFilePath, @"api", @"stop"];
220+
blockstackCoreApiStopTask.arguments = @[@"--debug", @"-y", @"--config", self.blockstackCoreConfigFilePath, @"api", @"stop"];
222221

223222
NSPipe *pipe = [[NSPipe alloc] init];
224223
[blockstackCoreApiStopTask setStandardOutput:pipe];

native/macos/Blockstack/Blockstack/Blockstack-Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<key>CFBundleSignature</key>
2020
<string>????</string>
2121
<key>CFBundleVersion</key>
22-
<string>14</string>
22+
<string>17</string>
2323
<key>LSApplicationCategoryType</key>
2424
<string>public.app-category.utilities</string>
2525
<key>LSMinimumSystemVersion</key>

native/macos/Blockstack/Blockstack/blockstack-wrapper-mac.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

native/macos/build_blockstack_virtualenv.sh

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@
44
# the macOS app
55

66

7-
# make working directory the same as location of script
8-
cd "$(dirname "$0")"
7+
## make working directory the same as location of script
8+
#cd "$(dirname "$0")"
9+
10+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/"
11+
12+
echo "Script is running in $SCRIPT_DIR"
13+
14+
cd /tmp
915

1016
echo "Removing any existing virtualenv dir..."
1117

@@ -15,10 +21,34 @@ echo "Creating a new virtualenv..."
1521

1622
virtualenv -p /usr/bin/python2.7 blockstack-venv
1723

24+
echo "Downloading gmp..."
25+
26+
curl -O https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2
27+
28+
bunzip2 gmp-6.1.2.tar.bz2
29+
30+
tar -xf gmp-6.1.2.tar
31+
32+
echo "Building gmp..."
33+
34+
cd gmp-6.1.2
35+
36+
./configure --prefix=/tmp/blockstack-venv
37+
38+
make
39+
40+
make install
41+
42+
cd ..
43+
1844
echo "Activating virtualenv..."
1945

2046
source blockstack-venv/bin/activate
2147

48+
echo "Installing fastecdsa..."
49+
50+
CFLAGS="-I/tmp/blockstack-venv/include" LDFLAGS="-L/tmp/blockstack-venv/lib" pip install fastecdsa --no-cache-dir
51+
2252
echo "Installing latest virtualchain..."
2353

2454
pip install git+https://github.com/blockstack/[email protected]
@@ -43,4 +73,4 @@ virtualenv --relocatable blockstack-venv
4373

4474
echo "Build Blockstack virtualenv archive..."
4575

46-
tar -czvf Blockstack/Blockstack/blockstack-venv.tar.gz blockstack-venv
76+
tar -czvf $SCRIPT_DIR/Blockstack/Blockstack/blockstack-venv.tar.gz blockstack-venv

0 commit comments

Comments
 (0)