1 @c -*- coding: utf-8; mode: texinfo; -*-
6 Want to submit a patch for LilyPond? Great! Never created a patch
7 before? Never compiled software before? No problem! This chapter is
8 for you and will help you do this as quickly and easily as possible.
14 * Compiling with LilyDev::
21 @c This text was written based on LilyDev 4.0 - JL
23 There is a @q{remix} of Debian GNU/Linux -- known as @qq{LilyDev} for
24 short -- which includes all the necessary software and tools to compile
25 LilyPond, the documentation and the website (also see
28 @warning{LilyDev does not include the software for the Grand Unified
29 Builder -- also see @ref{Grand Unified Builder (GUB)}.}
31 While compiling LilyPond on MacOs and Windows is possible, both
32 environments are complex to set up. LilyDev can be easily installed
33 and run inside a @q{virtual machine} on either of these operating
34 systems relatively easily using readily available virtualization
35 software. We recommend using VirtualBox as it is available for all
36 major operating systems and is very easy to install & configure.
38 The LilyDev disk image can also be written to a USB device or @q{burnt}
39 to a DVD -- it is approximately 900 GB in size -- and installed just
40 like any standard GNU/Linux distribution.
42 The current image is based on a 32bit version of Debian 8 (@q{Jessie})
43 and the Disk image was generated using Debian
44 @uref{http://live.debian.net/, live-build 4}.
47 Download the LilyDev disk image file from here:
50 @uref{https://github.com/fedelibre/LilyDev/releases/latest}
53 @warning{Apart from installing and configuring LilyDev in VirtualBox,
54 the rest of the chapter assumes that you are comfortable using the
55 command-line and is intended for users who may have never created a
56 patch or compiled software before. More experienced developers (who
57 prefer to use their own development environment) may still find it
58 instructive to skim over the following information.}
60 If you are not familiar with GNU/Linux, it may be beneficial to read a
61 a few @qq{introduction to Linux} type web pages.
64 * Installing LilyDev in VirtualBox::
65 * Configuring LilyDev in VirtualBox::
69 @node Installing LilyDev in VirtualBox
70 @unnumberedsubsec Installing LilyDev in VirtualBox
72 This section discusses how to install and use LilyDev with VirtualBox.
74 @warning{If you already know how to install a virtual machine using a
75 disc image inside VirtualBox (or your own virtualization software) then
76 you can skip this section and go straight to @ref{lily-git}.}
80 Download Virtualbox from here:
83 @uref{http://www.virtualbox.org/wiki/Downloads}
86 @warning{In virtualization terminology, the operating system where
87 Virtualbox is installed is known as the @strong{host}. LilyDev
88 will be installed @q{inside} Virtualbox as a @strong{guest}.}
91 Start the VirtualBox software and click @q{New} to create a new
94 The @q{New Virtual Machine Wizard} will walk you through setting up your
95 guest virtual machine. Choose an appropriate name for your LilyDev
96 installation and select the @q{Linux} operating system. When selecting
97 the @q{version} choose @q{Debian (32 bit)} (don't use the @q{64 bit}
98 option). If you do not have that specific option choose @q{Linux 2.6}
99 (again do not choose any option that has 64 bit next to it).
102 Select the amount of RAM you will allow the LilyDev guest to use from
103 your host operating system when it is running. If possible, use at
104 least 700 MB of RAM; the more RAM you can spare from your host the
105 better, although LilyDev will currently use no more than 4 GB (4096 MB)
106 even if you are able to assign more.
109 For your @q{Virtual Hard Disk}, leave the @q{Create new hard disk}
110 option checked, use the default @q{VDI} and @qq{Dynamically allocated}
111 options for the virtual hard drive. A complete compile of everything
112 (code, docs, regression tests) can reach 10 GB so size your virtual disk
113 and its location accordingly.
116 Verify the summary details and click @q{Create}, when you are satisfied.
117 Your new guest will be displayed in the Virtualbox window.
119 @warning{The image contains a @q{686-pae} kernel, so you must enable
120 @code{PAE} within the virtual machine's settings -- click on
121 @clicksequence{System @click{} Processor} and select
122 @q{Extended features: Enable PAE/NX}.}
125 Click the @q{Start} button and the @q{First Run Wizard} will prompt you
126 for the installation media. Click the browse icon, locate the LilyDev
127 disk image and click through the wizard to begin the installation
131 When the LilyDev disk image boots for the first time, choose either the
132 @q{Install} or the @q{Graphical install} menu item. The installer will
133 then walk you through the complete installation process.
136 At the @qq{Partition disks} stage, do not be afraid to select
137 @qq{Guided - use entire disk}, since this refers to your
138 @strong{@emph{virtual disk}}, not your computer's own hard disk.
141 Continue to click through the rest of the wizard, filling in any
142 appropriate details when asked, and wait for the install to complete.
143 This will take about 10 minutes or so on a reasonably modern computer.
146 When the installation is completed, just click on @q{Continue} (you
147 do not have to remove any media since you installed LilyDev from a Disk
148 image, which is just a file on your computer). The installer will
149 reboot the virtual machine.
154 LilyDev should now be installed and running!
157 @node Configuring LilyDev in VirtualBox
158 @unnumberedsubsec Configuring LilyDev in VirtualBox
160 VirtualBox has extra @q{guest additions} which although are not
161 necessary to use LilyDev or compile Lilypond, do provide some additional
162 features to your Virtual Machine to make it easier to work with. Such
163 as being able to dynamically resize the LilyDev window, allow seamless
164 interaction with your mouse pointer on both the host and guest and let
165 you copy/paste between your host and guest if needed.
170 Select the @q{Devices} menu from the virtual machine window and choose
171 @q{Install Guest Additions...}. This will automount a CD which will
172 prompt you to autorun it. Click OK and follow the instructions. It is
173 recommended to reboot the guest when the installation is complete.
175 Other virtualization software will also have their own @q{guest}
176 additions, follow the normal procedures for your virtualization software
177 with LilyDev as the client.
180 Restart LilyDev to complete the installation of the guest additions.
182 @advanced{If you do any kernel upgrades, you may need to reinstall the
183 additional software. Just follow the step above again and reboot when
184 the reinstallation is complete.}
189 Other items that may be helpful:
194 In the settings for the virtual machine, set the network to
195 Bridged mode to allow you to access shared folders when using Windows
199 Set up any additional features, such as @q{Shared Folders} between
200 your main operating system and LilyDev. This is distinct from the
201 networked share folders in Windows. Consult the external documentation
204 Some longtime contributors have reported that @q{shared folders}
205 are rarely useful and not worth the fuss, particularly since files
206 can be shared over a network instead.
209 Pasting into a terminal is done with @code{Ctrl+Shift+v}.
212 Right-click allows you to edit a file with the text editor (default
218 Not all hardware is supported in all virtualization tools. In
219 particular, some contributors have reported problems with USB network
220 adapters. If you have problems with network connection (for example
221 Internet connection in the host system is lost when you launch virtual
222 system), try installing and running LilyDev with your computer's
223 built-in network adapter used to connect to the network. Refer to the
224 help documentation that comes with your virtualization software.
230 The @q{LilyPond Contributor's Git Interface} (otherwise known as
231 @command{lily-git.tcl}) is a simple-to-use GUI to help you download and
232 update the LilyPond source code as well as an aid to making software
236 * Where to get lily-git::
237 * Using lily-git to download the source code::
238 * How to use lily-git::
241 @node Where to get lily-git
242 @unnumberedsubsec Where to get lily-git
244 Depending on your development environment, lily-git may already be
245 installed on your computer.
249 If you are using LilyDev (see @ref{LilyDev}) then lily-git should
250 already be installed and ready to run. If this is not the case you can
251 easily turn it on by adding the following line in @code{~/.bashrc}:
254 # add lily-git to the PATH
255 PATH=$LILYPOND_GIT/scripts/auxiliar:"$@{PATH@}"
259 For those not using LilyDev, lily-git can be obtained by downloading
260 the software directly. See @ref{Manually installing lily-git.tcl}.
263 lily-git is part of the LilyPond source code and is located in
264 @file{$LILYPOND_GIT/scripts/auxillar/lily-git.tcl}.
269 @node Using lily-git to download the source code
270 @unnumberedsubsec Using lily-git to download the source code
274 Type the following command into a Terminal:
281 You will be prompted to enter a name and email address into the lily-git
282 UI. This information is used to label any patches you create (using the
283 lily-git UI or git via the command line) and can be changed later if
284 required. See @ref{Configuring Git}.
287 Click on the @emph{Submit} button to update lily-git with the
291 Click on the @qq{Get source} button.
293 A directory called @file{lilypond-git} is created within your home
294 directory and the entire source code will start to be downloaded into
297 @warning{Be patient! There is no progress bar in the lily-git UI but the
298 complete source is around 180@tie{}Mb.}
301 When the source code has been downloaded, the @qq{command output} window
302 in the lily-git UI will update and display @qq{Done} on the very last
303 line and the button label will change to say @qq{Update source}.
305 @warning{Some contributors have reported that occasionally nothing
306 happens at this step at all. If this occurs, then try again in a few
307 minutes -- it could be an intermittant network problem. If the
308 problem persists, please ask for help.}
311 Close the lily-git GUI and navigate to the @file{lilypond-git}
312 directory to view and edit the source files.
317 If this is the first time you will be attempting to compile LilyPond,
318 please see the section @ref{Compiling with LilyDev} before continuing.
321 @node How to use lily-git
322 @unnumberedsubsec How to use lily-git
324 Here is a brief description of what each button does in the lily-git UI.
326 @advanced{Throughout the rest of this manual, most command-line
327 input should be entered from within the top level of the
328 @file{~/lilypond-git/} directory. This is known as the
329 @emph{top of the source directory} and is also referred to as
330 @var{$LILYPOND_GIT} as a convention for those users who may have
331 configured their own locations of the LilyPond source code.}
333 @warning{For those less experienced contributors using lily-git, we
334 recommend that you only work on one set of changes at a time and not
335 start on any new changes until your first set has been accepted.}
337 @subsubheading 1. Update source
339 Click the @qq{Update source} button to get any recent changes to the
340 source code that have been added by other contributors since your last
343 @warning{If another contributor has updated files in the source code
344 that you had been working on then updating your own copy of the source
345 code may result in what is known as a @emph{merge conflict}. If this
346 occurs, follow the instructions to @qq{Abort changes}, below. Note that
347 your work will not be lost.}
350 @subsubheading 2a. New local commit
352 A single commit typically represents one logical set of related
353 changes (such as a bug-fix), and may incorporate changes to
354 multiple files at the same time.
356 When you're finished making the changes for a commit, click the
357 @qq{New local commit} button. This will open the @qq{Git Commit
358 Message} window. The message header is required, and the message
361 After entering a commit message, click @qq{OK} to finalize the
364 @advanced{for more information regarding commits and commit
365 messages, see @ref{Commits and patches}.}
368 @subsubheading 2b. Amend previous commit
370 You can go back and make changes to the most recent commit with
371 the @qq{Amend previous commit} button. This is useful if a
372 mistake is found after you have clicked the @qq{New local commit}
375 To amend the most recent commit, re-edit the source files as
376 needed and then click the @qq{Amend previous commit} button. The
377 earlier version of the commit is not saved, but is replaced by the
380 @warning{This does not update the patch @strong{files}; if you
381 have a patch file from an earlier version of the commit, you will
382 need to make another patch set when using this feature. The old
383 patch file will not be saved, but will be replaced by the new one
384 after you click on @qq{Make patch set}.}
387 @subsubheading 3. Make patch set
389 Before making a patch set from any commits, you should click the
390 @qq{Update source} button to make sure the commits are based on
391 the most recent remote snapshot.
393 When you click the @qq{Make patch set} button,
394 @command{lily-git.tcl} will produce patch files for any new
395 commits, saving them to the current directory. The command output
396 will display the name of the new patch files near the end of the
400 0001-CG-add-lily-git-instructions.patch
404 Send patch files to the appropriate place:
408 If you have a mentor, send it to them via email.
411 Translators should send patches to
412 @email{translations@@lilynet.net}.
415 More experienced contributors should upload the patch for
416 web-based review. This requires additional software and use of
417 the command-line; see @ref{Uploading a patch for review}.
420 If you have trouble uploading the patch for review,
421 ask for help on @email{lilypond-devel@@gnu.org}.
426 @subsubheading The @qq{Abort changes -- Reset to origin} button
428 @warning{Only use this if your local commit history gets
429 hopelessly confused!}
431 The button labeled @qq{Abort changes -- Reset to origin} will copy
432 all changed files to a subdirectory of @file{$LILYPOND_GIT} named
433 @file{aborted_edits/}, and will reset the repository to the
434 current state of the remote repository (at @code{git.sv.gnu.org}).
441 * Installing git-cl::
443 * Configuring git-cl::
446 Git-cl is a @q{helper script} that uploads patches to Google's Rietveld
447 Code Review Tool -- used by the developers for patch review -- and, at
448 the same time, updates LilyPond's issue tracker.
451 @node Installing git-cl
452 @unnumberedsubsec Installing @code{git-cl}
454 @warning{LilyDev users can jump straight to the next section on updating
455 @command{git-cl} as it will already be installed in your home
461 Download @command{git-cl} by running the command:
464 git clone https://github.com/gperciva/git-cl.git
468 or, if that command fails for any reason, try:
471 git clone git://github.com/gperciva/git-cl.git
475 Add the @file{git-cl/} directory to your @var{PATH} or create a symbolic
476 link to the @command{git-cl} and @command{upload.py} scripts in one of
477 your @var{PATH} directories (e.g. @file{$HOME/bin}).
479 In GNU/Linux you can add directories to @var{PATH} by adding this line
480 to your @file{.bashrc} file located in your home directory:
483 PATH=~/directory_containing_git-cl:"$@{PATH@}"
489 @node Updating git-cl
490 @unnumberedsubsec Updating @code{git-cl}
492 LilyDev users should always make sure that they alwsys have the latest
493 version of git-cl installed. It is possible that changes may have been
494 made to git-cl that are not (yet) included in the version of LilyDev has
498 Using a terminal run the following commands:
505 This will download and update you to the lastest version of git-cl.
508 @node Configuring git-cl
509 @unnumberedsubsec Configuring @code{git-cl}
511 @subsubheading Set up login accounts
513 Because the @code{git-cl} updates two separate websites (Google's
514 Rietveld Code Review Tool and LilyPond's issue tracker) you @emph{must}
515 have a valid user login and password to both sites.
518 Although that it may appear that you have to use a @q{Google} email
519 address for the Rietveld Code Review Tool when you sign up, you can
520 instead select the option @qq{I prefer to use my current email address}
524 For a user login to the LilyPond issue tracker, please send your
525 request, preferably using the email address you want to use for your
526 login, to the LilyPond Developer's mailing list
527 (@code{lilypond-devel@@gnu.org}).
529 @subsubheading Authorising git-cl for the LilyPond issue tracker
531 The @code{git-cl} command itself also needs to be @q{authorized} so that
532 it can access the LilyPond issue tracker.
536 Once a valid login has been given for the LilyPond issye tracker, go to
537 the @q{Account settings} and select the @q{OAuth} tab.
540 Locate the @q{Register New Application} section and enter @code{git-cl}
541 in the @q{Application Name:} field.
544 Click on the @q{Register new application} button. You should now see
545 @q{git-cl} listed under the @q{My Applications} section.
548 Click on the @q{Generate Bearer Token} button. You should now see
549 @q{git-cl} listed under the @q{Authorized Applications} section along
550 with a value for the @q{Bearer Token} entry. This value is used, in the
551 next steps, to allow git-cl to access and update the LilyPond issue
556 @subsubheading Running git-cl for the first time
560 Using a terminal, move to top source directory of the
561 @code{$LILYPOND_GIT} directory and then run @code{git-cl} with the
562 @code{config} option:
570 When prompted for the @code{Rietveld server}:
573 Rietveld server (host[:port]) [codereview.appspot.com]:
577 When prompted for the @code{Allura server} (the LilyPond issue tracker):
580 Allura server [https://sourceforge.net/p/testlilyissues/issues/]:
584 When prompted for the @code{Allura bearer token} copy/paste the value
585 generated in the previous steps for
586 @emph{Authorising git-cl for the LilyPond issue tracker}:
589 Allura bearer token (see https://sourceforge.net/auth/oauth/) [fdbfca60801533465480]:
592 @warning{The above is a @q{fake} bearer token just to illustrate the
593 example. Do not use this value.}
596 Finally, when prompted for the @code{CC list} entry, add the Lilypond
597 Developer's group email.
600 CC list ("x" to clear) [lilypond-devel@@gnu.org]:
605 The @code{git-cl} script should now be correctly configured for use.
608 @node Compiling with LilyDev
609 @section Compiling with LilyDev
611 LilyDev is our @q{remix} of Debian which contains all the
612 necessary dependencies to do lilypond development; for more
613 information, see @ref{LilyDev}.
615 @subsubheading Preparing the build
617 To prepare the build directory, enter (or copy&paste) the below
618 text. This should take less than a minute.
620 @c we heavily recommend the out-of-tree build; do not change this!
624 sh autogen.sh --noconfigure
630 @subsubheading Building @code{lilypond}
632 Compiling lilypond will likely take between 5 and 60 minutes,
633 depending on your computer's speed and available RAM. We
634 recommend that you minimize the terminal window while it is
635 building; this can have a non-negligible effect on compilation
639 cd $LILYPOND_GIT/build/
643 You may run the compiled @code{lilypond} with:
646 cd $LILYPOND_GIT/build/
647 out/bin/lilypond my-file.ly
650 @subsubheading Building the documentation
652 Compiling the documentation is a much more involved process, and
653 will likely take 2 to 10 hours.
656 cd $LILYPOND_GIT/build/
661 The documentation is put in @file{out-www/offline-root/}. You may
662 view the html files by entering the below text; we recommend that
663 you bookmark the resulting page:
666 firefox $LILYPOND_GIT/build/out-www/offline-root/index.html
669 @subsubheading Installing
671 Don't. There is no reason to install lilypond within LilyDev.
672 All development work can (and should) stay within the
673 @file{$LILYPOND_GIT} directory, and any personal composition
674 or typesetting work should be done with an official GUB release.
677 @subsubheading Problems and other options
679 To select different build options, or isolate certain parts of the
680 build, or to use multiple CPUs while building, read
683 In particular, contributors working on the documentation should be
684 aware of some bugs in the build system, and should read the
685 workarounds in @ref{Generating documentation}.
688 @node Now start work!
689 @section Now start work!
691 LilyDev users may now skip to the chapter which is aimed at
692 their intended contributions:
695 @item @ref{Documentation work}
696 @item @ref{Translating the documentation}
697 @item @ref{Website work}
698 @item @ref{Regression tests}
699 @item @ref{Programming work}
702 These chapters are mainly intended for people not using LilyDev,
703 but they contain extra information about the
704 @qq{behind-the-scenes} activities. We recommend that you read
705 these at your leisure, a few weeks after beginning work with
709 @item @ref{Working with source code}
710 @item @ref{Compiling}