Paste number 333536: title

Paste number 333536: title
Pasted by: user
When:4 years, 11 months ago
Share:Tweet this! | http://paste.lisp.org/+75CW
Channel:None
Paste contents:
Raw Source | XML | Display As
(define-module (gnu packages syncthing)
  #:use-module (guix build-system gnu)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix licenses)
  #:use-module (gnu packages golang))

  (define-public syncthing
    (package
      (name "syncthing")
      (version "0.14.13")
      (source (origin
                (method url-fetch)
                (uri (string-append "https://github.com/syncthing/syncthing"
                                    "/releases/download/v" version
                                    "/syncthing-source-v" version ".tar.gz"))
                (sha256
                 (base32 "0zf648887c640gqg1kyldjn5nxxg0ldamxzs40ck8bxsy9rh26gi"))))
      (build-system gnu-build-system)
      (native-inputs
       `(("go" ,go)))
      (inputs
       `(("github-com-sasha-s-go-deadlock", github-com-sasha-s-go-deadlock)))
      (arguments
       `(#:phases
         (modify-phases %standard-phases
           (delete 'configure)
           
           (replace 'unpack
             (lambda* (#:key source #:allow-other-keys)
               (let ((bin "bin")
                     (pkg "pkg")
                     (src "src/github.com/syncthing"))
                 (mkdir-p bin)
                 (mkdir-p pkg)
                 (and (mkdir-p src)
                      (with-directory-excursion src
                        (zero? (system* "tar" "xvf" source))))
                 (delete-file-recursively "src/github.com/syncthing/syncthing/vendor/github.com/sasha-s"))))

           (add-after 'unpack 'set-env
             (lambda* (#:key inputs #:allow-other-keys)
               (setenv "GOPATH" (string-append (getcwd)
                                               ;; Do this in a loop?
                                               ":" (assoc-ref inputs "github-com-sasha-s-go-deadlock")))
               #t))
           
           (replace 'build
             (lambda _
               (with-directory-excursion "src/github.com/syncthing/syncthing"
                 (zero? (system* "go" "run" "build.go" "install" "syncthing" "-no-upgrade")))))

           (delete 'check)

           (replace 'install
             (lambda _
                 (copy-recursively "bin" (string-append (assoc-ref %outputs "out")
                                                        "/bin"))
                 (copy-recursively "pkg" (string-append (assoc-ref %outputs "out")
                                                        "/pkg"))
                 (copy-recursively "src" (string-append (assoc-ref %outputs "out")
                                                        "/src")))))))

      (synopsis "")
      (description "")
      (home-page "")
      (license gpl3+)))

  (define-public github-com-sasha-s-go-deadlock
    (package
      (name "github-com-sasha-s-go-deadlock")
      (version "09aefc")
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/sasha-s/go-deadlock")
                      (commit "09aefc0ac06ad74d91ca31acdb11fc981c159149")))
                (file-name (string-append name "-" version "-checkout"))
                (sha256
                 (base32 "193cdmd6vrnl6vdv6pr3671cpl1nwapdawqs462xmqkf16mggjfz"))))
      (build-system gnu-build-system)
      (native-inputs
       `(("go" ,go)))
      (arguments
       `(#:phases
         (modify-phases %standard-phases
           (delete 'configure)

           (replace 'unpack
             (lambda* (#:key source #:allow-other-keys)
               (let ((bin "bin")
                     (pkg "pkg")
                     (src "src/github.com/sasha-s/go-deadlock"))
                 (mkdir-p bin)
                 (mkdir-p pkg)
                 (copy-recursively source src))))
           
           (add-after 'unpack 'set-env
             (lambda _
               (setenv "GOPATH" (string-append (getcwd)))
               #t))
           
           (replace 'build
             (lambda _
               (zero? (system* "go" "install" "github.com/sasha-s/go-deadlock"))))

           (delete 'check)
           
           (replace 'install
             (lambda _
                 (copy-recursively "bin" (string-append (assoc-ref %outputs "out")
                                                        "/bin"))
                 (copy-recursively "pkg" (string-append (assoc-ref %outputs "out")
                                                        "/pkg"))
                 (copy-recursively "src" (string-append (assoc-ref %outputs "out")
                                                        "/src")))))))

      (synopsis "")
      (description "")
      (home-page "")
      (license gpl3+)))

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.