{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/osquery/issues/1107","labels_url":"https://api.github.com/repos/facebook/osquery/issues/1107/labels{/name}","comments_url":"https://api.github.com/repos/facebook/osquery/issues/1107/comments","events_url":"https://api.github.com/repos/facebook/osquery/issues/1107/events","html_url":"https://github.com/facebook/osquery/pull/1107","id":73597785,"number":1107,"title":"Add first wave of support for building on FreeBSD","user":{"login":"zi0r","id":1676702,"avatar_url":"https://avatars.githubusercontent.com/u/1676702?v=3","gravatar_id":"","url":"https://api.github.com/users/zi0r","html_url":"https://github.com/zi0r","followers_url":"https://api.github.com/users/zi0r/followers","following_url":"https://api.github.com/users/zi0r/following{/other_user}","gists_url":"https://api.github.com/users/zi0r/gists{/gist_id}","starred_url":"https://api.github.com/users/zi0r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zi0r/subscriptions","organizations_url":"https://api.github.com/users/zi0r/orgs","repos_url":"https://api.github.com/users/zi0r/repos","events_url":"https://api.github.com/users/zi0r/events{/privacy}","received_events_url":"https://api.github.com/users/zi0r/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-06T12:10:15Z","updated_at":"2015-05-06T12:10:20Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/osquery/pulls/1107","html_url":"https://github.com/facebook/osquery/pull/1107","diff_url":"https://github.com/facebook/osquery/pull/1107.diff","patch_url":"https://github.com/facebook/osquery/pull/1107.patch"},"body":"This is an initial set of patches to get osquery to build under FreeBSD.  They still need some work:\r\n- the python->python2 change should actually be $(PYTHON) instead.  CMake should check to see if $(PYTHON) is defined, if not, set it to python.\r\n- CMAKE_CXX_COMPILER/CMAKE_C_COMPILER should be able to be overridden.  The FreeBSD ports framework wants to be able to choose the compiler it uses, given a set of requirements.\r\n- Make the calls out to 'git' optional.  In these patches, I've just hardcoded the calls to return \"unknown-version\"\r\n- If we don't need bash, it would be better to use /bin/sh.  I did not test to see what specifically required bash.  This would be one less dependency.\r\n- The way I'm pulling in the third-party directory is kind of a hack, but it works.  If you guys have a better way to integrate these deps in the future, that would be ideal.  FreeBSD's ports tree has glog, gflags and a version of sqlite3 in it.  Perhaps we can investigate using these existing external dependencies to start work on eliminating the third-party directory wholesale.\r\n\r\nMy work so far on the port can be found here: https://people.freebsd.org/~zi/osquery.shar\r\n\r\nSimply download it and run it to extract the port contents.  Then cd osquery && make\r\nThis will pull in all of the dependencies, apply the patches I have for 1.4.5 and get you to the point where linking fails for osqueryd due to libboost_regex/rocksdb issues.\r\nOnce we've got a successful build, I'll do some additional review and then commit the port to the FreeBSD ports repo.\r\n\r\nCurrent Problems:\r\n- third-party/glog requires these patches to build: https://svnweb.freebsd.org/ports/head/devel/glog/files/\r\n- Linking fails with a bunch of 'undefined symbol' errors.  This affects libboost_regex and rocksdb.  Switching the linker to use the shared libraries seems to fix this.  This solution might be a good temporary fix, but I suspect we will want to statically link as much as possible, especially given the large dependency list for osquery.\r\n- There might be others that will be discovered after the linking issue is resolved.  I'll continue work as soon as I've got a CMake-fix for it."},"comment":{"url":"https://api.github.com/repos/facebook/osquery/issues/comments/99426773","html_url":"https://github.com/facebook/osquery/pull/1107#issuecomment-99426773","issue_url":"https://api.github.com/repos/facebook/osquery/issues/1107","id":99426773,"user":{"login":"osqueryer","id":9722826,"avatar_url":"https://avatars.githubusercontent.com/u/9722826?v=3","gravatar_id":"","url":"https://api.github.com/users/osqueryer","html_url":"https://github.com/osqueryer","followers_url":"https://api.github.com/users/osqueryer/followers","following_url":"https://api.github.com/users/osqueryer/following{/other_user}","gists_url":"https://api.github.com/users/osqueryer/gists{/gist_id}","starred_url":"https://api.github.com/users/osqueryer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/osqueryer/subscriptions","organizations_url":"https://api.github.com/users/osqueryer/orgs","repos_url":"https://api.github.com/users/osqueryer/repos","events_url":"https://api.github.com/users/osqueryer/events{/privacy}","received_events_url":"https://api.github.com/users/osqueryer/received_events","type":"User","site_admin":false},"created_at":"2015-05-06T12:10:19Z","updated_at":"2015-05-06T12:10:19Z","body":"Can one of the osquery admins reply with \"ok to test\" to kick off a build..."}}