Skip to content

Commit

Permalink
hack
Browse files Browse the repository at this point in the history
  • Loading branch information
tomba committed Oct 6, 2023
1 parent b91affd commit 717b6f6
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 12 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Build

on: [push, pull_request]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
# os: [ubuntu-20.04, windows-2019, macOS-11]

steps:
- uses: actions/checkout@v4

# Used to host cibuildwheel
- uses: actions/setup-python@v3

- name: install deps
run: sudo apt install -y meson ninja-build libdrm-dev libevdev-dev libfmt-dev

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.16.2

- name: Build wheels
run: python -m cibuildwheel --output-dir wheelhouse
# to supply options, put them in 'env', like:
# env:
# CIBW_SOME_OPTION: value

- uses: actions/upload-artifact@v3
with:
path: ./wheelhouse/*.whl
20 changes: 8 additions & 12 deletions py/pykms/meson.build
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
py3_dep = dependency('python3', required : get_option('pykms'))
py = import('python').find_installation('python3')

py3_dep = py.dependency()

if py3_dep.found() == false
pybindings_enabled = false
subdir_done()
endif

pybind11_dep = dependency('pybind11', fallback : ['pybind11', 'pybind11_dep'],
required : get_option('pykms'))
pybind11_dep = dependency('pybind11', required : true)

if pybind11_dep.found() == false
pybindings_enabled = false
Expand Down Expand Up @@ -44,16 +45,11 @@ endif

pykms_args = [ '-fvisibility=hidden' ]

destdir = get_option('libdir') / 'python' + py3_dep.version() / 'site-packages/pykms'

pykms = shared_module('pykms',
pykms = py.extension_module('pykms',
pykms_sources,
install : true,
install_dir : destdir,
name_prefix : '',
install : false,
# install_dir : destdir,
# name_prefix : '',
dependencies : pykms_deps,
cpp_args : pykms_args)

# Copy __init__.py to build dir so that we can run without installing
configure_file(input: '__init__.py', output: '__init__.py', copy: true,
install : true, install_dir : destdir)
19 changes: 19 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[build-system]
build-backend = 'mesonpy'
requires = ['meson-python', 'pybind11']

[project]
name = 'pykms'
version = '0.0.0a1'
description = 'kms++ python bindings'
readme = 'README.md'
requires-python = '>=3.10'

#[project.urls]
#Source = "https://github.com/will-v-pi/pykms"
#"kms++ Homepage" = "https://github.com/tomba/kmsxx"

#[tool.meson-python.args]
#setup = [
# '-Drevision=a4002d2'
#]

0 comments on commit 717b6f6

Please sign in to comment.