Initial push
This commit is contained in:
31
src/data/cbindings/python_package_works/setup.py
Normal file
31
src/data/cbindings/python_package_works/setup.py
Normal file
@@ -0,0 +1,31 @@
|
||||
from setuptools import setup, Extension
|
||||
import gi
|
||||
gi.require_version("GdkPixbuf", "2.0")
|
||||
|
||||
from gi.repository import GdkPixbuf
|
||||
from gi.repository import GObject
|
||||
|
||||
pkg_config_args = [
|
||||
"--cflags", "--libs",
|
||||
"gdk-pixbuf-2.0",
|
||||
"cairo"
|
||||
]
|
||||
|
||||
from subprocess import check_output
|
||||
|
||||
def get_pkgconfig_flags(flag_type):
|
||||
return check_output(["pkg-config", flag_type] + pkg_config_args).decode().split()
|
||||
|
||||
ext = Extension(
|
||||
"pixbuf2cairo",
|
||||
sources=["pixbuf2cairo.c"],
|
||||
include_dirs=[],
|
||||
extra_compile_args=get_pkgconfig_flags("--cflags"),
|
||||
extra_link_args=get_pkgconfig_flags("--libs")
|
||||
)
|
||||
|
||||
setup(
|
||||
name="pixbuf2cairo",
|
||||
version="0.1",
|
||||
ext_modules=[ext]
|
||||
)
|
Reference in New Issue
Block a user