3
0
Fork 0
forked from mirrors/nixpkgs

flutter: 2.5.1 -> 2.8.0

This commit is contained in:
Eric Dallo 2021-12-11 14:16:59 -03:00
parent 887da2479d
commit f6da7b4007
No known key found for this signature in database
GPG key ID: 985DD2B6664886B8
2 changed files with 28 additions and 33 deletions

View file

@ -4,20 +4,20 @@ let
getPatches = dir: getPatches = dir:
let files = builtins.attrNames (builtins.readDir dir); let files = builtins.attrNames (builtins.readDir dir);
in map (f: dir + ("/" + f)) files; in map (f: dir + ("/" + f)) files;
version = "2.5.1"; version = "2.8.0";
channel = "stable"; channel = "stable";
filename = "flutter_linux_${version}-${channel}.tar.xz"; filename = "flutter_linux_${version}-${channel}.tar.xz";
# Decouples flutter derivation from dart derivation, # Decouples flutter derivation from dart derivation,
# use specific dart version to not need to bump dart derivation when bumping flutter. # use specific dart version to not need to bump dart derivation when bumping flutter.
dartVersion = "2.14.2"; dartVersion = "2.15.0";
dartSourceBase = "https://storage.googleapis.com/dart-archive/channels"; dartSourceBase = "https://storage.googleapis.com/dart-archive/channels";
dartForFlutter = dart.override { dartForFlutter = dart.override {
version = dartVersion; version = dartVersion;
sources = { sources = {
"${dartVersion}-x86_64-linux" = fetchurl { "${dartVersion}-x86_64-linux" = fetchurl {
url = "${dartSourceBase}/stable/release/${dartVersion}/sdk/dartsdk-linux-x64-release.zip"; url = "${dartSourceBase}/stable/release/${dartVersion}/sdk/dartsdk-linux-x64-release.zip";
sha256 = "1gr2dr683kz0a0k6rcn4jcbxf9fr2xlzi5fcgn1lzrrxvys2lddx"; sha256 = "sha256-U1V1OPmFeNZCdBxFy7yqAbAE0cxh9f2UqKQmreJu9YA=";
}; };
}; };
}; };
@ -29,7 +29,7 @@ in {
pname = "flutter"; pname = "flutter";
src = fetchurl { src = fetchurl {
url = "https://storage.googleapis.com/flutter_infra_release/releases/${channel}/linux/${filename}"; url = "https://storage.googleapis.com/flutter_infra_release/releases/${channel}/linux/${filename}";
sha256 = "12ycz7iasrc9p9c6zr95l6llyji3za43gsx8cmr2kjfiv23bcrv2"; sha256 = "sha256-sSz/owGdCMB5b9+cAWvLkrfFcIIq5665Xopd4JKv1G4=";
}; };
patches = getPatches ./patches; patches = getPatches ./patches;
}; };

View file

