libcpr port (#13924)

This commit is contained in:
Peppersawce
2026-04-08 18:29:33 +02:00
committed by GitHub
parent 2b3733fd45
commit 725d271102
2 changed files with 90 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
SUMMARY="C++ Requests is a modern HTTP library for C++, built for people"
DESCRIPTION="C++ Requests is a simple wrapper around libcurl inspired by the excellent Python Requests project. \
Despite its name, libcurls easy interface is anything but, and making mistakes misusing it \
is a common source of error and frustration. Using the more expressive language facilities of C++17, \
this library captures the essence of making network calls into a few concise idioms."
HOMEPAGE="https://docs.libcpr.dev/"
COPYRIGHT="2026 libcpr contributors"
LICENSE="MIT"
REVISION="1"
SOURCE_URI="https://github.com/libcpr/cpr/archive/refs/tags/$portVersion.tar.gz"
CHECKSUM_SHA256="b9b529b47083bfe80bba855ca5308d12d767ae7c7b629aef5ef018c4343cf62b"
PATCHES="cpr-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
libVersion=$portVersion
libVersionCompat="$libVersion compat >= ${libVersion%%.*}"
PROVIDES="
cpr$secondaryArchSuffix = $portVersion
lib:libcpr$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libcrypto$secondaryArchSuffix
lib:libcurl$secondaryArchSuffix
lib:libssl$secondaryArchSuffix
"
PROVIDES_devel="
cpr${secondaryArchSuffix}_devel = $portVersion
devel:libcpr$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
cpr$secondaryArchSuffix == $portVersion base
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libcurl$secondaryArchSuffix
devel:libssl$secondaryArchSuffix >= 3
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:gcc$secondaryArchSuffix
cmd:make
"
BUILD()
{
cmake -Bbuild -S. $cmakeDirArgs -DCMAKE_BUILD_TYPE=Release \
-DCPR_USE_SYSTEM_CURL=ON -DBUILD_SHARED_LIBS=ON
make -C build $jobArgs
}
INSTALL()
{
make -C build install
prepareInstalledDevelLib libcpr
# devel package
packageEntries devel \
$developDir \
$libDir/cmake
}

View File

@@ -0,0 +1,22 @@
From c85babbc732b8da71559b08461097e7b817b5d7d Mon Sep 17 00:00:00 2001
From: Peppersawce <michaelpeppers89@yahoo.it>
Date: Wed, 8 Apr 2026 17:58:59 +0200
Subject: Save include dir
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt
index 74eedd7..455001b 100644
--- a/include/CMakeLists.txt
+++ b/include/CMakeLists.txt
@@ -1,7 +1,7 @@
cmake_minimum_required(VERSION 3.15)
target_include_directories(cpr PUBLIC
- $<INSTALL_INTERFACE:include>
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/cpr_generated_includes/>)
--
2.52.0