Skip to content

Commit

Permalink
[benchmark] add new plan
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Dang <me@bdang.it>
  • Loading branch information
bdangit committed Apr 5, 2018
1 parent c6a6a36 commit 9c4d940
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .bldr.toml
Expand Up @@ -47,6 +47,8 @@ plan_path = "bats"
plan_path = "bc"
[bdwgc]
plan_path = "bdwgc"
[benchmark]
plan_path = "benchmark"
[bind]
plan_path = "bind"
[binutils]
Expand Down
16 changes: 16 additions & 0 deletions benchmark/README.md
@@ -0,0 +1,16 @@
# benchmark

Google's microbenchmark support library

## Maintainers

* The Habitat Maintainers: <humans@habitat.sh>

## Type of Package

Binary package

## Usage

Include `core/benchmark` to have the `includes` and `libraries`. Refer to this
[C++ project](https://github.com/google/benchmark#example-usage) as an example.
55 changes: 55 additions & 0 deletions benchmark/plan.sh
@@ -0,0 +1,55 @@
pkg_name=benchmark
pkg_origin=core
pkg_version=1.4.0
pkg_description="Google's microbenchmark support library"
pkg_upstream_url=https://github.com/google/benchmark
pkg_license=('Apache-2.0')
pkg_maintainer="The Habitat Maintainers <humans@habitat.sh>"
pkg_source="https://github.com/google/benchmark/archive/v${pkg_version}.tar.gz"
pkg_filename="v${pkg_version}.tar.gz"
pkg_shasum=616f252f37d61b15037e3c2ef956905baf9c9eecfeab400cb3ad25bae714e214
pkg_deps=(
core/gcc-libs
core/glibc
)
pkg_build_deps=(
core/binutils
core/cmake
core/make
core/gcc
core/git
core/googletest
core/googlemock
)
pkg_lib_dirs=(lib)
pkg_include_dirs=(include)

BUILDDIR="build"

do_prepare() {
mkdir -p "$BUILDDIR"
}

do_build() {
GTEST_DIR="$(pkg_path_for core/googletest)"

cd "$BUILDDIR" || exit
cmake \
-DCMAKE_INSTALL_PREFIX="$PREFIX" \
-DCMAKE_BUILD_TYPE="RELEASE" \
-DGTEST_LIBRARY="$GTEST_DIR/lib/libgtest.a" \
-DGTEST_MAIN_LIBRARY="$GTEST_DIR/lib/libgtest_main.a" \
-DGTEST_INCLUDE_DIR="$GTEST_DIR/include" \
..
make
}

do_check() {
cd "$BUILDDIR" || exit
make test
}

do_install() {
cd "$BUILDDIR" || exit
make install
}

0 comments on commit 9c4d940

Please sign in to comment.