Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for FreeBSD #4872

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
import conda_build.windows as windows

if "bsd" in sys.platform:
shell_path = "/bin/sh"
jezdez marked this conversation as resolved.
Show resolved Hide resolved
shell_path = "/usr/local/bin/bash"
elif utils.on_win:
shell_path = "bash"
else:
Expand Down Expand Up @@ -3205,7 +3205,7 @@ def write_build_scripts(m, script, build_file):
with open(work_file, "w") as bf:
# bf.write('set -ex\n')
bf.write("if [ -z ${CONDA_BUILD+x} ]; then\n")
bf.write(f" source {env_file}\n")
bf.write(f" . {env_file}\n")
bf.write("fi\n")
if script:
bf.write(script)
Expand All @@ -3231,7 +3231,7 @@ def _write_test_run_script(
with open(test_run_script, "w") as tf:
tf.write(
'{source} "{test_env_script}"\n'.format(
source="call" if utils.on_win else "source",
source="call" if utils.on_win else ".",
test_env_script=test_env_script,
)
)
Expand Down
2 changes: 1 addition & 1 deletion conda_build/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ def get_shlib_ext(host_platform):
return ".dll"
elif host_platform in ["osx", "darwin"]:
return ".dylib"
elif host_platform.startswith("linux") or host_platform.endswith("-wasm32"):
elif host_platform.startswith(("linux", "freebsd")) or host_platform.endswith("-wasm32"):
return ".so"
elif host_platform == "noarch":
# noarch packages should not contain shared libraries, use the system
Expand Down
2 changes: 1 addition & 1 deletion conda_build/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def get_selectors(config: Config) -> dict[str, bool]:
linux32=bool(plat == "linux-32"),
linux64=bool(plat == "linux-64"),
arm=plat.startswith("linux-arm"),
unix=plat.startswith(("linux-", "osx-", "emscripten-")),
unix=plat.startswith(("linux-", "osx-", "emscripten-", "freebsd-")),
win32=bool(plat == "win-32"),
win64=bool(plat == "win-64"),
os=os,
Expand Down
1 change: 1 addition & 0 deletions conda_build/post.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"win": ("DLLfile", "EXEfile"),
"osx": ["machofile"],
"linux": ["elffile"],
"freebsd": ["elffile"],
}


Expand Down
2 changes: 1 addition & 1 deletion conda_build/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -934,7 +934,7 @@ def try_apply_patch(patch, patch_args, cwd, stdout, stderr):
temp_name = os.path.join(
tempfile.gettempdir(), next(tempfile._get_candidate_names())
)
base_patch_args = ["--no-backup-if-mismatch", "--batch"] + patch_args
base_patch_args = ["--posix", "--batch"] + patch_args
try:
try_patch_args = base_patch_args[:]
try_patch_args.append("--dry-run")
Expand Down
5 changes: 5 additions & 0 deletions conda_build/variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@
"cxx": "clangxx",
"fortran": "gfortran",
},
"freebsd": {
"c": "clang",
"cxx": "clangxx",
"fortran": "gfortran",
},
}

arch_name = subdir.rsplit("-", 1)[-1]
Expand Down
5 changes: 4 additions & 1 deletion docs/source/resources/define-metadata.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1931,7 +1931,10 @@ variables are booleans.
- True if the platform is either macOS or Windows and the
Python architecture is arm64.
* - unix
- True if the platform is either macOS or Linux or emscripten.
- True if the platform is either macOS or Linux or emscripten
or FreeBSD.
* - freebsd
- True if the platform is FreeBSD.
* - win
- True if the platform is Windows.
* - win32
Expand Down
19 changes: 19 additions & 0 deletions news/4872-add-freebsd-support
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* Add support for FreeBSD. (#4872)

### Bug fixes

* <news item>

### Deprecations

* <news item>

### Docs

* <news item>

### Other

* <news item>
Loading