From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark H Weaver Subject: Re: [PATCH]: gnu: shogun: Remove non-free source files. Date: Sat, 09 May 2015 12:41:37 -0400 Message-ID: <87mw1dputa.fsf@netris.org> References: <87a8xeqqk7.fsf@netris.org> <871tipj1xq.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52568) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yr7p1-0000Jw-8v for guix-devel@gnu.org; Sat, 09 May 2015 12:41:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yr7ox-0004yR-TG for guix-devel@gnu.org; Sat, 09 May 2015 12:41:51 -0400 In-Reply-To: <871tipj1xq.fsf@gnu.org> ("Ludovic \=\?utf-8\?Q\?Court\=C3\=A8s\=22'\?\= \=\?utf-8\?Q\?s\?\= message of "Sat, 09 May 2015 15:49:37 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel ludo@gnu.org (Ludovic Court=C3=A8s) writes: > Mark H Weaver skribis: > >> Ricardo Wurmus writes: > > [...] > >>> There are functions in src/shogun/kernel/Kernel.{cpp,h} that are also >>> released under non-free terms, but they are enclosed in #ifdef >>> statements and the make flags we pass disable these functions at build >>> time. >> >> This is not sufficient. We will need to completely remove the non-free >> functions from the source code using a snippet. We cannot use a patch >> because the patch would contain the non-free code. > > Indeed (I thought Kernel.{cpp,h} were the files being removed.) > > I guess there are two ways to address this: have a snippet that reads > these two files line by line (with =E2=80=98read-line=E2=80=99 from (ice-= 9 rdelim)) and > dismisses files within the #ifdef. > > If that turns out to be impractical, for instance because there are > nested #ifdefs or computed conditionals, then we=E2=80=99ll have to host a > cleaned up source tarball or repo somewhere. There's another option that might be better: instead of reading the file line-by-line, read the entire file into a single string, and then use regexps to find the relevant section and remove it. It might even be possible to do it with a single regexp substitution. Mark