about summary refs log tree commit diff
path: root/pkgs/os-specific/linux/oddjob/default.nix
blob: 1ade48c896972cd7c0e8c917747a68ad8df7f8cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
  autoreconfHook,
  dbus,
  fetchpatch,
  fetchurl,
  lib,
  libxml2,
  nixosTests,
  pam,
  pkg-config,
  stdenv,
  systemd,
}:

stdenv.mkDerivation rec {
  pname = "oddjob";
  version = "0.34.7";

  src = fetchurl {
    url = "https://pagure.io/oddjob/archive/${pname}-${version}/oddjob-${pname}-${version}.tar.gz";
    hash = "sha256-SUOsMH55HtEsk5rX0CXK0apDObTj738FGOaL5xZRnIM=";
  };

  patches = [
    # Define SystemD service location using `with-systemdsystemunitdir` configure flag
    (fetchpatch {
      url = "https://pagure.io/oddjob/c/f63287a35107385dcb6e04a4c742077c9d1eab86.patch";
      hash = "sha256-2mmw4pJhrIk4/47FM8zKH0dTQJWnntHPNmq8VAUWqJI=";
    })
  ];

  nativeBuildInputs = [
    autoreconfHook
    pkg-config
  ];

  buildInputs = [
    dbus
    libxml2
    pam
    systemd
  ];

  configureFlags = [
    "--prefix=${placeholder "out"}"
    "--sysconfdir=${placeholder "out"}/etc"
    "--with-selinux-acls=no"
    "--with-selinux-labels=no"
    "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
  ];

  postConfigure = ''
    substituteInPlace src/oddjobd.c \
      --replace "globals.selinux_enabled" "FALSE"
  '';

  # Requires a dbus-daemon environment
  doCheck = false;

  passthru.tests = {
    inherit (nixosTests) oddjobd;
  };

  meta = {
    changelog = "https://pagure.io/oddjob/blob/oddjob-${version}/f/ChangeLog";
    description = "Odd Job Daemon";
    homepage = "https://pagure.io/oddjob";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ SohamG ];
    platforms = lib.platforms.linux;
  };
}