You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

163 lines
6.7 KiB

;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020 Danny Milosavljevic <>
;;; 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
;;; 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 <>.
(define-module (gnu packages heads)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix build-system gnu)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix utils)
#:use-module (gnu packages)
#:use-module (gnu packages admin)
#:use-module (gnu packages algebra)
#:use-module (gnu packages assembly)
#:use-module (gnu packages autotools)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages compression)
#:use-module (gnu packages flex)
#:use-module (gnu packages bison)
#:use-module (gnu packages elf)
#:use-module (gnu packages m4)
#:use-module (gnu packages curl)
#:use-module (gnu packages linux)
#:use-module (gnu packages multiprecision)
#:use-module (gnu packages python)
#:use-module (gnu packages cpio)
#:use-module (gnu packages file)
#:use-module (gnu packages perl)
#:use-module (gnu packages version-control)
#:use-module (gnu packages virtualization)
#:use-module ((guix build utils) #:select (alist-replace)))
(define-public musl-cross
(let ((revision "3")
(commit "a8a66490dae7f23a2cf5e256f3a596d1ccfe1a03"))
(name "musl-cross")
(version (git-version "0.1" revision commit))
(method git-fetch)
(uri (git-reference
(url "")
(commit commit)))
(file-name "musl-cross-checkout")
(patches (search-patches "musl-cross-locale.patch"))))
(build-system gnu-build-system)
`(#:tests? #f ; No tests in main project.
((guix build utils)
(guix build gnu-build-system)
(srfi srfi-1)) ; drop
(modify-phases %standard-phases
(replace 'configure
(lambda _
(setenv "SHELL" "bash")
(setenv "CONFIG_SHELL" "bash")
(add-after 'unpack 'unpack-dependencies
(lambda* (#:key inputs outputs #:allow-other-keys)
(define (install-file* source-key destination-directory
(let* ((source-file (assoc-ref inputs source-key))
(source-basename (basename source-file))
(source-parts (string-split source-basename #\-))
(string-join (drop source-parts 1) "-")))
(copy-file source-file
(string-append destination-directory "/"
destination-file destination-suffix))))
(for-each (lambda (name)
(install-file* name "tarballs" ""))
'("binutils" "target-gcc-5" "linux-headers" "musl"))
(copy-file (string-append (assoc-ref inputs "config.sub")
(copy-file (string-append (assoc-ref inputs "config.sub")
(substitute* ""
(string-append "CC_BASE_PREFIX=" (assoc-ref outputs "out")
;; Note: Important: source/gcc-5.3.0/gcc/
;; Note: Important: source/kernel-headers-3.12.6-5/tools/
;; Note: Important: move-if-change (twice)
;; Make sure that shebangs are patched after new extractions.
(substitute* ""
(("touch \"[$]2/extracted\"")
(string-append "touch \"$2/extracted\"
for s in mkinstalldirs move-if-change compile depcomp callprocs configure \\
mkdep compile libtool-ldflags config.guess install-sh missing config.sub \\
config.rpath progtest.m4 lib-ld.m4 acx.m4 ylwrap \\ \\
find . -name $s -exec sed -i -e 's;!/bin/sh;!" (assoc-ref inputs "bash")
"/bin/sh;' '{}' ';'
find . -name $s -exec sed -i -e 's; /bin/sh; " (assoc-ref inputs "bash")
"/bin/sh;' '{}' ';'
" )))
(replace 'build
(lambda* (#:key outputs #:allow-other-keys)
(invoke "./")))
(delete 'install))))
`(("config.sub" ,automake)
("bash" ,bash)
("flex" ,flex)
("gmp" ,gmp)
("mpfr" ,mpfr)
("mpc" ,mpc)
(method url-fetch)
(uri "")
(base32 "125clslv17xh1sab74343fg6v31msavpmaa1c1394zsqa773g5rn"))))
(method url-fetch)
(uri "")
(base32 "1ny4smkp5bzs3cp8ss7pl6lk8yss0d9m4av1mvdp72r1x695akxq"))))
(method url-fetch)
(uri "")
(base32 "1srgi2nqw892jb6yd4kzacf2xzwfvzhsv2957xfh1nvbs7varwyk"))))
(method url-fetch)
(uri "")
(base32 "18r2a00k82hz0mqdvgm7crzc7305l36109c0j9yjmkxj2alcjw0k"))))))
(home-page "")
(synopsis "Musl-cross gcc 5 toolchain")
(description "Musl-cross toolchain: binutils, gcc 5 and musl.")
(license license:isc))))