You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
5.6 KiB

gnu: Some cleanup based on lint checkers. * gnu/packages/admin.scm, gnu/packages/aidc.scm, gnu/packages/algebra.scm, gnu/packages/apr.scm, gnu/packages/avahi.scm, gnu/packages/backup.scm, gnu/packages/base.scm, gnu/packages/calcurse.scm, gnu/packages/cdrom.scm, gnu/packages/check.scm, gnu/packages/compression.scm, gnu/packages/cook.scm, gnu/packages/crypto.scm, gnu/packages/cryptsetup.scm, gnu/packages/curl.scm, gnu/packages/cyrus-sasl.scm, gnu/packages/databases.scm, gnu/packages/doxygen.scm, gnu/packages/dwm.scm, gnu/packages/elf.scm, gnu/packages/emacs.scm, gnu/packages/feh.scm, gnu/packages/file.scm, gnu/packages/fish.scm, gnu/packages/flex.scm, gnu/packages/fltk.scm, gnu/packages/fontutils.scm, gnu/packages/games.scm, gnu/packages/gcal.scm, gnu/packages/gcc.scm, gnu/packages/geeqie.scm, gnu/packages/ghostscript.scm, gnu/packages/gimp.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gperf.scm, gnu/packages/grub.scm, gnu/packages/gsasl.scm, gnu/packages/gtk.scm, gnu/packages/guile-wm.scm, gnu/packages/guile.scm, gnu/packages/hurd.scm, gnu/packages/icu4c.scm, gnu/packages/image.scm, gnu/packages/imagemagick.scm, gnu/packages/irssi.scm, gnu/packages/kde.scm, gnu/packages/libdaemon.scm, gnu/packages/libevent.scm, gnu/packages/libidn.scm, gnu/packages/libusb.scm, gnu/packages/linux.scm, gnu/packages/lout.scm, gnu/packages/lsh.scm, gnu/packages/lsof.scm, gnu/packages/lua.scm, gnu/packages/maths.scm, gnu/packages/mcrypt.scm, gnu/packages/mp3.scm, gnu/packages/netpbm.scm, gnu/packages/noweb.scm, gnu/packages/ocaml.scm, gnu/packages/openssl.scm, gnu/packages/pcre.scm, gnu/packages/pdf.scm, gnu/packages/pkg-config.scm, gnu/packages/pretty-print.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/rsync.scm, gnu/packages/scheme.scm, gnu/packages/scrot.scm, gnu/packages/sdl.scm, gnu/packages/skribilo.scm, gnu/packages/ssh.scm, gnu/packages/stalonetray.scm, gnu/packages/tcl.scm, gnu/packages/tcsh.scm, gnu/packages/telephony.scm, gnu/packages/texlive.scm, gnu/packages/tor.scm, gnu/packages/valgrind.scm, gnu/packages/version-control.scm, gnu/packages/vim.scm, gnu/packages/vpn.scm, gnu/packages/w3m.scm, gnu/packages/web.scm, gnu/packages/wordnet.scm, gnu/packages/xiph.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/packages/zile.scm, gnu/packages/zip.scm, gnu/packages/zsh.scm [synopsis, description]: Adjust according to lint checkers. * gnu/packages/fltk.scm (fltk)[source]: Wrap long line in uri. * /gnu/packages/xiph.scm (libogg, libtheora, vorbis-tools)[source]: Same.
7 years ago
gnu: Some cleanup based on lint checkers. * gnu/packages/admin.scm, gnu/packages/aidc.scm, gnu/packages/algebra.scm, gnu/packages/apr.scm, gnu/packages/avahi.scm, gnu/packages/backup.scm, gnu/packages/base.scm, gnu/packages/calcurse.scm, gnu/packages/cdrom.scm, gnu/packages/check.scm, gnu/packages/compression.scm, gnu/packages/cook.scm, gnu/packages/crypto.scm, gnu/packages/cryptsetup.scm, gnu/packages/curl.scm, gnu/packages/cyrus-sasl.scm, gnu/packages/databases.scm, gnu/packages/doxygen.scm, gnu/packages/dwm.scm, gnu/packages/elf.scm, gnu/packages/emacs.scm, gnu/packages/feh.scm, gnu/packages/file.scm, gnu/packages/fish.scm, gnu/packages/flex.scm, gnu/packages/fltk.scm, gnu/packages/fontutils.scm, gnu/packages/games.scm, gnu/packages/gcal.scm, gnu/packages/gcc.scm, gnu/packages/geeqie.scm, gnu/packages/ghostscript.scm, gnu/packages/gimp.scm, gnu/packages/gl.scm, gnu/packages/glib.scm, gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm, gnu/packages/gperf.scm, gnu/packages/grub.scm, gnu/packages/gsasl.scm, gnu/packages/gtk.scm, gnu/packages/guile-wm.scm, gnu/packages/guile.scm, gnu/packages/hurd.scm, gnu/packages/icu4c.scm, gnu/packages/image.scm, gnu/packages/imagemagick.scm, gnu/packages/irssi.scm, gnu/packages/kde.scm, gnu/packages/libdaemon.scm, gnu/packages/libevent.scm, gnu/packages/libidn.scm, gnu/packages/libusb.scm, gnu/packages/linux.scm, gnu/packages/lout.scm, gnu/packages/lsh.scm, gnu/packages/lsof.scm, gnu/packages/lua.scm, gnu/packages/maths.scm, gnu/packages/mcrypt.scm, gnu/packages/mp3.scm, gnu/packages/netpbm.scm, gnu/packages/noweb.scm, gnu/packages/ocaml.scm, gnu/packages/openssl.scm, gnu/packages/pcre.scm, gnu/packages/pdf.scm, gnu/packages/pkg-config.scm, gnu/packages/pretty-print.scm, gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/rsync.scm, gnu/packages/scheme.scm, gnu/packages/scrot.scm, gnu/packages/sdl.scm, gnu/packages/skribilo.scm, gnu/packages/ssh.scm, gnu/packages/stalonetray.scm, gnu/packages/tcl.scm, gnu/packages/tcsh.scm, gnu/packages/telephony.scm, gnu/packages/texlive.scm, gnu/packages/tor.scm, gnu/packages/valgrind.scm, gnu/packages/version-control.scm, gnu/packages/vim.scm, gnu/packages/vpn.scm, gnu/packages/w3m.scm, gnu/packages/web.scm, gnu/packages/wordnet.scm, gnu/packages/xiph.scm, gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/packages/zile.scm, gnu/packages/zip.scm, gnu/packages/zsh.scm [synopsis, description]: Adjust according to lint checkers. * gnu/packages/fltk.scm (fltk)[source]: Wrap long line in uri. * /gnu/packages/xiph.scm (libogg, libtheora, vorbis-tools)[source]: Same.
7 years ago
  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2012, 2013, 2014, 2016 Ludovic Courtès <ludo@gnu.org>
  3. ;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
  4. ;;;
  5. ;;; This file is part of GNU Guix.
  6. ;;;
  7. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  8. ;;; under the terms of the GNU General Public License as published by
  9. ;;; the Free Software Foundation; either version 3 of the License, or (at
  10. ;;; your option) any later version.
  11. ;;;
  12. ;;; GNU Guix is distributed in the hope that it will be useful, but
  13. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ;;; GNU General Public License for more details.
  16. ;;;
  17. ;;; You should have received a copy of the GNU General Public License
  18. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  19. (define-module (gnu packages pkg-config)
  20. #:use-module (guix licenses)
  21. #:use-module (guix packages)
  22. #:use-module (guix download)
  23. #:use-module (guix build-system gnu)
  24. #:use-module (guix build-system trivial)
  25. #:use-module (guix memoization)
  26. #:export (pkg-config))
  27. ;; This is the "primitive" pkg-config package. People should use `pkg-config'
  28. ;; (see below) rather than `%pkg-config', but we export `%pkg-config' so that
  29. ;; `fold-packages' finds it.
  30. (define-public %pkg-config
  31. (package
  32. (name "pkg-config")
  33. (version "0.29.2")
  34. (source (origin
  35. (method url-fetch)
  36. (uri (list
  37. (string-append
  38. "http://fossies.org/linux/misc/pkg-config-" version
  39. ".tar.gz")
  40. ;; FIXME: The following URL redirects to HTTPS, which
  41. ;; creates bootstrapping problems:
  42. ;; <http://bugs.gnu.org/22774>.
  43. (string-append
  44. "http://pkgconfig.freedesktop.org/releases/pkg-config-"
  45. version ".tar.gz")))
  46. (sha256
  47. (base32
  48. "14fmwzki1rlz8bs2p810lk6jqdxsk966d8drgsjmi54cd00rrikg"))))
  49. (build-system gnu-build-system)
  50. (arguments
  51. `(#:configure-flags
  52. '("--with-internal-glib"
  53. ;; Those variables are guessed incorrectly when cross-compiling.
  54. ;; See: https://developer.gimp.org/api/2.0/glib/glib-cross-compiling.html.
  55. ,@(if (%current-target-system)
  56. '("glib_cv_stack_grows=no"
  57. "glib_cv_uscore=no"
  58. "ac_cv_func_posix_getpwuid_r=yes"
  59. "ac_cv_func_posix_getgrgid_r=yes")
  60. '()))))
  61. (native-search-paths
  62. (list (search-path-specification
  63. (variable "PKG_CONFIG_PATH")
  64. (files '("lib/pkgconfig" "lib64/pkgconfig" "share/pkgconfig")))))
  65. (home-page "https://www.freedesktop.org/wiki/Software/pkg-config")
  66. (license gpl2+)
  67. (synopsis "Helper tool used when compiling applications and libraries")
  68. (description
  69. "pkg-config is a helper tool used when compiling applications and
  70. libraries. It helps you insert the correct compiler options on the
  71. command line so an application can use gcc -o test test.c `pkg-config
  72. --libs --cflags glib-2.0` for instance, rather than hard-coding values
  73. on where to find glib (or other libraries). It is language-agnostic, so
  74. it can be used for defining the location of documentation tools, for
  75. instance.")))
  76. (define cross-pkg-config
  77. (mlambda (target)
  78. "Return a pkg-config for TARGET, essentially just a wrapper called
  79. `TARGET-pkg-config', as `configure' scripts like it."
  80. ;; See <http://www.flameeyes.eu/autotools-mythbuster/pkgconfig/cross-compiling.html>
  81. ;; for details.
  82. (package
  83. (inherit %pkg-config)
  84. (name (string-append (package-name %pkg-config) "-" target))
  85. (build-system trivial-build-system)
  86. (arguments
  87. `(#:modules ((guix build utils))
  88. #:builder (begin
  89. (use-modules (guix build utils))
  90. (let* ((in (assoc-ref %build-inputs "pkg-config"))
  91. (out (assoc-ref %outputs "out"))
  92. (bin (string-append out "/bin"))
  93. (prog (string-append ,target "-pkg-config"))
  94. (native (string-append in "/bin/pkg-config")))
  95. (mkdir-p bin)
  96. ;; Create a `TARGET-pkg-config' -> `pkg-config' symlink.
  97. ;; This satisfies the pkg.m4 macros, which use
  98. ;; AC_PROG_TOOL to determine the `pkg-config' program
  99. ;; name.
  100. (symlink native (string-append bin "/" prog))
  101. ;; Also make 'pkg.m4' available, some packages might
  102. ;; expect it.
  103. (mkdir-p (string-append out "/share"))
  104. (symlink (string-append in "/share/aclocal")
  105. (string-append out "/share/aclocal"))
  106. #t))))
  107. (native-inputs `(("pkg-config" ,%pkg-config)))
  108. ;; Ignore native inputs, and set `PKG_CONFIG_PATH' for target inputs.
  109. (native-search-paths '())
  110. (search-paths (package-native-search-paths %pkg-config)))))
  111. (define (pkg-config-for-target target)
  112. "Return a pkg-config package for TARGET, which may be either #f for a native
  113. build, or a GNU triplet."
  114. (if target
  115. (cross-pkg-config target)
  116. %pkg-config))
  117. ;; This hack allows us to automatically choose the native or the cross
  118. ;; `pkg-config' depending on whether it's being used in a cross-build
  119. ;; environment or not.
  120. (define-syntax pkg-config
  121. (identifier-syntax (pkg-config-for-target (%current-target-system))))