code:
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
;;;
;;; 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 lesstif)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages xorg))

(define-public lesstif
  (package
    (name "lesstif")
    (version "0.95.2")
    (source
      (origin
        (method url-fetch)
        (uri (string-append
               "mirror://sourceforge/lesstif/lesstif/" version
               "/lesstif-" version ".tar.bz2"))
        (sha256
          (base32
            "1qzpxjjf7ri1jzv71mvq5m9g8hfaj5yzwp30rwxlm6n2b24a6jpb"))))
    (build-system gnu-build-system)
    (propagated-inputs
     `(("printproto" ,printproto)))
    (inputs
      `(("libxext" ,libxext)
        ("libxt" ,libxt)))
    (home-page "http://lesstif.sourceforge.net/")
    (synopsis "Clone of the Motif toolkit for the X window system")
    (description "Clone of the Motif toolkit for the X window system.")
    (license license:gpl2+))) ; some files are lgpl2.1+ or x11


code:
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
;;;
;;; 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 libbsd)
  #:use-module (guix build-system gnu)
  #:use-module (guix download)
  #:use-module (guix licenses)
  #:use-module (guix packages))

(define-public libbsd
  (package
    (name "libbsd")
    (version "0.10.0")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://libbsd.freedesktop.org/releases/"
                                  "libbsd-" version ".tar.xz"))
              (sha256
               (base32
                "11x8q45jvjvf2dvgclds64mscyg10lva33qinf2hwgc84v3svf1l"))))
    (build-system gnu-build-system)
    (arguments
     '(#:configure-flags '("--disable-static")))
    (synopsis "Utility functions from BSD systems")
    (description "This library provides useful functions commonly found on BSD
systems, and lacking on others like GNU systems, thus making it easier to port
projects with strong BSD origins, without needing to embed the same code over
and over again on each project.")
    (home-page "https://libbsd.freedesktop.org/wiki/")
    ;; This package is a collection of third-party functions that were
    ;; originally released under various non-copyleft licenses.
    (license (list bsd-2 bsd-3 bsd-4 expat isc public-domain
                   (non-copyleft "file://COPYING"
                                 "See COPYING in the distribution.")))))

repo_name: maximed/guix

license: mit


code:
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2014, 2015, 2019 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Fabian Harfert <fhmgufs@web.de>
;;; Copyright © 2017, 2018 Nikita <nikita@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 libcanberra)
  #:use-module ((guix licenses)
                #:select (lgpl2.1+ gpl2 gpl2+ cc-by-sa4.0 cc-by3.0))
  #:use-module (gnu packages)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system python)
  #:use-module (guix utils)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages gstreamer)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages pulseaudio)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages python)
  #:use-module (gnu packages xiph)
  #:use-module ((srfi srfi-1) #:select (alist-delete)))

