Skip to content

Commit 44b55d3

Browse files
committed
[libfyaml] new port
Needed for appstream port
1 parent 80f9bcf commit 44b55d3

7 files changed

Lines changed: 109 additions & 0 deletions

File tree

ports/libfyaml/math.diff

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index ef0c3ae..624930c 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -1189,10 +1189,9 @@ endif()
6+
7+
# Link libm where it exists as a separate library (Linux, FreeBSD, etc.).
8+
# macOS includes math in libSystem; Windows has no libm.
9+
-find_library(LIBM m)
10+
-if(LIBM)
11+
- target_link_libraries(fyaml PUBLIC ${LIBM})
12+
- target_link_libraries(fyaml_static PUBLIC ${LIBM})
13+
+if(UNIX AND NOT ANDROID AND NOT APPLE)
14+
+ target_link_libraries(fyaml PUBLIC m)
15+
+ target_link_libraries(fyaml_static PUBLIC m)
16+
endif()
17+
18+
# Add libclang support if available

ports/libfyaml/portfile.cmake

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
vcpkg_download_distfile(32BIT_PATCH
2+
URLS "https://github.com/pantoniou/libfyaml/commit/0982fcefc6a16d4c8cb5b06747d3fc8e630de3ae.patch?full_index=1"
3+
FILENAME "fy_skip_size32.patch"
4+
SHA512 78071e1e555c531874fec6bd096b9bf8427e6b73436f679a7ef100970ccfdb0fbb0b683242a370b058d1a87f73a008861668b2d81b14a1f9fc77a19b3dbd49ec
5+
)
6+
7+
vcpkg_from_github(
8+
OUT_SOURCE_PATH SOURCE_PATH
9+
REPO pantoniou/libfyaml
10+
REF v${VERSION}
11+
SHA512 e38f42b5d3e5e88300fd1c7b59868592afa5f2f88d30f61e778700c35435ebd14ecef7d82ac0213345dabdb3c562dc234ed1b2bfd84e40b47fdc4f84144c79f5
12+
PATCHES
13+
"pthread.diff" #https://github.com/pantoniou/libfyaml/pull/287
14+
"yield.diff" #https://github.com/pantoniou/libfyaml/pull/288
15+
"${32BIT_PATCH}"
16+
"math.diff"
17+
)
18+
19+
vcpkg_cmake_configure(
20+
SOURCE_PATH "${SOURCE_PATH}"
21+
OPTIONS
22+
-DBUILD_TESTING=OFF
23+
)
24+
25+
vcpkg_cmake_install()
26+
27+
vcpkg_fixup_pkgconfig()
28+
vcpkg_copy_pdbs()
29+
30+
vcpkg_copy_tools(TOOL_NAMES fy-tool AUTO_CLEAN)
31+
32+
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}")
33+
34+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
35+
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
36+
37+
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")

ports/libfyaml/pthread.diff

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
diff --git a/cmake/libfyaml.pc.in b/cmake/libfyaml.pc.in
2+
index e57044c..a7da26e 100644
3+
--- a/cmake/libfyaml.pc.in
4+
+++ b/cmake/libfyaml.pc.in
5+
@@ -6,5 +6,5 @@ includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@
6+
Name: libfyaml
7+
Description: Fancy YAML 1.3 parser library
8+
Version: @PROJECT_VERSION@
9+
-Libs: -L${libdir} -lfyaml -lpthread
10+
+Libs: -L${libdir} -lfyaml @CMAKE_THREAD_LIBS_INIT@
11+
Cflags: -I${includedir}

ports/libfyaml/vcpkg.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "libfyaml",
3+
"version": "0.9.6",
4+
"description": "High-performance YAML parser and emitter library",
5+
"homepage": "https://github.com/pantoniou/libfyaml",
6+
"license": "MIT",
7+
"dependencies": [
8+
{
9+
"name": "vcpkg-cmake",
10+
"host": true
11+
},
12+
{
13+
"name": "vcpkg-cmake-config",
14+
"host": true
15+
}
16+
]
17+
}

ports/libfyaml/yield.diff

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/include/libfyaml/libfyaml-atomics.h b/include/libfyaml/libfyaml-atomics.h
2+
index 54d88ae..4832529 100644
3+
--- a/include/libfyaml/libfyaml-atomics.h
4+
+++ b/include/libfyaml/libfyaml-atomics.h
5+
@@ -401,6 +401,8 @@ static inline void fy_cpu_relax(void)
6+
__builtin_ia32_pause();
7+
#elif defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86))
8+
_mm_pause();
9+
+#elif defined(_MSC_VER) && (defined(_M_ARM64) || defined(_M_ARM))
10+
+ __yield();
11+
#elif defined(__aarch64__) || defined(__arm__)
12+
__asm__ volatile ("yield");
13+
#elif defined(__powerpc__)

versions/baseline.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4992,6 +4992,10 @@
49924992
"baseline": "3.17.3",
49934993
"port-version": 0
49944994
},
4995+
"libfyaml": {
4996+
"baseline": "0.9.6",
4997+
"port-version": 0
4998+
},
49954999
"libgcrypt": {
49965000
"baseline": "1.12.1",
49975001
"port-version": 0

versions/l-/libfyaml.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"versions": [
3+
{
4+
"git-tree": "746d545f2c70e9478d64abd29bb253657ed339ed",
5+
"version": "0.9.6",
6+
"port-version": 0
7+
}
8+
]
9+
}

0 commit comments

Comments
 (0)