// GNU Guix --- Functional package management for GNU // Copyright © 2016 Ricardo Wurmus // // This file is part of GNU Guix. // // GNU Guix is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 3 of the License, or (at // your option) any later version. // // GNU Guix is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with GNU Guix. If not, see . var outerRadius = Math.max(nodeArray.length * 15, 500) / 2, innerRadius = outerRadius - Math.min(nodeArray.length * 5, 200), width = outerRadius * 2, height = outerRadius * 2, colors = d3.scale.category20c(), matrix = []; function neighborsOf (node) { return links.filter(function (e) { return e.source === node; }).map(function (e) { return e.target; }); } function zoomed () { zoomer.attr("transform", "translate(" + d3.event.translate + ")" + "scale(" + d3.event.scale + ")"); } function fade (opacity, root) { return function (g, i) { root.selectAll("g path.chord") .filter(function (d) { return d.source.index != i && d.target.index != i; }) .transition() .style("opacity", opacity); }; } // Now that we have all nodes in an object we can replace each reference // with the actual node object. links.forEach(function (link) { link.target = nodes[link.target]; link.source = nodes[link.source]; }); // Construct a square matrix for package dependencies nodeArray.forEach(function (d, index, arr) { var source = ind;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2012, 2013, 2014, 2015, 2017, 2018, 2019 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2018 Jan (janneke) Nieuwenhuizen <janneke@gnu.org> ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (define-module (test-union) #:use-module (guix tests) #:use-module (guix store) #:use-module (guix utils) #:use-module (guix derivations) #:use-module (guix packages) #:use-module (guix build union) #:use-module ((guix build utils) #:select (with-directory-excursion directory-exists?)) #:use-module (gnu packages bootstrap) #:use-module (srfi srfi-1) #:use-module (srfi srfi-64) #:use-module (rnrs io ports) #:use-module (ice-9 match)) ;; Exercise the (guix build union) module. (define %store (open-connection-for-tests)) (test-begin "union") (test-assert "union-build with symlink to directory" ;; http://bugs.gnu.org/17083 ;; Here both ONE and TWO provide an element called 'foo', but in ONE it's a ;; directory whereas in TWO it's a symlink to a directory. (let* ((one (build-expression->derivation %store "one" '(begin (use-modules (guix build utils) (srfi srfi-26)) (let ((foo (string-append %output "/foo"))) (mkdir-p foo) (call-with-output-file (string-append foo "/one") (cut display "one" &l