(define-public libcanberra
  (package
    (name "libcanberra")
    (version "0.30")
    (source
     (origin
      (method url-fetch)

      ;; This used to be at 0pointer.de but it vanished.
      (uri (string-append
            "http://pkgs.fedoraproject.org/repo/pkgs/libcanberra/libcanberra-"
            version ".tar.xz/34cb7e4430afaf6f447c4ebdb9b42072/libcanberra-"
            version ".tar.xz"))
      (sha256
       (base32
        "0wps39h8rx2b00vyvkia5j40fkak3dpipp1kzilqla0cgvk73dn2"))
      ;; "sound-theme-freedesktop" is the default and fall-back sound theme for
      ;; XDG desktops and should always be present.
      ;; http://www.freedesktop.org/wiki/Specifications/sound-theme-spec/
      ;; We make sure libcanberra will find it.
      ;;
      ;; We add the default sounds store directory to the code dealing with
      ;; XDG_DATA_DIRS and not XDG_DATA_HOME. This is because XDG_DATA_HOME
      ;; can only be a single directory and is inspected first.  XDG_DATA_DIRS
      ;; can list an arbitrary number of directories and is only inspected
      ;; later.  This is designed to allows the user to modify any theme at
      ;; his pleasure.
      (patch-flags '("-p0"))
      (patches
       (search-patches "libcanberra-sound-theme-freedesktop.patch"
                       "libcanberra-wayland-crash.patch"))))
    (build-system gnu-build-system)
    (inputs
     `(("alsa-lib" ,alsa-lib)
       ("gstreamer" ,gstreamer)
       ("gtk+" ,gtk+)
       ("libltdl" ,libltdl)
       ("libvorbis" ,libvorbis)
       ("pulseaudio" ,pulseaudio)
       ("udev" ,eudev)
       ("sound-theme-freedesktop" ,sound-theme-freedesktop)))
    (native-inputs
     `(("pkg-config" ,pkg-config)))
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-before 'build 'patch-default-sounds-directory
           (lambda* (#:key inputs #:allow-other-keys)
             (substitute* "src/sound-theme-spec.c"
               (("@SOUND_THEME_DIRECTORY@")
                (string-append
                 (assoc-ref inputs "sound-theme-freedesktop")
                 "/share")))
             #t)))))
    (home-page "http://0pointer.de/lennart/projects/libcanberra/")
    (synopsis
     "Implementation of the XDG Sound Theme and Name Specifications")
    (description
     "Libcanberra is an implementation of the XDG Sound Theme and Name
Specifications, for generating event sounds on free desktops, such as
GNOME.  It comes with several backends (ALSA, PulseAudio, OSS, GStreamer,
null) and is designed to be portable.")
    (license lgpl2.1+)))

(define-public libcanberra/gtk+-2
  (package/inherit libcanberra
    (name "libcanberra-gtk2")
    (inputs `(,@(alist-delete "gtk+" (package-inputs libcanberra))
              ("gtk+" ,gtk+-2)))))

(define-public sound-theme-freedesktop
  (package
    (name "sound-theme-freedesktop")
    (version "0.8")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://people.freedesktop.org/~mccann/dist/"
                                  name "-" version ".tar.bz2"))
              (sha256
               (base32
                "054abv4gmfk9maw93fis0bf605rc56dah7ys5plc4pphxqh8nlfb"))))
    (build-system gnu-build-system)
    (native-inputs `(("intltool" ,intltool)))
    (synopsis "Audio samples for use as a desktop sound theme")
    (description
     "This package provides audio samples that can be used by libcanberra as
sounds for various system events.")

    ;; The license of the various sounds is given in the 'CREDITS' file.
    (license (list cc-by-sa4.0 cc-by3.0 gpl2 gpl2+))

    (home-page "https://www.freedesktop.org/wiki/Specifications/sound-theme-spec/")))

(define-public python-pycanberra
  (package
    (name "python-pycanberra")
    (version "0.1.1")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "http://ftp.n0.is/pub/releases/"
                           "pycanberra-" version ".tar.xz"))
       (sha256
        (base32
         "16jjf8fcgaprmz6jacsxrh17l1ad891fns38bxv49lg3s3mn1nj2"))))
    (build-system python-build-system)
    (arguments
     `(#:tests? #f)) ;No tests included.
    (propagated-inputs
     `(("libcanberra" ,libcanberra)))
    (synopsis "Ctypes wrapper for the libcanberra API")
    (description
     "Pycanberra is a basic Python wrapper for libcanberra.")
    (home-page "http://c.n0.is/ng0/pycanberra/")
    (license lgpl2.1+)))


code:
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2020 Ludovic Courtès <ludo@gnu.org>
;;;
;;; 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 libdaemon)
  #:use-module (guix licenses)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu))

