mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-11 06:10:06 +02:00
x86_64 is used as a baseline: the "x86_64" entry, whatever status it has, is transformed into "all", and then the other entries in ARCHITECTURES either dropped or rearranged appropriately.
144 lines
3.2 KiB
Bash
144 lines
3.2 KiB
Bash
SUMMARY="A SSH2 library"
|
|
DESCRIPTION="libssh is a multiplatform C library implementing the SSHv2 \
|
|
protocol on client and server side. With libssh, you can remotely execute \
|
|
programs, transfer files, use a secure and transparent tunnel, manage public \
|
|
keys and much more..."
|
|
HOMEPAGE="https://www.libssh.org/"
|
|
COPYRIGHT="1995 Tatu Ylonen
|
|
2000 Markus Friedl
|
|
2003-2014 Aris Adamantiadis
|
|
2006 Alexander Neundorf
|
|
2007 Daniel Gollub
|
|
2007-2018 Andreas Schneider
|
|
2012 Dmitriy Kuznetsov
|
|
2017 Sartura d.o.o.
|
|
2017 Jan-Lukas Wynen
|
|
2018-2019 Anderson Toshiyuki Sasaki
|
|
2018-2019 Red Hat, Inc.
|
|
2019 Simo Sorce"
|
|
LICENSE="GNU LGPL v2.1
|
|
BSD (2-clause)"
|
|
REVISION="1"
|
|
SOURCE_URI="https://www.libssh.org/files/${portVersion%.*}/libssh-$portVersion.tar.xz"
|
|
CHECKSUM_SHA256="acffef2da98e761fc1fd9c4fddde0f3af60ab44c4f5af05cd1b2d60a3fa08718"
|
|
PATCHES="libssh-$portVersion.patchset"
|
|
|
|
ARCHITECTURES="all !x86_gcc2"
|
|
SECONDARY_ARCHITECTURES="x86"
|
|
|
|
libVersion="4.8.6"
|
|
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
|
|
|
|
PROVIDES="
|
|
libssh$secondaryArchSuffix = $portVersion
|
|
lib:libssh$secondaryArchSuffix = $libVersionCompat
|
|
"
|
|
REQUIRES="
|
|
haiku$secondaryArchSuffix
|
|
lib:libcrypto$secondaryArchSuffix
|
|
lib:libssl$secondaryArchSuffix
|
|
lib:libz$secondaryArchSuffix
|
|
"
|
|
|
|
PROVIDES_devel="
|
|
libssh${secondaryArchSuffix}_devel = $portVersion
|
|
devel:libssh$secondaryArchSuffix = $libVersionCompat
|
|
"
|
|
REQUIRES_devel="
|
|
libssh$secondaryArchSuffix == $portVersion base
|
|
"
|
|
|
|
BUILD_REQUIRES="
|
|
haiku${secondaryArchSuffix}_devel
|
|
devel:libcmocka$secondaryArchSuffix
|
|
devel:libcrypto$secondaryArchSuffix
|
|
devel:libssl$secondaryArchSuffix
|
|
devel:libz$secondaryArchSuffix
|
|
"
|
|
BUILD_PREREQUIRES="
|
|
cmd:cmake
|
|
cmd:gcc$secondaryArchSuffix
|
|
cmd:ld$secondaryArchSuffix
|
|
cmd:make
|
|
cmd:pkg_config$secondaryArchSuffix
|
|
cmd:sshd
|
|
"
|
|
|
|
if [ -z "$secondaryArchSuffix" ]; then
|
|
ARCHITECTURES_doc="any"
|
|
|
|
PROVIDES_doc="
|
|
libssh_doc = $portVersion
|
|
"
|
|
|
|
BUILD_PREREQUIRES+="
|
|
cmd:doxygen
|
|
"
|
|
fi
|
|
|
|
defineDebugInfoPackage libssh$secondaryArchSuffix \
|
|
"$libDir"/libssh.so.$libVersion
|
|
|
|
PATCH()
|
|
{
|
|
# Requires: https://review.haiku-os.org/c/haiku/+/632
|
|
sed -i \
|
|
-e '/torture_threads_pki_rsa/d' \
|
|
-e '/torture_rand/d' \
|
|
-e '/torture_threads_init/d' \
|
|
-e '/torture_threads_buffer/d' \
|
|
-e '/torture_threads_crypto/d' \
|
|
tests/unittests/CMakeLists.txt
|
|
|
|
# Doesn't work in chroot, probably due to the lack of the passwd database
|
|
sed -i 's/cmocka_unit_test(torture_path_expand_tilde_unix),//' \
|
|
tests/unittests/torture_misc.c
|
|
}
|
|
|
|
BUILD()
|
|
{
|
|
_maybe_pie=()
|
|
if [ "$effectiveTargetArchitecture" = x86_64 ]; then
|
|
_maybe_pie=("-DCMAKE_EXE_LINKER_FLAGS=-pie -fstack-protector")
|
|
fi
|
|
|
|
mkdir -p build; cd build
|
|
cmake .. $cmakeDirArgs \
|
|
-DCMAKE_BUILD_TYPE="RelWithDebInfo" \
|
|
-DUNIT_TESTING=ON \
|
|
"${_maybe_pie[@]}"
|
|
make $jobArgs
|
|
|
|
if [ -z "$secondaryArchSuffix" ]; then
|
|
make docs
|
|
fi
|
|
}
|
|
|
|
INSTALL()
|
|
{
|
|
cd build
|
|
make install
|
|
|
|
prepareInstalledDevelLibs libssh
|
|
fixPkgconfig
|
|
|
|
ln -sr $libDir/libssh.so.$libVersion $libDir/libssh.so
|
|
|
|
# devel package
|
|
packageEntries devel \
|
|
"$developDir" \
|
|
"$libDir"/cmake
|
|
|
|
if [ -z "$secondaryArchSuffix" ]; then
|
|
install -d -m 755 "$developDocDir"
|
|
cp -rT doc/html "$developDocDir"
|
|
packageEntries doc "$developDir"
|
|
fi
|
|
}
|
|
|
|
TEST()
|
|
{
|
|
cd build
|
|
make test
|
|
}
|