help-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to build LFS-8.4 with only guix packages.


From: Yoshinori Arai
Subject: How to build LFS-8.4 with only guix packages.
Date: Mon, 11 Mar 2019 18:34:45 +0900 (JST)

I have tried to build
LFS-8.4(http://www.linuxfromscratch.org/lfs/view/stable/index.html)
with only guix packages.

I know it's idle attempt. Basically linux system build is unpack
tarball or install to the target directory. It's process is
incrementally.

My first step is to define package and build it. Almost package
already is defined. Some package is newer version and 2 package are
missing in guix, sysvinit and sysklogd.

After all 69 packages are confirmed to build successfully. I tried
guix pack -S ... for some package and unpack to the target directory.
I soon know this trial is fail. Because guix pack -S ... make
simlinked directory and it was overwrite.

Next trial is guix pack -S /bin=bin /sbin=sbin /share=share ... for
all package at once. It is just stupid. It's took so long time but
finished successfully.

Size of all packages packed is 600M. I think it's about twice compare
with LFS system size build by following instruction of LFS.

I think guix pack include inputs or propagated inputs or static
libraries and libtool file(.la).

My lesson is don't use guix pack for your own linux system building.
To make normal tarball is tar cvzf your-package.tar.gz
/gnu/store/...your-package
after guix build your-package.

Attached file is make separated files to one. Please don't use it.

Thank you.
;; LFS-8.4
(define-module (my-LFS-8)
  #:use-module (gnu packages)
  #:use-module (gnu packages acl)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages algebra)
  #:use-module (gnu packages attr)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages bootloaders)
  #:use-module (gnu packages build-tools)
  #:use-module (gnu packages bison)
  #:use-module (gnu packages check)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages disk)
  #:use-module (gnu packages ed)
  #:use-module (gnu packages elf)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages file)
  #:use-module (gnu packages flex)
  #:use-module (gnu packages gawk)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages gperf)
  #:use-module (gnu packages dbm)
  #:use-module (gnu packages gettext)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages ghostscript)
  #:use-module (gnu packages groff)
  #:use-module (gnu packages guile)
  #:use-module (gnu packages less)
  #:use-module (gnu packages libffi)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages m4)
  #:use-module (gnu packages man)
  #:use-module (gnu packages multiprecision)
  #:use-module (gnu packages ncurses)
  #:use-module (gnu packages netpbm)
  #:use-module (gnu packages networking)
  #:use-module (gnu packages ninja)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages python)
  #:use-module (gnu packages readline)
  #:use-module (gnu packages sqlite)
  #:use-module (gnu packages tcl)
  #:use-module (gnu packages texinfo)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages xml)
  #:use-module (guix download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system perl)
  #:use-module (guix utils))

;; Linux-4.20.12 API Headers
(define (linux-libre-urls version)
  "Return a list of URLs for Linux-Libre VERSION."
  (list (string-append
         "https://linux-libre.fsfla.org/pub/linux-libre/releases/";
         version "-gnu/linux-libre-" version "-gnu.tar.xz")

        ;; XXX: Work around <http://bugs.gnu.org/14851>.
        (string-append
         "ftp://alpha.gnu.org/gnu/guix/mirror/linux-libre-";
         version "-gnu.tar.xz")

        ;; Maybe this URL will become valid eventually.
        (string-append
         "mirror://gnu/linux-libre/" version "-gnu/linux-libre-"
         version "-gnu.tar.xz")))

(define-public my-linux-libre-headers
  (package (inherit linux-libre-headers)
    (name "my-linux-libre-headers")
    (version "4.20.12")
    (source (origin
             (method url-fetch)
             (uri (linux-libre-urls version))
             (sha256
              (base32
               "16w52g5s7qhvmmz3srai1myl8949nxv6cqybiw3wx3mwcvp95mlh"))))
    (native-inputs `(("perl" ,perl)
                     ("bison" ,bison)
                     ("flex" ,flex)))))
my-linux-libre-headers

;; Man-pages-4.16
(define-public my-man-pages
  (package (inherit man-pages)
    (name "my-man-pages")))
my-man-pages

;; Glibc-2.29
(define-public my-glibc
  (package (inherit glibc)
           (name "my-glibc")
           (version "2.29")
           (source (origin
                     (method url-fetch)
                     (uri (string-append "mirror://gnu/glibc/glibc-" version 
".tar.xz"))
                     (sha256
                      (base32
                       
"0jzh58728flfh939a8k9pi1zdyalfzlxmwra7k0rzji5gvavivpk"))))
           (native-inputs `(("python" ,python)
                            ("bison" ,bison)))))
my-glibc

;; Zlib-1.2.11
(define-public my-zlib
  (package (inherit zlib)
           (name "my-zlib")))
my-zlib


;; File-5.36
(define-public my-file
  (package (inherit file)
    (name "my-file")
    (version "5.36")
    (source (origin
              (method url-fetch)
              (uri (string-append "ftp://ftp.astron.com/pub/file/file-";
                                  version ".tar.gz"))
              (sha256
               (base32
                "0ya330cdkvfi2d28h8gvhghj4gnhysmifmryysl0a97xq2884q7v"))))))
my-file

;; Readline-8.0
(define-public my-readline
  (package (inherit readline)
    (name "my-readline")
    (version "8.0")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnu/readline/readline-"
                                  version ".tar.gz"))
              (sha256
               (base32
                "0qg4924hf4hg0r0wbx2chswsr08734536fh5iagkd3a7f4czafg3"))))))
my-readline

