Commit graph

208 commits

Author SHA1 Message Date
Eelco Dolstra 1f9740e01c * Added some regression tests for lib that I wrote a while ago but
didn't commit.  Also, run the tests when making a Nixpkgs tarball.

svn path=/nixpkgs/trunk/; revision=14802
2009-03-31 13:03:50 +00:00
Eelco Dolstra 2405d87230 * Move some functions for manipulating meta and name attributes out of
all-packages.nix and into lib.

svn path=/nixpkgs/trunk/; revision=14778
2009-03-30 13:22:19 +00:00
Eelco Dolstra 6b24d7bebe * mapAttrsRecursiveCond', which is like mapAttrsRecursive' but takes
a predicate to tell it whether to recursive into a given attribute
  set.

svn path=/nixpkgs/trunk/; revision=14776
2009-03-30 13:19:57 +00:00
Marc Weber e06491168b tidied up pkgs/lib/debug.nix
more consistent naming:
  debugVal -> traceVal
  debugXMLVal -> traceXMLVal

  whatis -> showVal
  traceWhatis -> traceShowVal
  traceMarked -> traceShowValMarked

removed some parenthesis

svn path=/nixpkgs/trunk/; revision=14701
2009-03-25 13:48:55 +00:00
Nicolas Pierron f624a70ee7 Fix mkThenElse and mkAlways evaluation.
svn path=/nixpkgs/trunk/; revision=14528
2009-03-14 07:20:31 +00:00
Eelco Dolstra b53ef57554 * Moved mapAttrs to attrsets.nix.
* Added a function mapAttrsRecursive, which is like mapAttrs, but
  recursively applies itself to attribute sets.
* Commented and cleaned up some functions.

svn path=/nixpkgs/trunk/; revision=14495
2009-03-10 15:18:38 +00:00
Marc Weber 08e1c08bc7 moved debugging functions into lib module "debug"
svn path=/nixpkgs/trunk/; revision=14430
2009-03-06 23:21:35 +00:00
Marc Weber 49b115132d add error context to all top level attr names of all-packages.nix
svn path=/nixpkgs/trunk/; revision=14429
2009-03-06 23:21:31 +00:00
Marc Weber b56ed35851 replacing applyAndFun by lib.defaultOverridableDelayableArgs
applyAndFun has a bug resulting in the same arg beeing added more than
once when using a concatenating merge function for the attr set.

I've tried giving the function a name "overridableDelayableArgs" which
resembles its usage much more.

important refactoring:
  applyAndFun had .fun and .funMerge only when passing the merge
  function lib.mergeOrApply

  composableDerivation {
    initial = {
      ...
    };
  }

to

  overridableDelayableArgs has always .replace and .merge
  composableDerivation {} {
    ...
  }

svn path=/nixpkgs/trunk/; revision=14428
2009-03-06 23:21:28 +00:00
Marc Weber 51289a41b0 adjust packages to overridableDelayableArgs
svn path=/nixpkgs/trunk/; revision=14427
2009-03-06 23:21:24 +00:00
Marc Weber f1183f33e3 added simple lib test case for overridableDelayableArgs
svn path=/nixpkgs/trunk/; revision=14426
2009-03-06 23:21:17 +00:00
Marc Weber 5ddfa7ed64 moved catAttrs, attrVals into attrsets.nix, adding attrValues
svn path=/nixpkgs/trunk/; revision=14425
2009-03-06 23:21:14 +00:00
Marc Weber be3a9f2346 added overridableDelayableArgs replacing applyAndFun
svn path=/nixpkgs/trunk/; revision=14424
2009-03-06 23:21:12 +00:00
Marc Weber e917282535 added eqStrict (deep, strict test for equality)
it can replace eqList and can compare attrs as well

svn path=/nixpkgs/trunk/; revision=14423
2009-03-06 23:21:09 +00:00
Nicolas Pierron e18a10d0ae * Refactor mkIf to extract the concept of properties.
Properties can be delay on any attribute set and have
functions which are used to define the semantic of each
property.

* Introduce the mkOverride property.

svn path=/nixpkgs/trunk/; revision=14285
2009-02-28 18:21:25 +00:00
Michael Raskin 8bf73286a4 add eqStrings back..
svn path=/nixpkgs/trunk/; revision=14228
2009-02-24 16:19:08 +00:00
Eelco Dolstra f9b9844949 * Doh.
svn path=/nixpkgs/trunk/; revision=14014
2009-02-09 17:03:18 +00:00
Eelco Dolstra 599015e8b0 * Split lib/default.nix into several files, as it had become a big
mess.  Also cleaned up some functions:

  - foldl appeared broken (it recursively called fold).
  - Renamed logicalAND/logicalOR to and/or.
  - Removed listOfListsToAttrs, eqStrings: obsolete.
  - Removed isInList, which does the same thing as elem.
  - stringToCharacters: don't return a "" at the end of the list.
  - Renamed concatList to concat, as concatList (singular) is a
    misnomer: it takes two lists.  Likewise, renamed mergeAttr to
    mergeAttrs.

  misc.nix still contains a lot of stuff that should be refactored and
  moved to other files.

