From 82b608d93f1c7138230846d7db7a26e26b14f420 Mon Sep 17 00:00:00 2001 From: "Yury G. Kudryashov" Date: Mon, 1 Oct 2007 15:07:55 +0000 Subject: [PATCH] Added optional unicode support to pcre. Building old (non-unicode) package by default. svn path=/nixpkgs/trunk/; revision=9386 --- pkgs/development/libraries/pcre/default.nix | 9 +++++++-- pkgs/top-level/all-packages.nix | 6 ++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/pcre/default.nix b/pkgs/development/libraries/pcre/default.nix index cef6ae627ea..1b4d7fc9093 100644 --- a/pkgs/development/libraries/pcre/default.nix +++ b/pkgs/development/libraries/pcre/default.nix @@ -1,9 +1,14 @@ -{stdenv, fetchurl}: +args: with args; -stdenv.mkDerivation { +stdenv.mkDerivation ({ name = "pcre-7.1"; src = fetchurl { url = ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-7.1.tar.bz2; sha256 = "0rpkcw07jas3fw6ava3ni5zcrmbncwa8xlsa0lzq6z2iph5510li"; }; } +// (if unicodeSupport then +{ + configureFlags = "--enable-unicode-properties --enable-shared --disable-static"; +} +else {})) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d91d79b03fd..1f0539690d9 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -146,6 +146,11 @@ rec { getVersion = name: alts: builtins.getAttr (getConfig [ "environment" "versions" name ] "default") alts; + # Whether user enabled given feature for the given package? + getFlag = flag: package: default: + getConfig [ "environment" "flags" package flag ] + (getConfig [ "environment" "flags" "default" flag ] default); + # The contents of the configuration file found at $NIXPKGS_CONFIG or # $HOME/.nixpkgs/config.nix. config = @@ -1930,6 +1935,7 @@ rec { pcre = import ../development/libraries/pcre { inherit fetchurl stdenv; + unicodeSupport = getFlag "unicode" "pcre" false; }; popt = import ../development/libraries/popt {