From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: [PATCH] gnu: Add clojure. Date: Sun, 24 Jul 2016 23:15:18 +0200 Message-ID: <87twfe7n6t.fsf@elephly.net> References: <87r3b7gc4d.fsf@gmail.com> <8737ndiln5.fsf@elephly.net> <87h9bs4amm.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50001) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRQkH-0007Lk-UX for guix-devel@gnu.org; Sun, 24 Jul 2016 17:15:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bRQkE-0007YK-DY for guix-devel@gnu.org; Sun, 24 Jul 2016 17:15:33 -0400 Received: from sender163-mail.zoho.com ([74.201.84.163]:24279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bRQkD-0007Xx-Um for guix-devel@gnu.org; Sun, 24 Jul 2016 17:15:30 -0400 In-reply-to: <87h9bs4amm.fsf@gmail.com> 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: Alex Vong Cc: guix-devel@gnu.org Hi Alex, > I see. So the general policy here is to be lazy and packaged by need :) > This time only version 1.8 is added. Does this apply to splitting > bundled libraries as well? I see clojure has some java libraries bundled > such as ASM. Currently, I suppose no other packages depend on it. Usually, we will split bundled libraries. For bundled “jar” archives this is necessary in any case as a “jar” file is a binary. If the libraries are bundled in source form (not as “jar” archives) and if they are closely tied to clojure (or if they were forked from upstream libraries to better fit clojure), we could make an exception. Packaging Java libraries for Guix still isn’t very easy as we lack a bootstrapped set of core libraries, but you might be able to use the “ant-build-system” to get closer to that goal. I also have a couple of packages for Java core libraries that haven’t yet been pushed. If you intend to work on this I can share my current work in progress. >> I see that you added a very large patch to make this work. In Guix we >> usually avoid patching upstream software unless it’s absolutely >> necessary. Have you thought about submitting your patch upstream to >> enable compilation with GCJ? I think we should not add extensive >> patches like that unless they are considered by the upstream developers. >> >> It’s also not so pretty that you have to call “gcj” and “g++” in a >> somewhat complicated build phase “build-native”. If you can get >> upstream to accept your patches to build with GCJ maybe you can slip in >> a patch to add a new Makefile target as well? This would greatly >> simplify the build phases. >> > I see clojure is written only in java and clojure. I will ask for > upstream advice on this one. Thank you. Please let us know when a decision has been reached. Here are some more comments about the patch you sent: > + (replace 'install > + (lambda* (#:key outputs #:allow-other-keys) > + (let ((java-dir (string-append (assoc-ref outputs "out") > + "/share/java/"))) > + ;; Do not install clojure.jar to avoid collisions. > + (install-file (string-append "clojure-" ,version ".jar") > + java-dir) > + #t))) You don’t need this. The “ant-build-system” allows you to override the name of the “jar” archive. You can change the name to “(string-append "clojure-" ,version ".jar")” there without needing to override the install phase. > + (add-after 'build 'build-doc > + (lambda _ > + (let* ((markdown-regex "(.*)\\.(md|markdown|txt)") > + (gsub regexp-substitute/global) > + (markdown->html (lambda (src-name) > + (zero? (system* > + "pandoc" > + "--output" (gsub #f > + markdown-regex > + src-name > + 1 ".html") > + "--verbose" > + "--from" "markdown_github" > + "--to" "html" > + src-name))))) > + (every markdown->html > + (find-files "./" markdown-regex))))) Why is this needed? Is there no target for building the documentation? If you added “pandoc” to the inputs only for building the documentation please reconsider this decision. The closure of the “pandoc” package is *massive* as it depends on countless Haskell packages. You would make the “clojure” package dependent on both Java (which is large) and an even larger set of packages consisting of GHC and numerous packages. Couldn’t you just install the markdown files as they are? > + (add-after 'install 'install-doc > + (lambda* (#:key outputs #:allow-other-keys) > + (let ((doc-dir (string-append (assoc-ref outputs "out") > + "/share/doc/clojure-" > + ,version "/")) > + (copy-file-to-dir (lambda (file dir) > + (copy-file file > + (string-append dir > + file))))) > + (for-each delete-file > + (find-files "doc/clojure/" > + ".*\\.(md|markdown|txt)")) > + (copy-recursively "doc/clojure/" doc-dir) > + (for-each (cut copy-file-to-dir <> doc-dir) > + (filter (cut string-match ".*\\.(html|txt)" <>) > + (scandir "./"))) > + #t)))))) Similar comments here. Why delete the markdown documentation? I’d much prefer to have the original plain text files. What do you think? ~~ Ricardo