projects/guix·blob javascript-team · refs

106 lines · 4.5 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013, 2014, 2020 Ludovic Courtès <[email protected]>
3;;; Copyright © 2021 Maxime Devos <[email protected]>
4;;; Copyright © 2022 LuHui <[email protected]>
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages libdaemon)
22 #:use-module (gnu packages autotools)
23 #:use-module (guix licenses)
24 #:use-module (guix packages)
25 #:use-module (guix utils)
26 #:use-module (guix download)
27 #:use-module (guix build-system gnu))
28
29(define-public libdaemon
30 (package
31 (name "libdaemon")
32 (version "0.14")
33 (source (origin
34 (method url-fetch)
35 (uri (list
36 (string-append
37 "mirror://debian/pool/main/libd/libdaemon/libdaemon_"
38 version ".orig.tar.gz")
39 "http://pkgs.fedoraproject.org/repo/pkgs/libdaemon/libdaemon-0.14.tar.gz/509dc27107c21bcd9fbf2f95f5669563/libdaemon-0.14.tar.gz"
40
41 ;; This used to be the canonical URL but it vanished.
42 ;; See <http://bugs.gnu.org/18639>.
43 ;; (string-append
44 ;; "http://0pointer.de/lennart/projects/libdaemon/libdaemon-"
45 ;; version ".tar.gz")
46 ))
47 (sha256
48 (base32
49 "0d5qlq5ab95wh1xc87rqrh1vx6i8lddka1w3f1zcqvcqdxgyn8zx"))
50 (file-name (string-append name "-" version ".tar.gz"))))
51 (build-system gnu-build-system)
52 (native-inputs
53 (if (or (and=> (%current-target-system) target-aarch64?)
54 (and=> (%current-target-system) target-riscv64?))
55 `(("config" ,config)) ; for config.sub
56 '()))
57 (arguments
58 `(,@(if (%current-target-system)
59 ;; The 'setpgrp' test cannot provide an answer when cross-compiling,
60 ;; so provide the right one for glibc.
61 `(#:configure-flags (list "ac_cv_func_setpgrp_void=yes"
62
63 ;; TODO: Move this globally on the next
64 ;; rebuild cycle.
65 ;; Set a valid localstatedir for the
66 ;; benefit of the default
67 ;; 'daemon_pid_file_proc', used by the
68 ;; Hurd's console client.
69 "--localstatedir=/var"))
70 '())
71 ,@(if (or (and=> (%current-target-system) target-aarch64?)
72 (and=> (%current-target-system) target-riscv64?))
73 `(#:phases
74 (modify-phases %standard-phases
75 (add-before 'configure 'update-config.sub
76 (lambda _
77 ;; Replace outdated config.sub such that aarch64
78 ;; will be recognised as an architecture.
79 (delete-file "config.sub")
80 (symlink (which "config.sub") "config.sub")))))
81 '())))
82 ;; XXX: Stale URL, missing replacement. See <http://bugs.gnu.org/18639>.
83 (home-page "https://0pointer.de/lennart/projects/libdaemon/")
84
85 (synopsis "Lightweight C library that eases the writing of UNIX daemons")
86 (description
87 "Libdaemon is a lightweight C library that eases the writing of UNIX
88daemons. It consists of the following parts:
89
90 • A wrapper around fork() which does the correct daemonization procedure of
91 a process
92
93 • A wrapper around syslog() for simpler and compatible log output to Syslog
94 or STDERR
95
96 • An API for writing PID files
97
98 • An API for serializing UNIX signals into a pipe for usage with select() or
99 poll()
100
101 • An API for running subprocesses with STDOUT and STDERR redirected to
102 syslog.
103
104APIs like these are used in most daemon software available. It is not that
105simple to get it done right and code duplication is not a goal.")
106 (license lgpl2.1+)))