Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: haikuports/haikuports
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 57dfb11c3865
Choose a base ref
...
head repository: haikuports/haikuports
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 842da908c2c4
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Jul 14, 2021

  1. pystring, new recipe (#6059)

    Begasus authored Jul 14, 2021

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    842da90 View commit details
Showing with 161 additions and 0 deletions.
  1. +81 −0 dev-cpp/pystring/patches/pystring-1.1.3~git.patchset
  2. +80 −0 dev-cpp/pystring/pystring-1.1.3~git.recipe
81 changes: 81 additions & 0 deletions dev-cpp/pystring/patches/pystring-1.1.3~git.patchset
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
From 754fcd9ebc523d3d4de39b9d0e443841a717e1c0 Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Wed, 14 Jul 2021 19:21:21 +0000
Subject: Import open PR from https://github.com/imageworks/pystring/pull/29


diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..0081a83
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,56 @@
+cmake_minimum_required(VERSION 3.2)
+
+option(BUILD_SHARED_LIBS "Create shared libraries if ON" OFF)
+
+project(pystring LANGUAGES CXX)
+
+# pystring library ======
+
+add_library(pystring
+ pystring.cpp
+ pystring.h
+)
+set_target_properties(pystring
+ PROPERTIES
+ PUBLIC_HEADER pystring.h
+ SOVERSION 0.0)
+
+set(EXPORT_NAME "${PROJECT_NAME}Targets")
+set(NAMESPACE "${PROJECT_NAME}::")
+
+# test ======
+
+include(CTest)
+
+if(BUILD_TESTING)
+ add_executable(pystring_test
+ test.cpp
+ unittest.h
+ )
+
+ target_link_libraries(pystring_test pystring)
+
+ add_test(NAME pystring_test COMMAND pystring_test)
+endif()
+
+# install and cmake configs ======
+
+include(GNUInstallDirs)
+install(TARGETS pystring
+ EXPORT "${EXPORT_NAME}"
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
+ PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/pystring)
+
+include(CMakePackageConfigHelpers)
+configure_package_config_file(cmake/pystringConfig.cmake.in
+ ${CMAKE_CURRENT_BINARY_DIR}/pystringConfig.cmake
+ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pystring)
+
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/pystringConfig.cmake
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pystring)
+
+install(EXPORT "${EXPORT_NAME}"
+ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/pystring
+ NAMESPACE "${NAMESPACE}")
diff --git a/cmake/pystringConfig.cmake.in b/cmake/pystringConfig.cmake.in
new file mode 100644
index 0000000..82e3995
--- /dev/null
+++ b/cmake/pystringConfig.cmake.in
@@ -0,0 +1,4 @@
+@PACKAGE_INIT@
+
+include("${CMAKE_CURRENT_LIST_DIR}/@EXPORT_NAME@.cmake")
+check_required_components("@PROJECT_NAME@")
--
2.30.2

80 changes: 80 additions & 0 deletions dev-cpp/pystring/pystring-1.1.3~git.recipe
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
SUMMARY="C++ functions matching the interface and behavior of python string methods"
DESCRIPTION="Pystring is a collection of C++ functions which match the \
interface and behavior of python's string class methods using std::string.
Implemented in C++, it does not require or make use of a python interpreter. \
It provides convenience and familiarity for common string operations not \
included in the standard C++ library. It's also useful in environments where \
both C++ and python are used.
Overlapping functionality (such as index and slice/substr) of std::string is \
included to match python interfaces.
Note: Despite the infrequent updates, this repo is not dead/abandoned - just \
stable! We use it every day at Imageworks."
HOMEPAGE="http://opensource.imageworks.com/"
COPYRIGHT="2008-2010 Sony Pictures Imageworks Inc"
LICENSE="BSD (3-clause)"
REVISION="1"
srcGitRev="281419de2f91f9e0f2df6acddfea3b06a43436be"
SOURCE_URI="https://github.com/imageworks/pystring/archive/$srcGitRev.tar.gz"
CHECKSUM_SHA256="46161e75f85a3e8867233aebb6f4399f405c565db76dc07731a7ef662459609d"
SOURCE_FILENAME="pystring-$portVersion-$srcGitRev.tar.gz"
SOURCE_DIR="pystring-$srcGitRev"
PATCHES="pystring-$portVersion.patchset"

ARCHITECTURES="!x86_gcc2 x86_64"
SECONDARY_ARCHITECTURES="x86"

libVersion="0.0"
libVersionCompat="$libVersion compat >= ${libVersion%.*}"

PROVIDES="
pystring$secondaryArchSuffix = $portVersion
lib:libpystring$secondaryArchSuffix = $libVersionCompat
"
REQUIRES="
haiku$secondaryArchSuffix
"

PROVIDES_devel="
pystring${secondaryArchSuffix}_devel = $portVersion
devel:libpystring$secondaryArchSuffix = $libVersionCompat
"
REQUIRES_devel="
pystring$secondaryArchSuffix == $portVersion base
"

BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:cmake
cmd:make
cmd:gcc$secondaryArchSuffix
cmd:libtool$secondaryArchSuffix
"

BUILD()
{
cmake -B build -S . \
$cmakeDirArgs \
-DCMAKE_BUILD_TYPE=None \
-DBUILD_SHARED_LIBS=ON
make -C build $jobArgs
}

INSTALL()
{
make -C build install

prepareInstalledDevelLib \
libpystring
packageEntries devel \
$developDir \
$libDir/cmake
}

TEST()
{
make -C build test
}