(define-public libdaemon
  (package
    (name "libdaemon")
    (version "0.14")
    (source (origin
             (method url-fetch)
             (uri (list
                   (string-append
                    "mirror://debian/pool/main/libd/libdaemon/libdaemon_"
                    version ".orig.tar.gz")
                   "http://pkgs.fedoraproject.org/repo/pkgs/libdaemon/libdaemon-0.14.tar.gz/509dc27107c21bcd9fbf2f95f5669563/libdaemon-0.14.tar.gz"

                   ;; This used to be the canonical URL but it vanished.
                   ;; See <http://bugs.gnu.org/18639>.
                   ;; (string-append
                   ;;  "http://0pointer.de/lennart/projects/libdaemon/libdaemon-"
                   ;;  version ".tar.gz")
                   ))
             (sha256
              (base32
               "0d5qlq5ab95wh1xc87rqrh1vx6i8lddka1w3f1zcqvcqdxgyn8zx"))
             (file-name (string-append name "-" version ".tar.gz"))))
    (build-system gnu-build-system)
    (arguments
     (if (%current-target-system)
         ;; The 'setpgrp' test cannot provide an answer when cross-compiling,
         ;; so provide the right one for glibc.
         `(#:configure-flags (list "ac_cv_func_setpgrp_void=yes"

                                   ;; TODO: Move this globally on the next
                                   ;; rebuild cycle.
                                   ;; Set a valid localstatedir for the
                                   ;; benefit of the default
                                   ;; 'daemon_pid_file_proc', used by the
                                   ;; Hurd's console client.
                                   "--localstatedir=/var"))
         '()))

    ;; XXX: Stale URL, missing replacement.  See <http://bugs.gnu.org/18639>.
    (home-page "http://0pointer.de/lennart/projects/libdaemon/")

    (synopsis "Lightweight C library that eases the writing of UNIX daemons")
    (description
     "Libdaemon is a lightweight C library that eases the writing of UNIX
daemons.  It consists of the following parts:

  • A wrapper around fork() which does the correct daemonization procedure of
    a process

  • A wrapper around syslog() for simpler and compatible log output to Syslog
    or STDERR

  • An API for writing PID files

  • An API for serializing UNIX signals into a pipe for usage with select() or
    poll()

  • An API for running subprocesses with STDOUT and STDERR redirected to
    syslog.

APIs like these are used in most daemon software available.  It is not that
simple to get it done right and code duplication is not a goal.")
    (license lgpl2.1+)))


code:
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Gábor Boskovits <boskovits@gmail.com>
;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
;;;
;;; 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 libedit)
  #:use-module (guix licenses)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages ncurses))

(define-public libedit
  (package
    (name "libedit")
    (version "20191231-3.1")
    (source
     (origin
      (method url-fetch)
      (uri (string-append "https://thrysoee.dk/editline"
                          "/libedit-" version ".tar.gz"))
      (sha256
       (base32 "0wch48nml28jj6ild889745dsg2agm7mpvrmbl1gi98nw6vjrf6v"))))
    (build-system gnu-build-system)
    (inputs
     `(("ncurses" ,ncurses)))
    (home-page "https://thrysoee.dk/editline/")
    (synopsis "NetBSD Editline library")
    (description
     "This is an autotool- and libtoolized port of the NetBSD Editline
library (libedit).  This Berkeley-style licensed command line editor library
provides generic line editing, history, and tokenization functions, similar to
those found in GNU Readline.")
    (license bsd-3)))

(define-public editline
  (package
    (name "editline")
    (version "1.17.1")
    (source
     (origin
      (method url-fetch)
      (uri (string-append
            "https://ftp.troglobit.com/editline/editline-" version ".tar.xz"))
      (sha256
       (base32 "03pw3z6pz590v8xfnjx0yynnzij2sb9xwjbvqvdzsid56crkn8nz"))))
    (build-system gnu-build-system)
    (home-page "https://troglobit.com/projects/editline/")
    (synopsis "Line editing library")
    (description
     "@code{editline} is a small line editing library.  It can be linked into almost
any program to provide command line editing and history functions.  It is call
compatible with the GNU Readline library, but at a fraction of the size,
and as a result fewer features.")
    (license bsd-4)))


code:
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013, 2014, 2015, 2016, 2018 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2015, 2017 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
;;; Copyright © 2016 David Thompson <davet@gnu.org>
;;; Copyright © 2017, 2019, 2020 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Pierre Neidhardt <mail@ambrevar.xyz>
;;;
;;; 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 libevent)
  #:use-module (gnu packages)
  #:use-module (guix licenses)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system perl)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages base)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages perl-check)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages python)
  #:use-module (gnu packages tls))

(define-public libevent
  (package
    (name "libevent")
    (version "2.1.11")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://github.com/libevent/libevent/releases/download/release-"
                    version "-stable/libevent-" version "-stable.tar.gz"))
              (sha256
               (base32
                "0g988zqm45sj1hlhhz4il5z4dpi5dl74hzjwzl4md37a09iaqnx6"))))
    (build-system gnu-build-system)
    (outputs '("out" "bin"))
    (arguments
     ;; This skips some of the tests which fail on armhf and aarch64.
     '(#:configure-flags '("--disable-libevent-regress")))
    (inputs
     `(("python" ,python-wrapper)))     ;for 'event_rpcgen.py'
    (native-inputs
     `(("which" ,which)))
    (home-page "https://libevent.org/")
    (synopsis "Event notification library")
    (description
     "The libevent API provides a mechanism to execute a callback
function when a specific event occurs on a file descriptor or after a
timeout has been reached.  Furthermore, libevent also support callbacks
due to signals or regular timeouts.

libevent is meant to replace the event loop found in event driven
network servers.  An application just needs to call event_dispatch() and
then add or remove events dynamically without having to change the event
loop.")
    (license bsd-3)))

