all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Simon Tournier <zimon.toutoune@gmail.com>
To: Rodrigo Morales <moralesrodrigo1100@gmail.com>, help-guix@gnu.org
Subject: Re: Most used and least used build-system in Guix packages
Date: Thu, 13 Apr 2023 11:40:30 +0200	[thread overview]
Message-ID: <863554t90x.fsf@gmail.com> (raw)
In-Reply-To: <CAGxMbPZ7OFMfhmrwtJxymZJHsqu0DamRC=innQd99XOaSuQwBA@mail.gmail.com>

Hi,

On Wed, 12 Apr 2023 at 23:04, Rodrigo Morales <moralesrodrigo1100@gmail.com> wrote:

>   Today, I was wondering what the most used build system and the least
>   one are. The most used build system is `gnu-build-system'. The least
>   used build system is `dub-build-system'. Here's how I found that out.

Please give a look at:

    https://issues.guix.gnu.org/msgid/Y0ZgY7ifJg0vkZxB@bluewin.ch

(Argh I am so late for completing the review of this!)

It comes from:
<https://10years.guix.gnu.org/video/guix-repl-to-infinity-and-beyond/>
where some examples traverse all the packages and collect build system
by build system if the modify the field ’arguments’.


Well, here an example to list the most used methods in ’origin’ field.

--8<---------------cut here---------------start------------->8---
$ cat sources.scm
(use-modules (guix)
             (guix git-download)
             (guix hg-download)
             (guix svn-download)
             (guix cvs-download)
             (guix bzr-download)
             (gnu)
             (ice-9 match)
             (srfi srfi-1)
             (srfi srfi-26))

(define packages-with-source
  (fold-packages (lambda (package result)
                   (if (origin? (package-source package))
                     (cons package result)
                     result))
                 '()))

(map (lambda (package)
       (let* ((origin (package-source package))
              (method (origin-method origin))
              (str (cond ((or (eq? method url-fetch)
                              (eq? method url-fetch/tarbomb)
                              (eq? method url-fetch/zipbomb)) "url-fetch")
                         ((eq? method git-fetch) "git-fetch")
                         ((eq? method hg-fetch) "hg-fetch")
                         ((or (eq? method svn-fetch)
                              (eq? method svn-multi-fetch)) "svn-fetch")
                         ((eq? method cvs-fetch) "cvs-fetch")
                         ((eq? method bzr-fetch) "bzr-fetch")
                         (else "other"))))
         (format #t (string-append str "~%"))))
     packages-with-source)

$ guix repl -- sources.scm | sort | uniq -c | sort -rn
  13600 url-fetch
   8047 git-fetch
    458 svn-fetch
     38 other
     32 hg-fetch
      5 bzr-fetch
      2 cvs-fetch
--8<---------------cut here---------------end--------------->8---


Hope that helps.

Cheers,
simon


  parent reply	other threads:[~2023-04-13 10:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-12 23:04 Most used and least used build-system in Guix packages Rodrigo Morales
2023-04-13  1:55 ` Maxim Cournoyer
2023-04-13  9:40 ` Simon Tournier [this message]
2023-04-13 17:12 ` Martin Castillo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=863554t90x.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=help-guix@gnu.org \
    --cc=moralesrodrigo1100@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.