Skip to content

Commit

Permalink
fix: stable patch fetch
Browse files Browse the repository at this point in the history
  • Loading branch information
attilaersek committed Oct 17, 2024
1 parent fa6bb0a commit 90fb87c
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,23 @@ let
EXTRA_LDFLAGS = pkgs.lib.optionalString pkgs.stdenv.isDarwin "-X github.com/nlewo/nix2container/nix.useNixCaseHack=true";
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.patchutils ];
preBuild = let
patch = pkgs.fetchurl {
# Needs to use fetchpatch2 to handle "git extended headers", which include
# lines with semantic content like "rename from" and "rename to".
# However, it also includes "index" lines which include the git revision(s) the patch was initially created from.
# These lines may include revisions of differing length, based on how Github generates them.
# fetchpatch2 does not filter out, but probably should
fetchgitpatch = args: pkgs.fetchpatch2 (args // {
postFetch = (args.postFetch or "") + ''
sed -i \
-e '/^index /d' \
-e '/^similarity index /d' \
-e '/^dissimilarity index /d' \
$out
'';
});
patch = fetchgitpatch {
url = "https://github.com/nlewo/image/commit/c2254c998433cf02af60bf0292042bd80b96a77e.patch";
sha256 = "sha256-1Tj9D+ePjGL5u04aT7zr5rJw4vHAVrXAsr4owdooC/Y=";

sha256 = "sha256-6CUjz46xD3ORgwrHwdIlSu6JUj7WLS6BOSyRGNnALHY=";
};
in ''
mkdir -p vendor/github.com/nlewo/nix2container/
Expand Down

0 comments on commit 90fb87c

Please sign in to comment.