---
source: src/patch/parse.rs
expression: patches
input_file: src/patch/test-data/0003-cross-install.cmake.patch
---
Ok(
    [
        Patch {
            original: Some(
                Filename(
                    "cmake/install.cmake",
                ),
            ),
            modified: Some(
                Filename(
                    "cmake/install.cmake",
                ),
            ),
            hunks: [
                Hunk {
                    old_range: HunkRange {
                        start: 2,
                        len: 3,
                    },
                    new_range: HunkRange {
                        start: 2,
                        len: 3,
                    },
                    function_context: None,
                    lines: [
                        Context(
                            "execute_process(\n",
                        ),
                        Delete(
                            "  COMMAND \"${ZIG_EXECUTABLE}\" ${ZIG_INSTALL_ARGS}\n",
                        ),
                        Insert(
                            "  COMMAND ${CROSSCOMPILING_EMULATOR} \"${ZIG_EXECUTABLE}\" ${ZIG_INSTALL_ARGS}\n",
                        ),
                        Context(
                            "  WORKING_DIRECTORY \"${ZIG2_WORKING_DIR}\"\n",
                        ),
                    ],
                },
                Hunk {
                    old_range: HunkRange {
                        start: 13,
                        len: 5,
                    },
                    new_range: HunkRange {
                        start: 13,
                        len: 5,
                    },
                    function_context: None,
                    lines: [
                        Context(
                            "    message(\"::\")\n",
                        ),
                        Delete(
                            "    message(\":: argv: ${ZIG_EXECUTABLE} ${s_INSTALL_LIBSTAGE2_ARGS}\")\n",
                        ),
                        Insert(
                            "    message(\":: argv: ${CROSSCOMPILING_EMULATOR} ${ZIG_EXECUTABLE} ${s_INSTALL_LIBSTAGE2_ARGS}\")\n",
                        ),
                        Context(
                            "\n",
                        ),
                        Delete(
                            "    set(_args ${ZIG_EXECUTABLE} ${ZIG_INSTALL_ARGS})\n",
                        ),
                        Insert(
                            "    set(_args ${CROSSCOMPILING_EMULATOR} ${ZIG_EXECUTABLE} ${ZIG_INSTALL_ARGS})\n",
                        ),
                        Context(
                            "    list(LENGTH _args _len)\n",
                        ),
                    ],
                },
            ],
        },
    ],
)
