Unverified Commit 18146423 authored by Fabián Heredia Montiel's avatar Fabián Heredia Montiel Committed by GitHub
Browse files

font-util: switch from fetchurl to fetchFromGitLab (#435396)

parents 6bc0e5fd e30a21aa
Loading
Loading
Loading
Loading
+20 −15
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  fetchurl,
  fetchFromGitLab,
  testers,
  writeScript,
  gitUpdater,
  autoreconfHook,
  util-macros,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "font-util";
  version = "1.4.1";

  src = fetchurl {
    url = "mirror://xorg/individual/font/font-util-${finalAttrs.version}.tar.xz";
    hash = "sha256-XJ9kEjwZSxUP7okEmZFoc4bm/zbvKve4C6U++vNozJU=";
  src = fetchFromGitLab {
    domain = "gitlab.freedesktop.org";
    group = "xorg";
    owner = "font";
    repo = "util";
    tag = "font-util-${finalAttrs.version}";
    hash = "sha256-cv6Whex1s4+J7Ue4IOHdO9WtrarTgSpLEghWpbUl+0o=";
  };

  passthru = {
    updateScript = writeScript "update-${finalAttrs.pname}" ''
      #!/usr/bin/env nix-shell
      #!nix-shell -i bash -p common-updater-scripts

      version="$(list-directory-versions --pname ${finalAttrs.pname} \
        --url https://xorg.freedesktop.org/releases/individual/font/ \
        | sort -V | tail -n1)"
  nativeBuildInputs = [
    autoreconfHook
    util-macros
  ];

      update-source-version ${finalAttrs.pname} "$version"
    '';
  passthru = {
    updateScript = gitUpdater {
      rev-prefix = "font-util-";
      ignoredVersions = "1_0_1";
    };
    tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
  };