about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/libpwquality
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-03-30 13:30:47 +0000
committerAlyssa Ross <hi@alyssa.is>2022-03-31 10:13:20 +0000
commitf2e61678de300336b3666afd19af7565efb0c4cf (patch)
tree49f6906c9d557f7fdd58257ff85ec17fc4495f31 /nixpkgs/pkgs/development/libraries/libpwquality
parentf920d5e07c29a9aa1b77d9b88bd604cf1a1f3664 (diff)
parent00e27c78d3d2de6964096ceee8d70e5b487365e3 (diff)
downloadnixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.gz
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.bz2
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.lz
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.xz
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.tar.zst
nixlib-f2e61678de300336b3666afd19af7565efb0c4cf.zip
Merge commit '00e27c78d3d2de6964096ceee8d70e5b487365e3'
Conflicts:
	nixpkgs/nixos/modules/system/boot/systemd.nix
	nixpkgs/pkgs/applications/networking/browsers/firefox/common.nix
	nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/common.nix
	nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/default.nix
	nixpkgs/pkgs/applications/version-management/git-and-tools/cgit/pink.nix
	nixpkgs/pkgs/top-level/all-packages.nix
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/libpwquality')
-rw-r--r--nixpkgs/pkgs/development/libraries/libpwquality/default.nix57
-rw-r--r--nixpkgs/pkgs/development/libraries/libpwquality/python-binding-prefix.patch13
2 files changed, 52 insertions, 18 deletions
diff --git a/nixpkgs/pkgs/development/libraries/libpwquality/default.nix b/nixpkgs/pkgs/development/libraries/libpwquality/default.nix
index 5d83b137b8e6..abc65130fc3a 100644
--- a/nixpkgs/pkgs/development/libraries/libpwquality/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpwquality/default.nix
@@ -1,36 +1,57 @@
-{ stdenv, lib, fetchFromGitHub, autoreconfHook, perl, cracklib, python3, fetchpatch }:
+{ stdenv
+, lib
+, fetchFromGitHub
+, autoreconfHook
+, perl
+, cracklib
+, enablePAM ? stdenv.hostPlatform.isLinux
+, pam
+, enablePython ? false
+, python
+}:
+
+# python binding generates a shared library which are unavailable with musl build
+assert enablePython -> !stdenv.hostPlatform.isStatic;
 
 stdenv.mkDerivation rec {
   pname = "libpwquality";
-  version = "1.4.2";
+  version = "1.4.4";
+
+  outputs = [ "out" "dev" "lib" "man" ] ++ lib.optionals enablePython [ "py" ];
 
   src = fetchFromGitHub {
     owner = "libpwquality";
     repo = "libpwquality";
     rev = "${pname}-${version}";
-    sha256 = "0n4pjhm7wfivk0wizggaxq4y4mcxic876wcarjabkp5z9k14y36h";
+    sha256 = "sha256-7gAzrx5VP1fEBwAt6E5zGM8GyuPRR+JxYifYfirY+U8=";
   };
 
-  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";
-    })
+  patches = [
+    # ensure python site-packages goes in $py output
+    ./python-binding-prefix.patch
   ];
 
-  configureFlags = lib.optional stdenv.hostPlatform.isStatic [
-    # Python binding generates a shared library which are unavailable with musl build
-    "--disable-python-bindings"
-  ];
+  nativeBuildInputs = [ autoreconfHook perl ] ++ lib.optionals enablePython [ python ];
+  buildInputs = [ cracklib ] ++ lib.optionals enablePAM [ pam ];
+
+  configureFlags = lib.optionals (!enablePython) [ "--disable-python-bindings" ];
 
   meta = with lib; {
-    description = "Password quality checking and random password generation library";
     homepage = "https://github.com/libpwquality/libpwquality";
-    license = licenses.bsd3;
+    description = "Password quality checking and random password generation library";
+    longDescription = ''
+      The libpwquality library purpose is to provide common functions for
+      password quality checking and also scoring them based on their apparent
+      randomness. The library also provides a function for generating random
+      passwords with good pronounceability. The library supports reading and
+      parsing of a configuration file.
+
+      In the package there are also very simple utilities that use the library
+      function and PAM module that can be used instead of pam_cracklib. The
+      module supports all the options of pam_cracklib.
+    '';
+    license = with licenses; [ bsd3 /* or */ gpl2Plus ];
+    maintainers = with maintainers; [ jk ];
     platforms = platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libpwquality/python-binding-prefix.patch b/nixpkgs/pkgs/development/libraries/libpwquality/python-binding-prefix.patch
new file mode 100644
index 000000000000..a8f77142e1db
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpwquality/python-binding-prefix.patch
@@ -0,0 +1,13 @@
+diff --git a/python/Makefile.am b/python/Makefile.am
+index 1d00c0c..0987690 100644
+--- a/python/Makefile.am
++++ b/python/Makefile.am
+@@ -14,7 +14,7 @@ all-local:
+ 	CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV)
+ 
+ install-exec-local:
+-	CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV) install --prefix=${DESTDIR}${prefix}
++	CFLAGS="${CFLAGS} -fno-strict-aliasing" @PYTHONBINARY@ setup.py build --build-base py$(PYTHONREV) install --prefix=${DESTDIR}${py}
+ 
+ clean-local:
+ 	rm -rf py$(PYTHONREV)