Node.js 损坏的修补程序错误nodejs

Node.js 损坏的修补程序错误nodejs,node.js,git,compilation,cross-compiling,patch,Node.js,Git,Compilation,Cross Compiling,Patch,我尝试为armv7编译nodejs,在执行~/cross-compiler-shell.sh和./configure&&make安装之前,我必须修补此脚本,但git apply wscript返回错误 致命:第49行的修补程序已损坏 这是我的补丁: --- a/deps/libev/wscript +++ b/deps/libev/wscript @@ -41,6 +41,7 @@ def configure(conf): conf.check_cc(header_name="sys/even

我尝试为armv7编译nodejs,在执行~/cross-compiler-shell.sh和./configure&&make安装之前,我必须修补此脚本,但git apply wscript返回错误

致命:第49行的修补程序已损坏

这是我的补丁:

--- a/deps/libev/wscript
+++ b/deps/libev/wscript
@@ -41,6 +41,7 @@ def configure(conf):
 conf.check_cc(header_name="sys/eventfd.h", function_name="eventfd")


+  ''' Can't run cross-binary code
code = """
   #include <syscall.h>
   #include <time.h>
@@ -54,6 +55,8 @@ def configure(conf):
"""
conf.check_cc(fragment=code, define_name="HAVE_CLOCK_SYSCALL", execute=True,
             msg="Checking for SYS_clock_gettime")
+  '''
+  conf.define('HAVE_CLOCK_SYSCALL', 1)

have_librt = conf.check(lib='rt', uselib_store='RT')
if have_librt:


vim wscript

--- a/wscript
+++ b/wscript
@@ -319,11 +319,15 @@ def v8_cmd(bld, variant):
if bld.env['DEST_CPU'] == 'x86_64':
 arch = "arch=x64"

+ cross_arch = False
+ # TODO would use -1 != str.find('linux-gnueabi'), but this is sometimes a string and other times an array
+ # if bld.env['AR'] == 'arm-angstrom-linux-gnueabi-ar':
+ #   arch = "arch=arm"
+ #   cross_arch = True
+ # 
+ arch = "arch=arm"
+ cross_arch = True

if variant == "default":
 mode = "release"
else:
 mode = "debug"

+  snapshot = 'snapshot=on'
+  if cross_arch:
+    snapshot = ''
-  cmd_R = 'python "%s" -j %d -C "%s" -Y "%s" visibility=default mode=%s %s library=static snapshot=on'
+  cmd_R = 'python "%s" -j %d -C "%s" -Y "%s" visibility=default mode=%s %s library=static ' + snapshot
我试着在末尾加一个空行,但错误仍然存在


感谢您的帮助

您的修补程序元数据不正确,因为您可能手动损坏了修补程序。@@@-319,11+319,15@@def v8_cmdbld,variant:实际上应该是@-319,10+319,20@@def v8_cmdbld,variant:。

这是完整的修补程序文件吗?它甚至没有51行,我输入了错误的号码,它是49行,我已经更正了Edit也没有49行,但只有48行确定,gedit说我也有48行,但git apply命令在第49行返回了错误,gedit没有在末尾向我显示空行,但emacs很好,因此我删除了结尾处的空行,错误现在显示在第48行谢谢,错误消除,但我这样做是因为我们告诉我,这可能是另一个问题的原因,但它仍然在这里,当我在make之前为configure nodejs启动“/configure”命令时,我在这个脚本的第3行遇到了syntaxerror,原因是@@对不起,那个英语太糟糕了,我不知道你们在说什么。但在我看来,这是一个不同的问题,因为这是关于应用损坏的补丁文件。