Skip to content

Commit

Permalink
馃帎 Fix macOS host to Windows target
Browse files Browse the repository at this point in the history
  • Loading branch information
agriyakhetarpal committed Apr 25, 2024
1 parent 0a5cc66 commit a972a51
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}"

# ----------------------------------------------------------------------------------

Expand Down Expand Up @@ -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":
Expand All @@ -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":
Expand Down Expand Up @@ -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,
)

0 comments on commit a972a51

Please sign in to comment.