svn path=/nixpkgs/trunk/; revision=14013
2009-02-09 16:51:03 +00:00
Eelco Dolstra 6ed4aa7ecb * Qt updated to 4.4.3 in preparation of upgrading KDE to 4.2.
svn path=/nixpkgs/trunk/; revision=13974
2009-02-03 16:32:56 +00:00
Nicolas Pierron 74630be169 Replace addLocation by addErrorContext.
pkgs.lib.addErrorContext add a new line inside the stack trace if this is supported by your nix version.

svn path=/nixpkgs/trunk/; revision=13886
2009-01-27 14:46:41 +00:00
Nicolas Pierron aa27e34a2e Remove python reference from comment.
svn path=/nixpkgs/trunk/; revision=13883
2009-01-27 14:08:49 +00:00
Nicolas Pierron a130392234 Suggest nice/readable example first for composableDerivation.
svn path=/nixpkgs/trunk/; revision=13882
2009-01-27 14:01:00 +00:00
Nicolas Pierron c333a6ab6b Add missing arguments to the "notHandle" functions of mergeOptionSets and filterOptionSets.
svn path=/nixpkgs/trunk/; revision=13872
2009-01-25 22:37:10 +00:00
Nicolas Pierron 74df154f73 Fix previous commit.
svn path=/nixpkgs/trunk/; revision=13870
2009-01-25 22:25:38 +00:00
Nicolas Pierron c2be87e132 Remove support for merge function with name argument.
svn path=/nixpkgs/trunk/; revision=13869
2009-01-25 21:23:47 +00:00
Nicolas Pierron c1b9946c28 Name argument of option's merge functions are now obsolete.
svn path=/nixpkgs/trunk/; revision=13842
2009-01-25 00:31:43 +00:00
Nicolas Pierron daa6f9c7ef Add a common merge function. (mergeOneOption)
This merge function allow only one definition for an option.

svn path=/nixpkgs/trunk/; revision=13841
2009-01-25 00:31:38 +00:00
Nicolas Pierron 9581664fb9 Add the "notdef" value when no else-part is defined.
Remove the "notdef" values from the user-defined values.

svn path=/nixpkgs/trunk/; revision=13840
2009-01-25 00:31:33 +00:00
Nicolas Pierron 57f66db54c Remove extra arguments from uniqFlatten.
Clean-up fixOptionSetsFun.

svn path=/nixpkgs/trunk/; revision=13839
2009-01-25 00:31:29 +00:00
Nicolas Pierron 13d5c8923d factor mergeOptionSets and filterOptionSets into the function handleOptionSets.
svn path=/nixpkgs/trunk/; revision=13838
2009-01-25 00:31:23 +00:00
Michael Raskin c87887ddd0 Oops. A typo fix
svn path=/nixpkgs/trunk/; revision=13727
2009-01-08 23:04:18 +00:00
Michael Raskin 46fec9e4c9 Add a (failure-prone) last-chance string merger
svn path=/nixpkgs/trunk/; revision=13726
2009-01-08 23:02:44 +00:00
Marc Weber 5638574907 fixes for previous commit
svn path=/nixpkgs/trunk/; revision=13662
2008-12-20 02:15:26 +00:00
Marc Weber e996113be7 removed mkDerivationByConfiguration, using composableDerivation instead
qgis, vim_configurable both work now

svn path=/nixpkgs/trunk/; revision=13661
2008-12-20 01:20:35 +00:00
Nicolas Pierron 071c62a942 Rewrite uniqFlattenAttr to handle any type of elements with associated keys.
Keys are introduced because manipulated sets cannot be compared safely.

svn path=/nixpkgs/trunk/; revision=13574
2008-12-03 18:56:00 +00:00
Marc Weber a7e33ec60c updates: istanbul starts without errors. But no window appears.
svn path=/nixpkgs/trunk/; revision=13554
2008-12-02 12:28:45 +00:00
Marc Weber 9e7846d214 added Haskell's foldl
svn path=/nixpkgs/trunk/; revision=13553
2008-12-02 12:28:21 +00:00
Marc Weber d8e1f6c976 adding lib function composableDerivation
providing easy setups of flags and configurations for derivations.
configuration is passed via passthru automatically,
additional names can be merged with final attrs in an automatic sensible way
even supporting fix.
fun and funMerge idea by Michael Raskin

