{"action":"created","comment":{"url":"https://api.github.com/repos/ngaut/rust-rocksdb/pulls/comments/71659749","id":71659749,"diff_hunk":"@@ -0,0 +1,106 @@\n+#!/usr/bin/env bash\n+\n+set -e\n+\n+function panic() {\n+    echo $@ >&2\n+    exit 1\n+}\n+\n+function download() {\n+    if which wget &>/dev/null; then\n+        wget $1 -O $2\n+    elif which curl &>/dev/null; then\n+        curl -L $1 -o $2\n+    else\n+        panic can\\'t find wget and curl.\n+    fi\n+\n+    if which md5sum &>/dev/null; then\n+        hash=`md5sum $2 | cut -d ' ' -f 1`\n+    elif which openssl &>/dev/null; then\n+        hash=`openssl md5 -hex $2 | cut -d ' ' -f 2`\n+    else\n+        panic can\\'t find hash tool.\n+    fi\n+\n+    [[ \"$hash\" == \"$3\" ]] || panic $2: hash not correct, expect $3, got $hash\n+}\n+\n+function compile_z() {\n+    if [[ -f libz.a ]]; then\n+        return\n+    fi\n+\n+    rm -rf zlib-1.2.8\n+    download http://zlib.net/zlib-1.2.8.tar.gz zlib-1.2.8.tar.gz 44d667c142d7cda120332623eab69f40\n+    tar xf zlib-1.2.8.tar.gz\n+    cd zlib-1.2.8\n+    CFLAGS='-fPIC' ./configure --static\n+    make\n+    cp libz.a ../\n+    cd ..\n+}\n+\n+function compile_bz2() {\n+    if [[ -f libbz2.a ]]; then\n+        return\n+    fi\n+\n+    rm -rf bzip2-1.0.6\n+    download http://www.bzip.org/1.0.6/bzip2-1.0.6.tar.gz bzip2-1.0.6.tar.gz 00b516f4704d4a7cb50a1d97e6e8e15b\n+    tar xvzf bzip2-1.0.6.tar.gz\n+    cd bzip2-1.0.6\n+    make CFLAGS='-fPIC -O2 -g -D_FILE_OFFSET_BITS=64'\n+    cp libbz2.a ../\n+    cd ..\n+}\n+\n+function compile_snappy() {\n+    if [[ -f libsnappy.a ]]; then\n+        return\n+    fi\n+\n+    rm -rf snappy-1.1.1\n+    download http://pkgs.fedoraproject.org/repo/pkgs/snappy/snappy-1.1.1.tar.gz/8887e3b7253b22a31f5486bca3cbc1c2/snappy-1.1.1.tar.gz snappy-1.1.1.tar.gz 8887e3b7253b22a31f5486bca3cbc1c2\n+    tar xvzf snappy-1.1.1.tar.gz\n+    cd snappy-1.1.1\n+    ./configure --with-pic --enable-static\n+    make\n+    mv .libs/libsnappy.a ../\n+    cd ..\n+}\n+\n+function compile_lz4() {\n+    if [[ -f liblz4.a ]]; then\n+        return\n+    fi\n+\n+    rm -rf lz4-r127\n+    download https://github.com/Cyan4973/lz4/archive/r131.tar.gz lz4-r131.tar.gz 42b09fab42331da9d3fb33bd5c560de9\n+    tar xvzf lz4-r131.tar.gz\n+    cd lz4-r131/lib\n+    make CFLAGS='-fPIC' all\n+    mv liblz4.a ../../\n+    cd ../..\n+}\n+\n+function compile_rocksdb() {\n+    if [[ -f librocksdb.a ]]; then\n+        return\n+    fi\n+\n+    echo building rocksdb\n+    rm -rf rocksdb-4.8\n+    download https://github.com/facebook/rocksdb/archive/v4.8.tar.gz rocksdb-4.8.tar.gz c7e1204cc6072d1a3e47817834b31c63\n+    tar xf rocksdb-4.8.tar.gz\n+    cd rocksdb-4.8\n+    EXTRA_CFLAGS=\"-fPIC -I./zlib-1.2.8 -I./bzip2-1.0.6 -I./snappy-1.1.1 -I./lz4-r127/lib\" EXTRA_CXXFLAGS=\"$EXTRA_CFLAGS\" PORTABLE=1 make static_lib","path":"librocksdb_sys/build.sh","position":98,"original_position":98,"commit_id":"fb333e68cff4c9d6b2d3a5a7a06e32a289f3916d","original_commit_id":"fb333e68cff4c9d6b2d3a5a7a06e32a289f3916d","user":{"login":"siddontang","id":1080370,"avatar_url":"https://avatars.githubusercontent.com/u/1080370?v=3","gravatar_id":"","url":"https://api.github.com/users/siddontang","html_url":"https://github.com/siddontang","followers_url":"https://api.github.com/users/siddontang/followers","following_url":"https://api.github.com/users/siddontang/following{/other_user}","gists_url":"https://api.github.com/users/siddontang/gists{/gist_id}","starred_url":"https://api.github.com/users/siddontang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siddontang/subscriptions","organizations_url":"https://api.github.com/users/siddontang/orgs","repos_url":"https://api.github.com/users/siddontang/repos","events_url":"https://api.github.com/users/siddontang/events{/privacy}","received_events_url":"https://api.github.com/users/siddontang/received_events","type":"User","site_admin":false},"body":"Native has better performance.\r\nIf two machines has different hardware, I think we may not run tikv too even using PORTABLE rocksdb. \r\n\r\n/cc @ngaut ","created_at":"2016-07-21T07:40:44Z","updated_at":"2016-07-21T07:40:44Z","html_url":"https://github.com/ngaut/rust-rocksdb/pull/26#discussion_r71659749","pull_request_url":"https://api.github.com/repos/ngaut/rust-rocksdb/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/ngaut/rust-rocksdb/pulls/comments/71659749"},"html":{"href":"https://github.com/ngaut/rust-rocksdb/pull/26#discussion_r71659749"},"pull_request":{"href":"https://api.github.com/repos/ngaut/rust-rocksdb/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/ngaut/rust-rocksdb/pulls/26","id":78122751,"html_url":"https://github.com/ngaut/rust-rocksdb/pull/26","diff_url":"https://github.com/ngaut/rust-rocksdb/pull/26.diff","patch_url":"https://github.com/ngaut/rust-rocksdb/pull/26.patch","issue_url":"https://api.github.com/repos/ngaut/rust-rocksdb/issues/26","number":26,"state":"open","locked":false,"title":"support static link","user":{"login":"BusyJay","id":1701473,"avatar_url":"https://avatars.githubusercontent.com/u/1701473?v=3","gravatar_id":"","url":"https://api.github.com/users/BusyJay","html_url":"https://github.com/BusyJay","followers_url":"https://api.github.com/users/BusyJay/followers","following_url":"https://api.github.com/users/BusyJay/following{/other_user}","gists_url":"https://api.github.com/users/BusyJay/gists{/gist_id}","starred_url":"https://api.github.com/users/BusyJay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BusyJay/subscriptions","organizations_url":"https://api.github.com/users/BusyJay/orgs","repos_url":"https://api.github.com/users/BusyJay/repos","events_url":"https://api.github.com/users/BusyJay/events{/privacy}","received_events_url":"https://api.github.com/users/BusyJay/received_events","type":"User","site_admin":false},"body":"@ngaut @siddontang @disksing @zhangjinpeng1987 PTAL","created_at":"2016-07-20T10:24:20Z","updated_at":"2016-07-21T07:40:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4a188172e6a51a3ec09004d2f85bd264fb04498c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ngaut/rust-rocksdb/pulls/26/commits","review_comments_url":"https://api.github.com/repos/ngaut/rust-rocksdb/pulls/26/comments","review_comment_url":"https://api.github.com/repos/ngaut/rust-rocksdb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ngaut/rust-rocksdb/issues/26/comments","statuses_url":"https://api.github.com/repos/ngaut/rust-rocksdb/statuses/fb333e68cff4c9d6b2d3a5a7a06e32a289f3916d","head":{"label":"BusyJay:busyjay/static-compile","ref":"busyjay/static-compile","sha":"fb333e68cff4c9d6b2d3a5a7a06e32a289f3916d","user":{"login":"BusyJay","id":1701473,"avatar_url":"https://avatars.githubusercontent.com/u/1701473?v=3","gravatar_id":"","url":"https://api.github.com/users/BusyJay","html_url":"https://github.com/BusyJay","followers_url":"https://api.github.com/users/BusyJay/followers","following_url":"https://api.github.com/users/BusyJay/following{/other_user}","gists_url":"https://api.github.com/users/BusyJay/gists{/gist_id}","starred_url":"https://api.github.com/users/BusyJay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BusyJay/subscriptions","organizations_url":"https://api.github.com/users/BusyJay/orgs","repos_url":"https://api.github.com/users/BusyJay/repos","events_url":"https://api.github.com/users/BusyJay/events{/privacy}","received_events_url":"https://api.github.com/users/BusyJay/received_events","type":"User","site_admin":false},"repo":{"id":53025495,"name":"rust-rocksdb","full_name":"BusyJay/rust-rocksdb","owner":{"login":"BusyJay","id":1701473,"avatar_url":"https://avatars.githubusercontent.com/u/1701473?v=3","gravatar_id":"","url":"https://api.github.com/users/BusyJay","html_url":"https://github.com/BusyJay","followers_url":"https://api.github.com/users/BusyJay/followers","following_url":"https://api.github.com/users/BusyJay/following{/other_user}","gists_url":"https://api.github.com/users/BusyJay/gists{/gist_id}","starred_url":"https://api.github.com/users/BusyJay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BusyJay/subscriptions","organizations_url":"https://api.github.com/users/BusyJay/orgs","repos_url":"https://api.github.com/users/BusyJay/repos","events_url":"https://api.github.com/users/BusyJay/events{/privacy}","received_events_url":"https://api.github.com/users/BusyJay/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/BusyJay/rust-rocksdb","description":"rust wrapper for rocksdb","fork":true,"url":"https://api.github.com/repos/BusyJay/rust-rocksdb","forks_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/forks","keys_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/teams","hooks_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/hooks","issue_events_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/issues/events{/number}","events_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/events","assignees_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/assignees{/user}","branches_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/branches{/branch}","tags_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/tags","blobs_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/statuses/{sha}","languages_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/languages","stargazers_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/stargazers","contributors_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/contributors","subscribers_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/subscribers","subscription_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/subscription","commits_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/contents/{+path}","compare_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/merges","archive_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/downloads","issues_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/issues{/number}","pulls_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/pulls{/number}","milestones_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/milestones{/number}","notifications_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/labels{/name}","releases_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/releases{/id}","deployments_url":"https://api.github.com/repos/BusyJay/rust-rocksdb/deployments","created_at":"2016-03-03T06:07:01Z","updated_at":"2016-03-03T06:07:02Z","pushed_at":"2016-07-21T04:23:08Z","git_url":"git://github.com/BusyJay/rust-rocksdb.git","ssh_url":"git@github.com:BusyJay/rust-rocksdb.git","clone_url":"https://github.com/BusyJay/rust-rocksdb.git","svn_url":"https://github.com/BusyJay/rust-rocksdb","homepage":null,"size":334,"stargazers_count":0,"watchers_count":0,"language":"Rust","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":"ngaut:master","ref":"master","sha":"ebf9de0fd3ae152623545ae45d8f2c2c87f10908","user":{"login":"ngaut","id":878009,"avatar_url":"https://avatars.githubusercontent.com/u/878009?v=3","gravatar_id":"","url":"https://api.github.com/users/ngaut","html_url":"https://github.com/ngaut","followers_url":"https://api.github.com/users/ngaut/followers","following_url":"https://api.github.com/users/ngaut/following{/other_user}","gists_url":"https://api.github.com/users/ngaut/gists{/gist_id}","starred_url":"https://api.github.com/users/ngaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngaut/subscriptions","organizations_url":"https://api.github.com/users/ngaut/orgs","repos_url":"https://api.github.com/users/ngaut/repos","events_url":"https://api.github.com/users/ngaut/events{/privacy}","received_events_url":"https://api.github.com/users/ngaut/received_events","type":"User","site_admin":false},"repo":{"id":52847980,"name":"rust-rocksdb","full_name":"ngaut/rust-rocksdb","owner":{"login":"ngaut","id":878009,"avatar_url":"https://avatars.githubusercontent.com/u/878009?v=3","gravatar_id":"","url":"https://api.github.com/users/ngaut","html_url":"https://github.com/ngaut","followers_url":"https://api.github.com/users/ngaut/followers","following_url":"https://api.github.com/users/ngaut/following{/other_user}","gists_url":"https://api.github.com/users/ngaut/gists{/gist_id}","starred_url":"https://api.github.com/users/ngaut/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngaut/subscriptions","organizations_url":"https://api.github.com/users/ngaut/orgs","repos_url":"https://api.github.com/users/ngaut/repos","events_url":"https://api.github.com/users/ngaut/events{/privacy}","received_events_url":"https://api.github.com/users/ngaut/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ngaut/rust-rocksdb","description":"rust wrapper for rocksdb","fork":true,"url":"https://api.github.com/repos/ngaut/rust-rocksdb","forks_url":"https://api.github.com/repos/ngaut/rust-rocksdb/forks","keys_url":"https://api.github.com/repos/ngaut/rust-rocksdb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ngaut/rust-rocksdb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ngaut/rust-rocksdb/teams","hooks_url":"https://api.github.com/repos/ngaut/rust-rocksdb/hooks","issue_events_url":"https://api.github.com/repos/ngaut/rust-rocksdb/issues/events{/number}","events_url":"https://api.github.com/repos/ngaut/rust-rocksdb/events","assignees_url":"https://api.github.com/repos/ngaut/rust-rocksdb/assignees{/user}","branches_url":"https://api.github.com/repos/ngaut/rust-rocksdb/branches{/branch}","tags_url":"https://api.github.com/repos/ngaut/rust-rocksdb/tags","blobs_url":"https://api.github.com/repos/ngaut/rust-rocksdb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ngaut/rust-rocksdb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ngaut/rust-rocksdb/git/refs{/sha}","trees_url":"https://api.github.com/repos/ngaut/rust-rocksdb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ngaut/rust-rocksdb/statuses/{sha}","languages_url":"https://api.github.com/repos/ngaut/rust-rocksdb/languages","stargazers_url":"https://api.github.com/repos/ngaut/rust-rocksdb/stargazers","contributors_url":"https://api.github.com/repos/ngaut/rust-rocksdb/contributors","subscribers_url":"https://api.github.com/repos/ngaut/rust-rocksdb/subscribers","subscription_url":"https://api.github.com/repos/ngaut/rust-rocksdb/subscription","commits_url":"https://api.github.com/repos/ngaut/rust-rocksdb/commits{/sha}","git_commits_url":"https://api.github.com/repos/ngaut/rust-rocksdb/git/commits{/sha}","comments_url":"https://api.github.com/repos/ngaut/rust-rocksdb/comments{/number}","issue_comment_url":"https://api.github.com/repos/ngaut/rust-rocksdb/issues/comments{/number}","contents_url":"https://api.github.com/repos/ngaut/rust-rocksdb/contents/{+path}","compare_url":"https://api.github.com/repos/ngaut/rust-rocksdb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ngaut/rust-rocksdb/merges","archive_url":"https://api.github.com/repos/ngaut/rust-rocksdb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ngaut/rust-rocksdb/downloads","issues_url":"https://api.github.com/repos/ngaut/rust-rocksdb/issues{/number}","pulls_url":"https://api.github.com/repos/ngaut/rust-rocksdb/pulls{/number}","milestones_url":"https://api.github.com/repos/ngaut/rust-rocksdb/milestones{/number}","notifications_url":"https://api.github.com/repos/ngaut/rust-rocksdb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ngaut/rust-rocksdb/labels{/name}","releases_url":"https://api.github.com/repos/ngaut/rust-rocksdb/releases{/id}","deployments_url":"https://api.github.com/repos/ngaut/rust-rocksdb/deployments","created_at":"2016-03-01T04:29:15Z","updated_at":"2016-04-06T16:52:16Z","pushed_at":"2016-07-21T04:23:09Z","git_url":"git://github.com/ngaut/rust-rocksdb.git","ssh_url":"git@github.com:ngaut/rust-rocksdb.git","clone_url":"https://github.com/ngaut/rust-rocksdb.git","svn_url":"https://github.com/ngaut/rust-rocksdb","homepage":null,"size":343,"stargazers_count":2,"watchers_count":2,"language":"Rust","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ngaut/rust-rocksdb/pulls/26"},"html":{"href":"https://github.com/ngaut/rust-rocksdb/pull/26"},"issue":{"href":"https://api.github.com/repos/ngaut/rust-rocksdb/issues/26"},"comments":{"href":"https://api.github.com/repos/ngaut/rust-rocksdb/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/ngaut/rust-rocksdb/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/ngaut/rust-rocksdb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ngaut/rust-rocksdb/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/ngaut/rust-rocksdb/statuses/fb333e68cff4c9d6b2d3a5a7a06e32a289f3916d"}}}}
{"actor":{"display_login":"siddontang"}}