libiconv: use enableFeature for static/shared

This makes things more predictable w.r.t. what is actually being built.
This commit is contained in:
Matthew Bauer 2018-07-03 16:51:30 -04:00
parent ea08cf9e6c
commit f7138342cb
2 changed files with 8 additions and 5 deletions

View File

@ -29,9 +29,10 @@ stdenv.mkDerivation rec {
sed -i -e '/preload/d' Makefile.in
'';
configureFlags = lib.optional stdenv.isFreeBSD "--with-pic"
++ lib.optional enableStatic "--enable-static"
++ lib.optional (!enableShared) "--disable-shared";
configureFlags = [
(lib.enableFeature enableStatic "static")
(lib.enableFeature enableShared "shared")
] ++ lib.optional stdenv.isFreeBSD "--with-pic";
meta = {
description = "An iconv(3) implementation";

View File

@ -10,8 +10,10 @@ appleDerivation {
sed -i 's/darwin\*/ios\*/g' configure libcharset/configure
'';
configureFlags = lib.optional enableStatic "--enable-static"
++ lib.optional (!enableShared) "--disable-shared";
configureFlags = [
(lib.enableFeature enableStatic "static")
(lib.enableFeature enableShared "shared")
];
postInstall = lib.optionalString (!enableStatic) ''
mv $out/lib/libiconv.dylib $out/lib/libiconv-nocharset.dylib