svn path=/nixpkgs/trunk/; revision=13546
2008-12-02 12:26:53 +00:00
Marc Weber 429df4f864 added prepareDerivationArgs
svn path=/nixpkgs/trunk/; revision=13545
2008-12-02 12:26:43 +00:00
Marc Weber 570a103136 adding mergeAttrsByFunc function - its easiy to customize how a name should be merged - the merge function is passed by the attr set itself (and can be overridden/ extended this way) This code can probably be shortened using zip and the like as proposed by Nicolas Pierron (mailinglist)
svn path=/nixpkgs/trunk/; revision=13544
2008-12-02 12:26:36 +00:00
Marc Weber 55976c6f8d depreceating functions which have been sud by me only replacements are in the following commits.. I still have to remove and adopt the code using them
svn path=/nixpkgs/trunk/; revision=13543
2008-12-02 12:26:28 +00:00
Marc Weber bd0b75fe28 added mergeAttr and concatList functions giving // and ++ a name
svn path=/nixpkgs/trunk/; revision=13542
2008-12-02 12:26:20 +00:00
Marc Weber 1f69d4d1eb enhancing whatis trace function
svn path=/nixpkgs/trunk/; revision=13541
2008-12-02 12:26:12 +00:00
Marc Weber 01fc783e7f added debug functions tracing function arguments and result
svn path=/nixpkgs/trunk/; revision=13540
2008-12-02 12:26:05 +00:00
Nicolas Pierron 53e6c77aca Fix previous commit.
svn path=/nixpkgs/trunk/; revision=13373
2008-11-23 01:23:32 +00:00
Nicolas Pierron 249a3a314f Add: Handle a way to factor conditions.
mkIf config.foo.enable {
  require = [ .. ];

  environment = {
    // infer the else part.
    extraPackages = [pkgs.foo];
    etc = mkThenElse {
      thenPart = { .. };
      elsePart = { .. };
    };
  };
}

Fix: UniqFlattenAttr compare configuration without the "require" attribute.

svn path=/nixpkgs/trunk/; revision=13372
2008-11-23 00:19:18 +00:00
Nicolas Pierron 0f2bd6c305 mergeDefaultOption: handle boolean values.
svn path=/nixpkgs/trunk/; revision=13371
2008-11-23 00:19:12 +00:00
Nicolas Pierron b62298f7c7 Add a common pattern used in jobs definition.
svn path=/nixpkgs/trunk/; revision=13370
2008-11-23 00:19:06 +00:00
Nicolas Pierron 34f916700d Add mergeStringOption and factor mergeSomethingOption by introducing mergeTypedOption.
svn path=/nixpkgs/trunk/; revision=13310
2008-11-16 19:23:00 +00:00
Nicolas Pierron b196bab378 Remove obsolete functions.
svn path=/nixpkgs/trunk/; revision=13309
2008-11-16 19:22:55 +00:00
Nicolas Pierron 08b583682a Handle apply attribute for each option declared with MkOption.
This is similar to the new-proposal in upstart-jobs except that the default value is also processed with this function. (the existing merge function acts only on extra values).

svn path=/nixpkgs/trunk/; revision=13308
2008-11-16 19:22:47 +00:00
Marc Weber 2bf82b4470 added examples for composedArgsAndFun, introducing setAttrMerge
svn path=/nixpkgs/trunk/; revision=13193
2008-11-04 21:40:51 +00:00
Michael Raskin c5363217ad meta.function -> passthru.function, not killing other contents of passthru
svn path=/nixpkgs/trunk/; revision=13190
2008-11-04 21:24:10 +00:00
Marc Weber 1bdbe847f7 removed finalReference not beeing used anywhere
svn path=/nixpkgs/trunk/; revision=13137
2008-10-28 14:20:52 +00:00
Marc Weber a9b19788fb simplified isOption reusing typeOf
svn path=/nixpkgs/trunk/; revision=13119
2008-10-26 17:44:23 +00:00
Marc Weber 892db3bb8c update bleeding edge repo management
it now figures out the dist name from the url and the revision is added to the url
This way a new version doesn't override the old one and you can keep multiple dist tar.gz files

svn path=/nixpkgs/trunk/; revision=13065
2008-10-14 14:01:00 +00:00
Michael Raskin 29149e5385 The even more incredibly verbose debugging machine...
svn path=/nixpkgs/trunk/; revision=12758
2008-08-27 21:23:49 +00:00
Michael Raskin c406fcf194 Some diagnostics for NixOS manual helper
svn path=/nixpkgs/trunk/; revision=12756
2008-08-27 21:19:03 +00:00
Nicolas Pierron 042bc846df Handle new configuration file argument notation:
{pkgs, config, ...}:

