unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
blob 95bb78106fb0fa84fdfb03ecfb0c9da84dcd486d 8742 bytes (raw)
name: gnu/packages/pastebin.scm 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
 
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 ng0 <ng0@we.make.ritual.n0.is>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages pastebin)
  #:use-module (gnu packages)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages certs)
  #:use-module (gnu packages curl)
  #:use-module (gnu packages libidn)
  #:use-module (gnu packages llvm)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages tup)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages python)
  #:use-module (gnu packages web)
  #:use-module (gnu packages zsh)
  #:use-module (guix build-system gnu)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages))

;; We use this git checkout because it applies fixes needed to build
;; pbpst on Guix, essential additions to the used build system.
(define-public pbpst
  (let ((revision "2")
        (commit "4aeb782cdd05251a902af427ce942f3b8a866188"))
    (package
      (name "pbpst")
      (version (string-append "1.2.0-" revision "." (string-take commit 7)))
      (source (origin
                ;; (method url-fetch)
                ;; (uri (string-append "https://github.com/HalosGhost/"
                ;;                    name "/archive/v" version ".tar.gz"))
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/HalosGhost/pbpst")
                      (commit commit)))
                (file-name (string-append name "-" version "-checkout"))
                (sha256
                 (base32
                  "1w0js3z5xk4l1inxvh49w6ydahz33r7vn2mziziihn9h5qfadlhs"))))
      (build-system gnu-build-system)
      ;; XXX: "make simple" runs "make gen dist @./make.sh". make.sh is generated
      ;; by the primary build system, which is tup based. we can not use the
      ;; full tup build system as it requires to load FUSE. "make gen" runs
      ;; `tup generate make.sh' which is a new file, we need to apply some
      ;; Guix specific patching before we can continue. We therefore remove
      ;; "@./make.sh" from the "make simple" and run it manually, this way we can
      ;; patch make.sh before running it.
      (arguments
       `(#:make-flags (list
                       (string-append "PREFIX=" (assoc-ref %outputs "out"))
                       "simple")
         #:tests? #f
         #:phases
         (modify-phases %standard-phases
           (replace 'configure
             (lambda _
               (substitute* "Makefile"
                 (("@./make.sh") "")
                 ;; XXX: Because this is a drop-in replacement build system, there are
                 ;; some unexplainable special behaviors introduced. One of them is that
                 ;; building pbpst binary out to ../dist/pbpst fails, but inside cwd
                 ;; "src/" succeeds. I blame dark matter. Fix this if you feel the
                 ;; desire for a headache.
                 (("dist/\\$\\(PROGNM\\)") "src/$(PROGNM)")
                 (("src/\\$\\(PROGNM\\)\\.1") "dist/$(PROGNM).1"))
               (substitute* "Tuprules.tup"
                 (("`git describe --long --tags`") ,version))))
               ;;(setenv "SSL_CERT_FILE" "/dev/null"))) ; I have no idea.
               ;;(setenv "SSL_CERT_DIR" "/etc/ssl/certs")
               ;;(setenv "SSL_CERT_FILE" "/etc/ssl/certs/ca-certificates.crt")))
           (add-after 'build 'make-it
             (lambda _
               (patch-shebang "make.sh")
               (substitute* "make.sh"
                 (("clang -g -O3 -fPIE -pie -Weverything -Werror -std=c11 -ggdb -D_FORTIFY_SOURCE=2 -fstack-protector-strong -march=native --param=ssp-buffer-size=1 -Wl,-z,relro,-z,now -fsanitize=undefined -fsanitize-trap=undefined `pkg-config --libs-only-l libcurl jansson` callback.c main.c pb.c pbpst_db.c -o ../dist/pbpst")
                  "clang -v -g -O3 -fPIE -pie -Weverything -Werror -std=c11 -ggdb -D_FORTIFY_SOURCE=2 -fstack-protector-strong -march=native --param=ssp-buffer-size=1 -Wl,-z,relro,-z,now -fsanitize=undefined -fsanitize-trap=undefined `pkg-config --libs-only-l libcurl jansson` callback.c main.c pb.c pbpst_db.c -o pbpst"))
                 ;; (("gcc -g -O3 -fPIE -pie -Weverything -Werror -std=c11 -ggdb -D_FORTIFY_SOURCE=2 -fstack-protector-strong -march=native --param=ssp-buffer-size=1 -Wl,-z,relro,-z,now -fsanitize=undefined -fsanitize-trap=undefined `pkg-config --libs-only-l libcurl jansson` callback.c main.c pb.c pbpst_db.c -o ../dist/pbpst")
                 ;;  "gcc -v -g -O3 -fPIE -pie -Werror -std=c11 -ggdb -D_FORTIFY_SOURCE=2 -fstack-protector-strong -march=native --param=ssp-buffer-size=1 -Wl,-z,relro,-z,now -fsanitize=undefined `pkg-config --libs-only-l libcurl jansson` callback.c main.c pb.c pbpst_db.c -o pbpst"))
;;                 (("cp bash ../dist/bash")
;;                  "cp bash ../dist/bash
               ;;cd '..'"))
               (zero? (system* "bash" "make.sh")))))))
      ;; the above fails, the one below was used with the 2.1.0 release ball:
      ;; (replace 'build
      ;;   (lambda _
      ;;     (zero? (system* "make" "simple"))
      ;;     (patch-shebang "make.sh")
      ;;     (substitute* "make.sh"
      ;;       (("`git describe --tags`") ,version))
      ;;     (zero? (system* "bash" "make.sh"))))
      ;; ;; (mkdir-p (string-append out "/dist"))
      ;; (mkdir-p "dist")
      ;; (chdir "src")
      ;; (zero? (system* "clang" "-g" "-O3" "-fPIE" "-pie" "-Weverything"
      ;;                 "-Werror" "-std=c11" "-ggdb" "-D_FORTIFY_SOURCE=2"
      ;;                 "-fstack-protector-strong" "-march=native"
      ;;                 "--param=ssp-buffer-size=1" "-Wl,-z,relro,-z,now"
      ;;                 "-fsanitize=undefined" "-fsanitize-trap=undefined"
      ;;                 "pkg-config" "--libs-only-l" "libcurl" "jansson"
      ;;                 "callback.c" "main.c" "pb.c" "pbpst_db.c"
      ;;                 "-o ../dist/pbpst"))
      ;; (chdir "../cmp")
      ;; (copy-file "zsh" "../dist/zsh")
      ;; (copy-file "bash" "../dist/bash")
      ;; (chdir "../doc")
      ;; (system* "sphinx-build" "-b man" "-Dversion=`git describe --tags`"
      ;;          "-d doctree" "-E . ../dist pbpst.rst pbpst_db.rst")
      ;; (delete-file-recursively "doctree"))))
      (inputs
       `(("curl" ,curl)
         ("jansson" ,jansson)
         ("openssl" ,openssl)
         ("libidn" ,libidn)
         ;;("gnutls" ,gnutls)
         ;;("nss-certs" ,nss-certs)
         ("zsh" ,zsh) ; zsh completions
         ("bash" ,bash))) ; bash completions
      (native-inputs
       `(("clang" ,clang)
         ("clang-runtime" ,clang-runtime)
         ("tup" ,tup)
         ("pkg-config" ,pkg-config)
         ("python" ,python)
         ("python-sphinx" ,python-sphinx)))
      (outputs '("out" "debug"))
      ;; (native-search-paths
      ;;  ;; FIXME: These two variables must designate a single file or directory
      ;;  ;; and are not actually "search paths."  In practice it works OK in
      ;;  ;; user profiles because there's always just one item that matches the
      ;;  ;; specification.
      ;;  (list (search-path-specification
      ;;         (variable "SSL_CERT_DIR")
      ;;         (files '("etc/ssl/certs")))
      ;;        (search-path-specification
      ;;         (variable "SSL_CERT_FILE")
      ;;         (files '("etc/ssl/certs/ca-certificates.crt")))))
      (synopsis "Command-line libcurl C client for pb deployments")
      (description
       "pbpst is a small tool to make interacting with pb instances as simple as
possible.  pb is a versatile, free and open source pastebin which has more
 features, is more robust, and is faster than any other pastebin with which I
 am familiar.  You can find the reference instance (which tracks pb's master
 branch) at ptpb. Ideally, pbpst will support as many features of pb as
 possible (hopefully, nearly all) in a simple, unassuming CLI.")
      (home-page "https://github.com/HalosGhost/pbpst/")
      (license license:gpl2))))

debug log:

solving 95bb781 ...
found 95bb781 in https://yhetil.org/guix-devel/87y43ksj47.fsf@we.make.ritual.n0.is/

applying [1/1] https://yhetil.org/guix-devel/87y43ksj47.fsf@we.make.ritual.n0.is/
diff --git a/gnu/packages/pastebin.scm b/gnu/packages/pastebin.scm
new file mode 100644
index 0000000..95bb781

Checking patch gnu/packages/pastebin.scm...
Applied patch gnu/packages/pastebin.scm cleanly.

index at:
100644 95bb78106fb0fa84fdfb03ecfb0c9da84dcd486d	gnu/packages/pastebin.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).