(define-public libev
  (package
    (name "libev")
    (version "4.31")
    (source (origin
              (method url-fetch)
              (uri (string-append "http://dist.schmorp.de/libev/Attic/libev-"
                                  version
                                  ".tar.gz"))
              (sha256
               (base32
                "0nkfqv69wfyy2bpga4d53iqydycpik8jp8x6q70353hia8mmv1gd"))))
    (build-system gnu-build-system)
    (arguments
     '(#:configure-flags '("--disable-static")))
    (home-page "http://software.schmorp.de/pkg/libev.html")
    (synopsis "Event loop loosely modelled after libevent")
    (description
     "libev provides a full-featured and high-performance event loop that is
loosely modelled after libevent.  It includes relative timers, absolute timers
with customized rescheduling, synchronous signals, process status change
events, event watchers dealing with the event loop itself, file watchers, and
limited support for fork events.")
    (license
     (list bsd-2 gpl2+))))

(define-public libuv
  (package
    (name "libuv")
    (version "1.35.0")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://dist.libuv.org/dist/v" version
                                  "/libuv-v" version ".tar.gz"))
              (sha256
               (base32
                "0126mfmaw3s92dsga60sydgwjmzwg9cd36n127pydmisah17v50f"))))
    (build-system gnu-build-system)
    (arguments
     '(#:configure-flags '("--disable-static")
       ;; XXX: Some tests want /dev/tty, attempt to make connections, etc.
       #:tests? #f))
    ;; TODO replace with autoconf on core-updates
    (native-inputs `(("autoconf" ,autoconf-wrapper)
                     ("automake" ,automake)
                     ("libtool" ,libtool)

                     ;; libuv.pc is installed only when pkg-config is found.
                     ("pkg-config" ,pkg-config)))
    (home-page "https://github.com/libuv/libuv")
    (synopsis "Library for asynchronous I/O")
    (description
     "libuv is a multi-platform support library with a focus on asynchronous
I/O.  Among other things, it supports event loops via epoll, kqueue, and
similar IOCP, and event ports, asynchronous TCP/UDP sockets, asynchronous DNS
resolution, asynchronous file system operations, and threading primitives.")

    ;; A few files fall under other non-copyleft licenses; see 'LICENSE' for
    ;; details.  Documentation is CC-BY 4.0 as of 1.12.0; see 'LICENSE-docs'.
    (license (list expat cc-by4.0))))

(define-public libuv-for-node
  ;; When upgrading Node, also upgrade this. Get the version from
  ;; https://github.com/nodejs/node/blob/master/deps/uv/include/uv/version.h
  (package
    (inherit libuv)
    (name "libuv")
    (version "1.40.0")
    (source (origin
              (method url-fetch)
              (uri (string-append "https://dist.libuv.org/dist/v" version
                                  "/libuv-v" version ".tar.gz"))
              (sha256
               (base32
                "1551k3ab27vbg9517l9b4iqbramwxdkwgpf53knas05cbfwhvab1"))))
    (properties '((hidden? . #t)))))

(define-public perl-anyevent
  (package
    (name "perl-anyevent")
    (version "7.17")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://cpan/authors/id/M/ML/MLEHMANN/"
                                  "AnyEvent-" version ".tar.gz"))
              (sha256
               (base32
                "11drlj8r02czhjgzkb39axnr8zzyp506r043xfmf93q9kilfmgjh"))))
    (build-system perl-build-system)
    (native-inputs
     `(("perl-canary-stability" ,perl-canary-stability)))
    (propagated-inputs
     `(("perl-async-interrupt" ,perl-async-interrupt)
       ("perl-ev" ,perl-ev)
       ("perl-guard" ,perl-guard)
       ("perl-json" ,perl-json)
       ("perl-json-xs" ,perl-json-xs)
       ("perl-net-ssleay" ,perl-net-ssleay)
       ("perl-task-weaken" ,perl-task-weaken)))
    (home-page "https://metacpan.org/release/AnyEvent")
    (synopsis
     "API for I/O, timer, signal, child process and completion events")
    (description
     "This module allows using a variety of events without forcing module
authors to pick a specific event loop, and without noticeable overhead.
Currently supported event loops are EV, Event, Glib/Gtk2, Tk, Qt,
@code{Event::Lib}, Irssi, @code{IO::Async} and POE (and thus also WxWidgets
and Prima).  It also comes with a very fast Pure Perl event loop that does
not rely on XS.")
    (license perl-license)))

(define-public perl-ev
  (package
    (name "perl-ev")
    (version "4.31")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://cpan/authors/id/M/ML/MLEHMANN/EV-"
                                  version ".tar.gz"))
              (sha256
               (base32
                "1jxlhnvrqim39977zwavjrcbdf9bifb46pwaxvm0s8klq121kjwb"))
              (modules '((guix build utils)))
              (snippet
               '(begin
                  ;; Drop bundled libev.
                  (delete-file-recursively "libev")
                  #t))))
    (build-system perl-build-system)
    (arguments
     '(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'unpack-libev
           ;; This package requires the libev *sources* in order
           ;; to build. Unpack system libev here...
           (lambda* (#:key inputs #:allow-other-keys)
             (mkdir "./libev")
             (invoke "tar" "-xf" (assoc-ref inputs "libev-source")
                     "-C" "./libev" "--strip-components=1"))))))
    (native-inputs
     `(("libev-source" ,(package-source libev))
       ("perl-canary-stability" ,perl-canary-stability)))
    (propagated-inputs
     `(("perl-common-sense" ,perl-common-sense)))
    (home-page "https://metacpan.org/release/EV")
    (synopsis "Perl interface to libev")
    (description
     "This module provides an interface to @code{libev}, a high performance
full-featured event loop.  It can be used through the @code{AnyEvent} module
and still be faster than other event loops currently supported in Perl.")
    (license perl-license)))

(define-public perl-rpc-epc-service
  (package
    (name "perl-rpc-epc-service")
    (version "0.0.11")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "mirror://cpan/authors/id/K/KI/KIWANAMI/RPC-EPC-Service-"
             "v" version ".tar.gz"))
       (sha256
        (base32
         "1qwb284z4ig3xzy21m1b3w8bkb8k6l2ij6cjz93znn2j6qs42pwp"))))
    (build-system perl-build-system)
    (native-inputs
     `(("perl-module-build" ,perl-module-build)
       ("perl-test-simple" ,perl-test-simple)))
    (propagated-inputs
     `(("perl-anyevent" ,perl-anyevent)
       ("perl-data-sexpression" ,perl-data-sexpression)))
    (arguments
     ;; Tests seem to fail because they try to start a server.
     `(#:tests? #f))
    (home-page "https://metacpan.org/release/RPC-EPC-Service")
    (synopsis "Asynchronous remote procedure stack")
    (description "RPC::EPC::Service enables to connect the other process with
the S-expression protocol, like the Swank protocol of the SLIME.")
    (license perl-license)))


code:
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 Joshua S. Grant <jgrant@parenthetical.io>
;;; Copyright © 2015 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
;;;
;;; 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 libffcall)
  #:use-module ((guix licenses) #:prefix l:)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu))

(define-public libffcall
   (package
    (name "libffcall")
    (version "2.2")
    (source
     (origin
       (method url-fetch)
       (uri (string-append
             "mirror://gnu/libffcall/libffcall-" version ".tar.gz"))
       (sha256
        (base32
         "0ixp7kbr7y8s34nsrsdfh77ig5c2zkwr6cfg9v1gm53cggwkgypb"))))
    (build-system gnu-build-system)
    (arguments
     '(#:parallel-build? #f
       #:configure-flags '("--disable-static")))
    (synopsis "Foreign function calls from interpreters")
    (description
     "GNU Libffcall is a collection of libraries that can be used to build
foreign function call interfaces in embedded interpreters.")
    (home-page "https://www.gnu.org/software/libffcall/")
    (license l:gpl2+)))


code:
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013, 2014, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2014 Federico Beffa <beffa@fbengineering.ch>
;;; Copyright © 2015, 2019 Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
;;; Copyright © 2016, 2017, 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016, 2017 Ben Woodcroft <donttrustben@gmail.com>
;;; Copyright © 2017, 2019, 2020 Marius Bakke <marius@gnu.org>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2020 John Doe <dftxbs3e@free.fr>
;;;
;;; 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 libffi)
  #:use-module (gnu packages)
  #:use-module (guix licenses)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (gnu packages check)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages ruby)
  #:use-module (gnu packages sphinx)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system python)
  #:use-module (guix build-system ruby))

(define-public libffi
  (package
    (name "libffi")
    (version "3.3")
    (source (origin
              (method url-fetch)
              (uri
               (string-append "ftp://sourceware.org/pub/libffi/"
                              name "-" version ".tar.gz"))
              (sha256
               (base32
                "0mi0cpf8aa40ljjmzxb7im6dbj45bb0kllcd09xgmp834y9agyvj"))))
    (build-system gnu-build-system)
    (arguments
     `(;; Prevent the build system from passing -march and -mtune to the
       ;; compiler.  See "ax_cc_maxopt.m4" and "ax_gcc_archflag.m4".
       #:configure-flags '("--enable-portable-binary" "--without-gcc-arch")

       ;; TODO: Inline patches on next rebuild cycle.
       ,@(if (string-prefix? "powerpc-" (or (%current-target-system)
                                            (%current-system)))
             '(#:phases (modify-phases %standard-phases
                          (add-after 'unpack 'apply-patch
                            (lambda* (#:key inputs #:allow-other-keys)
                              (let ((patch (assoc-ref inputs
                                                      "powerpc-patch")))
                                (invoke "patch" "--force" "-p1"
                                        "-i" patch))))))
             '())
       ,@(if (string-prefix? "powerpc64le-" (or (%current-target-system)
                                                (%current-system)))
             '(#:phases (modify-phases %standard-phases
                          (add-after 'unpack 'apply-patch2
                            (lambda* (#:key inputs #:allow-other-keys)
                              (let ((patch (assoc-ref inputs
                                                      "powerpc64le-patch")))
                                (invoke "patch" "--force" "-p1"
                                        "-i" patch))))))
             '())))
    (inputs
     (cond
      ((string-prefix? "powerpc-" (or (%current-target-system)
                                        (%current-system)))
       `(("powerpc-patch" ,@(search-patches
                             "libffi-3.3-powerpc-fixes.patch"))))
      ((string-prefix? "powerpc64le-" (or (%current-target-system)
                                          (%current-system)))
       `(("powerpc64le-patch" ,@(search-patches
                                 "libffi-float128-powerpc64le.patch"))))
      (else '())))
    (outputs '("out" "debug"))
    (synopsis "Foreign function call interface library")
    (description
     "The libffi library provides a portable, high level programming interface
to various calling conventions.  This allows a programmer to call any
function specified by a call interface description at run-time.

FFI stands for Foreign Function Interface.  A foreign function interface is
the popular name for the interface that allows code written in one language
to call code written in another language.  The libffi library really only
provides the lowest, machine dependent layer of a fully featured foreign
function interface.  A layer must exist above libffi that handles type
conversions for values passed between the two languages.")
    (home-page "http://www.sourceware.org/libffi/")
    (properties `((release-monitoring-url . ,home-page)))

    ;; See <https://github.com/atgreen/libffi/blob/master/LICENSE>.
    (license expat)))

(define-public python-cffi
  (package
    (name "python-cffi")
    (version "1.14.4")
    (source
     (origin
      (method url-fetch)
      (uri (pypi-uri "cffi" version))
      (sha256
       (base32 "0v080s7vlrjz9z823x2yh36yc8drwpvvir6w8wfkkzd7k2z5qihs"))))
    (build-system python-build-system)
    (inputs
     `(("libffi" ,libffi)))
    (propagated-inputs ; required at run-time
     `(("python-pycparser" ,python-pycparser)))
    (native-inputs
     `(("pkg-config" ,pkg-config)
       ("python-pytest" ,python-pytest)))
    (arguments
     `(#:modules ((ice-9 ftw)
                  (srfi srfi-26)
                  (guix build utils)
                  (guix build python-build-system))
       #:phases
       (modify-phases %standard-phases
         (replace 'check
           (lambda _
             (setenv "PYTHONPATH"
                     (string-append
                      (getenv "PYTHONPATH")
                      ":" (getcwd) "/build/"
                      (car (scandir "build" (cut string-prefix? "lib." <>)))))

             ;; XXX The "normal" approach of setting CC and friends does
             ;; not work here.  Is this the correct way of doing things?
             (substitute* "testing/embedding/test_basic.py"
               (("c = distutils\\.ccompiler\\.new_compiler\\(\\)")
                (string-append "c = distutils.ccompiler.new_compiler();"
                               "c.set_executables(compiler='gcc',"
                               "compiler_so='gcc',linker_exe='gcc',"
                               "linker_so='gcc -shared')")))
             (substitute* "testing/cffi0/test_ownlib.py"
               (("\"cc testownlib") "\"gcc testownlib"))
             (invoke "py.test" "-v" "c/" "testing/")
             #t))
         (add-before 'check 'patch-paths-of-dynamically-loaded-libraries
           (lambda* (#:key inputs #:allow-other-keys)
             ;; Shared libraries should be referred by their absolute path as
             ;; using find_library or the like with their name fail when the
             ;; resolved .so object is a linker script rather than an ELF
             ;; binary (this is a limitation of the ctype library of Python).
             (let* ((glibc (assoc-ref inputs "libc"))
                    (libm (string-append glibc "/lib/libm.so.6"))
                    (libc (string-append glibc "/lib/libc.so.6")))
               (substitute* '("testing/cffi0/test_function.py"
                              "testing/cffi0/test_parsing.py"
                              "testing/cffi0/test_unicode_literals.py"
                              "testing/cffi0/test_zdistutils.py"
                              "testing/cffi1/test_recompiler.py")
                 (("lib_m = ['\"]{1}m['\"]{1}")
                  (format #f "lib_m = '~a'" libm)))
               (substitute* '("testing/cffi0/test_verify.py"
                              "testing/cffi1/test_verify1.py")
                 (("lib_m = \\[['\"]{1}m['\"]{1}\\]")
                  (format #f "lib_m = ['~a']" libm)))
               (substitute* "c/test_c.py"
                 (("find_and_load_library\\(['\"]{1}c['\"]{1}")
                  (format #f "find_and_load_library('~a'" libc)))
               #t))))))
    (home-page "https://cffi.readthedocs.io/")
    (synopsis "Foreign function interface for Python")
    (description "Foreign Function Interface for Python calling C code.")
    (license expat)))

(define-public python2-cffi
  (package-with-python2 python-cffi))

(define-public python-cffi-documentation
  (package
    (name "python-cffi-documentation")
    (version (package-version python-cffi))
    (source (package-source python-cffi))
    (build-system gnu-build-system)
    (arguments
     `(#:tests? #f
       #:phases (modify-phases %standard-phases
                  (add-after 'unpack 'chdir
                    (lambda _ (chdir "doc") #t))
                  (delete 'configure)
                  (replace 'build
                    (lambda* (#:key (make-flags '()) #:allow-other-keys)
                      (apply invoke "make" "html" make-flags)))
                  (replace 'install
                    (lambda* (#:key outputs #:allow-other-keys)
                      (let ((out (assoc-ref outputs "out")))
                        (copy-recursively "build/html" (string-append out "/html"))
                        #t))))))
    (native-inputs
     `(("sphinx-build" ,python-sphinx)))
    (home-page (package-home-page python-cffi))
    (synopsis "Documentation for the Python CFFI interface")
    (description
     "This package contains HTML documentation for the @code{python-cffi}
project.")
    (license (package-license python-cffi))))

(define-public ruby-ffi
  (package
    (name "ruby-ffi")
    (version "1.12.2")
    (source (origin
              ;; Pull from git because the RubyGems release bundles LibFFI,
              ;; and comes with a gemspec that makes it difficult to unbundle.
              (method git-fetch)
              (uri (git-reference
                    (url "https://github.com/ffi/ffi")
                    (commit version)))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "1cvqsbjr2gfjgqggq9kdx90qhhzr7qkyr9wmxdsfsik6cnxnnpmd"))))
    (build-system ruby-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'do-not-depend-on-ccache
           (lambda _
             (substitute* "spec/ffi/fixtures/GNUmakefile"
               (("^CCACHE := .*")
                ""))
             #t))
         (replace 'replace-git-ls-files
           (lambda _
             ;; Do not try to execute git, or include the (un)bundled LibFFI.
             (substitute* "ffi.gemspec"
               (("git ls-files -z")
                "find * -type f -print0 | sort -z")
               (("lfs \\+?= .*")
                "lfs = []\n"))
             (substitute* "Rakefile"
               (("LIBFFI_GIT_FILES = .*")
                "LIBFFI_GIT_FILES = []\n"))
             #t))
         (replace 'build
          (lambda _
            ;; Tests depend on the native extensions, so we build it
            ;; beforehand without going through the gem machinery.
             (invoke "rake" "compile")

             ;; XXX: Ideally we'd use "rake native gem" here to prevent the
             ;; install phase from needlessly rebuilding everything, but that
             ;; requires the bundled LibFFI, and the install phase can not
             ;; deal with such gems anyway.
             (invoke "gem" "build" "ffi.gemspec")))
         (replace 'check
           (lambda* (#:key tests? #:allow-other-keys)
             (if tests?
                 (begin
                   (setenv "MAKE" "make")
                   (setenv "CC" "gcc")
                   (invoke "rspec" "spec"))
                 (format #t "test suite not run~%"))
             #t)))))
    (native-inputs
     `(("ruby-rake-compiler" ,ruby-rake-compiler)
       ("ruby-rspec" ,ruby-rspec)
       ("ruby-rubygems-tasks" ,ruby-rubygems-tasks)))
    (inputs
     `(("libffi" ,libffi)))
    (synopsis "Ruby foreign function interface library")
    (description "Ruby-FFI is a Ruby extension for programmatically loading
dynamic libraries, binding functions within them, and calling those functions
from Ruby code.  Moreover, a Ruby-FFI extension works without changes on Ruby
and JRuby.")
    (home-page "https://wiki.github.com/ffi/ffi")
    (license bsd-3)))


code:
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2014 Manolis Fragkiskos Ragkousis <manolis837@gmail.com>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; 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 libftdi)
  #:use-module (guix licenses)
  #:use-module (guix download)
  #:use-module (guix packages)
  #:use-module (gnu packages)
  #:use-module (gnu packages libusb)
  #:use-module (guix build-system cmake))

(define-public libftdi
  (package
    (name "libftdi")
    (version "1.4")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "http://www.intra2net.com/en/developer/libftdi/download/libftdi1-"
                    version ".tar.bz2"))
              (sha256
               (base32
                "0x0vncf6i92slgrn0h7ghkskqbglbs534220qa84d0qg114zndpc"))))
    (build-system cmake-build-system)
    (propagated-inputs
     `(("libusb" ,libusb))) ; required by libftdi1.pc
    (home-page "https://www.intra2net.com/en/developer/libftdi/")
    (synopsis "FTDI USB driver with bitbang mode")
    (description
     "libFTDI is a library to talk to FTDI chips: FT232BM,
FT245BM, FT2232C, FT2232D, FT245R and FT232H including the popular
bitbangmode.")
    (license lgpl2.1)))


code:
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2016, 2017 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2017 Mark H Weaver <mhw@netris.org>
;;; Copyright © 2017 Eric Bavier <bavier@member.fsf.org>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; 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 libidn)
  #:use-module (gnu packages)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages libunistring)
  #:use-module (guix licenses)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu))

(define-public libidn
  (package
   (name "libidn")
   (version "1.35")
   (source (origin
            (method url-fetch)
            (uri (string-append "mirror://gnu/libidn/libidn-" version
                                ".tar.gz"))
            (sha256
             (base32
              "07pyy0afqikfq51z5kbzbj9ldbd12mri0zvx0mfv3ds6bc0g26pi"))))
   (build-system gnu-build-system)
   ;; FIXME: No Java and C# libraries are currently built.
   (arguments
    `(#:configure-flags '("--disable-static")))
   (synopsis "Internationalized string processing library")
   (description
     "libidn is a library implementing of the Stringprep, Punycode and IDNA
specifications.  These are used to encode and decode internationalized domain
names according to the IDNA2003 specifications.  It includes native C, C# and
Java libraries.")
   ;; The C code is dual-licensed gpl2+ lgpl3+, the manual is fdl1.3+,
   ;; the command line tool is gpl3+.
   (license (list gpl2+ gpl3+ lgpl3+ fdl1.3+))
   (home-page "https://www.gnu.org/software/libidn/")))

(define-public libidn2
  (package
    (name "libidn2")
    (version "2.3.0")
    (source (origin
              (method url-fetch)
              (uri (string-append "mirror://gnu/libidn/" name "-" version
                                  ".tar.lz"))
              (sha256
               (base32
                "14yw4w37ya6rcqa7h6p44x6711dwgq2j22xg6k79ybbf04sj88kb"))))
    (native-inputs
     `(("lzip" ,lzip)))
    (inputs
     `(("libunistring" ,libunistring)))
    (build-system gnu-build-system)
    (arguments
     `(#:configure-flags '("--disable-static")))
    (synopsis "Internationalized domain name library for IDNA2008")
    (description "Libidn2 is an internationalized domain library implementing
the IDNA2008 specifications.   Libidn2 is believed to be a complete IDNA2008
implementation, but has yet to be as extensively used as the original Libidn
library.")
    (home-page "https://www.gnu.org/software/libidn/#libidn2")
    (properties '((ftp-directory . "/gnu/libidn")))
    ;; The command-line tool 'idn2' is GPL3+, while the library is dual-licensed
    ;; GPL2+ or LGPL3+.
    (license (list gpl2+ gpl3+ lgpl3+))))


code:
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;;
;;; 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 libphidget)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (guix licenses)
  #:use-module (gnu packages libusb))

(define-public libphidget
  (package
   (name "libphidget")
   (version "2.1.9.20190409")
   (source (origin
            (method url-fetch)
            (uri (string-append
                  "https://www.phidgets.com/downloads/phidget21/libraries/"
                  "linux/libphidget/libphidget_"
                  version ".tar.gz"))
            (sha256
             (base32 "07w54dmr75vq2imngfy66nk1sxlvkzhl2p6g362q0a02f099jy0f"))))
   (build-system gnu-build-system)
   (inputs `(("libusb" ,libusb)))
   (outputs '("out" "debug"))
   (home-page "https://www.phidgets.com/")
   (license lgpl3+)
   (synopsis "C library to manipulate Phidgets")
   (description synopsis)))