Remove additional rustc

Julien LepillerTue Dec 12 22:48:40+0100 2017

64af23f

Remove additional rustc

more/packages/gnuzilla.scm

7676
                 ((#:configure-flags flags)
7777
                  `(cons* "--enable-skia" ,flags))))))
7878
79-
;; FIXME: Needs to be parsed from url not package name.
80-
(define (package-name->crate-name name)
81-
  "Return the crate name of NAME."
82-
  (match (string-split name #\-)
83-
    (("rust" rest ...)
84-
     (string-join rest "-"))
85-
    (_ #f)))
86-
87-
(define* (replace-cargo-toml #:key inputs cargo-toml #:allow-other-keys)
88-
  "Replace Cargo.toml [dependencies] section with guix inputs."
89-
  ;; Make sure Cargo.toml is writeable when the crate uses git-fetch.
90-
  (chmod cargo-toml #o644)
91-
  (substitute* cargo-toml
92-
    ((".*32-sys.*") "
93-
")
94-
    ((".*winapi.*") "
95-
")
96-
    ((".*core-foundation.*") "
97-
"))
98-
  ;; Prepare one new directory with all the required dependencies.
99-
  ;; It's necessary to do this (instead of just using /gnu/store as the
100-
  ;; directory) because we want to hide the libraries in subdirectories
101-
  ;;   share/rust-source/... instead of polluting the user's profile root.
102-
  (mkdir "vendor")
103-
  (for-each
104-
    (match-lambda
105-
      ((name . path)
106-
       (let ((crate (package-name->crate-name name)))
107-
         (when (and crate path)
108-
           (match (string-split (basename path) #\-)
109-
             ((_ ... version)
110-
              (symlink (string-append path "/share/rust-source")
111-
                       (string-append "vendor/" (basename path)))))))))
112-
    inputs)
113-
  ;; Configure cargo to actually use this new directory.
114-
  (mkdir-p ".cargo")
115-
  (let ((port (open-file ".cargo/config" "w" #:encoding "utf-8")))
116-
    (display "
117-
[scrates-io]
118-
re = 'https://github.com/rust-lang/crates.io-index'
119-
rewith = 'vendored-sources'
120-
121-
[svendored-sources]
122-
diy = '" port)
123-
    (display (getcwd) port)
124-
    (display "/vendor" port)
125-
    (display "'
126-
" 
127-
    (close-port port)))
128-
  (setenv "CC" (string-append (assoc-ref inputs "gcc") "/bin/gcc"))
129-
130-
  ;(setenv "CARGO_HOME" "/gnu/store")
131-
  ; (setenv "CMAKE_C_COMPILER" cc)
132-
  #t)
133-
134-
(define-public rust-for-mozilla
135-
  (package
136-
    (inherit rustc)
137-
    (arguments
138-
     (substitute-keyword-arguments (package-arguments rustc)
139-
       ((#:phases phases)
140-
        `(modify-phases ,phases
141-
           (replace 'check
142-
             (lambda _
143-
               #t))))))))
144-
145-
(define-public cargo-for-mozilla
146-
  (package
147-
    (inherit cargo)
148-
    (arguments
149-
     `(#:rustc ,rust-for-mozilla
150-
       ,@(package-arguments cargo)))))
151-
152-
(define-public rustc-1.17
153-
  (package
154-
    (inherit rust-for-mozilla)
155-
    (version "1.17.0")
156-
    (source (origin
157-
              (method url-fetch)
158-
              (uri (string-append
159-
                    "https://static.rust-lang.org/dist/"
160-
                    "rustc-" version "-src.tar.gz"))
161-
              (sha256
162-
               (base32
163-
                "11sg2y38x2psvc1gvhcd10fcszih2sljhnnfyqnlkwkmbf4s7asb"))
164-
            (modules '((guix build utils)))
165-
            (snippet
166-
             `(begin
167-
                (delete-file-recursively "src/llvm")
168-
                #t))))
169-
    (native-inputs
170-
     `(("bison" ,bison) ; For the tests
171-
       ("cmake" ,cmake)
172-
       ("flex" ,flex) ; For the tests
173-
       ("git" ,git)
174-
       ("procps" ,procps) ; For the tests
175-
       ("python-2" ,python-2)
176-
       ("rustc-bootstrap" ,rust-for-mozilla)
177-
       ("cargo" ,cargo-for-mozilla)
178-
       ("curl" ,curl)
179-
       ("which" ,which)))
180-
    (arguments
181-
     (substitute-keyword-arguments (package-arguments rustc)
182-
       ((#:phases phases)
183-
        `(modify-phases ,phases
184-
           (replace 'configure
185-
             (lambda* (#:key inputs outputs #:allow-other-keys)
186-
               (let* ((out (assoc-ref outputs "out"))
187-
                      (gcc (assoc-ref inputs "gcc"))
188-
                      (binutils (assoc-ref inputs "binutils"))
189-
                      (python (assoc-ref inputs "python-2"))
190-
                      (rustc (assoc-ref inputs "rustc-bootstrap"))
191-
                      (llvm (assoc-ref inputs "llvm"))
192-
                      (jemalloc (assoc-ref inputs "jemalloc"))
193-
                      (flags (list
194-
                              (string-append "--prefix=" out)
195-
                              (string-append "--datadir=" out "/share")
196-
                              (string-append "--infodir=" out "/share/info")
197-
                              (string-append "--default-linker=" gcc "/bin/gcc")
198-
                              (string-append "--default-ar=" binutils "/bin/ar")
199-
                              (string-append "--python=" python "/bin/python2")
200-
                              (string-append "--local-rust-root=" rustc)
201-
                              (string-append "--llvm-root=" llvm)
202-
                              (string-append "--jemalloc-root=" jemalloc "/lib")
203-
                              "--release-channel=stable"
204-
                              "--enable-rpath"
205-
                              "--enable-local-rust"
206-
                              "--disable-manage-submodules")))
207-
                 (substitute* "src/bootstrap/bootstrap.py"
208-
                   (("self.get_toml\\('cargo'\\)") 
209-
                    (string-append "\"" (assoc-ref inputs "cargo") "/bin/cargo\"")))
210-
                 ;; Rust uses a custom configure script (no autoconf).
211-
                 (zero? (apply system* "./configure" flags)))))
212-
           (delete 'patch-configure)))))))
213-
214-
(define-public rustc-1.18
215-
  (package
216-
    (inherit rustc-1.17)
217-
    (version "1.18.0")
218-
    (source (origin
219-
              (method url-fetch)
220-
              (uri (string-append
221-
                    "https://static.rust-lang.org/dist/"
222-
                    "rustc-" version "-src.tar.gz"))
223-
              (sha256
224-
               (base32
225-
                "11sg2y38x2psvc1gvhcd10fcszih2sljhnnfyqnlkwkmbf4s7asb"))
226-
            (modules '((guix build utils)))
227-
            (snippet
228-
             `(begin
229-
                (delete-file-recursively "src/llvm")
230-
                #t))))
231-
    (native-inputs
232-
     `(("bison" ,bison) ; For the tests
233-
       ("cmake" ,cmake)
234-
       ("flex" ,flex) ; For the tests
235-
       ("git" ,git)
236-
       ("procps" ,procps) ; For the tests
237-
       ("python-2" ,python-2)
238-
       ("rustc-bootstrap" ,rustc-1.17)
239-
       ("which" ,which)))))
240-
241-
(define-public rustc-1.19
242-
  (package
243-
    (inherit rustc-1.18)
244-
    (version "1.19.0")
245-
    (source (origin
246-
              (method url-fetch)
247-
              (uri (string-append
248-
                    "https://static.rust-lang.org/dist/"
249-
                    "rustc-" version "-src.tar.gz"))
250-
              (sha256
251-
               (base32
252-
                "11sg2y38x2psvc1gvhcd10fcszih2sljhnnfyqnlkwkmbf4s7asb"))
253-
            (modules '((guix build utils)))
254-
            (snippet
255-
             `(begin
256-
                (delete-file-recursively "src/llvm")
257-
                #t))))
258-
    (native-inputs
259-
     `(("bison" ,bison) ; For the tests
260-
       ("cmake" ,cmake)
261-
       ("flex" ,flex) ; For the tests
262-
       ("git" ,git)
263-
       ("procps" ,procps) ; For the tests
264-
       ("python-2" ,python-2)
265-
       ("rust-bootstrap" ,rustc-1.18)
266-
       ("which" ,which)))))
267-
268-
(define-public rustc-1.20
269-
  (package
270-
    (inherit rustc-1.19)
271-
    (version "1.20.0")
272-
    (source (origin
273-
              (method url-fetch)
274-
              (uri (string-append
275-
                    "https://static.rust-lang.org/dist/"
276-
                    "rustc-" version "-src.tar.gz"))
277-
              (sha256
278-
               (base32
279-
                "11sg2y38x2psvc1gvhcd10fcszih2sljhnnfyqnlkwkmbf4s7asb"))
280-
            (modules '((guix build utils)))
281-
            (snippet
282-
             `(begin
283-
                (delete-file-recursively "src/llvm")
284-
                #t))))
285-
    (native-inputs
286-
     `(("bison" ,bison) ; For the tests
287-
       ("cmake" ,cmake)
288-
       ("flex" ,flex) ; For the tests
289-
       ("git" ,git)
290-
       ("procps" ,procps) ; For the tests
291-
       ("python-2" ,python-2)
292-
       ("rustc-bootstrap" ,rustc-1.19)
293-
       ("which" ,which)))))
294-
295-
(define-public rustc-1.21
296-
  (package
297-
    (inherit rustc-1.20)
298-
    (version "1.21.0")
299-
    (source (origin
300-
              (method url-fetch)
301-
              (uri (string-append
302-
                    "https://static.rust-lang.org/dist/"
303-
                    "rustc-" version "-src.tar.gz"))
304-
              (sha256
305-
               (base32
306-
                "11sg2y38x2psvc1gvhcd10fcszih2sljhnnfyqnlkwkmbf4s7asb"))
307-
            (modules '((guix build utils)))
308-
            (snippet
309-
             `(begin
310-
                (delete-file-recursively "src/llvm")
311-
                #t))))
312-
    (native-inputs
313-
     `(("bison" ,bison) ; For the tests
314-
       ("cmake" ,cmake)
315-
       ("flex" ,flex) ; For the tests
316-
       ("git" ,git)
317-
       ("procps" ,procps) ; For the tests
318-
       ("python-2" ,python-2)
319-
       ("rustc-bootstrap" ,rustc-1.20)
320-
       ("which" ,which)))))
321-
32279
(define-public firefox
32380
  (package
32481
    (name "firefox")

479236
       ("pkg-config" ,pkg-config)
480237
       ("autoconf" ,autoconf-2.13)
481238
       ("which" ,which)
482-
       ("rust" ,rustc-1.21)))
239+
       ("rust" ,rustc)))
483240
    (home-page "https://mozilla.org")
484241
    (synopsis "Web browser")
485242
    (description "")