{"action":"created","comment":{"url":"https://api.github.com/repos/G-Node/nixpy/pulls/comments/76830881","id":76830881,"diff_hunk":"@@ -0,0 +1,64 @@\n+import os, sys, shutil\n+\n+from textwrap import dedent\n+import tempfile\n+\n+import distutils.sysconfig\n+import distutils.ccompiler\n+from distutils.errors import CompileError, LinkError\n+\n+\n+def check_nix(libdirs=(), incdirs=()):\n+    \"\"\"\n+    Check if NIX is available by trying to compile a tiny program.\n+    \"\"\"\n+\n+    cpp_code = dedent(\"\"\"\n+    #include <nix.hpp>\n+\n+    int main() {\n+        return 0;\n+    }\n+    \"\"\")\n+\n+    tmpdir = tempfile.mkdtemp()\n+    bin_file_name = os.path.join(tmpdir, \"check_nix\")\n+    file_name = bin_file_name + '.cpp'\n+    with open(file_name, 'w') as cfile:\n+        cfile.write(cpp_code)\n+\n+    compiler = distutils.ccompiler.new_compiler()\n+    assert isinstance(compiler, distutils.ccompiler.CCompiler)\n+\n+    compiler.library_dirs.extend(libdirs)\n+    compiler.include_dirs.extend(incdirs)\n+    distutils.sysconfig.customize_compiler(compiler)\n+\n+    stderr = os.dup(sys.stderr.fileno())\n+    errfile = open(os.path.join(tmpdir, \"check_nix.err\"), 'w')\n+    # redirect stderr to file\n+    os.dup2(errfile.fileno(), sys.stderr.fileno())\n+    try:\n+        compiler.compile([file_name], output_dir=tmpdir,\n+                         extra_postargs=[\"--std=c++11\"])","path":"checknix.py","position":43,"original_position":43,"commit_id":"a148a251d8c3d5d4927cf07e768c1a6ef98f78fe","original_commit_id":"a148a251d8c3d5d4927cf07e768c1a6ef98f78fe","user":{"login":"gicmo","id":2040,"avatar_url":"https://avatars.githubusercontent.com/u/2040?v=3","gravatar_id":"","url":"https://api.github.com/users/gicmo","html_url":"https://github.com/gicmo","followers_url":"https://api.github.com/users/gicmo/followers","following_url":"https://api.github.com/users/gicmo/following{/other_user}","gists_url":"https://api.github.com/users/gicmo/gists{/gist_id}","starred_url":"https://api.github.com/users/gicmo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gicmo/subscriptions","organizations_url":"https://api.github.com/users/gicmo/orgs","repos_url":"https://api.github.com/users/gicmo/repos","events_url":"https://api.github.com/users/gicmo/events{/privacy}","received_events_url":"https://api.github.com/users/gicmo/received_events","type":"User","site_admin":false},"body":"NIX (headers) also depend on boost (headers) so if boost is installed in a non-standard location then nix will fail to build. Could work around that by also passing the boost incdirs. ","created_at":"2016-08-30T16:31:25Z","updated_at":"2016-08-30T16:31:25Z","html_url":"https://github.com/G-Node/nixpy/pull/206#discussion_r76830881","pull_request_url":"https://api.github.com/repos/G-Node/nixpy/pulls/206","_links":{"self":{"href":"https://api.github.com/repos/G-Node/nixpy/pulls/comments/76830881"},"html":{"href":"https://github.com/G-Node/nixpy/pull/206#discussion_r76830881"},"pull_request":{"href":"https://api.github.com/repos/G-Node/nixpy/pulls/206"}}},"pull_request":{"url":"https://api.github.com/repos/G-Node/nixpy/pulls/206","id":83278773,"html_url":"https://github.com/G-Node/nixpy/pull/206","diff_url":"https://github.com/G-Node/nixpy/pull/206.diff","patch_url":"https://github.com/G-Node/nixpy/pull/206.patch","issue_url":"https://api.github.com/repos/G-Node/nixpy/issues/206","number":206,"state":"open","locked":false,"title":"Python only builds","user":{"login":"achilleas-k","id":2369197,"avatar_url":"https://avatars.githubusercontent.com/u/2369197?v=3","gravatar_id":"","url":"https://api.github.com/users/achilleas-k","html_url":"https://github.com/achilleas-k","followers_url":"https://api.github.com/users/achilleas-k/followers","following_url":"https://api.github.com/users/achilleas-k/following{/other_user}","gists_url":"https://api.github.com/users/achilleas-k/gists{/gist_id}","starred_url":"https://api.github.com/users/achilleas-k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/achilleas-k/subscriptions","organizations_url":"https://api.github.com/users/achilleas-k/orgs","repos_url":"https://api.github.com/users/achilleas-k/repos","events_url":"https://api.github.com/users/achilleas-k/events{/privacy}","received_events_url":"https://api.github.com/users/achilleas-k/received_events","type":"User","site_admin":false},"body":"Setup script updated to support building without the NIX dependency.\r\n\r\nThe setup script detects if NIX is available by attempting to compile a dummy C++ file that simply imports `nix.hpp` and checking if it fails (see new file `checknix.py`).\r\n\r\nAdditionally, Python only builds can now be explicitly performed using `python setup.py build --pyonly`.\r\n\r\nTravis build config now includes 4 configurations: Python 2.7 and 3.4 with and without NIX.\r\n","created_at":"2016-08-30T14:11:29Z","updated_at":"2016-08-30T16:31:25Z","closed_at":null,"merged_at":null,"merge_commit_sha":"47645078807da4752636e5ab207e17427694729a","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/G-Node/nixpy/pulls/206/commits","review_comments_url":"https://api.github.com/repos/G-Node/nixpy/pulls/206/comments","review_comment_url":"https://api.github.com/repos/G-Node/nixpy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/G-Node/nixpy/issues/206/comments","statuses_url":"https://api.github.com/repos/G-Node/nixpy/statuses/a148a251d8c3d5d4927cf07e768c1a6ef98f78fe","head":{"label":"achilleas-k:master","ref":"master","sha":"a148a251d8c3d5d4927cf07e768c1a6ef98f78fe","user":{"login":"achilleas-k","id":2369197,"avatar_url":"https://avatars.githubusercontent.com/u/2369197?v=3","gravatar_id":"","url":"https://api.github.com/users/achilleas-k","html_url":"https://github.com/achilleas-k","followers_url":"https://api.github.com/users/achilleas-k/followers","following_url":"https://api.github.com/users/achilleas-k/following{/other_user}","gists_url":"https://api.github.com/users/achilleas-k/gists{/gist_id}","starred_url":"https://api.github.com/users/achilleas-k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/achilleas-k/subscriptions","organizations_url":"https://api.github.com/users/achilleas-k/orgs","repos_url":"https://api.github.com/users/achilleas-k/repos","events_url":"https://api.github.com/users/achilleas-k/events{/privacy}","received_events_url":"https://api.github.com/users/achilleas-k/received_events","type":"User","site_admin":false},"repo":{"id":56339168,"name":"nixpy","full_name":"achilleas-k/nixpy","owner":{"login":"achilleas-k","id":2369197,"avatar_url":"https://avatars.githubusercontent.com/u/2369197?v=3","gravatar_id":"","url":"https://api.github.com/users/achilleas-k","html_url":"https://github.com/achilleas-k","followers_url":"https://api.github.com/users/achilleas-k/followers","following_url":"https://api.github.com/users/achilleas-k/following{/other_user}","gists_url":"https://api.github.com/users/achilleas-k/gists{/gist_id}","starred_url":"https://api.github.com/users/achilleas-k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/achilleas-k/subscriptions","organizations_url":"https://api.github.com/users/achilleas-k/orgs","repos_url":"https://api.github.com/users/achilleas-k/repos","events_url":"https://api.github.com/users/achilleas-k/events{/privacy}","received_events_url":"https://api.github.com/users/achilleas-k/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/achilleas-k/nixpy","description":"Python bindings for NIX","fork":true,"url":"https://api.github.com/repos/achilleas-k/nixpy","forks_url":"https://api.github.com/repos/achilleas-k/nixpy/forks","keys_url":"https://api.github.com/repos/achilleas-k/nixpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/achilleas-k/nixpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/achilleas-k/nixpy/teams","hooks_url":"https://api.github.com/repos/achilleas-k/nixpy/hooks","issue_events_url":"https://api.github.com/repos/achilleas-k/nixpy/issues/events{/number}","events_url":"https://api.github.com/repos/achilleas-k/nixpy/events","assignees_url":"https://api.github.com/repos/achilleas-k/nixpy/assignees{/user}","branches_url":"https://api.github.com/repos/achilleas-k/nixpy/branches{/branch}","tags_url":"https://api.github.com/repos/achilleas-k/nixpy/tags","blobs_url":"https://api.github.com/repos/achilleas-k/nixpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/achilleas-k/nixpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/achilleas-k/nixpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/achilleas-k/nixpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/achilleas-k/nixpy/statuses/{sha}","languages_url":"https://api.github.com/repos/achilleas-k/nixpy/languages","stargazers_url":"https://api.github.com/repos/achilleas-k/nixpy/stargazers","contributors_url":"https://api.github.com/repos/achilleas-k/nixpy/contributors","subscribers_url":"https://api.github.com/repos/achilleas-k/nixpy/subscribers","subscription_url":"https://api.github.com/repos/achilleas-k/nixpy/subscription","commits_url":"https://api.github.com/repos/achilleas-k/nixpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/achilleas-k/nixpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/achilleas-k/nixpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/achilleas-k/nixpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/achilleas-k/nixpy/contents/{+path}","compare_url":"https://api.github.com/repos/achilleas-k/nixpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/achilleas-k/nixpy/merges","archive_url":"https://api.github.com/repos/achilleas-k/nixpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/achilleas-k/nixpy/downloads","issues_url":"https://api.github.com/repos/achilleas-k/nixpy/issues{/number}","pulls_url":"https://api.github.com/repos/achilleas-k/nixpy/pulls{/number}","milestones_url":"https://api.github.com/repos/achilleas-k/nixpy/milestones{/number}","notifications_url":"https://api.github.com/repos/achilleas-k/nixpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/achilleas-k/nixpy/labels{/name}","releases_url":"https://api.github.com/repos/achilleas-k/nixpy/releases{/id}","deployments_url":"https://api.github.com/repos/achilleas-k/nixpy/deployments","created_at":"2016-04-15T17:46:50Z","updated_at":"2016-04-15T17:46:51Z","pushed_at":"2016-08-30T15:47:08Z","git_url":"git://github.com/achilleas-k/nixpy.git","ssh_url":"git@github.com:achilleas-k/nixpy.git","clone_url":"https://github.com/achilleas-k/nixpy.git","svn_url":"https://github.com/achilleas-k/nixpy","homepage":"","size":3137,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"G-Node:master","ref":"master","sha":"3e66ac8c74f240b64a7acc6e8fe10898a85803d0","user":{"login":"G-Node","id":574778,"avatar_url":"https://avatars.githubusercontent.com/u/574778?v=3","gravatar_id":"","url":"https://api.github.com/users/G-Node","html_url":"https://github.com/G-Node","followers_url":"https://api.github.com/users/G-Node/followers","following_url":"https://api.github.com/users/G-Node/following{/other_user}","gists_url":"https://api.github.com/users/G-Node/gists{/gist_id}","starred_url":"https://api.github.com/users/G-Node/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/G-Node/subscriptions","organizations_url":"https://api.github.com/users/G-Node/orgs","repos_url":"https://api.github.com/users/G-Node/repos","events_url":"https://api.github.com/users/G-Node/events{/privacy}","received_events_url":"https://api.github.com/users/G-Node/received_events","type":"Organization","site_admin":false},"repo":{"id":20493628,"name":"nixpy","full_name":"G-Node/nixpy","owner":{"login":"G-Node","id":574778,"avatar_url":"https://avatars.githubusercontent.com/u/574778?v=3","gravatar_id":"","url":"https://api.github.com/users/G-Node","html_url":"https://github.com/G-Node","followers_url":"https://api.github.com/users/G-Node/followers","following_url":"https://api.github.com/users/G-Node/following{/other_user}","gists_url":"https://api.github.com/users/G-Node/gists{/gist_id}","starred_url":"https://api.github.com/users/G-Node/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/G-Node/subscriptions","organizations_url":"https://api.github.com/users/G-Node/orgs","repos_url":"https://api.github.com/users/G-Node/repos","events_url":"https://api.github.com/users/G-Node/events{/privacy}","received_events_url":"https://api.github.com/users/G-Node/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/G-Node/nixpy","description":"Python bindings for NIX","fork":false,"url":"https://api.github.com/repos/G-Node/nixpy","forks_url":"https://api.github.com/repos/G-Node/nixpy/forks","keys_url":"https://api.github.com/repos/G-Node/nixpy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/G-Node/nixpy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/G-Node/nixpy/teams","hooks_url":"https://api.github.com/repos/G-Node/nixpy/hooks","issue_events_url":"https://api.github.com/repos/G-Node/nixpy/issues/events{/number}","events_url":"https://api.github.com/repos/G-Node/nixpy/events","assignees_url":"https://api.github.com/repos/G-Node/nixpy/assignees{/user}","branches_url":"https://api.github.com/repos/G-Node/nixpy/branches{/branch}","tags_url":"https://api.github.com/repos/G-Node/nixpy/tags","blobs_url":"https://api.github.com/repos/G-Node/nixpy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/G-Node/nixpy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/G-Node/nixpy/git/refs{/sha}","trees_url":"https://api.github.com/repos/G-Node/nixpy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/G-Node/nixpy/statuses/{sha}","languages_url":"https://api.github.com/repos/G-Node/nixpy/languages","stargazers_url":"https://api.github.com/repos/G-Node/nixpy/stargazers","contributors_url":"https://api.github.com/repos/G-Node/nixpy/contributors","subscribers_url":"https://api.github.com/repos/G-Node/nixpy/subscribers","subscription_url":"https://api.github.com/repos/G-Node/nixpy/subscription","commits_url":"https://api.github.com/repos/G-Node/nixpy/commits{/sha}","git_commits_url":"https://api.github.com/repos/G-Node/nixpy/git/commits{/sha}","comments_url":"https://api.github.com/repos/G-Node/nixpy/comments{/number}","issue_comment_url":"https://api.github.com/repos/G-Node/nixpy/issues/comments{/number}","contents_url":"https://api.github.com/repos/G-Node/nixpy/contents/{+path}","compare_url":"https://api.github.com/repos/G-Node/nixpy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/G-Node/nixpy/merges","archive_url":"https://api.github.com/repos/G-Node/nixpy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/G-Node/nixpy/downloads","issues_url":"https://api.github.com/repos/G-Node/nixpy/issues{/number}","pulls_url":"https://api.github.com/repos/G-Node/nixpy/pulls{/number}","milestones_url":"https://api.github.com/repos/G-Node/nixpy/milestones{/number}","notifications_url":"https://api.github.com/repos/G-Node/nixpy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/G-Node/nixpy/labels{/name}","releases_url":"https://api.github.com/repos/G-Node/nixpy/releases{/id}","deployments_url":"https://api.github.com/repos/G-Node/nixpy/deployments","created_at":"2014-06-04T17:50:22Z","updated_at":"2016-03-30T11:28:09Z","pushed_at":"2016-08-30T15:47:08Z","git_url":"git://github.com/G-Node/nixpy.git","ssh_url":"git@github.com:G-Node/nixpy.git","clone_url":"https://github.com/G-Node/nixpy.git","svn_url":"https://github.com/G-Node/nixpy","homepage":"","size":3096,"stargazers_count":5,"watchers_count":5,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":14,"mirror_url":null,"open_issues_count":24,"forks":14,"open_issues":24,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/G-Node/nixpy/pulls/206"},"html":{"href":"https://github.com/G-Node/nixpy/pull/206"},"issue":{"href":"https://api.github.com/repos/G-Node/nixpy/issues/206"},"comments":{"href":"https://api.github.com/repos/G-Node/nixpy/issues/206/comments"},"review_comments":{"href":"https://api.github.com/repos/G-Node/nixpy/pulls/206/comments"},"review_comment":{"href":"https://api.github.com/repos/G-Node/nixpy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/G-Node/nixpy/pulls/206/commits"},"statuses":{"href":"https://api.github.com/repos/G-Node/nixpy/statuses/a148a251d8c3d5d4927cf07e768c1a6ef98f78fe"}}}}
{"actor":{"display_login":"gicmo"}}