1 @c -*- coding: utf-8; mode: texinfo; -*-
6 Want to submit a patch for LilyPond? Great! This chapter is
7 designed to let you do this as quickly and easily as possible.
9 It is not possible to compile LilyPond on Windows, and extremely
10 difficulty to compile it on MacOS X. We have therefore made a
11 @q{remix} of Ubuntu which includes all necessary dependencies to
12 compile both LilyPond and the documentation. This can be run
13 inside a virtual machine without disturbing your main operating
16 @advanced{experienced developers may prefer to use their own
17 development environment. It may be instructive to skim over these
18 instructions, but be aware that this chapter is intended for
19 helpful users who may have never created a patch before.}
24 * Compiling with lilybuntu::
34 * Installing lilybuntu::
35 * Configuring lilybuntu in virtualbox::
39 @node Installing lilybuntu
40 @subsection Installing lilybuntu
44 Install some virtualization software.
46 Any virtualization tool can be used, but we recommend VirtualBox:
49 @uref{http://@/www.virtualbox.org/@/wiki/@/Downloads}
52 In virtualization terminology, your main operating system is the
53 @qq{host}, while lilybuntu is the @qq{guest}.
56 Download the @file{lilybuntu2.iso} disk image: (approximately 1
60 @uref{http://files.lilynet.net/lilybuntu2.iso}
63 @advanced{There is a md5sum available:
64 @uref{http://files.lilynet.net/lilybuntu2.iso.md5}}
67 Install @file{lilybuntu2.iso} as the @qq{guest} operating system
68 on your virtualized system.
73 If possible, use at least 700 MB of RAM (1GB would be better) for
74 the virtual machine, and use @qq{dynamically expanding storage}
75 for the virtual hard drive. A complete compile of everything
76 (code, docs, regression tests) can reach 10 GB.
79 When @file{lilybuntu2.iso} boots, it shows an ISOLINUX
80 @code{boot:} prompt. Type:
87 At the @qq{Prepare disk space} stage, do not be afraid to select
88 @qq{Erase and use the entire disk}, since this refers to your
89 @emph{virtual disk}, not your machine's actual hard drive.
92 When prompted to remove the installation CD, go to
93 @clicksequence{Devices @click{} CD/DVD Devices} and de-select
94 @file{lilybuntu2.iso}.
99 The latest version of lilybuntu is based on Ubuntu 10.04.1; if you
100 encounter any difficulties installing it, search for one of the
101 many tutorials for installing that particular version of Ubuntu as
102 a guest operating system.
106 Do any extra configuration for your virtualization software.
108 There are additional instructions for VirtualBox in
109 @ref{Configuring lilybuntu in virtualbox}.
111 If you use other virtualization software, then follow the normal
112 procedures for your virtualization software with Ubuntu as the
115 @advanced{not all hardware is supported in all virtualization
116 tools. In particular, some contributors have reported problems
117 with USB devices. If you would like to investigate further, then
118 look for help for your virtualization tool using your normal OS as
119 the @qq{host} and Ubuntu as the @qq{client}.}
124 @node Configuring lilybuntu in virtualbox
125 @subsection Configuring lilybuntu in virtualbox
127 VirtualBox has extra @qq{guest additions} which can make the
128 virtualization easier to use (full-screen, easy file sharing
129 between host and guest operating systems, shared clipboards, etc).
134 In @emph{VirtualBox}, select @clicksequence{Devices @click{}
135 Install Guest Additions...}.
138 In @emph{Ubuntu}, select @clicksequence{Places @click{}
139 VBOXADDITIONS_}. A file-system window will open.
142 Double-click on the @file{autorun.sh} file, then select @qq{Run in
143 Terminal}, and enter your password when prompted.
146 Once the script is finished, restart Ubuntu to complete the
149 @advanced{If you do any kernel upgrades, you may need to re-run
150 these VBOXADDITIONS instructions.}
153 Some other steps may be helpful:
157 In the settings for the virtual machine, set the network to
158 Bridged mode to allow you to access shared folders on your Windows
162 Set up any additional features, such as @q{Shared Folders} between
163 your main operating system and ubuntu. This is distinct from the
164 networked share folders in Windows. Consult external
165 documentation for this step.
167 TODO: maybe we should just nuke this point? is it easier to do
168 networked file sharing in osx, linux, etc, thus making the
169 virtualbox "shared folders" not useful?
174 @node Using lilybuntu
175 @subsection Using lilybuntu
177 If you are not familiar with Linux, it may be beneficial to read a
178 couple of @qq{introduction to Ubuntu} webpages.
182 One particular change from Windows and MacOS X is that most
183 software should be installed with your @qq{package manager}; this
184 vastly simplifies the process of installing and configuring
185 software. Go to @clicksequence{Applications @click{} Ubuntu
189 The rest of this manual assumes that you are using the
190 command-line; go to @clicksequence{Applications @click{}
191 Accessories @click{} Terminal}.
194 Pasting into a terminal is done with @code{Ctrl+Shift+v}.
197 Some contributors have recommended: (pdf available for free)
200 @uref{http://www.ubuntupocketguide.com/}
206 @c if you change this node name, you'll need to change the @ref in
207 @c web/ and/or included/, along with all the translations.
209 @section Using lily-git
211 @command{lily-git.tcl} is a graphical tool to help you access and
212 share changes to the lilypond source code.
215 * Install and configuration of lily-git.tcl::
216 * Daily use of lily-git.tcl::
219 @node Install and configuration of lily-git.tcl
220 @unnumberedsubsec Install and configuration of @command{lily-git.tcl}
222 @warning{The rest of this manual assumes that you are using the
223 command-line; go to @clicksequence{Applications @click{}
224 Accessories @click{} Terminal}.}
228 @code{lily-git.tcl} has already been installed for you. Simply type
237 Click on the @qq{Get source} button.
239 This will create a directory called @file{lilypond-git/} within
240 your home directory, and will download the source code into that
241 directory (around 55Mb). When the process is finished, the
242 @qq{Command output} window will display @qq{Done}, and the button
243 label will change to say @qq{Update source}.
246 Navigate to the @file{lilypond-git/} directory to view the source
251 You should now progress to @ref{Compiling with lilybuntu}.
253 @warning{Throughout the rest of this manual, most command-line
254 input should be entered from @file{~/lilypond-git/}. This is
255 referred to as the @emph{top source directory}.}
258 @subsubheading Other operating systems
262 If you haven't already, download and install Git.
267 Lilybuntu users: git has already been installed for you.
269 @item Windows users: download the @code{.exe} file labeled
270 @qq{Full installer for official Git} from:
273 @uref{http://code.google.com/p/msysgit/downloads/list}
276 @item Other operating systems: either install @command{git} with
277 your package manager, or download it from the @qq{Binaries}
281 @uref{http://git-scm.com/download}
288 Download the @command{lily-git.tcl} script from:
290 @c don't change the cgit link below to gitweb; gitweb uses
291 @c long filenames like "scripts_auxiliar_lily-git.tcl"
294 @uref{http://git.sv.gnu.org/cgit/lilypond.git/plain/scripts/auxiliar/lily-git.tcl}
298 To run the program from the command line, navigate to the
299 directory containing @command{lily-git.tcl} and enter:
306 Go read the lilybuntu instructions, starting from the @qq{get
311 @advanced{the @qq{Get source} button does not fetch the entire
312 history of the git repository, so utilities like @command{gitk}
313 will only be able to display the most recent additions. As you
314 continue to work with @command{lily-git.tcl}, the @qq{Update
315 source} button will take any new additions and add it to whatever
316 is currently in your repository's history.}
319 @node Daily use of lily-git.tcl
320 @unnumberedsubsec Daily use of @command{lily-git.tcl}
322 @warning{Only work on one set of changes at once. Do not start
323 work on any new changes until your first set has been accepted.}
325 @subsubheading 1. Update source
327 At the beginning of each session of lilypond work, you should
328 click the @qq{Update source} button to get the latest changes to
331 @warning{In some rare and unfortunate circumstances, this will
332 result in a @emph{merge conflict}. If this occurs, follow the
333 instructions for @qq{Abort changes}, below. Your work will not be
337 @subsubheading 2a. New local commit
339 A single commit typically represents one logical set of related
340 changes (such as a bug-fix), and may incorporate changes to
341 multiple files at the same time.
343 When you're finished making the changes for a commit, click the
344 @qq{New local commit} button. This will open the @qq{Git Commit
345 Message} window. The message header is required, and the message
348 After entering a commit message, click @qq{OK} to finalize the
351 @advanced{for more information regarding commits and commit
352 messages, see @ref{Commits and patches}.}
355 @subsubheading 2b. Amend previous commit
357 You can go back and make changes to the most recent commit with
358 the @qq{Amend previous commit} button. This is useful if a
359 mistake is found after you have clicked the @qq{New local commit}
362 To amend the most recent commit, re-edit the source files as
363 needed and then click the @qq{Amend previous commit} button. The
364 earlier version of the commit is not saved, but is replaced by the
367 @warning{This does not update the patch @strong{files}; if you
368 have a patch file from an earlier version of the commit, you will
369 need to make another patch set when using this feature. The old
370 patch file will not be saved, but will be replaced by the new one
371 after you click on @qq{Make patch set}.}
374 @subsubheading 3. Make patch set
376 Before making a patch set from any commits, you should click the
377 @qq{Update source} button to make sure the commits are based on
378 the most recent remote snapshot.
380 When you click the @qq{Make patch set} button,
381 @command{lily-git.tcl} will produce patch files for any new
382 commits, saving them to the current directory. The command output
383 will display the name of the new patch files near the end of the
387 0001-CG-add-lily-git-instructions.patch
391 Send patch files to the appropriate place:
395 If you have a mentor, send it to them via email.
398 New contributors should send the patch attached to an email to
399 @email{frogs@@lilynet.net}. Please add @qq{[PATCH]} to the
403 Translators should send patches to
404 @email{translations@@lilynet.net}.
407 More experienced contributors should upload the patch for
408 web-based review. This requires additional software and use of
409 the command-line; see @ref{Uploading a patch for review}.
414 @subsubheading The @qq{Abort changes -- Reset to origin} button
416 @warning{Only use this if your local commit history gets
417 hopelessly confused!}
419 The button labeled @qq{Abort changes -- Reset to origin} will copy
420 all changed files to a subdirectory of @file{lilypond-git/} named
421 @file{aborted_edits/}, and will reset the repository to the
422 current state of the remote repository (at @code{git.sv.gnu.org}).
426 @node Compiling with lilybuntu
427 @section Compiling with lilybuntu
429 Lilybuntu is our @q{remix} of Ubuntu which contains all the
430 necessary dependencies to do lilypond development; for more
431 information, see @rcontrib{Lilybuntu}.
433 @subsubheading Preparing the build
435 To prepare the build directory, enter (or copy&paste) the below
436 text. This should take less than a minute.
440 sh autogen.sh --noconfigure
446 @advanced{this is called an @qq{out-of-tree} build; we heavily
447 recommend this build method.}
449 @subsubheading Building @code{lilypond}
451 Compiling lilypond will likely take between 5 and 30 minutes,
452 depending on your computer's speed and available RAM. We
453 recommend that you minimize the terminal window while it is
454 building; this can have a non-negligible effect on compilation
458 cd ~/lilypond-git/build/
462 You may run the compiled @code{lilypond} with:
465 cd ~/lilypond-git/build/
466 out/bin/lilypond my-file.ly
469 @subsubheading Building the documentation
471 Compiling the documentation is a much more involved process, and
472 will likely take 2 to 10 hours.
475 cd ~/lilypond-git/build/
479 The documentation is put in @file{out-www/offline-root/}. You may
480 view the html files by entering the below text; we recommend that
481 you bookmark the resulting page:
484 firefox ~/lilypond-git/build/out-www/offline-root/index.html
487 @subsubheading Other options
489 To select different build options, or isolate certain parts of the
490 build, or to use multiple CPUs while building, read the rest of
494 @node Now start work!
495 @section Now start work!
497 Lilybuntu users may now skip to the chapter which is aimed at
498 their intended contributions:
501 @item @rcontrib{Documentation work}
502 @item @rcontrib{Translate the documentation}
503 @item @rcontrib{Website work}
504 @item @rcontrib{Regression tests}
505 @item @rcontrib{Programming work}