From patchwork Fri Sep 20 07:31:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danny Milosavljevic X-Patchwork-Id: 15417 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 541F2173BE; Fri, 20 Sep 2019 08:33:25 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id A9014173BE for ; Fri, 20 Sep 2019 08:33:17 +0100 (BST) Received: from localhost ([::1]:53108 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iBDPp-0005ri-35 for patchwork@mira.cbaines.net; Fri, 20 Sep 2019 03:33:17 -0400 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 X-Loop: help-debbugs@gnu.org Subject: [bug#37466] [PATCH 1/4] gnu: Add musl-cross. Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 20 Sep 2019 07:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37466 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 37466@debbugs.gnu.org Received: via spool by 37466-submit@debbugs.gnu.org id=B37466.156896473131895 (code B ref 37466); Fri, 20 Sep 2019 07:33:02 +0000 Received: (at 37466) by debbugs.gnu.org; 20 Sep 2019 07:32:11 +0000 Received: from localhost ([127.0.0.1]:56700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBDOa-0008HW-Cc for submit@debbugs.gnu.org; Fri, 20 Sep 2019 03:32:11 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:38072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iBDOX-0008HG-Bs for 37466@debbugs.gnu.org; Fri, 20 Sep 2019 03:31:58 -0400 Received: from localhost.localdomain (77.116.217.78.wireless.dyn.drei.com [77.116.217.78]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 46F463365515; Fri, 20 Sep 2019 09:31:55 +0200 (CEST) From: Danny Milosavljevic Date: Fri, 20 Sep 2019 09:31:46 +0200 Message-Id: <20190920073149.2933-1-dannym@scratchpost.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20190920010248.28082-1-dannym@scratchpost.org> References: <20190920010248.28082-1-dannym@scratchpost.org> MIME-Version: 1.0 Tags: patch X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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))))