blob: c224addca72bdcacd3c3267375c636fd76fe9ba8 [file] [log] [blame] [edit]
# Maintainer: Alexey Pavlov <alexpux@gmail.com>
_realname=libssh
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=0.9.5
pkgrel=2
pkgdesc="Library for accessing ssh client services through C libraries (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url="https://www.libssh.org/"
license=("LGPL")
install=libssh-${CARCH}.install
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
"${MINGW_PACKAGE_PREFIX}-pkg-config"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-cmocka")
depends=("${MINGW_PACKAGE_PREFIX}-openssl"
"${MINGW_PACKAGE_PREFIX}-zlib")
options=('staticlibs' 'strip')
validpgpkeys=('8DFF53E18F2ABC8D8F3C92237EE0FC4DCC014E3D') # Andreas Schneider <asn@cryptomilk.org>
source=("https://www.libssh.org/files/${pkgver%.*}/${_realname}-${pkgver}.tar.xz"
"https://www.libssh.org/files/${pkgver%.*}/${_realname}-${pkgver}.tar.xz.asc"
"mingw-as-unix.patch"
001-install-static-lib.patch
010-lld.patch)
sha256sums=('acffef2da98e761fc1fd9c4fddde0f3af60ab44c4f5af05cd1b2d60a3fa08718'
'SKIP'
'bac0a32f54368f55abbce14dea3dfba27a24321d590022b93bb8369a2aaa4993'
'eca5206ca1d3b3ff76fab5759ab1a8387655fe31c383a2d125d8e13c86098bd8'
'f92a4603a820defee4938e39f4413b80a71e53627356e4f51314048b91d89713')
noextract=(${_realname}-${pkgver}.tar.xz)
prepare() {
[[ -d ${_realname}-${pkgver} ]] && rm -rf ${_realname}-${pkgver}
tar -xJvf ${_realname}-${pkgver}.tar.xz -C ${srcdir} || true
cd ${srcdir}/${_realname}-${pkgver}
patch -p1 -i ${srcdir}/mingw-as-unix.patch
patch -p1 -i ${srcdir}/001-install-static-lib.patch
patch -p1 -i ${srcdir}/010-lld.patch
}
build() {
declare -a extra_config
if check_option "debug" "n"; then
extra_config+=("-DCMAKE_BUILD_TYPE=Release")
else
extra_config+=("-DCMAKE_BUILD_TYPE=Debug")
fi
[[ -d ${srcdir}/build-${MINGW_CHOST} ]] && rm -rf ${srcdir}/build-${MINGW_CHOST}
mkdir -p ${srcdir}/build-${MINGW_CHOST} && cd ${srcdir}/build-${MINGW_CHOST}
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake.exe \
-G"MSYS Makefiles" \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
${extra_config} \
-DWITH_GSSAPI=OFF \
-DUNIT_TESTING=ON \
-DBUILD_STATIC_LIB=ON \
-DBUILD_SHARED_LIBS=ON \
../${_realname}-${pkgver}
make all
}
check() {
cd "${srcdir}/build-${MINGW_CHOST}"
make test
}
package() {
cd "${srcdir}/build-${MINGW_CHOST}"
make DESTDIR=${pkgdir} install
}