aboutsummaryrefslogtreecommitdiff
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2020 Ryan Prior <rprior@protonmail.com>
;;; Copyright © 2020 Tobias Geerinckx-Rice <me@tobias.gr>
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2021 (unmatched parenthesis <paren@disroot.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 vlang)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages node)
  #:use-module (gnu packages sqlite)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages version-control)
  #:use-module (gnu packages xorg)
  #:use-module (guix build-system gnu)
  #:use-module (guix git-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix utils)
  #:use-module (guix packages))

(define-public vlang
  (package
   (name "vlang")
   (version "0.2.4")
   (source
    (origin
     (method git-fetch)
     (uri (git-reference
           (url "https://github.com/vlang/v")
           (commit version)))
     (file-name (git-file-name name version))
     (sha256
      (base32 "17wmjxssmg6kd4j8i6pgib452zzwvkyi3n1znd1jj3xkf2l92fw8"))))
   (build-system gnu-build-system)
   (arguments
    `(#:make-flags
      (list (string-append "CC=" ,(cc-for-target))
            "TMPTCC=tcc"
            (string-append "VC=" (assoc-ref %build-inputs "vc"))
            "GITCLEANPULL=true"
            "GITFASTCLONE=mkdir -p"
            "TCCREPO="
            "VCREPO="
            (string-append "VFLAGS=-cc " ,(cc-for-target))
            "VERBOSE=1")
      #:phases
      (modify-phases %standard-phases
        (delete 'configure)
        (add-before 'build 'change-home
          (lambda _
            (setenv "HOME" "/tmp")
            #t))
        (add-before 'build 'patch-makefile
          (lambda _
            (substitute* "Makefile"
              (("--branch thirdparty-unknown-unknown") "")
              (("rm -rf") "true"))
            #t))
        (add-before 'check 'delete-failing-tests
          ;; XXX As always, these should eventually be fixed and run.
          (lambda _
            (for-each delete-file
                      '("vlib/os/notify/notify_test.v"
                        "vlib/v/doc/doc_private_fn_test.v"
                        "vlib/v/live/live_test.v"
                        "vlib/v/tests/repl/repl_test.v"
                        "vlib/v/tests/valgrind/valgrind_test.v"))
            #t))
        (replace 'check
          (lambda* (#:key tests? #:allow-other-keys)
            (let* ((bin "tmp/bin")
                   (gcc (which "gcc")))
              (when tests?
                (mkdir-p bin)
                (symlink gcc (string-append bin "/cc"))
                (setenv "PATH" (string-append bin ":" (getenv "PATH")))
                (invoke "./v" "test-self")))
            #t))
        (replace 'install
          (lambda* (#:key outputs #:allow-other-keys)
            (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
                   (docs (string-append bin "/cmd/v/help"))
                   (tools (string-append bin "/cmd/tools"))
                   (thirdparty (string-append bin "/thirdparty"))
                   (vlib (string-append bin "/vlib"))
                   (vmod (string-append bin "/v.mod")))
              (mkdir-p bin)
              (copy-file "./v" (string-append bin "/v"))
              ;; v requires as of 0.2.4 that these other components are in the
              ;; same directory. In a future release we may be able to move
              ;; these into other output folders.
              (copy-recursively "cmd/tools" tools)
              (copy-recursively "cmd/v/help" docs)
              (copy-recursively "thirdparty" thirdparty)
              (copy-recursively "vlib" vlib)
              (copy-file "v.mod" vmod))
            #t)))))
   (inputs
    (list glib))
   (native-inputs
    `(("vc"
       ;; Versions are not consistently tagged, but the matching commit will
       ;; probably have ‘v0.x.y’ in the commit message.
       ,(let ((vc-version "5e876c1491db50b136499d3397b57b7c062040e5"))
          ;; v bootstraps from generated c source code from a dedicated
          ;; repository. It's readable, as generated source goes, and not at all
          ;; obfuscated, and it's about 15kb. The original source written in
          ;; golang is lost to the forces of entropy; modifying the generated c
          ;; source by hand has been a commonly used technique for iterating on
          ;; the codebase.
          (origin
            (method git-fetch)
            (uri (git-reference
                  (url "https://github.com/vlang/vc")
                  (commit vc-version)))
            (file-name (git-file-name "vc" vc-version))
            (sha256
             (base32 "1gxdkgc7aqw5f0fhch1n6nhzgzvgb49p77idx1zj7wcp53lpx5ng")))))
      ("git" ,git-minimal)
      ;; For the tests.
      ("libx11" ,libx11)
      ("node" ,node-lts)
      ("openssl" ,openssl)
      ("sqlite" ,sqlite)))
   (home-page "https://vlang.io/")
   (synopsis "Compiler for the V programming language")
   (description
    "V is a systems programming language.  It provides memory safety and thread
safety guarantees with minimal abstraction.")
   (license license:expat)))
ostscript.scm (lcms)[inputs]: Likewise. (ghostscript)[inputs, native-inputs]: Likewise. * gnu/packages/gimp.scm (gegl, gimp)[inputs]: Likewise. * gnu/packages/gnome.scm (libgnomeui, eog, tracker-miners, gthumb)[inputs]: Likewise. * gnu/packages/gnunet.scm (libextractor)[inputs]: Likewise. * gnu/packages/gnustep.scm (windowmaker)[inputs]: Likewise. * gnu/packages/graphics.scm (blender, blender-2.79, openimageio, openscenegraph, openscenegraph-3.4, povray, fgallery)[inputs]: Likewise. * gnu/packages/graphviz.scm (graphviz)[inputs]: Likewise. * gnu/packages/gstreamer.scm (gst-plugins-good)[inputs]: Likewise. * gnu/packages/gtk.scm (gdk-pixbuf)[inputs]: Likewise. * gnu/packages/image-processing.scm (dcmtk, mia, vtk, opencv, vips, nip2, vxl, insight-toolkit)[inputs]: Likewise. * gnu/packages/image-viewers.scm (gpicview, luminance-hdr)[inputs]: Likewise. * gnu/packages/image.scm (jpegoptim, libtiff, leptonica, imlib2, freeimage, vigra, libwebp, libmng, jasper, steghide, jp2a)[inputs]: Likewise. * gnu/packages/imagemagick.scm (imagemagick, graphicsmagick)[inputs]: Likewise. * gnu/packages/java.scm (icedtea-6, icedtea-7, openjdk9, openjdk11, openjdk12)[inputs]: Likewise. * gnu/packages/kde-frameworks.scm (khtml)[inputs]: Likewise. * gnu/packages/kodi.scm (kodi)[inputs]: Likewise. * gnu/packages/machine-learning.scm (dlib, tensorflow)[inputs]: Likewise. * gnu/packages/mate.scm (atril, eom)[inputs]: Likewise. * gnu/packages/maths.scm (hdf4, hdf-java, hdf-eos2, netcdf)[inputs]: Likewise. * gnu/packages/netpbm.scm (netpbm)[inputs]: Likewise. * gnu/packages/pdf.scm (zathura-pdf-mupdf, podofo, mupdf, fbida)[inputs]: Likewise. * gnu/packages/photo.scm (libraw, libpano13, enblend-enfuse, darktable, hugin, rawtherapee)[inputs]: Likewise. * gnu/packages/prolog.scm (swi-prolog)[native-inputs]: Likewise. * gnu/packages/python-xyz.scm (python-hdf4, python-pillow)[inputs]: Likewise. * gnu/packages/qt.scm (qtbase, qtwebkit)[inputs]: Likewise. * gnu/packages/rdesktop.scm (freerdp)[inputs]: Likewise. * gnu/packages/scanner.scm (sane-backends, xsane)[inputs]: Likewise. * gnu/packages/scheme.scm (racket)[inputs]: Likewise. * gnu/packages/scribus.scm (scribus)[inputs]: Likewise. * gnu/packages/sdl.scm (sdl-image)[propagated-inputs]: Likewise. (guile-sdl)[native-inputs]: Likewise. * gnu/packages/spice.scm (spice-gtk)[inputs]: Likewise. * gnu/packages/statistics.scm (r-with-tests)[inputs]: Likewise. * gnu/packages/tcl.scm (perl-tk)[inputs]: Likewise. * gnu/packages/upnp.scm (readymedia)[inputs]: Likewise. * gnu/packages/video.scm (mplayer, mpv, v4l-utils, motion)[inputs]: Likewise. * gnu/packages/web-browsers.scm (dillo, links)[inputs]: Likewise. * gnu/packages/web.scm (netsurf)[inputs]: Likewise. * gnu/packages/webkit.scm (webkitgtk)[inputs]: Likewise. * gnu/packages/wine.scm (wine)[inputs]: Likewise. * gnu/packages/wv.scm (wv)[inputs]: Likewise. * gnu/packages/wxwidgets.scm (wxwidgets, wxwidgets-2)[inputs]: Likewise. * gnu/packages/xdisorg.scm (xscreensaver)[inputs]: Likewise. * gnu/packages/xfce.scm (tumbler)[inputs]: Likewise. * gnu/packages/xfig.scm (xfig, transfig)[inputs]: Likewise. * gnu/packages/xorg.scm (xpra)[inputs]: Likewise. Marius Bakke 2020-01-19gnu: ImageMagick: Update to 6.9.10-87....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-87. Marius Bakke 2019-12-13Merge branch 'master' into stagingBrett Gilio 2019-12-12gnu: graphicsmagick: Update to 1.3.33....* gnu/packages/imagemagick.scm (graphicsmagick): Update to 1.3.33. Tobias Geerinckx-Rice 2019-12-11gnu: imagemagick: Update to 6.9.10-78....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-78. Marius Bakke 2019-10-08gnu: imagemagick: Update to 6.9.10-68....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-68. Marius Bakke 2019-08-04gnu: ImageMagick: Update to 6.9.10-58....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-58. Marius Bakke 2019-07-04Merge branch 'master' into stagingMarius Bakke 2019-07-03gnu: GraphicsMagick: Update to 1.3.32....* gnu/packages/imagemagick.scm (graphicsmagick): Update to 1.3.32. Leo Famulari 2019-07-02gnu: ImageMagick: Update to 6.9.10-51....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-51. Marius Bakke 2019-06-30gnu: ImageMagick: Update to 6.9.10-50....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-50. Marius Bakke 2019-06-14gnu: imagemagick: Update to 6.9.10-49....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-49. Marius Bakke 2019-05-24gnu: imagemagick: Update to 6.9.10-46....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-46. Marius Bakke 2019-05-13gnu: ImageMagick: Update to 6.9.10-45....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-45. Marius Bakke 2019-05-04gnu: imagemagick: Update to 6.9.10-42....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-42. Marius Bakke 2019-04-01gnu: ImageMagick: Update to 6.9.10-35....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-35. Marius Bakke 2019-03-23gnu: imagemagick: Update to 6.9.10-34....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-34. Marius Bakke 2019-03-23Merge branch 'master' into stagingMarius Bakke 2019-03-22gnu: graphicsmagick: Update to 1.3.31....* gnu/packages/imagemagick.scm (graphicsmagick): Update to 1.3.31. Tobias Geerinckx-Rice 2019-03-22gnu: graphicsmagick: Don't use NAME in source URI....* gnu/packages/imagemagick.scm (graphicsmagick)[source]: Hard-code NAME. Tobias Geerinckx-Rice 2019-02-10gnu: ImageMagick: Update to 6.9.10-27....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-27. Marius Bakke 2018-12-12gnu: ImageMagick: Update to 6.9.9-16....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.9-16. Marius Bakke 2018-12-04gnu: imagemagick: Update to 6.9.10-15....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-15. Marius Bakke 2018-11-14gnu: ImageMagick: Update to 6.9.10-14....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-14. Alex Vong 2018-10-12gnu: ImageMagick: Update to 6.9.10-12....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-12. Leo Famulari 2018-08-22gnu: ImageMagick: Update to 6.9.10-10....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-10. Leo Famulari 2018-08-22gnu: GraphicsMagick: Update to 1.3.30....* gnu/packages/imagemagick.scm (graphicsmagick): Update to 1.3.30. Leo Famulari 2018-08-11Migrate search.cpan.org home pages to metacpan.org....The venerable search.cpan.org has retired[0]. [0]: https://log.perl.org/2018/05/goodbye-search-dot-cpan-dot-org.html * guix/import/cpan.scm (cpan-home): Generate metacpan.org home page URIs. Update all previously generated ones in (gnu packages) to their canonical new homes. Tobias Geerinckx-Rice 2018-07-27gnu: imagemagick: Update to 6.9.10-8....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-8. Marius Bakke 2018-07-08gnu: imagemagick: Update to 6.9.10-5....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-5. Marius Bakke 2018-06-28gnu: imagemagick: Update to 6.9.10-3....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.10-3. Marius Bakke 2018-05-17Merge branch 'master' into core-updatesMark H Weaver 2018-05-17gnu: graphicsmagick: Update to 1.3.29....* gnu/packages/imagemagick.scm (graphicsmagick): Update to 1.3.29. Tobias Geerinckx-Rice 2018-05-13gnu: ImageMagick: Update to 6.9.9-43....* gnu/packages/imagemagick.scm (imagemagick): Update to 6.9.9-43. Leo Famulari