Cleanning up setup.py
This commit is contained in:
@@ -1,31 +1,28 @@
|
|||||||
|
# Python imports
|
||||||
from setuptools import setup, Extension
|
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
|
from subprocess import check_output
|
||||||
|
|
||||||
|
# Lib imports
|
||||||
|
|
||||||
|
# Application imports
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
pkg_config_args = ["--cflags", "--libs", "gdk-pixbuf-2.0", "cairo"]
|
||||||
|
|
||||||
def get_pkgconfig_flags(flag_type):
|
def get_pkgconfig_flags(flag_type):
|
||||||
return check_output(["pkg-config", flag_type] + pkg_config_args).decode().split()
|
return check_output(["pkg-config", flag_type] + pkg_config_args).decode().split()
|
||||||
|
|
||||||
ext = Extension(
|
ext = Extension(
|
||||||
"pixbuf2cairo",
|
"pixbuf2cairo",
|
||||||
sources=["pixbuf2cairo.c"],
|
sources = ["pixbuf2cairo.c"],
|
||||||
include_dirs=[],
|
include_dirs = [],
|
||||||
extra_compile_args=get_pkgconfig_flags("--cflags"),
|
extra_compile_args = get_pkgconfig_flags("--cflags"),
|
||||||
extra_link_args=get_pkgconfig_flags("--libs")
|
extra_link_args = get_pkgconfig_flags("--libs")
|
||||||
)
|
)
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name="pixbuf2cairo",
|
name = "pixbuf2cairo",
|
||||||
version="0.1",
|
version = "0.1",
|
||||||
ext_modules=[ext]
|
ext_modules = [ext]
|
||||||
)
|
)
|
||||||
|
Reference in New Issue
Block a user