diff options
| author | Jonas Meeuws <jonas.meeuws@gmail.com> | 2025-10-06 16:26:26 +0200 |
|---|---|---|
| committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2026-08-22 16:49:16 +0200 |
| commit | 4ac3bf752f7f8cf1414563880b8bd51b5aa98656 (patch) | |
| tree | 23b5f6a8bf18707f673aea28eaa177541e8b8a5e | |
| parent | b2d0dca6afa7a50f1079e06814ea2e0a9bff65a0 (diff) | |
gnu: d-tools: Update to 2.111.0, build more of the tools.
* gnu/packages/dlang.scm (d-tools): Update to 2.111.0.
[outputs]: Add “internal” output.
[#:modules]: Add (srfi srfi-26).
[#:phases]: Build with dub. Install ddemangle to out. Install catdoc,
cchanged, checkwhitespace, contributors, detab, dget, tolf to internal.
<configure>: Replace by setting environment variables.
<build>: Move setting environment variables to ‘configure’. Invoke dub
instead of manual compilation.
<check>: Adjust for new test command.
<install>: Adjust for new build output paths, install more files.
[native-inputs]: Remove ld-gold-wrapper, add dub.
[description]: Add description for new binaries.
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
| -rw-r--r-- | gnu/packages/dlang.scm | 120 |
1 files changed, 83 insertions, 37 deletions
diff --git a/gnu/packages/dlang.scm b/gnu/packages/dlang.scm index 9479e262691..1699690c2c3 100644 --- a/gnu/packages/dlang.scm +++ b/gnu/packages/dlang.scm | |||
| @@ -826,7 +826,7 @@ needed.") | |||
| 826 | (define-public d-tools | 826 | (define-public d-tools |
| 827 | (package | 827 | (package |
| 828 | (name "d-tools") | 828 | (name "d-tools") |
| 829 | (version "2.105.3") | 829 | (version "2.111.0") |
| 830 | (source (origin | 830 | (source (origin |
| 831 | (method git-fetch) | 831 | (method git-fetch) |
| 832 | (uri (git-reference | 832 | (uri (git-reference |
| @@ -835,51 +835,97 @@ needed.") | |||
| 835 | (file-name (git-file-name name version)) | 835 | (file-name (git-file-name name version)) |
| 836 | (sha256 | 836 | (sha256 |
| 837 | (base32 | 837 | (base32 |
| 838 | "0hvz786k0pi8697x1vk9x5bx52jiy7pvi13wmfkx15ddvv0x5j33")))) | 838 | "04kckyh4r2s1kncxbknykrcrjqi3ypygnz0sj909hbrdpfg0ghf4")))) |
| 839 | (outputs '("out" "internal")) | ||
| 839 | (build-system gnu-build-system) | 840 | (build-system gnu-build-system) |
| 840 | (arguments | 841 | (arguments |
| 841 | (list | 842 | (list |
| 843 | #:modules | ||
| 844 | `(,@%default-gnu-modules | ||
| 845 | (srfi srfi-26)) | ||
| 842 | #:phases | 846 | #:phases |
| 843 | #~(modify-phases %standard-phases | 847 | #~(let ((sub-packages-out |
| 844 | (add-after 'unpack 'patch-tests | 848 | '("ddemangle" |
| 845 | (lambda _ | 849 | ;;"dman" ; skip as it depends “../dlang.org“ |
| 846 | ;; Skip broken make ONESHELL shell test. | 850 | "dustmite" |
| 847 | (substitute* "rdmd_test.d" | 851 | "rdmd")) |
| 848 | (("makeVersion = .*$") "makeVersion = \"skip\";")))) | 852 | (sub-packages-internal |
| 849 | (delete 'configure) | 853 | '("catdoc" |
| 850 | (replace 'build | 854 | "changed" |
| 851 | (lambda _ | 855 | "checkwhitespace" |
| 852 | (mkdir-p "bin") | 856 | "contributors" |
| 853 | (setenv "CC" #$(cc-for-target)) | 857 | "detab" |
| 854 | (setenv "LD" #$(ld-for-target)) | 858 | "dget" |
| 855 | (invoke "ldc2" "rdmd.d" "--of" "bin/rdmd") | 859 | ;;"tests_extractor" ; skip as it depends on libdparse |
| 856 | (apply invoke "ldc2" "--of=bin/dustmite" | 860 | "tolf"))) |
| 857 | (find-files "DustMite" ".*\\.d")))) | 861 | (modify-phases %standard-phases |
| 858 | (replace 'check | 862 | (add-after 'unpack 'patch-tests |
| 859 | (lambda* (#:key tests? #:allow-other-keys) | 863 | (lambda _ |
| 860 | (when tests? | 864 | ;; Skip broken make ONESHELL shell test. |
| 861 | (invoke "bin/rdmd" "rdmd_test.d" "bin/rdmd" | 865 | (substitute* "rdmd_test.d" |
| 862 | "-m" (if #$(target-64bit?) "64" "32") | 866 | (("makeVersion = .*$") "makeVersion = \"skip\";")))) |
| 863 | "--rdmd-default-compiler" "ldmd2")))) | 867 | (replace 'configure |
| 864 | (replace 'install | 868 | (lambda _ |
| 865 | (lambda* (#:key outputs #:allow-other-keys) | 869 | (setenv "CC" #$(cc-for-target)) |
| 866 | (let* ((out (assoc-ref outputs "out")) | 870 | (setenv "DC" (which "ldc2")) |
| 867 | (bin (string-append out "/bin")) | 871 | (setenv "DUB_HOME" "/tmp/.dub"))) |
| 868 | (man (string-append out "/man"))) | 872 | (replace 'build |
| 869 | (for-each delete-file (find-files "bin" "\\.o$")) | 873 | (lambda _ |
| 870 | (copy-recursively "bin" bin) | 874 | (for-each |
| 871 | (copy-recursively "man" man))))))) | 875 | (lambda (sub-package) |
| 876 | (invoke "dub" "build" "--build=release" | ||
| 877 | (string-append ":" sub-package))) | ||
| 878 | (append sub-packages-out sub-packages-internal)))) | ||
| 879 | (replace 'check | ||
| 880 | (lambda* (#:key tests? #:allow-other-keys) | ||
| 881 | (when tests? | ||
| 882 | (invoke "./dtools_rdmd" "rdmd_test.d" "dtools_rdmd" | ||
| 883 | "--rdmd-default-compiler" "ldmd2")))) | ||
| 884 | (replace 'install | ||
| 885 | (lambda* (#:key outputs #:allow-other-keys) | ||
| 886 | (let* ((out (assoc-ref outputs "out")) | ||
| 887 | (out-bin (string-append out "/bin")) | ||
| 888 | (out-man (string-append out "/man")) | ||
| 889 | (internal (assoc-ref outputs "internal")) | ||
| 890 | (internal-bin (string-append internal "/bin")) | ||
| 891 | (install-sub-package | ||
| 892 | (lambda (pkg dir) | ||
| 893 | (mkdir-p dir) | ||
| 894 | (copy-file (string-append "dtools_" pkg) | ||
| 895 | (string-append dir "/" pkg)))) | ||
| 896 | (install-sub-packages | ||
| 897 | (lambda (pkgs dir) | ||
| 898 | (for-each (cut install-sub-package <> dir) | ||
| 899 | pkgs)))) | ||
| 900 | (install-sub-packages sub-packages-out out-bin) | ||
| 901 | (install-sub-packages sub-packages-internal internal-bin) | ||
| 902 | (copy-recursively "man" out-man)))))))) | ||
| 872 | (native-inputs | 903 | (native-inputs |
| 873 | (list ldc | 904 | (list ldc |
| 874 | (module-ref (resolve-interface | 905 | dub)) |
| 875 | '(gnu packages commencement)) | ||
| 876 | 'ld-gold-wrapper))) | ||
| 877 | (home-page "https://github.com/dlang/tools") | 906 | (home-page "https://github.com/dlang/tools") |
| 878 | (synopsis "Useful D-related tools") | 907 | (synopsis "Useful D-related tools") |
| 879 | (description | 908 | (description |
| 880 | "@code{d-tools} provides two useful tools for the D language: @code{rdmd}, | 909 | "@code{d-tools} provides some useful tools for working with the D |
| 881 | which runs D source files as scripts, and @code{dustmite}, which reduces D code | 910 | programming language. In the output @code{out} are: |
| 882 | to a minimal test case.") | 911 | @itemize |
| 912 | @item @code{ddemangle} (demangles D symbols) | ||
| 913 | @item @code{dustmite} (reduces D-like source code to mimimally reproduce some | ||
| 914 | test case) | ||
| 915 | @item @code{rdmd} (runs D source files as scripts) | ||
| 916 | @end itemize | ||
| 917 | In the @code{internal} output are: | ||
| 918 | @itemize | ||
| 919 | @item @code{catdoc} (concatenates Ddoc files) | ||
| 920 | @item @code{changed} (change log generator) | ||
| 921 | @item @code{checkwhitespace} (checks for correct whitespace usage in source | ||
| 922 | files) | ||
| 923 | @item @code{contributors} (query contributors between two D releases) | ||
| 924 | @item @code{detab} (replace tabs with spaces, and remove trailing whitespace | ||
| 925 | from lines) | ||
| 926 | @item @code{dget} (D source code downloader) | ||
| 927 | @item @code{tolf} (line endings converter) | ||
| 928 | @end itemize") | ||
| 883 | (license license:boost1.0))) | 929 | (license license:boost1.0))) |
| 884 | 930 | ||
| 885 | 931 | ||
