nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitLab,
5 fetchpatch,
6 meson,
7 ninja,
8 pkg-config,
9 wrapWithXFileSearchPathHook,
10 libx11,
11 libxaw,
12 libxft,
13 libxkbfile,
14 libxmu,
15 libxrender,
16 libxt,
17 xorgproto,
18 nix-update-script,
19}:
20stdenv.mkDerivation (finalAttrs: {
21 pname = "xclock";
22 version = "1.1.1";
23
24 src = fetchFromGitLab {
25 domain = "gitlab.freedesktop.org";
26 group = "xorg";
27 owner = "app";
28 repo = "xclock";
29 tag = "xclock-${finalAttrs.version}";
30 hash = "sha256-ZgUb+iVO45Az/C+2YJ1TXxcTLk3zQjM1GGv2E69WNfo=";
31 };
32
33 patches = [
34 # meson build system patch
35 (fetchpatch {
36 url = "https://gitlab.freedesktop.org/xorg/app/xclock/-/commit/28e10bd26ac7e02fe8a4fb8016bb115f8d664032.patch";
37 hash = "sha256-KdrS7VneJqwVPB+TRJoMmtR03Ju3PvvUMYfXz5tII6k=";
38 })
39 ];
40
41 strictDeps = true;
42
43 nativeBuildInputs = [
44 meson
45 ninja
46 pkg-config
47 wrapWithXFileSearchPathHook
48 ];
49
50 buildInputs = [
51 libx11
52 libxaw
53 libxft
54 libxkbfile
55 libxmu
56 libxrender
57 libxt
58 xorgproto
59 ];
60
61 mesonFlags = [
62 (lib.mesonOption "appdefaultdir" "${placeholder "out"}/share/X11/app-defaults")
63 ];
64
65 passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex=xclock-(.*)" ]; };
66
67 meta = {
68 description = "analog / digital clock for X";
69 longDescription = ''
70 xclock is the classic X Window System clock utility. It displays the time in analog or digital
71 form, continuously updated at a frequency which may be specified by the user.
72 '';
73 homepage = "https://gitlab.freedesktop.org/xorg/app/xclock";
74 license = with lib.licenses; [
75 mitOpenGroup
76 hpnd
77 mit
78 ];
79 mainProgram = "xclock";
80 maintainers = [ ];
81 platforms = lib.platforms.unix;
82 };
83})