svn path=/nixpkgs/trunk/; revision=12753
2008-08-27 17:54:24 +00:00
Nicolas Pierron ae163f596e Replace "finalReference" prefix by "fix".
svn path=/nixpkgs/trunk/; revision=12740
2008-08-27 13:58:36 +00:00
Michael Raskin d7acaeb096 Refactorings and removing hard-coded assumptions
svn path=/nixpkgs/trunk/; revision=12668
2008-08-20 11:20:32 +00:00
Michael Raskin a921f752b8 Saner tracing of booleans
svn path=/nixpkgs/trunk/; revision=12667
2008-08-20 08:41:53 +00:00
Michael Raskin ff0d85fdc8 Added traceMarked; it is traceWhatis with the extra (first) argument to distinguish the output of that exat statement.
svn path=/nixpkgs/trunk/; revision=12666
2008-08-20 08:21:54 +00:00
Michael Raskin a8da119da4 Silly mistake fixed
svn path=/nixpkgs/trunk/; revision=12665
2008-08-20 07:17:55 +00:00
Michael Raskin 97e15cc2b8 Noticed an associativity direction problem
svn path=/nixpkgs/trunk/; revision=12664
2008-08-20 06:45:14 +00:00
Michael Raskin 69e4f17372 Added null recognition to whatis
svn path=/nixpkgs/trunk/; revision=12663
2008-08-20 04:34:28 +00:00
Marc Weber 6394358c9a fix of cosmetic commit (sry)
svn path=/nixpkgs/trunk/; revision=12646
2008-08-17 07:40:35 +00:00
Marc Weber bab435592b cosmetic var name change
svn path=/nixpkgs/trunk/; revision=12644
2008-08-17 00:06:01 +00:00
Michael Raskin 99c46f200c Forgot to make composedArgsAndFun support function overrides in addition to attrSet-merging ones.
svn path=/nixpkgs/trunk/; revision=12627
2008-08-14 22:12:50 +00:00
Michael Raskin f1f9e38e94 Big breaking change. I have radically reduced number of nulls used in all-packages.nix and generally switched to composedArgsAndFun which simply adds .meta.function to everything that has come through it.. I have not tested the build, because OO.o has to be updated...
svn path=/nixpkgs/trunk/; revision=12625
2008-08-14 22:04:30 +00:00
Michael Raskin eb50dd2c0d Added StumpWM
svn path=/nixpkgs/trunk/; revision=12566
2008-08-09 20:21:33 +00:00
Nicolas Pierron 692c5a62a4 Use "abort" instead of "throw" when option values cannot be merged.
Fix mergeListOption.
Add error support in mergeEnableOption.

svn path=/nixpkgs/trunk/; revision=12522
2008-08-06 19:24:36 +00:00
Nicolas Pierron 0ce4cafd88 * Do not always use the current result as argument.
* "filterOptionSets" returns the only option per attribute instead of a list of options.

svn path=/nixpkgs/trunk/; revision=12520
2008-08-06 18:34:11 +00:00
Nicolas Pierron 0e25bb67cf Add a new way to handle option sets.
svn path=/nixpkgs/trunk/; revision=12505
2008-08-05 17:16:35 +00:00
Eelco Dolstra fc5eebdf8b * Merged the stdenv branch
(https://svn.nixos.org/repos/nix/nixpkgs/branches/stdenv-updates
  -r10966:12061).

