Compare commits
12 commits
9315751220
...
0a63667459
Author | SHA1 | Date | |
---|---|---|---|
Jake Hamilton | 0a63667459 | ||
Jake Hamilton | d2b053d63a | ||
Jake Hamilton | 7774f65079 | ||
Jake Hamilton | fd9b85f29e | ||
Jake Hamilton | b315ae81f6 | ||
Jake Hamilton | 193a52cbc8 | ||
Jake Hamilton | 27a0e3d59f | ||
Jake Hamilton | 2b5f90d4e5 | ||
Jake Hamilton | 008632bc8b | ||
Jake Hamilton | 0f602b1cb7 | ||
Alex Kladov | 8233d4aedf | ||
Steve D | a2f0a06426 |
|
@ -68,6 +68,7 @@ in
|
||||||
export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib"
|
export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib"
|
||||||
export ac_cv_func_getpgrp_void=yes
|
export ac_cv_func_getpgrp_void=yes
|
||||||
export ac_cv_func_tzset=yes
|
export ac_cv_func_tzset=yes
|
||||||
|
chmod 0755 missing
|
||||||
bash ./configure \
|
bash ./configure \
|
||||||
--build=${platform.build} \
|
--build=${platform.build} \
|
||||||
--host=${platform.host} \
|
--host=${platform.host} \
|
||||||
|
|
|
@ -58,6 +58,7 @@ in
|
||||||
|
|
||||||
# Configure
|
# Configure
|
||||||
export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib"
|
export CC="tcc -B ${stage1.tinycc.mes.libs.package}/lib"
|
||||||
|
chmod 0755 missing
|
||||||
bash ./configure \
|
bash ./configure \
|
||||||
--build=${platform.build} \
|
--build=${platform.build} \
|
||||||
--host=${platform.host} \
|
--host=${platform.host} \
|
||||||
|
|
|
@ -59,6 +59,7 @@ in
|
||||||
export ac_cv_sizeof_unsigned_long=4
|
export ac_cv_sizeof_unsigned_long=4
|
||||||
export ac_cv_sizeof_long_long=8
|
export ac_cv_sizeof_long_long=8
|
||||||
export ac_cv_header_netdb_h=no
|
export ac_cv_header_netdb_h=no
|
||||||
|
chmod 0755 missing
|
||||||
bash ./configure \
|
bash ./configure \
|
||||||
--prefix=$out \
|
--prefix=$out \
|
||||||
--build=${platform.build} \
|
--build=${platform.build} \
|
||||||
|
|
|
@ -21,7 +21,7 @@ lib: {
|
||||||
## Apply a topological sort to a DAG.
|
## Apply a topological sort to a DAG.
|
||||||
##
|
##
|
||||||
## @type Dag a -> { result :: List a } | { cycle :: List a, loops :: List a }
|
## @type Dag a -> { result :: List a } | { cycle :: List a, loops :: List a }
|
||||||
topographic =
|
topological =
|
||||||
graph:
|
graph:
|
||||||
let
|
let
|
||||||
getEntriesBefore =
|
getEntriesBefore =
|
||||||
|
@ -43,7 +43,7 @@ lib: {
|
||||||
|
|
||||||
isBefore = a: b: builtins.elem a.name b.after;
|
isBefore = a: b: builtins.elem a.name b.after;
|
||||||
|
|
||||||
sorted = lib.lists.sort.topographic isBefore entries;
|
sorted = lib.lists.sort.topological isBefore entries;
|
||||||
in
|
in
|
||||||
if sorted ? result then
|
if sorted ? result then
|
||||||
{
|
{
|
||||||
|
|
|
@ -119,11 +119,11 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
"sort" = {
|
"sort" = {
|
||||||
"topographic" = {
|
"topological" = {
|
||||||
"handles an empty graph" =
|
"handles an empty graph" =
|
||||||
let
|
let
|
||||||
expected = [ ];
|
expected = [ ];
|
||||||
actual = lib.dag.sort.topographic { };
|
actual = lib.dag.sort.topological { };
|
||||||
in
|
in
|
||||||
actual.result == expected;
|
actual.result == expected;
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ in
|
||||||
value = "d";
|
value = "d";
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
actual = lib.dag.sort.topographic {
|
actual = lib.dag.sort.topological {
|
||||||
a = lib.dag.entry.anywhere "a";
|
a = lib.dag.entry.anywhere "a";
|
||||||
b = lib.dag.entry.between [ "c" ] [ "a" ] "b";
|
b = lib.dag.entry.between [ "c" ] [ "a" ] "b";
|
||||||
c = lib.dag.entry.before [ "c" ] "c";
|
c = lib.dag.entry.before [ "c" ] "c";
|
||||||
|
|
|
@ -31,15 +31,15 @@ lib: {
|
||||||
in
|
in
|
||||||
builtins.map (x: builtins.elemAt x 1) (builtins.sort isLess prepared);
|
builtins.map (x: builtins.elemAt x 1) (builtins.sort isLess prepared);
|
||||||
|
|
||||||
## Perform a topographic sort on a list of items. The predicate function determines whether
|
## Perform a topological sort on a list of items. The predicate function determines whether
|
||||||
## its first argument comes before the second argument.
|
## its first argument comes before the second argument.
|
||||||
##
|
##
|
||||||
## @type (a -> a -> Bool) -> List a -> List a
|
## @type (a -> a -> Bool) -> List a -> List a
|
||||||
topographic =
|
topological =
|
||||||
predicate: list:
|
predicate: list:
|
||||||
let
|
let
|
||||||
searched = lib.lists.search.depthFirst true predicate list;
|
searched = lib.lists.search.depthFirst true predicate list;
|
||||||
results = lib.lists.sort.topographic predicate (searched.visited ++ searched.rest);
|
results = lib.lists.sort.topological predicate (searched.visited ++ searched.rest);
|
||||||
in
|
in
|
||||||
if builtins.length list < 2 then
|
if builtins.length list < 2 then
|
||||||
{ result = list; }
|
{ result = list; }
|
||||||
|
|
Loading…
Reference in a new issue