parameterized-emacs.scm 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. ;; Test Package for Parameters
  2. ;; emacs-p : emacs variants, combined with parameters
  3. (define-module (test-packages)
  4. #:use-module (gnu packages version-control)
  5. #:use-module (gnu packages emacs)
  6. #:use-module (gnu packages sqlite)
  7. #:use-module (gnu packages)
  8. #:use-module (guix parameters)
  9. #:use-module (guix packages)
  10. #:use-module (guix utils)
  11. #:use-module (guix git-download)
  12. #:use-module (guix build-system gnu))
  13. (define-global-parameter
  14. (package-parameter
  15. (name 'x11)))
  16. (define-public emacs-p
  17. (package-with-parameters
  18. [parameter-spec
  19. (local
  20. (list
  21. (package-parameter
  22. (name 'next)
  23. (variants
  24. (parameter-variant-match
  25. (_ #:lambda (lambda (pkg)
  26. (package
  27. (inherit pkg)
  28. (version "29.0.92")
  29. (source
  30. (origin
  31. (inherit (package-source pkg))
  32. (method git-fetch)
  33. (uri (git-reference
  34. (url "https://git.savannah.gnu.org/git/emacs.git/")
  35. (commit (string-append "emacs-" version))))
  36. (file-name (git-file-name (package-name pkg) version))
  37. (patches
  38. (parameter-if #:package pkg (pgtk)
  39. (search-patches
  40. "emacs-exec-path.patch"
  41. "emacs-fix-scheme-indent-function.patch"
  42. "emacs-native-comp-driver-options.patch"
  43. "emacs-pgtk-super-key-fix.patch")
  44. (search-patches
  45. "emacs-exec-path.patch"
  46. "emacs-fix-scheme-indent-function.patch"
  47. "emacs-native-comp-driver-options.patch")))
  48. (sha256
  49. (base32
  50. "1h3p325859svcy43iv7wr27dp68049j9d44jq5akcynqdkxz4jjn"))))))))))
  51. (package-parameter (name 'tree-sitter)
  52. (dependencies '(tree-sitter)))
  53. (package-parameter
  54. (name 'pgtk)
  55. (variants
  56. (parameter-variant-match
  57. (_ #:transform (with-configure-flag
  58. #:package-name "=--with-pgtk"))))
  59. (dependencies '(tree-sitter x11)))
  60. (package-parameter
  61. (name 'xwidgets)
  62. (variants
  63. (parameter-variant-match
  64. (_ #:transform (with-configure-flag
  65. #:package-name "=--with-xwidgets")))))
  66. (package-parameter
  67. (name 'wide-int)
  68. (variants
  69. (parameter-variant-match
  70. (_ #:transform (with-configure-flag
  71. #:package-name "=--with-wide-int")))))))
  72. (one-of '((_ (x11 #:off) pgtk)
  73. (_ (x11 #:off) xwidgets)))]
  74. (inherit emacs)
  75. (name "emacs-p")
  76. (arguments
  77. (parameter-substitute-keyword-arguments
  78. (package-arguments emacs)
  79. [((x11 #:off))
  80. '(((#:configure-flags flags #~'())
  81. #~(delete "--with-cairo" #$flags))
  82. ((#:modules _) (%emacs-modules build-system))
  83. ((#:phases phases)
  84. #~(modify-phases #$phases
  85. (delete 'restore-emacs-pdmp)
  86. (delete 'strip-double-wrap))))]
  87. [(#:all (xwidgets on) (pgtk #:off))
  88. '(((#:configure-flags flags #~'())
  89. #~(cons "--with-xwidgets" #$flags))
  90. ((#:modules _) (%emacs-modules build-system))
  91. ((#:phases phases)
  92. #~(modify-phases #$phases
  93. (delete 'restore-emacs-pdmp)
  94. (delete 'strip-double-wrap))))]))
  95. (inputs
  96. (parameter-modify-inputs (package-inputs emacs)
  97. ((next) (prepend sqlite))
  98. (((tree-sitter on)) (prepend tree-sitter))
  99. (((xwidgets on)) (prepend gsettings-desktop-schemas
  100. webkitgtk-with-libsoup2))
  101. (((x11 #:off))
  102. (delete "libx11" "gtk+" "libxft" "libtiff" "giflib" "libjpeg"
  103. "imagemagick" "libpng" "librsvg" "libxpm" "libice" "libsm"
  104. "cairo" "pango" "harfbuzz" "libotf" "m17n-lib" "dbus"))))))