Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
82675474
Unverified
Commit
82675474
authored
Mar 12, 2021
by
Marcus Tomlinson
Committed by
GitHub
Mar 12, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add libgcrypt as an explicit dependancy on Linux (#77926)
parent
d20ec4c7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
0 deletions
+49
-0
user_messages.dart
packages/flutter_tools/lib/src/base/user_messages.dart
+2
-0
linux_doctor.dart
packages/flutter_tools/lib/src/linux/linux_doctor.dart
+4
-0
CMakeLists.txt
...ter_tools/templates/app/linux.tmpl/flutter/CMakeLists.txt
+2
-0
linux_doctor_test.dart
...ter_tools/test/general.shard/linux/linux_doctor_test.dart
+41
-0
No files found.
packages/flutter_tools/lib/src/base/user_messages.dart
View file @
82675474
...
...
@@ -236,6 +236,8 @@ class UserMessages {
'It is likely available from your distribution (e.g.: apt install libblkid-dev)'
;
String
get
lzmaLibraryMissing
=>
'The lzma development library is required for Linux development.
\n
'
'It is likely available from your distribution (e.g.: apt install liblzma-dev)'
;
String
get
gcryptLibraryMissing
=>
'The gcrypt development library is required for Linux development.
\n
'
'It is likely available from your distribution (e.g.: apt install libgcrypt20-dev)'
;
// Messages used in FlutterCommand
String
flutterElapsedTime
(
String
name
,
String
elapsedTime
)
=>
'"flutter
$name
" took
$elapsedTime
.'
;
...
...
packages/flutter_tools/lib/src/linux/linux_doctor.dart
View file @
82675474
...
...
@@ -159,6 +159,10 @@ class LinuxDoctorValidator extends DoctorValidator {
validationType
=
ValidationType
.
missing
;
messages
.
add
(
ValidationMessage
.
error
(
_userMessages
.
lzmaLibraryMissing
));
}
if
(!
await
_libraryIsPresent
(
'libgcrypt'
))
{
validationType
=
ValidationType
.
missing
;
messages
.
add
(
ValidationMessage
.
error
(
_userMessages
.
gcryptLibraryMissing
));
}
return
ValidationResult
(
validationType
,
messages
);
}
...
...
packages/flutter_tools/templates/app/linux.tmpl/flutter/CMakeLists.txt
View file @
82675474
...
...
@@ -26,6 +26,7 @@ pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0)
pkg_check_modules
(
GIO REQUIRED IMPORTED_TARGET gio-2.0
)
pkg_check_modules
(
BLKID REQUIRED IMPORTED_TARGET blkid
)
pkg_check_modules
(
LZMA REQUIRED IMPORTED_TARGET liblzma
)
pkg_check_modules
(
GCRYPT REQUIRED IMPORTED_TARGET libgcrypt
)
set
(
FLUTTER_LIBRARY
"
${
EPHEMERAL_DIR
}
/libflutter_linux_gtk.so"
)
...
...
@@ -69,6 +70,7 @@ target_link_libraries(flutter INTERFACE
PkgConfig::GIO
PkgConfig::BLKID
PkgConfig::LZMA
PkgConfig::GCRYPT
)
add_dependencies
(
flutter flutter_assemble
)
...
...
packages/flutter_tools/test/general.shard/linux/linux_doctor_test.dart
View file @
82675474
...
...
@@ -102,6 +102,7 @@ void main() {
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
_libraryCheckCommand
(
'libgcrypt'
),
]);
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
processManager:
processManager
,
...
...
@@ -127,6 +128,7 @@ void main() {
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
_libraryCheckCommand
(
'libgcrypt'
),
]);
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
processManager:
processManager
,
...
...
@@ -153,6 +155,7 @@ void main() {
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
_libraryCheckCommand
(
'libgcrypt'
),
]);
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
processManager:
processManager
,
...
...
@@ -179,6 +182,7 @@ void main() {
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
_libraryCheckCommand
(
'libgcrypt'
),
]);
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
processManager:
processManager
,
...
...
@@ -205,6 +209,7 @@ void main() {
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
_libraryCheckCommand
(
'libgcrypt'
),
]);
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
processManager:
processManager
,
...
...
@@ -231,6 +236,7 @@ void main() {
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
_libraryCheckCommand
(
'libgcrypt'
),
]);
final
UserMessages
userMessages
=
UserMessages
();
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
...
...
@@ -257,6 +263,7 @@ void main() {
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
_libraryCheckCommand
(
'libgcrypt'
),
]);
final
UserMessages
userMessages
=
UserMessages
();
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
...
...
@@ -283,6 +290,7 @@ void main() {
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
_libraryCheckCommand
(
'libgcrypt'
),
]);
final
UserMessages
userMessages
=
UserMessages
();
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
...
...
@@ -309,6 +317,7 @@ void main() {
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
_libraryCheckCommand
(
'libgcrypt'
),
]);
final
UserMessages
userMessages
=
UserMessages
();
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
...
...
@@ -335,6 +344,7 @@ void main() {
...
_gtkLibrariesMissingCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
_libraryCheckCommand
(
'libgcrypt'
),
]);
final
UserMessages
userMessages
=
UserMessages
();
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
...
...
@@ -362,6 +372,7 @@ void main() {
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
,
exists:
false
),
_libraryCheckCommand
(
'liblzma'
),
_libraryCheckCommand
(
'libgcrypt'
),
]);
final
UserMessages
userMessages
=
UserMessages
();
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
...
...
@@ -389,6 +400,7 @@ void main() {
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
,
exists:
false
),
_libraryCheckCommand
(
'libgcrypt'
),
]);
final
UserMessages
userMessages
=
UserMessages
();
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
...
...
@@ -407,6 +419,34 @@ void main() {
]);
});
testWithoutContext
(
'Missing validation when libgcrypt is not available'
,
()
async
{
final
ProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
_clangPresentCommand
(
'4.0.1'
),
_cmakePresentCommand
(
'3.16.3'
),
_ninjaPresentCommand
(
'1.10.0'
),
_pkgConfigPresentCommand
(
'0.29'
),
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
_libraryCheckCommand
(
'libgcrypt'
,
exists:
false
),
]);
final
UserMessages
userMessages
=
UserMessages
();
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
processManager:
processManager
,
userMessages:
userMessages
,
);
final
ValidationResult
result
=
await
linuxDoctorValidator
.
validate
();
expect
(
result
.
type
,
ValidationType
.
missing
);
expect
(
result
.
messages
,
<
ValidationMessage
>[
const
ValidationMessage
(
'clang version 4.0.1-6+build1'
),
const
ValidationMessage
(
'cmake version 3.16.3'
),
const
ValidationMessage
(
'ninja version 1.10.0'
),
const
ValidationMessage
(
'pkg-config version 0.29'
),
ValidationMessage
.
error
(
userMessages
.
gcryptLibraryMissing
),
]);
});
testWithoutContext
(
'Missing validation when multiple dependencies are not available'
,
()
async
{
final
ProcessManager
processManager
=
FakeProcessManager
.
list
(<
FakeCommand
>[
_missingBinaryCommand
(
'clang++'
),
...
...
@@ -416,6 +456,7 @@ void main() {
...
_gtkLibrariesPresentCommands
(),
_libraryCheckCommand
(
'blkid'
),
_libraryCheckCommand
(
'liblzma'
),
_libraryCheckCommand
(
'libgcrypt'
),
]);
final
DoctorValidator
linuxDoctorValidator
=
LinuxDoctorValidator
(
processManager:
processManager
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment