pycairo: add recipe (#8895)

This commit is contained in:
hfsfox
2023-06-28 21:26:32 +03:00
committed by GitHub
parent 2c417281b0
commit 9feb75caf0
2 changed files with 113 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
From e34815392264061a90515bec7abb880ff1dee15a Mon Sep 17 00:00:00 2001
From: hfsfox <darkkitsunezx128k2309@gmail.com>
Date: Wed, 28 Jun 2023 15:41:57 +0000
Subject: fix headers path
diff --git a/setup.py b/setup.py
old mode 100755
new mode 100644
index b91fb5c..40ea407
--- a/setup.py
+++ b/setup.py
@@ -380,7 +380,7 @@ class install_pycairo_header(Command):
source = self.get_inputs()[0]
# for things using get_include()
- lib_hdir = os.path.join(self.install_lib, "cairo", "include")
+ lib_hdir = os.path.join(self.install_lib, "cairo", "develop/headers")
self.mkpath(lib_hdir)
lib_header_path = os.path.join(lib_hdir, hname)
(out, _) = self.copy_file(source, lib_header_path)
@@ -394,7 +394,7 @@ class install_pycairo_header(Command):
return
# for things using pkg-config
- data_hdir = os.path.join(self.install_data, "include", "pycairo")
+ data_hdir = os.path.join(self.install_data, "develop/headers", "pycairo")
self.mkpath(data_hdir)
header_path = os.path.join(data_hdir, hname)
(out, _) = self.copy_file(source, header_path)
--
2.37.3

View File

@@ -0,0 +1,80 @@
SUMMARY="A Python module providing bindings for the cairo library"
DESCRIPTION="The Pycairo bindings are designed to match the cairo C API as closely as possible, \
and to deviate only in cases which are clearly better implemented in a more Pythonic way."
HOMEPAGE="https://pypi.org/project/pycairo/"
COPYRIGHT="2023 pycairo developers"
LICENSE="GNU LGPL v2.1"
REVISION="1"
SOURCE_URI="https://github.com/pygobject/pycairo/releases/download/v$portVersion/pycairo-$portVersion.tar.gz"
CHECKSUM_SHA256="1444d52f1bb4cc79a4a0c0fe2ccec4bd78ff885ab01ebe1c0f637d8392bcafb6"
PATCHES="$portName-$portVersion.patchset"
ARCHITECTURES="?all x86_64 ?x86_gcc2 ?x86"
PROVIDES="
$portName = $portVersion
"
REQUIRES="
haiku
lib:libcairo$secondaryArchSuffix
lib:libcairo_gobject$secondaryArchSuffix
lib:libcairo_script_interpreter$secondaryArchSuffix
"
BUILD_REQUIRES="
haiku_devel
devel:libcairo$secondaryArchSuffix
devel:libcairo_gobject$secondaryArchSuffix
devel:libcairo_script_interpreter$secondaryArchSuffix
"
PYTHON_PACKAGES=(python38 python39 python310)
PYTHON_VERSIONS=(3.8 3.9 3.10)
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
eval "PROVIDES_${pythonPackage}=\"
${portName}_$pythonPackage = $portVersion
\""
eval "REQUIRES_$pythonPackage=\"
haiku
setuptools_$pythonPackage
toml_$pythonPackage
cmd:git
cmd:python$pythonVersion
\""
BUILD_REQUIRES="$BUILD_REQUIRES
packaging_$pythonPackage
setuptools_$pythonPackage
"
BUILD_PREREQUIRES="$BUILD_PREREQUIRES
cmd:aclocal
cmd:autoconf
cmd:automake
cmd:gcc$secondaryArchSuffix
cmd:python$pythonVersion
cmd:ld$secondaryArchSuffix
cmd:libtoolize
cmd:make
cmd:pkg_config$secondaryArchSuffix
"
done
INSTALL()
{
for i in "${!PYTHON_PACKAGES[@]}"; do
pythonPackage=${PYTHON_PACKAGES[i]}
pythonVersion=${PYTHON_VERSIONS[$i]}
python=python$pythonVersion
installLocation=$prefix/lib/$python/vendor-packages/
export PYTHONPATH=$installLocation:$PYTHONPATH
mkdir -p $installLocation
rm -rf build
$python setup.py build install \
--root=/ --prefix=$prefix
packageEntries $pythonPackage \
$prefix/lib/python*
done
}