diff --git a/rekahsoft-gnu/packages/patches/terraform-provider-path.patch b/rekahsoft-gnu/packages/patches/terraform-provider-path.patch new file mode 100644 index 0000000..4f22ba3 --- /dev/null +++ b/rekahsoft-gnu/packages/patches/terraform-provider-path.patch @@ -0,0 +1,16 @@ +diff --git a/command/init.go b/command/init.go +index 403ca245b..05d98329a 100644 +--- a/command/init.go ++++ b/command/init.go +@@ -64,6 +64,11 @@ func (c *InitCommand) Run(args []string) int { + return 1 + } + ++ val, ok := os.LookupEnv("GUIX_TERRAFORM_PLUGIN_DIR") ++ if ok { ++ flagPluginPath = append(flagPluginPath, val) ++ } ++ + if len(flagPluginPath) > 0 { + c.pluginPath = flagPluginPath + c.getPlugins = false diff --git a/rekahsoft-gnu/packages/terraform.scm b/rekahsoft-gnu/packages/terraform.scm index 6e788cc..78980eb 100644 --- a/rekahsoft-gnu/packages/terraform.scm +++ b/rekahsoft-gnu/packages/terraform.scm @@ -18,6 +18,7 @@ (define-module (rekahsoft-gnu packages terraform) #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages) #:use-module (gnu packages golang) #:use-module (guix utils) #:use-module (guix packages) @@ -27,6 +28,14 @@ #:use-module (guix build-system trivial) #:use-module (rekahsoft-gnu packages golang)) +(define (search-rekahsoft-gnu-patches patch) + (parameterize + ((%patch-path + (map (lambda (directory) + (string-append directory "/rekahsoft-gnu/packages/patches")) + %load-path))) + (search-patches patch))) + ;; TODO: Uses vendored dependencies (define-public terraform-0.13 (package @@ -37,6 +46,7 @@ (uri (git-reference (url "https://github.com/hashicorp/terraform") (commit (string-append "v" version)))) + (patches (search-rekahsoft-gnu-patches "terraform-provider-path.patch")) (file-name (git-file-name name version)) (sha256 (base32 @@ -53,7 +63,11 @@ (variable "SSL_CERT_FILE") (file-type 'regular) (separator #f) ;single entry - (files '("etc/ssl/certs/ca-certificates.crt"))))) + (files '("etc/ssl/certs/ca-certificates.crt"))) + (search-path-specification + (variable "GUIX_TERRAFORM_PLUGIN_DIR") + (separator #f) ;single entry + (files '("libexec/terraform"))))) (arguments `(#:import-path "github.com/hashicorp/terraform" #:install-source? #f @@ -106,6 +120,7 @@ popular service providers as well as custom in-house solutions.") (uri (git-reference (url "https://github.com/hashicorp/terraform") (commit (string-append "v" version)))) + (patches (search-rekahsoft-gnu-patches "terraform-provider-path.patch")) (file-name (git-file-name name version)) (sha256 (base32 @@ -120,6 +135,7 @@ popular service providers as well as custom in-house solutions.") (uri (git-reference (url "https://github.com/hashicorp/terraform") (commit (string-append "v" version)))) + (patches (search-rekahsoft-gnu-patches "terraform-provider-path.patch")) (file-name (git-file-name name version)) (sha256 (base32