{"action":"created","issue":{"url":"https://api.github.com/repos/sparklemotion/nokogiri/issues/1369","labels_url":"https://api.github.com/repos/sparklemotion/nokogiri/issues/1369/labels{/name}","comments_url":"https://api.github.com/repos/sparklemotion/nokogiri/issues/1369/comments","events_url":"https://api.github.com/repos/sparklemotion/nokogiri/issues/1369/events","html_url":"https://github.com/sparklemotion/nokogiri/pull/1369","id":114513480,"number":1369,"title":"listen to --with-iconv-dir=<path> on OS X","user":{"login":"kiwiroy","id":313562,"avatar_url":"https://avatars.githubusercontent.com/u/313562?v=3","gravatar_id":"","url":"https://api.github.com/users/kiwiroy","html_url":"https://github.com/kiwiroy","followers_url":"https://api.github.com/users/kiwiroy/followers","following_url":"https://api.github.com/users/kiwiroy/following{/other_user}","gists_url":"https://api.github.com/users/kiwiroy/gists{/gist_id}","starred_url":"https://api.github.com/users/kiwiroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiwiroy/subscriptions","organizations_url":"https://api.github.com/users/kiwiroy/orgs","repos_url":"https://api.github.com/users/kiwiroy/repos","events_url":"https://api.github.com/users/kiwiroy/events{/privacy}","received_events_url":"https://api.github.com/users/kiwiroy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-02T02:39:33Z","updated_at":"2015-11-03T19:13:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/sparklemotion/nokogiri/pulls/1369","html_url":"https://github.com/sparklemotion/nokogiri/pull/1369","diff_url":"https://github.com/sparklemotion/nokogiri/pull/1369.diff","patch_url":"https://github.com/sparklemotion/nokogiri/pull/1369.patch"},"body":"## About\r\n\r\nAmong the issues touched by this are #972, #1119, #1231 and #1345 - not claiming they are fixed...\r\n\r\n## Environment\r\nHere's where I started debugging/installing and prepared this contribution from.\r\n\r\nOS X:\r\n```\r\n% sw_vers\r\nProductName:       Mac OS X\r\nProductVersion: 10.10.5\r\nBuildVersion:   14F27\r\n```\r\n\r\nXcode:\r\n```\r\n% xcodebuild -version\r\nXcode 7.1\r\nBuild version 7B91b\r\n% xcode-select -v\r\nxcode-select version 2339.\r\n```\r\n\r\nMacports:\r\nSpot that I started on the non-universal variants.\r\n```\r\n% port version\r\nVersion: 2.3.4\r\n% port installed zlib lzma libiconv\r\nThe following ports are currently installed:\r\n  libiconv @1.14_0\r\n  libiconv @1.14_0+universal (active)\r\n  lzma @4.65_0+universal (active)\r\n  zlib @1.2.8_0\r\n  zlib @1.2.8_0+universal (active)\r\n```\r\n\r\n## Install guide\r\n@flavorjones you [asked](https://github.com/sparklemotion/nokogiri/issues/1119#issuecomment-68426814) for additions to OS X install guide.\r\n\r\n`export ARCHFLAGS=\"-arch x86_64\"` as diagnosed by @oliver-whiteman can help with:\r\n\r\n```\r\nUndefined symbols for architecture i386:\r\n  \"_crc32\", referenced from:\r\n      _xmlCreateZMemBuff in libxml2.a(xmlIO.o)\r\n      _xmlZMemBuffAppend in libxml2.a(xmlIO.o)\r\n<snip>\r\n```\r\nA better solution is to install the `universal` variants\r\n```bash\r\nsudo port install zlib +universal\r\nsudo port install libiconv +universal\r\nsudo port install lzma +universal\r\n```\r\nSadly, this isn't the whole story as @oliver-whiteman found.\r\n```\r\nchecking for main() in -llzma... yes\r\nchecking for xmlParseDoc() in libxml/parser.h... no\r\nchecking for xmlParseDoc() in -lxml2... no\r\nchecking for xmlParseDoc() in -llibxml2... no\r\n-----\r\nlibxml2 is missing.  Please locate mkmf.log to investigate how it is failing.\r\n```\r\nAs @rsanchezsaez mentioned this will affect **all** users of Macports with `zlib` and `libiconv` ports installed, where they are not the **universal** variants. The option of moving `/opt/local` sideways did not fill me with joy and `mkmf.log` shows this inability to find `iconv_open` and hence this PR.\r\n\r\n### merge\r\nSo if this is merged the guide should reflect the requirement of:\r\n\r\n```bash\r\nsudo port install zlib +universal\r\nsudo port install libiconv +universal\r\nsudo port install lzma +universal\r\nbundle config build.nokogiri --with-xml2-include=/opt/local/include/libxml2 --with-xml2-lib=/opt/local/lib --with-xslt-dir=/opt/local --with-iconv-dir=/opt/local\r\n```\r\n\r\n**or**\r\n\r\nAs has been pointed out, installation of `libxml2` and `libxslt` macports/brew and the use the `--use-system-libraries` or `NOKOGIRI_USE_SYSTEM_LIBRARIES=1`\r\n\r\nMaking note that the **universal** variants are installed.\r\n```bash\r\nsudo port install libxml2 +universal\r\nsudo port install libxslt +universal\r\nbundle config build.nokogiri --use-system-libraries --with-xml2-config=/opt/local/bin/xml2-config --with-xslt-config=/opt/local/bin/xslt-config\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/sparklemotion/nokogiri/issues/comments/153458062","html_url":"https://github.com/sparklemotion/nokogiri/pull/1369#issuecomment-153458062","issue_url":"https://api.github.com/repos/sparklemotion/nokogiri/issues/1369","id":153458062,"user":{"login":"kiwiroy","id":313562,"avatar_url":"https://avatars.githubusercontent.com/u/313562?v=3","gravatar_id":"","url":"https://api.github.com/users/kiwiroy","html_url":"https://github.com/kiwiroy","followers_url":"https://api.github.com/users/kiwiroy/followers","following_url":"https://api.github.com/users/kiwiroy/following{/other_user}","gists_url":"https://api.github.com/users/kiwiroy/gists{/gist_id}","starred_url":"https://api.github.com/users/kiwiroy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kiwiroy/subscriptions","organizations_url":"https://api.github.com/users/kiwiroy/orgs","repos_url":"https://api.github.com/users/kiwiroy/repos","events_url":"https://api.github.com/users/kiwiroy/events{/privacy}","received_events_url":"https://api.github.com/users/kiwiroy/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T19:13:42Z","updated_at":"2015-11-03T19:13:42Z","body":"The consequence of 36f1c82 is that OS X installs will still be in the same state for older rubies - though I have no knowledge of which was distributed in each version of OS X."}}