Skip to content

Commit

Permalink
uri-template-1.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fd00 committed Jan 11, 2025
1 parent 0eb9858 commit e34e923
Show file tree
Hide file tree
Showing 3 changed files with 192 additions and 0 deletions.
79 changes: 79 additions & 0 deletions uri-template/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
uri-template
------------------------------------------
This library implements URI Template with full support up to Level 4 providing
expansion and match capabilities. It requires c++17 compiler support and has no
dependencies.

Runtime requirements:
cygwin-3.5.4-1
libgcc1-12.4.0-3
libstdc++6-12.4.0-3
liburi-template-devel-1.2.1-1bl1
liburi-template1.2.1-1.2.1-1bl1
pkg-config-2.3.0-1

Build requirements:
(besides corresponding -devel packages)
binutils-2.43.1-1
cmake-3.28.3-1
cygport-0.36.9-1
gcc-core-12.4.0-3
gcc-g++-12.4.0-3
ninja-1.12.0-1

Canonical website:
https://github.com/Tinkoff/uri-template

Canonical download:
https://github.com/Tinkoff/uri-template/archive/refs/tags/v1.2.1.tar.gz

-------------------------------------------

Build instructions:
1. unpack uri-template-1.2.1-X-src.tar.xz
2. if you use setup to install this src package,
it will be unpacked under /usr/src automatically
% cd /usr/src
% cygport ./uri-template-1.2.1-X.cygport all

This will create:
/usr/src/uri-template-1.2.1-X-src.tar.xz
/usr/src/uri-template-1.2.1-X.tar.xz
/usr/src/liburi-template1.2.1-1.2.1-X.tar.xz
/usr/src/liburi-template-devel-1.2.1-X.tar.xz

-------------------------------------------

Files included in the binary package:

(uri-template)
/usr/share/doc/Cygwin/uri-template.README
/usr/share/doc/uri-template/CHANGELOG.md
/usr/share/doc/uri-template/LICENSE
/usr/share/doc/uri-template/README.md

(liburi-template1.2.1)
/usr/bin/cyguri-template-1.2.1.dll

(liburi-template-devel)
/usr/include/uri-template/Expander.h
/usr/include/uri-template/Matcher.h
/usr/include/uri-template/Modifier.h
/usr/include/uri-template/Operator.h
/usr/include/uri-template/Parser.h
/usr/include/uri-template/Template.h
/usr/include/uri-template/Variable.h
/usr/include/uri-template/uri-template.h
/usr/lib/cmake/uri-template/uri-template-config-version.cmake
/usr/lib/cmake/uri-template/uri-template-config.cmake
/usr/lib/cmake/uri-template/uri-template-targets-release.cmake
/usr/lib/cmake/uri-template/uri-template-targets.cmake
/usr/lib/liburi-template.dll.a
/usr/lib/pkgconfig/uri-template.pc

------------------

Port Notes:

----- version 1.2.1-1bl1 -----
Initial release by fd0 <https://github.com/fd00/>
50 changes: 50 additions & 0 deletions uri-template/uri-template-1.2.1-1bl1.cygport
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
HOMEPAGE="https://github.com/Tinkoff/${PN}"
SRC_URI="https://github.com/Tinkoff/${PN}/archive/refs/tags/v${PV}.tar.gz"

CATEGORY="Libs"
SUMMARY="URI Templates expansion and reverse-matching for C++"
DESCRIPTION="This library implements URI Template with full support up to Level 4 providing
expansion and match capabilities. It requires c++17 compiler support and has
no dependencies."

LICENSE="Apache-2.0"
LICENSE_SPDX="SPDX-License-Identifier: Apache-2.0"
LICENSE_URI="LICENSE"

export CPPFLAGS="${CPPFLAGS} -D_GNU_SOURCE"

inherit cmake

CYGCMAKE_ARGS="
-DBUILD_SHARED_LIBS:BOOL=ON
-DURITEMPLATE_BUILD_TESTING:BOOL=ON
"

src_test()
{
cd ${B}
PATH=${B}:${PATH} ctest
}

DOCS="
CHANGELOG.md
"

PKG_NAMES="
uri-template
liburi-template${PV}
liburi-template-devel
"
uri_template_CONTENTS="
usr/share
"
liburi_template1_2_1_CONTENTS="
usr/bin/cyg*-${PV}.dll
"
liburi_template_devel_CONTENTS="
usr/include
usr/lib
"
uri_template_SUMMARY="${SUMMARY} (licensing & readmes)"
liburi_template1_2_1_SUMMARY="${SUMMARY} (runtime)"
liburi_template_devel_SUMMARY="${SUMMARY} (development)"
63 changes: 63 additions & 0 deletions uri-template/uri-template-1.2.1-1bl1.src.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
--- origsrc/uri-template-1.2.1/CMakeLists.txt 2021-08-26 06:03:41.000000000 +0900
+++ src/uri-template-1.2.1/CMakeLists.txt 2025-01-11 23:59:44.753407400 +0900
@@ -151,3 +151,10 @@ endif()
if(URITEMPLATE_BUILD_DOCS)
add_subdirectory(docs)
endif()
+
+set(prefix ${CMAKE_INSTALL_PREFIX})
+set(exec_prefix ${CMAKE_INSTALL_PREFIX})
+set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
+set(includedir ${CMAKE_INSTALL_PREFIX}/include)
+configure_file(${CMAKE_SOURCE_DIR}/uri-template.pc.in ${CMAKE_BINARY_DIR}/uri-template.pc @ONLY)
+install(FILES ${CMAKE_BINARY_DIR}/uri-template.pc DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/pkgconfig)
--- origsrc/uri-template-1.2.1/test/CMakeLists.txt 2021-08-26 06:03:41.000000000 +0900
+++ src/uri-template-1.2.1/test/CMakeLists.txt 2025-01-11 23:49:18.840353500 +0900
@@ -8,6 +8,9 @@ else()
set(TETING_TARGET_LOCAL "False")
endif()

+find_package(GTest)
+
+if (NOT GTEST_FOUND)
# Download and unpack googletest at configure time
configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
@@ -22,20 +25,23 @@ execute_process(COMMAND ${CMAKE_COMMAND}
if(result)
message(FATAL_ERROR "Build step for googletest failed: ${result}")
endif()
+endif()

# Prevent overriding the parent project's compiler/linker
# settings on Windows
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

+if (NOT GTEST_FOUND)
# Add googletest directly to our build. This defines
# the gtest and gtest_main targets.
add_subdirectory(${CMAKE_CURRENT_BINARY_DIR}/googletest-src
${CMAKE_CURRENT_BINARY_DIR}/googletest-build
EXCLUDE_FROM_ALL)
+endif()

function(add_unit_test name)
add_executable(${name} ${ARGN})
- target_link_libraries(${name} ${PROJECT_NAME}::${PROJECT_NAME} gtest_main)
+ target_link_libraries(${name} ${PROJECT_NAME}::${PROJECT_NAME} gtest gtest_main)
add_test(NAME ${name} COMMAND $<TARGET_FILE:${name}>)
if (TETING_TARGET_LOCAL)
add_dependencies(testing ${name})
--- origsrc/uri-template-1.2.1/uri-template.pc.in 1970-01-01 09:00:00.000000000 +0900
+++ src/uri-template-1.2.1/uri-template.pc.in 2025-01-11 23:59:58.757470800 +0900
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: uri-template
+Description: URI Templates expansion and reverse-matching for C++
+Version: @PROJECT_VERSION@
+Libs: -L${libdir} -luri-template
+Cflags: -I${includedir}

0 comments on commit e34e923

Please sign in to comment.