Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LilyPond: Fix configure error - incorrectly detected fontforge version #59937

Merged
merged 1 commit into from Apr 23, 2019

Conversation

tex
Copy link
Contributor

@tex tex commented Apr 20, 2019

Motivation for this change

Fix broken build. It fails on Hydra too.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@tex tex changed the title Fix configure error - incorrectly detected fontforge version LilyPond: Fix configure error - incorrectly detected fontforge version Apr 20, 2019
@dtzWill
Copy link
Member

dtzWill commented Apr 21, 2019

I think this can be simplified further, here's what I came up with:

diff --git a/pkgs/misc/lilypond/default.nix b/pkgs/misc/lilypond/default.nix
index f312cce19d7..36d2d3864be 100644
--- a/pkgs/misc/lilypond/default.nix
+++ b/pkgs/misc/lilypond/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, ghostscript, texinfo, imagemagick, texi2html, guile
-, python2, gettext, flex, perl, bison, pkgconfig, dblatex
+, python2, gettext, flex, perl, bison, pkgconfig, autoreconfHook, dblatex
 , fontconfig, freetype, pango, fontforge, help2man, zip, netpbm, groff
 , fetchsvn, makeWrapper, t1utils
 , texlive, tex ? texlive.combine {
@@ -26,11 +26,6 @@ stdenv.mkDerivation rec{
   preConfigure=''
     sed -e "s@mem=mf2pt1@mem=$PWD/mf/mf2pt1@" -i scripts/build/mf2pt1.pl
 
-    # At some point our fontforge had path 2n…-fontforge-2015… and it
-    # confused the version detection…
-    sed -re 's%("[$]exe" --version .*)([|\\] *$)%\1 | sed -re "s@/nix/store/[a-z0-9]{32}-@@" \2%' \
-      -i configure
-
     export HOME=$TMPDIR/home
   '';
 
@@ -48,10 +43,12 @@ stdenv.mkDerivation rec{
 
   buildInputs =
     [ ghostscript texinfo imagemagick texi2html guile dblatex tex zip netpbm
-      python2 gettext flex perl bison pkgconfig fontconfig freetype pango
-      fontforge help2man groff makeWrapper t1utils
+      python2 gettext flex perl bison fontconfig freetype pango
+      fontforge help2man groff t1utils
     ];
+  nativeBuildInputs = [ makeWrapper pkgconfig autoreconfHook ];
 
+  autoreconfPhase = "NOCONFIGURE=1 ./autogen.sh";
   #enableParallelBuilding = true; # fatal error: parser.hh: No such file or directory
 
   meta = with stdenv.lib; {

No need to patch in the version anywhere :). Haven't tried the parallel building, but am glad that it works now :).

@tex
Copy link
Contributor Author

tex commented Apr 22, 2019

@dtzWill Thanks for help, I tried autoreconfHook before, but didn't know about NOCONFIGURE=1 which led to problems that I workarounded with the direct use of automake...
The oriignal issue is with the pre-generated configure script - it gets fontforge version correctly, it prints what on screen looks like never version that lowest required but then comparsion goes south probably and error is reported incorrectly. Oh, nice world of build systems and especially autoconf/automake ;-) in this particular case.

@infinisil
Copy link
Member

Can you squash the commits?

@tex
Copy link
Contributor Author

tex commented Apr 23, 2019

Done.

@infinisil infinisil merged commit 9a8d764 into NixOS:master Apr 23, 2019
@infinisil
Copy link
Member

Ah I didn't notice, add LilyPond: as a prefix to your commit message next time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants