Skip to content

Commit

Permalink
meson (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdavid committed Jan 23, 2024
1 parent 0fbf892 commit 81603e2
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 1 deletion.
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,16 @@ build:

html: build
make -C docs html

meson:
rm builddir -rf
meson setup builddir
cd builddir && meson compile

meson_build:
python -m build

meson_install:
python -m venv venv
./venv/bin/pip install -U pip
./venv/bin/pip install build
65 changes: 65 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
project('pygit2', 'c', version: '1.13.2')

py = import('python').find_installation(pure: false)

#includes = include_directories('src')

# If some files (such as .py files) need to be copied to site-packages,
# this is where they get specified. Files get copied to
# <python directory>/site-packages/<subdir>
sources = [
'pygit2/__init__.py',
'pygit2/_build.py',
'pygit2/_run.py',
'pygit2/blame.py',
'pygit2/blob.py',
'pygit2/callbacks.py',
'pygit2/config.py',
'pygit2/credentials.py',
'pygit2/errors.py',
'pygit2/ffi.py',
'pygit2/filter.py',
'pygit2/index.py',
'pygit2/packbuilder.py',
'pygit2/refspec.py',
'pygit2/remote.py',
'pygit2/repository.py',
'pygit2/settings.py',
'pygit2/submodule.py',
'pygit2/utils.py',
]
py.install_sources(sources, subdir: 'pygit2', pure: false)

sources = [
'src/blob.c',
'src/branch.c',
'src/commit.c',
'src/diff.c',
'src/error.c',
'src/filter.c',
'src/mailmap.c',
'src/note.c',
'src/object.c',
'src/odb_backend.c',
'src/odb.c',
'src/oid.c',
'src/options.c',
'src/patch.c',
'src/pygit2.c',
'src/refdb_backend.c',
'src/refdb.c',
'src/reference.c',
'src/repository.c',
'src/revspec.c',
'src/signature.c',
'src/stash.c',
'src/tag.c',
'src/treebuilder.c',
'src/tree.c',
'src/utils.c',
'src/walker.c',
'src/wildmatch.c',
'src/worktree.c',
]

py.extension_module('_pygit2', sources, install: true)
33 changes: 32 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
[build-system]
requires = ["setuptools", "wheel"]
build-backend = 'mesonpy'
requires = ['meson-python']

[project]
name = 'pygit2'
version = '1.13.3'
description = 'Python bindings for libgit2.'
classifiers = [
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: PyPy',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Software Development :: Version Control',
]
dependencies = ['cffi>=1.16.0']
keywords = ['git']
license = {text = 'GPLv2 with linking exception'}
maintainers = [{name = 'J. David Ibáñez', email = '[email protected]'}]
readme = 'README.rst'
requires-python = '>=3.9'

[project.urls]
Homepage = 'https://github.com/libgit2/pygit2'
Documentation = 'https://www.pygit2.org/'
Changelog = 'https://github.com/libgit2/pygit2/blob/master/CHANGELOG.rst'
Funding = 'https://github.com/sponsors/jdavid'

[tool.cibuildwheel]
skip = "pp3* *musllinux_aarch64"
Expand Down
Empty file modified src/repository.h
100755 → 100644
Empty file.

0 comments on commit 81603e2

Please sign in to comment.