Skip to content

Commit 0017020

Browse files
committed
Updated comments
1 parent cb569af commit 0017020

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

hook/build.dart

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,12 @@ void main(List<String> args) async {
6060
);
6161

6262
// run jom to build the library
63-
await runProcess(jomProgram, ['-j', '${Platform.numberOfProcessors}'], workingDirectory: openSslDir, extraEnvironment: msvcEnv);
63+
await runProcess(
64+
jomProgram,
65+
['-j', '${Platform.numberOfProcessors}'],
66+
workingDirectory: openSslDir,
67+
extraEnvironment: msvcEnv,
68+
);
6469

6570
// delete perl and jom if downloaded
6671
if (needDownloadPerl) {
@@ -72,6 +77,11 @@ void main(List<String> args) async {
7277
break;
7378
case OS.macOS:
7479
case OS.linux:
80+
final hasPerl = await isProgramInstalled('perl');
81+
if (!hasPerl) {
82+
throw Exception('perl is not installed, please install it to be able to build openssl.');
83+
}
84+
7585
// run ./Configure with the target OS and architecture
7686
await runProcess('./Configure', [configName, ...configArgs], workingDirectory: openSslDir);
7787

@@ -80,19 +90,21 @@ void main(List<String> args) async {
8090
break;
8191
}
8292

83-
// copy the library to the output directory
93+
// determine the libName from OS and Link mode
8494
final libName = switch ((input.config.code.targetOS, input.config.code.linkModePreference)) {
8595
(OS.windows, LinkModePreference.static || LinkModePreference.preferStatic) => 'libcrypto_static.lib',
8696
(OS.macOS, LinkModePreference.static || LinkModePreference.preferStatic) => 'libcrypto.a',
8797
(OS.linux, LinkModePreference.static || LinkModePreference.preferStatic) => 'libcrypto.a',
88-
(OS.windows, LinkModePreference.dynamic || LinkModePreference.preferDynamic) => 'libcrypto-3-${input.config.code.targetArchitecture.name}.dll',
98+
(OS.windows, LinkModePreference.dynamic || LinkModePreference.preferDynamic) =>
99+
'libcrypto-3-${input.config.code.targetArchitecture.name}.dll',
89100
(OS.macOS, LinkModePreference.dynamic || LinkModePreference.preferDynamic) => 'libcrypto.dylib',
90101
(OS.linux, LinkModePreference.dynamic || LinkModePreference.preferDynamic) => 'libcrypto.so',
91102
_ => throw UnsupportedError(
92103
'Unsupported target OS: ${input.config.code.targetOS.name} or link mode preference: ${input.config.code.linkModePreference.name}',
93104
),
94105
};
95106

107+
// copy the library to the output directory
96108
final libPath = outputDir.resolve(libName).toFilePath(windows: Platform.isWindows);
97109
await File(openSslDir.resolve(libName).toFilePath(windows: Platform.isWindows)).copy(libPath);
98110

lib/src/third_party/openssl.g.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70877,7 +70877,7 @@ const int OPENSSL_VERSION_NUMBER = 810549312;
7087770877
const int OPENSSL_API_LEVEL = 30500;
7087870878

7087970879
const String OPENSSL_FILE =
70880-
'/var/folders/0y/d5dw8zh541q633mfzdfgf9bc0000gp/T/q2MGhh/temp_for_macros.hpp';
70880+
'/var/folders/0y/d5dw8zh541q633mfzdfgf9bc0000gp/T/TrFJt1/temp_for_macros.hpp';
7088170881

7088270882
const int OPENSSL_LINE = 221;
7088370883

0 commit comments

Comments
 (0)