Skip to content

Commit

Permalink
build scripts: ensure taglib build path is specific for used compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
supermihi committed Mar 16, 2024
1 parent 5c2fe86 commit f02204a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
14 changes: 7 additions & 7 deletions build_taglib.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
from pathlib import Path

system = platform.system()
python_version = platform.python_version()
python_implementation = sys.implementation.name
here = Path(__file__).resolve().parent

taglib_version = "2.0"
Expand All @@ -21,20 +19,22 @@
utfcpp_version = "4.0.5"
utfcpp_release = f"https://github.com/nemtrif/utfcpp/archive/refs/tags/v{utfcpp_version}.tar.gz"

sys_identifier = f"{system}-{platform.machine()}-{sys.implementation.name}-{platform.python_version()}"

class Configuration:
def __init__(self):
self.build_path = here / "build"
self.tl_install_dir = self.build_path / "taglib" / f"{system}-{python_implementation}-{python_version}"
self.build_base = here / "build"
self.build_path = self.build_base / sys_identifier
self.tl_install_dir = self.build_path / "taglib"
self.clean = False

@property
def tl_download_dest(self):
return self.build_path / f"taglib-{taglib_version}.tar.gz"
return self.build_base / f"taglib-{taglib_version}.tar.gz"

@property
def utfcpp_download_dest(self):
return self.build_path / f"utfcpp-{utfcpp_version}.tar.gz"
return self.build_base / f"utfcpp-{utfcpp_version}.tar.gz"

@property
def tl_extract_dir(self):
Expand Down Expand Up @@ -163,7 +163,7 @@ def parse_args() -> Configuration:


def run():
print(f"building taglib on {system}, for {python_implementation} {python_version} ...")
print(f"building taglib on {sys_identifier} ...")
config = parse_args()
tag_lib = (
config.tl_install_dir
Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,9 @@
from Cython.Build import cythonize
from setuptools import setup, Extension

system = platform.system()
python_version = platform.python_version()
python_implementation = sys.implementation.name
sys_identifier = f"{platform.system()}-{platform.machine()}-{sys.implementation.name}-{platform.python_version()}"
here = Path(__file__).resolve().parent
default_taglib_path = here / "build" / "taglib" / f"{system}-{python_implementation}-{python_version}"
default_taglib_path = here / "build" / sys_identifier / "taglib"

src = Path("src")

Expand Down

0 comments on commit f02204a

Please sign in to comment.