Skip to content

Commit

Permalink
fix: remove package.from (#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
milahu committed Sep 2, 2021
1 parent 56dee67 commit d0c89d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal.nix
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ rec {
let
isBundled = spec ? bundled && spec.bundled == true;
hasGitHubRequires = spec: (spec ? requires) && (lib.any (x: lib.hasPrefix "github:" x) (lib.attrValues spec.requires));
patchFrom = builtins.removeAttrs spec [ "from" ]; # NOTE we must either remove package.from, or replace it with a file://....tar.gz link
patchSource = lib.optionalAttrs (!isBundled) (makeSource sourceHashFunc name spec);
patchRequiresSources = lib.optionalAttrs (hasGitHubRequires spec) { requires = (patchRequires sourceHashFunc versionOfRequireSet name spec.requires); };
patchDependenciesSources = lib.optionalAttrs (spec ? dependencies) { dependencies = lib.mapAttrs (patchDependency sourceHashFunc versionOfRequireSet) spec.dependencies; };
Expand All @@ -204,7 +205,7 @@ rec {
# - `resolved` set to a path in the nix store (`patchSource`)
# - All `requires` entries of this dependency that are set to github URLs set to a path in the nix store (`patchRequiresSources`)
# - This needs to be done recursively for all `dependencies` in the lockfile (`patchDependenciesSources`)
(spec // patchSource // patchRequiresSources // patchDependenciesSources);
(patchFrom // patchSource // patchRequiresSources // patchDependenciesSources);

# Description: Takes a Path to a lockfile and returns the patched version as attribute set
# Type: Fn -> Path -> Set
Expand Down

0 comments on commit d0c89d1

Please sign in to comment.