Skip to content

Commit

Permalink
Install cygwin for windows LHAPDF compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed Mar 27, 2024
1 parent 3855495 commit 97a6bb9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions .github/workflows/cli-wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ jobs:
3.10
- name: Install non-Rust dependencies
run: |
choco install cygwin
python maintainer/install-lhapdf.py
- name: Build wheels
uses: PyO3/maturin-action@v1
Expand Down
1 change: 1 addition & 0 deletions maintainer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__pycache__/
8 changes: 5 additions & 3 deletions maintainer/install-lhapdf.py → maintainer/install_lhapdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,16 @@ def run_(cmd, *args, **kwargs):
cmd = cmd.split() if isinstance(cmd, str) else cmd
run(cmd, *args, cwd=path / SRC_DIR, **kwargs)

log.info("Autoreconf...")
run_("autoreconf -f -i")
prefix = os.environ.get("PREFIX")
prefix_ = ["--prefix", prefix] if prefix is not None else []
log.info("Configuring...")
run_(["./configure"] + prefix_, env={"PYTHON": sys.executable})
log.info("Configured")
log.info("Building...")
run_("make clean")
run_("make -j")
log.info("Built")
log.info("Installing...")
run_("make install")
log.info("Installed")

Expand All @@ -55,7 +57,7 @@ def main():
log.info(f"Downloaded {HOST}{PATH}")
with tempfile.TemporaryDirectory() as tmpd:
tarfile.open(fileobj=io.BytesIO(tar), mode="r:gz").extractall(tmpd)
log.info(f"Extracted LHAPDF tarbal in {tmpd}")
log.info(f"Extracted LHAPDF tarball in {tmpd}")
install(Path(tmpd))


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
log = logging.getLogger("binary-patch")
log.setLevel(logging.INFO)

WRAPPER = """
WRAPPER = """\
#!python
import os
import sys
import sysconfig
if __name__ == "__main__":
os.execv(
os.path.join(sysconfig.get_path("platlib"), {binary_path!r}),
Expand Down

0 comments on commit 97a6bb9

Please sign in to comment.