From: Ryan Prior via Guix-patches via <guix-patches@gnu.org>
To: 43937@debbugs.gnu.org
Subject: [bug#43937] [PATCH 4/4] gnu: Add go-github-com-bep-golibsass.
Date: Mon, 12 Oct 2020 03:50:26 +0000 [thread overview]
Message-ID: <20201012034957.15477-4-rprior@protonmail.com> (raw)
In-Reply-To: <20201012034957.15477-1-rprior@protonmail.com>
* gnu/packages/golang.scm: (go-github-com-bep-golibsass): New variable.
---
gnu/packages/golang.scm | 59 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 59 insertions(+)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index df6fbdfa94..c87a712d11 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -57,6 +57,7 @@
#:use-module (gnu packages mp3)
#:use-module (gnu packages textutils)
#:use-module (gnu packages tls)
+ #:use-module (gnu packages web)
#:use-module (ice-9 match)
#:use-module (srfi srfi-1))
@@ -5872,3 +5873,61 @@ error messages.")
"Package quicktest provides a collection of Go helpers for writing
tests.")
(license license:expat)))
+
+(define-public go-github-com-bep-golibsass
+ (package
+ (name "go-github-com-bep-golibsass")
+ (version "0.7.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/bep/golibsass")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0xk3m2ynbydzx87dz573ihwc4ryq0r545vz937szz175ivgfrhh3"))
+ (modules '((guix build utils)))
+ (snippet
+ '(begin
+ (delete-file-recursively "libsass_src")
+ #t))))
+ (build-system go-build-system)
+ (arguments
+ '(#:import-path "github.com/bep/golibsass/libsass"
+ #:unpack-path "github.com/bep/golibsass"
+ ;; The dev build tag modifies the build to link to system libsass
+ ;; instead of including the bundled one (which we remove.)
+ ;; https://github.com/bep/golibsass/blob/v0.7.0/internal/libsass/a__cgo_dev.go
+ #:build-flags '("-tags" "dev")
+ #:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'generate-bindings
+ ;; Generate bindings for system libsass, replacing the
+ ;; pre-generated bindings.
+ (lambda* (#:key inputs unpack-path #:allow-other-keys)
+ (mkdir-p (string-append "src/" unpack-path "/internal/libsass"))
+ (let ((libsass-src (string-append (assoc-ref inputs "libsass-src") "/src")))
+ (substitute* (string-append "src/" unpack-path "/gen/main.go")
+ (("filepath.Join\\(rootDir, \"libsass_src\", \"src\"\\)")
+ (string-append "\"" libsass-src "\""))
+ (("../../libsass_src/src/")
+ libsass-src)))
+ (invoke "go" "generate" (string-append unpack-path "/gen"))
+ #t))
+ (replace 'check
+ (lambda* (#:key tests? import-path #:allow-other-keys)
+ (if tests?
+ (invoke "go" "test" import-path "-tags" "dev"))
+ #t)))))
+ (propagated-inputs
+ `(("libsass" ,libsass)))
+ (native-inputs
+ `(("go-github-com-frankban-quicktest" ,go-github-com-frankban-quicktest)
+ ("libsass-src" ,(package-source libsass))))
+ (home-page "https://github.com/bep/golibsass")
+ (synopsis "Easy to use Go bindings for LibSass")
+ (description
+ "This package provides SCSS compiler support for Go applications.")
+ (license license:expat)))
--
2.17.1
next prev parent reply other threads:[~2020-10-12 3:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-12 3:16 [bug#43937] [PATCH 0/4] Add golibsass Ryan Prior via Guix-patches via
2020-10-12 3:50 ` [bug#43937] [PATCH 1/4] gnu: Add go-golang-org-x-xerrors Ryan Prior via Guix-patches via
2020-10-12 3:50 ` [bug#43937] [PATCH 2/4] gnu: go-github-com-google-go-cmp-cmp: Update to 0.5.2 Ryan Prior via Guix-patches via
2020-10-12 3:50 ` [bug#43937] [PATCH 3/4] gnu: Add go-github-com-frankban-quicktest Ryan Prior via Guix-patches via
2020-10-12 3:50 ` Ryan Prior via Guix-patches via [this message]
2020-10-27 17:01 ` bug#43937: [PATCH 0/4] Add golibsass Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201012034957.15477-4-rprior@protonmail.com \
--to=guix-patches@gnu.org \
--cc=43937@debbugs.gnu.org \
--cc=rprior@protonmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.