summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Smedstad2024-03-18 19:54:22 +0100
committerCarl Smedstad2024-04-04 19:19:07 +0200
commit755fe80d2ab9ceda863fc778967ebd28d086a667 (patch)
tree10c04d1a2614e020e50bc6cc34b5530dd5605de5
parentd4886d1faddba9bdd6d9321da153f2d0dfbd90c1 (diff)
downloadaur-755fe80d2ab9ceda863fc778967ebd28d086a667.tar.gz
upgpkg: 2024.04.01.00-1: Build Python extensions
-rw-r--r--.SRCINFO11
-rw-r--r--.gitignore1
-rw-r--r--PKGBUILD23
-rw-r--r--fix-setup-py-for-python-extensions.patch57
4 files changed, 86 insertions, 6 deletions
diff --git a/.SRCINFO b/.SRCINFO
index c9b82a7ce3ae..c91112105a63 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,13 +1,16 @@
pkgbase = folly
pkgdesc = An open-source C++ library developed and used at Facebook
- pkgver = 2024.03.11.00
+ pkgver = 2024.04.01.00
pkgrel = 1
url = https://github.com/facebook/folly
arch = x86_64
license = Apache-2.0
makedepends = boost
makedepends = cmake
+ makedepends = cython
makedepends = gtest
+ makedepends = python-setuptools
+ makedepends = python-wheel
depends = boost-libs
depends = bzip2
depends = double-conversion
@@ -31,11 +34,13 @@ pkgbase = folly
provides = libfolly_test_util.so
provides = libfollybenchmark.so
options = !lto
- source = folly-2024.03.11.00.tar.gz::https://github.com/facebook/folly/archive/v2024.03.11.00.tar.gz
+ source = folly-2024.04.01.00.tar.gz::https://github.com/facebook/folly/archive/v2024.04.01.00.tar.gz
source = fix-cmake-find-glog.patch
source = fix-missing-include.patch
- sha256sums = 057cff82142dbfacea455aa2ad30b3dd80e28a95a98ef43a27c1ca5cf77a373f
+ source = fix-setup-py-for-python-extensions.patch
+ sha256sums = 8d51e4e5d04ca29b752ecd57831fb78d79036877bbad424b371490b2a8bb5d11
sha256sums = 7655b9d6fd926770dae4d26f67b6aedf8fb6ff03927782bcfeffa09b5138b87c
sha256sums = 19cc8b4190e3c7d4ef9d1d9842a2def99bb261711ae85cb03e63787c4995e286
+ sha256sums = 1f369049ec6f14cc8682f0a8d6d08cca8ac49a1cf83f94914f0335adacba29c0
pkgname = folly
diff --git a/.gitignore b/.gitignore
index 8f90ebfc0d2f..941ec65c5cb7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@
!PKGBUILD
!fix-cmake-find-glog.patch
!fix-missing-include.patch
+!fix-setup-py-for-python-extensions.patch
diff --git a/PKGBUILD b/PKGBUILD
index 9bf8082570a3..189ebbf84868 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,10 +1,10 @@
+# Maintainer: Carl Smedstad <carsme@archlinux.org>
# Maintainer: Xiaoxu Guo <ftiasch0@gmail.com>
# Maintainer: László Várady <laszlo.varady93@gmail.com>
-# Maintainer: Carl Smedstad <carl.smedstad at protonmail dot com>
# Contributor: Daichi Shinozaki <dsdseg@gmail.com>
pkgname=folly
-pkgver=2024.03.11.00
+pkgver=2024.04.01.00
pkgrel=1
pkgdesc="An open-source C++ library developed and used at Facebook"
arch=(x86_64)
@@ -34,7 +34,10 @@ depends=(
makedepends=(
boost
cmake
+ cython
gtest
+ python-setuptools
+ python-wheel
)
provides=(
libfolly.so
@@ -46,11 +49,13 @@ source=(
"$pkgname-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz"
"fix-cmake-find-glog.patch"
"fix-missing-include.patch"
+ "fix-setup-py-for-python-extensions.patch"
)
sha256sums=(
- '057cff82142dbfacea455aa2ad30b3dd80e28a95a98ef43a27c1ca5cf77a373f'
+ '8d51e4e5d04ca29b752ecd57831fb78d79036877bbad424b371490b2a8bb5d11'
'7655b9d6fd926770dae4d26f67b6aedf8fb6ff03927782bcfeffa09b5138b87c'
'19cc8b4190e3c7d4ef9d1d9842a2def99bb261711ae85cb03e63787c4995e286'
+ '1f369049ec6f14cc8682f0a8d6d08cca8ac49a1cf83f94914f0335adacba29c0'
)
_archive="$pkgname-$pkgver"
@@ -60,6 +65,16 @@ prepare() {
patch --forward --strip=1 --input="$srcdir/fix-cmake-find-glog.patch"
patch --forward --strip=1 --input="$srcdir/fix-missing-include.patch"
+ patch --forward --strip=1 --input="$srcdir/fix-setup-py-for-python-extensions.patch"
+
+ # Remove non-existent test
+ sed -i '/LaunderTest/d' CMakeLists.txt
+
+ # The build will generate these files and fails if they already exist
+ rm folly/python/executor.cpp folly/python/iobuf.cpp
+
+ # Set Python extensions version
+ sed -i "s/version=\"0.0.1\"/version=\"$pkgver\"/" folly/python/setup.py
}
build() {
@@ -71,6 +86,7 @@ build() {
-Wno-dev \
-DBUILD_TESTS=ON \
-DBUILD_SHARED_LIBS=ON \
+ -DPYTHON_EXTENSIONS=ON \
-DPACKAGE_VERSION="$pkgver"
cmake --build build
}
@@ -88,6 +104,7 @@ check() {
atomic_unordered_map_test.AtomicUnorderedInsertMap.DISABLEDMegaMap
fbstring_test.FBString.testAllClauses
fbvector_test
+ heap_vector_types_test.HeapVectorTypes.SimpleSetTest
xlog_test.XlogTest.perFileCategoryHandling
)
local skipped_tests_pattern="${skipped_tests[0]}$(printf '|%s' "${skipped_tests[@]:1}")"
diff --git a/fix-setup-py-for-python-extensions.patch b/fix-setup-py-for-python-extensions.patch
new file mode 100644
index 000000000000..29715051829b
--- /dev/null
+++ b/fix-setup-py-for-python-extensions.patch
@@ -0,0 +1,57 @@
+From e21ddcf809472feb8010363a192fb5ca986d1167 Mon Sep 17 00:00:00 2001
+From: Carl Smedstad <carl.smedstad@protonmail.com>
+Date: Thu, 4 Apr 2024 10:07:57 +0200
+Subject: [PATCH] Fix setup.py for Python extensions
+
+* Add missing .cpp files to sources.
+* Define `GLOG_USE_GLOG_EXPORT` for compatibility with glog v0.7+.
+* Don't bundle and install .h and .pxd files.
+---
+ folly/python/setup.py | 19 ++++++++++++++++---
+ 1 file changed, 16 insertions(+), 3 deletions(-)
+
+diff --git a/folly/python/setup.py b/folly/python/setup.py
+index fc2d2fe0a..0954a9062 100755
+--- a/folly/python/setup.py
++++ b/folly/python/setup.py
+@@ -28,13 +28,27 @@ Options.fast_fail = True
+ exts = [
+ Extension(
+ "folly.executor",
+- sources=["folly/executor.pyx"],
++ sources=[
++ "folly/executor.pyx",
++ "folly/GILAwareManualExecutor.cpp",
++ "folly/ProactorExecutor.cpp",
++ "folly/error.cpp",
++ "folly/iobuf_ext.cpp",
++ ],
+ libraries=["folly", "glog", "double-conversion", "iberty"],
++ define_macros=[('GLOG_USE_GLOG_EXPORT', '1')],
+ ),
+ Extension(
+ "folly.iobuf",
+- sources=["folly/iobuf.pyx"],
++ sources=[
++ "folly/iobuf.pyx",
++ "folly/GILAwareManualExecutor.cpp",
++ "folly/ProactorExecutor.cpp",
++ "folly/error.cpp",
++ "folly/iobuf_ext.cpp",
++ ],
+ libraries=["folly", "glog", "double-conversion", "iberty"],
++ define_macros=[('GLOG_USE_GLOG_EXPORT', '1')],
+ ),
+ ]
+
+@@ -42,7 +56,6 @@ setup(
+ name="folly",
+ version="0.0.1",
+ packages=["folly"],
+- package_data={"": ["*.pxd", "*.h"]},
+ setup_requires=["cython"],
+ zip_safe=False,
+ ext_modules=cythonize(exts, compiler_directives={"language_level": 3}),
+--
+2.44.0
+