unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: Add sassc.
@ 2015-08-20  1:56 David Thompson
  2015-08-22  4:57 ` Mark H Weaver
  0 siblings, 1 reply; 3+ messages in thread
From: David Thompson @ 2015-08-20  1:56 UTC (permalink / raw)
  To: guix-devel

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: 0001-gnu-Add-sassc.patch --]
[-- Type: text/x-patch, Size: 2904 bytes --]

From 4a6d1a798a0625d8bc104b86db56f5d2594a5d80 Mon Sep 17 00:00:00 2001
From: David Thompson <dthompson2@worcester.edu>
Date: Wed, 19 Aug 2015 21:54:57 -0400
Subject: [PATCH] gnu: Add sassc.

* gnu/packages/web.scm (sassc): New variable.
---
 gnu/packages/web.scm | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 48bfbc7..ce4cfeb 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -642,6 +642,59 @@ minimum to provide high performance operation.")
     ;; bundled CuTest framework uses a different non-copyleft license.
     (license (list l:asl2.0 (l:non-copyleft "file://test/CuTest-README.txt")))))
 
+(define-public sassc
+  ;; libsass must be statically linked and it isn't included in source the
+  ;; sassc release tarballs, hence this odd package recipe.
+  (let* ((version "3.2.5")
+         (libsass
+          (origin
+            (method url-fetch)
+            (uri (string-append
+                  "https://github.com/sass/libsass/archive/"
+                  version ".tar.gz"))
+            (file-name (string-append "libsass-" version ".tar.gz"))
+            (sha256
+             (base32
+              "1x25k6p1s1yzsdpzb7bzh8japilmi1mk3z96q66pycbinj9z9is4")))))
+    (package
+      (name "sassc")
+      (version version)
+      (source (origin
+                (method url-fetch)
+                (uri (string-append "https://github.com/sass/sassc/archive/"
+                                    version ".tar.gz"))
+                (sha256
+                 (base32
+                  "1xf3w75w840rj0nx375rxi7mcv1ngqqq8p3zrzjlyx8jfpnldmv5"))))
+      (build-system gnu-build-system)
+      (arguments
+       `(#:make-flags '("CC=gcc")
+         #:test-target "test"
+         #:phases
+         (modify-phases %standard-phases
+           (delete 'configure)
+           (add-before 'build 'set-libsass-path
+             (lambda* (#:key inputs #:allow-other-keys)
+               (system* "tar" "xvf" (assoc-ref inputs "libsass"))
+               (setenv "SASS_LIBSASS_PATH"
+                       (string-append (getcwd) "/libsass-" ,version))
+
+               #t))
+           (replace 'install ; no install target
+             (lambda* (#:key outputs #:allow-other-keys)
+               (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
+                 (mkdir-p bin)
+                 (copy-file "bin/sassc"
+                            (string-append bin "/sassc"))
+                 #t))))))
+      (inputs
+       `(("libsass" ,libsass)))
+      (synopsis "CSS pre-processor")
+      (description "SassC is a compiler written in C for the CSS pre-processor
+language known as SASS.")
+      (home-page "http://sass-lang.com/libsass")
+      (license l:expat))))
+
 \f
 (define-public perl-apache-logformat-compiler
   (package
-- 
2.4.3


[-- Attachment #2: Type: text/plain, Size: 38 bytes --]


-- 
David Thompson
GPG Key: 0FF1D807

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gnu: Add sassc.
  2015-08-20  1:56 [PATCH] gnu: Add sassc David Thompson
@ 2015-08-22  4:57 ` Mark H Weaver
  2015-09-01 23:11   ` Thompson, David
  0 siblings, 1 reply; 3+ messages in thread
From: Mark H Weaver @ 2015-08-22  4:57 UTC (permalink / raw)
  To: David Thompson; +Cc: guix-devel

David Thompson <dthompson2@worcester.edu> writes:

> From 4a6d1a798a0625d8bc104b86db56f5d2594a5d80 Mon Sep 17 00:00:00 2001
> From: David Thompson <dthompson2@worcester.edu>
> Date: Wed, 19 Aug 2015 21:54:57 -0400
> Subject: [PATCH] gnu: Add sassc.
>
> * gnu/packages/web.scm (sassc): New variable.
> ---
>  gnu/packages/web.scm | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 53 insertions(+)
>
> diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
> index 48bfbc7..ce4cfeb 100644
> --- a/gnu/packages/web.scm
> +++ b/gnu/packages/web.scm
> @@ -642,6 +642,59 @@ minimum to provide high performance operation.")
>      ;; bundled CuTest framework uses a different non-copyleft license.
>      (license (list l:asl2.0 (l:non-copyleft "file://test/CuTest-README.txt")))))
>  
> +(define-public sassc
> +  ;; libsass must be statically linked and it isn't included in source the
> +  ;; sassc release tarballs, hence this odd package recipe.
> +  (let* ((version "3.2.5")
> +         (libsass
> +          (origin
> +            (method url-fetch)
> +            (uri (string-append
> +                  "https://github.com/sass/libsass/archive/"
> +                  version ".tar.gz"))
> +            (file-name (string-append "libsass-" version ".tar.gz"))
> +            (sha256
> +             (base32
> +              "1x25k6p1s1yzsdpzb7bzh8japilmi1mk3z96q66pycbinj9z9is4")))))
> +    (package
> +      (name "sassc")
> +      (version version)
> +      (source (origin
> +                (method url-fetch)
> +                (uri (string-append "https://github.com/sass/sassc/archive/"
> +                                    version ".tar.gz"))

Please add a 'file-name' field here.

> +                (sha256
> +                 (base32
> +                  "1xf3w75w840rj0nx375rxi7mcv1ngqqq8p3zrzjlyx8jfpnldmv5"))))
> +      (build-system gnu-build-system)
> +      (arguments
> +       `(#:make-flags '("CC=gcc")
> +         #:test-target "test"
> +         #:phases
> +         (modify-phases %standard-phases
> +           (delete 'configure)
> +           (add-before 'build 'set-libsass-path
> +             (lambda* (#:key inputs #:allow-other-keys)
> +               (system* "tar" "xvf" (assoc-ref inputs "libsass"))

I think this phase should be renamed, since it is doing much more than
just setting the path.  How about 'unpack-libsass-and-set-path'?

The return value of 'system*' should be checked.

Also, I think this pass should go after 'unpack' instead of before
'build', so that the other passes between 'unpack' and 'build' can do
their jobs.  It's possible that it doesn't make a difference in this
case, but that might change in a future version of libsass, and anyway
since copy+paste from existing packages is a common method, we should
encourage best practices.

> +               (setenv "SASS_LIBSASS_PATH"
> +                       (string-append (getcwd) "/libsass-" ,version))
> +
> +               #t))

I'd probably remove that blank line here.

> +           (replace 'install ; no install target
> +             (lambda* (#:key outputs #:allow-other-keys)
> +               (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
> +                 (mkdir-p bin)
> +                 (copy-file "bin/sassc"
> +                            (string-append bin "/sassc"))
> +                 #t))))))
> +      (inputs
> +       `(("libsass" ,libsass)))
> +      (synopsis "CSS pre-processor")
> +      (description "SassC is a compiler written in C for the CSS pre-processor
> +language known as SASS.")
> +      (home-page "http://sass-lang.com/libsass")
> +      (license l:expat))))

Otherwise it looks good to me.  Thanks!

     Mark

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gnu: Add sassc.
  2015-08-22  4:57 ` Mark H Weaver
@ 2015-09-01 23:11   ` Thompson, David
  0 siblings, 0 replies; 3+ messages in thread
From: Thompson, David @ 2015-09-01 23:11 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

On Sat, Aug 22, 2015 at 12:57 AM, Mark H Weaver <mhw@netris.org> wrote:
> David Thompson <dthompson2@worcester.edu> writes:
>
>> From 4a6d1a798a0625d8bc104b86db56f5d2594a5d80 Mon Sep 17 00:00:00 2001
>> From: David Thompson <dthompson2@worcester.edu>
>> Date: Wed, 19 Aug 2015 21:54:57 -0400
>> Subject: [PATCH] gnu: Add sassc.
>>
>> * gnu/packages/web.scm (sassc): New variable.
>> ---
>>  gnu/packages/web.scm | 53 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 53 insertions(+)
>>
>> diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
>> index 48bfbc7..ce4cfeb 100644
>> --- a/gnu/packages/web.scm
>> +++ b/gnu/packages/web.scm
>> @@ -642,6 +642,59 @@ minimum to provide high performance operation.")
>>      ;; bundled CuTest framework uses a different non-copyleft license.
>>      (license (list l:asl2.0 (l:non-copyleft "file://test/CuTest-README.txt")))))
>>
>> +(define-public sassc
>> +  ;; libsass must be statically linked and it isn't included in source the
>> +  ;; sassc release tarballs, hence this odd package recipe.
>> +  (let* ((version "3.2.5")
>> +         (libsass
>> +          (origin
>> +            (method url-fetch)
>> +            (uri (string-append
>> +                  "https://github.com/sass/libsass/archive/"
>> +                  version ".tar.gz"))
>> +            (file-name (string-append "libsass-" version ".tar.gz"))
>> +            (sha256
>> +             (base32
>> +              "1x25k6p1s1yzsdpzb7bzh8japilmi1mk3z96q66pycbinj9z9is4")))))
>> +    (package
>> +      (name "sassc")
>> +      (version version)
>> +      (source (origin
>> +                (method url-fetch)
>> +                (uri (string-append "https://github.com/sass/sassc/archive/"
>> +                                    version ".tar.gz"))
>
> Please add a 'file-name' field here.

Good catch.

>> +                (sha256
>> +                 (base32
>> +                  "1xf3w75w840rj0nx375rxi7mcv1ngqqq8p3zrzjlyx8jfpnldmv5"))))
>> +      (build-system gnu-build-system)
>> +      (arguments
>> +       `(#:make-flags '("CC=gcc")
>> +         #:test-target "test"
>> +         #:phases
>> +         (modify-phases %standard-phases
>> +           (delete 'configure)
>> +           (add-before 'build 'set-libsass-path
>> +             (lambda* (#:key inputs #:allow-other-keys)
>> +               (system* "tar" "xvf" (assoc-ref inputs "libsass"))
>
> I think this phase should be renamed, since it is doing much more than
> just setting the path.  How about 'unpack-libsass-and-set-path'?

Sounds good.  When I initially wrote the phase the name was accurate,
then I added the tarball unpacking step and forgot to change the name.

> The return value of 'system*' should be checked.

Done.

> Also, I think this pass should go after 'unpack' instead of before
> 'build', so that the other passes between 'unpack' and 'build' can do
> their jobs.  It's possible that it doesn't make a difference in this
> case, but that might change in a future version of libsass, and anyway
> since copy+paste from existing packages is a common method, we should
> encourage best practices.

Yes, good idea.

>> +               (setenv "SASS_LIBSASS_PATH"
>> +                       (string-append (getcwd) "/libsass-" ,version))
>> +
>> +               #t))
>
> I'd probably remove that blank line here.

Done.

>> +           (replace 'install ; no install target
>> +             (lambda* (#:key outputs #:allow-other-keys)
>> +               (let ((bin (string-append (assoc-ref outputs "out") "/bin")))
>> +                 (mkdir-p bin)
>> +                 (copy-file "bin/sassc"
>> +                            (string-append bin "/sassc"))
>> +                 #t))))))
>> +      (inputs
>> +       `(("libsass" ,libsass)))
>> +      (synopsis "CSS pre-processor")
>> +      (description "SassC is a compiler written in C for the CSS pre-processor
>> +language known as SASS.")
>> +      (home-page "http://sass-lang.com/libsass")
>> +      (license l:expat))))
>
> Otherwise it looks good to me.  Thanks!

Pushed, thanks!

- Dave

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-09-01 23:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-20  1:56 [PATCH] gnu: Add sassc David Thompson
2015-08-22  4:57 ` Mark H Weaver
2015-09-01 23:11   ` Thompson, David

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).