riverbankcomputing.com/sip (#2759)

* riverbankcomputing.com/sip

* gcc

* deps
This commit is contained in:
Andrew 2023-08-07 21:51:19 +03:00 committed by GitHub
parent 74730a1eba
commit fc4cf57990
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 62 additions and 0 deletions

View file

@ -0,0 +1,24 @@
// Define the SIP wrapper to the (theoretical) fib library.
%Module(name=fib, language="C")
int fib_n(int n);
%MethodCode
if (a0 <= 0)
{
sipRes = 0;
}
else
{
int a = 0, b = 1, c, i;
for (i = 2; i <= a0; i++)
{
c = a + b;
a = b;
b = c;
}
sipRes = b;
}
%End

View file

@ -0,0 +1,30 @@
distributable:
url: https://www.riverbankcomputing.com/hg/sip/archive/{{version}}.tar.gz
strip-components: 1
versions:
url: https://www.riverbankcomputing.com/hg/sip/tags
match: /rev\/\d+\.\d+\.\d+/
strip:
- /^rev\//
dependencies:
python.org: ^3.11
linux:
tea.xyz/gx/cc: c99
build:
script:
- python-venv.sh {{prefix}}/bin/sip-install
- python-venv.sh {{prefix}}/bin/sip-build
- python-venv.sh {{prefix}}/bin/sip-distinfo
- python-venv.sh {{prefix}}/bin/sip-module
- python-venv.sh {{prefix}}/bin/sip-sdist
- python-venv.sh {{prefix}}/bin/sip-wheel
provides:
- bin/sip-install
- bin/sip-build
- bin/sip-distinfo
- bin/sip-module
- bin/sip-sdist
- bin/sip-wheel
test:
script:
- sip-install --target-dir .

View file

@ -0,0 +1,8 @@
# Specify sip v6 as the build system for the package.
[build-system]
requires = ["sip >=6, <7"]
build-backend = "sipbuild.api"
# Specify the PEP 566 metadata for the project.
[tool.sip.metadata]
name = "fib"