Fail to install git from macports ("can't find file to patch" error)

2018-02-19 Thread Qianqian Fang

hi everyone,

I don't know what was changed recently, the built-in git command from 
Xcode stopped working with the following error


   *|fangq@jinwy:~/space/git/Project/autobuild/mcx$ git pull|*|
   ||dyld: lazy symbol binding failed: Symbol not found: _iconv_open||
   ||  Referenced from:
   /Library/Developer/CommandLineTools/usr/libexec/git-core/git||
   ||  Expected in: /opt/local/lib/libiconv.2.dylib||
   ||
   ||dyld: Symbol not found: _iconv_open||
   ||  Referenced from:
   /Library/Developer/CommandLineTools/usr/libexec/git-core/git||
   ||  Expected in: /opt/local/lib/libiconv.2.dylib||
   ||
   ||error: fetch died of signal 6|

I can only fix this if I put /usr/lib in the front of DYLD_LIBRARY_PATH, 
but this breaks tons of other command. So, I decided to install a git 
from macports, however, this attempt failed with the following error:


   *|fangq@jinwy:~/space/git/Project/autobuild/mcx$ sudo port install
   git|*|
   ||Warning: xcodebuild exists but failed to execute||
   ||Warning: Xcode does not appear to be installed; most ports will
   likely fail to build.||
   ||--->  Computing dependencies for git||
   ||--->  Applying patches to git||
   ||Error: Failed to patch git: command execution failed||
   ||Error: See
   
/opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git/git/main.log
   for details.||
   ||Error: Follow https://guide.macports.org/#project.tickets to
   report a bug.||
   ||Error: Processing of port git failed|

look at the main.log file, I found the error message attached at the end.

My macport version is 2.4.2, OS is Sierra, already ran port selfupdate.

I have an old version of xcode (7.3) in order to compile cuda code, but 
I don't think it was the issue.


can someone let me know how to fix this? alternative approaches, such as 
portable git binaries are also welcome, thanks a lot!


Qianqian



|:debug:main Executing org.macports.main (git)|||
|||:debug:main dropping privileges: euid changed to 502, egid changed to 
505.|||

|||:debug:main Skipping completed org.macports.archivefetch (git)|||
|||:debug:main Privilege de-escalation not attempted as not running as 
root.|||

|||:debug:main Skipping completed org.macports.fetch (git)|||
|||:debug:main Privilege de-escalation not attempted as not running as 
root.|||

|||:debug:main Skipping completed org.macports.checksum (git)|||
|||:debug:main Privilege de-escalation not attempted as not running as 
root.|||

|||:debug:main Skipping completed org.macports.extract (git)|||
|||:debug:main Privilege de-escalation not attempted as not running as 
root.|||

|||:debug:patch patch phase started at Mon Feb 19 14:27:42 EST 2018|||
|||:debug:patch Executing org.macports.patch (git)|||
|||:notice:patch --->  Applying patches to git|||
|||:info:patch --->  Applying patch-Makefile.diff|||
|||:debug:patch Environment: |||
|||:debug:patch CC_PRINT_OPTIONS='YES'|||
|||:debug:patch 
CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git/git/work/.CC_PRINT_OPTIONS'|||

|||:debug:patch CPATH='/opt/local/include'|||
|||:debug:patch LIBRARY_PATH='/opt/local/lib'|||
|||:debug:patch MACOSX_DEPLOYMENT_TARGET='10.12'|||
|||:info:patch Executing:  cd 
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git/git/work/git-2.16.2" 
&& /usr/bin/patch -p1 < 
'/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/git/files/patch-Makefile.diff'|||
|||:debug:patch system:  cd 
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git/git/work/git-2.16.2" 
&& /usr/bin/patch -p1 < 
'/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/git/files/patch-Makefile.diff'|||

