From patchwork Mon Oct 12 03:50:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Prior X-Patchwork-Id: 24587 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0A83427BBEB; Mon, 12 Oct 2020 04:51:17 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7B0DE27BBEA for ; Mon, 12 Oct 2020 04:51:16 +0100 (BST) Received: from localhost ([::1]:46658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kRorj-0006IW-M2 for patchwork@mira.cbaines.net; Sun, 11 Oct 2020 23:51:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57800) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kRorX-00061Q-NG for guix-patches@gnu.org; Sun, 11 Oct 2020 23:51:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57999) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kRorX-0007av-E1 for guix-patches@gnu.org; Sun, 11 Oct 2020 23:51:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kRorX-00040i-Dh for guix-patches@gnu.org; Sun, 11 Oct 2020 23:51:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#43937] [PATCH 4/4] gnu: Add go-github-com-bep-golibsass. Resent-From: Ryan Prior Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 12 Oct 2020 03:51:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 43937 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 43937@debbugs.gnu.org Received: via spool by 43937-submit@debbugs.gnu.org id=B43937.160247463815365 (code B ref 43937); Mon, 12 Oct 2020 03:51:03 +0000 Received: (at 43937) by debbugs.gnu.org; 12 Oct 2020 03:50:38 +0000 Received: from localhost ([127.0.0.1]:41309 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kRor8-0003zk-Bq for submit@debbugs.gnu.org; Sun, 11 Oct 2020 23:50:38 -0400 Received: from mail-40134.protonmail.ch ([185.70.40.134]:33904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kRor7-0003zX-15 for 43937@debbugs.gnu.org; Sun, 11 Oct 2020 23:50:37 -0400 Date: Mon, 12 Oct 2020 03:50:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1602474630; bh=1i279iOFLVbExdpWeqDDU4xce6SgwDqZSMO5i5F0uco=; h=Date:To:From:Reply-To:Subject:In-Reply-To:References:From; b=tg9QFDPKx4E0sgDDqWcKVEj2T6mvqPI2f4PAbLSyWp1ZXZYW3iSURWqwgE8sb4Wdg pzpy8Jg9Uis6XahgfhlLFwsGLSfIVbgg5CuUKc5YzSMAjtXlQ8WFvgtGlR66MBaRVA u5E3+vakAFYozpRrHOPJKHRsOF4vQtA2n4N87cFM= Message-ID: <20201012034957.15477-4-rprior@protonmail.com> In-Reply-To: <20201012034957.15477-1-rprior@protonmail.com> References: <20201012034957.15477-1-rprior@protonmail.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Ryan Prior , Ryan Prior via Guix-patches X-Patchwork-Original-From: Ryan Prior via Guix-patches via From: Ryan Prior X-getmail-retrieved-from-mailbox: Patches * 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)))