libiconv: add "enableShared" option

When false, shared libraries will be disabled.

also adds patch to *really* disable shared libiconv.
This commit is contained in:
Matthew Bauer
2018-06-22 21:49:41 -04:00
parent 6946361408
commit 73e2f60837
2 changed files with 16 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
{ fetchurl, stdenv, lib
, buildPlatform, hostPlatform
, enableStatic ? stdenv.hostPlatform.useAndroidPrebuilt
, enableShared ? !stdenv.hostPlatform.useAndroidPrebuilt
}:
# assert !stdenv.isLinux || hostPlatform != buildPlatform; # TODO: improve on cross
@@ -23,10 +24,14 @@ stdenv.mkDerivation rec {
lib.optionalString ((hostPlatform != buildPlatform && hostPlatform.libc == "msvcrt") || stdenv.cc.nativeLibc)
''
sed '/^_GL_WARN_ON_USE (gets/d' -i srclib/stdio.in.h
'';
''
+ lib.optionalString (!enableShared) ''
sed -i -e '/preload/d' Makefile.in
'';
configureFlags = lib.optional stdenv.isFreeBSD "--with-pic"
++ lib.optional enableStatic "--enable-static";
++ lib.optional enableStatic "--enable-static"
++ lib.optional (!enableShared) "--disable-shared";
meta = {
description = "An iconv(3) implementation";