;; M4-1.4.18
(define-public my-m4
  (package (inherit m4)
   (name "my-m4")))
my-m4

;; Bc-1.07.1
(define-public my-bc
  (package (inherit bc)
    (name "my-bc")))
my-bc

;; Binutils-2.32
(define-public my-binutils
  (package (inherit binutils)
   (name "my-binutils")
   (version "2.32")
   (source (origin
             (method url-fetch)
             (uri (string-append "mirror://gnu/binutils/binutils-"
                                 version ".tar.xz"))
             (sha256
              (base32
               "017ffgj3d2rfr13692bzamsrz2qanywibfkj35bfv4kav1fwbdha"))))
   (build-system gnu-build-system)

   ;; Add dependency on zlib + those for Gold.
   ;; (native-inputs `(("zlib" ,zlib)
   ;;                  ("bc" ,bc)))
   (inputs `(("gcc:lib" ,gcc "lib")))
   (native-inputs `(("bc" ,bc)))
   (arguments
    `(#:configure-flags '( ;; Turn on --enable-new-dtags by default to make the
                          ;; linker set RUNPATH instead of RPATH on binaries.
                          ;; This is important because RUNPATH can be overriden
                          ;; using LD_LIBRARY_PATH at runtime.
                          "--enable-new-dtags"

                          ;; Don't search under /usr/lib & co.
                          "--with-lib-path=/no-ld-lib-path"

                          ;; Install BFD.  It ends up in a hidden directory,
                          ;; but it's here.
                          "--enable-install-libbfd"

                          ;; Make sure 'ar' and 'ranlib' produce archives in a
                          ;; deterministic fashion.
                          "--enable-deterministic-archives"
                          ;;"--enable-shared"
                          ;; "--with-system-zlib"
                          "--enable-gold"
                          "--enable-ld=default")
      #:phases
      (modify-phases %standard-phases
        (add-after 'patch-source-shebangs 'patch-more-shebangs
          (lambda _
            (substitute* "gold/Makefile.in"
              (("/bin/sh") (which "sh")))
            #t)))))))
my-binutils

;; GMP-6.1.2, MPFR-4.0.2, MPC-1.1.0
(define-public my-gmp
  (package (inherit gmp)
   (name "my-gmp")))
my-gmp

(define-public my-mpfr
  (package (inherit mpfr)
   (name "my-mpfr")
   (version "4.0.2")
   (source (origin
            (method url-fetch)
            (uri (string-append "mirror://gnu/mpfr/mpfr-" version
                                ".tar.xz"))
            (sha256 (base32
                     "12m3amcavhpqygc499s3fzqlb8f2j2rr7fkqsm10xbjfc04fffqx"))))
   (propagated-inputs `(("gmp" ,my-gmp)))))            ; <mpfr.h> refers to 
<gmp.h>
my-mpfr

(define-public my-mpc
  (package (inherit mpc)
   (name "my-mpc")
   (propagated-inputs `(("gmp" ,my-gmp)              ; <mpc.h> refers to both
                        ("mpfr" ,my-mpfr)))))
my-mpc

;; Shadow-4.6
(define-public my-shadow
  (package (inherit shadow)
    (name "my-shadow")))
my-shadow

;; Gcc-8.2.0
(define-public my-gcc
  (package
    (inherit gcc-7)
    (name "my-gcc")
    (version "8.2.0")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnu/gcc/gcc-"
                                  version "/gcc-" version ".tar.xz"))
              (sha256
               (base32
                "10007smilswiiv2ymazr3b6x2i933c0ycxrr529zh4r6p823qv0r"))
              (patches (search-patches "gcc-8-strmov-store-file-names.patch"
                                       "gcc-5.0-libvtv-runpath.patch"))))))
my-gcc

;; Bzip2-1.0.6
(define-public my-bzip2
  (package (inherit bzip2)
           (name "my-bzip2")))
my-bzip2

;; Pkg-config-0.29.2
(define-public my-pkg-config
  (package (inherit pkg-config)
   (name "my-pkg-config")
   (arguments `(#:configure-flags '("--with-internal-glib"
                                    "--disable-host-tool")))))
my-pkg-config

;; Ncurses-6.1
(define-public my-ncurses
  (package (inherit ncurses)
    (name "my-ncurses")))
my-ncurses

;; Attr-2.4.48
(define-public my-attr
  (package (inherit attr)
    (name "my-attr")
    (version "2.4.48")
    (source (origin
              (method url-fetch)
              (uri (string-append 
"http://download.savannah.gnu.org/releases/attr/attr-";
                                  version ".tar.gz"))
              (sha256
               (base32
                "1rr4adzwax4bzr2c00f06zcsljv5y6p9wymz1g89ww7cb2rp5bay"))))
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         ;; (add-after 'configure 'patch-makefile-SHELL
         ;;   (lambda _
         ;;     (patch-makefile-SHELL "include/buildmacros")
         ;;     #t))
         (replace 'install
           (lambda _
             (invoke "make"
                     "install"
                     ;; "install-lib"
                     ;; "install-dev"
                     )))
         (replace 'check
           (lambda* (#:key target #:allow-other-keys)
             ;; Use the right shell.
             (substitute* "test/run"
               (("/bin/sh")
                (which "sh")))

             ;; When building natively, run the tests.
             ;;
             ;; Note that we use system* and unconditionally return #t here
             ;; to ignore the test result, because the tests will fail when
             ;; the build is performed on a file system without support for
             ;; extended attributes, and we wish to allow Guix to be built
             ;; on such systems.
             (unless target
               (system* "make" "tests" "-C" "test"))
             #t)))))))
my-attr

;; Acl-2.2.53
(define-public my-acl
  (package (inherit acl)
    (name "my-acl")
    (version "2.2.53")
    (source
     (origin
      (method url-fetch)
      (uri (string-append "http://download.savannah.gnu.org/releases/acl/acl-";
                          version ".tar.gz"))
      (sha256
       (base32
        "1ir6my3w74s6nfbgbqgzj6w570sn0qjf3524zx8xh67lqrjrigh6"))))
    (arguments
     `(;; #:test-target "tests"
       #:modules ((ice-9 ftw)
                  ,@%gnu-build-system-modules)
       #:phases
       (modify-phases %standard-phases
         ;; XXX After repacking the sources the timestamps are reset to the
         ;; epoch, which leads to a failure in gzipping the CHANGES file.
         (add-after 'unpack 'ensure-no-mtimes-pre-1980
           (lambda _
             (let ((early-1980 315619200)) ; 1980-01-02 UTC
               (ftw "." (lambda (file stat flag)
                          (unless (<= early-1980 (stat:mtime stat))
                            (utime file early-1980 early-1980))
                          #t))
               #t)))
         (add-after 'build 'patch-exec-bin-sh
           (lambda _
             (substitute* "test/run"
               (("/bin/sh") (which "sh")))
             #t)))))))
my-acl

;; Libcap-2.26
(define-public my-libcap
  (package (inherit libcap)
    (name "my-libcap")
    (version "2.26")
    (source (origin
             (method url-fetch)
             (uri (string-append
                   "mirror://kernel.org/linux/libs/security/linux-privs/"
                   "libcap2/libcap-" version ".tar.xz"))
             (sha256
              (base32
               "12s5b8fp61jcn4qld8a7fakcz1han4a6l3b8cyl3n6r7hk2bfc5n"))))))
my-libcap

;; Sed-4.7
(define-public my-sed
  (package (inherit sed)
   (name "my-sed")
   (version "4.7")
   (source (origin
            (method url-fetch)
            (uri (string-append "mirror://gnu/sed/sed-" version
                                ".tar.xz"))
            (sha256
             (base32
              "0smxcx66vx29djzb542nxcynl7qnzxqa5032ibazi7x2s267d198"))))))
my-sed

;; Psmisc-23.2
(define-public my-psmisc
  (package (inherit psmisc)
   (name "my-psmisc")
   (version "23.2")
   (source
    (origin
      (method url-fetch)
      (uri (string-append 
"https://sourceforge.net/projects/psmisc/files/psmisc/psmisc-";
                          version ".tar.xz"))
      (sha256
       (base32
        "0s1kjhrik0wzqbm7hv4gkhywhjrwhp9ajw0ad05fwharikk6ah49"))))))
my-psmisc

;; Iana-etc-2.30
(define-public my-Iana-etc
  (package
   (name "my-Iana-etc")
   (version "2.30")
   (source (origin
            (method url-fetch)
            (uri (string-append 
"http://anduin.linuxfromscratch.org/LFS/iana-etc-";
                                version ".tar.bz2"))

            (sha256
             (base32
              "03gjlg5zlwsdk6qyw3v85l129rna5bpm4m7pzrp864h0n97qg9mr"))))
   (build-system gnu-build-system)
   (arguments
    `(#:tests? #f
      #:make-flags (list (string-append "PREFIX=" (assoc-ref %outputs "out")))
      #:phases (modify-phases %standard-phases
                (delete 'configure))))
   (native-inputs `(("gawk" ,gawk)))
   (home-page "http://freecode.com/projects/iana-etc";)
   (synopsis "Data for network services and protocols")
   (description "Iana-etc installs /etc/services and /etc/protocols using data 
from the Internet Assigned Numbers Authority. ")
   (license (license:fsf-free 
"http://freshmeat.sourceforge.net/projects/iana-etc";))))
my-Iana-etc

;; Bison-3.3.2
(define-public my-bison
  (package (inherit bison)
    (name "my-bison")
    (version "3.3.2")
    (source
     (origin
      (method url-fetch)
      (uri (string-append "mirror://gnu/bison/bison-"
                          version ".tar.xz"))
      (sha256
       (base32
        "016qp59wxakz3ckxwyrmzxk406q0h286ydz8ww1m0pnrc5dy97h3"))))))
my-bison

;; Flex-2.6.4
(define-public my-flex
  (package (inherit flex)
    (name "my-flex")))
my-flex

;; Grep-3.3
(define-public my-grep
  (package (inherit grep)
   (name "my-grep")
   (version "3.3")
   (source (origin
            (method url-fetch)
            (uri (string-append "mirror://gnu/grep/grep-"
                                version ".tar.xz"))
            (sha256
             (base32
              "055mqp6vrd0brkygmygb2673qwz409a7kyp1mzbfy6cn94f58q5r"))
            (patches (search-patches "grep-timing-sensitive-test.patch"))))))
my-grep

;; Bash-5.0
(define-public my-bash
  (package (inherit bash)
   (name "my-bash")
   (version "5.0")
   (source (origin
             (method url-fetch)
             (uri (string-append
                   "mirror://gnu/bash/bash-" version ".tar.gz"))
             (sha256
              (base32
               "0kgvfwqdcd90waczf4gx39xnrxzijhjrzyzv7s8v4w31qqm0za5l"))))))
my-bash

;; Libtool-2.4.6
(define-public my-libtool
  (package (inherit libtool)
           (name "my-libtool")))
my-libtool

;; Gdbm-1.18.1
(define-public my-gdbm
  (package (inherit gdbm)
    (name "my-gdbm")
    (version "1.18.1")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnu/gdbm/gdbm-"
                                  version ".tar.gz"))
              (sha256
               (base32
                "1p4ibds6z3ccy65lkmd6lm7js0kwifvl53r0fd759fjxgr917rl6"))))))
my-gdbm

;; Gperf-3.1
(define-public my-gperf
  (package (inherit gperf)
    (name "my-gperf")))
my-gperf

;; Expat-2.2.6
(define-public my-expat
  (package (inherit expat)
    (name "my-expat")))
my-expat

;; Inetutils-1.9.4
(define-public my-Inetutils
  (package (inherit inetutils)
   (name "my-Inetutils")
   (arguments
    `(#:configure-flags '("--localstatedir=/var"
                          "--disable-logger"
                          "--disable-whois"
                          "--disable-rcp"
                          "--disable-rexec"
                          "--disable-rlogin"
                          "--disable-rsh"
                          "--disable-servers"
                          ;; Make sure 'PATH_PROCNET_DEV' gets defined when
                          ;; cross-compiling (by default it does not.)
                          ,@(if (%current-target-system)
                                '("--with-path-procnet-dev=/proc/net/dev")
                                '()))
      ;; On some systems, 'libls.sh' may fail with an error such as:
      ;; "Failed to tell switch -a apart from -A".
      #:parallel-tests? #f))))
my-Inetutils

;; Perl-5.28.1
(define-public my-perl
  (package (inherit perl)
    (name "my-perl")
    (version "5.28.1")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://cpan/src/5.0/perl-"
                                 version ".tar.xz"))
             (sha256
              (base32
               "0b901g6i5g3qv77xgafqfjzq9n1pcwzvk1q5gww0m56a9hnid9zy"))
             (patches (search-patches
                       "perl-no-sys-dirs.patch"
                       "perl-autosplit-default-time.patch"
                       "perl-deterministic-ordering.patch"
                       "perl-reproducible-build-date.patch"))))))
my-perl

;; XML::Parser-2.44
(define-public my-perl-xml-parser
  (package (inherit perl-xml-parser)
    (name "my-perl-xml-parser")))
my-perl-xml-parser

;; Intltool-1.9.4
(define-public my-intltool
  (package (inherit intltool)
    (name "my-intltool")))
my-intltool

;; Autoconf-2.69
(define-public my-autoconf
  (package (inherit autoconf)
           (name "my-autoconf")))
my-autoconf

;; Automake-1.16.1
(define-public my-automake
  (package (inherit automake)
           (name "my-automake")))
my-automake

;; Xz-5.2.4
(define-public my-xz
  (package (inherit xz)
           (name "my-xz")
           (version "5.2.4")
           (source (origin
                    (method url-fetch)
                    (uri (string-append "http://tukaani.org/xz/xz-"; version 
".tar.xz"))
                    (sha256
                     (base32
                      
"0jsgakq14aqvywn1vhjvnrb65a7yqlh1895d7mbxzpk06wvaw5wp"))))))
my-xz

;; Kmod-26
(define-public my-kmod
  (package (inherit kmod)
    (name "my-kmod")
    (version "26")
    (source (origin
              (method url-fetch)
              (uri
               (string-append "mirror://kernel.org/linux/utils/kernel/kmod/"
                              "kmod-" version ".tar.xz"))
              (sha256
               (base32
                "17dvrls70nr3b3x1wm8pwbqy4r8a5c20m0dhys8mjhsnpg425fsp"))
              (patches (search-patches "kmod-module-directory.patch"))))))
my-kmod

;; Gettext-0.19.8.1
(define-public my-gettext
  (package (inherit gnu-gettext)
   (name "my-gettext")))
my-gettext

;; Libelf from Elfutils-0.176
(define-public my-libelf
  (package (inherit elfutils)
    (name "my-libelf")
    (version "0.176")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://sourceware.org/elfutils/ftp/";
                                  version "/elfutils-" version ".tar.bz2"))
              (sha256
               (base32
                "08qhrl4g6qqr4ga46jhh78y56a47p3msa5b2x1qhzbxhf71lfmzb"))
              (patches (search-patches "elfutils-tests-ptrace.patch"))))
    (outputs '("out"))
    (arguments
     `(#:configure-flags (list (string-append "LDFLAGS=-Wl,-rpath="
                                              (assoc-ref %outputs "out")
                                              "/lib"))

       ,@(if (string-prefix? "mips" (or (%current-target-system)
                                        (%current-system)))
             '(#:tests? #f)
             '())

       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'disable-failing-aarch64-tests
           (lambda _
             (substitute* "tests/Makefile.in"
               (("run-backtrace-native.sh") ""))
             #t))
         (replace 'install
           (lambda _
             (invoke "make" "-C" "libelf" "install")
             (install-file "config/libelf.pc"
                           (string-append (assoc-ref %outputs "out") 
"/lib/pkgconfig"))
             #t)))))))
my-libelf

;; Libffi-3.2.1
(define-public my-libffi
  (package (inherit libffi)
   (name "my-libffi")))
my-libffi

;; Openssl-1.1.1a
(define-public my-openssl
  (package
    (inherit openssl-next)
    (name "my-openssl")
    (version "1.1.1a")
    (source (origin
             (method url-fetch)
             (uri (list (string-append "https://www.openssl.org/source/openssl-";
                                       version ".tar.gz")
                        (string-append "ftp://ftp.openssl.org/source/old/";
                                       (string-trim-right version 
char-set:letter)
                                       "/openssl-" version ".tar.gz")))
              (patches (search-patches "openssl-1.1-c-rehash-in.patch"))
              (sha256
               (base32
                "0hcz7znzznbibpy3iyyhvlqrq44y88plxwdj32wjzgbwic7i687w"))))))
my-openssl

(define-public my-python
  (package (inherit python)
    (name "my-python")
    (version "3.7.2")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://www.python.org/ftp/python/";
                                  version "/Python-" version ".tar.xz"))
              (patches (search-patches
                        "python-fix-tests.patch"
                        "python-3-fix-tests.patch"
                        "python-3-deterministic-build-info.patch"
                        "python-3-search-paths.patch"))
              (patch-flags '("-p0"))
              (sha256
               (base32
                "1fzi9d2gibh0wzwidyckzbywsxcsbckgsl05ryxlifxia77fhgyq"))
              (snippet
               '(begin
                  (for-each delete-file
                            '(;; This test may hang and eventually run out of
                              ;; memory on some systems:
                              ;; <https://bugs.python.org/issue34587>
                              "Lib/test/test_socket.py"

                              ;; These tests fail on AArch64.
                              "Lib/ctypes/test/test_win32.py"
                              "Lib/test/test_fcntl.py"
                              "Lib/test/test_posix.py"))
                  #t))))))
my-python

;; Ninja-1.9.0
(define-public my-ninja
  (package (inherit ninja)
    (name "my-ninja")
    (version "1.9.0")
    (source (origin
              (method url-fetch)
              (uri (string-append 
"https://github.com/ninja-build/ninja/archive/v";
                                  version "/ninja-" version ".tar.gz"))
              (sha256
               (base32
                "1ffmzj5s9h98qhl94d9i23zcv057rsqbac9g1hdgvlzq51ccfzjx"))))
    (build-system gnu-build-system)
    (native-inputs `(("python" ,python)))
    (arguments
     '(#:phases
       (modify-phases %standard-phases
         (replace 'configure
           (lambda _
             (substitute* "src/subprocess-posix.cc"
               (("/bin/sh") (which "sh")))
             (substitute* "src/subprocess_test.cc"
               (("/bin/echo") (which "echo")))
             #t))
         (replace 'build
           (lambda _
             (invoke "python3" "configure.py" "--bootstrap")))
         (replace 'check
           (lambda _
             (invoke "python3" "configure.py")
             (invoke "./ninja" "ninja_test")
             (invoke "./ninja_test" 
"--gtest_filter=-SubprocessTest.SetWithhLots")))
         (replace 'install
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (bin (string-append out "/bin"))
                    (doc (string-append out "/share/doc/ninja")))
               (install-file "ninja" bin)
               (install-file "doc/manual.asciidoc" doc)
               #t))))))))
my-ninja

;; Meson-0.49.2
(define-public my-meson
  (package (inherit meson)
    (name "my-meson")
    (version "0.49.2")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://github.com/mesonbuild/meson/";
                                  "releases/download/" version  "/meson-"
                                  version ".tar.gz"))
              (sha256
               (base32
                "1z89f71r29laywx75bamjakybv9653wz0vd2l4xhvqy1dqr197zg"))))))
my-meson

;; Coreutils-8.30
(define-public my-coreutils
  (package (inherit coreutils)
   (name "my-coreutils")
   (version "8.30")
   (source (origin
            (method url-fetch)
            (uri (string-append "mirror://gnu/coreutils/coreutils-"
                                version ".tar.xz"))
            (sha256
             (base32
              "0mxhw43d4wpqmvg0l4znk1vm10fy92biyh90lzdnqjcic2lb6cg8"))
            (patches (search-patches "coreutils-8.30-i18n-1.patch"))))
   (arguments
    `(#:parallel-build? #f            ; help2man may be called too early
      #:phases (modify-phases %standard-phases
                 (add-before 'build 'patch-shell-references
                   (lambda _
                     ;; 'split' uses either $SHELL or /bin/sh.  Set $SHELL so
                     ;; that tests pass, since /bin/sh isn't in the chroot.
                     (setenv "SHELL" (which "sh"))

                     (substitute* (find-files "gnulib-tests" "\\.c$")
                       (("/bin/sh") (which "sh")))
                     (substitute* (find-files "tests" "\\.sh$")
                       (("#!/bin/sh") (string-append "#!" (which "sh"))))
                     #t))
                 (add-before 'check 'disable-broken-test
                   (lambda _
                     ;; This test hits the 127 character shebang limit in the 
build
                     ;; environment due to the way "env -S" splits arguments 
into
                     ;; shebangs.  Note that "env-S-script.sh" works around this
                     ;; specific issue, but "env-S.pl" is not adjusted for build
                     ;; environments with long prefixes (/tmp/guix-build-...).
                     (substitute* "Makefile"
                       (("^.*tests/misc/env-S.pl.*$") ""))
                     #t)))
      #:configure-flags '("gl_cv_func_working_mktime=yes"
                          "--enable-no-install-program=kill,uptime")))))
my-coreutils

;; Check-0.12.0
(define-public my-check
  (package (inherit check)
    (name "my-check")))
my-check

;; Diffutils-3.7
(define-public my-diffutils
  (package (inherit diffutils)
    (name "my-diffutils")
    (version "3.7")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnu/diffutils/diffutils-"
                                  version ".tar.xz"))
              (sha256
               (base32
                "09isrg0isjinv8c535nxsi1s86wfdfzml80dbw41dj9x3hiad9xk"))
              (snippet '(begin
                          ;; Remove failed test
                          (delete-file "tests/strip-trailing-cr")))))
    (native-inputs `(("perl" ,perl)))   ;; for tests
    (arguments
     `(#:phases (modify-phases %standard-phases
                  (add-after 'unpack 'delete-test-from-Makefile.in
                    (lambda _
                      (substitute* "tests/Makefile.in"
                        (("strip-trailing-cr") ""))
                      #t)))))))
my-diffutils

;; Gawk-4.2.1
(define-public my-gawk
  (package (inherit gawk)
   (name "my-gawk")))
my-gawk

;; Findutils-4.6.0
(define-public my-findutils
  (package (inherit findutils)
   (name "my-findutils")))
my-findutils

;; Groff-1.22.4
(define-public my-groff
  (package (inherit groff)
   (name "my-groff")
   (version "1.22.4")
   (source (origin
            (method url-fetch)
            (uri (string-append "mirror://gnu/groff/groff-" version
                                ".tar.gz"))
            (sha256 (base32
                     "14q2mldnr1vx0l9lqp9v2f6iww24gj28iyh4j2211hyynx67p3p7"))))
   (outputs '("out"))
   (arguments
    `(#:parallel-build? #f   ; parallel build fails
      #:phases
      (modify-phases %standard-phases
        (add-after 'unpack 'setenv
          (lambda _
            (setenv "GS_GENERATE_UUIDS" "0")
            (setenv "PAGE" "A4")
            #t)))))))
my-groff

;; Grub-2.02
(define-public my-grub
  (package (inherit grub)
    (name "my-grub")))
my-grub

;; Less-530
(define-public my-less
  (package (inherit less)
   (name "my-less")))
my-less

;; Gzip-1.10
(define-public my-gzip
  (package (inherit gzip)
   (name "my-gzip")
   (version "1.10")
   (source (origin
            (method url-fetch)
            (uri (string-append "mirror://gnu/gzip/gzip-" version ".tar.xz"))
            (sha256
             (base32
              "1h6p374d3j8d4cdfydzls021xa2yby8myc0h8d6m8bc7k6ncq9c4"))))))
my-gzip

;; Iproute2-4.20.0
(define-public my-iproute2
  (package (inherit iproute)
   (name "my-iproute2")))
my-iproute2

;; Kbd-2.0.4
(define-public my-kbd
  (package (inherit kbd)
    (name "my-kbd")))
my-kbd

;; Libpipeline-1.5.1
(define-public my-libpipeline
  (package (inherit libpipeline)
    (name "my-libpipeline")))
my-libpipeline

;; Make-4.2.1
(define-public my-make
  (package (inherit gnu-make)
   (name "my-make")))
my-make

;; Patch-2.7.6
(define-public my-patch
  (package (inherit patch)
   (name "my-patch")))
my-patch

;; Man-db-2.8.5
(define-public my-man-db
  (package (inherit man-db)
    (name "my-man-db")
    (version "2.8.5")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://savannah/man-db/man-db-"
                                  version ".tar.xz"))
              (sha256
               (base32
                "1hgnfcgbllmws8cs6zaxklq8b69i05zynxi87f3zxw9lfms54kdn"))))
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'patch-source-shebangs 'patch-test-shebangs
           (lambda* (#:key outputs #:allow-other-keys)
             ;; Patch shebangs in test scripts.
             (let ((out (assoc-ref outputs "out")))
               (for-each (lambda (file)
                           (substitute* file
                             (("#! /bin/sh")
                              (string-append "#!" (which "sh")))))
                         (remove file-is-directory?
                                 (find-files "src/tests" ".*")))
               #t)))
         (add-after 'unpack 'patch-absolute-paths
           (lambda* (#:key inputs #:allow-other-keys)
             (substitute* "src/man.c"
               (("\"iconv\"")
                (string-append "\"" (which "iconv") "\"")))
             ;; Embed an absolute reference to "preconv", otherwise it
             ;; falls back to searching in PATH and ultimately fails
             ;; to render unicode data (see <https://bugs.gnu.org/30785>).
             (substitute* "lib/encodings.c"
               (("groff_preconv = NULL")
                (string-append "groff_preconv = \""
                               (assoc-ref inputs "groff-minimal")
                               "/bin/preconv\"")))
             #t)))
       #:configure-flags
       (let ((groff (assoc-ref %build-inputs "groff"))
             (groff-minimal (assoc-ref %build-inputs "groff-minimal"))
             (less  (assoc-ref %build-inputs "less"))
             (gzip  (assoc-ref %build-inputs "gzip"))
             (bzip2 (assoc-ref %build-inputs "bzip2"))
             (xz    (assoc-ref %build-inputs "xz"))
             (util  (assoc-ref %build-inputs "util-linux")))
         ;; Invoke groff, less, gzip, bzip2, and xz directly from the store.
         (append (list ;; Disable setuid man user.
                       "--disable-setuid"
                       ;; Don't constrain ownership of system-wide cache files.
                       ;; Otherwise creating the manpage database fails with
                       ;; man-db > 2.7.5.
                       "--disable-cache-owner"
                       (string-append "--with-pager=" less "/bin/less")
                       (string-append "--with-gzip=" gzip "/bin/gzip")
                       (string-append "--with-bzip2=" bzip2 "/bin/gzip")
                       (string-append "--with-xz=" xz "/bin/xz")
                       (string-append "--with-col=" util "/bin/col")
                       ;; Default value is "/usr/lib/tmpfiles.d" (not
                       ;; prefix-sensitive).
                       ;; (string-append "--with-systemdtmpfilesdir="
                       ;;                %output "/lib/tmpfiles.d")
                       "--with-systemdtmpfilesdir="
                       "--with-systemdsystemunitdir=")
                 (map (lambda (prog)
                        (string-append "--with-" prog "=" groff-minimal
                                       "/bin/" prog))
                      '("nroff" "eqn" "neqn" "tbl" "refer" "pic"))))

       ;; At run time we should refer to GROFF-MINIMAL, not GROFF (the latter
       ;; pulls in Perl.)
       #:disallowed-references (,groff)

       #:modules ((guix build gnu-build-system)
                  (guix build utils)
                  (srfi srfi-1))))
    (native-inputs
     `(("pkg-config" ,pkg-config)
       ("groff" ,groff)))   ;needed at build time (troff, grops, soelim, etc.)
    (inputs
     `(("flex" ,flex)
       ("gdbm" ,gdbm)
       ("groff-minimal" ,groff-minimal)
       ("less" ,less)
       ("libpipeline" ,libpipeline)
       ;; FIXME: 4.8 and later can use libseccomp, but it causes test
       ;; failures in the build chroot.
       ;;("libseccomp" ,libseccomp)
       ("util-linux" ,util-linux)))
    (native-search-paths
     (list (search-path-specification
            (variable "MANPATH")
            (files '("share/man")))))))
my-man-db

;; Tar-1.31
(define-public my-tar
  (package (inherit tar)
   (name "my-tar")
   (version "1.31")
   (source (origin
            (method url-fetch)
            (uri (string-append "mirror://gnu/tar/tar-"
                                version ".tar.xz"))
            (sha256
             (base32
              "1h9dxhjhz1jnyhmh6jfhqw1g1sxqbg3cd32vpwg7x2xxxqffzwrp"))
            (patches (search-patches "tar-skip-unreliable-tests.patch"
                                     "tar-remove-wholesparse-check.patch"))))
   (build-system gnu-build-system)
   ;; Note: test suite requires ~1GiB of disk space.
   (arguments
    `(#:phases (modify-phases %standard-phases
                 (add-after 'unpack 'fix-bug-tar-1.31
                   (lambda _
                     (substitute* "src/extract.c"
                       (("abort.*") "FALLTHROUGH;"))
                     #t))
                 (add-before 'build 'set-shell-file-name
                   (lambda* (#:key inputs #:allow-other-keys)
                     ;; Do not use "/bin/sh" to run programs.
                     (let ((bash (assoc-ref inputs "bash")))
                       (substitute* "src/system.c"
                         (("/bin/sh")
                          (string-append bash "/bin/sh")))
                       #t))))

      ;; Work around a cross-compilation bug whereby libgnu.a would provide
      ;; '__mktime_internal', which conflicts with the one in libc.a.
      ,@(if (%current-target-system)
            `(#:configure-flags '("gl_cv_func_working_mktime=yes"))
            '())

      ;; Test #92 "link mismatch" expects "a/z: Not linked to a/y" but gets
      ;; "a/y: Not linked to a/z" and fails, presumably due to differences in
      ;; the order in which 'diff' traverses directories.  That leads to a
      ;; test failure even though conceptually the test passes.  Skip it.
      ;; Test 117 and 118 are prone to race conditions too, particularly
      ;; when cross-compiling, so we skip those as well.  All issues have
      ;; been fixed upstream in these commits:
      ;; <https://git.savannah.gnu.org/cgit/tar.git/commit/?id=847a36f>
      ;; <https://git.savannah.gnu.org/cgit/tar.git/commit/?id=64b43fd>
      #:make-flags (list (string-append
                          "TESTSUITEFLAGS= -k '!link mismatch,"
                          "!directory removed before reading,"
                          "!explicitly named directory removed before 
reading'"))))))
my-tar

;; Texinfo-6.5
(define-public my-texinfo
  (package (inherit texinfo)
    (name "my-texinfo")))
my-texinfo

;; Vim-8.1.0644
(define-public my-vim
  (package (inherit vim)
    (name "my-vim")))
my-vim

;; Procps-ng-3.3.15
(define-public my-procps-ng
  (package (inherit procps)
    (name "my-procps-ng")))
my-procps-ng

;; Util-linux-2.33.1
(define-public my-util-linux
  (package (inherit util-linux)
    (name "my-util-linux")
    (version "2.33.1")
    (source (origin
              (method url-fetch)
              (uri (string-append 
"https://www.kernel.org/pub/linux/utils/util-linux/v";
                                  (version-major+minor version) "/"
                                  "util-linux-" version ".tar.xz"))
              (sha256
               (base32
                "08ggvgrb59m5jbq29950xxirsgv4xj3nwsc7vf82nyg1nvrxjjy1"))
              (patches (search-patches "util-linux-tests.patch"))
              (modules '((guix build utils)))
              (snippet
               '(begin
                  ;; delete failed subtests
                  (delete-file-recursively "tests/ts/lsblk")
                  #t))))
    (arguments
     `(#:configure-flags (list "--disable-use-tty-group"
                               
;;"--enable-fs-paths-default=/run/current-system/profile/sbin"
                               ;; Don't try to chown root:root mount and umount
                               "--disable-makeinstall-chown"
                               ;; Install completions where our
                               ;; bash-completion package expects them.
                               (string-append "--with-bashcompletiondir="
                                              (assoc-ref %outputs "out")
                                              "/etc/bash_completion.d")
                               "ADJTIME_PATH=/var/lib/hwclock/adjtime"
                               "--disable-chfn-chsh"
                               "--disable-login"
                               "--disable-nologin"
                               "--disable-su"
                               "--disable-setpriv"
                               "--disable-runuser"
                               "--disable-pylibmount"
                               "--without-python"
                               "--without-systemd"
                               "--without-systemdsystemunitdir")
       #:phases (modify-phases %standard-phases
                  ;; (add-before
                  ;;  'build 'set-umount-file-name
                  ;;  (lambda* (#:key outputs #:allow-other-keys)
                  ;;    ;; Tell 'eject' the right file name of 'umount'.
                  ;;    (let ((out (assoc-ref outputs "out")))
                  ;;      (substitute* "sys-utils/eject.c"
                  ;;        (("\"/bin/umount\"")
                  ;;         (string-append "\"" out "/bin/umount\"")))
                  ;;      #t)))
                  (add-before
                   'check 'pre-check
                   (lambda* (#:key inputs outputs #:allow-other-keys)
                     (let ((out (assoc-ref outputs "out"))
                           (net (assoc-ref inputs "net-base")))
                       ;; Change the test to refer to the right file.
                       (substitute* "tests/ts/misc/mcookie"
                         (("/etc/services")
                          (string-append net "/etc/services")))
                       #t)))
                  (add-after
                   'install 'move-static-libraries
                   (lambda* (#:key outputs #:allow-other-keys)
                     (let ((out    (assoc-ref outputs "out"))
                           (static (assoc-ref outputs "static")))
                       (mkdir-p (string-append static "/lib"))
                       (with-directory-excursion out
                         (for-each (lambda (file)
                                     (rename-file file
                                                  (string-append static "/"
                                                                 file)))
                                   (find-files "lib" "\\.a$"))

                         ;; Remove references to the static library from the 
'.la'
                         ;; files so that Libtool does the right thing when both
                         ;; the shared and static library is available.
                         (substitute* (find-files "lib" "\\.la$")
                           (("old_library=.*") "old_library=''\n")))

                       #t))))))))
my-util-linux

;; E2fsprogs-1.44.5
(define-public my-e2fsprogs
  (package (inherit e2fsprogs)
   (name "my-e2fsprogs")))
my-e2fsprogs

;; Sysklogd-1.5.1
(define-public my-sysklogd
  (package
    (name "my-sysklogd")
    (version "1.5.1")
    (source (origin
              (method url-fetch)
              (uri (string-append 
"http://www.infodrom.org/projects/sysklogd/download/sysklogd-";
                                  version ".tar.gz"))

              (sha256
               (base32
                "00f2wy6f0qng7qzga4iicyzl9j8b7mp6mrpfky5jxj93ms2w2rji"))
              (modules '((guix build utils)))
              (snippet '(begin
                          (substitute* "ksym_mod.c"
                            (("Error loading kernel symbols") "{n;n;d}"))
                          (substitute* "syslogd.c"
                            (("union wait") "int"))
                          #t))))
    (build-system gnu-build-system)
    (arguments
     `(#:tests? #f  ;; no testsuite
       #:phases (modify-phases %standard-phases
                  (delete 'configure)
                  (replace 'install
                    (lambda _
                      (let ((sbin (string-append (assoc-ref %outputs "out") 
"/sbin"))
                            (man5 (string-append (assoc-ref %outputs "out") 
"/share/man/man5"))
                            (man8 (string-append (assoc-ref %outputs "out") 
"/share/man/man8")))
                        (install-file "syslogd" sbin)
                        (install-file "klogd" sbin)
                        (install-file "syslog.conf.5" man5)
                        (install-file "syslogd.8" man8)
                        (install-file "klogd.8" man8)
                        (install-file "sysklogd.8" man8))
                      #t)))))
    (home-page "http://www.infodrom.org/projects/sysklogd/";)
    (synopsis "System log daemon")
    (description "Sysklogd package contains programs for logging system 
messages.")
    (license gpl2)))
my-sysklogd

;; Sysvinit-2.93
(define-public my-sysvinit
  (package
    (name "my-sysvinit")
    (version "2.93")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://savannah/sysvinit/sysvinit-"
                                  version ".tar.xz"))

              (sha256
               (base32
                "1zx84vrzv615na661dd6mg4wh999m0jp25lsa241961x4c74cba7"))
              (patches (search-patches "sysvinit-2.93-consolidated-1.patch"))))
    (build-system gnu-build-system)
    (arguments
     `(#:tests? #f
       #:phases (modify-phases %standard-phases
                  (delete 'configure)
                  (add-before 'build 'setenv-fix-src-Makefile
                    (lambda _
                      (setenv "CC" "gcc")
                      (setenv "ROOT" (assoc-ref %outputs "out"))
                      (setenv "INSTALL_DIR" "mkdir-p")
                      (substitute* "src/Makefile"
                        (("usr") "")
                        (("man1") ""))
                      #t))
                  (add-after 'install 'delete-bin
                    (lambda _
                      (rmdir (string-append (assoc-ref %outputs "out") "/bin"))
                      #t)))))
    (home-page "https://savannah.nongnu.org/projects/sysvinit";)
    (synopsis "System V style init programs")
    (description "Sysvinit control the booting and shutdown of your system.")
    (license gpl2+)))
my-sysvinit

;; Eudev-3.2.7
(define-public my-eudev
  (package (inherit eudev)
    (name "my-eudev")))
my-eudev

reply via email to

[Prev in Thread] Current Thread [Next in Thread]