From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42423) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fGbS6-0003IR-Cj for guix-patches@gnu.org; Wed, 09 May 2018 22:37:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fGbS2-0006el-Em for guix-patches@gnu.org; Wed, 09 May 2018 22:37:06 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:47899) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fGbS2-0006eC-7p for guix-patches@gnu.org; Wed, 09 May 2018 22:37:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fGbS1-0002Q6-QV for guix-patches@gnu.org; Wed, 09 May 2018 22:37:02 -0400 Subject: [bug#31395] [PATCH 2/2] gnu: Add snap. Resent-Message-ID: Date: Wed, 9 May 2018 21:36:25 -0500 From: Eric Bavier Message-ID: <20180509213625.5fa4db0a@centurylink.net> In-Reply-To: <20180509214622.28928-2-mail@nicolasgoaziou.fr> References: <20180509214622.28928-1-mail@nicolasgoaziou.fr> <20180509214622.28928-2-mail@nicolasgoaziou.fr> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; boundary="Sig_/i3rNLF58=XPb.4KSdEqobIT"; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Nicolas Goaziou Cc: 31395@debbugs.gnu.org --Sig_/i3rNLF58=XPb.4KSdEqobIT Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Hello Nicolas, This package looks fun, thanks for working on it, I played with it for a while in my browser :) Just a few comments: On Wed, 9 May 2018 23:46:22 +0200 Nicolas Goaziou wrote: > * gnu/packages/education.scm (snap): New variable. > --- > gnu/packages/education.scm | 82 +++++++++++++++++++++++++++++++++++++- > 1 file changed, 80 insertions(+), 2 deletions(-) >=20 [...] > @@ -224,3 +230,75 @@ Useful support functions and an extensive progress t= racker, topical lessons > and the ability to create your own practice lessons make learning to type > easy.") > (license license:gpl2))) > + > +(define-public snap > + (package > + (name "snap") > + (version "4.1.2.7") > + (source > + (origin > + (method url-fetch) > + (uri (string-append > + "https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/arc= hive/" > + version ".tar.gz")) I think we're trying to stay away from Github's auto-generated tarballs now, because they are not guaranteed to remain the same over time. =20 Unfortunately this project doesn't seem to upload its own release tarballs. I would instead use a git checkout. > + (file-name (string-append name "-" version)) > + (sha256 > + (base32 > + "0yf3x133n9ady4zr9z8cab98qfp9v69x9qjfl8ia05zxzy7d3y5z")))) > + (build-system trivial-build-system) > + (arguments > + `(#:modules ((guix build utils)) > + #:builder > + (begin > + (use-modules (guix build utils)) > + (let* ((out (assoc-ref %outputs "out")) > + (share (string-append out "/share/snap")) > + (root (string-append "Snap--Build-Your-Own-Blocks-" > + ,version))) > + (setenv "PATH" (string-append > + (assoc-ref %build-inputs "gzip") "/bin:" > + (assoc-ref %build-inputs "tar") "/bin")) > + (invoke "tar" "xvzf" (assoc-ref %build-inputs "source")) > + (mkdir-p share) > + (with-directory-excursion root > + (copy-recursively "." share)) This could be simplified to '(copy-recursively root share)', and the mkdir-p can even be left out because copy-recursively will create it for you. > + ;; Replace the sole minified file in the package. > + (with-directory-excursion share > + (delete-file "FileSaver.min.js") > + (symlink (string-append (assoc-ref %build-inputs "js-filesa= ver") > + "/share/javascript/FileSaver.min.js= ") > + "FileSaver.min.js")) > + ;; Create a "snap" executable. > + (let* ((bin (string-append out "/bin")) > + (script (string-append bin "/snap")) > + (bash (string-append (assoc-ref %build-inputs "bash") > + "/bin/bash")) > + (xdg-open (string-append (assoc-ref %build-inputs "xdg= -utils") > + "/bin/xdg-open")) > + (snap (string-append share "/snap.html"))) > + (mkdir-p bin) > + (call-with-output-file script > + (lambda (port) > + (format port "#!~a\n~a '~a'" bash xdg-open snap))) You could maybe use '(which "sh")' and '(which xdg-open)'. A matter of taste, I think. > + (chmod script #o555))) > + #t))) > + (native-inputs > + `(("gzip" ,gzip) > + ("tar" ,tar) > + ("js-filesaver" ,js-filesaver))) js-filesave should go in "inputs", right? > + (inputs > + `(("bash" ,bash-minimal) > + ("xdg-utils" ,xdg-utils))) > + (home-page "https://snap.berkeley.edu") > + (synopsis "Visual, blocks based programming language inspired by Scr= atch") We can leave out "inspired by Scratch" in the synopsis. > + (description "Snap! (formerly BYOB) is a visual, drag-and-drop > +programming language. It is an extended reimplementation of Scratch (a > +project of the Lifelong Kindergarten Group at the MIT Media Lab) that > +allows you to Build Your Own Blocks. It also features first class > +lists, first class procedures, and continuations. These added > +capabilities make it suitable for a serious introduction to computer > +science for high school or college students. > + > +This package provides a @command{snap} executable calling @command{xdg-o= pen} > +to open a the application in a web browser.") ^ s/a the/the/ > + (license license:agpl3+))) Otherwise looks good and works for me. Thanks, `~Eric --Sig_/i3rNLF58=XPb.4KSdEqobIT Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEoMXjUi7471xkzbfw/XPKxxnTJWYFAlrzsCkACgkQ/XPKxxnT JWbVBw//eKPDUhiOnWkUTYACtcsJNUBcMBGzfyZplvPTwcpAa+90vYiN3QRUzdy2 515eswB7SEjFx2sctncQXgtDj9bfUl0S+Ksp3vbc7OK6zEUCcCjHabKHu0i8zjj2 R059PNOahJvyS54MBBcJhwYe/slMd7jA9UJpPXZ0zwN+ibq4a7lWTgHThykL3gcm 0HU05ICaqGY4mAT9vn3kwkHHs1y75/gEiR7Jv5tfAX0RlKDIZ3623vSoU/FaBn2z pUM7nA0BkOUOrCTdUL1v7rE30r6f0Y08CCpuuH9K/tIJsd8TuXn95OGEW3PbJMYL qcFkQoR/x36hnbtGnqWf10k8LnuRI8PX0Tvfov+msRhq6s0siQLdwFleSBDMP3QF +Z9eei9g474V7E+ETlOJqLsUNyltTXrxUfbK86aoKcuWab47wKC3BHQLm6A5dBGU 6r5h2s/rifO1866Q7oCNrWavT+2+alab6Hub6/V9O7sxHW9xvfjkmrEpe0MIP61Z GETs86uKQcTdR1/kRyEqsTyL0K1sBUDPzT63PoP+nMh22pRM6Mu2/+/gBzuWvOBG g+TOAs4IlBs0luTj9BlP27/5Ctl2oN9sG1kthADTQj7wz5G2AjIv+S0jQ0RPpBB1 wqPhrR8rrVcgIJ9AA2MHEr/ff+GWoax+raHCzLwuui6KwnnXYlU= =SBpB -----END PGP SIGNATURE----- --Sig_/i3rNLF58=XPb.4KSdEqobIT--