Merge pull request #212171 from alyssais/iconv

iconv: init (portable attribute for iconv(1))

authored by

John Ericson and committed by
GitHub
d35fb99d 13dcfc6d

+13 -15
+3 -6
pkgs/tools/inputmethods/skk/skk-dicts/default.nix
··· 1 - { lib, stdenv, fetchurl, buildPackages, libiconv, skktools }: 2 3 let 4 # kana to kanji ··· 25 url = "https://raw.githubusercontent.com/skk-dev/dict/8b35d07a7d2044d48b063d2774d9f9d00bb7cb48/SKK-JISYO.assoc"; 26 sha256 = "1smcbyv6srrhnpl7ic9nqds9nz3g2dgqngmhzkrdlwmvcpvakp1v"; 27 }; 28 - 29 - iconvBin = if stdenv.isDarwin then libiconv else buildPackages.stdenv.cc.libc; 30 in 31 32 stdenv.mkDerivation { 33 pname = "skk-dicts-unstable"; 34 version = "2020-03-24"; 35 srcs = [ small medium large edict assoc ]; 36 - nativeBuildInputs = [ skktools ] ++ lib.optional stdenv.isDarwin libiconv; 37 38 strictDeps = true; 39 ··· 51 for src in $srcs; do 52 dst=$out/share/$(dictname $src) 53 echo ";;; -*- coding: utf-8 -*-" > $dst # libskk requires this on the first line 54 - ${lib.getBin iconvBin}/bin/iconv \ 55 - -f EUC-JP -t UTF-8 $src | skkdic-expr2 >> $dst 56 done 57 58 # combine .L .edict and .assoc for convenience
··· 1 + { lib, stdenv, fetchurl, buildPackages, iconv, skktools }: 2 3 let 4 # kana to kanji ··· 25 url = "https://raw.githubusercontent.com/skk-dev/dict/8b35d07a7d2044d48b063d2774d9f9d00bb7cb48/SKK-JISYO.assoc"; 26 sha256 = "1smcbyv6srrhnpl7ic9nqds9nz3g2dgqngmhzkrdlwmvcpvakp1v"; 27 }; 28 in 29 30 stdenv.mkDerivation { 31 pname = "skk-dicts-unstable"; 32 version = "2020-03-24"; 33 srcs = [ small medium large edict assoc ]; 34 + nativeBuildInputs = [ iconv skktools ]; 35 36 strictDeps = true; 37 ··· 49 for src in $srcs; do 50 dst=$out/share/$(dictname $src) 51 echo ";;; -*- coding: utf-8 -*-" > $dst # libskk requires this on the first line 52 + iconv -f EUC-JP -t UTF-8 $src | skkdic-expr2 >> $dst 53 done 54 55 # combine .L .edict and .assoc for convenience
+2 -9
pkgs/tools/text/cmigemo/default.nix
··· 1 { lib, stdenv, fetchFromGitHub, buildPackages 2 - , libiconv, nkf, perl, which 3 , skk-dicts 4 }: 5 6 - let 7 - iconvBin = if stdenv.isDarwin then libiconv else buildPackages.stdenv.cc.libc; 8 - in 9 stdenv.mkDerivation { 10 pname = "cmigemo"; 11 version = "1.3e"; ··· 17 sha256 = "00a6kdmxp16b8x0p04ws050y39qspd1bqlfq74bkirc55b77a2m1"; 18 }; 19 20 - nativeBuildInputs = [ libiconv nkf perl which ]; 21 22 postUnpack = '' 23 cp ${skk-dicts}/share/SKK-JISYO.L source/dict/ ··· 26 patches = [ ./no-http-tool-check.patch ]; 27 28 makeFlags = [ "INSTALL=install" ]; 29 - 30 - preBuild = '' 31 - makeFlagsArray+=(FILTER_UTF8="${lib.getBin iconvBin}/bin/iconv -t utf-8 -f cp932") 32 - ''; 33 34 buildFlags = [ (if stdenv.isDarwin then "osx-all" else "gcc-all") ]; 35
··· 1 { lib, stdenv, fetchFromGitHub, buildPackages 2 + , iconv, nkf, perl, which 3 , skk-dicts 4 }: 5 6 stdenv.mkDerivation { 7 pname = "cmigemo"; 8 version = "1.3e"; ··· 14 sha256 = "00a6kdmxp16b8x0p04ws050y39qspd1bqlfq74bkirc55b77a2m1"; 15 }; 16 17 + nativeBuildInputs = [ iconv nkf perl which ]; 18 19 postUnpack = '' 20 cp ${skk-dicts}/share/SKK-JISYO.L source/dict/ ··· 23 patches = [ ./no-http-tool-check.patch ]; 24 25 makeFlags = [ "INSTALL=install" ]; 26 27 buildFlags = [ (if stdenv.isDarwin then "osx-all" else "gcc-all") ]; 28
+8
pkgs/top-level/all-packages.nix
··· 21331 21332 libiconvReal = callPackage ../development/libraries/libiconv { }; 21333 21334 # On non-GNU systems we need GNU Gettext for libintl. 21335 libintl = if stdenv.hostPlatform.libc != "glibc" then gettext else null; 21336
··· 21331 21332 libiconvReal = callPackage ../development/libraries/libiconv { }; 21333 21334 + iconv = 21335 + if lib.elem stdenv.hostPlatform.libc [ "glibc" "musl" ] then 21336 + lib.getBin stdenv.cc.libc 21337 + else if stdenv.hostPlatform.isDarwin then 21338 + lib.getBin darwin.libiconv 21339 + else 21340 + lib.getBin libiconvReal; 21341 + 21342 # On non-GNU systems we need GNU Gettext for libintl. 21343 libintl = if stdenv.hostPlatform.libc != "glibc" then gettext else null; 21344