diff --git a/HACKING b/HACKING index e8f6cc4208..cf10ba5536 100644 --- a/HACKING +++ b/HACKING @@ -2,7 +2,7 @@ #+TITLE: Hacking GNU Guix and Its Incredible Distro -Copyright © 2012, 2013, 2014 Ludovic Courtès +Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès Copyright © 2013 Nikita Karetnikov Copyright © 2014 Pierre-Antoine Rault @@ -46,17 +46,7 @@ take a look at “info '(guix) Installation'” or send a message to * Running Guix before it is installed -Command-line tools can be used even if you have not run "make install". -To do that, prefix each command with ‘./pre-inst-env’, as in: - - ./pre-inst-env guix build --help - -Similarly, for a Guile session using the Guix modules: - - ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))' - -The ‘pre-inst-env’ script sets up all the environment variables -necessary to support this. +See the same-named section in the manual. * The Perfect Setup diff --git a/doc/emacs.texi b/doc/emacs.texi index 93d0c86b42..e1d14a4c4a 100644 --- a/doc/emacs.texi +++ b/doc/emacs.texi @@ -29,7 +29,7 @@ is ready to use, provided Guix is installed system-wide, which is the case by default. So if that is what you're using, you can happily skip this section and read about the fun stuff. -If you're not yet a happy user of GSD, a little bit of setup is needed. +If you're not yet a happy user of GuixSD, a little bit of setup is needed. To be able to use ``guix.el'', you need to install the following packages: diff --git a/doc/guix.texi b/doc/guix.texi index 9bd9c581ce..cfb626c705 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -88,6 +88,7 @@ Installation * Running the Test Suite:: Testing Guix. * Setting Up the Daemon:: Preparing the build daemon's environment. * Invoking guix-daemon:: Running the build daemon. +* Running Guix Before It Is Installed:: Hacker tricks. Setting Up the Daemon @@ -114,6 +115,11 @@ Programming Interface * The Store Monad:: Purely functional interface to the store. * G-Expressions:: Manipulating build expressions. +Defining Packages + +* package Reference:: The package data type. +* origin Reference:: The origin data type. + Utilities * Invoking guix build:: Building packages from the command line. @@ -247,6 +253,7 @@ instead, you want to install the complete GNU operating system, * Running the Test Suite:: Testing Guix. * Setting Up the Daemon:: Preparing the build daemon's environment. * Invoking guix-daemon:: Running the build daemon. +* Running Guix Before It Is Installed:: Hacker tricks. @end menu @node Binary Installation @@ -825,6 +832,44 @@ useful in exceptional circumstances, such as if you need to run several daemons on the same machine. @end table +@node Running Guix Before It Is Installed +@section Running Guix Before It Is Installed + +If you are hacking Guix itself---which is a good idea!---you will find +it useful to test the changes made in your local source tree checkout +without actually installing them. + +To that end, all the command-line tools can be used even if you have not +run @command{make install}. To do that, prefix each command with +@command{./pre-inst-env} (the @file{pre-inst-env} script lives in the +top build tree of Guix), as in: + +@example +$ sudo ./pre-inst-env guix-daemon --build-users-group=guixbuild +$ ./pre-inst-env guix build hello +@end example + +@noindent +Similarly, for a Guile session using the Guix modules: + +@example +$ ./pre-inst-env guile -c '(use-modules (guix utils)) (pk (%current-system))' +@end example + +The @command{pre-inst-env} script sets up all the environment variables +necessary to support this, including @code{PATH} and +@code{GUILE_LOAD_PATH}. + +If you are hacking Guix from Emacs using the wonderful Geiser +(@pxref{Introduction,,, geiser, Geiser User Manual}), make sure to +augment Guile's load path so that it finds source files from your +checkout: + +@lisp +;; Assuming the Guix checkout is in ~/src/guix. +(add-to-list 'geiser-guile-load-path "~/src/guix") +@end lisp + @c ********************************************************************* @node Package Management @@ -6210,7 +6255,8 @@ creating packages. For more information on package definitions, Once a package definition is in place, stored in a file in the Guix source tree, it can be tested using the @command{guix build} command (@pxref{Invoking guix build}). For example, assuming the new package is -called @code{gnew}, you may run this command from the Guix build tree: +called @code{gnew}, you may run this command from the Guix build tree +(@pxref{Running Guix Before It Is Installed}): @example ./pre-inst-env guix build gnew --keep-failed diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index f54e3d3a35..3081a93a97 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -418,7 +418,6 @@ to it are lost." (switch-root "/root") (format #t "loading '~a'...\n" to-load) - ;; TODO: Remove /lib, /share, and /loader.go. (primitive-load to-load) (format (current-error-port) diff --git a/gnu/packages/audio.scm b/gnu/packages/audio.scm index e607d1a9a0..fdc783a455 100644 --- a/gnu/packages/audio.scm +++ b/gnu/packages/audio.scm @@ -991,10 +991,8 @@ buffers, and audio capture.") ("boost" ,boost) ("jack" ,jack-1) ("ganv" ,ganv) - ("glib" ,glib) ("glibmm" ,glibmm) ("gtkmm" ,gtkmm-2) - ("dbus" ,dbus) ("dbus-glib" ,dbus-glib))) (native-inputs `(("pkg-config" ,pkg-config))) diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index 1d43895f5c..305c89c022 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -353,10 +353,11 @@ translated.") (base32 "1xi1v1msz75qs0s4lkyf1psrksdppa3hwkg0mznc6gpw5flg3hdz")))) (build-system gnu-build-system) - (inputs + (propagated-inputs ; according to dbus-glib-1.pc `(("dbus" ,dbus) - ("expat" ,expat) ("glib" ,glib))) + (inputs + `(("expat" ,expat))) (native-inputs `(("glib" ,glib "bin") ("pkg-config" ,pkg-config))) diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm index 3c7aab4874..eefe75de1e 100644 --- a/gnu/packages/gnome.scm +++ b/gnu/packages/gnome.scm @@ -837,8 +837,7 @@ use in GNOME applications, built on top of CORBA.") (sha256 (base32 "0k3q9nh53yhc9qxf1zaicz4sk8p3kzq4ndjdsgpaa2db0ccbj4hr")))) (build-system gnu-build-system) - (inputs `(("dbus" ,dbus) - ("dbus-glib" ,dbus-glib) + (inputs `(("dbus-glib" ,dbus-glib) ("libxml2" ,libxml2))) (propagated-inputs `(("glib" ,glib) ; referred to in the .pc file ("orbit2" ,orbit2))) @@ -907,7 +906,6 @@ designed to be accessed through the MIME functions in GnomeVFS.") %standard-phases)))) (inputs `(("libxml2" ,libxml2) ("dbus-glib" ,dbus-glib) - ("dbus" ,dbus) ("gconf" ,gconf) ("gnome-mime-data" ,gnome-mime-data) ("zlib" ,zlib))) @@ -1949,7 +1947,6 @@ keyboard shortcuts.") ("intltool" ,intltool))) (inputs `(("eudev" ,eudev) - ("dbus" ,dbus) ("dbus-glib" ,dbus-glib) ("libusb" ,libusb) ("lcms" ,lcms) @@ -2083,7 +2080,6 @@ faster results and to avoid unnecessary server load.") ("python" ,python))) (inputs `(("eudev" ,eudev) - ("dbus" ,dbus) ("dbus-glib" ,dbus-glib) ("libusb" ,libusb))) (home-page "http://upower.freedesktop.org/") diff --git a/gnu/packages/gnuzilla.scm b/gnu/packages/gnuzilla.scm index 4410c5bc43..20930c302a 100644 --- a/gnu/packages/gnuzilla.scm +++ b/gnu/packages/gnuzilla.scm @@ -245,9 +245,7 @@ standards.") `(("alsa-lib" ,alsa-lib) ("bzip2" ,bzip2) ("cairo" ,cairo) - ("dbus" ,dbus) ("dbus-glib" ,dbus-glib) - ("glib" ,glib) ("gstreamer" ,gstreamer) ("gst-plugins-base" ,gst-plugins-base) ("gtk+" ,gtk+-2) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 26e9aa9000..62a19f5332 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès -;;; Copyright © 2013, 2014 Andreas Enge +;;; Copyright © 2013, 2014, 2015 Andreas Enge ;;; Copyright © 2012 Nikita Karetnikov ;;; Copyright © 2014, 2015 Mark H Weaver ;;; Copyright © 2015 Federico Beffa @@ -308,7 +308,7 @@ It has been modified to remove all non-free binary blobs.") (license gpl2) (home-page "http://www.gnu.org/software/linux-libre/")))) - + ;;; ;;; Pluggable authentication modules (PAM). ;;; @@ -354,7 +354,7 @@ be used through the PAM API to perform tasks, like authenticating a user at login. Local and dynamic reconfiguration are its key features") (license bsd-3))) - + ;;; ;;; Miscellaneous. ;;; @@ -1582,7 +1582,7 @@ from the module-init-tools project.") ;; Work around undefined reference to ;; 'mq_getattr' in sc-daemon.c. "LDFLAGS=-lrt") - #:phases + #:phases (alist-cons-before 'build 'pre-build ;; The program 'g-ir-scanner' (part of the package @@ -2203,7 +2203,8 @@ applications.") (arguments '(#:configure-flags (let ((out (assoc-ref %outputs "out"))) - (list "--disable-systemd" + (list "--enable-library" + "--disable-systemd" ;; Install dbus/udev files to the correct location. (string-append "--with-dbusconfdir=" out "/etc") (string-append "--with-udevdir=" out "/lib/udev"))))) diff --git a/gnu/packages/mail.scm b/gnu/packages/mail.scm index f9eb5a7453..70b0b0298d 100644 --- a/gnu/packages/mail.scm +++ b/gnu/packages/mail.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer ;;; Copyright © 2015 Paul van der Walt ;;; Copyright © 2015 Eric Bavier +;;; Copyright © 2015 Andreas Enge ;;; ;;; This file is part of GNU Guix. ;;; @@ -493,7 +494,6 @@ MailCore 2.") (inputs `(("bogofilter" ,bogofilter) ("curl" ,curl) ("dbus-glib" ,dbus-glib) - ("dbus" ,dbus) ("enchant" ,enchant) ("expat" ,expat) ("ghostscript" ,ghostscript) diff --git a/gnu/packages/messaging.scm b/gnu/packages/messaging.scm index 99c5bdb0ff..50d59cfcc5 100644 --- a/gnu/packages/messaging.scm +++ b/gnu/packages/messaging.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2014, 2015 Mark H Weaver ;;; Copyright © 2014 Julien Lepiller ;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer +;;; Copyright © 2015 Andreas Enge ;;; ;;; This file is part of GNU Guix. ;;; diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 9da91111f6..9b4f6b6787 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -3274,9 +3274,7 @@ features useful for text console applications.") `(("pkg-config" ,pkg-config))) (inputs `(("python" ,python) - ("dbus" ,dbus) - ("dbus-glib" ,dbus-glib) - ("glib" ,glib))) + ("dbus-glib" ,dbus-glib))) (synopsis "Python bindings for D-bus") (description "python-dbus provides bindings for libdbus, the reference implementation of D-Bus.") diff --git a/gnu/packages/wicd.scm b/gnu/packages/wicd.scm index 779ec84e3c..908b15e30b 100644 --- a/gnu/packages/wicd.scm +++ b/gnu/packages/wicd.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2015 Pierre-Antoine Rault +;;; Copyright © 2015 Andreas Enge ;;; ;;; This file is part of GNU Guix. ;;; @@ -49,8 +50,7 @@ "wicd-template-instantiation.patch"))))) (build-system python-build-system) (native-inputs `(("gettext" ,gnu-gettext))) - (inputs `(("dbus" ,dbus) - ("dbus-glib" ,dbus-glib) + (inputs `(("dbus-glib" ,dbus-glib) ("python2-dbus" ,python2-dbus) ("python2-pygtk" ,python2-pygtk) ("python2-urwid" ,python2-urwid) diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index 8d5fbe5a78..1feb821389 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -145,6 +145,16 @@ When GRUB? is true, install GRUB on DEVICE, using GRUB.CFG." ;; Copy items to the new store. (copy-closure to-copy target #:log-port log-port))))) + ;; Make sure TARGET is root-owned when running as root, but still allow + ;; non-root uses (useful for testing.) See + ;; . + (if (zero? (geteuid)) + (chown target 0 0) + (warning (_ "not running as 'root', so \ +the ownership of '~a' may be incorrect!~%") + target)) + + (chmod target #o755) (let ((os-dir (derivation->output-path os-drv)) (format (lift format %store-monad)) (populate (lift2 populate-root-file-system %store-monad)))