|||:info:patch can't find file to patch at input line 3|||
|||:info:patch Perhaps you used the wrong -p or --strip option?|||
|||:info:patch The text leading up to this was:|||
|||:info:patch --|||
|||:info:patch |--- a/Makefile.orig|||
|||:info:patch |+++ b/Makefile|||
|||:info:patch --|||
|||:info:patch File to patch: |||
|||:info:patch Skip this patch? [y] |||
|||:info:patch Skipping patch.|||
|||:info:patch 2 out of 2 hunks ignored|||
|||:info:patch Command failed:  cd 
"/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_git/git/work/git-2.16.2" 
&& /usr/bin/patch -p1 < 
'/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/git/files/patch-Makefile.diff'|||

|||:info:patch Exit code: 1|||
|||:error:patch Failed to patch git: command execution failed|||
|||:debug:patch Error code: CHILDSTATUS 81845 1|||
|||:debug:patch Backtrace: command execution failed|||
|||:debug:patch while executing|||
|||:debug:patch "system {*}$notty {*}$nice $fullcmd

fail to compile xz - unknown type name 'clockid_t'; did you mean 'clock_t'

2018-03-22 Thread Qianqian Fang

Dear list,

I don't know if this si common, but when I tried to install gdb (because 
my lazarus 1.8 complains about missing gdb) using


|sudo port install gdb|

I got an error when installing the dependency package xz, with the 
following error


my port was updated and has the latest version.

Please advise how to get around this. thanks

Qianqian


|:info:build In file included from common/common.c:13:||
||:info:build In file included from In file included from 
common/hardware_physmem.c:13:||
||:info:build In file included from In file included from 
common/block_util.c:13:||
||:info:build In file included from 
../../src/liblzma/common/common.h:17../../src/liblzma/common/common.hIn 
file included from 
:common/filter_common.c../../src/liblzma/common/common.h:||

||:info:build :1717../../src/common/mythread.h:||
||:info:build ::||
||:info:build 
../../src/common/mythread.h:13../../src/common/mythread.h:120:120::||
||:info:build 2::2In file included from In file included from 
120../../src/liblzma/common/filter_common.h::162:||
||:info:build In file included from :../../src/liblzma/common/common.h 
error:common/index.c :error17: :||
||:info:build :||*13unknown type name 'clockid_t'; did you mean 
'clock_t'?:*||
||:info:build errorIn file included from : : 
common/easy_preset.c:13unknown type name 'clockid_t'; did you mean 
'clock_t'?In file included from||
||:info:build ../../src/liblzma/common/index.hunknown type name 
'clockid_t'; did you mean 'clock_t'?:||

||:info:build 16:||
||:info:build In file included from :||
||:info:build In file included from 
../../src/common/mythread.h../../src/liblzma/common/easy_preset.h::12013::||
||:info:build 2In file included from :../../src/liblzma/common/common.h 
:error17: :||
||:info:build ../../src/common/mythread.h||*unknown type name 
'clockid_t'; did you mean 'clock_t'?:*||

||:info:build ../../src/liblzma/common/common.h:17:||
||:info:build clockid_t clk_id; clockid_t 
clk_id;../../src/common/mythread.h120:||

||:info:build 120:||
||...||
||:info:build In file included from common/easy_preset.c:13:||
||:info:build In file included from 
../../src/liblzma/common/easy_preset.h:13:||

||:info:build In file included from ../../src/liblzma/common/common.h:17:||
||:info:build ../../src/common/mythread.hIn file included from In file 
included from common/filter_common.c:13:In file included from 
common/hardware_physmem.c250::1319:||
||:info:build :In file included from 
../../src/liblzma/common/common.herror:||
||:info:build common/block_util.cIn file included from 
:../../src/liblzma/common/filter_common.h::17:||

||:info:build 13../../src/common/mythread.h:250:19: 16:||
||:info:build use of undeclared identifier 'CLOCK_REALTIME'||
||:info:build : ||*error: use of undeclared identifier 'CLOCK_REALTIME'*||
||:info:build In file included from :||
||:info:build common/index.c:In file included from 13:||
||:info:build ../../src/liblzma/common/common.hIn file included from 
:../../src/liblzma/common/index.h17::||
||:info:build 16../../src/common/mythread.h:250:19In file included 
from mycond->clk_id = CLOCK_REALTIME;||

||:info:build ../../src/liblzma/common/common.h ^:||
|