* [PATCH] gnu: Add hoedown.
@ 2015-07-19 14:51 David Thompson
2015-07-19 17:19 ` Mathieu Lirzin
2015-07-21 18:53 ` Mark H Weaver
0 siblings, 2 replies; 5+ messages in thread
From: David Thompson @ 2015-07-19 14:51 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: Type: text/plain, Size: 121 bytes --]
Here's a package recipe for a Markdown library written in C. I want to
try to make Guile bindings for it with the FFI.
[-- Attachment #2: 0001-gnu-Add-hoedown.patch --]
[-- Type: text/x-patch, Size: 3588 bytes --]
From 567748faa4e3e03fe9b106a8ea61843a2d31409d Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson2@worcester.edu>
Date: Sun, 19 Jul 2015 10:41:34 -0400
Subject: [PATCH] gnu: Add hoedown.
* gnu/packages/markdown.scm: New file.
* gnu-system.am (GNU_SYSTEM_MODULES): Add it.
---
gnu-system.am | 1 +
gnu/packages/markdown.scm | 59 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+)
create mode 100644 gnu/packages/markdown.scm
diff --git a/gnu-system.am b/gnu-system.am
index fb661d4..5fd5870 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -201,6 +201,7 @@ GNU_SYSTEM_MODULES = \
gnu/packages/man.scm \
gnu/packages/mail.scm \
gnu/packages/make-bootstrap.scm \
+ gnu/packages/markdown.scm \
gnu/packages/maths.scm \
gnu/packages/mc.scm \
gnu/packages/mcrypt.scm \
diff --git a/gnu/packages/markdown.scm b/gnu/packages/markdown.scm
new file mode 100644
index 0000000..42af2ae
--- /dev/null
+++ b/gnu/packages/markdown.scm
@@ -0,0 +1,59 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2015 David Thompson <davet@gnu.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu packages markdown)
+ #:use-module (guix licenses)
+ #:use-module (guix packages)
+ #:use-module (guix download)
+ #:use-module (guix packages)
+ #:use-module (guix build-system gnu)
+ #:use-module (gnu packages python)
+ #:use-module (gnu packages web))
+
+(define-public hoedown
+ (package
+ (name "hoedown")
+ (version "3.0.3")
+ (source (origin
+ (method url-fetch)
+ (uri (string-append "https://github.com/hoedown/hoedown/archive/"
+ version ".tar.gz"))
+ (file-name (string-append name "-" version ".tar.gz"))
+ (sha256
+ (base32
+ "0mmmkfayqgh6k39kbi3pq68mg03x35aiygy3zypxzvwx9y8b53ky"))))
+ (build-system gnu-build-system)
+ (arguments
+ '(#:phases (modify-phases %standard-phases
+ (add-before 'build 'fix-makefile
+ (lambda* (#:key outputs #:allow-other-keys)
+ (setenv "CC" "gcc")
+ (substitute* '("Makefile")
+ (("/usr/local")
+ (assoc-ref outputs "out")))
+ #t))
+ (delete 'configure)) ; no configure script
+ #:test-target "test"))
+ (native-inputs
+ `(("python" ,python-2)
+ ("tidy" ,tidy)))
+ (synopsis "Markdown processing library")
+ (description "Hoedown is a standards compliant, fast, secure markdown
+processing library written in C.")
+ (home-page "https://github.com/hoedown/hoedown")
+ (license expat)))
--
2.4.3
[-- Attachment #3: Type: text/plain, Size: 38 bytes --]
--
David Thompson
GPG Key: 0FF1D807
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] gnu: Add hoedown.
2015-07-19 14:51 [PATCH] gnu: Add hoedown David Thompson
@ 2015-07-19 17:19 ` Mathieu Lirzin
2015-07-20 0:01 ` Thompson, David
2015-07-21 18:53 ` Mark H Weaver
1 sibling, 1 reply; 5+ messages in thread
From: Mathieu Lirzin @ 2015-07-19 17:19 UTC (permalink / raw)
To: David Thompson; +Cc: guix-devel
David Thompson <dthompson2@worcester.edu> writes:
> Here's a package recipe for a Markdown library written in C. I want to
> try to make Guile bindings for it with the FFI.
Nice idea!
> +(define-module (gnu packages markdown)
> + #:use-module (guix licenses)
> + #:use-module (guix packages)
> + #:use-module (guix download)
> + #:use-module (guix packages)
> + #:use-module (guix build-system gnu)
> + #:use-module (gnu packages python)
> + #:use-module (gnu packages web))
guix packages is added two times. Maybe "prefix:" for licences to be
safe ?
> + (substitute* '("Makefile")
> + (("/usr/local")
> + (assoc-ref outputs "out")))
No need to use a list of files here. I noticed some warnings in the
compilation process which can be fixed like this.
--8<---------------cut here---------------start------------->8---
(substitute* "Makefile"
(("-ansi") "-std=c99")
(("/usr/local") (assoc-ref outputs "out")))
--8<---------------cut here---------------end--------------->8---
> + (native-inputs
> + `(("python" ,python-2)
> + ("tidy" ,tidy)))
perl is needed in native-inputs for "test/MarkdownTest_1.0.3/MarkdownTest.pl"
Otherwise LGTM! (if i'm entitled to ;))
I will send a patch for moving the "markdown" package to this new file after
that.
--
Mathieu Lirzin
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gnu: Add hoedown.
2015-07-19 17:19 ` Mathieu Lirzin
@ 2015-07-20 0:01 ` Thompson, David
0 siblings, 0 replies; 5+ messages in thread
From: Thompson, David @ 2015-07-20 0:01 UTC (permalink / raw)
To: Mathieu Lirzin; +Cc: guix-devel
On Sun, Jul 19, 2015 at 1:19 PM, Mathieu Lirzin <mthl@openmailbox.org> wrote:
> David Thompson <dthompson2@worcester.edu> writes:
>
>> Here's a package recipe for a Markdown library written in C. I want to
>> try to make Guile bindings for it with the FFI.
>
> Nice idea!
>
>> +(define-module (gnu packages markdown)
>> + #:use-module (guix licenses)
>> + #:use-module (guix packages)
>> + #:use-module (guix download)
>> + #:use-module (guix packages)
>> + #:use-module (guix build-system gnu)
>> + #:use-module (gnu packages python)
>> + #:use-module (gnu packages web))
>
> guix packages is added two times.
Good catch. Thanks.
> Maybe "prefix:" for licences to be safe ?
We can prefix identifiers if/when the need arises.
>> + (substitute* '("Makefile")
>> + (("/usr/local")
>> + (assoc-ref outputs "out")))
>
> No need to use a list of files here. I noticed some warnings in the
> compilation process which can be fixed like this.
>
> --8<---------------cut here---------------start------------->8---
> (substitute* "Makefile"
> (("-ansi") "-std=c99")
> (("/usr/local") (assoc-ref outputs "out")))
> --8<---------------cut here---------------end--------------->8---
'substitute*' operates on a single string *or* a list of strings.
Here's the relevant pattern matching code in the implementation:
(match file
((files (... ...))
(for-each substitute-one-file files))
((? string? f)
(substitute-one-file f)))
I'm inclined to use a list, as I think that this macro should ought to
demand a list and only a list.
>> + (native-inputs
>> + `(("python" ,python-2)
>> + ("tidy" ,tidy)))
>
> perl is needed in native-inputs for "test/MarkdownTest_1.0.3/MarkdownTest.pl"
There's a Python and a Perl version of the same test suite. I just
use Python and don't bother with Perl.
> Otherwise LGTM! (if i'm entitled to ;))
>
> I will send a patch for moving the "markdown" package to this new file after
> that.
Cool, I'm doing to fix the double import and push this.
Thanks
- Dave
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] gnu: Add hoedown.
2015-07-19 14:51 [PATCH] gnu: Add hoedown David Thompson
2015-07-19 17:19 ` Mathieu Lirzin
@ 2015-07-21 18:53 ` Mark H Weaver
2015-07-21 19:04 ` Thompson, David
1 sibling, 1 reply; 5+ messages in thread
From: Mark H Weaver @ 2015-07-21 18:53 UTC (permalink / raw)
To: David Thompson; +Cc: guix-devel
David Thompson <dthompson2@worcester.edu> writes:
> From 567748faa4e3e03fe9b106a8ea61843a2d31409d Mon Sep 17 00:00:00 2001
> From: David Thompson <dthompson2@worcester.edu>
> Date: Sun, 19 Jul 2015 10:41:34 -0400
> Subject: [PATCH] gnu: Add hoedown.
Sorry for not reviewing this earlier, but...
> + '(#:phases (modify-phases %standard-phases
> + (add-before 'build 'fix-makefile
> + (lambda* (#:key outputs #:allow-other-keys)
> + (setenv "CC" "gcc")
> + (substitute* '("Makefile")
> + (("/usr/local")
> + (assoc-ref outputs "out")))
> + #t))
Instead of the 'fix-makefile' phase, you can simply do this:
#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
I tested the following patch, and it works.
Mark
diff --git a/gnu/packages/markdown.scm b/gnu/packages/markdown.scm
index 58ca102..ee0edfc 100644
--- a/gnu/packages/markdown.scm
+++ b/gnu/packages/markdown.scm
@@ -38,14 +38,8 @@
"0mmmkfayqgh6k39kbi3pq68mg03x35aiygy3zypxzvwx9y8b53ky"))))
(build-system gnu-build-system)
(arguments
- '(#:phases (modify-phases %standard-phases
- (add-before 'build 'fix-makefile
- (lambda* (#:key outputs #:allow-other-keys)
- (setenv "CC" "gcc")
- (substitute* '("Makefile")
- (("/usr/local")
- (assoc-ref outputs "out")))
- #t))
+ '(#:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
+ #:phases (modify-phases %standard-phases
(delete 'configure)) ; no configure script
#:test-target "test"))
(native-inputs
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] gnu: Add hoedown.
2015-07-21 18:53 ` Mark H Weaver
@ 2015-07-21 19:04 ` Thompson, David
0 siblings, 0 replies; 5+ messages in thread
From: Thompson, David @ 2015-07-21 19:04 UTC (permalink / raw)
To: Mark H Weaver; +Cc: guix-devel
On Tue, Jul 21, 2015 at 2:53 PM, Mark H Weaver <mhw@netris.org> wrote:
> David Thompson <dthompson2@worcester.edu> writes:
>
>> From 567748faa4e3e03fe9b106a8ea61843a2d31409d Mon Sep 17 00:00:00 2001
>> From: David Thompson <dthompson2@worcester.edu>
>> Date: Sun, 19 Jul 2015 10:41:34 -0400
>> Subject: [PATCH] gnu: Add hoedown.
>
> Sorry for not reviewing this earlier, but...
>
>> + '(#:phases (modify-phases %standard-phases
>> + (add-before 'build 'fix-makefile
>> + (lambda* (#:key outputs #:allow-other-keys)
>> + (setenv "CC" "gcc")
>> + (substitute* '("Makefile")
>> + (("/usr/local")
>> + (assoc-ref outputs "out")))
>> + #t))
>
> Instead of the 'fix-makefile' phase, you can simply do this:
>
> #:make-flags (list "CC=gcc" (string-append "PREFIX=" %output))
>
> I tested the following patch, and it works.
Thank you, feel free to apply it or I can do it later.
- Dave
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-07-21 19:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-19 14:51 [PATCH] gnu: Add hoedown David Thompson
2015-07-19 17:19 ` Mathieu Lirzin
2015-07-20 0:01 ` Thompson, David
2015-07-21 18:53 ` Mark H Weaver
2015-07-21 19:04 ` Thompson, David
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.