Subject: [bug#44721] [PATCH] gnu: Add terraform.

From: Christopher Baines <[email-masked]>
Date: Fri, 20 Nov 2020 09:21:50 +0000

EuAndreh via Guix-patches via <[email-masked]> writes:

> * gnu/packages/terraform.scm (terraform): New variable.
> ---
>  gnu/packages/terraform.scm | 25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
>
> diff --git a/gnu/packages/terraform.scm b/gnu/packages/terraform.scm
> index b9313bbd4a..233859629c 100644
> --- a/gnu/packages/terraform.scm
> +++ b/gnu/packages/terraform.scm
> @@ -1,6 +1,7 @@
>  ;;; GNU Guix --- Functional package management for GNU
>  ;;; Copyright © 2018 Christopher Baines <[email-masked]>
>  ;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <[email-masked]>
> +;;; Copyright © 2020 EuAndreh <[email-masked]>
>  ;;;
>  ;;; This file is part of GNU Guix.
>  ;;;
> @@ -47,3 +48,27 @@ the inputs and outputs for modules of the Terraform infrastructure management
>  tool.  These can be shown, or written to a file in JSON or Markdown formats.")
>      (home-page "https://github.com/segmentio/terraform-docs")
>      (license license:expat)))
> +
> +(define-public terraform
> +  (package
> +    (name "terraform")
> +    (version "0.13.5")
> +    (source (origin
> +              (method git-fetch)
> +              (uri (git-reference
> +                    (url "https://github.com/hashicorp/terraform")
> +                    (commit (string-append "v" version))))
> +              (sha256
> +               (base32
> +                "0q8x6fhhkh4spddbqsxbsc2fp0r5p5010awgkb628s9vz111ws3r"))))
> +    (build-system go-build-system)
> +    (arguments
> +     '(#:import-path "github.com/hashicorp/terraform"))
> +    (synopsis "Tool for building, changing, and versioning infrastructure")
> +    (description
> +     "Terraform enables you to safely and predictably create, change, and
> +improve infrastructure.  It is an open source tool that codifies APIs into
> +declarative configuration files that can be shared amongst team members,
> +treated as code, edited, reviewed, and versioned.")
> +    (home-page "https://www.terraform.io/")
> +    (license license:mpl2.0)))

Hi,

Thanks for the patch. I've also written a package definition like this,
which works, but isn't yet suitable for inclusion in Guix, because it
misrepresents the dependencies/inputs.

Terraform has a number of dependencies, but this package does
not. Properly packaging it for Guix will require packaging those
dependencies, then making a package definition which actually uses those
dependencies.

I'm hopeful that the recent progress with importers for Go packages will
help with this, but I haven't checked myself, maybe you can take a look?

Thanks,

Chris

(there's also some Terraform related discussion here
https://issues.guix.info/30806 )