help-debbugs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Migrating to the latest Debbugs version


From: Felix Lechner
Subject: Re: Migrating to the latest Debbugs version
Date: Mon, 15 Jan 2024 11:07:16 -0800

On Mon, Jan 15 2024, Felix Lechner via "General discussion for the tracker at 
debbugs.gnu.org" wrote:

> For your perusal, I attached the current packaging for debbugs-gnu
> below.

Sorry, here it is, for the latest upstream version:

* * *

(define-public debbugs-gnu-experimental/juix
  (let ((commit "8beaa7ffcf5e07dd814689c28ce8ce060036d532")
        (revision "0"))
    (package
      (name "debbugs")
      (version (git-version "0.0" revision commit))
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://codeberg.org/lechner/debbugs-gnu";)
                      (commit commit)))
                (file-name (git-file-name name version))
                (sha256
                 (base32
                  "1l7735qcws136sk36akhx1dyfrgpzh1hy5j2cczciydwqb1bf597"))))
      (build-system copy-build-system)
      (arguments
       (list
        #:phases
        #~(modify-phases %standard-phases
            (add-after 'install 'fix-paths
              (lambda _
                (let ((inetutils #$(this-package-input "inetutils"))
                      (lib-perl (string-append #$output "/lib/perl")))
                  (substitute* (string-append lib-perl "/Debbugs/Config.pm")
                    (("hostname --fqdn") (string-append inetutils 
"/bin/hostname --fqdn"))
                    (("/usr/share/debbugs/templates") (string-append #$output 
"/share/templates"))))
                (let ((cgi (string-append #$output "/cgi")))
                  ;; enable command-line debugging
                  (substitute* (string-append cgi "/bugreport.cgi")
                    (("use CGI::Simple;") "use 
CGI::Simple;\n$CGI::Simple::DEBUG = 1;")))))
            (add-after 'fix-paths 'wrap-executables
              (lambda* (#:key inputs #:allow-other-keys)
                (let* ((cgi (string-append #$output "/cgi"))
                       (basenames (scandir cgi (lambda (name)
                                                 (string-match "[.]cgi$" 
name))))
                       (scripts (map (lambda (name)
                                       (string-append cgi "/" name))
                                     basenames)))
                  (for-each
                   (lambda (script)
                     ;; turn on debugging output
                     (substitute* script (("use strict;")
                                          "use strict;\n\nuse Carp 'verbose';\n
$SIG{ __DIE__ } = sub { Carp::confess( @_ ) };")))
                   scripts)
                  (for-each
                   (lambda (script)
                     ;; PERL5LIB is ignored in tainted mode
                     (substitute* script (("use strict;")
                                          "use strict;\n\nuse lib 
$ENV{PERL5LIB} =~ /[^:]+/g;")))
                   scripts)

                  (use-modules (ice-9 popen)
                               (ice-9 textual-ports)
                               (srfi srfi-1))

                  (define (perl-version perl-executable)
                    (let* ((input-pipe (open-pipe* OPEN_READ perl-executable 
"-e" "print $^V"))
                           (version-output (get-string-all input-pipe)))
                      (close-pipe input-pipe)
                      (string-delete #\v version-output)))

                  (define* (perl-site-libs store-folders #:key perl)
                    (let* ((version (perl-version perl))
                           (lib-site-perl (string-append 
"/lib/perl5/site_perl/" version)))
                      (append-map
                       (lambda (folder)
                         (let* ((candidate (string-append folder 
lib-site-perl)))
                           (if (file-exists? candidate)
                               (list candidate)
                               '())))
                       store-folders)))

                  (let* ((perl-executable (string-append #$(this-package-input 
"perl") "/bin/perl"))
                         (without-source (filter
                                          (lambda (input)
                                            (not (string=? "source" (car 
input))))
                                          inputs))
                         (store-folders (map cdr without-source))
                         (site-libs (perl-site-libs store-folders #:perl 
perl-executable))
                         (package-lib-perl (string-append #$output "/lib/perl"))
                         (variable-specs `(("PERL5LIB" prefix
                                            (,package-lib-perl ,@site-libs)))))
                    (for-each
                     (lambda (script)
                       (apply wrap-program script #:sh (which "bash") 
variable-specs))
                     scripts))))))
        #:modules '((ice-9 ftw)
                    (ice-9 regex)
                    (guix build utils)
                    (guix build copy-build-system))
        #:install-plan
        #~'(("lib/" "lib/perl/")
            ("html" "share/")
            ("templates" "share/")
            ("cgi/" "cgi"))))
      (inputs (list
                                        ; for wrap-program
               bash
               inetutils
               perl
               perl-b-hooks-endofscope
               perl-cgi-simple
               perl-class-accessor-grouped
               perl-class-c3-componentised
               perl-class-data-inheritable
               perl-class-inspector
               perl-class-singleton
               perl-clone-choose
               perl-data-dumper
               perl-data-messagepack
               perl-datetime
               perl-datetime-format-builder
               perl-datetime-format-pg
               perl-datetime-format-strptime
               perl-datetime-locale
               perl-datetime-timezone
               perl-dbix-class
               perl-dbix-class-dynamicdefault
               perl-dbix-class-timestamp
               perl-devel-globaldestruction
               perl-devel-stacktrace
               perl-exception-class
               perl-exporter-tiny
               perl-eval-closure
               perl-file-sharedir
               perl-hash-merge
               perl-html-parser
               perl-io-stringy
               perl-list-allutils
               perl-list-moreutils
               perl-mail-message
               perl-mailtools
               perl-mime-tools
               perl-mldbm
               perl-module-find
               perl-module-implementation
               perl-module-runtime
               perl-mouse
               perl-mousex-nativetraits
               perl-mro-compat
               perl-namespace-autoclean
               perl-namespace-clean
               perl-package-stash
               perl-params-validate
               perl-params-validationcompiler
               perl-role-tiny-2
               perl-safe-hole
               perl-search-estraier
               perl-soap-lite
               perl-specio
               perl-sql-abstract-classic
               perl-storable
               perl-strictures-2
               perl-sub-exporter-progressive
               perl-sub-identify
               perl-sub-name
               perl-sub-quote
               perl-text-iconv
               perl-text-template
               perl-text-xslate
               perl-timedate
               perl-try-tiny
               perl-uri
               perl-variable-magic))
      (home-page "https://codeberg.org/lechner/debbugs-gnu";)
      (synopsis "Debian has a bug tracking system which files details of
bugs reported by users and developers. Each bug is given a number, and is
kept on file until it is marked as having been dealt with. The system is
mainly controlled by e-mail, but the bug reports can be viewed using the
WWW.

This is the version used by the GNU Project.")
      (description
       "Debian's bug tracking system as used by the GNU Project.")
      (license license:gpl2+))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]