about summary refs log tree commit diff
path: root/pkgs/build-support
diff options
context:
space:
mode:
authorhacker1024 <hacker1024@users.sourceforge.net>2023-10-29 01:23:47 +1100
committerFlafyDev <flafyarazi@gmail.com>2023-12-26 18:48:12 +0200
commit23952fb64184b44d1c884dd592b6a19381413bf2 (patch)
treef439b5eb622a8fc22bbf4ac85c127763750f19ee /pkgs/build-support
parent2bd3e5d779f31c751cf2f23e98fc4dbe74f4328c (diff)
downloadnixlib-23952fb64184b44d1c884dd592b6a19381413bf2.tar
nixlib-23952fb64184b44d1c884dd592b6a19381413bf2.tar.gz
nixlib-23952fb64184b44d1c884dd592b6a19381413bf2.tar.bz2
nixlib-23952fb64184b44d1c884dd592b6a19381413bf2.tar.lz
nixlib-23952fb64184b44d1c884dd592b6a19381413bf2.tar.xz
nixlib-23952fb64184b44d1c884dd592b6a19381413bf2.tar.zst
nixlib-23952fb64184b44d1c884dd592b6a19381413bf2.zip
buildDartApplication: Remove depsListFile
We get a dependency list with pub2nix now. We can no longer easily distinguish between development dependency dependencies and regular dependency dependencies, but we weren't doing this anyway.
Diffstat (limited to 'pkgs/build-support')
-rw-r--r--pkgs/build-support/dart/build-dart-application/default.nix23
-rw-r--r--pkgs/build-support/dart/build-dart-application/generators.nix27
-rw-r--r--pkgs/build-support/dart/build-dart-application/hooks/dart-config-hook.sh3
3 files changed, 1 insertions, 52 deletions
diff --git a/pkgs/build-support/dart/build-dart-application/default.nix b/pkgs/build-support/dart/build-dart-application/default.nix
index ccecbe6fd3e8..c4cc3fe8ed0f 100644
--- a/pkgs/build-support/dart/build-dart-application/default.nix
+++ b/pkgs/build-support/dart/build-dart-application/default.nix
@@ -44,8 +44,6 @@
 
 , runtimeDependencies ? [ ]
 , extraWrapProgramArgs ? ""
-, autoDepsList ? false
-, depsListFile ? null
 , pubspecLock
 , ...
 }@args:
@@ -53,15 +51,6 @@
 let
   generators = callPackage ./generators.nix { inherit dart; } { buildDrvArgs = args; };
 
-  generatedDepsList = generators.mkDepsList { inherit pubspecLockFile pubspecLockData packageConfig; };
-
-  depsList =
-    if autoDepsList
-    then lib.importJSON generatedDepsList
-    else if depsListFile == null
-    then null
-    else lib.importJSON depsListFile;
-
   pubspecLockFile = builtins.toJSON pubspecLock;
   pubspecLockData = pub2nix.readPubspecLock { inherit src packageRoot pubspecLock gitHashes sdkSourceBuilders; };
   packageConfig = generators.linkPackageConfig {
@@ -117,17 +106,6 @@ let
       ln -sf "$pubspecLockFilePath" pubspec.lock
     '';
 
-    preBuild = args.preBuild or "" + lib.optionalString (!autoDepsList) ''
-      if ! { [ '${lib.boolToString (depsListFile != null)}' = 'true' ] ${lib.optionalString (depsListFile != null) "&& cmp -s <(jq -Sc . '${depsListFile}') <(jq -Sc . deps.json)"}; }; then
-        echo 1>&2 -e '\nThe dependency list file was either not given or differs from the expected result.' \
-                     '\nPlease choose one of the following solutions:' \
-                     '\n - Duplicate the following file and pass it to the depsListFile argument.' \
-                     '\n   ${generatedDepsList}' \
-                     '\n - Set autoDepsList to true (not supported by Hydra or permitted in Nixpkgs)'.
-        exit 1
-      fi
-    '';
-
     # When stripping, it seems some ELF information is lost and the dart VM cli
     # runs instead of the expected program. Don't strip if it's an exe output.
     dontStrip = args.dontStrip or (dartOutputType == "exe");
@@ -136,7 +114,6 @@ let
 
     passthru = {
       pubspecLock = pubspecLockData;
-      depsList = generatedDepsList;
       generatePubspecLock = generators.generatePubspecLock { inherit pubGetScript; };
     } // (args.passthru or { });
 
diff --git a/pkgs/build-support/dart/build-dart-application/generators.nix b/pkgs/build-support/dart/build-dart-application/generators.nix
index 6af9a66b2f7f..91b92af9f980 100644
--- a/pkgs/build-support/dart/build-dart-application/generators.nix
+++ b/pkgs/build-support/dart/build-dart-application/generators.nix
@@ -67,33 +67,8 @@ let
       runHook postInstall
     '';
   });
-
-  mkDepsDrv = { pubspecLockFile, pubspecLockData, packageConfig }: args: stdenvNoCC.mkDerivation (drvArgs // args // {
-    inherit pubspecLockFile packageConfig;
-
-    nativeBuildInputs = drvArgs.nativeBuildInputs or [ ] ++ args.nativeBuildInputs or [ ] ++ [ dart dartHooks.dartConfigHook ];
-
-    preConfigure = drvArgs.preConfigure or "" + args.preConfigure or "" + ''
-      ln -sf "$pubspecLockFilePath" pubspec.lock
-    '';
-
-    passAsFile = drvArgs.passAsFile or [ ] ++ args.passAsFile or [ ] ++ [ "pubspecLockFile" ];
-  } // (removeAttrs buildDrvInheritArgs [ "name" "pname" ]));
-
-  mkDepsList = args: mkDepsDrv args {
-    name = "${name}-dart-deps-list.json";
-
-    dontBuild = true;
-
-    installPhase = ''
-      runHook preInstall
-      cp deps.json "$out"
-      runHook postInstall
-    '';
-  };
 in
 {
   inherit
-    linkPackageConfig
-    mkDepsList;
+    linkPackageConfig;
 }
diff --git a/pkgs/build-support/dart/build-dart-application/hooks/dart-config-hook.sh b/pkgs/build-support/dart/build-dart-application/hooks/dart-config-hook.sh
index dae74c3f77e6..50754a7b56d4 100644
--- a/pkgs/build-support/dart/build-dart-application/hooks/dart-config-hook.sh
+++ b/pkgs/build-support/dart/build-dart-application/hooks/dart-config-hook.sh
@@ -64,9 +64,6 @@ dartConfigHook() {
         packageRunCustom "$name" "$fileName" -- "$@"
     }
 
-    echo "Generating the dependency list"
-    dart pub deps --json | @jq@ .packages > deps.json
-
     echo "Finished dartConfigHook"
 }