[Nix-dev] Auto package update script v4

Marc Weber marco-oweber at gmx.de
Sat Feb 19 02:16:45 CET 2011


How do you use uscan?

I found its part of devscripts (debian) which depends on perl-po4a which
is non trivial to package because you have to tweak the installation
path.

I got that far (SGML seems to bet the only thing making the test cases fail),
and the SGML library itself has to be packaged manually a well:

perl-packages.nix:

  po4a = buildPerlPackage {
    name = "po4a-0.41";
    # http://po4a.alioth.debian.org/download.php
    # * Optional prerequisite Text::WrapI18N is not installed
    # * Optional prerequisite SGMLS is not installed
    # * Optional prerequisite Locale::gettext is not installed
    # * Optional prerequisite Term::ReadKey is not installed

    src = fetchurl {
      url = https://alioth.debian.org/frs/download.php/3472/po4a-0.41.tar.gz;
      sha256 = "b1874531b59631079a48c91bfb8d98392c016a9ef761dfedb03b57325332e86c";
    };

    # TODO get rid of latex. without it the test fails.
    buildInputs = [perl pkgs.gettext pkgs.libxml2 pkgs.libxslt pkgs.docbook_xml_dtd_412 /* pkgs.texLive */ ];
    configurePhase =
    # hacky ?
    "
      find -type f | xargs sed -i -e 's at http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl at file://${pkgs.docbook_xsl}/xml/xsl/docbook/manpages/docbook.xsl at g' \\
                                  -e 's at http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd@${pkgs.docbook_xml_dtd_412}/xml/dtd/docbook/docbookx.dtd@'
    " + "
      perl Build.PL --prefix=$out
    ";
    buildPhase = "perl ./Build";
    doCheck = true;
    checkPhase = "
      # perl ./Build test
    ";
    installPhase = "perl ./Build install";
  };

Is this work necessary or can you just take the uscan.pl file and run it?

Marc Weber



devscripts could look like this:

{stdenv, fetchurl, perl, perlPackages, gettext}:

stdenv.mkDerivation {
  name = "devscripts-2.10.35-lenny";

  src = fetchurl {
    url = http://security.debian.org/pool/updates/main/d/devscripts/devscripts_2.10.35lenny7.tar.gz;
    sha256 = "1w3x37hciir3270lq8wdk1hwyz2fyvc4pnm5z8m2xnckn057mzyn";
  };

  buildInputs = [perl perlPackages.po4a gettext];

  meta = {
    description = "several scripts which may be of use to Debian developers - also contains uscan";
    homepage = http://www.debian.org/security/2009/dsa-1878.en.html; # ?
    license = "GPLv2";
    maintainers = [stdenv.lib.maintainers.marcweber];
    platforms = stdenv.lib.platforms.linux;
  };
}



More information about the nix-dev mailing list