From 68c6b5f2fc18d3468afc12ecd88c6b800b60fefc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 11 Jun 2008 12:31:44 +0000 Subject: [PATCH] * git: make the TCL/TK GUI optional (git.guiSupport). * git: always install the Emacs mode but don't depend on Emacs to do it (just don't build the .elc files). svn path=/nixpkgs/trunk/; revision=12037 --- .../version-management/git/default.nix | 52 +++++++++---------- pkgs/top-level/all-packages.nix | 12 ++--- 2 files changed, 29 insertions(+), 35 deletions(-) diff --git a/pkgs/applications/version-management/git/default.nix b/pkgs/applications/version-management/git/default.nix index 323b5d27d0c4..3e6a838b4995 100644 --- a/pkgs/applications/version-management/git/default.nix +++ b/pkgs/applications/version-management/git/default.nix @@ -1,7 +1,9 @@ -{ fetchurl, stdenv, curl, openssl, zlib, expat, perl, gettext, emacs, cpio +{ fetchurl, stdenv, curl, openssl, zlib, expat, perl, gettext, cpio , asciidoc, texinfo, xmlto, docbook2x, docbook_xsl, docbook_xml_dtd_42 , libxslt, tcl, tk, makeWrapper -, svnSupport, subversion, perlLibs }: +, svnSupport, subversion, perlLibs +, guiSupport +}: # `git-svn' support requires Subversion and various Perl libraries. # FIXME: We should make sure Subversion comes with its Perl bindings. @@ -18,28 +20,22 @@ stdenv.mkDerivation rec { patches = [ ./pwd.patch ./docbook2texi.patch ]; - buildInputs = [curl openssl zlib expat gettext cpio] - ++ (if emacs != null then [emacs] else []) + buildInputs = [curl openssl zlib expat gettext cpio makeWrapper] ++ # documentation tools [ asciidoc texinfo xmlto docbook2x docbook_xsl docbook_xml_dtd_42 libxslt ] - ++ # Tcl/Tk - [ tcl tk makeWrapper ]; + ++ stdenv.lib.optionals guiSupport [tcl tk]; - makeFlags="prefix=\${out} PERL_PATH=${perl}/bin/perl SHELL_PATH=${stdenv.shell}"; + makeFlags = "prefix=\${out} PERL_PATH=${perl}/bin/perl SHELL_PATH=${stdenv.shell}"; postInstall = - (if emacs != null then - ''# Install Emacs mode. - echo "installing Emacs mode..." - make install -C contrib/emacs prefix="$out" - - # XXX: There are other things under `contrib' that people might want to - # install. '' - else - ''echo "NOT installing Emacs mode. Set \`git.useEmacs' to \`true' in your" - echo "\`~/.nixpkgs/config.nix' file to change it." '') - + '' + # Install Emacs mode. + echo "installing Emacs mode..." + ensureDir $out/share/emacs/site-lisp + cp -p contrib/emacs/*.el $out/share/emacs/site-lisp + '' # */ + + (if svnSupport then ''# wrap git-svn @@ -47,9 +43,9 @@ stdenv.mkDerivation rec { for i in ${builtins.toString perlLibs}; do gitperllib=$gitperllib:$i/lib/site_perl done - wrapProgram "$out/bin/git-svn" \ - --set GITPERLLIB "$gitperllib" \ - --prefix PATH : "${subversion}/bin" '' + wrapProgram "$out/bin/git-svn" \ + --set GITPERLLIB "$gitperllib" \ + --prefix PATH : "${subversion}/bin" '' else '' echo "NOT installing \`git-svn' since \`svnSupport' is false." rm $out/bin/git-svn '') @@ -58,16 +54,18 @@ stdenv.mkDerivation rec { make PERL_PATH="${perl}/bin/perl" cmd-list.made install install-info \ -C Documentation '' - + ''# Wrap Tcl/Tk programs + + (if guiSupport then '' + # Wrap Tcl/Tk programs for prog in gitk git-gui git-citool do - wrapProgram "$out/bin/$prog" \ - --set TK_LIBRARY "${tk}/lib/tk8.4" \ - --prefix PATH : "${tk}/bin" - done '' + wrapProgram "$out/bin/$prog" \ + --set TK_LIBRARY "${tk}/lib/tk8.4" \ + --prefix PATH : "${tk}/bin" + done + '' else "") + ''# Wrap `git-clone' - wrapProgram $out/bin/git-clone \ + wrapProgram $out/bin/git-clone \ --prefix PATH : "${cpio}/bin" ''; meta = { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9f60834446c8..618e0faa2de8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -5851,14 +5851,10 @@ let pkgs = rec { inherit fetchurl stdenv curl openssl zlib expat perl gettext asciidoc texinfo xmlto docbook2x docbook_xsl docbook_xml_dtd_42 libxslt - cpio tcl tk makeWrapper; - - # for git-svn support: - svnSupport = getConfig [ "git" "svnSupport" ] false; - inherit subversion ; - perlLibs = [ perlLWP perlURI perlTermReadKey subversion ]; - - emacs = if (getConfig ["git" "useEmacs"] true) then emacs else null; + cpio tcl tk makeWrapper subversion; + svnSupport = getConfig ["git" "svnSupport"] false; # for git-svn support + guiSupport = getConfig ["git" "guiSupport"] false; + perlLibs = [perlLWP perlURI perlTermReadKey subversion]; }; gkrellm = import ../applications/misc/gkrellm {