all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Danny Milosavljevic <dannym@scratchpost.org>
To: 31026@debbugs.gnu.org
Subject: [bug#31026] [PATCH 1/2] gnu: Add rust@1.19.0.
Date: Mon,  2 Apr 2018 19:24:08 +0200	[thread overview]
Message-ID: <20180402172409.13230-1-dannym@scratchpost.org> (raw)
In-Reply-To: <20180402171721.12331-1-dannym@scratchpost.org>

* gnu/packages/rust.scm (rust-1.23)[build-system, native-inputs, inputs,
native-search-paths, synopsis, description, home-page, license]: Move to...
(rust-1.19): ... here. New variable.
(rust-1.23)[arguments]<#:phases>[set-env, patch-tests, patch-cargo-checksums]:
Move to...
(rust-1.19): ... here.
(rust-1.19)[arguments]<#:phases>[configure, check, install]: Replace by no-op.
---
 gnu/packages/rust.scm | 126 ++++++++++++++++++++++++++++----------------------
 1 file changed, 72 insertions(+), 54 deletions(-)

diff --git a/gnu/packages/rust.scm b/gnu/packages/rust.scm
index 70140579b..8ec748fa6 100644
--- a/gnu/packages/rust.scm
+++ b/gnu/packages/rust.scm
@@ -150,30 +150,12 @@ in turn be used to build the final Rust.")
     (modules '((guix build utils)))
     (snippet '(begin (delete-file-recursively "src/llvm") #t))))
 
-(define-public rust-1.23
+(define-public rust-1.19
   (package
     (name "rust")
-    (version "1.23.0")
-    (source (rust-source version "14fb8vhjzsxlbi6yrn1r6fl5dlbdd1m92dn5zj5gmzfwf4w9ar3l"))
-    (build-system gnu-build-system)
-    (native-inputs
-     `(("bison" ,bison) ; For the tests
-       ("cmake" ,cmake)
-       ("flex" ,flex) ; For the tests
-       ("gdb" ,gdb)   ; For the tests
-       ("git" ,git)
-       ("procps" ,procps) ; For the tests
-       ("python-2" ,python-2)
-       ("rustc-bootstrap" ,rust-bootstrap)
-       ("cargo-bootstrap" ,rust-bootstrap "cargo")
-       ("pkg-config" ,pkg-config) ; For "cargo"
-       ("which" ,which)))
-    (inputs
-     `(("jemalloc" ,jemalloc-4.5.0)
-       ("llvm" ,llvm-3.9.1)
-       ("openssl" ,openssl)
-       ("libcurl" ,curl))) ; For "cargo"
-    (outputs '("out" "doc" "cargo"))
+    (version "1.19.0")
+    (source (rust-source version "0l8c14qsf42rmkqy92ahij4vf356dbyspxcips1aswpvad81y8qm"))
+    (outputs '("out" "cargo"))
     (arguments
      `(#:imported-modules ,%cargo-build-system-modules ;for `generate-checksums'
        #:phases
@@ -204,15 +186,6 @@ in turn be used to build the final Rust.")
                ;; <https://lists.gnu.org/archive/html/guix-devel/2017-06/msg00193.html>
                (delete-file-recursively "src/test/run-make/linker-output-non-utf8")
                #t)))
-         (add-after 'patch-tests 'fix-mtime-bug
-           (lambda* _
-             (substitute* "src/build_helper/lib.rs"
-               ;; Bug in Rust code.
-               ;; Current implementation assume that if dst not exist then it's mtime
-               ;; is 0, but in same time "src" have 0 mtime in guix build!
-               (("let threshold = mtime\\(dst\\);")
-                "if !dst.exists() {\nreturn false\n}\n let threshold = mtime(dst);"))
-             #t))
          (add-after 'patch-source-shebangs 'patch-cargo-checksums
            (lambda* _
              (substitute* "src/Cargo.lock"
@@ -230,20 +203,73 @@ in turn be used to build the final Rust.")
               (find-files "src/vendor" ".cargo-checksum.json"))
              #t))
          (replace 'configure
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (doc (assoc-ref outputs "doc"))
-                    (gcc (assoc-ref inputs "gcc"))
-                    (gdb (assoc-ref inputs "gdb"))
-                    (binutils (assoc-ref inputs "binutils"))
-                    (python (assoc-ref inputs "python-2"))
-                    (rustc (assoc-ref inputs "rustc-bootstrap"))
-                    (cargo (assoc-ref inputs "cargo-bootstrap"))
-                    (llvm (assoc-ref inputs "llvm"))
-                    (jemalloc (assoc-ref inputs "jemalloc")))
-               (call-with-output-file "config.toml"
-                 (lambda (port)
-                   (display (string-append "
+           (const #t))
+         (replace 'check
+           (const #t))
+         (replace 'install
+           (const #t)))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("bison" ,bison) ; For the tests
+       ("cmake" ,cmake)
+       ("flex" ,flex) ; For the tests
+       ("gdb" ,gdb)   ; For the tests
+       ("git" ,git)
+       ("procps" ,procps) ; For the tests
+       ("python-2" ,python-2)
+       ("rustc-bootstrap" ,rust-bootstrap)
+       ("cargo-bootstrap" ,rust-bootstrap "cargo")
+       ("pkg-config" ,pkg-config) ; For "cargo"
+       ("which" ,which)))
+    (inputs
+     `(("jemalloc" ,jemalloc-4.5.0)
+       ("llvm" ,llvm-3.9.1)
+       ("openssl" ,openssl)
+       ("libcurl" ,curl))) ; For "cargo"
+    ;; rustc invokes gcc, so we need to set its search paths accordingly.
+    (native-search-paths (package-native-search-paths gcc))
+    (synopsis "Compiler for the Rust progamming language")
+    (description "Rust is a systems programming language that provides memory
+safety and thread safety guarantees.")
+    (home-page "https://www.rust-lang.org")
+    ;; Dual licensed.
+    (license (list license:asl2.0 license:expat))))
+
+(define-public rust-1.23
+  (package
+    (inherit rust-1.19)
+    (name "rust")
+    (version "1.23.0")
+    (source (rust-source version "14fb8vhjzsxlbi6yrn1r6fl5dlbdd1m92dn5zj5gmzfwf4w9ar3l"))
+    (outputs '("out" "doc" "cargo"))
+    (arguments
+     (substitute-keyword-arguments (package-arguments rust-1.19)
+       ((#:phases phases)
+        `(modify-phases ,phases
+           (add-after 'patch-tests 'fix-mtime-bug
+             (lambda* _
+               (substitute* "src/build_helper/lib.rs"
+                 ;; Bug in Rust code.
+                 ;; Current implementation assume that if dst not exist then it's mtime
+                 ;; is 0, but in same time "src" have 0 mtime in guix build!
+                 (("let threshold = mtime\\(dst\\);")
+                  "if !dst.exists() {\nreturn false\n}\n let threshold = mtime(dst);"))
+               #t))
+           (replace 'configure
+             (lambda* (#:key inputs outputs #:allow-other-keys)
+               (let* ((out (assoc-ref outputs "out"))
+                      (doc (assoc-ref outputs "doc"))
+                      (gcc (assoc-ref inputs "gcc"))
+                      (gdb (assoc-ref inputs "gdb"))
+                      (binutils (assoc-ref inputs "binutils"))
+                      (python (assoc-ref inputs "python-2"))
+                      (rustc (assoc-ref inputs "rustc-bootstrap"))
+                      (cargo (assoc-ref inputs "cargo-bootstrap"))
+                      (llvm (assoc-ref inputs "llvm"))
+                      (jemalloc (assoc-ref inputs "jemalloc")))
+                 (call-with-output-file "config.toml"
+                   (lambda (port)
+                     (display (string-append "
 [llvm]
 [build]
 cargo = \"" cargo "/bin/cargo" "\"
@@ -308,15 +334,7 @@ jemalloc = \"" jemalloc "/lib/libjemalloc_pic.a" "\"
                (wrap-program (string-append out "/bin/rustc")
                  `("PATH" ":" prefix (,(string-append ld-wrapper "/bin")))
                  `("LIBRARY_PATH" ":" suffix (,(string-append libc "/lib"))))
-               #t))))))
-    ;; rustc invokes gcc, so we need to set its search paths accordingly.
-    (native-search-paths (package-native-search-paths gcc))
-    (synopsis "Compiler for the Rust progamming language")
-    (description "Rust is a systems programming language that provides memory
-safety and thread safety guarantees.")
-    (home-page "https://www.rust-lang.org")
-    ;; Dual licensed.
-    (license (list license:asl2.0 license:expat))))
+               #t)))))))))
 
 (define-public rust
   (let ((base-rust rust-1.23))

  reply	other threads:[~2018-04-02 17:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-02 17:17 [bug#31026] [PATCH 0/2] Split off rust@1.19.0 Danny Milosavljevic
2018-04-02 17:24 ` Danny Milosavljevic [this message]
2018-04-02 17:24   ` [bug#31026] [PATCH 2/2] gnu: Factorize rust-bootstrapped-package Danny Milosavljevic
2018-04-02 18:19 ` [bug#31026] [PATCH 0/2] Split off rust@1.19.0 Nils Gillmann
2018-04-02 19:20   ` Danny Milosavljevic
2018-04-03 11:10     ` Nils Gillmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180402172409.13230-1-dannym@scratchpost.org \
    --to=dannym@scratchpost.org \
    --cc=31026@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.