diff --git a/projects/riverbankcomputing.com/sip/fib.sip b/projects/riverbankcomputing.com/sip/fib.sip new file mode 100644 index 0000000000..5e494b607d --- /dev/null +++ b/projects/riverbankcomputing.com/sip/fib.sip @@ -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 \ No newline at end of file diff --git a/projects/riverbankcomputing.com/sip/package.yml b/projects/riverbankcomputing.com/sip/package.yml new file mode 100644 index 0000000000..78462d7d38 --- /dev/null +++ b/projects/riverbankcomputing.com/sip/package.yml @@ -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 . \ No newline at end of file diff --git a/projects/riverbankcomputing.com/sip/pyproject.toml b/projects/riverbankcomputing.com/sip/pyproject.toml new file mode 100644 index 0000000000..cb1019eddf --- /dev/null +++ b/projects/riverbankcomputing.com/sip/pyproject.toml @@ -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" \ No newline at end of file