libpwquality: fixup static build

Close #96023 (original PR).  Amended by vcunat (isMusl != isStatic).
gstqt5
Arthur Gautier 2020-07-19 17:13:23 -07:00 committed by Vladimír Čunát
parent db919693e4
commit a72822c23f
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
1 changed files with 16 additions and 3 deletions

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchFromGitHub, autoreconfHook, perl, cracklib, python3 }:
{ stdenv, lib, fetchFromGitHub, autoreconfHook, perl, cracklib, python3, fetchpatch }:
stdenv.mkDerivation rec {
pname = "libpwquality";
@ -11,8 +11,21 @@ stdenv.mkDerivation rec {
sha256 = "0n4pjhm7wfivk0wizggaxq4y4mcxic876wcarjabkp5z9k14y36h";
};
nativeBuildInputs = [ autoreconfHook perl ];
buildInputs = [ cracklib python3 ];
nativeBuildInputs = [ autoreconfHook perl python3 ];
buildInputs = [ cracklib ];
patches = lib.optional stdenv.hostPlatform.isStatic [
(fetchpatch {
name = "static-build.patch";
url = "https://github.com/libpwquality/libpwquality/pull/40.patch";
sha256 = "1ypccq437wxwgddd98cvd330jfm7jscdlzlyxgy05g6yzrr68xyk";
})
];
configureFlags = lib.optional stdenv.hostPlatform.isStatic [
# Python binding generates a shared library which are unavailable with musl build
"--disable-python-bindings"
];
meta = with lib; {
description = "Password quality checking and random password generation library";