Skip to content

Commit 5d95f6c

Browse files
guix.scm: Allow to build Guile-SSH with libssh 0.9
* guix.scm: Allow to build Guile-SSH with libssh 0.9. Add module commentary.
1 parent 40b0e8a commit 5d95f6c

File tree

1 file changed

+60
-1
lines changed

1 file changed

+60
-1
lines changed

guix.scm

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
;;; guix.scm -- GNU Guix package definition.
2+
3+
;; Copyright (C) 2022-2024 Artyom V. Poptsov <poptsov.artyom@gmail.com>
4+
;;
5+
;; This file is a part of Guile-SSH.
6+
;;
7+
;; Guile-SSH is free software: you can redistribute it and/or
8+
;; modify it under the terms of the GNU General Public License as
9+
;; published by the Free Software Foundation, either version 3 of the
10+
;; License, or (at your option) any later version.
11+
;;
12+
;; Guile-SSH is distributed in the hope that it will be useful, but
13+
;; WITHOUT ANY WARRANTY; without even the implied warranty of
14+
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
;; General Public License for more details.
16+
;;
17+
;; You should have received a copy of the GNU General Public License
18+
;; along with Guile-SSH. If not, see
19+
;; <http://www.gnu.org/licenses/>.
20+
21+
22+
;;; Commentary:
23+
24+
;; Use this file to build Guile-SSH with GNU Guix:
25+
;;
26+
;; guix build -f guix.scm
27+
;;
28+
;; By default Guile-SSH builds with libssh 0.10, but it is possible to switch
29+
;; it to libssh 0.9 by exporting an environment variable:
30+
;;
31+
;; export GUILE_SSH_BUILD_WITH_LIBSSH_0_9=1
32+
;; guix build -f guix.scm
33+
34+
35+
;;; Code:
36+
137
(use-modules (guix gexp)
238
((guix licenses) #:prefix license:)
339
(guix packages)
@@ -50,6 +86,20 @@ applications.")
5086
(home-page "https://www.libssh.org")
5187
(license license:lgpl2.1+)))
5288

89+
(define-public libssh9
90+
(package
91+
(inherit libssh)
92+
(name "libssh")
93+
(version "0.9.0")
94+
(source (origin
95+
(method url-fetch)
96+
(uri (string-append "https://www.libssh.org/files/"
97+
(version-major+minor version)
98+
"/libssh-" version ".tar.xz"))
99+
(sha256
100+
(base32
101+
"19f7h8s044pqfhfk35ky5lj4hvqhi2p2p46xkwbcsqz6jllkqc15"))))))
102+
53103
(define-public guile-ssh
54104
(package
55105
(name "guile-ssh")
@@ -117,8 +167,17 @@ programs written in GNU Guile interpreter. It is a wrapper to the underlying
117167
libssh library.")
118168
(license license:gpl3+)))
119169

170+
(define-public guile-ssh/libssh9
171+
(package
172+
(inherit guile-ssh)
173+
(name "guile-ssh")
174+
(inputs (modify-inputs (package-inputs guile-ssh)
175+
(replace "libssh" libssh9)))))
176+
120177

121178

122-
guile-ssh
179+
(if (getenv "GUILE_SSH_BUILD_WITH_LIBSSH_0_9")
180+
guile-ssh/libssh9
181+
guile-ssh)
123182

124183
;;; guix.scm ends here.

0 commit comments

Comments
 (0)