diff --git a/setup.py b/setup.py index 7b5eb73..1f430af 100644 --- a/setup.py +++ b/setup.py @@ -40,10 +40,8 @@ }[platform.machine()] # Name of the Hugo binary that will be built -HUGO_BINARY_NAME = ( - f"hugo-{HUGO_VERSION}-{HUGO_PLATFORM}-{os.environ.get('GOARCH', HUGO_ARCH)}" - + FILE_EXT -) +# Can be overridden during cross-compilation +HUGO_BINARY_NAME = f"hugo-{HUGO_VERSION}-{os.environ.get('GOOS', HUGO_ARCH)}-{os.environ.get('GOARCH', HUGO_ARCH)}{FILE_EXT}" # ---------------------------------------------------------------------------------- @@ -370,7 +368,7 @@ def get_tag(self): # Handle cross-compilation on/to Windows via the Zig compiler # =========================================================== - if os.environ.get("GOOS") == "windows" or (sys.platform == "win32"): + elif os.environ.get("GOOS") == "windows" or (sys.platform == "win32"): if os.environ.get("GOARCH") == "arm64": platform_tag = "win_arm64" elif os.environ.get("GOARCH") == "amd64": @@ -386,7 +384,7 @@ def get_tag(self): # Also, let cibuildwheel handle the platform tags if it is being used, # since that is where we won't cross-compile at all but use the native # GitHub Actions runners. - if ((os.environ.get("GOOS") == "darwin") or (sys.platform == "darwin")) and ( + elif ((os.environ.get("GOOS") == "darwin") or (sys.platform == "darwin")) and ( os.environ.get("CIBUILDWHEEL") != "1" ): if os.environ.get("GOARCH") == "arm64": @@ -439,6 +437,5 @@ def run(self): f"binaries/{HUGO_BINARY_NAME}", ], }, - # has to be kept in sync with the version in hugo/cli.py version=HUGO_VERSION, )