path: root/gnu/packages/noweb.scm
blob: be90e2dc643a0f61ad458dfd401342ebbdfc5afe (about) (plain)
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
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 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 noweb)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix build-system gnu)
  #:use-module (guix licenses))

(define-public noweb
  (package
    (name "noweb")
    (version "2.11b")
    (source (origin
             (method url-fetch)
             (uri (string-append "ftp://www.eecs.harvard.edu/pub/nr/noweb-"
                                 version ".tgz"))
             (sha256
              (base32
               "10hdd6mrk26kyh4bnng4ah5h1pnanhsrhqa7qwqy6dyv3rng44y9"))))
    (build-system gnu-build-system)
    (arguments
     '(#:phases (alist-cons-before
                 'install 'pre-install
                 (lambda* (#:key outputs #:allow-other-keys)
                   (let ((out (assoc-ref outputs "out")))
                     (mkdir-p (string-append out "/share/texmf/tex/latex"))
                     #t))
                 (alist-cons-after
                  'install 'post-install
                  (lambda* (#:key outputs inputs #:allow-other-keys)
                    (let ((out (assoc-ref outputs "out"))
                          (cu  (assoc-ref inputs "coreutils"))
                          (du  (assoc-ref inputs "diffutils")))
                      (with-directory-excursion out
                        (for-each (lambda (prog)
                                    (substitute* prog
                                      (("nawk") (which "awk"))))
                                  (append (map (lambda (x)
                                                 (string-append "bin/" x))
                                               '("noweb" "nountangle"
                                                 "noroots" "noroff"
                                                 "noindex"))
                                          (map (lambda (x)
                                                 (string-append "lib/" x))
                                               '("btdefn" "emptydefn" "noidx"
                                                 "pipedocs" "toascii" "tohtml"
                                                 "toroff" "totex" "unmarkup"))))
                        (substitute* "bin/cpif"
                          (("^PATH=.*$")
                           (string-append "PATH=" cu "/bin:" du "/bin\n"))))
                      #t))
                  (alist-replace
                   'configure
                   (lambda _
                     ;; Jump in the source.
                     (chdir "src")

                     ;; The makefile reads "source: FAQ", but FAQ isn't
                     ;; available.
                     (substitute* "Makefile"
                       (("FAQ") "")))
                   %standard-phases)))
       #:make-flags (let ((out (assoc-ref %outputs "out")))
                      (list (string-append "BIN=" out "/bin")
                            (string-append "LIB=" out "/lib")
                            (string-append "MAN=" out "/share/man")
                            (string-append "TEXINPUTS=" out
                                           "/share/texmf/tex/latex")))
       #:tests? #f))                              ; no tests
    (home-page "http://www.cs.tufts.edu/~nr/noweb/")
    (synopsis "Literate programming tool")
    (description
     "Noweb is designed to meet the needs of literate programmers while
remaining as simple as possible.  Its primary advantages are simplicity,
extensibility, and language-independence—especially noticeable when compared
with other literate-programming tools.  noweb uses 5 control sequences to
WEB's 27.  The noweb manual is only 4 pages; an additional page explains how
to customize its LaTeX output.  noweb works “out of the box” with any
programming language, and supports TeX, LaTeX, HTML, and troff back ends.")
    (license (fsf-free "http://www.cs.tufts.edu/~nr/noweb/#copyright"))))
47'>247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015 David Thompson <davet@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 kodi)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix utils)
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages algebra)
  #:use-module (gnu packages audio)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages avahi)
  #:use-module (gnu packages base)
  #:use-module (gnu packages boost)
  #:use-module (gnu packages cdrom)
  #:use-module (gnu packages cmake)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages curl)
  #:use-module (gnu packages databases)
  #:use-module (gnu packages documentation)
  #:use-module (gnu packages fontutils)
  #:use-module (gnu packages fribidi)
  #:use-module (gnu packages gettext)
  #:use-module (gnu packages ghostscript)
  #:use-module (gnu packages gawk)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gperf)
  #:use-module (gnu packages gnunet)
  #:use-module (gnu packages gnupg)
  #:use-module (gnu packages image)
  #:use-module (gnu packages java)
  #:use-module (gnu packages libusb)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages mp3)
  #:use-module (gnu packages pcre)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages pulseaudio)
  #:use-module (gnu packages python)
  #:use-module (gnu packages samba)
  #:use-module (gnu packages sdl)
  #:use-module (gnu packages ssh)
  #:use-module (gnu packages swig)
  #:use-module (gnu packages textutils)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages video)
  #:use-module (gnu packages web)
  #:use-module (gnu packages xdisorg)
  #:use-module (gnu packages xiph)
  #:use-module (gnu packages xml)
  #:use-module (gnu packages xorg)
  #:use-module (gnu packages yasm)
  #:use-module (gnu packages zip))

(define-public crossguid
  (let ((commit "8f399e8bd4252be9952f3dfa8199924cc8487ca4"))
    (package
      (name "crossguid")
      (version (string-append "0.0-1." (string-take commit 7)))
      ;; There's no official release.  Just a Git repository.
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://github.com/graeme-hill/crossguid.git")
                      (commit commit)))
                (file-name (string-append name "-" version "-checkout"))
                (sha256
                 (base32
                  "1i29y207qqddvaxbn39pk2fbh3gx8zvdprfp35wasj9rw2wjk3s9"))))
      (build-system gnu-build-system)
      (arguments
       '(#:phases
         (modify-phases %standard-phases
           (delete 'configure) ; no configure script
           ;; There's no build system here, so we have to do it ourselves.
           (replace 'build
             (lambda _
               (and (zero? (system* "g++" "-c" "guid.cpp" "-o" "guid.o"
                                    "-std=c++11" "-DGUID_LIBUUID"))
                    (zero? (system* "ar" "rvs" "libcrossguid.a" "guid.o")))))
           (replace 'check
             (lambda _
               (and (zero? (system* "g++" "-c" "test.cpp" "-o" "test.o"
                                    "-std=c++11"))
                    (zero? (system* "g++" "-c" "testmain.cpp" "-o" "testmain.o"
                                    "-std=c++11"))
                    (zero? (system* "g++" "test.o" "guid.o" "testmain.o"
                                    "-o" "test" "-luuid"))
                    (zero? (system* (string-append (getcwd) "/test"))))))
           (replace 'install
             (lambda* (#:key outputs #:allow-other-keys)
               (let ((out (assoc-ref outputs "out")))
                 (install-file "guid.h" (string-append out "/include"))
                 (install-file "libcrossguid.a"
                               (string-append out "/lib"))
                 #t))))))
      (inputs
       `(("util-linux" ,util-linux)))
      (synopsis "Lightweight universal identifier library")
      (description "CrossGuid is a minimal GUID/UUID
generator library for C++.")
      (home-page "https://github.com/graeme-hill/crossguid")
      (license license:expat))))

(define-public kodi
  (package
    (name "kodi")
    (version "16.0")
    (source (origin
              (method url-fetch)
              (uri (string-append "http://mirrors.kodi.tv/releases/source/"
                                  version "-Jarvis.tar.gz"))
              (file-name (string-append name "-" version ".tar.gz"))
              (sha256
               (base32
                "0iirspvv7czf785l2lqf232dvdaj87srbn9ni97ngvnd6w9yl884"))
              (snippet
               ;; Delete bundled ffmpeg.
               ;; TODO: Delete every other bundled library.
               '(begin
                  (use-modules (guix build utils))
                  (delete-file-recursively "tools/depends/target/ffmpeg")))
              (modules '((guix build utils)))))
    (build-system gnu-build-system)
    (arguments
     '(#:configure-flags '("--with-ffmpeg=shared") ; don't use bundled ffmpeg
       #:phases
       (modify-phases %standard-phases
         ;; JsonSchemaBuilder is a small tool needed by the build system that
         ;; comes bundled with the source.  The build system tries to build it
         ;; during the bootstrapping phase, which causes serious issues
         ;; because there's no time for shebangs to be patched.  So, we
         ;; bootstrap it on our own instead.
         (add-after 'unpack 'bootstrap-jsonschemabuilder
           (lambda* (#:key inputs #:allow-other-keys)
             (let ((dir "tools/depends/native/JsonSchemaBuilder/src"))
               (with-directory-excursion dir
                 (zero? (system* "sh" "autogen.sh"))))))
         ;; Now we can do the regular bootstrapping process, but only after
         ;; the first round of shebang patching.  We must repeat the patching
         ;; after bootstrapping so that all of the files generated by the
         ;; Autotools et al. are patched appropriately.
         (add-after 'patch-source-shebangs 'bootstrap
           (lambda* (#:key inputs #:allow-other-keys)
             ;; We bootstrapped JsonSchemaBuilder in the previous phase, so we
             ;; need to make sure it isn't done a second time.  Otherwise, it
             ;; would undo the shebang patching that we worked so hard for.
             (substitute* '("tools/depends/native/JsonSchemaBuilder/Makefile")
               (("\\./autogen\\.sh") ""))
             ;; This essentially does what their 'bootstrap' script does, but
             ;; additionally passes the correct CONFIG_SHELL.
             (let ((bash (string-append (assoc-ref inputs "bash") "/bin/sh")))
               (define (run-make makefile)
                 (zero? (system* "make" "-f" makefile
                                 "BOOTSTRAP_STANDALONE=1"
                                 (string-append "CONFIG_SHELL=" bash))))
               (and (run-make "bootstrap.mk")
                    (run-make "codegenerator.mk")))))
         (add-after 'bootstrap 'patch-source-shebangs-again
           (assoc-ref %standard-phases 'patch-source-shebangs))
         ;; 3 tests fail that appear harmless, so we disable them.
         (add-before 'check 'disable-some-tests
           (lambda _
             (substitute* '("xbmc/utils/test/TestSystemInfo.cpp")
               (("TEST_F\\(TestSystemInfo, GetOsPrettyNameWithVersion\\)")
                "TEST_F(TestSystemInfo, DISABLED_GetOsPrettyNameWithVersion)")
               (("TEST_F\\(TestSystemInfo, GetOsName\\)")
                "TEST_F(TestSystemInfo, DISABLED_GetOsName)")
               (("TEST_F\\(TestSystemInfo, GetOsVersion\\)")
                "TEST_F(TestSystemInfo, DISABLED_GetOsVersion)")))))))
    ;; TODO: Add dependencies for:
    ;; - vdpau
    ;; - nfs
    ;;
    ;; FIXME: libusb detection fails.
    ;;
    ;; FIXME: As you can see, we use a lot of external libraries, but it seems
    ;; that a few bundled ones are still being used.
    (native-inputs
     `(("autoconf" ,autoconf)
       ("automake" ,automake)
       ("cmake" ,cmake)
       ("doxygen" ,doxygen)
       ("gawk" ,gawk)
       ("gettext" ,gnu-gettext)
       ("icedtea" ,icedtea) ; needed at build-time only, mandatory
       ("libtool" ,libtool)
       ("pkg-config" ,pkg-config)
       ("swig" ,swig)
       ("which" ,which)
       ("yasm" ,yasm)))
    (inputs
     `(("alsa-lib" ,alsa-lib)
       ("avahi" ,avahi)
       ("bluez" ,bluez)
       ("boost" ,boost)
       ("bzip2" ,bzip2)
       ("crossguid" ,crossguid)
       ("curl" ,curl)
       ("dcadec" ,dcadec)
       ("dbus" ,dbus)
       ("enca" ,enca)
       ("eudev" ,eudev)
       ("ffmpeg" ,ffmpeg)
       ("flac" ,flac)
       ("fontconfig" ,fontconfig)
       ("freetype" ,freetype)
       ("fribidi" ,fribidi)
       ("glew" ,glew)
       ("gnutls" ,gnutls)
       ("gperf" ,gperf)
       ("jasper" ,jasper)
       ("lame" ,lame)
       ("libass" ,libass)
       ("libbluray" ,libbluray)
       ("libcap" ,libcap)
       ("libcdio" ,libcdio)
       ("libgcrypt" ,libgcrypt)
       ("libjpeg" ,libjpeg)
       ("libltdl" ,libltdl)
       ("libmad" ,libmad)
       ("libmicrohttpd" ,libmicrohttpd)
       ("libmodplug" ,libmodplug)
       ("libmpeg2" ,libmpeg2)
       ("libogg" ,libogg)
       ("libpng" ,libpng)
       ("libsamplerate" ,libsamplerate)
       ("libssh" ,libssh)
       ("libtiff" ,libtiff)
       ("libva" ,libva)
       ("libvorbis" ,libvorbis)
       ("libxml2" ,libxml2)
       ("libxmu" ,libxmu)
       ("libxrandr" ,libxrandr)
       ("libxrender" ,libxrender)
       ("libxslt" ,libxslt)
       ("libxt" ,libxt)
       ("libyajl" ,libyajl)
       ("lzo" ,lzo)
       ("mesa-utils" ,mesa-utils)
       ("mysql" ,mysql)
       ("openssl" ,openssl)
       ("pcre" ,pcre)
       ("pulseaudio" ,pulseaudio)
       ("python" ,python-2)
       ("samba" ,samba)
       ("sdl2" ,sdl2)
       ("sqlite" ,sqlite)
       ("taglib" ,taglib)
       ("tinyxml" ,tinyxml)
       ("unzip" ,unzip)
       ("util-linux" ,util-linux)
       ("zip" ,zip)
       ("zlib" ,zlib)))
    (synopsis "Media center for home theater computers")
    (description "Kodi is a media center application for playing videos,
music, games, etc.  Kodi is highly customizable and features a theme and
plug-in system.")
    (home-page "http://kodi.tv")
    (license license:gpl2+)))