| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
import subprocess |
| 4 |
|
| 5 |
from setuptools import setup |
| 6 |
|
| 7 |
subprocess.check_call( |
| 8 |
( |
| 9 |
"gcc", |
| 10 |
"testpackage/testprogram.c", |
| 11 |
"-lgsl", |
| 12 |
"-lgslcblas", |
| 13 |
"-o", |
| 14 |
"testpackage/testprogram", |
| 15 |
), |
| 16 |
) |
| 17 |
subprocess.check_call( |
| 18 |
("gcc", "testpackage/testprogram_nodeps.c", "-o", "testpackage/testprogram_nodeps"), |
| 19 |
) |
| 20 |
|
| 21 |
setup( |
| 22 |
name="testpackage", |
| 23 |
version="0.0.1", |
| 24 |
packages=["testpackage"], |
| 25 |
package_data={"testpackage": ["testprogram", "testprogram_nodeps"]}, |
| 26 |
# This places these files at a path like |
| 27 |
# "testpackage-0.0.1.data/scripts/testprogram", which is needed to test |
| 28 |
# rewriting ELF binaries installed into the scripts directory. |
| 29 |
# |
| 30 |
# Note that using scripts=[] doesn't work here since setuptools expects the |
| 31 |
# scripts to be text and tries to decode them using UTF-8. |
| 32 |
data_files=[ |
| 33 |
("../scripts", ["testpackage/testprogram", "testpackage/testprogram_nodeps"]), |
| 34 |
], |
| 35 |
) |