diff options
author | Peter Hoeg <peter@hoeg.com> | 2020-11-05 22:02:27 +0800 |
---|---|---|
committer | Peter Hoeg <peter@hoeg.com> | 2020-11-06 10:19:36 +0800 |
commit | 11fc05583669cf3cb8c99dc6cb6f6ca7d93fa01d (patch) | |
tree | 61302b9dce1f6afdac68363f7e3fb0d0ec06c3d5 /pkgs/os-specific/linux/pam_mount/default.nix | |
parent | 93b0accc76ffccee15a1b34ff8206f84a64069cb (diff) | |
download | nixpkgs-11fc05583669cf3cb8c99dc6cb6f6ca7d93fa01d.tar nixpkgs-11fc05583669cf3cb8c99dc6cb6f6ca7d93fa01d.tar.gz nixpkgs-11fc05583669cf3cb8c99dc6cb6f6ca7d93fa01d.tar.bz2 nixpkgs-11fc05583669cf3cb8c99dc6cb6f6ca7d93fa01d.tar.lz nixpkgs-11fc05583669cf3cb8c99dc6cb6f6ca7d93fa01d.tar.xz nixpkgs-11fc05583669cf3cb8c99dc6cb6f6ca7d93fa01d.tar.zst nixpkgs-11fc05583669cf3cb8c99dc6cb6f6ca7d93fa01d.zip |
pam_mount: add support for LUKS2
Diffstat (limited to 'pkgs/os-specific/linux/pam_mount/default.nix')
-rw-r--r-- | pkgs/os-specific/linux/pam_mount/default.nix | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/pkgs/os-specific/linux/pam_mount/default.nix b/pkgs/os-specific/linux/pam_mount/default.nix index 18bc84effa0..3e026be6abb 100644 --- a/pkgs/os-specific/linux/pam_mount/default.nix +++ b/pkgs/os-specific/linux/pam_mount/default.nix @@ -1,37 +1,48 @@ -{ stdenv, fetchurl, autoconf, automake, pkgconfig, libtool, pam, libHX, libxml2, pcre, perl, openssl, cryptsetup, utillinux }: +{ stdenv, fetchurl, autoreconfHook, pkgconfig, libtool, pam, libHX, libxml2, pcre, perl, openssl, cryptsetup, utillinux }: stdenv.mkDerivation rec { - name = "pam_mount-2.16"; + pname = "pam_mount"; + version = "2.16"; src = fetchurl { - url = "mirror://sourceforge/pam-mount/pam_mount/2.16/${name}.tar.xz"; + url = "mirror://sourceforge/pam-mount/pam_mount/${version}/${pname}-${version}.tar.xz"; sha256 = "1rvi4irb7ylsbhvx1cr6islm2xxw1a4b19q6z4a9864ndkm0f0mf"; }; - nativeBuildInputs = [ pkgconfig ]; - buildInputs = [ autoconf automake libtool pam libHX utillinux libxml2 pcre perl openssl cryptsetup ]; + patches = [ + ./insert_utillinux_path_hooks.patch + ./support_luks2.patch + ]; - patches = [ ./insert_utillinux_path_hooks.patch ]; + postPatch = '' + substituteInPlace src/mtcrypt.c \ + --replace @@NIX_UTILLINUX@@ ${utillinux}/bin + ''; - preConfigure = '' - substituteInPlace src/mtcrypt.c --replace @@NIX_UTILLINUX@@ ${utillinux}/bin - sh autogen.sh --prefix=$out - ''; + nativeBuildInputs = [ autoreconfHook libtool pkgconfig ]; - makeFlags = [ "DESTDIR=$(out)" ]; + buildInputs = [ pam libHX utillinux libxml2 pcre perl openssl cryptsetup ]; + + enableParallelBuilding = true; + + configureFlags = [ + "--prefix=${placeholder "out"}" + "--localstatedir=${placeholder "out"}/var" + "--sbindir=${placeholder "out"}/bin" + "--sysconfdir=${placeholder "out"}/etc" + "--with-slibdir=${placeholder "out"}/lib" + "--with-ssbindir=${placeholder "out"}/bin" + ]; - # Probably a hack, but using DESTDIR and PREFIX makes everything work! postInstall = '' - mkdir -p $out - cp -r $out/$out/* $out - rm -r $out/nix - ''; + rm -r $out/var + ''; meta = with stdenv.lib; { - homepage = "http://pam-mount.sourceforge.net/"; description = "PAM module to mount volumes for a user session"; - maintainers = [ maintainers.tstrobel ]; + homepage = "https://pam-mount.sourceforge.net/"; license = with licenses; [ gpl2 gpl3 lgpl21 lgpl3 ]; + maintainers = with maintainers; [ tstrobel ]; platforms = platforms.linux; }; } |