File: setup.py

package info (click to toggle)
python-auditwheel 5.3.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 816 kB
  • sloc: python: 4,270; ansic: 205; cpp: 58; makefile: 20; f90: 12
file content (35 lines) | stat: -rw-r--r-- 787 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import os
import subprocess

from setuptools import Extension, setup

cmd = "gcc -fPIC -shared -o b/libb.so b/b.c"
subprocess.check_call(cmd.split())
cmd = (
    "gcc -fPIC -shared -o a/liba.so "
    "-Wl,{dtags_flag} -Wl,-rpath=$ORIGIN/../b "
    "-Ib a/a.c -Lb -lb"
).format(
    dtags_flag=(
        "--enable-new-dtags"
        if os.getenv("DTAG") == "runpath"
        else "--disable-new-dtags"
    )
)
subprocess.check_call(cmd.split())

setup(
    name="testrpath",
    version="0.0.1",
    packages=["testrpath"],
    package_dir={"": "src"},
    ext_modules=[
        Extension(
            "testrpath/testrpath",
            sources=["src/testrpath/testrpath.c"],
            include_dirs=["a"],
            libraries=["a"],
            library_dirs=["a"],
        )
    ],
)