unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: [PATCH]: gnu: shogun: Remove non-free source files.
Date: Thu, 21 May 2015 21:52:47 +0200	[thread overview]
Message-ID: <87r3q91ze8.fsf@gnu.org> (raw)
In-Reply-To: <idjh9r6i74r.fsf@bimsb-sys02.mdc-berlin.net> (Ricardo Wurmus's message of "Thu, 21 May 2015 11:59:00 +0200")

Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:

> Attached is a patch to remove non-free source files as well as anything
> in a "#ifdef USE_SVMLIGHT ... #endif" block.

Good!

> From d409756bd2fc2db396d6257cfed42a213f6f43f6 Mon Sep 17 00:00:00 2001
> From: Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de>
> Date: Fri, 8 May 2015 16:53:28 +0200
> Subject: [PATCH] gnu: shogun: Remove non-free source files.
>
> * gnu/packages/bioinformatics.scm (shogun)[source]: Add snippet to remove
>   non-free sources.

[...]

> +           ;; Remove non-free functions.
> +           (for-each
> +            (lambda (file)
> +              (with-atomic-file-replacement file
> +                (lambda (in out)
> +                  (let loop ((line (read-line in 'concat))
> +                             (skipping? #f))
> +                    (if (eof-object? line)
> +                        #t
> +                        (let ((skip-next?
> +                               (or (and skipping?
> +                                        (not (string-prefix?
> +                                              "#endif //USE_SVMLIGHT" line)))
> +                                   (string-prefix?
> +                                    "#ifdef USE_SVMLIGHT" line))))
> +                          (when (or (not skipping?)
> +                                    (and skipping? (not skip-next?)))
> +                            (display line out))
> +                          (loop (read-line in 'concat) skip-next?)))))))
> +            (find-files "src/shogun/kernel/"
> +                        "^Kernel\\.(cpp|h)"))))))

It would be nicer to give the lambda a name, like:

  (define (delete-ifdefs file)
    ...)

  ...

  (for-each delete-ifdefs (find-files ...))

OK to push with this change.

Thanks for working on it!

Ludo’.

  reply	other threads:[~2015-05-21 19:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-08 14:56 [PATCH]: gnu: shogun: Remove non-free source files Ricardo Wurmus
2015-05-08 17:30 ` Ludovic Courtès
2015-05-09  5:15 ` Mark H Weaver
2015-05-09 13:49   ` Ludovic Courtès
2015-05-09 16:41     ` Mark H Weaver
2015-05-15 15:01       ` Ricardo Wurmus
2015-05-15 16:56         ` Ludovic Courtès
2015-05-21  9:59           ` Ricardo Wurmus
2015-05-21 19:52             ` Ludovic Courtès [this message]
2015-05-21 19:55             ` Ludovic Courtès
2015-05-09 21:06     ` Ricardo Wurmus

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=87r3q91ze8.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=ricardo.wurmus@mdc-berlin.de \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).