Unverified Commit 8c4cc63c authored by Tristan Ross's avatar Tristan Ross Committed by GitHub
Browse files

flutter329: init at 3.29.2 (#384617)

parents 630541ec ce0be78e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
{
  lib,
  flutter,
  flutter327,
  fetchFromGitHub,
  makeDesktopItem,
  copyDesktopItems,
  mpv-unwrapped,
}:
flutter.buildFlutterApplication rec {
flutter327.buildFlutterApplication rec {
  pname = "jellyflix";
  version = "1.0.0";

+11 −1
Original line number Diff line number Diff line
@@ -174,7 +174,11 @@ stdenv.mkDerivation (finalAttrs: {

  nativeBuildInputs =
    [
      python3
      (python3.withPackages (
        ps: with ps; [
          pyyaml
        ]
      ))
      (tools.vpython python3)
      gitMinimal
      pkg-config
@@ -295,6 +299,12 @@ stdenv.mkDerivation (finalAttrs: {

    export TERM=dumb

    ${lib.optionalString (lib.versionAtLeast flutterVersion "3.29") ''
      # ValueError: ZIP does not support timestamps before 1980
      substituteInPlace src/flutter/build/zip.py \
        --replace-fail "zipfile.ZipFile(args.output, 'w', zipfile.ZIP_DEFLATED)" "zipfile.ZipFile(args.output, 'w', zipfile.ZIP_DEFLATED, strict_timestamps=False)"
    ''}

    ninja -C $out/out/$outName -j$NIX_BUILD_CORES

    runHook postBuild
+38 −17
Original line number Diff line number Diff line
@@ -48,7 +48,7 @@ runCommand "flutter-engine-source-${version}-${buildPlatform.system}-${targetPla
    gclient = writeText "flutter-engine-${version}.gclient" ''
      solutions = [{
        "managed": False,
        "name": "src/flutter",
        "name": "${lib.optionalString (lib.versionAtLeast flutterVersion "3.29") "engine/"}src/flutter",
        "url": "${url}",
        "custom_vars": {
          "download_fuchsia_deps": False,
@@ -86,17 +86,37 @@ runCommand "flutter-engine-source-${version}-${buildPlatform.system}-${targetPla
      (hashes."${buildPlatform.system}" or { })."${targetPlatform.system}"
        or (throw "Hash not set for ${targetPlatform.system} on ${buildPlatform.system}");
  }
  (
    ''
      source ${../../../../build-support/fetchgit/deterministic-git}
      export -f clean_git
      export -f make_deterministic_repo

    ''
    + (
      if lib.versionAtLeast flutterVersion "3.29" then
        ''
          mkdir -p source
          cp $gclient source/.gclient
          cd source
        ''
      else
        ''
          mkdir -p $out
          cp $gclient $out/.gclient
          cd $out
        ''
    )
    + ''

      export PATH=$PATH:$depot_tools
      python3 $depot_tools/gclient.py sync --no-history --shallow --nohooks -j $NIX_BUILD_CORES
    ''
    + lib.optionalString (lib.versionAtLeast flutterVersion "3.29") ''
      cp -r engine/src/flutter/third_party/* engine/src/flutter/engine/src/flutter/third_party/
      mv engine/src/flutter/engine $out
    ''
    + ''
      find $out -name '.git' -exec rm -rf {} \; || true

      rm -rf $out/src/{buildtools,fuchsia}
@@ -106,3 +126,4 @@ runCommand "flutter-engine-source-${version}-${buildPlatform.system}-${targetPla

      rm -rf $out/.cipd $out/.gclient $out/.gclient_entries $out/.gclient_previous_custom_vars $out/.gclient_previous_sync_commits
    ''
  )
+5 −9
Original line number Diff line number Diff line
@@ -3,7 +3,11 @@
  version,
  engineVersion,
  engineHashes ? { },
  engineUrl ? "https://github.com/flutter/engine.git@${engineVersion}",
  engineUrl ?
    if lib.versionAtLeast version "3.29" then
      "https://github.com/flutter/flutter.git@${engineVersion}"
    else
      "https://github.com/flutter/engine.git@${engineVersion}",
  enginePatches ? [ ],
  engineRuntimeModes ? [
    "release"
@@ -99,14 +103,6 @@ let
      echo "$(git rev-parse HEAD)" > bin/cache/flutter_tools.stamp
      ln -s '${flutterTools}/share/flutter_tools.snapshot' bin/cache/flutter_tools.snapshot

      # Some of flutter_tools's dependencies contain static assets. The
      # application attempts to read its own package_config.json to find these
      # assets at runtime.
      # TODO: Remove this once Flutter 3.24 is the lowest version in Nixpkgs.
      # https://github.com/flutter/flutter/pull/150340 makes it redundant.
      mkdir -p packages/flutter_tools/.dart_tool
      ln -s '${flutterTools.pubcache}/package_config.json' packages/flutter_tools/.dart_tool/package_config.json

      echo -n "${version}" > version
      cat <<EOF > bin/cache/flutter.version.json
      {
+1 −1
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ let
                buildPlatform = lib.systems.elaborate buildPlatform;
                flutterVersion = version;
                version = engineVersion;
                url = "https://github.com/flutter/engine.git@${engineVersion}";
                url = "https://github.com/flutter/flutter.git@${engineVersion}";
                hashes."${buildPlatform}"."${targetPlatform}" = lib.fakeSha256;
              })
            systemPlatforms)
Loading