2025-09-15 18:51:41 -05:00
|
|
|
# Python imports
|
2025-09-12 12:07:47 -05:00
|
|
|
from setuptools import setup, Extension
|
2025-09-15 18:51:41 -05:00
|
|
|
from subprocess import check_output
|
2025-09-12 12:07:47 -05:00
|
|
|
|
2025-09-15 18:51:41 -05:00
|
|
|
# Lib imports
|
2025-09-12 12:07:47 -05:00
|
|
|
|
2025-09-15 18:51:41 -05:00
|
|
|
# Application imports
|
2025-09-12 12:07:47 -05:00
|
|
|
|
2025-09-15 18:51:41 -05:00
|
|
|
|
|
|
|
|
|
|
|
pkg_config_args = ["gdk-pixbuf-2.0", "cairo"]
|
2025-09-12 12:07:47 -05:00
|
|
|
|
|
|
|
def get_pkgconfig_flags(flag_type):
|
|
|
|
return check_output(["pkg-config", flag_type] + pkg_config_args).decode().split()
|
|
|
|
|
|
|
|
ext = Extension(
|
|
|
|
"pixbuf2cairo",
|
2025-09-15 18:51:41 -05:00
|
|
|
sources = ["pixbuf2cairo.c"],
|
|
|
|
include_dirs = [],
|
|
|
|
extra_compile_args = get_pkgconfig_flags("--cflags"),
|
|
|
|
extra_link_args = get_pkgconfig_flags("--libs")
|
2025-09-12 12:07:47 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
setup(
|
2025-09-15 18:51:41 -05:00
|
|
|
name = "pixbuf2cairo",
|
|
|
|
version = "0.1",
|
|
|
|
ext_modules = [ext]
|
2025-09-12 12:07:47 -05:00
|
|
|
)
|