;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2020 pkill-9 ;;; Copyright © 2020, 2021 ison ;;; Copyright © 2021 pineapples ;;; Copyright © 2021 Jean-Baptiste Volatier ;;; Copyright © 2021 Kozo ;;; Copyright © 2021 John Kehayias ;;; ;;; This file is not 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 . (use-modules (guix build-system trivial) (guix packages) (gnu packages fontutils) (gnu packages apr)) (define* (fhs-union inputs #:key (name "fhs-union") (version "0.0") (system "x86_64-linux")) "Create a package housing the union of inputs." (package (name name) (version version) (source #f) (inputs inputs) (build-system trivial-build-system) (arguments `(#:system ,system #:modules ((guix build union)) #:builder (begin (use-modules (ice-9 match) (guix build union)) (match %build-inputs (((_ . directories) ...) (union-build (assoc-ref %outputs "out") directories) (format #t "\n directories: ~a\n" directories)))))) (home-page #f) (synopsis "Libraries used for FHS") (description "Libraries needed to build a guix container FHS.") (license #f))) (define fontconfig-fixed (package (inherit fontconfig) (propagated-inputs (modify-inputs (package-propagated-inputs fontconfig) (replace "expat" (@@ (gnu packages xml) expat/fixed)))))) (define (container-package pkg-list) (let* ((union64 (fhs-union pkg-list #:name "fhs-union-64")) (union32 (fhs-union pkg-list #:name "fhs-union-32" #:system "i686-linux"))) (package (name "test-pkg") (version "0.0") (source #f) (inputs `(("fhs-union-64" ,union64) ("fhs-union-32" ,union32))) (build-system trivial-build-system) (arguments `(#:modules ((guix build utils)) #:builder (begin (use-modules (guix build utils)) (let* ((out (assoc-ref %outputs "out")) (lib64-target (assoc-ref %build-inputs "fhs-union-64")) (lib64-dest (string-append out "/lib64")) (lib32-target (assoc-ref %build-inputs "fhs-union-32")) (lib32-dest (string-append out "/lib32"))) (format #t "\nunion64: ~a\nunion32: ~a\n" lib64-target lib32-target) (mkdir-p (string-append out "/bin")) ; dummy dir needed to build (symlink lib64-target lib64-dest) (symlink lib32-target lib32-dest))))) (home-page #f) (synopsis #f) (description #f) (license #f)))) ;(fhs-union (list fontconfig-fixed)) ;(fhs-union (list fontconfig) #:system "i686-linux") ;(fhs-union (list fontconfig)) ;(fhs-union (list apr-util)) (container-package `(("apr-util" ,apr-util)))