From ec644e05cb58734f9d8f73aba236838020909809 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Fri, 15 Jan 2021 17:21:25 -0300 Subject: [PATCH] flutter: remove non-stable versions Related issue #108606. Nowadays we have multiple outdated versions of Flutter in nixpkgs. Instead, let's focus in having in having stable versions of Flutter working. Users needing to use beta or dev versions of Flutter can use mkFlutter function, that still exists. --- .../development/compilers/flutter/default.nix | 23 +------ .../development/compilers/flutter/flutter.nix | 3 +- .../patches/dev/disable-auto-update.patch | 31 --------- .../flutter/patches/dev/move-cache.patch | 64 ------------------- .../development/interpreters/dart/default.nix | 2 +- pkgs/top-level/aliases.nix | 2 + pkgs/top-level/all-packages.nix | 2 - 7 files changed, 6 insertions(+), 121 deletions(-) delete mode 100644 pkgs/development/compilers/flutter/patches/dev/disable-auto-update.patch delete mode 100644 pkgs/development/compilers/flutter/patches/dev/move-cache.patch diff --git a/pkgs/development/compilers/flutter/default.nix b/pkgs/development/compilers/flutter/default.nix index 3eea7f596b6b..d455eb101105 100644 --- a/pkgs/development/compilers/flutter/default.nix +++ b/pkgs/development/compilers/flutter/default.nix @@ -1,8 +1,5 @@ { callPackage, dart }: let - dart_stable = dart.override { version = "2.10.0"; }; - dart_beta = dart.override { version = "2.10.0"; }; - dart_dev = dart.override { version = "2.11.0-161.0.dev"; }; mkFlutter = opts: callPackage (import ./flutter.nix opts) { }; getPatches = dir: let files = builtins.attrNames (builtins.readDir dir); @@ -11,30 +8,12 @@ in { mkFlutter = mkFlutter; stable = mkFlutter rec { + inherit dart; pname = "flutter"; channel = "stable"; version = "1.22.0"; filename = "flutter_linux_${version}-${channel}.tar.xz"; sha256Hash = "0ryrx458ss8ryhmspcfrhjvad2pl46bxh1qk5vzwzhxiqdc79vm8"; patches = getPatches ./patches/stable; - dart = dart_stable; - }; - beta = mkFlutter rec { - pname = "flutter"; - channel = "beta"; - version = "1.22.0-12.3.pre"; - filename = "flutter_linux_${version}-${channel}.tar.xz"; - sha256Hash = "1axzz137z4lgpa09h7bjf52i6dij6a9wmjbha1182db23r09plzh"; - patches = getPatches ./patches/stable; - dart = dart_beta; - }; - dev = mkFlutter rec { - pname = "flutter"; - channel = "dev"; - version = "1.23.0-7.0.pre"; - filename = "flutter_linux_${version}-${channel}.tar.xz"; - sha256Hash = "166qb4qbv051bc71yj7c0vrkamhvzz3fp3mz318qzm947mydwjj5"; - patches = getPatches ./patches/dev; - dart = dart_dev; }; } diff --git a/pkgs/development/compilers/flutter/flutter.nix b/pkgs/development/compilers/flutter/flutter.nix index a7ec87322507..36c2fdff201f 100644 --- a/pkgs/development/compilers/flutter/flutter.nix +++ b/pkgs/development/compilers/flutter/flutter.nix @@ -13,7 +13,8 @@ , coreutils , git , runCommand -, lib, stdenv +, stdenv +, lib , fetchurl , alsaLib , dbus diff --git a/pkgs/development/compilers/flutter/patches/dev/disable-auto-update.patch b/pkgs/development/compilers/flutter/patches/dev/disable-auto-update.patch deleted file mode 100644 index f9ac00d1d323..000000000000 --- a/pkgs/development/compilers/flutter/patches/dev/disable-auto-update.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/bin/internal/shared.sh b/bin/internal/shared.sh -index 22efe87443..c6954575c5 100644 ---- a/bin/internal/shared.sh -+++ b/bin/internal/shared.sh -@@ -212,8 +212,6 @@ function shared::execute() { - # FLUTTER_TOOL_ARGS="--enable-asserts $FLUTTER_TOOL_ARGS" - # FLUTTER_TOOL_ARGS="$FLUTTER_TOOL_ARGS --observe=65432" - -- upgrade_flutter 7< "$PROG_NAME" -- - BIN_NAME="$(basename "$PROG_NAME")" - case "$BIN_NAME" in - flutter*) -diff --git a/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart b/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart -index fb1616ba96..b973b3fd58 100644 ---- a/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart -+++ b/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart -@@ -291,13 +291,6 @@ class FlutterCommandRunner extends CommandRunner { - globals.flutterUsage.suppressAnalytics = true; - } - -- try { -- await globals.flutterVersion.ensureVersionFile(); -- } on FileSystemException catch (e) { -- globals.printError('Failed to write the version file to the artifact cache: "$e".'); -- globals.printError('Please ensure you have permissions in the artifact cache directory.'); -- throwToolExit('Failed to write the version file'); -- } - final bool machineFlag = topLevelResults['machine'] as bool; - if (topLevelResults.command?.name != 'upgrade' && topLevelResults['version-check'] as bool && !machineFlag) { - await globals.flutterVersion.checkFlutterVersionFreshness(); diff --git a/pkgs/development/compilers/flutter/patches/dev/move-cache.patch b/pkgs/development/compilers/flutter/patches/dev/move-cache.patch deleted file mode 100644 index eb6ff5cf582e..000000000000 --- a/pkgs/development/compilers/flutter/patches/dev/move-cache.patch +++ /dev/null @@ -1,64 +0,0 @@ -diff --git a/dev/devicelab/lib/framework/runner.dart b/dev/devicelab/lib/framework/runner.dart -index a059a8e992..b664a7070c 100644 ---- a/dev/devicelab/lib/framework/runner.dart -+++ b/dev/devicelab/lib/framework/runner.dart -@@ -137,7 +137,7 @@ Future cleanupSystem() async { - print('\nTelling Gradle to shut down (JAVA_HOME=$javaHome)'); - final String gradlewBinaryName = Platform.isWindows ? 'gradlew.bat' : 'gradlew'; - final Directory tempDir = Directory.systemTemp.createTempSync('flutter_devicelab_shutdown_gradle.'); -- recursiveCopy(Directory(path.join(flutterDirectory.path, 'bin', 'cache', 'artifacts', 'gradle_wrapper')), tempDir); -+ recursiveCopy(Directory(path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'artifacts', 'gradle_wrapper')), tempDir); - copy(File(path.join(path.join(flutterDirectory.path, 'packages', 'flutter_tools'), 'templates', 'app', 'android.tmpl', 'gradle', 'wrapper', 'gradle-wrapper.properties')), Directory(path.join(tempDir.path, 'gradle', 'wrapper'))); - if (!Platform.isWindows) { - await exec( -diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart -index 36714c5fb4..c0cc049ee1 100644 ---- a/packages/flutter_tools/lib/src/asset.dart -+++ b/packages/flutter_tools/lib/src/asset.dart -@@ -6,6 +6,7 @@ import 'package:meta/meta.dart'; - import 'package:package_config/package_config.dart'; - import 'package:yaml/yaml.dart'; - -+import 'base/common.dart'; - import 'base/context.dart'; - import 'base/file_system.dart'; - import 'base/utils.dart'; -@@ -397,7 +398,7 @@ List<_Asset> _getMaterialAssets(String fontSet) { - for (final Map font in (family['fonts'] as List).cast>()) { - final Uri entryUri = globals.fs.path.toUri(font['asset'] as String); - result.add(_Asset( -- baseDir: globals.fs.path.join(Cache.flutterRoot, 'bin', 'cache', 'artifacts', 'material_fonts'), -+ baseDir: globals.fs.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'artifacts', 'material_fonts'), - relativeUri: Uri(path: entryUri.pathSegments.last), - entryUri: entryUri, - package: null, -diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart -index aaca036d78..43ff428f8d 100644 ---- a/packages/flutter_tools/lib/src/cache.dart -+++ b/packages/flutter_tools/lib/src/cache.dart -@@ -226,8 +226,15 @@ class Cache { - return; - } - assert(_lock == null); -+ -+ final Directory dir = globals.fs.directory(globals.fs.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter')); -+ if (!dir.existsSync()) { -+ dir.createSync(recursive: true); -+ globals.os.chmod(dir, '755'); -+ } -+ - final File lockFile = -- globals.fs.file(globals.fs.path.join(flutterRoot, 'bin', 'cache', 'lockfile')); -+ globals.fs.file(globals.fs.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'lockfile')); - try { - _lock = lockFile.openSync(mode: FileMode.write); - } on FileSystemException catch (e) { -@@ -330,7 +337,7 @@ class Cache { - if (_rootOverride != null) { - return _fileSystem.directory(_fileSystem.path.join(_rootOverride.path, 'bin', 'cache')); - } else { -- return _fileSystem.directory(_fileSystem.path.join(flutterRoot, 'bin', 'cache')); -+ return _fileSystem.directory(_fileSystem.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter')); - } - } - diff --git a/pkgs/development/interpreters/dart/default.nix b/pkgs/development/interpreters/dart/default.nix index 7fa59a18c5f1..d3c10540ebfb 100644 --- a/pkgs/development/interpreters/dart/default.nix +++ b/pkgs/development/interpreters/dart/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, unzip, version ? "2.7.2" }: +{ lib, stdenv, fetchurl, unzip, version ? "2.10.0" }: let diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 21ef7acf4b0b..2f0e601094f9 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -174,6 +174,8 @@ mapAliases ({ fish-foreign-env = throw "fish-foreign-env has been replaced with fishPlugins.foreign-env"; # added 2020-12-29, modified 2021-01-10 flameGraph = flamegraph; # added 2018-04-25 flink_1_5 = throw "flink_1_5 was removed, use flink instead"; # added 2021-01-25 + flutter-beta = throw "Non-stable versions of Flutter have been removed. You can use flutterPackages.mkFlutter to generate a package for other Flutter versions."; # added 2020-01-15 + flutter-dev = throw "Non-stable versions of Flutter have been removed. You can use flutterPackages.mkFlutter to generate a package for other Flutter versions."; # added 2020-01-15 flvtool2 = throw "flvtool2 has been removed."; # added 2020-11-03 foldingathome = fahclient; # added 2020-09-03 font-awesome-ttf = font-awesome; # 2018-02-25 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index bd3f5e27d31c..37a8b9d8ea51 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9592,8 +9592,6 @@ in flutterPackages = recurseIntoAttrs (callPackage ../development/compilers/flutter { }); flutter = flutterPackages.stable; - flutter-beta = flutterPackages.beta; - flutter-dev = flutterPackages.dev; fpc = callPackage ../development/compilers/fpc { };