Unverified Commit 021ca53e authored by quantenzitrone's avatar quantenzitrone
Browse files

xclock: refactor & move to pkgs/by-name from xorg namespace

relevant changes:
- switch to gitlab source instead of release tarball
- adds an unreleased patch for adding the meson build system,
  because i couldn't get it to work without it.
  It will have to be removed on the next update.
parent 2b271e9c
Loading
Loading
Loading
Loading
+83 −0
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchFromGitLab,
  fetchpatch,
  meson,
  ninja,
  pkg-config,
  wrapWithXFileSearchPathHook,
  libx11,
  libxaw,
  libxft,
  libxkbfile,
  libxmu,
  libxrender,
  libxt,
  xorgproto,
  nix-update-script,
}:
stdenv.mkDerivation (finalAttrs: {
  pname = "xclock";
  version = "1.1.1";

  src = fetchFromGitLab {
    domain = "gitlab.freedesktop.org";
    group = "xorg";
    owner = "app";
    repo = "xclock";
    tag = "xclock-${finalAttrs.version}";
    hash = "sha256-ZgUb+iVO45Az/C+2YJ1TXxcTLk3zQjM1GGv2E69WNfo=";
  };

  patches = [
    # meson build system patch
    (fetchpatch {
      url = "https://gitlab.freedesktop.org/xorg/app/xclock/-/commit/28e10bd26ac7e02fe8a4fb8016bb115f8d664032.patch";
      hash = "sha256-KdrS7VneJqwVPB+TRJoMmtR03Ju3PvvUMYfXz5tII6k=";
    })
  ];

  strictDeps = true;

  nativeBuildInputs = [
    meson
    ninja
    pkg-config
    wrapWithXFileSearchPathHook
  ];

  buildInputs = [
    libx11
    libxaw
    libxft
    libxkbfile
    libxmu
    libxrender
    libxt
    xorgproto
  ];

  mesonFlags = [
    (lib.mesonOption "appdefaultdir" "${placeholder "out"}/share/X11/app-defaults")
  ];

  passthru.updateScript = nix-update-script { extraArgs = [ "--version-regex=xclock-(.*)" ]; };

  meta = {
    description = "analog / digital clock for X";
    longDescription = ''
      xclock is the classic X Window System clock utility. It displays the time in analog or digital
      form, continuously updated at a frequency which may be specified by the user.
    '';
    homepage = "https://gitlab.freedesktop.org/xorg/app/xclock";
    license = with lib.licenses; [
      mitOpenGroup
      hpnd
      mit
    ];
    mainProgram = "xclock";
    maintainers = [ ];
    platforms = lib.platforms.unix;
  };
})
+2 −52
Original line number Diff line number Diff line
@@ -116,6 +116,7 @@
  xbitmaps,
  xcalc,
  xcb-proto,
  xclock,
  xcmsdb,
  xcompmgr,
  xconsole,
@@ -197,6 +198,7 @@ self: with self; {
    xbacklight
    xbitmaps
    xcalc
    xclock
    xcmsdb
    xcompmgr
    xconsole
@@ -364,58 +366,6 @@ self: with self; {
    })
  ) { };

  # THIS IS A GENERATED FILE.  DO NOT EDIT!
  xclock = callPackage (
    {
      stdenv,
      pkg-config,
      fetchurl,
      libX11,
      libXaw,
      libXft,
      libxkbfile,
      libXmu,
      xorgproto,
      libXrender,
      libXt,
      wrapWithXFileSearchPathHook,
      testers,
    }:
    stdenv.mkDerivation (finalAttrs: {
      pname = "xclock";
      version = "1.1.1";
      builder = ./builder.sh;
      src = fetchurl {
        url = "mirror://xorg/individual/app/xclock-1.1.1.tar.xz";
        sha256 = "0b3l1zwz2b1cn46f8pd480b835j9anadf929vqpll107iyzylz6z";
      };
      hardeningDisable = [
        "bindnow"
        "relro"
      ];
      strictDeps = true;
      nativeBuildInputs = [
        pkg-config
        wrapWithXFileSearchPathHook
      ];
      buildInputs = [
        libX11
        libXaw
        libXft
        libxkbfile
        libXmu
        xorgproto
        libXrender
        libXt
      ];
      passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
      meta = {
        pkgConfigModules = [ ];
        platforms = lib.platforms.unix;
      };
    })
  ) { };

  # THIS IS A GENERATED FILE.  DO NOT EDIT!
  xf86inputevdev = callPackage (
    {
+2 −0
Original line number Diff line number Diff line
@@ -448,6 +448,7 @@ print OUT <<EOF;
  xbitmaps,
  xcalc,
  xcb-proto,
  xclock,
  xcmsdb,
  xcompmgr,
  xconsole,
@@ -529,6 +530,7 @@ self: with self; {
    xbacklight
    xbitmaps
    xcalc
    xclock
    xcmsdb
    xcompmgr
    xconsole
+0 −2
Original line number Diff line number Diff line
@@ -338,8 +338,6 @@ self: super:
      postPatch = lib.concatStrings (lib.mapAttrsToList patchIn layouts);
    });

  xclock = addMainProgram super.xclock { };

  xinit =
    (super.xinit.override {
      stdenv = if isDarwin then clangStdenv else stdenv;
+0 −1
Original line number Diff line number Diff line
mirror://xorg/individual/app/xclock-1.1.1.tar.xz
mirror://xorg/individual/app/xfd-1.1.4.tar.xz
mirror://xorg/individual/app/xfs-1.2.2.tar.xz
mirror://xorg/individual/app/xinit-1.4.4.tar.xz