summaryrefslogtreecommitdiff
path: root/etc/snippets/tempel/scheme-mode
diff options
context:
space:
mode:
authorMarius Bakke <[email protected]>2022-08-30 20:18:55 +0200
committerMarius Bakke <[email protected]>2022-08-30 20:18:55 +0200
commit59c136ef611b7a00683af1d1bb406dbd1af1a2bd (patch)
tree1ab434580130c7fd11b8ef5c22a91087b8401559 /etc/snippets/tempel/scheme-mode
parenta6f42953626df657041fddfc36a207b06c38f944 (diff)
parentd62fc2cc837b095ff1a633ae2639513ea3253596 (diff)
Merge branch 'staging' into core-updates
Diffstat (limited to 'etc/snippets/tempel/scheme-mode')
-rw-r--r--etc/snippets/tempel/scheme-mode89
1 files changed, 89 insertions, 0 deletions
diff --git a/etc/snippets/tempel/scheme-mode b/etc/snippets/tempel/scheme-mode
new file mode 100644
index 0000000000..54cb8e40a9
--- /dev/null
+++ b/etc/snippets/tempel/scheme-mode
@@ -0,0 +1,89 @@
+-*- mode: lisp-data -*-
+
+scheme-mode
+
+(package...
+ "(define-public " (s name)
+ n> "(package"
+ n > "(name \"" (s name) "\")"
+ n > "(version \"" p "\")"
+ n > "(source origin...)"
+ n > "(build-system " (p "gnu") "-build-system)"
+ n > "(home-page \"" p "\")"
+ n > "(synopsis \"" p "\")"
+ n > "(description \"" p "\")"
+ n > "(license license:" (p "unknown") ")))" n)
+
+(origin...
+ "(origin"
+ n> "(method " (p "url-fetch" method) ")"
+ n> "(uri " (cl-case (and method (intern method))
+ ('git-fetch "git-reference...")
+ ('svn-fetch "svn-reference...")
+ ('hg-fetch "hg-reference...")
+ ('cvs-fetch "cvs-reference...")
+ ('bzr-fetch "bzr-reference...")
+ (t "\"https://...\""))
+ ")"
+ n>
+ (cl-case (and method (intern method))
+ ('git-fetch
+ (insert "(file-name (git-file-name name version))")
+ (newline)
+ (indent-according-to-mode))
+ ('hg-fetch
+ (insert "(file-name (hg-file-name name version))")
+ (newline)
+ (indent-according-to-mode))
+ ('svn-fetch
+ (insert "(file-name (string-append name \"-\" version \"-checkout\"))")
+ (newline)
+ (indent-according-to-mode))
+ ('cvs-fetch
+ (insert "(file-name (string-append name \"-\" version \"-checkout\"))")
+ (newline)
+ (indent-according-to-mode))
+ ('bzr-fetch
+ (insert "(file-name (string-append name \"-\" version \"-checkout\"))")
+ (newline)
+ (indent-according-to-mode))
+ (t ""))
+ > "(sha256"
+ n > "(base32 \""
+ ;; hash of an empty directory
+ (p "0sjjj9z1dhilhpc8pq4154czrb79z9cm044jvn75kxcjv6v5l2m5") "\")))")
+
+(git-reference...
+ "(git-reference"
+ n> "(url \"" p "\")"
+ n> "(commit \"" p "\"))")
+
+(svn-reference...
+ "(svn-reference"
+ n> "(url \"" p "\")"
+ n> "(revision \"" p "\"))")
+
+(cvs-reference...
+ "(cvs-reference"
+ n> "(root-directory \"" p "\")"
+ n> "(module \"" p "\")"
+ n> "(revision \"" p "\"))")
+
+(hg-reference...
+ "(hg-reference"
+ n> "(url \"" p "\")"
+ n> "(changeset \"" p "\"))")
+
+(bzr-reference...
+ "(bzr-reference"
+ n> "(url \"" p "\")"
+ n> "(revision \"" p "\"))")
+
+(:phases\ "#:phases (modify-phases %standard-phases"
+ n> p ")")
+
+(add-before\ "(add-before '" p " '" p
+ n > p ")")
+(add-after\ "(add-after '" p " '" p
+ n > p ")")
+(replace\ "(replace '" p " " p")")