Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sha256sum & fixed patch #1

Open
wants to merge 2 commits into
base: python-dm-tree-abseil
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions python-dm-tree/.SRCINFO
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ pkgbase = python-dm-tree
makedepends = git
depends = python
depends = python-six
depends = abseil-cpp
source = python-dm-tree-0.1.8.tar.gz::https://pypi.org/packages/source/d/dm-tree/dm-tree-0.1.8.tar.gz
source = CMakeLists.txt.patch
sha256sums = 0fcaabbb14e7980377439e7140bd05552739ca5e515ecb3119f234acee4b9430
sha256sums = 84c9cbd52b3852af2e97dc6261c0114c78d40bc3deeb6b7638dd3864df1a9f72

pkgname = python-dm-tree
96 changes: 96 additions & 0 deletions python-dm-tree/CMakeLists.txt.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
--- dm-tree-0.1.8.orig/tree/CMakeLists.txt 2022-12-18 12:35:42.000000000 +0300
+++ dm-tree-0.1.8/tree/CMakeLists.txt 2023-06-15 16:56:39.291503035 +0300
@@ -11,8 +11,8 @@
"Python found ${Python3_VERSION} < 3.6.0")
endif()

-# Use C++14 standard.
-set(CMAKE_CXX_STANDARD 14 CACHE STRING "C++ version selection")
+# Use C++17 standard.
+set(CMAKE_CXX_STANDARD 17 CACHE STRING "C++ version selection")

# Position-independent code is needed for Python extension modules.
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
@@ -27,17 +27,12 @@
message("PROJECT_BINARY_DIR is: ${PROJECT_BINARY_DIR}")

if (NOT (WIN32 OR MSVC))
- if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
- # Basic build for debugging (default).
- # -Og enables optimizations that do not interfere with debugging.
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Og")
- endif()
-
- if(${CMAKE_BUILD_TYPE} STREQUAL "Release")
- # Optimized release build: turn off debug runtime checks
- # and turn on highest speed optimizations.
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DNDEBUG -O3")
- endif()
+ # Basic build for debugging (default).
+ # -Og enables optimizations that do not interfere with debugging.
+ set(CMAKE_CXX_FLAGS_DEBUG "-g -Og")
+ # Optimized release build: turn off debug runtime checks
+ # and turn on highest speed optimizations.
+ set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")
endif()

if(APPLE)
@@ -67,51 +62,19 @@
# Needed to disable Abseil tests.
set (BUILD_TESTING OFF)

-# Include abseil-cpp.
-set(ABSEIL_VER 20210324.2)
-include(ExternalProject)
-set(ABSEIL_CMAKE_ARGS
- "-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/abseil-cpp"
- "-DCMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}"
- "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}"
- "-DCMAKE_CXX_FLAGS=${CMAKE_CXX_FLAGS}"
- "-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}"
- "-DCMAKE_POSITION_INDEPENDENT_CODE=${CMAKE_POSITION_INDEPENDENT_CODE}"
- "-DLIBRARY_OUTPUT_PATH=${CMAKE_SOURCE_DIR}/abseil-cpp/lib")
-if(DEFINED CMAKE_OSX_ARCHITECTURES)
- set(ABSEIL_CMAKE_ARGS
- ${ABSEIL_CMAKE_ARGS}
- "-DCMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}")
-endif()
-ExternalProject_Add(abseil-cpp
- GIT_REPOSITORY https://github.com/abseil/abseil-cpp.git
- GIT_TAG ${ABSEIL_VER}
- PREFIX ${CMAKE_SOURCE_DIR}/abseil-cpp
- CMAKE_ARGS ${ABSEIL_CMAKE_ARGS}
+set(ABSEIL_LIBS int128 raw_hash_set raw_logging_internal strings throw_delegate)
+find_package(
+ absl
+ REQUIRED
+ COMPONENTS ${ABSEIL_LIBS}
)
-ExternalProject_Get_Property(abseil-cpp install_dir)
-set(abseil_install_dir ${install_dir})
-include_directories (${abseil_install_dir}/include)
-

# Define pybind11 tree module.
pybind11_add_module(_tree tree.h tree.cc)
-add_dependencies(_tree abseil-cpp)

-if (WIN32 OR MSVC)
- set(ABSEIL_LIB_PREF "absl")
- set(LIB_SUFF "lib")
-else()
- set(ABSEIL_LIB_PREF "libabsl")
- set(LIB_SUFF "a")
-endif()

-# Link abseil static libs.
-# We don't use find_library here to force cmake to build abseil before linking.
-set(ABSEIL_LIBS int128 raw_hash_set raw_logging_internal strings throw_delegate)
foreach(ABSEIL_LIB IN LISTS ABSEIL_LIBS)
- target_link_libraries(_tree PRIVATE
- "${abseil_install_dir}/lib/${ABSEIL_LIB_PREF}_${ABSEIL_LIB}.${LIB_SUFF}")
+ target_link_libraries(_tree PRIVATE "absl::${ABSEIL_LIB}")
endforeach()

# Make the module private to tree package.

18 changes: 15 additions & 3 deletions python-dm-tree/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,26 @@ pkgdesc='tree is a library for working with nested data structures'
arch=('x86_64')
url='https://tree.readthedocs.io'
license=('Apache-2.0')
depends=(python python-six)
depends=(python python-six abseil-cpp)
makedepends=(python python-build python-installer python-wheel python-setuptools
cmake git)
source=("$pkgname-$pkgver.tar.gz::https://pypi.org/packages/source/d/dm-tree/dm-tree-${pkgver}.tar.gz")
sha256sums=('0fcaabbb14e7980377439e7140bd05552739ca5e515ecb3119f234acee4b9430')
source=("$pkgname-$pkgver.tar.gz::https://pypi.org/packages/source/d/dm-tree/dm-tree-${pkgver}.tar.gz"
CMakeLists.txt.patch)

sha256sums=('0fcaabbb14e7980377439e7140bd05552739ca5e515ecb3119f234acee4b9430'
'abd81eb1d12a4dd3e33e599831581ba92a36228bf53d5a23e7ad19d380ef4e38')

_pkgname=dm-tree

prepare() {
cd "${srcdir}/${_pkgname}-${pkgver}"
for p in "${source[@]}"; do
if [[ ${p} == *.patch ]]; then
patch -Np1 -i "${srcdir}/${p}"
fi
done
}

build() {
cd "${srcdir}/${_pkgname}-${pkgver}"
python -m build --wheel --no-isolation
Expand Down