nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 autoreconfHook,
3 dbus,
4 fetchpatch,
5 fetchurl,
6 lib,
7 libxml2,
8 nixosTests,
9 pam,
10 pkg-config,
11 stdenv,
12 systemd,
13}:
14
15stdenv.mkDerivation rec {
16 pname = "oddjob";
17 version = "0.34.7";
18
19 src = fetchurl {
20 url = "https://pagure.io/oddjob/archive/${pname}-${version}/oddjob-${pname}-${version}.tar.gz";
21 hash = "sha256-SUOsMH55HtEsk5rX0CXK0apDObTj738FGOaL5xZRnIM=";
22 };
23
24 patches = [
25 # Define SystemD service location using `with-systemdsystemunitdir` configure flag
26 (fetchpatch {
27 url = "https://pagure.io/oddjob/c/f63287a35107385dcb6e04a4c742077c9d1eab86.patch";
28 hash = "sha256-2mmw4pJhrIk4/47FM8zKH0dTQJWnntHPNmq8VAUWqJI=";
29 })
30 ];
31
32 nativeBuildInputs = [
33 autoreconfHook
34 pkg-config
35 ];
36
37 buildInputs = [
38 dbus
39 libxml2
40 pam
41 systemd
42 ];
43
44 configureFlags = [
45 "--prefix=${placeholder "out"}"
46 "--sysconfdir=${placeholder "out"}/etc"
47 "--with-selinux-acls=no"
48 "--with-selinux-labels=no"
49 "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
50 ];
51
52 postConfigure = ''
53 substituteInPlace src/oddjobd.c \
54 --replace "globals.selinux_enabled" "FALSE"
55 '';
56
57 # Requires a dbus-daemon environment
58 doCheck = false;
59
60 passthru.tests = {
61 inherit (nixosTests) oddjobd;
62 };
63
64 meta = {
65 changelog = "https://pagure.io/oddjob/blob/oddjob-${version}/f/ChangeLog";
66 description = "Odd Job Daemon";
67 homepage = "https://pagure.io/oddjob";
68 license = lib.licenses.bsd3;
69 maintainers = with lib.maintainers; [ SohamG ];
70 platforms = lib.platforms.linux;
71 };
72}