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

tk: fix installation on macOS #95510

Merged
merged 1 commit into from Aug 23, 2020
Merged

tk: fix installation on macOS #95510

merged 1 commit into from Aug 23, 2020

Conversation

hannesweisbach
Copy link
Contributor

@hannesweisbach hannesweisbach commented Aug 15, 2020

Motivation for this change

Installing libtk on macOS 10.15.5 resulted in a following warning:

warning: skipping dangling symlink '/nix/store/3whl4256v6qf15dsm1d5mf0lzhfh6w06-user-environment/lib/libtk.so'

which was caused by the following code in generic.nix of the tk derviation:

ln -s $out/lib/libtk${super.tcl.release}.so $out/lib/libtk.so

Shared libraries on macOS are suffixed `.dylib' not 'so' so libtk${version}.so does not actually exist. Consequently a symlink from libtk.dylib is never created and linking against tk fails.

I fixed it with an overlay first, but I guess it is time to upstream this fix.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Installing libtk on macOS 10.15.5 resulted in a following warning:

    warning: skipping dangling symlink '/nix/store/3whl4256v6qf15dsm1d5mf0lzhfh6w06-user-environment/lib/libtk.so'

which was caused by the following code in generic.nix of the tk derivation:

    ln -s $out/lib/libtk${super.tcl.release}.so $out/lib/libtk.so

Shared libraries on macOS are suffixed `.dylib' not 'so' so
libtk${version}.so does not actually exist. Consequently a symlink from
libtk.dylib is never created and linking against tk fails.
@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Aug 15, 2020
@ofborg ofborg bot requested review from lovek323 and vrthra August 15, 2020 18:40
@marsam
Copy link
Contributor

marsam commented Aug 23, 2020

@GrahamcOfBorg build tk

@marsam marsam merged commit 70cfd9d into NixOS:master Aug 23, 2020
@hannesweisbach hannesweisbach deleted the patch-1 branch August 24, 2020 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants