diff options
Diffstat (limited to 'libs/yajl/MAKEPKG')
| -rw-r--r-- | libs/yajl/MAKEPKG | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/libs/yajl/MAKEPKG b/libs/yajl/MAKEPKG new file mode 100644 index 0000000..dbc5656 --- /dev/null +++ b/libs/yajl/MAKEPKG @@ -0,0 +1,60 @@ +#!/bin/mkpkg +# description: Yet Another JSON Library +# url: https://github.com/lloyd/yajl + +name=yajl +version=2.1.0 +release=1 +depends=() +makedeps=(cmake) +source=(https://github.com/lloyd/$name/archive/refs/tags/$version.tar.gz + $name-$version-CVE-2017-16516.patch + $name-$version-CVE-2022-24795.patch + $name-$version-memory_leak.patch) +renames=($name-$version.tar.gz) + +sha256sums=( + "3fb73364a5a30efe615046d07e6db9d09fd2b41c763c5f7d3bfb121cd5c5ac5a" + "b5eb60178071e2df0088856939fabbd45864d836259b611260fc498a34154614" + "a58f51871a9ebd80849c8bc7418df6f58d66f8fe701f5e11a6429fd0f32d9ecf" + "cd36f7f51520baac2bd8467d7bbb04f2c6e261968981a1e8c10ff4ed7a0aff69" +) + +patch() { + cd $name-$version + for p in "$SRC"/*.patch; do + [ -f "$p" ] && patch -p1 -i "$p" + done + + # remove broken subdirectories - only need the library + sed -i '/ADD_SUBDIRECTORY(test)/d; + /ADD_SUBDIRECTORY(reformatter)/d; + /ADD_SUBDIRECTORY(verify)/d; + /ADD_SUBDIRECTORY(example)/d; + /ADD_SUBDIRECTORY(perf)/d; + /ADD_CUSTOM_TARGET(test/,+2d; + /ADD_CUSTOM_TARGET(test-api/,+1d; + /INCLUDE(YAJLDoc.cmake)/d' CMakeLists.txt + + # fix minimum cmake version + sed -i 's/CMAKE_MINIMUM_REQUIRED(VERSION 2.6)/CMAKE_MINIMUM_REQUIRED(VERSION 3.5)/' CMakeLists.txt +} + +build() { + cmake -B build -S $name-$version \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \ + -DCMAKE_POLICY_DEFAULT_CMP0026=OLD \ + -W no-dev + + cmake --build build + DESTDIR=$PKG cmake --install build +} + +signify() { + untrusted comment: public key + RWTZ9IduCSQ/mL8337TEUinPwT92xFEUpD92hkS7IxcOnzTt9QdpohT3 +} + +# vim: filetype=sh |
