Compiling GNOME3 from scratch (for Beyond Linux From Scratch)

Hey guys!
This tutorial will help you compile the GNOME Desktop Environment v3 from scratch. This assumes that you have either a normal systemd-based Linux distribution or a Linux From Scratch system with systemd.

The GNOME documentation actually strongly recommends NOT building the packages from source and instead, use the packages available from a distro maintainer. But, in the case of source built systems like (B)LFS, this is not an option.

First of all, some due credits
A few notes before you start:
  • I have assembled the list of packages the best I could but errors might appear. Cross-check the BLFS instructions to see if you have the necessary dependencies.
  • GNOME is huge (around 90 packages for a base system) so expect to wait a long time before even testing the install.
  • This tutorial will only build a base GNOME system without much functionality. It's upto you to install any applications that you need (BLFS has instructions for a few applications)
  • GNOME requires hardware acceleration (DRI2 or Direct Rendering Infrastructure), so check if your videocard supports DRI2 first. Add your user to the video group as specified by the instructions if DRI is supported.
  • Lastly, I haven't tried launching GNOME from the GNOME Display Manager so this tutorial will only use xinit (startx) for launching GNOME 
So, without further ado, lets get started!

The below list shows the necessary packages with links to BLFS instructions for compiling them. A few have to be modified for making sure they compile properly.

Packages in dependency order

  1. porg (very highly recommended for managing packages)
    1. If you are installing porg (install it with a /usr prefix), then in every package given below, replace the install command with "sudo porg -lp <PACKAGE_NAME[_VERSION][_PYTHON_VERSION]> -- <ORIGINAL_INSTALL_COMMAND>". Add the Python version if the package uses multiple Python versions 
  2. X Window System (Obviously required. Install all packages)
  3. Python 2 (Compatibility with some packages)
  4. Python 3
  5. ISO Codes
  6. yasm
  7. sgml-common (Used for DocBook)
  8. UnZip
  9. SQLite
  10. NSPR 
  11. NSS
  12. docbook-xml (Recommended, required for GTK-Doc) 
  13. docbook-xsl (Recommended, required for GTK-Doc)
  14. libxml2
  15. libxslt
  16. Itstool (Required for GTK-Doc and other packages) 
  17. GTK-Doc (Not necessary, use if you want to generate documentation)
  18. PCRE (Recommended for Glib)
  19. libffi
  20. Wayland
  21. ICU (Recommended)
  22. Glib2 (Compile both Python modules. Suffix with the python version if using porg)
  23. dbus-glib
  24. Vala
  25. gobject-introspection 
  26. libpng
  27. libjpeg-turbo 
  28. libTIFF
  29. Pixman 
  30. Freetype2 (NOTE: Circular dependency with Harfbuzz)
  31. Cairo
  32. Harfbuzz (NOTE: Circular dependency with Freetype2)
  33. Fontconfig
  34. Pango
  35. shared-mime-info (If you get compile errors, try running make without parallelism [-j1] )
  36. ATK
  37. at-spi2-core
  38. at-spi2-atk
  39. gdk-pixbuf 
  40. GTK+ 3
  41. GConf
  42. libgpg-error 
  43. libgcrypt
  44. GMime
  45. libtasn1
  46. p11-kit 
  47. Gcr 
  48. gnome-keyring
  49. libsecret  
  50. libgudev
  51. Nettle 
  52. GnuTLS 
  53. gsettings-desktop-schemas  
  54. glib-networking
  55. libsoup
  56. Gvfs
  57. hicolor-icon-theme
  58. gnome-icon-theme
  59. startup-notification
  60. gnome-theme-standard
  61. gnome-desktop
  62. libwnck
  63. gnome-session
  64. VTE
  65. libarchive 
  66. YAML 
  67. Gcab 
  68. Appstream-GLib 
  69. DConf (Only the command-line tool)
  70. desktop-file-utils 
  71. Cogl
  72. Clutter
  73. libgee 
  74. libxklavier
  75. Py2Cairo
  76. PyGObject (Build the Python 2 module only)
  77. Caribou
  78. Berkeley DB
  79. CMake
  80. libical 
  81. evolution-data-server 
  82. MozJS
  83. MozJS 2 
  84. libcroco  
  85. libusb
  86. Linux PAM (recompile Shadow and Systemd after installing) 
  87. Polkit
  88. UPower 
  89. Zenity
  90. Mutter 
    1. After configuring, edit src/compositor/plugins/Makefile and remove -Werror from AM_CFLAGS and WARN_CFLAGS. Then compile
  91. gnome-shell 
  92. gnome-terminal (Doesn't work with this base. Have to check EDIT: Ensure you have a UTF8 locale otherwise gnome-terminal won't start)
  93. libgtop
  94. Nautilus (Doesn't work with this base. Have to check EDIT: Nautilus requires gnome-control-center which is not shown here because its dependency, gnome-online-accounts, requires WebkitGTK which takes a long time to compile)
  95. telepathy-glib
  96. telepathy-logger

Running GNOME 3

Create an .xinitrc file in your home directory by running:
cat > ~/.xinitrc << EOF
export XDG_MENU_PREFIX=gnome-
exec gnome-session

EOF
And finally, start GNOME by running "startx". GNOME should start without any problems. If there are any problems, fell free to comment with the last few lines of the output of "sudo journalctl -xe".
 
Cheers!
-Technohacker

Comments

Popular Posts