diff --git a/612.patch b/612.patch new file mode 100644 index 0000000..7d80170 --- /dev/null +++ b/612.patch @@ -0,0 +1,118 @@ +From e1398fd0732917110fb96d93a6a608ada7ff53f6 Mon Sep 17 00:00:00 2001 +From: Jonas Hahnfeld +Date: Thu, 21 Jan 2021 20:33:55 +0100 +Subject: [PATCH 1/2] Revert "Issue 4125: Disable character set recognition" + +This reverts commit 241314869ffedc026a5d151925aa7f6b64679ad1. + +We should parse the command line parameters as locale strings, most +importantly the input file names. Fixes #6089, at least for reading +in ly files with non-ascii characters in their names. +--- + lily/main.cc | 15 --------------- + 1 file changed, 15 deletions(-) + +diff --git a/lily/main.cc b/lily/main.cc +index ff66b2b747..e8a90604f5 100644 +--- a/lily/main.cc ++++ b/lily/main.cc +@@ -18,7 +18,6 @@ + */ + + #include "main.hh" +-#include "lily-guile.hh" + + #include + #include +@@ -611,20 +610,6 @@ setup_localisation () + Disable localisation of float values. */ + setlocale (LC_NUMERIC, "C"); + +-#if GUILEV2 +- // In order not to have this porting aid backfire to GUILE1 usage, +- // this is only compiled in the GUILEV2 version. It should +- // eventually be replaced with proper multibyte communication with +- // GUILE2, but in the mean time it seems that this is the least +- // invasive path to get comparable results between the +- // not-really-multibyte-supporting GUILE1 and GUILE2 +- +- /* Disable character sets */ +- setlocale (LC_CTYPE, "C"); +- /* But our text domain is in UTF-8 */ +- bind_textdomain_codeset ("lilypond", "UTF-8"); +-#endif +- + // we temporarily use the compile-time value for the locale + // until we get the final directory location + bindtextdomain ("lilypond", LOCALEDIR); +-- +GitLab + + +From 330221bd9034499ec169c710ec13bc340d96264e Mon Sep 17 00:00:00 2001 +From: Jonas Hahnfeld +Date: Thu, 21 Jan 2021 20:38:47 +0100 +Subject: [PATCH 2/2] Write input file for Ghostscript as UTF-8 + +Since commit 017927b4d6 ("Unify calling convention for command-line +and API GS use"), we pass the input and output file names via a +temporary file. That needs to be written as UTF-8 so that file names +with special characters work. As a side effect, stop re-encoding +the command line arguments to Ghostscript because these are purely +ASCII now. + +Fixes #6089 +--- + lily/general-scheme.cc | 13 ++----------- + scm/backend-library.scm | 3 +++ + 2 files changed, 5 insertions(+), 11 deletions(-) + +diff --git a/lily/general-scheme.cc b/lily/general-scheme.cc +index 41e7d2c148..c2fec616b8 100644 +--- a/lily/general-scheme.cc ++++ b/lily/general-scheme.cc +@@ -644,15 +644,6 @@ ly_run_command (char *argv[], char **standard_output, char **standard_error) + return exit_status; + } + +-static char * +-ly_scm2utf8 (SCM str) +-{ +- char *p = ly_scm2str0 (str); +- char *g = g_locale_to_utf8 (p, -1, 0, 0, 0); +- free (p); +- return g; +-} +- + LY_DEFINE (ly_spawn, "ly:spawn", + 1, 0, 1, (SCM command, SCM rest), + "Simple interface to g_spawn_sync" +@@ -666,9 +657,9 @@ LY_DEFINE (ly_spawn, "ly:spawn", + char **argv = new char *[argc + 2]; + + int n = 0; +- argv[n++] = ly_scm2utf8 (command); ++ argv[n++] = ly_scm2str0 (command); + for (SCM s = rest; scm_is_pair (s); s = scm_cdr (s)) +- argv[n++] = ly_scm2utf8 (scm_car (s)); ++ argv[n++] = ly_scm2str0 (scm_car (s)); + argv[n] = 0; + + char *standard_output = 0; +diff --git a/scm/backend-library.scm b/scm/backend-library.scm +index 426087eade..e402f9573b 100644 +--- a/scm/backend-library.scm ++++ b/scm/backend-library.scm +@@ -46,6 +46,9 @@ + (let* + ((tmp (make-tmpfile #f)) + (tmp-name (port-filename tmp))) ++ (cond-expand ++ (guile-2 (set-port-encoding! tmp "UTF-8")) ++ (else)) + (ly:debug (_ "Preparing Ghostscript command to `~a': ~a") + tmp-name run-str) + (display run-str tmp) +-- +GitLab + diff --git a/b84ea4740f3279516905c5db05f4074e777c16ff.patch b/b84ea4740f3279516905c5db05f4074e777c16ff.patch deleted file mode 100644 index e91947e..0000000 --- a/b84ea4740f3279516905c5db05f4074e777c16ff.patch +++ /dev/null @@ -1,101 +0,0 @@ -From b84ea4740f3279516905c5db05f4074e777c16ff Mon Sep 17 00:00:00 2001 -From: Han-Wen Nienhuys -Date: Tue, 21 Jul 2020 14:45:08 +0200 -Subject: [PATCH] scm: disable embedded-ps and embedded-svg in -dsafe mode - -This prevents executing privileged PostScript and exploiting -Ghostscript vulnerablilities - -Tested: - $ lilypond -dsafe input/regression/les-nereides.ly - (works, kinda) - - $ cat f.ly - { c4_ \markup \postscript #" (x) show " } - - $ lilypond -dsafe f - Preprocessing graphical objects.../home/hanwen/vc/lilypond/out/share/lilypond/current/scm/define-markup-commands.scm:1145:3: In procedure ly_make_stencil in expression (ly:make-stencil (list # #) (quote #) ...): - /home/hanwen/vc/lilypond/out/share/lilypond/current/scm/define-markup-commands.scm:1145:3: Wrong type argument in position 1 (expecting registered stencil expression): (embedded-ps " ---- - scm/define-stencil-commands.scm | 65 ++++++++++++++++++++++------------------- - 1 file changed, 35 insertions(+), 30 deletions(-) - -diff --git a/scm/define-stencil-commands.scm b/scm/define-stencil-commands.scm -index 09a2299..e388788 100644 ---- a/scm/define-stencil-commands.scm -+++ b/scm/define-stencil-commands.scm -@@ -21,36 +21,41 @@ - (define-public (ly:all-stencil-commands) - "Return the list of stencil commands that can be - defined in the output modules (@file{output-*.scm})." -- '(blank -- char -- circle -- dashed-line -- draw-line -- ellipse -- embedded-ps -- embedded-svg -- end-group-node -- glyph-string -- grob-cause -- named-glyph -- no-origin -- page-link -- path -- partial-ellipse -- placebox -- polygon -- resetcolor -- resetrotation -- resetscale -- round-filled-box -- setcolor -- setrotation -- setscale -- start-group-node -- text -- unknown -- url-link -- utf-8-string -+ (let* -+ ((commands '(blank -+ char -+ circle -+ dashed-line -+ draw-line -+ ellipse -+ end-group-node -+ glyph-string -+ grob-cause -+ named-glyph -+ no-origin -+ page-link -+ path -+ partial-ellipse -+ placebox -+ polygon -+ resetcolor -+ resetrotation -+ resetscale -+ round-filled-box -+ setcolor -+ setrotation -+ setscale -+ start-group-node -+ text -+ unknown -+ url-link -+ utf-8-string -+ ))) -+ -+ (if (ly:get-option 'safe) -+ commands -+ (append '(embedded-ps embedded-svg) -+ commands)) - )) - - ;; TODO: --- -1.9.1 - diff --git a/lilypond-Fix-out-of-bounds-access-detected-by-D_GLIBCXX_ASSER.patch b/lilypond-Fix-out-of-bounds-access-detected-by-D_GLIBCXX_ASSER.patch deleted file mode 100644 index 5dd1d4d..0000000 --- a/lilypond-Fix-out-of-bounds-access-detected-by-D_GLIBCXX_ASSER.patch +++ /dev/null @@ -1,40 +0,0 @@ -From: David Kastrup -Date: Wed, 9 May 2018 11:48:35 +0000 (+0200) -Subject: Issue 5320: beam.cc: avoid calculating an invalid reference -X-Git-Url: http://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=commitdiff_plain;h=d63756608d265d7a99444af1123b7be8a06f3cc2 - -Issue 5320: beam.cc: avoid calculating an invalid reference - -In calc_beam_segments, an invalid reference to a neighboring segment -was calculated (and not used) at the extreme ends of the beam. This -caused segfaults on Fedora. Since the reference is used at most twice -anyway and in the same expression, it seems easier to just use the -expression directly (the invalid cases are then skipped due to -short-circuit evaluation). ---- - -diff --git a/lily/beam.cc b/lily/beam.cc -index dff6216..9a9ea15 100644 ---- a/lily/beam.cc -+++ b/lily/beam.cc -@@ -457,7 +457,6 @@ Beam::calc_beam_segments (SCM smob) - Beam_stem_segment const &seg = segs[j]; - for (LEFT_and_RIGHT (event_dir)) - { -- Beam_stem_segment const &neighbor_seg = segs[j + event_dir]; - // TODO: make names clearer? --jneem - // on_line_bound: whether the current segment is on the boundary of the WHOLE beam - // on_beam_bound: whether the current segment is on the boundary of just that part -@@ -471,9 +470,10 @@ Beam::calc_beam_segments (SCM smob) - : seg.stem_index_ + 1 < stems.size (); - - bool event = on_beam_bound -- || abs (seg.rank_ - neighbor_seg.rank_) > 1 -+ || abs (seg.rank_ - segs[j + event_dir].rank_) > 1 - || (abs (vertical_count) >= seg.max_connect_ -- || abs (vertical_count) >= neighbor_seg.max_connect_); -+ || abs (vertical_count) -+ >= segs[j + event_dir].max_connect_); - - if (!event) - // Then this edge of the current segment is irrelevant because it will diff --git a/lilypond-emmentaler-area.patch b/lilypond-emmentaler-area.patch deleted file mode 100644 index 5a5bc95..0000000 --- a/lilypond-emmentaler-area.patch +++ /dev/null @@ -1,20 +0,0 @@ ---- mf/emmentaler-brace.pe.in~ 2016-03-27 09:43:58.000000000 -0500 -+++ mf/emmentaler-brace.pe.in 2016-04-01 16:05:30.914128364 -0500 -@@ -60,7 +60,7 @@ - while (i < CharCnt()) - Select(i); - # crashes fontforge, use PUA for now -- jcn --# SetUnicodeValue(i + 0xF0000, 0); -+ SetUnicodeValue(i + 0xF0000, 0); - /* - PRIVATE AREA - In the BMP, the range 0xe000 to 0xf8ff will never be assigned to any -@@ -72,7 +72,7 @@ - assigned to the Linux zone is currently maintained by H. Peter Anvin - . - */ -- SetUnicodeValue(i + 0xE000, 0); -+# SetUnicodeValue(i + 0xE000, 0); - ++i; - endloop - diff --git a/lilypond.spec b/lilypond.spec index 3b83dfc..3d81d6f 100644 --- a/lilypond.spec +++ b/lilypond.spec @@ -4,7 +4,7 @@ Name: lilypond Version: 2.23.0 -Release: 1%{?dist} +Release: 2%{?dist} Summary: A typesetting system for music notation License: GPLv3 @@ -12,12 +12,7 @@ URL: https://www.lilypond.org Source0: https://lilypond.org/download/sources/v2.23/lilypond-%{version}.tar.gz Source1: century-schoolbook-l.metainfo.xml Patch0: lilypond-2.21.2-gcc44-relocate.patch -#Patch1: lilypond-emmentaler-area.patch -# https://bugzilla.redhat.com/show_bug.cgi?id=1568274 -# https://sourceforge.net/p/testlilyissues/issues/5320/ -# Fixed in http://git.savannah.gnu.org/gitweb/?p=lilypond.git;a=commitdiff;h=d63756608d265d7a99444af1123b7be8a06f3cc2 -#Patch2: lilypond-Fix-out-of-bounds-access-detected-by-D_GLIBCXX_ASSER.patch -#Patch3: py3.patch +Patch1: 612.patch Requires: ghostscript >= 8.15 Obsoletes: lilypond-fonts <= 2.12.1-1 @@ -35,7 +30,7 @@ BuildRequires: t1utils bison flex ImageMagick gettext BuildRequires: python3-devel BuildRequires: mftrace >= 1.1.19 BuildRequires: texinfo >= 4.8 -BuildRequires: compat-guile18-devel +BuildRequires: guile22-devel BuildRequires: ghostscript >= 8.15 BuildRequires: pango-devel >= 1.12.0 BuildRequires: fontpackages-devel @@ -153,8 +148,7 @@ This contains the directory common to all lilypond fonts. %setup -q %patch0 -p0 -#%%patch1 -p0 -#%patch3 -p0 +%patch1 -p1 %build PYTHON=/usr/bin/python3 @@ -216,6 +210,9 @@ ln -s %{_fontdir} $RPM_BUILD_ROOT%{_datadir}/lilypond/%{version}/fonts/otf %doc COPYING %changelog +* Mon Jan 25 2021 Gwyn Ciesla - 2.23.0-2 +- Upstream patch for ascii issue, move to Guile 2.2. + * Mon Jan 25 2021 Gwyn Ciesla - 2.23.0-1 - 2.23.0 diff --git a/py3.patch b/py3.patch deleted file mode 100644 index 73803a9..0000000 --- a/py3.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- mf/invoke-mf2pt1.sh~ 2020-04-26 04:45:49.000000000 -0500 -+++ mf/invoke-mf2pt1.sh 2020-05-13 09:13:18.273092230 -0500 -@@ -4,7 +4,7 @@ - - # realpath doesn't exist on OSX - realpath() { -- python -c "import os; print(os.path.realpath('$1'))" -+ python3 -c "import os; print(os.path.realpath('$1'))" - } - - set -eu