Unverified Commit 3c202d0e authored by Arne Keller's avatar Arne Keller Committed by GitHub
Browse files

lilypond: modernise, enable docs (#393173)

parents 67782624 7b6b4097
Loading
Loading
Loading
Loading
+51 −43
Original line number Diff line number Diff line
{
  stdenv,
  lib,
  fetchurl,
  fetchzip,
  ghostscript,
  gyre-fonts,
  texinfo,
  imagemagick,
  texi2html,
  extractpdfmark,
  guile,
  python3,
  gettext,
  glib,
  gmp,
  flex,
  perl,
  bison,
@@ -21,9 +23,6 @@
  pango,
  fontforge,
  help2man,
  zip,
  netpbm,
  groff,
  freefont_ttf,
  makeFontsConf,
  makeWrapper,
@@ -34,10 +33,11 @@
  texliveSmall,
  tex ? texliveSmall.withPackages (
    ps: with ps; [
      lh
      metafont
      epsf
      fontinst
      fontware
      lh
      metafont
    ]
  ),
}:
@@ -46,9 +46,9 @@ stdenv.mkDerivation rec {
  pname = "lilypond";
  version = "2.24.4";

  src = fetchurl {
  src = fetchzip {
    url = "http://lilypond.org/download/sources/v${lib.versions.majorMinor version}/lilypond-${version}.tar.gz";
    sha256 = "sha256-6W+gNXHHnyDhl5ZTr6vb5O5Cdlo9n9FJU/DNnupReBw=";
    hash = "sha256-UYdORvodrVchxslOxpMiXrAh7DtB9sWp9yqZU/jeB9Y=";
  };

  postInstall = ''
@@ -68,48 +68,48 @@ stdenv.mkDerivation rec {
    done
  '';

  configureFlags = [
    "--disable-documentation"
    # FIXME: these URW fonts are not OTF, configure reports "URW++ OTF files... no".
    "--with-urwotf-dir=${ghostscript.fonts}/share/fonts"
    "--with-texgyre-dir=${gyre-fonts}/share/fonts/truetype/"
  ];

  preConfigure = ''
    sed -e "s@mem=mf2pt1@mem=$PWD/mf/mf2pt1@" -i scripts/build/mf2pt1.pl
    export HOME=$TMPDIR/home
    substituteInPlace scripts/build/mf2pt1.pl \
      --replace-fail "mem=mf2pt1" "mem=$PWD/mf/mf2pt1"
  '';

  strictDeps = true;

  depsBuildBuild = [
    pkg-config
  ];

  nativeBuildInputs = [
    autoreconfHook
    bison
    flex
    dblatex
    extractpdfmark
    flex # for flex binary
    fontconfig
    fontforge
    gettext
    ghostscript
    guile
    help2man
    imagemagick
    makeWrapper
    perl
    pkg-config
    python3
    rsync
    t1utils
    tex
    texi2html
    texinfo
  ];

  buildInputs = [
    ghostscript
    texinfo
    imagemagick
    texi2html
    guile
    dblatex
    tex
    zip
    netpbm
    python3
    gettext
    perl
    fontconfig
    boehmgc
    flex # FlexLexer.h
    freetype
    glib
    gmp
    pango
    fontforge
    help2man
    groff
    t1utils
    boehmgc
    rsync
  ];

  autoreconfPhase = "NOCONFIGURE=1 sh autogen.sh";
@@ -121,15 +121,23 @@ stdenv.mkDerivation rec {
    supportedFeatures = [ "commit" ];
  };

  meta = with lib; {
  # documentation makefile uses "out" for different purposes, hence we explicitly set it to an empty string
  makeFlags = [ "out=" ];

  meta = {
    description = "Music typesetting system";
    homepage = "http://lilypond.org/";
    license = licenses.gpl3;
    maintainers = with maintainers; [
    homepage = "https://lilypond.org/";
    license = with lib.licenses; [
      gpl3Plus # most code
      gpl3Only # ly/articulate.ly
      fdl13Plus # docs
      ofl # mf/
    ];
    maintainers = with lib.maintainers; [
      marcweber
      yurrriq
    ];
    platforms = platforms.all;
    platforms = lib.platforms.all;
  };

  FONTCONFIG_FILE = lib.optional stdenv.hostPlatform.isDarwin (makeFontsConf {
+4 −4
Original line number Diff line number Diff line
{
  lib,
  fetchurl,
  fetchzip,
  lilypond,
}:

lilypond.overrideAttrs (oldAttrs: rec {
  version = "2.25.24";
  src = fetchurl {
  version = "2.25.25";
  src = fetchzip {
    url = "https://lilypond.org/download/sources/v${lib.versions.majorMinor version}/lilypond-${version}.tar.gz";
    hash = "sha256-1n6mJBbZcfQYsmrjWxcG/EtIyF9uHNRVT7fX3+zoXc4=";
    hash = "sha256-OO3yXA2PgOuUUR4Bo5wP4PieBvIxV1N9hPiapOB6cAE=";
  };

  passthru.updateScript = {
+1 −1
Original line number Diff line number Diff line
@@ -21,5 +21,5 @@ echo "[{\"commitMessage\":\"$ATTR: $PREV -> $NEXT\"}]"

# update hash
PREV=$(nix eval --raw -f default.nix $ATTR.src.outputHash)
NEXT=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 $(nix eval --raw -f default.nix $ATTR.src.url)))
NEXT=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 --unpack $(nix eval --raw -f default.nix $ATTR.src.url)))
sed -i "s|$PREV|$NEXT|" "$FILE"