mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-11-07 18:57:20 +00:00
Apply platform patches before planning source repository packages
This commit is contained in:
2 files changed
+46
-25
No files matched your search
@@ -0,0 +1,24 @@
|
||||
{ pkgs, cabalProject, sha256map, patchesByUrl }:
|
||||
let
|
||||
parsed = pkgs.haskell-nix.haskellLib.parseSourceRepositoryPackages
|
||||
"cabal.project" sha256map {} cabalProject;
|
||||
repos = map (block: block.sourceRepo)
|
||||
(builtins.filter (block: block ? sourceRepo) parsed.sourceRepos);
|
||||
patchedSource = url: patches:
|
||||
let
|
||||
matches = builtins.filter (repo: repo.url == url) repos;
|
||||
repo = assert pkgs.lib.assertMsg (builtins.length matches == 1)
|
||||
"Expected exactly one pinned source repository for ${url}";
|
||||
builtins.head matches;
|
||||
rev = repo.rev or repo.ref;
|
||||
in {
|
||||
name = "${url}/${rev}";
|
||||
value = pkgs.applyPatches {
|
||||
src = pkgs.fetchgit {
|
||||
inherit (repo) url sha256;
|
||||
inherit rev;
|
||||
};
|
||||
inherit patches;
|
||||
};
|
||||
};
|
||||
in builtins.listToAttrs (pkgs.lib.mapAttrsToList patchedSource patchesByUrl)
|
||||
Reference in new issue
Block a user