tvl-depot/users/glittershark/pkgs/fprintd/default.nix
Vincent Ambo 473604f567 refactor: Move nixpkgs attribute to third_party.nixpkgs
Please read b/108 to make sense of this.

This gets rid of the explicit list of exposed packages from nixpkgs,
and instead makes the entire package set available at
`third_party.nixpkgs`.

To accommodate this, a LOT of things have to be very slightly shuffled
around. Some of this was done in already submitted CLs, but this
change is unfortunately still quite noisy.

Pay extra attention to:

* overlay-like functionality that was partially moved to actual
  overlays (partially as in, the minimum required to get a green
  build)

* modified uses of the package set path, esp. in NixOS systems

Special notes:

* xanthous has been disabled in CI because of issues with the Haskell
  overlay
* //third_party/nix has been disabled because of other unclear
  dependency issues

Both of these will be tackled in a followup CL.

Change-Id: I2f9c60a4d275fdb5209264be0addfd7e06c53118
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2910
Reviewed-by: glittershark <grfn@gws.fyi>
Reviewed-by: sterni <sternenseemann@systemli.org>
Tested-by: BuildkiteCI
2021-04-10 21:18:55 +00:00

130 lines
3.2 KiB
Nix

{ depot, pkgs, ... }:
let
nixpkgs = import pkgs.path {
config.allowUnfree = true;
overlays = [(self: super: {
# TODO(grfn): Can we not override this here? It bootstraps
# rustc, builds firefox, and many other things.
gcc = super.gcc9;
})];
};
inherit (nixpkgs)
stdenv
fetchFromGitLab
fetchpatch
pkgconfig
meson
ninja
perl
gettext
cairo
gtk-doc
libxslt
docbook-xsl-nons
docbook_xml_dtd_412
glib
dbus
dbus-glib
polkit
nss
pam
systemd
python3;
libfprint-tod = nixpkgs.callPackage ./libfprint-tod.nix {};
in
stdenv.mkDerivation rec {
pname = "fprintd";
version = "1.90.1";
outputs = [ "out" "devdoc" ];
src = fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "libfprint";
repo = pname;
rev = version;
sha256 = "0mbzk263x7f58i9cxhs44mrngs7zw5wkm62j5r6xlcidhmfn03cg";
};
patches = [
# Fixes issue with ":" when there is multiple paths (might be the case on NixOS)
# https://gitlab.freedesktop.org/libfprint/fprintd/-/merge_requests/50
(fetchpatch {
url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/d7fec03f24d10f88d34581c72f0eef201f5eafac.patch";
sha256 = "0f88dhizai8jz7hpm5lpki1fx4593zcy89iwi4brsqbqc7jp9ls0";
})
# Fix locating libpam_wrapper for tests
(fetchpatch {
url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/merge_requests/40.patch";
sha256 = "0qqy090p93lzabavwjxzxaqidkcb3ifacl0d3yh1q7ms2a58yyz3";
})
(fetchpatch {
url = "https://gitlab.freedesktop.org/libfprint/fprintd/-/commit/f401f399a85dbeb2de165b9b9162eb552ab6eea7.patch";
sha256 = "1bc9g6kc95imlcdpvp8qgqjsnsxg6nipr6817c1pz5i407yvw1iy";
})
];
nativeBuildInputs = [
pkgconfig
meson
ninja
perl
gettext
gtk-doc
libxslt
dbus
docbook-xsl-nons
docbook_xml_dtd_412
];
buildInputs = [
glib
dbus-glib
polkit
nss
pam
systemd
libfprint-tod
];
checkInputs = with python3.pkgs; [
python-dbusmock
dbus-python
pygobject3
pycairo
pypamtest
];
mesonFlags = [
"-Dgtk_doc=true"
"-Dpam_modules_dir=${placeholder "out"}/lib/security"
"-Dsysconfdir=${placeholder "out"}/etc"
"-Ddbus_service_dir=${placeholder "out"}/share/dbus-1/system-services"
"-Dsystemd_system_unit_dir=${placeholder "out"}/lib/systemd/system"
];
PKG_CONFIG_DBUS_1_INTERFACES_DIR = "${placeholder "out"}/share/dbus-1/interfaces";
PKG_CONFIG_POLKIT_GOBJECT_1_POLICYDIR = "${placeholder "out"}/share/polkit-1/actions";
PKG_CONFIG_DBUS_1_DATADIR = "${placeholder "out"}/share";
# FIXME: Ugly hack for tests to find libpam_wrapper.so
LIBRARY_PATH = stdenv.lib.makeLibraryPath [ python3.pkgs.pypamtest ];
doCheck = true;
postPatch = ''
patchShebangs po/check-translations.sh
'';
meta = with stdenv.lib; {
homepage = "https://fprint.freedesktop.org/";
description = "D-Bus daemon that offers libfprint functionality over the D-Bus interprocess communication bus";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = with maintainers; [ abbradar elyhaka ];
};
}