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

darwin.libiconv: switch to libiconvReal and add to darwin-aliases #299613

Merged
merged 3 commits into from
Mar 29, 2024
Merged
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
3 changes: 2 additions & 1 deletion pkgs/applications/editors/vim/macvim.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
, perl
, luajit
, darwin
, libiconv
, python3
}:

Expand Down Expand Up @@ -127,7 +128,7 @@ stdenv.mkDerivation {
--replace " -L${stdenv.cc.libc}/lib" "" \
--replace " -L${darwin.libobjc}/lib" "" \
--replace " -L${darwin.libunwind}/lib" "" \
--replace " -L${darwin.libiconv}/lib" ""
--replace " -L${libiconv}/lib" ""

# All the libraries we stripped have -osx- in their name as of this time.
# Assert now that this pattern no longer appears in config.mk.
Expand Down
3 changes: 2 additions & 1 deletion pkgs/by-name/fr/frankenphp/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
, testers
, frankenphp
, darwin
, libiconv
, pkg-config
, makeBinaryWrapper
, runCommand
Expand Down Expand Up @@ -64,7 +65,7 @@ in buildGoModule rec {
'' + lib.optionalString stdenv.isDarwin ''
# replace hard-code homebrew path
substituteInPlace ../frankenphp.go \
--replace "-L/opt/homebrew/opt/libiconv/lib" "-L${darwin.libiconv}/lib"
--replace "-L/opt/homebrew/opt/libiconv/lib" "-L${libiconv}/lib"
'';

preFixup = ''
Expand Down
12 changes: 6 additions & 6 deletions pkgs/development/libraries/libiconv/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ stdenv.mkDerivation rec {
+ lib.optionalString enableDarwinABICompat ''
for iconv_h_in in iconv.h.in iconv.h.build.in; do
substituteInPlace "include/$iconv_h_in" \
--replace "#define iconv libiconv" "" \
--replace "#define iconv_close libiconv_close" "" \
--replace "#define iconv_open libiconv_open" "" \
--replace "#define iconv_open_into libiconv_open_into" "" \
--replace "#define iconvctl libiconvctl" "" \
--replace "#define iconvlist libiconvlist" ""
--replace-fail "#define iconv libiconv" "" \
--replace-fail "#define iconv_close libiconv_close" "" \
--replace-fail "#define iconv_open libiconv_open" "" \
--replace-fail "#define iconv_open_into libiconv_open_into" "" \
--replace-fail "#define iconvctl libiconvctl" "" \
--replace-fail "#define iconvlist libiconvlist" ""
done
'';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
, stdenv
, buildPythonPackage
, cargo
, darwin
, libiconv
, fetchFromGitHub
, json-stream
, json-stream-rs-tokenizer
Expand Down Expand Up @@ -45,7 +45,7 @@ buildPythonPackage rec {
];

buildInputs = lib.optionals stdenv.isDarwin [
darwin.libiconv
libiconv
];

# Tests depend on json-stream, which depends on this package.
Expand Down
3 changes: 0 additions & 3 deletions pkgs/os-specific/darwin/apple-source-releases/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ let
versions = {
"osx-10.12.6" = {
xnu = "3789.70.16";
libiconv = "50";
Libnotify = "165.20.1";
objc4 = "709.1";
dyld = "433.5";
Expand All @@ -35,7 +34,6 @@ let
dtrace = "168";
xnu = "3248.60.10";
libpthread = "138.10.4";
libiconv = "44";
Libnotify = "150.40.1";
objc4 = "680";
eap8021x = "222.40.1";
Expand Down Expand Up @@ -269,7 +267,6 @@ developerToolsPackages_11_3_1 // macosPackages_11_0_1 // {
};
libclosure = applePackage "libclosure" "osx-10.11.6" "sha256-L5rQ+UBpf3B+W1U+gZKk7fXulslHsc8lxnCsplV+nr0=" {};
libdispatch = applePackage "libdispatch" "osx-10.10.5" "sha256-jfAEk0OLrJa9AIZVikIoHomd+l+4rCfc320Xh50qK5M=" {};
libiconv = applePackage "libiconv" "osx-10.12.6" "sha256-ZzPFkchK3EU95UQUVVrR0t8iilhi/VnIkjjtP6KT2oI=" {};
Libinfo = applePackage "Libinfo" "osx-10.11.6" "sha256-6F7wiwerv4nz/xXHtp1qCHSaFzZgzcRN+jbmXA5oWOQ=" {};
Libm = applePackage "Libm" "osx-10.7.4" "sha256-KjMETfT4qJm0m0Ux/F6Rq8bI4Q4UVnFx6IKbKxXd+Es=" {};
Libnotify = applePackage "Libnotify" "osx-10.12.6" "sha256-6wvMBxAUfiYcQtmlfYCj1d3kFmFM/jdboTd7hRvi3e4=" {};
Expand Down
38 changes: 0 additions & 38 deletions pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ file_cmds = applePackage' "file_cmds" "321.40.3" "macos-11.0.1" "0p077lnbcy8266m
hfs = applePackage' "hfs" "556.41.1" "macos-11.0.1" "0a0s6b12b0q07wslfifna0bj51dml9v098i4crr2m1vivnx4xj75" {};
libclosure = applePackage' "libclosure" "78" "macos-11.0.1" "0vf9n0k3m8dbprv1bf45zqg0g43bidy2i5z1v9a826bsf8lv7am7" {};
libdispatch = applePackage' "libdispatch" "1271.40.12" "macos-11.0.1" "1ck5srcjapg18vqb8wl08gacs7ndc6xr067qjn3ngx39q1jdcywz" {};
libiconv = applePackage' "libiconv" "59" "macos-11.0.1" "0lwa4brdwm4lvrdnxylzsn1yph4m7csgri2zkc4xb4xiisz32pwp" {};
libmalloc = applePackage' "libmalloc" "317.40.8" "macos-11.0.1" "sha256-Tdhb0mq3w4Hwvp3xHB79Vr22hCOQK6h28HCsd7jvITI=" {};
libplatform = applePackage' "libplatform" "254.40.4" "macos-11.0.1" "1qf3ri0yd8b1xjln1j1gyx7ks6k3a2jhd63blyvfby75y9s7flky" {};
libpthread = applePackage' "libpthread" "454.40.3" "macos-11.0.1" "0zljbw8mpb80n1if65hhi9lkgwbgjr8vc9wvf7q1nl3mzyl35f8p" {};
Expand Down
6 changes: 3 additions & 3 deletions pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -22711,7 +22711,7 @@ with pkgs;

# GNU libc provides libiconv so systems with glibc don't need to
# build libiconv separately. Additionally, Apple forked/repackaged
# libiconv so we use that instead of the vanilla version on that OS,
# libiconv, so build and use the upstream one with a compatible ABI,
# and BSDs include libiconv in libc.
#
# We also provide `libiconvReal`, which will always be a standalone libiconv,
Expand All @@ -22722,7 +22722,7 @@ with pkgs;
then libcCross
else stdenv.cc.libc)
else if stdenv.hostPlatform.isDarwin
then darwin.libiconv
then libiconvReal.override { enableDarwinABICompat = true; }
else libiconvReal;

libcIconv = libc: let
Expand All @@ -22739,7 +22739,7 @@ with pkgs;
if lib.elem stdenv.hostPlatform.libc [ "glibc" "musl" ] then
lib.getBin stdenv.cc.libc
else if stdenv.hostPlatform.isDarwin then
lib.getBin darwin.libiconv
lib.getBin libiconv
else
lib.getBin libiconvReal;

Expand Down
4 changes: 4 additions & 0 deletions pkgs/top-level/darwin-aliases.nix
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,8 @@ mapAliases ({
### B ###

builder = throw "'darwin.builder' has been changed and renamed to 'darwin.linux-builder'. The default ssh port is now 31022. Please update your configuration or override the port back to 22. See https://nixos.org/manual/nixpkgs/unstable/#sec-darwin-builder"; # added 2023-07-06

### L ###

libiconv = pkgs.libiconv; # 2024-03-27
})
6 changes: 1 addition & 5 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2513,7 +2513,6 @@ self: super: with self; {
cryptodatahub = callPackage ../development/python-modules/cryptodatahub { };

cryptography = callPackage ../development/python-modules/cryptography {
inherit (pkgs.darwin) libiconv;
inherit (pkgs.darwin.apple_sdk.frameworks) Security;
};

Expand All @@ -2538,7 +2537,6 @@ self: super: with self; {
css-html-js-minify = callPackage ../development/python-modules/css-html-js-minify { };

css-inline = callPackage ../development/python-modules/css-inline {
inherit (pkgs.darwin) libiconv;
inherit (pkgs.darwin.apple_sdk.frameworks) Security SystemConfiguration;
};

Expand Down Expand Up @@ -11459,9 +11457,7 @@ self: super: with self; {

pyreaderwriterlock = callPackage ../development/python-modules/pyreaderwriterlock { };

pyreadstat = callPackage ../development/python-modules/pyreadstat {
inherit (pkgs.darwin) libiconv;
};
pyreadstat = callPackage ../development/python-modules/pyreadstat { };

pyrealsense2 = toPythonModule (pkgs.librealsense.override {
enablePython = true;
Expand Down