@ -1,62 +1,57 @@
diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart
index 80fb16673f..5723f93f9f 100644 index ed42baea29..fee2fb1d62 100644
--- a/packages/flutter_tools/lib/src/asset.dart --- a/packages/flutter_tools/lib/src/asset.dart
+++ b/packages/flutter_tools/lib/src/asset.dart +++ b/packages/flutter_tools/lib/src/asset.dart
@@ -7,6 +7,7 @@ @@ -11,11 +11,11 @@ import 'base/file_system.dart';
import 'package:meta/meta.dart'; import 'base/logger.dart';
import 'package:package_config/package_config.dart'; import 'base/platform.dart';
import 'build_info.dart';
+import 'base/common.dart'; -import 'cache.dart';
import 'base/context.dart';
import 'base/deferred_component.dart';
import 'base/file_system.dart';
@@ -16,6 +17,7 @@ import 'build_info.dart';
import 'cache.dart';
import 'convert.dart'; import 'convert.dart';
import 'dart/package_map.dart'; import 'dart/package_map.dart';
+import 'globals.dart' as globals;
import 'devfs.dart'; import 'devfs.dart';
import 'flutter_manifest.dart'; import 'flutter_manifest.dart';
+import 'globals.dart' as globals;
import 'license_collector.dart'; import 'license_collector.dart';
@@ -449,7 +451,7 @@ class ManifestAssetBundle implements AssetBundle { import 'project.dart';
for (final Map<String, Object> font in family['fonts'] as List<Map<String, Object>>) {
final Uri entryUri = _fileSystem.path.toUri(font['asset'] as String); @@ -504,7 +504,7 @@ class ManifestAssetBundle implements AssetBundle {
}
final Uri entryUri = _fileSystem.path.toUri(asset);
result.add(_Asset( result.add(_Asset(
- baseDir: _fileSystem.path.join(Cache.flutterRoot, 'bin', 'cache', 'artifacts', 'material_fonts'), - baseDir: _fileSystem.path.join(Cache.flutterRoot!, 'bin', 'cache', 'artifacts', 'material_fonts'),
+ baseDir: _fileSystem.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'artifacts', 'material_fonts'), + baseDir: _fileSystem.path.join(globals.fsUtils.homeDirPath!, 'bin', 'cache', 'artifacts', 'material_fonts'),
relativeUri: Uri(path: entryUri.pathSegments.last), relativeUri: Uri(path: entryUri.pathSegments.last),
entryUri: entryUri, entryUri: entryUri,
package: null, package: null,
diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart
index 152d4e75e5..1fcff7e2bd 100644 index 7870c7807f..3fcf92f20d 100644
--- a/packages/flutter_tools/lib/src/cache.dart --- a/packages/flutter_tools/lib/src/cache.dart
+++ b/packages/flutter_tools/lib/src/cache.dart +++ b/packages/flutter_tools/lib/src/cache.dart
@@ -9,6 +9,7 @@ import 'package:file/memory.dart'; @@ -22,6 +22,7 @@ import 'base/user_messages.dart';
import 'package:meta/meta.dart'; import 'build_info.dart';
import 'package:process/process.dart'; import 'convert.dart';
import 'features.dart';
+import 'globals.dart' as globals; +import 'globals.dart' as globals;
import 'base/common.dart';
import 'base/error_handling_io.dart'; const String kFlutterRootEnvironmentVariableName = 'FLUTTER_ROOT'; // should point to //flutter/ (root of flutter/flutter repo)
import 'base/file_system.dart'; const String kFlutterEngineEnvironmentVariableName = 'FLUTTER_ENGINE'; // should point to //engine/src/ (root of flutter/engine repo)
@@ -298,8 +299,15 @@ class Cache { @@ -302,8 +303,13 @@ class Cache {
return; return;
} }
assert(_lock == null); assert(_lock == null);
+
+ final Directory dir = _fileSystem.directory(_fileSystem.path.join(globals.fsUtils.homeDirPath!, '.cache', 'flutter')); + final Directory dir = _fileSystem.directory(_fileSystem.path.join(globals.fsUtils.homeDirPath!, '.cache', 'flutter'));
+ if (!dir.existsSync()) { + if (!dir.existsSync()) {
+ dir.createSync(recursive: true); + dir.createSync(recursive: true);
+ globals.os.chmod(dir, '755'); + globals.os.chmod(dir, '755');
+ } + }
+
final File lockFile = final File lockFile =
- _fileSystem.file(_fileSystem.path.join(flutterRoot!, 'bin', 'cache', 'lockfile')); - _fileSystem.file(_fileSystem.path.join(flutterRoot!, 'bin', 'cache', 'lockfile'));
+ _fileSystem.file(_fileSystem.path.join(globals.fsUtils.homeDirPath!, '.cache', 'flutter', 'lockfile')); + _fileSystem.file(_fileSystem.path.join(globals.fsUtils.homeDirPath!, '.cache', 'flutter', 'lockfile'));
try { try {
_lock = lockFile.openSync(mode: FileMode.write); _lock = lockFile.openSync(mode: FileMode.write);
} on FileSystemException catch (e) { } on FileSystemException catch (e) {
@@ -404,7 +412,7 @@ class Cache { @@ -453,7 +459,7 @@ class Cache {
if (_rootOverride != null) { if (_rootOverride != null) {
return _fileSystem.directory(_fileSystem.path.join(_rootOverride!.path, 'bin', 'cache')); return _fileSystem.directory(_fileSystem.path.join(_rootOverride!.path, 'bin', 'cache'));
} else { } else {