From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:57141) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBDPc-0005rE-Oj for guix-patches@gnu.org; Fri, 20 Sep 2019 03:33:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iBDPb-0007e0-2n for guix-patches@gnu.org; Fri, 20 Sep 2019 03:33:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47888) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iBDPb-0007dr-0W for guix-patches@gnu.org; Fri, 20 Sep 2019 03:33:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iBDPa-0008KJ-Qm for guix-patches@gnu.org; Fri, 20 Sep 2019 03:33:02 -0400 Subject: [bug#37466] [PATCH 1/4] gnu: Add musl-cross. Resent-Message-ID: From: Danny Milosavljevic Date: Fri, 20 Sep 2019 09:31:46 +0200 Message-Id: <20190920073149.2933-1-dannym@scratchpost.org> In-Reply-To: <20190920010248.28082-1-dannym@scratchpost.org> References: <20190920010248.28082-1-dannym@scratchpost.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 37466@debbugs.gnu.org * gnu/packages/heads.scm: New file. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. --- gnu/local.mk | 1 + gnu/packages/heads.scm | 124 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 gnu/packages/heads.scm diff --git a/gnu/local.mk b/gnu/local.mk index ad85894ebe..4fc22d6fb4 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -245,6 +245,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/haskell-web.scm \ %D%/packages/haskell-xyz.scm \ %D%/packages/ham-radio.scm \ + %D%/packages/heads.scm \ %D%/packages/hexedit.scm \ %D%/packages/hugs.scm \ %D%/packages/hurd.scm \ diff --git a/gnu/packages/heads.scm b/gnu/packages/heads.scm new file mode 100644 index 0000000000..b547a374e0 --- /dev/null +++ b/gnu/packages/heads.scm @@ -0,0 +1,124 @@ +(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 (gnu packages) + #:use-module (gnu packages algebra) + #: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 multiprecision) + #:use-module (gnu packages cpio) + #:use-module (gnu packages perl) + #:use-module (gnu packages version-control) + #:use-module (gnu packages virtualization)) + +(define-public musl-cross + (let ((revision "1") + (commit "b7f2249b665705939dc4eca67d11553c72164f4b")) + (package + (name "musl-cross") + (version (git-version "0.1" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/GregorR/musl-cross") + (commit "3b5b118f1cdddecda3f04b5005f69f962278fc1e"))) + (file-name "musl-cross-checkout") + (sha256 + (base32 "0pd1b7k4gwbvnyw0677p56d7j0xmv80k5iihkkjrd1mp9zdx90gj")))) + (build-system gnu-build-system) + (arguments + `(#:tests? #f ; No tests in main project. + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda _ + (setenv "SHELL" "bash") + (setenv "CONFIG_SHELL" "bash") + #t)) + (add-after 'unpack 'unpack-dependencies + (lambda* (#:key inputs outputs #:allow-other-keys) + (define (install-file* source-key destination-directory + destination-suffix) + (let* ((source-file (assoc-ref inputs source-key)) + (source-basename (basename source-file)) + (source-parts (string-split source-basename #\-)) + (drop (@ (srfi srfi-1) drop)) + (destination-file + (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" "kernel-headers" "musl")) + (substitute* "config.sh" + (("^CC_BASE_PREFIX=.*") + (string-append "CC_BASE_PREFIX=" (assoc-ref outputs "out") + "/crossgcc\n"))) + ;; Note: Important: source/gcc-5.3.0/gcc/exec-tool.in + ;; Note: Important: source/kernel-headers-3.12.6-5/tools/install.sh + ;; Note: Important: move-if-change (twice) + ;; Make sure that shebangs are patched after new extractions. + (substitute* "defs.sh" + (("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 gen-fixed.sh mkheader.sh ylwrap \\ +merge.sh godeps.sh lock-and-run.sh print-sysroot-suffix.sh mkconfig.sh \\ +genmultilib exec-tool.in install.sh +do + 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;' '{}' ';' +done +" ))) + #t)) + (replace 'build + (lambda* (#:key outputs #:allow-other-keys) + (invoke "./build.sh"))) + (delete 'install)))) + (native-inputs + `(("bash" ,bash) + ("flex" ,flex) + ("gmp" ,gmp) + ("mpfr" ,mpfr) + ("mpc" ,mpc) + ("binutils" + ,(origin + (method url-fetch) + (uri "https://ftpmirror.gnu.org/gnu/binutils/binutils-2.25.1.tar.bz2") + (sha256 + (base32 "08lzmhidzc16af1zbx34f8cy4z7mzrswpdbhrb8shy3xxpflmcdm")))) + ("target-gcc-5" + ,(origin + (method url-fetch) + (uri "https://ftpmirror.gnu.org/gnu/gcc/gcc-5.3.0/gcc-5.3.0.tar.bz2") + (sha256 + (base32 "1ny4smkp5bzs3cp8ss7pl6lk8yss0d9m4av1mvdp72r1x695akxq")))) + ("kernel-headers" + ,(origin + (method url-fetch) + (uri "http://ftp.barfooze.de/pub/sabotage/tarballs/kernel-headers-3.12.6-5.tar.xz") + (sha256 + (base32 "0p43lvbpy69lbjmvq39g570imj0p8z791bhzrpdnp1nygwshj2wf")))) + ("musl" + ,(origin + (method url-fetch) + (uri "http://www.musl-libc.org/releases/musl-1.1.21.tar.gz") + (sha256 + (base32 "0i2z52zgc86af1n1gjiz43hgd85mxjgvgn345zsybja9dxpvchn7")))))) + (home-page "https://github.com/osresearch/heads") + (synopsis "Musl-cross gcc 5 toolchain") + (description "Musl-cross toolchain: binutils, gcc 5 and musl.") + (license license:isc))))