test-packages.scm 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. (define-module (test-packages)
  2. #:use-module (gnu packages version-control)
  3. #:use-module (gnu packages suckless)
  4. #:use-module (gnu packages emacs)
  5. #:use-module (gnu packages sqlite)
  6. #:use-module (gnu packages)
  7. #:use-module (guix parameters)
  8. #:use-module (guix packages)
  9. #:use-module (guix utils)
  10. #:use-module (guix git-download)
  11. #:use-module (guix build-system gnu))
  12. (define-global-parameter
  13. (package-parameter
  14. (name 'tests)
  15. (variants
  16. (parameter-variant-match
  17. (_ #:lambda (lambda (pkg)
  18. (display "Something expected!")
  19. (newline) pkg)
  20. #:lambda (lambda (pkg pv)
  21. (display "Something else expected!\n")
  22. pkg))
  23. (off #:lambda (lambda (pkg) (display "One more test!\n") pkg)
  24. #:transform (without-tests #:package-name)
  25. #:lambda (lambda (pkg pv) (display "Global parameters work!!! ")
  26. (display pv)
  27. (newline) pkg)
  28. (lambda (pkg) (display "one more thing...\n") pkg))))
  29. (description "toggle for tests")
  30. (predicate (const #t)))) ;(lambda (pkg)
  31. ; (eqv? (package-build-system pkg)
  32. ; gnu-build-system)))))
  33. (define-public git-st
  34. (package-with-parameters
  35. ;; pspec
  36. (parameter-spec
  37. (local
  38. (list
  39. ;; (package-parameter
  40. ;; (name 'temp)
  41. ;; (type (parameter-type
  42. ;; (name 'temp-type)
  43. ;; (accepted-values '(1 2 3)))))
  44. (package-parameter
  45. (name 'git)
  46. (variants
  47. (parameter-variant-match
  48. (off #:lambda (lambda (pkg pv) (display "IT WORKS! ") (display pv) (newline) pkg))
  49. (on #:transform (with-git-url #:package-name "https://github.com/cel7t/st")))))))
  50. (defaults '((git off))))
  51. (inherit st)
  52. (arguments (parameter-if (git) ; (list (cons 'git 'on))
  53. (and (display "Parameter-if works\n")
  54. (package-arguments st))
  55. (and (display "INITIAL Parameter-if works\n")
  56. (package-arguments st))))
  57. (name "git-st")))
  58. (define-global-parameter
  59. (package-parameter
  60. (name 'x11)))
  61. (define-public emacs-p
  62. (package-with-parameters
  63. [parameter-spec
  64. (local
  65. (list
  66. (package-parameter
  67. (name 'next)
  68. (variants
  69. (parameter-variant-match
  70. (_ #:lambda (lambda (pkg)
  71. (package
  72. (inherit pkg)
  73. (version "29.0.92")
  74. (source
  75. (origin
  76. (inherit (package-source pkg))
  77. (method git-fetch)
  78. (uri (git-reference
  79. (url "https://git.savannah.gnu.org/git/emacs.git/")
  80. (commit (string-append "emacs-" version))))
  81. (file-name (git-file-name (package-name pkg) version))
  82. (patches
  83. (parameter-if #:package pkg (pgtk)
  84. (search-patches
  85. "emacs-exec-path.patch"
  86. "emacs-fix-scheme-indent-function.patch"
  87. "emacs-native-comp-driver-options.patch"
  88. "emacs-pgtk-super-key-fix.patch")
  89. (search-patches
  90. "emacs-exec-path.patch"
  91. "emacs-fix-scheme-indent-function.patch"
  92. "emacs-native-comp-driver-options.patch")))
  93. (sha256
  94. (base32
  95. "1h3p325859svcy43iv7wr27dp68049j9d44jq5akcynqdkxz4jjn"))))))))))
  96. (package-parameter (name 'tree-sitter)
  97. (dependencies '(tree-sitter)))
  98. (package-parameter
  99. (name 'pgtk)
  100. (variants
  101. (parameter-variant-match
  102. (_ #:transform (with-configure-flag
  103. #:package-name "=--with-pgtk"))))
  104. (dependencies '(tree-sitter x11)))
  105. (package-parameter
  106. (name 'xwidgets)
  107. (variants
  108. (parameter-variant-match
  109. (_ #:transform (with-configure-flag
  110. #:package-name "=--with-xwidgets")))))
  111. (package-parameter
  112. (name 'wide-int)
  113. (variants
  114. (parameter-variant-match
  115. (_ #:transform (with-configure-flag
  116. #:package-name "=--with-wide-int")))))))
  117. (one-of '((_ (x11 #:off) pgtk)
  118. (_ (x11 #:off) xwidgets)))]
  119. (inherit emacs)
  120. (name "emacs-p")
  121. (arguments
  122. (parameter-substitute-keyword-arguments
  123. (package-arguments emacs)
  124. [((x11 #:off))
  125. '(((#:configure-flags flags #~'())
  126. #~(delete "--with-cairo" #$flags))
  127. ((#:modules _) (%emacs-modules build-system))
  128. ((#:phases phases)
  129. #~(modify-phases #$phases
  130. (delete 'restore-emacs-pdmp)
  131. (delete 'strip-double-wrap))))]
  132. [(#:all (xwidgets on) (pgtk #:off))
  133. '(((#:configure-flags flags #~'())
  134. #~(cons "--with-xwidgets" #$flags))
  135. ((#:modules _) (%emacs-modules build-system))
  136. ((#:phases phases)
  137. #~(modify-phases #$phases
  138. (delete 'restore-emacs-pdmp)
  139. (delete 'strip-double-wrap))))]))
  140. (inputs
  141. (parameter-modify-inputs (package-inputs emacs)
  142. ((next) (prepend sqlite))
  143. (((tree-sitter on)) (prepend tree-sitter))
  144. (((xwidgets on)) (prepend gsettings-desktop-schemas
  145. webkitgtk-with-libsoup2))
  146. (((x11 #:off))
  147. (delete "libx11" "gtk+" "libxft" "libtiff" "giflib" "libjpeg"
  148. "imagemagick" "libpng" "librsvg" "libxpm" "libice" "libsm"
  149. "cairo" "pango" "harfbuzz" "libotf" "m17n-lib" "dbus"))))))