From be62259393a3cff405b9d84015f1a60d9150b355 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 22 Jan 2023 19:29:48 +0000 Subject: [PATCH 1/2] libcIconv: rename from glibcIconv MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There's nothing Glibc-specific about this function — it's already used for musl and wasilibc as well! I haven't bothered with an alias as I think it's highly unlikely anybody uses this function outside Nixpkgs. --- pkgs/top-level/all-packages.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1df342fa13dd..97661453c278 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21144,7 +21144,7 @@ with pkgs; # just in case you want it regardless of platform. libiconv = if lib.elem stdenv.hostPlatform.libc ["glibc" "musl" "wasilibc"] - then glibcIconv (if stdenv.hostPlatform != stdenv.buildPlatform + then libcIconv (if stdenv.hostPlatform != stdenv.buildPlatform then libcCross else stdenv.cc.libc) else if stdenv.hostPlatform.isDarwin @@ -21153,7 +21153,7 @@ with pkgs; then null else libiconvReal; - glibcIconv = libc: let + libcIconv = libc: let inherit (libc) pname version; libcDev = lib.getDev libc; in runCommand "${pname}-iconv-${version}" { strictDeps = true; } '' From b19185fdb2a5ffbbdb5689ef5ee30d17d208e217 Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Sun, 22 Jan 2023 19:31:16 +0000 Subject: [PATCH 2/2] libiconv: use libc header on NetBSD Let's be consistent about this. Updated netbsd.libc to have a pname attribute so it's compatible with libcIconv. --- pkgs/os-specific/bsd/netbsd/default.nix | 3 ++- pkgs/top-level/all-packages.nix | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/os-specific/bsd/netbsd/default.nix b/pkgs/os-specific/bsd/netbsd/default.nix index 37a0c35b1860..8903db9f36b7 100644 --- a/pkgs/os-specific/bsd/netbsd/default.nix +++ b/pkgs/os-specific/bsd/netbsd/default.nix @@ -54,7 +54,8 @@ in makeScopeWithSplicing mkDerivation = lib.makeOverridable (attrs: let stdenv' = if attrs.noCC or false then stdenvNoCC else stdenv; in stdenv'.mkDerivation ({ - name = "${attrs.pname or (baseNameOf attrs.path)}-netbsd-${attrs.version}"; + pname = "${attrs.pname or (baseNameOf attrs.path)}-netbsd"; + inherit (attrs) version; src = fetchNetBSD attrs.path attrs.version attrs.sha256; extraPaths = [ ]; diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 97661453c278..a2f9b2fa7b5f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21143,14 +21143,12 @@ with pkgs; # We also provide `libiconvReal`, which will always be a standalone libiconv, # just in case you want it regardless of platform. libiconv = - if lib.elem stdenv.hostPlatform.libc ["glibc" "musl" "wasilibc"] + if lib.elem stdenv.hostPlatform.libc [ "glibc" "musl" "nblibc" "wasilibc" ] then libcIconv (if stdenv.hostPlatform != stdenv.buildPlatform then libcCross else stdenv.cc.libc) else if stdenv.hostPlatform.isDarwin then darwin.libiconv - else if stdenv.hostPlatform.isNetBSD - then null else libiconvReal; libcIconv = libc: let