From mboxrd@z Thu Jan 1 00:00:00 1970 From: zimoun Subject: Re: [External] Re: New outreachy participant introduction Date: Tue, 8 Oct 2019 15:24:19 +0200 Message-ID: References: <1570119118548.1674@iu.edu> <1570504991415.84097@iu.edu> <87a7abag1z.fsf@cbaines.net> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:41576) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iHpTh-0007ad-Fk for guix-devel@gnu.org; Tue, 08 Oct 2019 09:24:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iHpTb-00074B-VB for guix-devel@gnu.org; Tue, 08 Oct 2019 09:24:37 -0400 Received: from mail-qk1-x72a.google.com ([2607:f8b0:4864:20::72a]:37169) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iHpTb-00073C-QN for guix-devel@gnu.org; Tue, 08 Oct 2019 09:24:31 -0400 Received: by mail-qk1-x72a.google.com with SMTP id u184so16707991qkd.4 for ; Tue, 08 Oct 2019 06:24:31 -0700 (PDT) In-Reply-To: <87a7abag1z.fsf@cbaines.net> 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" To: Christopher Baines Cc: Guix Devel Hi Nardos, Welcome ! :-) On Tue, 8 Oct 2019 at 08:48, Christopher Baines wrote: > One good starting point would be an importer, there are a set of > importers included in Guix that take a package definition from somewhere > else (like the Python package index, or Rubygems) and try to generate a > Guix package definition. If you're familiar with some packages from one > of the collections with a corresponding importer, that might be a good > place to start. As an example, let consider packages from BioConductor [1] (mainly R packages used in bioinformatics field). If I have right, then 2002 packages are still missing in Guix, so there is materials. ;-) Well, let's pick one which is not packaged yet: zinbwave [2]. Then it is easy: guix import cran -r -a bioconductor zinbwave This will download TAR archives and automatically compute the hash. It corresponds to the manual: guix download https://bioconductor.org/packages/release/bioc/src/contrib/zinbwave_1.6.0.tar.gz [1] https://bioconductor.org/ [2] https://bioconductor.org/packages/release/bioc/html/zinbwave.html Moreover, the importer provides the definition of the package: --8<---------------cut here---------------start------------->8--- (define-public r-zinbwave (package (name "r-zinbwave") (version "1.6.0") (source (origin (method url-fetch) (uri (bioconductor-uri "zinbwave" version)) (sha256 (base32 "187r7l9jf2q74qaqx63df5zx6iphmvl817448balvfv9vqyhrp2j")))) (properties `((upstream-name . "zinbwave"))) (build-system r-build-system) (propagated-inputs `(("r-biocparallel" ,r-biocparallel) ("r-copula" ,r-copula) ("r-edger" ,r-edger) ("r-genefilter" ,r-genefilter) ("r-glmnet" ,r-glmnet) ("r-matrix" ,r-matrix) ("r-singlecellexperiment" ,r-singlecellexperiment) ("r-softimpute" ,r-softimpute) ("r-summarizedexperiment" ,r-summarizedexperiment))) (home-page "https://bioconductor.org/packages/zinbwave") (synopsis "Zero-Inflated Negative Binomial Model for RNA-Seq Data") (description " Implements a general and flexible zero-inflated negative binomial model that can be used to provide a low-dimensional representations of single-cell RNA-seq data. The model accounts for zero inflation (dropouts), over-dispersion, and the count nature of the data. The model also accounts for the difference in library sizes and optionally for batch effects and/or other covariates, avoiding the need for pre-normalize the data.") (license artistic2.0))) --8<---------------cut here---------------end--------------->8--- In the propagated input, you can see the package `r-copula` which is not yet packaged neither. But, the nice option --recursive does the job for you and it also gives you the package definition. Now, let add them to the Guix source. Clone the repo and go in the folder. The command: guix environment guix will download the dependencies to build Guix and setup all the variables correctly. Well, refer to the documentation to compile Guix from source. Basically: ./bootstrap ./configure --localstatedir=/var make Now, you can run this version with ./pre-inst-env, for example: ./pre-inst-env guix describe Well, ready to add one package! For example, add `r-copula` to the file gnu/package/cran.scm then recompile with make. Check if it is ok: ./pre-inst-env guile show r-copula Ouch! `r-psline` is missing so let also add it (the definition was provided by the importer), run make again. Now "./pre-inst-env guix show r-copula" should work. Add the package definition of zinbwave to the file gnu/package/bioconductor.scm. Let build them: ./pre-inst-env guix build r-zinbwave and time to breath. ;-) If something fails, try to investigate by yourself and do not hesitate to ask advices or help. If everything is ok, the package still needs some polishing: synopsis, description, indentation, etc and really important: check the license field. The next step is to commit the changes. In this case, three commits (one per package) seem nice. Give a look to previous commits as example of commit message (ChangeLog format, etc.). Now, it is time to prepare the submission: git format-patch --cover-letter - o patches master this will create the 3 patches in the folder patches/ and one cover letter. Edit the cover letter to describe what the patches are about then submit it to the bug tracker: git send-email --to=guix-patches@gnu.org patches/0000-cover-letter.patch Wait the answer to the bug tracker. You should receive an email (if your .gitconfig is ok) with the bug number. Last submit the patches: git send-email --to=ABCDEF@debbugs.gnu.org patches/000{1,2,3}-* where ABCDEF is the bug number. Well, if you need some inspiration to find unpackaged tools from BioConductor: wget https://git.bioconductor.org -qO - | sed -ne '/packages\/[a-zA-Z]/{s,^.*R.*packages/,,p}' > bioc_manifest ./pre-inst-env guile --no-auto-compile missing-bioconductor.scm bioc_manifest where the file `missing-bioconductor.scm` is given by: --8<---------------cut here---------------start------------->8--- (use-modules ((guix import utils) #:select (guix-name)) (gnu packages) (srfi srfi-1) ;lists (ice-9 textual-ports)) (define (fetch-names manifest) "Return a list of strings, each corresponding to a name from the input file MANIFEST." (call-with-input-file manifest (lambda (port) (let loop ((lines '()) (line (get-line port))) (if (eof-object? line) (reverse lines) (loop (cons line lines) (get-line port))))))) ;;; Start! (map (lambda (name) (when (null? (find-packages-by-name (guix-name "r-" name))) (begin (display name) (newline)))) (fetch-names (cadr (command-line)))) ;; wget https://git.bioconductor.org -qO - | sed -ne '/packages\/[a-zA-Z]/{s,^.*R.*packages/,,p}' > bioc_manifest ;; ./pre-inst-env guile --no-auto-compile missing-bioconductor.scm bioc_manifest --8<---------------cut here---------------end--------------->8--- Hope that help. All the best, simon