svn path=/nixpkgs/trunk/; revision=12073
2008-06-13 11:46:39 +00:00
Michael Raskin e8e0d1665c traceWhatIs works for empty lists
svn path=/nixpkgs/trunk/; revision=12046
2008-06-12 06:58:07 +00:00
Eelco Dolstra dcf01e5925 * A convenience function `makeLibraryPath' that adds "/lib" to each
element of a list and concatenates them separated by colons.

svn path=/nixpkgs/branches/stdenv-updates/; revision=11970
2008-06-04 09:56:11 +00:00
Marc Weber e17c96c881 Support for profiling (all libraries) enabled by custom config
moved flapjax to ghcExecutables
added haskelldb mysql
added ghc darcs build (left in comments)

svn path=/nixpkgs/trunk/; revision=11742
2008-04-28 22:27:03 +00:00
Michael Raskin 55f4987f42 Added optionalString (similar to optional)
svn path=/nixpkgs/trunk/; revision=11733
2008-04-27 23:17:24 +00:00
Marc Weber 772fd74b99 Updated my ghc stuff.
New is the file containing executables (such as alex/ happy)
some new libraries
The wrapper no longer installs tags by default. You have to add it to your config
So I'm ready to start merging

svn path=/nixpkgs/trunk/; revision=11554
2008-04-11 00:40:10 +00:00
Michael Raskin 003a6d10b5 Added CDDA support to MPlayer
svn path=/nixpkgs/trunk/; revision=10978
2008-03-06 09:34:36 +00:00
Marc Weber a277b420ee annotatedDerivation removed
svn path=/nixpkgs/trunk/; revision=10975
2008-03-06 02:48:09 +00:00
Michael Raskin d02d11636b Fixed a typo in lib/default.nix
svn path=/nixpkgs/trunk/; revision=10904
2008-03-02 14:26:40 +00:00
Eelco Dolstra e12b421add * Merged most of the stdenv-updates branch. Some stuff didn't
merge cleanly right away (kde-4, kernel stuff) so it should be
  merged later.  But the stdenv stuff is all there.

svn path=/nixpkgs/branches/stdenv-updates-merge/; revision=10793
2008-02-20 23:02:41 +00:00
Michael Raskin ca34aa0514 Forward port of lib
svn path=/nixpkgs/branches/stdenv-updates/; revision=10700
2008-02-15 08:41:31 +00:00
Eelco Dolstra 329cf0523e * Doh.
svn path=/nixpkgs/trunk/; revision=10685
2008-02-14 13:34:55 +00:00
Eelco Dolstra 3be8e7c28e * Function concatMapStrings.
svn path=/nixpkgs/trunk/; revision=10681
2008-02-14 13:16:22 +00:00
Marc Weber 9c211b094e added whatis, traceWhatis, subsetmap, escapeShellArg, stringToCharacters, defineShList
stringToCharacters is only used by escapeShellArg and should be implemented as primop

svn path=/nixpkgs/trunk/; revision=10655
2008-02-13 10:09:29 +00:00
Marc Weber 260c0c9c96 new version - annotated derivation proposal - used to install addtiontal /src
and /tag/ source code which to build up develop environments more easily ( TODO
make this optional for ghcWrapper )

svn path=/nixpkgs/trunk/; revision=10648
2008-02-12 16:24:02 +00:00
Marc Weber 2fbd55bb6b lib/default-unstable.nix removed
svn path=/nixpkgs/trunk/; revision=10647
2008-02-12 16:15:27 +00:00
Eelco Dolstra 28d2f608c6 * Doh! cleanSource was broken; it didn't actually get rid of
.svn and CVS directories.

svn path=/nixpkgs/trunk/; revision=10635
2008-02-12 10:08:57 +00:00
Yury G. Kudryashov e7bc12a932 * Function concatMap as in Haskell.
svn path=/nixpkgs/branches/stdenv-updates/; revision=10588
2008-02-10 17:38:56 +00:00
Michael Raskin 4df190c703 Various fixes and updates to build that all.
svn path=/nixpkgs/branches/stdenv-updates/; revision=10568
2008-02-10 16:44:43 +00:00
Eelco Dolstra 48f544d2e3 * Function optionals.
svn path=/nixpkgs/trunk/; revision=10553
2008-02-08 11:48:06 +00:00
Eelco Dolstra 937f8663ac * Function concatMap as in Haskell.
svn path=/nixpkgs/trunk/; revision=10501
2008-02-05 11:41:09 +00:00
Yury G. Kudryashov 0aef28a212 Rewritten gettext-version stuff.
I've added listOfListsToAttrs to lib because I don't like to type "name =" and
"value =".


svn path=/nixpkgs/trunk/; revision=10315
2008-01-28 19:30:13 +00:00
Yury G. Kudryashov da57804fff Merged with trunk again
svn path=/nixpkgs/branches/stdenv-updates/; revision=10267
2008-01-23 18:11:03 +00:00
Marc Weber b4b61eccce svn path=/nixpkgs/trunk/; revision=10233 2008-01-20 22:47:08 +00:00
Marc Weber f22d19c128 slightly modified stringsWithDeps script Builder proposal adding the feature
overriding steps and has better documentation (IMHO) reusing as much as
possible of the code already written by raskin

svn path=/nixpkgs/trunk/; revision=10225
2008-01-19 01:23:48 +00:00
Michael Raskin bc46eaf404 Some review of builder-defs and dependent files. No rebuild needed. Now it should be possible to override elements in builderDefs
svn path=/nixpkgs/trunk/; revision=10214
2008-01-18 12:36:56 +00:00