# Copyright (c) 2023 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Contributor: Chen Xu <chenxu.unix@gmail.com>
# Maintainer: Chen Xu <chenxu.unix@gmail.com>
pkgname=libevent
pkgver=release-2.1.12-stable
pkgrel=0
pkgdesc="libevent is meant to replace the event loop found in event driven network servers. An application just needs to call event_dispatch() and then add or remove events dynamically without having to change the event loop."
url="https://libevent.org/"
archs=("armeabi-v7a" "arm64-v8a" "x86_64")
license=("BSD-style license")
depends=("openssl")
makedepends=()
source="https://github.com/$pkgname/$pkgname/archive/refs/tags/$pkgver.tar.gz"
autounpack=true
downloadpackage=true
builddir=$pkgname-${pkgver}
packagename=$builddir.tar.gz
prepare() {
mkdir -p $builddir/$ARCH-build
}
build() {
cd $builddir
${OHOS_SDK}/native/build-tools/cmake/bin/cmake -DEVENT__LIBRARY_TYPE=BOTH "$@" -DOHOS_ARCH=$ARCH \
-DCMAKE_C_FLAGS="-s" \
-DCMAKE_CXX_FLAGS="-s" \
-B$ARCH-build/ -S./ -L > `pwd`/$ARCH-build/build.log 2>&1
# 编译
make -j4 -C $ARCH-build VERBOSE=1 >> `pwd`/$ARCH-build/build.log 2>&1
ret=$?
cd $OLDPWD
return $ret
}
package() {
cd $builddir
make -C $ARCH-build install VERBOSE=1 >> `pwd`/$ARCH-build/build.log 2>&1
cd $OLDPWD
}
check() {
echo "The test must be on an OpenHarmony device!"
}
# 清理环境
cleanbuild() {
rm -rf ${PWD}/$builddir # ${PWD}/$packagename
}