summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.envrc-nix8
-rw-r--r--dub_describe.json194
-rw-r--r--flake.lock14
-rw-r--r--flake.nix6
-rw-r--r--nix-overlays/README26
-rw-r--r--nix-overlays/dmd/default.nix6
-rw-r--r--nix-overlays/dmd/generic.nix65
-rw-r--r--nix-overlays/dmd/package.nix5
-rw-r--r--nix-overlays/dtools/default.nix52
-rw-r--r--nix-overlays/dtools/disabled-tests.diff11
-rw-r--r--nix-overlays/dtools/fix-ldc-arm64.diff102
-rw-r--r--nix-overlays/dtools/package.nix49
-rw-r--r--nix-overlays/dub/package.nix22
-rw-r--r--nix-overlays/ldc/bootstrap.nix23
-rw-r--r--nix-overlays/ldc/package.nix116
-rw-r--r--org/config_env.org2
-rw-r--r--org/config_nix.org12
-rw-r--r--org/nix-develop-dlang-shared.org255
-rw-r--r--org/nixpkgs_overlays_d_related.org1092
-rw-r--r--src/ext_depends/arsd/cgi.d4
-rw-r--r--src/ext_depends/arsd/core.d755
21 files changed, 1740 insertions, 1079 deletions
diff --git a/.envrc-nix b/.envrc-nix
index 165a025..e118848 100644
--- a/.envrc-nix
+++ b/.envrc-nix
@@ -1,7 +1,7 @@
NIX_ENFORCE_PURITY=1
# - https://github.com/nix-community/nix-direnv
-NixDirEnvVersion="3.0.6"
-NixDirEnvSHA="sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM="
+NixDirEnvVersion="3.0.7"
+NixDirEnvSHA="sha256-bn8WANE5a91RusFmRI7kS751ApelG02nMcwRekC/qzc="
if ! has nix_direnv_version || ! nix_direnv_version ${NixDirEnvVersion}; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/${NixDirEnvVersion}/direnvrc" "${NixDirEnvSHA}"
fi
@@ -26,7 +26,7 @@ echo '
• nix develop using nixpkgs
❯❯ nix develop ".#dsh-nixpkgs-dmd-dub" --print-build-logs -c zsh
❯❯ nix develop ".#dsh-nixpkgs-ldc-dub" --print-build-logs -c zsh
- • nix develop using package overlays: (dmd-2.109.1, ldc-1.40.0, dub-1.38.1)
+ • nix develop using package overlays: (dmd-2.111.0, ldc-1.41.0, dub-1.39.0)
❯❯ nix develop ".#dsh-overlay-dmd-dub" --print-build-logs -c zsh
❯❯ nix develop ".#dsh-overlay-ldc-dub" --print-build-logs -c zsh
❯❯ nix flake show
@@ -40,7 +40,7 @@ echo '
• nix build using nixpkgs
❯❯ nix build ".#spine-search-nixpkgs-dmd" --print-build-logs
❯❯ nix build ".#spine-search-nixpkgs-ldc" --print-build-logs
- • nix build using package overlays: (dmd-2.109.1, ldc-1.40.0, dub-1.38.1)
+ • nix build using package overlays: (dmd-2.111.0, ldc-1.41.0, dub-1.39.0)
❯❯ nix build ".#spine-search-overlay-dmd" --print-build-logs
❯❯ nix build ".#spine-search-overlay-ldc" --print-build-logs
diff --git a/dub_describe.json b/dub_describe.json
index e87b668..b034366 100644
--- a/dub_describe.json
+++ b/dub_describe.json
@@ -1,7 +1,7 @@
{
"rootPackage": "spine_search",
"configuration": "default",
- "buildType": "$DFLAGS",
+ "buildType": "debug",
"compiler": "ldc",
"architecture": [
"x86_64"
@@ -14,13 +14,13 @@
{
"path": "./",
"name": "spine_search",
- "version": "0.12.0",
+ "version": "0.18.0",
"description": "cgi search for spine, a sisu like document parser",
"homepage": "https://sisudoc.org",
"authors": [
"Ralph Amissah"
],
- "copyright": "Copyright © 2002, 2023 Ralph Amissah",
+ "copyright": "Copyright © 2002, 2025 Ralph Amissah",
"license": "AGPL-3.0+",
"dependencies": [
"spine_search:arsd.cgi",
@@ -43,8 +43,9 @@
"versions": [],
"debugVersions": [],
"importPaths": [
- "src/"
+ "./views"
],
+ "cImportPaths": [],
"stringImportPaths": [
"./views"
],
@@ -70,66 +71,42 @@
"files": [
{
"role": "source",
- "path": "src/ext_depends/arsd/cgi.d"
- },
- {
- "role": "source",
- "path": "src/ext_depends/arsd/core.d"
- },
- {
- "role": "source",
- "path": "src/ext_depends/d2sqlite3/source/d2sqlite3/database.d"
- },
- {
- "role": "source",
- "path": "src/ext_depends/d2sqlite3/source/d2sqlite3/internal/memory.d"
- },
- {
- "role": "source",
- "path": "src/ext_depends/d2sqlite3/source/d2sqlite3/internal/util.d"
- },
- {
- "role": "source",
- "path": "src/ext_depends/d2sqlite3/source/d2sqlite3/library.d"
- },
- {
- "role": "source",
- "path": "src/ext_depends/d2sqlite3/source/d2sqlite3/package.d"
+ "path": "src/sisudoc/spine_search.d"
},
{
- "role": "source",
- "path": "src/ext_depends/d2sqlite3/source/d2sqlite3/results.d"
+ "role": "stringImport",
+ "path": "views/configuration.txt"
},
{
- "role": "source",
- "path": "src/ext_depends/d2sqlite3/source/d2sqlite3/sqlite3.d"
+ "role": "stringImport",
+ "path": "views/configuration.txt_"
},
{
- "role": "source",
- "path": "src/ext_depends/d2sqlite3/source/d2sqlite3/statement.d"
+ "role": "stringImport",
+ "path": "views/configuration.txt_localhost_"
},
{
- "role": "source",
- "path": "src/ext_depends/d2sqlite3/source/tests.d"
+ "role": "stringImport",
+ "path": "views/configuration.txt_remotehost_"
},
{
- "role": "source",
- "path": "src/spine_search.d"
+ "role": "stringImport",
+ "path": "views/configuration_example.txt"
},
{
"role": "stringImport",
- "path": "views/configuration.txt"
+ "path": "views/version.txt"
},
{
"role": "stringImport",
- "path": "views/version.txt"
+ "path": "views/version.txt_"
}
]
},
{
"path": "./",
"name": "spine_search:arsd.cgi",
- "version": "0.12.0",
+ "version": "0.18.0",
"description": "cgi",
"homepage": "https://code.dlang.org/packages/arsd-official",
"authors": [
@@ -157,6 +134,7 @@
"importPaths": [
"./src/ext_depends/arsd"
],
+ "cImportPaths": [],
"stringImportPaths": [
"views"
],
@@ -192,14 +170,34 @@
},
{
"role": "stringImport",
+ "path": "views/configuration.txt_"
+ },
+ {
+ "role": "stringImport",
+ "path": "views/configuration.txt_localhost_"
+ },
+ {
+ "role": "stringImport",
+ "path": "views/configuration.txt_remotehost_"
+ },
+ {
+ "role": "stringImport",
+ "path": "views/configuration_example.txt"
+ },
+ {
+ "role": "stringImport",
"path": "views/version.txt"
+ },
+ {
+ "role": "stringImport",
+ "path": "views/version.txt_"
}
]
},
{
"path": "./",
"name": "spine_search:d2sqlite3",
- "version": "0.12.0",
+ "version": "0.18.0",
"description": "A thin wrapper around SQLite 3",
"homepage": "https://github.com/dlang-community/d2sqlite3",
"authors": [
@@ -230,6 +228,7 @@
"importPaths": [
"./src/ext_depends/d2sqlite3/source"
],
+ "cImportPaths": [],
"stringImportPaths": [
"views"
],
@@ -293,7 +292,27 @@
},
{
"role": "stringImport",
+ "path": "views/configuration.txt_"
+ },
+ {
+ "role": "stringImport",
+ "path": "views/configuration.txt_localhost_"
+ },
+ {
+ "role": "stringImport",
+ "path": "views/configuration.txt_remotehost_"
+ },
+ {
+ "role": "stringImport",
+ "path": "views/configuration_example.txt"
+ },
+ {
+ "role": "stringImport",
"path": "views/version.txt"
+ },
+ {
+ "role": "stringImport",
+ "path": "views/version.txt_"
}
]
}
@@ -311,12 +330,7 @@
"targetName": "spine_search",
"workingDirectory": "",
"mainSourceFile": "",
- "dflags": [
- "\"-O2",
- "-inline",
- "-boundscheck=on",
- "-color=on\""
- ],
+ "dflags": [],
"lflags": [],
"libs": [
"sqlite3"
@@ -326,18 +340,7 @@
"./libspine_search_d2sqlite3.a"
],
"sourceFiles": [
- "./src/ext_depends/arsd/cgi.d",
- "./src/ext_depends/arsd/core.d",
- "./src/ext_depends/d2sqlite3/source/d2sqlite3/database.d",
- "./src/ext_depends/d2sqlite3/source/d2sqlite3/internal/memory.d",
- "./src/ext_depends/d2sqlite3/source/d2sqlite3/internal/util.d",
- "./src/ext_depends/d2sqlite3/source/d2sqlite3/library.d",
- "./src/ext_depends/d2sqlite3/source/d2sqlite3/package.d",
- "./src/ext_depends/d2sqlite3/source/d2sqlite3/results.d",
- "./src/ext_depends/d2sqlite3/source/d2sqlite3/sqlite3.d",
- "./src/ext_depends/d2sqlite3/source/d2sqlite3/statement.d",
- "./src/ext_depends/d2sqlite3/source/tests.d",
- "./src/spine_search.d"
+ "./src/sisudoc/spine_search.d"
],
"injectSourceFiles": [],
"copyFiles": [],
@@ -351,17 +354,23 @@
"versionFilters": [],
"debugVersionFilters": [],
"importPaths": [
- "./src/",
+ "./views",
"./src/ext_depends/arsd",
"./src/ext_depends/d2sqlite3/source"
],
+ "cImportPaths": [],
"stringImportPaths": [
"./views"
],
"importFiles": [],
"stringImportFiles": [
+ "./views/configuration.txt_localhost_",
+ "./views/configuration.txt_",
+ "./views/configuration.txt_remotehost_",
+ "./views/version.txt_",
+ "./views/version.txt",
"./views/configuration.txt",
- "./views/version.txt"
+ "./views/configuration_example.txt"
],
"preGenerateCommands": [],
"postGenerateCommands": [],
@@ -378,9 +387,16 @@
"postBuildEnvironments": {},
"preRunEnvironments": {},
"postRunEnvironments": {},
- "requirements": {},
- "options": {}
+ "requirements": [
+ "allowWarnings"
+ ],
+ "options": [
+ "debugMode",
+ "debugInfo",
+ "warnings"
+ ]
},
+ "cacheArtifactPath": "/home/ralph/.dub/cache/spine_search/0.18.0/build/default-debug-ad4Jr5KYHL-vWkDoM8eUmQ/spine_search",
"dependencies": [
"spine_search:arsd.cgi",
"spine_search:d2sqlite3"
@@ -402,12 +418,7 @@
"targetName": "spine_search_arsd.cgi",
"workingDirectory": "",
"mainSourceFile": "",
- "dflags": [
- "\"-O2",
- "-inline",
- "-boundscheck=on",
- "-color=on\""
- ],
+ "dflags": [],
"lflags": [],
"libs": [],
"linkerFiles": [],
@@ -427,13 +438,19 @@
"importPaths": [
"./src/ext_depends/arsd"
],
+ "cImportPaths": [],
"stringImportPaths": [
"./views"
],
"importFiles": [],
"stringImportFiles": [
+ "./views/configuration.txt_localhost_",
+ "./views/configuration.txt_",
+ "./views/configuration.txt_remotehost_",
+ "./views/version.txt_",
+ "./views/version.txt",
"./views/configuration.txt",
- "./views/version.txt"
+ "./views/configuration_example.txt"
],
"preGenerateCommands": [],
"postGenerateCommands": [],
@@ -450,9 +467,14 @@
"postBuildEnvironments": {},
"preRunEnvironments": {},
"postRunEnvironments": {},
- "requirements": {},
- "options": {}
+ "requirements": [],
+ "options": [
+ "debugMode",
+ "debugInfo",
+ "warningsAsErrors"
+ ]
},
+ "cacheArtifactPath": "/home/ralph/.dub/cache/spine_search/0.18.0/+arsd.cgi/build/cgi-debug-v2DAX8HeTpjjJrCrVfJhng/libspine_search_arsd.cgi.a",
"dependencies": [],
"linkDependencies": []
},
@@ -468,12 +490,7 @@
"targetName": "spine_search_d2sqlite3",
"workingDirectory": "",
"mainSourceFile": "",
- "dflags": [
- "\"-O2",
- "-inline",
- "-boundscheck=on",
- "-color=on\""
- ],
+ "dflags": [],
"lflags": [],
"libs": [
"sqlite3"
@@ -502,13 +519,19 @@
"importPaths": [
"./src/ext_depends/d2sqlite3/source"
],
+ "cImportPaths": [],
"stringImportPaths": [
"./views"
],
"importFiles": [],
"stringImportFiles": [
+ "./views/configuration.txt_localhost_",
+ "./views/configuration.txt_",
+ "./views/configuration.txt_remotehost_",
+ "./views/version.txt_",
+ "./views/version.txt",
"./views/configuration.txt",
- "./views/version.txt"
+ "./views/configuration_example.txt"
],
"preGenerateCommands": [],
"postGenerateCommands": [],
@@ -525,9 +548,14 @@
"postBuildEnvironments": {},
"preRunEnvironments": {},
"postRunEnvironments": {},
- "requirements": {},
- "options": {}
+ "requirements": [],
+ "options": [
+ "debugMode",
+ "debugInfo",
+ "warningsAsErrors"
+ ]
},
+ "cacheArtifactPath": "/home/ralph/.dub/cache/spine_search/0.18.0/+d2sqlite3/build/d2sqlite3-debug-WjZayd7TAWeyfdiH60vT-A/libspine_search_d2sqlite3.a",
"dependencies": [],
"linkDependencies": []
}
diff --git a/flake.lock b/flake.lock
index b5f12ba..71e836f 100644
--- a/flake.lock
+++ b/flake.lock
@@ -2,11 +2,11 @@
"nodes": {
"nixpkgs": {
"locked": {
- "lastModified": 1740019556,
- "narHash": "sha256-vn285HxnnlHLWnv59Og7muqECNMS33mWLM14soFIv2g=",
+ "lastModified": 1754651824,
+ "narHash": "sha256-aB7ft6njy9EJfuW+rdToNChfRrHNRw/yTg5cSEnG+HI=",
"owner": "NixOS",
"repo": "nixpkgs",
- "rev": "dad564433178067be1fbdfcce23b546254b6d641",
+ "rev": "b069b7c1e2fe1a3a24221428558bf44128d3d5c8",
"type": "github"
},
"original": {
@@ -29,11 +29,11 @@
]
},
"locked": {
- "lastModified": 1734289685,
- "narHash": "sha256-nfnmDNn0OWIAPKAi7Lo9bCk6AhS7knUOp68AYwLhVAM=",
+ "lastModified": 1754707636,
+ "narHash": "sha256-np3xPi0/PPEe4OWPPrTNV+eu8QIgSp83NaKMukE0hJE=",
"ref": "refs/heads/main",
- "rev": "664c8a2c6450aca19b9c84c1a5c4b42d5d5a1f9f",
- "revCount": 16,
+ "rev": "d393ad85676436fef1e37e712405d6d10593977d",
+ "revCount": 23,
"type": "git",
"url": "git://git.sisudoc.org/package/dlang-nix-overlays-and-flake"
},
diff --git a/flake.nix b/flake.nix
index 43af700..481f7ae 100644
--- a/flake.nix
+++ b/flake.nix
@@ -211,7 +211,7 @@
with pkgs-nix; {
dsh-d-overlay = spine-d-overlay.devShells.${system}.default;
dsh-overlay = mkShell {
- name = "spine-0.18.0 base dev shell, ldc-1.40.0, dub-1.38.1";
+ name = "spine-0.18.0 base dev shell, ldc-1.41.0, dub-1.39.0";
inherit shell;
inherit devEnv;
packages = with pkgs-ovl; [
@@ -248,7 +248,7 @@
inherit shellHook;
};
dsh-overlay-dmd-dub = mkShell {
- name = "spine-0.18.0 base dev shell, dmd-2.109.1, dub-1.38.1";
+ name = "spine-0.18.0 base dev shell, dmd-2.111.0, dub-1.39.0";
inherit shell;
inherit devEnv;
packages = with pkgs-ovl; [
@@ -260,7 +260,7 @@
inherit shellHook;
};
dsh-overlay-ldc-dub = mkShell {
- name = "spine-0.18.0 base dev shell, ldc-1.40.0, dub-1.38.1";
+ name = "spine-0.18.0 base dev shell, ldc-1.41.0, dub-1.39.0";
inherit shell;
inherit devEnv;
packages = with pkgs-ovl; [
diff --git a/nix-overlays/README b/nix-overlays/README
index c593dc5..75b498b 100644
--- a/nix-overlays/README
+++ b/nix-overlays/README
@@ -16,11 +16,11 @@ compiler and build tools: ldc, dub and dtools, than exist in nixpkgs at the time
of publishing, in some cases with additional fixes.
nix overlays for (updates nixpkgs, more recent versions of):
- - ldc ( 1.30.0 -> 1.40.0 )
- - dub ( 1.23.0 -> 1.38.1 ) [for nix versions 1.31.0 ... 1.33.0 broken]
- - dtools ( 2.095.1 -> 2.103.1 )
+ - ldc ( 1.30.0 -> 1.41.0 )
+ - dub ( 1.23.0 -> 1.40.0 ) [for nix versions 1.31.0 ... 1.33.0 broken]
+ - dtools ( 2.095.1 -> 2.110.0 )
- - dmd ( 2.106.1 -> 2.109.1 )
+ - dmd ( 2.106.1 -> 2.111.0 )
- gdc [not yet available]
dlang-nix-flakes.org --❯
@@ -47,26 +47,26 @@ search nixpkgs here:
- https://search.nixos.org/packages?channel=unstable&from=0&size=100&sort=relevance&query=
** compilers
-*** ldc OK ✓ ( 1.30.0 -> 1.40.0 )
+*** ldc OK ✓ ( 1.30.0 -> 1.41.0 )
- https://wiki.dlang.org/LDC
- https://github.com/ldc-developers/ldc
- https://github.com/ldc-developers/ldc/releases
- nix-prefetch-url --unpack https://github.com/ldc-developers/ldc/archive/refs/tags/v1.40.0.tar.gz
+ nix-prefetch-url --unpack https://github.com/ldc-developers/ldc/archive/refs/tags/v1.41.0.tar.gz
- https://github.com/ldc-developers/ldc/issues
- version in nixpkgs:
- https://search.nixos.org/packages?channel=unstable&show=ldc&from=0&size=100&sort=relevance&type=packages&query=ldc
-*** dmd OK ✓ ( 2.100.2 -> 2.109.1 )
+*** dmd OK ✓ ( 2.100.2 -> 2.111.0 )
- https://dlang.org/
- https://wiki.dlang.org/LDC
- https://github.com/dlang/dmd
- https://github.com/dlang/dmd/tags
- nix-prefetch-url --unpack https://github.com/dlang/dmd/archive/refs/tags/v2.109.1.tar.gz
+ nix-prefetch-url --unpack https://github.com/dlang/dmd/archive/refs/tags/v2.111.0.tar.gz
- https://github.com/dlang/dmd/pulls
- version in nixpkgs:
@@ -88,13 +88,13 @@ not yet provided in nixpkgs with gcc12, no attempt made
- https://github.com/D-Programming-GDC/gdc
** build tool
-*** dub ( 1.23.0 -> 1.38.1 )
+*** dub ( 1.23.0 -> 1.40.0 )
- https://code.dlang.org/packages/dub
- https://github.com/dlang/dub
- https://github.com/dlang/dub/releases
- nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.38.1.tar.gz
+ nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.40.0.tar.gz
- https://github.com/dlang/dub/issues
- version in nixpkgs:
@@ -102,19 +102,19 @@ not yet provided in nixpkgs with gcc12, no attempt made
- dub nixpkg overlay is updated and runs most dub tests correctly
-- dub OK ✓ ( 1.30.0 -> 1.38.1 )
+- dub OK ✓ ( 1.30.0 -> 1.40.0 )
from v1.31.0 requires seeting of pwd in buildPhase else fails to build
packages with nix tools that previous version of dub built;
** tools
-*** dtools OK ✓ ( 2.095.1 -> 2.103.1 )
+*** dtools OK ✓ ( 2.095.1 -> 2.110.0 )
- https://code.dlang.org/packages/dtools
- https://github.com/dlang/tools
- https://github.com/dlang/tools/tags
- nix-prefetch --unpack https://github.com/dlang/tools/archive/refs/tags/v2.103.1.tar.gz
+ nix-prefetch --unpack https://github.com/dlang/tools/archive/refs/tags/v2.110.0.tar.gz
- https://github.com/dlang/tools/issues
- version in nixpkgs
diff --git a/nix-overlays/dmd/default.nix b/nix-overlays/dmd/default.nix
index b5268b7..8375c13 100644
--- a/nix-overlays/dmd/default.nix
+++ b/nix-overlays/dmd/default.nix
@@ -1,5 +1 @@
-import ./generic.nix {
- version = "2.109.1";
- dmdHash = "sha256-3nCDPZnb4eQZmhYYxcH6qOmsP8or0KYuzAa5g/C9xdU=";
- phobosHash = "sha256-73I0k7tCBwe5tl4K6uMs3/nT2JTZ2SppFYzmokS4W5Y=";
-}
+import ./package.nix
diff --git a/nix-overlays/dmd/generic.nix b/nix-overlays/dmd/generic.nix
index 22f7fa8..59a781e 100644
--- a/nix-overlays/dmd/generic.nix
+++ b/nix-overlays/dmd/generic.nix
@@ -1,28 +1,30 @@
-{ version
-, dmdHash
-, phobosHash
+{
+ version,
+ dmdHash,
+ phobosHash,
}:
-{ stdenv
-, lib
-, fetchFromGitHub
-, removeReferencesTo
-, makeWrapper
-, which
-, writeTextFile
-, curl
-, tzdata
-, gdb
-#, Foundation
-, callPackage
-, targetPackages
-, fetchpatch
-, bash
-, installShellFiles
-, git
-, unzip
-, dmdBootstrap ? callPackage ./bootstrap.nix { }
-, dmdBin ? "${dmdBootstrap}/bin"
+{
+ stdenv,
+ lib,
+ fetchFromGitHub,
+ removeReferencesTo,
+ makeWrapper,
+ which,
+ writeTextFile,
+ curl,
+ tzdata,
+ gdb,
+ # Foundation,
+ callPackage,
+ targetPackages,
+ fetchpatch,
+ bash,
+ installShellFiles,
+ git,
+ unzip,
+ dmdBootstrap ? callPackage ./bootstrap.nix { },
+ dmdBin ? "${dmdBootstrap}/bin",
}:
let
@@ -36,11 +38,8 @@ let
};
bits = builtins.toString stdenv.hostPlatform.parsed.cpu.bits;
- osname =
- if stdenv.hostPlatform.isDarwin then
- "osx"
- else
- stdenv.hostPlatform.parsed.kernel.name;
+ osname = if stdenv.hostPlatform.isDarwin then "osx"
+ else stdenv.hostPlatform.parsed.kernel.name;
pathToDmd = "\${NIX_BUILD_TOP}/dmd/generated/${osname}/release/${bits}/dmd";
in
@@ -97,7 +96,9 @@ stdenv.mkDerivation (finalAttrs: {
rm dmd/compiler/test/runnable/gdb4149.d
rm dmd/compiler/test/runnable/gdb4181.d
rm dmd/compiler/test/compilable/ddocYear.d
- rm dmd/compiler/test/fail_compilation/needspkgmod.d
+ rm dmd/compiler/test/compilable/sarif_success_test.d
+ rm dmd/compiler/test/fail_compilation/sarif_test.d
+ rm dmd/compiler/test/fail_compilation/sarifmultiple_test.d
# Disable tests that rely on objdump whitespace until fixed upstream:
# https://issues.dlang.org/show_bug.cgi?id=23317
@@ -109,9 +110,9 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace dmd/compiler/test/dshell/test6952.d --replace-fail "/usr/bin/env bash" "${bash}/bin/bash"
'' + lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace phobos/std/socket.d --replace-fail "assert(ih.addrList[0] == 0x7F_00_00_01);" ""
- '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
- substituteInPlace phobos/std/socket.d --replace-fail "foreach (name; names)" "names = []; foreach (name; names)"
- '';
+ ''; # + lib.optionalString stdenv.hostPlatform.isDarwin ''
+ # substituteInPlace phobos/std/socket.d --replace-fail "foreach (name; names)" "names = []; foreach (name; names)"
+ #'';
nativeBuildInputs = [
makeWrapper
diff --git a/nix-overlays/dmd/package.nix b/nix-overlays/dmd/package.nix
new file mode 100644
index 0000000..3aa1183
--- /dev/null
+++ b/nix-overlays/dmd/package.nix
@@ -0,0 +1,5 @@
+import ./generic.nix {
+ version = "2.111.0";
+ dmdHash = "sha256-2bjsGa9nTny818dLRV6LKkes+Ycq8W+PFjwhGVrD5TM=";
+ phobosHash = "sha256-9jySZbODoL8sULhYKj/l4+c/uiG5xY2dO240k9XQtPk=";
+}
diff --git a/nix-overlays/dtools/default.nix b/nix-overlays/dtools/default.nix
index d605e4d..8375c13 100644
--- a/nix-overlays/dtools/default.nix
+++ b/nix-overlays/dtools/default.nix
@@ -1,51 +1 @@
-{ stdenv, lib, fetchFromGitHub, fetchpatch, ldc, curl, gnumake42 }:
-
-stdenv.mkDerivation rec {
- pname = "dtools";
- version = "2.103.1";
-
- src = fetchFromGitHub {
- owner = "dlang";
- repo = "tools";
- rev = "v${version}";
- sha256 = "sha256-XM4gUxcarQCOBR8W/o0iWAI54PyLDkH6CsDce22Cnu4=";
- name = "dtools";
- };
-
- patches = [
- (fetchpatch {
- # part of https://github.com/dlang/tools/pull/441
- url = "https://github.com/dlang/tools/commit/6c6a042d1b08e3ec1790bd07a7f69424625ee866.patch"; # Fix LDC arm64 build
- sha256 = "sha256-x6EclTYN1Y5FG57KLhbBK0BZicSYcZoWO7MTVcP4T18=";
- })
- ];
-
- nativeBuildInputs = [ ldc gnumake42 ]; # fails with make 4.4
- buildInputs = [ curl ];
-
- makeCmd = ''
- make -f posix.mak all DMD_DIR=dmd DMD=${ldc.out}/bin/ldmd2 CC=${stdenv.cc}/bin/cc
- '';
-
- buildPhase = ''
- $makeCmd
- '';
-
- doCheck = true;
-
- checkPhase = ''
- $makeCmd test_rdmd
- '';
-
- installPhase = ''
- $makeCmd INSTALL_DIR=$out install
- '';
-
- meta = with lib; {
- description = "Ancillary tools for the D programming language compiler";
- homepage = "https://github.com/dlang/tools";
- license = lib.licenses.boost;
- maintainers = with maintainers; [ ThomasMader ];
- platforms = lib.platforms.unix;
- };
-}
+import ./package.nix
diff --git a/nix-overlays/dtools/disabled-tests.diff b/nix-overlays/dtools/disabled-tests.diff
new file mode 100644
index 0000000..a22825a
--- /dev/null
+++ b/nix-overlays/dtools/disabled-tests.diff
@@ -0,0 +1,11 @@
+--- a/rdmd_test.d
++++ b/rdmd_test.d
+@@ -616,7 +616,7 @@ void runTests(string rdmdApp, string compiler, string model)
+ enforce(res.status == 1, res.output);
+ }
+
+- version (Posix)
++ version (none)
+ {
+ import std.conv : to;
+ auto makeVersion = execute(["make", "--version"]).output.splitLines()[0];
diff --git a/nix-overlays/dtools/fix-ldc-arm64.diff b/nix-overlays/dtools/fix-ldc-arm64.diff
new file mode 100644
index 0000000..66eaa22
--- /dev/null
+++ b/nix-overlays/dtools/fix-ldc-arm64.diff
@@ -0,0 +1,102 @@
+Adapted from https://github.com/dlang/tools/commit/6c6a042d1b08e3ec1790bd07a7f69424625ee866.patch
+--- /dev/null
++++ b/osmodel.mak
+@@ -0,0 +1,75 @@
++# osmodel.mak
++#
++# Detects and sets the macros:
++#
++# OS = one of {osx,linux,freebsd,openbsd,netbsd,dragonflybsd,solaris}
++# MODEL = one of { 32, 64 }
++# MODEL_FLAG = one of { -m32, -m64 }
++# ARCH = one of { x86, x86_64, aarch64 }
++#
++# Note:
++# Keep this file in sync between druntime, phobos, and dmd repositories!
++# Source: https://github.com/dlang/dmd/blob/master/src/osmodel.mak
++
++
++ifeq (,$(OS))
++ uname_S:=$(shell uname -s)
++ ifeq (Darwin,$(uname_S))
++ OS:=osx
++ endif
++ ifeq (Linux,$(uname_S))
++ OS:=linux
++ endif
++ ifeq (FreeBSD,$(uname_S))
++ OS:=freebsd
++ endif
++ ifeq (OpenBSD,$(uname_S))
++ OS:=openbsd
++ endif
++ ifeq (NetBSD,$(uname_S))
++ OS:=netbsd
++ endif
++ ifeq (DragonFly,$(uname_S))
++ OS:=dragonflybsd
++ endif
++ ifeq (Solaris,$(uname_S))
++ OS:=solaris
++ endif
++ ifeq (SunOS,$(uname_S))
++ OS:=solaris
++ endif
++ ifeq (,$(OS))
++ $(error Unrecognized or unsupported OS for uname: $(uname_S))
++ endif
++endif
++
++# When running make from XCode it may set environment var OS=MACOS.
++# Adjust it here:
++ifeq (MACOS,$(OS))
++ OS:=osx
++endif
++
++ifeq (,$(MODEL))
++ ifeq ($(OS), solaris)
++ uname_M:=$(shell isainfo -n)
++ else
++ uname_M:=$(shell uname -m)
++ endif
++ ifneq (,$(findstring $(uname_M),x86_64 amd64))
++ MODEL:=64
++ ARCH:=x86_64
++ endif
++ ifneq (,$(findstring $(uname_M),aarch64 arm64))
++ MODEL:=64
++ ARCH:=aarch64
++ endif
++ ifneq (,$(findstring $(uname_M),i386 i586 i686))
++ MODEL:=32
++ ARCH:=x86
++ endif
++ ifeq (,$(MODEL))
++ $(error Cannot figure 32/64 model and arch from uname -m: $(uname_M))
++ endif
++endif
++
++MODEL_FLAG:=-m$(MODEL)
+--- a/Makefile
++++ b/Makefile
+@@ -9,9 +9,8 @@ DUB=dub
+ WITH_DOC = no
+ DOC = ../dlang.org
+
+-# Load operating system $(OS) (e.g. linux, osx, ...) and $(MODEL) (e.g. 32, 64) detection Makefile from dmd
+-$(shell [ ! -d $(DMD_DIR) ] && git clone --depth=1 https://github.com/dlang/dmd $(DMD_DIR))
+-include $(DMD_DIR)/compiler/src/osmodel.mak
++# Load operating system $(OS) (e.g. linux, osx, ...) and $(MODEL) (e.g. 32, 64) detection Makefile
++include osmodel.mak
+
+ ifeq (windows,$(OS))
+ DOTEXE:=.exe
+@@ -30,7 +29,7 @@ DFLAGS = $(MODEL_FLAG) $(if $(findstring windows,$(OS)),,-fPIC) -preview=dip1000
+ DFLAGS += $(WARNINGS)
+
+ # Default DUB flags (DUB uses a different architecture format)
+-DUBFLAGS = --arch=$(subst 32,x86,$(subst 64,x86_64,$(MODEL)))
++DUBFLAGS = --arch=$(ARCH)
+
+ TOOLS = \
+ $(ROOT)/catdoc$(DOTEXE) \
diff --git a/nix-overlays/dtools/package.nix b/nix-overlays/dtools/package.nix
new file mode 100644
index 0000000..2e72b44
--- /dev/null
+++ b/nix-overlays/dtools/package.nix
@@ -0,0 +1,49 @@
+{
+ lib,
+ stdenv,
+ fetchFromGitHub,
+ ldc,
+ curl,
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+ pname = "dtools";
+ version = "2.110.0";
+
+ src = fetchFromGitHub {
+ owner = "dlang";
+ repo = "tools";
+ rev = "v${finalAttrs.version}";
+ hash = "sha256-xMEHnrstL5hAkhp8+/z1I2KZWZ7eztWZnUGLTKCfbBI=";
+ name = "dtools";
+ };
+
+ patches = [
+ # Disable failing tests
+ ./disabled-tests.diff
+ # Fix LDC arm64 build
+ ./fix-ldc-arm64.diff
+ ];
+
+ nativeBuildInputs = [ ldc ];
+ buildInputs = [ curl ];
+
+ makeFlags = [
+ "CC=${stdenv.cc}/bin/cc"
+ "DMD=${ldc.out}/bin/ldmd2"
+ "INSTALL_DIR=$(out)"
+ ];
+
+ enableParallelBuilding = true;
+
+ doCheck = true;
+ checkTarget = "test_rdmd";
+
+ meta = with lib; {
+ description = "Ancillary tools for the D programming language";
+ homepage = "https://github.com/dlang/tools";
+ license = licenses.boost;
+ maintainers = with maintainers; [ jtbx ];
+ platforms = platforms.unix;
+ };
+})
diff --git a/nix-overlays/dub/package.nix b/nix-overlays/dub/package.nix
index f13adec..4d63f2d 100644
--- a/nix-overlays/dub/package.nix
+++ b/nix-overlays/dub/package.nix
@@ -1,18 +1,19 @@
-{ lib
-, stdenv
-, fetchFromGitHub
-, curl
-, ldc
-, dcompiler ? ldc
-, libevent
-, rsync
+{
+ lib,
+ stdenv,
+ fetchFromGitHub,
+ curl,
+ ldc,
+ dcompiler ? ldc,
+ libevent,
+ rsync,
}:
assert dcompiler != null;
stdenv.mkDerivation (finalAttrs: {
pname = "dub";
- version = "1.38.1";
+ version = "1.40.0";
enableParallelBuilding = true;
@@ -20,7 +21,7 @@ stdenv.mkDerivation (finalAttrs: {
owner = "dlang";
repo = "dub";
rev = "v${finalAttrs.version}";
- hash = "sha256-8Lr/0sx4SKwU1aNOxZArta0RXpDM+EWl29ZsPDdPWFo=";
+ hash = "sha256-OirchEKf66gis70gCSTOYcrHLyHhCsyt/rTEGT83Vcc=";
};
postPatch = ''
@@ -69,6 +70,7 @@ stdenv.mkDerivation (finalAttrs: {
rm -rf test/pr2642-cache-db # added to build v1.34.0
rm -rf test/pr2644-describe-artifact-path # added to build v1.36.0
rm -rf test/pr2647-build-deep # added to build v1.36.0
+ rm -rf test/issue2698-cimportpaths-broken-with-dmd-ldc # added to build v1.40.0
./test/run-unittest.sh
runHook postCheck
diff --git a/nix-overlays/ldc/bootstrap.nix b/nix-overlays/ldc/bootstrap.nix
index d81e5a4..f166568 100644
--- a/nix-overlays/ldc/bootstrap.nix
+++ b/nix-overlays/ldc/bootstrap.nix
@@ -1,16 +1,25 @@
-{ lib, stdenv, fetchurl, curl, tzdata, autoPatchelfHook, fixDarwinDylibNames, libxml2 }:
+{
+ lib,
+ stdenv,
+ fetchurl,
+ curl,
+ tzdata,
+ autoPatchelfHook,
+ fixDarwinDylibNames,
+ libxml2,
+}:
let
inherit (stdenv) hostPlatform;
OS = if hostPlatform.isDarwin then "osx" else hostPlatform.parsed.kernel.name;
ARCH = if hostPlatform.isDarwin && hostPlatform.isAarch64 then "arm64" else hostPlatform.parsed.cpu.name;
- version = "1.25.0";
+ version = "1.41.0";
hashes = {
- # Get these from `nix store prefetch-file https://github.com/ldc-developers/ldc/releases/download/v1.25.0/ldc2-1.25.0-osx-x86_64.tar.xz` etc..
- osx-x86_64 = "sha256-6iKnbS+oalLKmyS8qYD/wS21b7+O+VgsWG2iT4PrWPU=";
- linux-x86_64 = "sha256-sfg47RdlsIpryc3iZvE17OtLweh3Zw6DeuNJYgpuH+o=";
- linux-aarch64 = "sha256-UDZ43x4flSo+SfsPeE8juZO2Wtk2ZzwySk0ADHnvJBI=";
- osx-arm64 = "sha256-O/x0vy0wwQFaDc4uWSeMhx+chJKqbQb6e5QNYf+7DCw=";
+ # Get these from `nix store prefetch-file https://github.com/ldc-developers/ldc/releases/download/v1.41.0/ldc2-1.41.0-osx-x86_64.tar.xz` etc..
+ osx-x86_64 = "sha256-W8/0i2PFakXbqs2wxb3cjqa+htSgx7LHyDGOBH9yEYE=";
+ linux-x86_64 = "sha256-SkOUV/D+WeadAv1rV1Sfw8h60PVa2fueQlB7b44yfI8=";
+ linux-aarch64 = "sha256-HEuVChPVM3ntT1ZDZsJ+xW1iYeIWhogNcMdIaz6Me6g=";
+ osx-arm64 = "sha256-FXJnBC8QsEchBhkxSqcZtPC/iHYB6TscY0qh7LPFRuQ=";
};
in stdenv.mkDerivation {
pname = "ldc-bootstrap";
diff --git a/nix-overlays/ldc/package.nix b/nix-overlays/ldc/package.nix
index c20084c..1767785 100644
--- a/nix-overlays/ldc/package.nix
+++ b/nix-overlays/ldc/package.nix
@@ -1,26 +1,28 @@
-{ lib
-, stdenv
-, fetchFromGitHub
-, cmake
-, ninja
-, llvm_19
-, curl
-, tzdata
-, lit
-, gdb
-, unzip
-, darwin
-, callPackage
-, makeWrapper
-, runCommand
-, writeText
-, targetPackages
-
-, ldcBootstrap ? callPackage ./bootstrap.nix { }
+{
+ lib,
+ stdenv,
+ fetchFromGitHub,
+ fetchpatch,
+ callPackage,
+ makeWrapper,
+ removeReferencesTo,
+ runCommand,
+ writeText,
+ targetPackages,
+ cmake,
+ ninja,
+ llvm_20,
+ curl,
+ tzdata,
+ lit,
+ gdb,
+ unzip,
+
+ ldcBootstrap ? callPackage ./bootstrap.nix { },
}:
let
- pathConfig = runCommand "ldc-lib-paths" {} ''
+ pathConfig = runCommand "ldc-lib-paths" { } ''
mkdir $out
echo ${tzdata}/share/zoneinfo/ > $out/TZDatabaseDirFile
echo ${curl.out}/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} > $out/LibcurlPathFile
@@ -30,13 +32,13 @@ in
stdenv.mkDerivation (finalAttrs: {
pname = "ldc";
- version = "1.40.0";
+ version = "1.41.0";
src = fetchFromGitHub {
owner = "ldc-developers";
repo = "ldc";
rev = "v${finalAttrs.version}";
- hash = "sha256-LT85DlAebecPpBUgZP0ayKTVrTUqN6DMJVEWTatLOxY=";
+ hash = "sha256-6LcpY3LSFK4KgEiGrFp/LONu5Vr+/+vI04wEEpF3s+s=";
fetchSubmodules = true;
};
@@ -62,9 +64,7 @@ stdenv.mkDerivation (finalAttrs: {
'';
nativeBuildInputs = [
- cmake ldcBootstrap lit lit.python llvm_19.dev makeWrapper ninja unzip
- ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
- darwin.apple_sdk.frameworks.Foundation
+ cmake ldcBootstrap lit lit.python llvm_20.dev makeWrapper ninja unzip
] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
# https://github.com/NixOS/nixpkgs/pull/36378#issuecomment-385034818
gdb
@@ -106,8 +106,7 @@ stdenv.mkDerivation (finalAttrs: {
'';
# https://github.com/ldc-developers/ldc/issues/2497#issuecomment-459633746
- additionalExceptions = lib.optionalString stdenv.hostPlatform.isDarwin
- "|druntime-test-shared";
+ additionalExceptions = lib.optionalString stdenv.hostPlatform.isDarwin "|druntime-test-shared";
checkPhase = ''
# Build default lib test runners
@@ -135,6 +134,12 @@ stdenv.mkDerivation (finalAttrs: {
--set-default CC ${targetPackages.stdenv.cc}/bin/cc
'';
+ preFixup = ''
+ find $out/bin -type f -exec ${removeReferencesTo}/bin/remove-references-to -t ${ldcBootstrap} '{}' +
+ '';
+
+ disallowedReferences = [ ldcBootstrap ];
+
meta = with lib; {
description = "LLVM-based D compiler";
homepage = "https://github.com/ldc-developers/ldc";
@@ -147,34 +152,35 @@ stdenv.mkDerivation (finalAttrs: {
};
passthru.ldcBootstrap = ldcBootstrap;
- passthru.tests = let
- ldc = finalAttrs.finalPackage;
- helloWorld = stdenv.mkDerivation (finalAttrs: {
- name = "ldc-hello-world";
- src = writeText "hello_world.d" ''
- module hello_world;
- import std.stdio;
- void main() {
- writeln("Hello, world!");
- }
- '';
- dontUnpack = true;
- buildInputs = [ ldc ];
- dFlags = [];
- buildPhase = ''
- ldc2 ${lib.escapeShellArgs finalAttrs.dFlags} -of=test $src
- '';
- installPhase = ''
- mkdir -p $out/bin
- mv test $out/bin
- '';
- });
- in {
- # Without -shared, built binaries should not contain
- # references to the compiler binaries.
- no-references-to-compiler = helloWorld.overrideAttrs {
- disallowedReferences = [ ldc ];
- dFlags = ["-g"];
+ passthru.tests =
+ let
+ ldc = finalAttrs.finalPackage;
+ helloWorld = stdenv.mkDerivation (finalAttrs: {
+ name = "ldc-hello-world";
+ src = writeText "hello_world.d" ''
+ module hello_world;
+ import std.stdio;
+ void main() {
+ writeln("Hello, world!");
+ }
+ '';
+ dontUnpack = true;
+ buildInputs = [ ldc ];
+ dFlags = [ ];
+ buildPhase = ''
+ ldc2 ${lib.escapeShellArgs finalAttrs.dFlags} -of=test $src
+ '';
+ installPhase = ''
+ mkdir -p $out/bin
+ mv test $out/bin
+ '';
+ });
+ in {
+ # Without -shared, built binaries should not contain
+ # references to the compiler binaries.
+ no-references-to-compiler = helloWorld.overrideAttrs {
+ disallowedReferences = [ ldc ];
+ dFlags = ["-g"];
};
};
})
diff --git a/org/config_env.org b/org/config_env.org
index 6dddf9c..e5f2a43 100644
--- a/org/config_env.org
+++ b/org/config_env.org
@@ -141,7 +141,7 @@ export SpineCGIform='spine_search'
export SpineCGIbin=/var/www/cgi/cgi-bin
#+END_SRC
-* SHARED versions
+* versions GET
** direnv
#+NAME: direnv_version
diff --git a/org/config_nix.org b/org/config_nix.org
index cf5e836..195114a 100644
--- a/org/config_nix.org
+++ b/org/config_nix.org
@@ -653,7 +653,7 @@ github:nixos/nixpkgs
<<./sisudoc_spine_version_info_and_doc_header_including_copyright_and_license.org:sisudoc_dlang_nix_overlay_src()>>
#+END_SRC
-** versions dlang overlays versions
+** dlang overlays
*** ldc
#+NAME: ldc_version
@@ -686,14 +686,14 @@ github:nixos/nixpkgs
<<./nix-develop-dlang-shared.org:dtools-version()>>
#+END_SRC
-** empty sha56 hash
+** sha256 blank hash
-#+NAME: blank_hash
+#+NAME: sha256-blank
#+BEGIN_SRC nix
-sha256-0000000000000000000000000000000000000000000=
+<<./nix-develop-dlang-shared.org:sha256-blank()>>
#+END_SRC
-#+NAME: assumed_hash
+#+NAME: blank_hash
#+BEGIN_SRC nix
-sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
+<<./nix-develop-dlang-shared.org:sha256-blank()>>
#+END_SRC
diff --git a/org/nix-develop-dlang-shared.org b/org/nix-develop-dlang-shared.org
index 5623f63..671fa8d 100644
--- a/org/nix-develop-dlang-shared.org
+++ b/org/nix-develop-dlang-shared.org
@@ -17,20 +17,51 @@
* nix
** direnv
+*** NOTES to update direnv in .envrc-nix
+
+- https://github.com/nix-community/nix-direnv
+
+check for latest version:
+
+- https://github.com/nix-community/nix-direnv/releases
+
+update direnv version and sha hash:
+- emacs org/nix-develop-dlang-shared.org
+
+re-tangle file:
+
+- emacs org/config_env.org
+ updates: .envrc-nix
+
+update flake.lock:
+- nix flake update && nix flake check && nix flake show
+
*** version SET
#+NAME: direnv-version
#+BEGIN_SRC org
-<<direnv_version_3_0_6>>
+<<direnv_version_3_0_7>>
#+END_SRC
#+NAME: direnv-hash
#+BEGIN_SRC org
-<<direnv_hash_3_0_6>>
+<<direnv_hash_3_0_7>>
#+END_SRC
*** versions
+**** 3.0.7
+
+#+NAME: direnv_version_3_0_7
+#+BEGIN_SRC org
+3.0.7
+#+END_SRC
+
+#+NAME: direnv_hash_3_0_7
+#+BEGIN_SRC org
+sha256-bn8WANE5a91RusFmRI7kS751ApelG02nMcwRekC/qzc=
+#+END_SRC
+
**** 3.0.6
#+NAME: direnv_version_3_0_6
@@ -81,6 +112,40 @@ sha256-XQzUAvL6pysIJnRJyR7uVpmUSZfc7LSgWQwq/4mBr1U=
* dlang
** ldc
+*** tags link
+
+- https://github.com/ldc-developers/ldc/tags
+
+*** NOTES to update ldc
+
+check for latest version:
+
+update ldc version and sha hash:
+- emacs ./org/nix-develop-dlang-shared.org
+
+re-tangle files:
+- emacs ./org/nixpkgs_overlays_d_related.org
+ updates: nix-overlays/ldc/package.nix
+- emacs ./org/config_nix.org
+ updates: flake.nix
+- emacs ./org/config_env.org
+ updates: .envrc-nix
+
+update flake.lock:
+- nix flake update && nix flake check && nix flake show
+
+build:
+- nix build ".#spine-overlay-ldc" --print-build-logs
+
+adjust nix overlay if required (to get started):
+- git clone --depth 1 https://github.com/NixOS/nixpkgs
+- find ./nixpkgs/pkgs/ -type d -name "ldc"
+ ./nixpkgs/pkgs/by-name/ld/ldc
+- compare with overlay:
+ ./nix-overlays/ldc
+- overlay is tangled from:
+ emacs ./org/nixpkgs_overlays_d_related.org
+
*** version SET
**** version & sha256 nix composite
@@ -94,24 +159,65 @@ sha256 = "<<ldc-hash>>";
#+NAME: ldc-version
#+BEGIN_SRC org
-<<ldc_version_1_40_0>>
+<<ldc_version_1_41_0>>
#+END_SRC
#+NAME: ldc-hash
#+BEGIN_SRC org
-<<ldc_hash_1_40_0>>
+<<ldc_hash_1_41_0>>
#+END_SRC
#+NAME: ldc-llvm-set
#+BEGIN_SRC org
-<<ldc_llvm_set_1_40_0>>
+<<ldc_llvm_set_1_41_0>>
#+END_SRC
*** versions
+**** 1.41 OK ✓
+***** 1.41.0 OK ✓
+
+ - nix-prefetch-url --unpack https://github.com/ldc-developers/ldc/archive/refs/tags/v1.41.0.tar.gz
+ - nix-prefetch-url --unpack https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz
+
+#+NAME: ldc_version_1_41_0
+#+BEGIN_SRC nix
+1.41.0
+#+END_SRC
+
+#+NAME: ldc_hash_1_41_0
+#+BEGIN_SRC nix
+sha256-6LcpY3LSFK4KgEiGrFp/LONu5Vr+/+vI04wEEpF3s+s=
+#+END_SRC
+
+#+NAME: ldc_llvm_set_1_41_0
+#+BEGIN_SRC nix
+llvm_20
+#+END_SRC
+
**** 1.40 OK ✓
+***** 1.40.1 OK ✓
+
+ - nix-prefetch-url --unpack https://github.com/ldc-developers/ldc/archive/refs/tags/v1.40.1.tar.gz
+ - nix-prefetch-url --unpack https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz
+
+#+NAME: ldc_version_1_40_1
+#+BEGIN_SRC nix
+1.40.1
+#+END_SRC
+
+#+NAME: ldc_hash_1_40_1
+#+BEGIN_SRC nix
+sha256-WdnwdH25A5oMNNY3uWG2hxnaAT+S1hNuP7LElH3uuuk=
+#+END_SRC
+
+#+NAME: ldc_llvm_set_1_40_1
+#+BEGIN_SRC nix
+llvm_19
+#+END_SRC
+
***** 1.40.0 OK ✓
- - nix-prefetch-url --unpack https://github.com/ldc-developers/ldc/archive/refs/tags/v1.40.0-beta6.tar.gz
+ - nix-prefetch-url --unpack https://github.com/ldc-developers/ldc/archive/refs/tags/v1.40.0.tar.gz
- nix-prefetch-url --unpack https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz
#+NAME: ldc_version_1_40_0
@@ -222,24 +328,68 @@ sha256-/bs3bwgkLZF5IqaiKnc5gCF/r6MQBG/F1kWUkK8j2s0=
#+END_SRC
** dmd
+*** tags link
+
+- https://github.com/dlang/dmd/tags
+
*** version SET
#+NAME: dmd-version
#+BEGIN_SRC org
-<<dmd_version_2_109_1>>
+<<dmd_version_2_111_0>>
#+END_SRC
#+NAME: dmd-hash
#+BEGIN_SRC org
-<<dmd_hash_2_109_1>>
+<<dmd_hash_2_111_0>>
#+END_SRC
#+NAME: phobos-hash
#+BEGIN_SRC org
-<<phobos_hash_2_109_1>>
+<<phobos_hash_2_111_0>>
#+END_SRC
*** versions
+**** 2.111.0 OK ✓
+
+- nix-prefetch-url --unpack https://github.com/dlang/dmd/archive/refs/tags/v2.111.0.tar.gz
+- nix-prefetch-url --unpack https://github.com/dlang/phobos/archive/refs/tags/v2.111.0.tar.gz
+
+#+NAME: dmd_version_2_111_0
+#+BEGIN_SRC nix
+2.111.0
+#+END_SRC
+
+#+NAME: phobos_hash_2_111_0
+#+BEGIN_SRC nix
+sha256-9jySZbODoL8sULhYKj/l4+c/uiG5xY2dO240k9XQtPk=
+#+END_SRC
+
+#+NAME: dmd_hash_2_111_0
+#+BEGIN_SRC nix
+sha256-2bjsGa9nTny818dLRV6LKkes+Ycq8W+PFjwhGVrD5TM=
+#+END_SRC
+
+**** 2.110.0 OK ✓
+
+- nix-prefetch-url --unpack https://github.com/dlang/dmd/archive/refs/tags/v2.110.0.tar.gz
+- nix-prefetch-url --unpack https://github.com/dlang/phobos/archive/refs/tags/v2.110.0.tar.gz
+
+#+NAME: dmd_version_2_110_0
+#+BEGIN_SRC nix
+2.110.0
+#+END_SRC
+
+#+NAME: phobos_hash_2_110_0
+#+BEGIN_SRC nix
+sha256-CmJpcHM+sIsaYBlpALCFoQFG+93s8gUyWmM0tYqjXkk=
+#+END_SRC
+
+#+NAME: dmd_hash_2_110_0
+#+BEGIN_SRC nix
+sha256-icXp9xWF2AI2gp7z/lQFAChmXfQePe9b5pbpQ9Mn19Y=
+#+END_SRC
+
**** 2.109.1 OK ✓
- nix-prefetch-url --unpack https://github.com/dlang/dmd/archive/refs/tags/v2.109.1.tar.gz
@@ -356,20 +506,54 @@ sha256-yRL9ub3u4mREG9PVxBvgQ/LDXD57RadPTZ2h08qyh/s=
#+END_SRC
** dub
+*** tags link
+
+- https://github.com/dlang/dub/releases
+
*** version SET
#+NAME: dub-version
#+HEADER: :noweb yes
#+BEGIN_SRC org
-<<dub_version_1_38_1>>
+<<dub_version_1_40_0>>
#+END_SRC
#+NAME: dub-hash
#+BEGIN_SRC org
-<<dub_hash_1_38_1>>
+<<dub_hash_1_40_0>>
#+END_SRC
*** versions
+**** 1.40 OK ✓
+***** 1.40.0
+
+- nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.40.0.tar.gz
+
+#+NAME: dub_version_1_40_0
+#+BEGIN_SRC nix
+1.40.0
+#+END_SRC
+
+#+NAME: dub_hash_1_40_0
+#+BEGIN_SRC nix
+sha256-OirchEKf66gis70gCSTOYcrHLyHhCsyt/rTEGT83Vcc=
+#+END_SRC
+
+**** 1.39 OK ✓
+***** 1.39.0
+
+- nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.39.0.tar.gz
+
+#+NAME: dub_version_1_39_0
+#+BEGIN_SRC nix
+1.39.0
+#+END_SRC
+
+#+NAME: dub_hash_1_39_0
+#+BEGIN_SRC nix
+sha256-73b15A9+hClD6IbuxTy9QZKpTKjUFYBuqGOclUyhrnM=
+#+END_SRC
+
**** 1.38 OK ✓
***** 1.38.1
@@ -482,66 +666,71 @@ sha256-5pW3Fu3PQ1ZLJnsuh7fPpEBNbVQgGfFyiuMrAVOJKQA=
#+NAME: dtools-version
#+BEGIN_SRC org
-<<dtools_version_2_103_1>>
+<<dtools_version_2_110_0>>
#+END_SRC
#+NAME: dtools-hash
#+BEGIN_SRC org
-<<dtools_hash_2_103_1>>
+<<dtools_hash_2_110_0>>
#+END_SRC
*** versions
-**** 2.103.1 OK ✓
+**** 2.110.0 OK ✓
-- https://github.com/dlang/tools/releases/tag/v2.103.1
+- https://github.com/dlang/tools/releases/tag/v2.110.0
-#+NAME: dtools_version_2_103_1
+#+NAME: dtools_version_2_110_0
#+BEGIN_SRC nix
-2.103.1
+2.110.0
#+END_SRC
-#+NAME: dtools_hash_2_103_1
+#+NAME: dtools_hash_2_110_0
#+BEGIN_SRC nix
-sha256-XM4gUxcarQCOBR8W/o0iWAI54PyLDkH6CsDce22Cnu4=
+sha256-xMEHnrstL5hAkhp8+/z1I2KZWZ7eztWZnUGLTKCfbBI=
#+END_SRC
-**** 2.102.2
+**** 2.109.1 OK ✓
-- https://github.com/dlang/tools/releases/tag/v2.102.2
+- https://github.com/dlang/tools/releases/tag/v2.109.1
-#+NAME: dtools_version_2_102_2
+#+NAME: dtools_version_2_109_1
#+BEGIN_SRC nix
-2.102.2
+2.109.1
#+END_SRC
-#+NAME: dtools_hash_2_102_2
+#+NAME: dtools_hash_2_109_1
#+BEGIN_SRC nix
-sha256-XM4gUxcarQCOBR8W/o0iWAI54PyLDkH6CsDce22Cnu4=
+sha256-Pfj8Kwf5AlcrHhLs5A/0vIFWLZaNR3ro+esbs7oWN9I=
#+END_SRC
-**** 2.095.1
+**** 2.104.1 OK ✓
-- https://github.com/dlang/tools/releases/tag/v2.095.1
+- https://github.com/dlang/tools/releases/tag/v2.104.2
-#+NAME: dtools_version_2_095_1
+#+NAME: dtools_version_2_104_2
#+BEGIN_SRC nix
-2.095.1
+2.104.2
#+END_SRC
-#+NAME: dtools_hash_2_095_1
+#+NAME: dtools_hash_2_104_2
#+BEGIN_SRC nix
-sha256:0rdfk3mh3fjrb0h8pr8skwlq6ac9hdl1fkrkdl7n1fa2806b740b
+sha256-Pfj8Kwf5AlcrHhLs5A/0vIFWLZaNR3ro+esbs7oWN9I=
#+END_SRC
** sha256 blank_hash
#+NAME: blank_hash
-#+BEGIN_SRC nix
+#+BEGIN_SRC org
+<<sha256-blank>>
+#+END_SRC
+
+#+NAME: sha256-blank
+#+BEGIN_SRC org
sha256-0000000000000000000000000000000000000000000=
#+END_SRC
#+NAME: assumed_hash
-#+BEGIN_SRC nix
+#+BEGIN_SRC org
sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
#+END_SRC
diff --git a/org/nixpkgs_overlays_d_related.org b/org/nixpkgs_overlays_d_related.org
index a2c8c37..f01c362 100644
--- a/org/nixpkgs_overlays_d_related.org
+++ b/org/nixpkgs_overlays_d_related.org
@@ -264,8 +264,8 @@ fi
#+BEGIN_SRC shell
NIX_ENFORCE_PURITY=1
# - https://github.com/nix-community/nix-direnv
-NixDirEnvVersion="<<direnv-version>>"
-NixDirEnvSHA="<<direnv-sha>>"
+NixDirEnvVersion="<<direnv_version>>"
+NixDirEnvSHA="<<direnv_hash>>"
if ! has nix_direnv_version || ! nix_direnv_version ${NixDirEnvVersion}; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/${NixDirEnvVersion}/direnvrc" "${NixDirEnvSHA}"
fi
@@ -285,59 +285,6 @@ use flake .
#use flake .#default
#+END_SRC
-*** 3.0.6
-
-#+NAME: direnv-version
-#+BEGIN_SRC shell
-3.0.6
-#+END_SRC
-
-#+NAME: direnv-sha
-#+BEGIN_SRC shell
-sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM=
-#+END_SRC
-
-*** 3.0.4
-
-#+BEGIN_SRC shell
-3.0.4
-#+END_SRC
-
-#+BEGIN_SRC shell
-sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4=
-#+END_SRC
-
-*** 3.0.0
-
-#+BEGIN_SRC shell
-3.0.0
-#+END_SRC
-
-#+BEGIN_SRC shell
-sha256-21TMnI2xWX7HkSTjFFri2UaohXVj854mgvWapWrxRXg=
-#+END_SRC
-
-*** 2.4.0
-
-#+BEGIN_SRC shell
-2.4.0
-#+END_SRC
-
-#+BEGIN_SRC shell
-sha256-XQzUAvL6pysIJnRJyR7uVpmUSZfc7LSgWQwq/4mBr1U=
-#+END_SRC
-
-#+NAME: direnv-sha_
-#+BEGIN_SRC shell
-sha256-0000000000000000000000000000000000000000000=
-#+END_SRC
-
-#+BEGIN_SRC shell
-- https://github.com/nix-community/nix-direnv
-NixDirEnvSHA="sha256-0000000000000000000000000000000000000000000="
-direnv fetchurl https://raw.githubusercontent.com/nix-community/nix-direnv/${NixDirEnvVersion}/direnvrc
-#+END_SRC
-
** .nix
*** flake.nix
@@ -397,32 +344,34 @@ direnv fetchurl https://raw.githubusercontent.com/nix-community/nix-direnv/${Nix
inherit shell;
inherit devEnv;
packages = [
- gnumake
ldc
dub
dtools
+ gnumake
];
inherit shellHook;
};
dsh-overlay-ldc-dub = mkShell {
- name = "overlay - ldc-<<ldc_version>> - dub-<<dub_version>>";
+ name = "overlay - ldc-<<ldc_version>> - dub-<<dub_version>> - dtools-<<dtools_version>>";
inherit shell;
inherit devEnv;
packages = [
- gnumake
ldc
dub
+ dtools
+ gnumake
];
inherit shellHook;
};
dsh-overlay-dmd-dub = mkShell {
- name = "overlay - dmd-<<dmd_version>> - dub-<<dub_version>>";
+ name = "overlay - dmd-<<dmd_version>> - dub-<<dub_version>> - dtools-<<dtools_version>>";
inherit shell;
inherit devEnv;
packages = [
- gnumake
dmd
dub
+ dtools
+ gnumake
];
inherit shellHook;
};
@@ -431,11 +380,12 @@ direnv fetchurl https://raw.githubusercontent.com/nix-community/nix-direnv/${Nix
inherit shell;
inherit devEnv;
packages = [
- gnumake
ldc
gtkd
tilix
dub
+ dtools
+ gnumake
];
inherit shellHook;
};
@@ -444,9 +394,10 @@ direnv fetchurl https://raw.githubusercontent.com/nix-community/nix-direnv/${Nix
# inherit shell;
# inherit devEnv;
# packages = [
- # gnumake
# gdc
# dub
+ # dtools
+ # gnumake
# ];
# inherit shellHook;
#};
@@ -457,6 +408,7 @@ direnv fetchurl https://raw.githubusercontent.com/nix-community/nix-direnv/${Nix
packages = with pkgs-nix; [
ldc
dub
+ dtools
gnumake
];
inherit shellHook;
@@ -468,6 +420,7 @@ direnv fetchurl https://raw.githubusercontent.com/nix-community/nix-direnv/${Nix
packages = with pkgs-nix; [
dmd
dub
+ dtools
gnumake
];
inherit shellHook;
@@ -544,45 +497,43 @@ pkgs.callPackage ./shell.nix {}
- version in nixpkgs:
- https://search.nixos.org/packages?channel=unstable&show=ldc&from=0&size=100&sort=relevance&type=packages&query=ldc
-**** notes
-
-- OK ldc 1.32.2 tested
-
-*** overlays
-**** default.nix OK ✓
+*** overlays OK ✓
+**** default.nix
#+HEADER: :tangle "../nix-overlays/ldc/default.nix"
#+BEGIN_SRC nix
import ./package.nix
#+END_SRC
-**** package.nix OK ✓ (unaltered)
+**** package.nix OK ✓
#+HEADER: :tangle "../nix-overlays/ldc/package.nix"
#+BEGIN_SRC nix
-{ lib
-, stdenv
-, fetchFromGitHub
-, cmake
-, ninja
-, <<ldc_llvm_set>>
-, curl
-, tzdata
-, lit
-, gdb
-, unzip
-, darwin
-, callPackage
-, makeWrapper
-, runCommand
-, writeText
-, targetPackages
-
-, ldcBootstrap ? callPackage ./bootstrap.nix { }
+{
+ lib,
+ stdenv,
+ fetchFromGitHub,
+ fetchpatch,
+ callPackage,
+ makeWrapper,
+ removeReferencesTo,
+ runCommand,
+ writeText,
+ targetPackages,
+ cmake,
+ ninja,
+ <<ldc_llvm_set>>,
+ curl,
+ tzdata,
+ lit,
+ gdb,
+ unzip,
+
+ ldcBootstrap ? callPackage ./bootstrap.nix { },
}:
let
- pathConfig = runCommand "ldc-lib-paths" {} ''
+ pathConfig = runCommand "ldc-lib-paths" { } ''
mkdir $out
echo ${tzdata}/share/zoneinfo/ > $out/TZDatabaseDirFile
echo ${curl.out}/lib/libcurl${stdenv.hostPlatform.extensions.sharedLibrary} > $out/LibcurlPathFile
@@ -625,8 +576,6 @@ stdenv.mkDerivation (finalAttrs: {
nativeBuildInputs = [
cmake ldcBootstrap lit lit.python <<ldc_llvm_set>>.dev makeWrapper ninja unzip
- ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
- darwin.apple_sdk.frameworks.Foundation
] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
# https://github.com/NixOS/nixpkgs/pull/36378#issuecomment-385034818
gdb
@@ -668,8 +617,7 @@ stdenv.mkDerivation (finalAttrs: {
'';
# https://github.com/ldc-developers/ldc/issues/2497#issuecomment-459633746
- additionalExceptions = lib.optionalString stdenv.hostPlatform.isDarwin
- "|druntime-test-shared";
+ additionalExceptions = lib.optionalString stdenv.hostPlatform.isDarwin "|druntime-test-shared";
checkPhase = ''
# Build default lib test runners
@@ -697,6 +645,12 @@ stdenv.mkDerivation (finalAttrs: {
--set-default CC ${targetPackages.stdenv.cc}/bin/cc
'';
+ preFixup = ''
+ find $out/bin -type f -exec ${removeReferencesTo}/bin/remove-references-to -t ${ldcBootstrap} '{}' +
+ '';
+
+ disallowedReferences = [ ldcBootstrap ];
+
meta = with lib; {
description = "LLVM-based D compiler";
homepage = "https://github.com/ldc-developers/ldc";
@@ -709,34 +663,35 @@ stdenv.mkDerivation (finalAttrs: {
};
passthru.ldcBootstrap = ldcBootstrap;
- passthru.tests = let
- ldc = finalAttrs.finalPackage;
- helloWorld = stdenv.mkDerivation (finalAttrs: {
- name = "ldc-hello-world";
- src = writeText "hello_world.d" ''
- module hello_world;
- import std.stdio;
- void main() {
- writeln("Hello, world!");
- }
- '';
- dontUnpack = true;
- buildInputs = [ ldc ];
- dFlags = [];
- buildPhase = ''
- ldc2 ${lib.escapeShellArgs finalAttrs.dFlags} -of=test $src
- '';
- installPhase = ''
- mkdir -p $out/bin
- mv test $out/bin
- '';
- });
- in {
- # Without -shared, built binaries should not contain
- # references to the compiler binaries.
- no-references-to-compiler = helloWorld.overrideAttrs {
- disallowedReferences = [ ldc ];
- dFlags = ["-g"];
+ passthru.tests =
+ let
+ ldc = finalAttrs.finalPackage;
+ helloWorld = stdenv.mkDerivation (finalAttrs: {
+ name = "ldc-hello-world";
+ src = writeText "hello_world.d" ''
+ module hello_world;
+ import std.stdio;
+ void main() {
+ writeln("Hello, world!");
+ }
+ '';
+ dontUnpack = true;
+ buildInputs = [ ldc ];
+ dFlags = [ ];
+ buildPhase = ''
+ ldc2 ${lib.escapeShellArgs finalAttrs.dFlags} -of=test $src
+ '';
+ installPhase = ''
+ mkdir -p $out/bin
+ mv test $out/bin
+ '';
+ });
+ in {
+ # Without -shared, built binaries should not contain
+ # references to the compiler binaries.
+ no-references-to-compiler = helloWorld.overrideAttrs {
+ disallowedReferences = [ ldc ];
+ dFlags = ["-g"];
};
};
})
@@ -748,13 +703,22 @@ stdenv.mkDerivation (finalAttrs: {
#+HEADER: :tangle "../nix-overlays/ldc/bootstrap.nix"
#+BEGIN_SRC nix
-{ lib, stdenv, fetchurl, curl, tzdata, autoPatchelfHook, fixDarwinDylibNames, libxml2 }:
+{
+ lib,
+ stdenv,
+ fetchurl,
+ curl,
+ tzdata,
+ autoPatchelfHook,
+ fixDarwinDylibNames,
+ libxml2,
+}:
let
inherit (stdenv) hostPlatform;
OS = if hostPlatform.isDarwin then "osx" else hostPlatform.parsed.kernel.name;
ARCH = if hostPlatform.isDarwin && hostPlatform.isAarch64 then "arm64" else hostPlatform.parsed.cpu.name;
- <<ldc_bootstrap_1-25-0_hashes>>
+ <<ldc_bootstrap_1-41-0_hashes>>
in stdenv.mkDerivation {
pname = "ldc-bootstrap";
inherit version;
@@ -794,17 +758,17 @@ in stdenv.mkDerivation {
#+END_SRC
***** bootstrap.nix version SELECT
-****** bootstrap.nix ldc2-1.25.0
+****** bootstrap.nix ldc2-1.41.0
-#+NAME: ldc_bootstrap_1-25-0_hashes
+#+NAME: ldc_bootstrap_1-41-0_hashes
#+BEGIN_SRC nix
-version = "1.25.0";
+version = "1.41.0";
hashes = {
- # Get these from `nix store prefetch-file https://github.com/ldc-developers/ldc/releases/download/v1.25.0/ldc2-1.25.0-osx-x86_64.tar.xz` etc..
- osx-x86_64 = "sha256-6iKnbS+oalLKmyS8qYD/wS21b7+O+VgsWG2iT4PrWPU=";
- linux-x86_64 = "sha256-sfg47RdlsIpryc3iZvE17OtLweh3Zw6DeuNJYgpuH+o=";
- linux-aarch64 = "sha256-UDZ43x4flSo+SfsPeE8juZO2Wtk2ZzwySk0ADHnvJBI=";
- osx-arm64 = "sha256-O/x0vy0wwQFaDc4uWSeMhx+chJKqbQb6e5QNYf+7DCw=";
+ # Get these from `nix store prefetch-file https://github.com/ldc-developers/ldc/releases/download/v1.41.0/ldc2-1.41.0-osx-x86_64.tar.xz` etc..
+ osx-x86_64 = "sha256-W8/0i2PFakXbqs2wxb3cjqa+htSgx7LHyDGOBH9yEYE=";
+ linux-x86_64 = "sha256-SkOUV/D+WeadAv1rV1Sfw8h60PVa2fueQlB7b44yfI8=";
+ linux-aarch64 = "sha256-HEuVChPVM3ntT1ZDZsJ+xW1iYeIWhogNcMdIaz6Me6g=";
+ osx-arm64 = "sha256-FXJnBC8QsEchBhkxSqcZtPC/iHYB6TscY0qh7LPFRuQ=";
};
#+END_SRC
@@ -822,73 +786,18 @@ hashes = {
};
#+END_SRC
-*** versions SET
-**** selected version SET OK ✓
-***** version & sha256 nix composite
-
-#+NAME: ldc_version_info
-#+BEGIN_SRC nix
-version = "<<ldc_version>>";
-sha256 = "<<ldc_hash>>";
-#+END_SRC
-
-***** select version SET OK ✓
-
-#+NAME: ldc_version
-#+BEGIN_SRC nix
-<<ldc_version_1_40_0>>
-#+END_SRC
-
-#+NAME: ldc_hash
-#+BEGIN_SRC nix
-<<ldc_hash_1_40_0>>
-#+END_SRC
-
-#+NAME: ldc_llvm_set
-#+BEGIN_SRC nix
-<<ldc_llvm_set_1_40_0>>
-#+END_SRC
-
-**** 1.40 OK ✓
-***** 1.40.0 OK ✓
-
- - nix-prefetch-url --unpack https://github.com/ldc-developers/ldc/archive/refs/tags/v1.40.0-beta6.tar.gz
- - nix-prefetch-url --unpack https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz
-
-#+NAME: ldc_version_1_40_0
-#+BEGIN_SRC nix
-1.40.0
-#+END_SRC
-
-#+NAME: ldc_hash_1_40_0
-#+BEGIN_SRC nix
-sha256-LT85DlAebecPpBUgZP0ayKTVrTUqN6DMJVEWTatLOxY=
-#+END_SRC
-
-#+NAME: ldc_llvm_set_1_40_0
-#+BEGIN_SRC nix
-llvm_19
-#+END_SRC
-
-**** 1.39 OK ✓
-***** 1.39.0 OK ✓
-
-- nix-prefetch-url --unpack https://github.com/ldc-developers/ldc/archive/refs/tags/v1.39.0.tar.gz
-- nix-prefetch-url --unpack https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz
-
-#+NAME: ldc_version_1_39_0
-#+BEGIN_SRC nix
-1.39.0
-#+END_SRC
-
-#+NAME: ldc_hash_1_39_0
-#+BEGIN_SRC nix
-sha256-ZiG0ATsY6Asu2nus3Y404fvqIwtKYoHl1JRUDU5A6mo=
-#+END_SRC
+****** bootstrap.nix ldc2-1.25.0
-#+NAME: ldc_llvm_set_1_39_0
+#+NAME: ldc_bootstrap_1-25-0_hashes
#+BEGIN_SRC nix
-llvm_18
+version = "1.25.0";
+hashes = {
+ # Get these from `nix store prefetch-file https://github.com/ldc-developers/ldc/releases/download/v1.25.0/ldc2-1.25.0-osx-x86_64.tar.xz` etc..
+ osx-x86_64 = "sha256-6iKnbS+oalLKmyS8qYD/wS21b7+O+VgsWG2iT4PrWPU=";
+ linux-x86_64 = "sha256-sfg47RdlsIpryc3iZvE17OtLweh3Zw6DeuNJYgpuH+o=";
+ linux-aarch64 = "sha256-UDZ43x4flSo+SfsPeE8juZO2Wtk2ZzwySk0ADHnvJBI=";
+ osx-arm64 = "sha256-O/x0vy0wwQFaDc4uWSeMhx+chJKqbQb6e5QNYf+7DCw=";
+};
#+END_SRC
** dmd OK ✓
@@ -905,18 +814,19 @@ llvm_18
- version in nixpkgs:
- https://search.nixos.org/packages?channel=unstable&show=dmd&from=0&size=100&sort=relevance&type=packages&query=dmd
-**** notes KO ✗
-
-- dmd nixpkg modified and appears to build ok
-
-- ISSUES dmd on nixos FAILS to build (my working projects), appears not to find parts of itself
-
*** overlays
**** default.nix
-***** default.nix >=2.108.0)
#+HEADER: :tangle "../nix-overlays/dmd/default.nix"
#+BEGIN_SRC nix
+import ./package.nix
+#+END_SRC
+
+**** package.nix OK ✓
+***** package.nix >=2.108.0)
+
+#+HEADER: :tangle "../nix-overlays/dmd/package.nix"
+#+BEGIN_SRC nix
import ./generic.nix {
version = "<<dmd_version>>";
dmdHash = "<<dmd_hash>>";
@@ -924,10 +834,9 @@ import ./generic.nix {
}
#+END_SRC
-***** default.nix < 2.108.0)
+***** package.nix < 2.108.0)
-
-#+HEADER: :tangle-NO "../nix-overlays/dmd/default.nix"
+#+HEADER: :tangle-NO "../nix-overlays/dmd/package.nix"
#+BEGIN_SRC nix
import ./generic.nix {
version = "<<dmd_version>>";
@@ -940,31 +849,33 @@ import ./generic.nix {
#+HEADER: :tangle "../nix-overlays/dmd/generic.nix"
#+BEGIN_SRC nix
-{ version
-, dmdHash
-, phobosHash
+{
+ version,
+ dmdHash,
+ phobosHash,
}:
-{ stdenv
-, lib
-, fetchFromGitHub
-, removeReferencesTo
-, makeWrapper
-, which
-, writeTextFile
-, curl
-, tzdata
-, gdb
-#, Foundation
-, callPackage
-, targetPackages
-, fetchpatch
-, bash
-, installShellFiles
-, git
-, unzip
-, dmdBootstrap ? callPackage ./bootstrap.nix { }
-, dmdBin ? "${dmdBootstrap}/bin"
+{
+ stdenv,
+ lib,
+ fetchFromGitHub,
+ removeReferencesTo,
+ makeWrapper,
+ which,
+ writeTextFile,
+ curl,
+ tzdata,
+ gdb,
+ # Foundation,
+ callPackage,
+ targetPackages,
+ fetchpatch,
+ bash,
+ installShellFiles,
+ git,
+ unzip,
+ dmdBootstrap ? callPackage ./bootstrap.nix { },
+ dmdBin ? "${dmdBootstrap}/bin",
}:
let
@@ -978,11 +889,8 @@ let
};
bits = builtins.toString stdenv.hostPlatform.parsed.cpu.bits;
- osname =
- if stdenv.hostPlatform.isDarwin then
- "osx"
- else
- stdenv.hostPlatform.parsed.kernel.name;
+ osname = if stdenv.hostPlatform.isDarwin then "osx"
+ else stdenv.hostPlatform.parsed.kernel.name;
pathToDmd = "\${NIX_BUILD_TOP}/dmd/generated/${osname}/release/${bits}/dmd";
in
@@ -1039,7 +947,9 @@ stdenv.mkDerivation (finalAttrs: {
rm dmd/compiler/test/runnable/gdb4149.d
rm dmd/compiler/test/runnable/gdb4181.d
rm dmd/compiler/test/compilable/ddocYear.d
- rm dmd/compiler/test/fail_compilation/needspkgmod.d
+ rm dmd/compiler/test/compilable/sarif_success_test.d
+ rm dmd/compiler/test/fail_compilation/sarif_test.d
+ rm dmd/compiler/test/fail_compilation/sarifmultiple_test.d
# Disable tests that rely on objdump whitespace until fixed upstream:
# https://issues.dlang.org/show_bug.cgi?id=23317
@@ -1051,9 +961,9 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace dmd/compiler/test/dshell/test6952.d --replace-fail "/usr/bin/env bash" "${bash}/bin/bash"
'' + lib.optionalString stdenv.hostPlatform.isLinux ''
substituteInPlace phobos/std/socket.d --replace-fail "assert(ih.addrList[0] == 0x7F_00_00_01);" ""
- '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
- substituteInPlace phobos/std/socket.d --replace-fail "foreach (name; names)" "names = []; foreach (name; names)"
- '';
+ ''; # + lib.optionalString stdenv.hostPlatform.isDarwin ''
+ # substituteInPlace phobos/std/socket.d --replace-fail "foreach (name; names)" "names = []; foreach (name; names)"
+ #'';
nativeBuildInputs = [
makeWrapper
@@ -1270,189 +1180,6 @@ stdenv.mkDerivation {
}
#+END_SRC
-*** versions SET
-**** selected version SET OK ✓
-
-#+NAME: dmd_version
-#+BEGIN_SRC nix
-<<dmd_version_2_109_1>>
-#+END_SRC
-
-#+NAME: dmd_hash
-#+BEGIN_SRC nix
-<<dmd_hash_2_109_1>>
-#+END_SRC
-
-#+NAME: phobos_hash
-#+BEGIN_SRC nix
-<<phobos_hash_2_109_1>>
-#+END_SRC
-
-**** 2.109.1 OK ✓
-
-- nix-prefetch-url --unpack https://github.com/dlang/dmd/archive/refs/tags/v2.109.1.tar.gz
-- nix-prefetch-url --unpack https://github.com/dlang/phobos/archive/refs/tags/v2.109.1.tar.gz
-
-#+NAME: dmd_version_2_109_1
-#+BEGIN_SRC nix
-2.109.1
-#+END_SRC
-
-#+NAME: phobos_hash_2_109_1
-#+BEGIN_SRC nix
-sha256-73I0k7tCBwe5tl4K6uMs3/nT2JTZ2SppFYzmokS4W5Y=
-#+END_SRC
-
-#+NAME: dmd_hash_2_109_1
-#+BEGIN_SRC nix
-sha256-3nCDPZnb4eQZmhYYxcH6qOmsP8or0KYuzAa5g/C9xdU=
-#+END_SRC
-
-**** 2.109.0 OK ✓
-
-- nix-prefetch-url --unpack https://github.com/dlang/dmd/archive/refs/tags/v2.109.0.tar.gz
-- nix-prefetch-url --unpack https://github.com/dlang/phobos/archive/refs/tags/v2.109.0.tar.gz
-
-#+NAME: dmd_version_2_109_0
-#+BEGIN_SRC nix
-2.109.0
-#+END_SRC
-
-#+NAME: dmd_hash_2_109_0
-#+BEGIN_SRC nix
-sha256-unAZgyZyT6qomlj6pdlOx4h1SKuDjutl1/0FM9AhBWc=
-#+END_SRC
-
-#+NAME: phobos_hash_2_109_0
-#+BEGIN_SRC nix
-sha256-b91FeluFqhmjHd1wwkyq98QzIlwjE646xNj2n6hP3aM=
-#+END_SRC
-
-**** 2.108.0 OK ✓
-
-- nix-prefetch-url --unpack https://github.com/dlang/dmd/archive/refs/tags/v2.108.0.tar.gz
-- nix-prefetch-url --unpack https://github.com/dlang/phobos/archive/refs/tags/v2.108.0.tar.gz
-
-#+NAME: dmd_version_2_108_0
-#+BEGIN_SRC nix
-2.108.0
-#+END_SRC
-
-#+NAME: dmd_hash_2_108_0
-#+BEGIN_SRC nix
-sha256-tlWcFgKtXzfqMMkOq4ezhZHdYCXFckjN5+m6jO4VH0U=
-#+END_SRC
-
-#+NAME: phobos_hash_2_108_0
-#+BEGIN_SRC nix
-sha256-uU8S4rABOfhpKh+MvSbclkbdf0hrsuKF8SIpWMnPpfU=
-#+END_SRC
-
-**** 2.107.0 - skip (asleep here apparently)
-
-- asleep apparently
-
-#+NAME: dmd_version_2_107_0
-#+BEGIN_SRC nix
-2.107.0
-#+END_SRC
-
-#+NAME: dmd_hash_2_107_0
-#+BEGIN_SRC nix
-<<sha256-blank>>
-#+END_SRC
-
-#+NAME: phobos_hash_2_107_0
-#+BEGIN_SRC nix
-<<sha256-blank>>
-#+END_SRC
-
-**** 2.106.1 OK ✓
-
-- nix-prefetch-url --unpack https://github.com/dlang/dmd/archive/refs/tags/v2.106.1.tar.gz
-- nix-prefetch-url --unpack https://github.com/dlang/phobos/archive/refs/tags/v2.106.1.tar.gz
-
-#+NAME: dmd_version_2_106_1
-#+BEGIN_SRC nix
-2.106.1
-#+END_SRC
-
-#+NAME: dmd_hash_2_106_1
-#+BEGIN_SRC nix
-sha256-vjYa/Pxrz7J2htXT+fa+xaeen/Vxne++lELbHTSXBK8=
-#+END_SRC
-
-#+NAME: phobos_hash_2_106_1
-#+BEGIN_SRC nix
-sha256-yRL9ub3u4mREG9PVxBvgQ/LDXD57RadPTZ2h08qyh/s=
-#+END_SRC
-
-**** 2.104.0 KO ✗
-
-- nix-prefetch-url --unpack https://github.com/dlang/dmd/archive/refs/tags/v2.104.0.tar.gz
-- nix-prefetch-url --unpack https://github.com/dlang/phobos/archive/refs/tags/v2.104.0.tar.gz
-
-#+NAME: dmd_version_2_104_0
-#+BEGIN_SRC nix
-2.104.0
-#+END_SRC
-
-#+NAME: dmd_hash_2_104_0
-#+BEGIN_SRC nix
-sha256-yv+uW6cYAId2HK/YSPxsR9Xt0o3LWa97z8KyzjFik6s=
-#+END_SRC
-
-#+NAME: phobos_hash_2_104_0
-#+BEGIN_SRC nix
-sha256-cWp36Gd/lh3gy21bf9z0/RqzlJmf6ypmx72aMeakcec=
-#+END_SRC
-
-**** 2.102.2 KO ✗
-
-- nix-prefetch-url --unpack https://github.com/dlang/dmd/archive/refs/tags/v2.102.2.tar.gz
-- nix-prefetch-url --unpack https://github.com/dlang/phobos/archive/refs/tags/v2.102.2.tar.gz
-
-#+NAME: dmd_version_2_102_2
-#+BEGIN_SRC nix
-2.102.2
-#+END_SRC
-
-#+NAME: dmd_hash_2_102_2
-#+BEGIN_SRC nix
-sha256-der9nb31hJ+K1aJZdzIgs8+eRgVVsH97QnYEnVbKUws=
-#+END_SRC
-
-#+NAME: phobos_hash_2_102_2
-#+BEGIN_SRC nix
-sha256-SracmUm2aY/LDCyDqYuVS39pCbwO8UCL3TSB0CVHpHE=
-#+END_SRC
-
-**** 2.100.2 KO ✗
-
-- nix-prefetch-url --unpack https://github.com/dlang/dmd/archive/refs/tags/v2.100.2.tar.gz
-- nix-prefetch-url --unpack https://github.com/dlang/druntime/archive/refs/tags/v2.100.2.tar.gz
-- nix-prefetch-url --unpack https://github.com/dlang/phobos/archive/refs/tags/v2.100.2.tar.gz
-
-#+NAME: dmd_version_2_100_2
-#+BEGIN_SRC nix
-2.100.2
-#+END_SRC
-
-#+NAME: dmd_hash_2_100_2
-#+BEGIN_SRC nix
-sha256-o4+G3ARXIGObYHtHooYZKr+Al6kHpiwpMIog3i4BlDM=
-#+END_SRC
-
-#+NAME: druntime_hash_2_100_2
-#+BEGIN_SRC nix
-sha256-qXvY1ECN4mPwOGgOE1FWwvxoRvlSww3tGLWgBdhzAKo=
-#+END_SRC
-
-#+NAME: phobos_hash_2_100_2
-#+BEGIN_SRC nix
-sha256-kTHRaAKG7cAGb4IE/NGHWaZ8t7ZceKj03l6E8wLzJzs=
-#+END_SRC
-
** dub OK
*** info
**** links
@@ -1466,37 +1193,27 @@ sha256-kTHRaAKG7cAGb4IE/NGHWaZ8t7ZceKj03l6E8wLzJzs=
- version in nixpkgs:
- https://search.nixos.org/packages?channel=unstable&show=dub&from=0&size=100&sort=relevance&type=packages&query=dub
-**** notes
-
-- OK dub == current OK ✓
-
-- NOTES for dub 1.33.0 >= 1.31.0 KO ✗
- - dub builds test tilix which calls in gtkd
- - ISSUES dub FAILS to build project from local disk that has built without issue
- since dub v1.23.0
- - BROKEN breaks on subproject ends up in nix: Error /homeless-shelter:
- Permission denied
-
-- OK dub == 1.30.0 OK ✓
-
*** overlays
-**** default.nix OK ✓
+**** default.nix
#+HEADER: :tangle "../nix-overlays/dub/default.nix"
#+BEGIN_SRC nix
import ./package.nix
#+END_SRC
+**** package.nix OK ✓
+
#+HEADER: :tangle "../nix-overlays/dub/package.nix"
#+BEGIN_SRC nix
-{ lib
-, stdenv
-, fetchFromGitHub
-, curl
-, <<dcompiler>>
-, dcompiler ? <<dcompiler>>
-, libevent
-, rsync
+{
+ lib,
+ stdenv,
+ fetchFromGitHub,
+ curl,
+ <<dcompiler>>,
+ dcompiler ? <<dcompiler>>,
+ libevent,
+ rsync,
}:
assert dcompiler != null;
@@ -1560,6 +1277,7 @@ stdenv.mkDerivation (finalAttrs: {
rm -rf test/pr2642-cache-db # added to build v1.34.0
rm -rf test/pr2644-describe-artifact-path # added to build v1.36.0
rm -rf test/pr2647-build-deep # added to build v1.36.0
+ rm -rf test/issue2698-cimportpaths-broken-with-dmd-ldc # added to build v1.40.0
./test/run-unittest.sh
runHook postCheck
@@ -1582,7 +1300,7 @@ stdenv.mkDerivation (finalAttrs: {
})
#+END_SRC
-*** dcompiler SET
+*** dcompiler
#+NAME: dcompiler
#+BEGIN_SRC nix
@@ -1593,199 +1311,6 @@ ldc
dmd
#+END_SRC
-*** versions SET
-**** selected version SET
-
-#+NAME: dub_version
-#+BEGIN_SRC nix
-<<dub_version_1_38_1>>
-#+END_SRC
-
-#+NAME: dub_hash
-#+BEGIN_SRC nix
-<<dub_hash_1_38_1>>
-#+END_SRC
-
-**** 1.38 OK ✓
-***** 1.38.1
-
-- nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.38.1.tar.gz
-
-#+NAME: dub_version_1_38_1
-#+BEGIN_SRC nix
-1.38.1
-#+END_SRC
-
-#+NAME: dub_hash_1_38_1
-#+BEGIN_SRC nix
-sha256-8Lr/0sx4SKwU1aNOxZArta0RXpDM+EWl29ZsPDdPWFo=
-#+END_SRC
-
-**** 1.36 OK ✓
-***** 1.36.0
-
-- nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.36.0.tar.gz
-
-#+NAME: dub_version_1_36_0
-#+BEGIN_SRC nix
-1.36.0
-#+END_SRC
-
-#+NAME: dub_hash_1_36_0
-#+BEGIN_SRC nix
-sha256-S8pls9zxbGAQTwqYf4bDT2q7Ow12S8bBsJE5UmsACBs=
-#+END_SRC
-
-**** 1.35 OK ✓
-***** 1.35.0
-
-- nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.35.0.tar.gz
-
-#+NAME: dub_version_1_35_0
-#+BEGIN_SRC nix
-1.35.0
-#+END_SRC
-
-#+NAME: dub_hash_1_35_0
-#+BEGIN_SRC nix
-sha256-hC46XKE6lLLMLGMGl4vDnLDBQy6P/Z7o3ayDJj0Sois=
-#+END_SRC
-
-**** 1.34 OK ✓
-***** 1.34.0
-
-- nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.34.0.tar.gz
-
-#+NAME: dub_version_1_34_0
-#+BEGIN_SRC nix
-1.34.0
-#+END_SRC
-
-#+NAME: dub_hash_1_34_0
-#+BEGIN_SRC nix
-sha256-hC46XKE6lLLMLGMGl4vDnLDBQy6P/Z7o3ayDJj0Sois=
-#+END_SRC
-
-**** 1.33 OK ✓
-***** 1.33.1 OK ✓
-
-- nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.33.1.tar.gz
-
-#+NAME: dub_version_1_33_1
-#+BEGIN_SRC nix
-1.33.1
-#+END_SRC
-
-#+NAME: dub_hash_1_33_1
-#+BEGIN_SRC nix
-sha256-QFgUsO04VRXBDjGI5QQs7u9XrexG7/V34TMgJP1D8yA=
-#+END_SRC
-
-**** 1.33.0 OK ✓
-
-- nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.33.0.tar.gz
-
-#+NAME: dub_version_1_33_0
-#+BEGIN_SRC nix
-1.33.0
-#+END_SRC
-
-#+NAME: dub_hash_1_33_0
-#+BEGIN_SRC nix
-sha256-4Mha7WF6cg3DIccfpvOnheuvgfziv/7wo8iFsPXO4yY=
-#+END_SRC
-
-**** 1.32.1 OK ✓
-
-- nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.32.1.tar.gz
-
-#+NAME: dub_version_1_32_1
-#+BEGIN_SRC nix
-1.32.1
-#+END_SRC
-
-#+NAME: dub_hash_1_32_1
-#+BEGIN_SRC nix
-sha256-5pW3Fu3PQ1ZLJnsuh7fPpEBNbVQgGfFyiuMrAVOJKQA=
-#+END_SRC
-
-- ISSUES from 1.31.0 continuing
-
-**** 1.31.1 OK ✓
-
-- nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.31.1.tar.gz
-
-#+NAME: dub_version_1_31_1
-#+BEGIN_SRC nix
-1.31.1
-#+END_SRC
-
-#+NAME: dub_hash_1_31_1
-#+BEGIN_SRC nix
-sha256-dp64D51ypowXS1+EYKRXh5hpa3rMmiotvKO2FW+i92w=
-#+END_SRC
-
-- ISSUES from 1.31.0 continuing
-
-**** 1.31.0 OK ✓ NOTE
-
-- nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.31.0.tar.gz
-
-behavior change in dub requiring the setting of pwd in buildPhase
-
-#+NAME: dub_version_1_31_0
-#+BEGIN_SRC nix
-1.31.0
-#+END_SRC
-
-#+NAME: dub_hash_1_31_0
-#+BEGIN_SRC nix
-sha256-Ki8HJOfWFM1tF86s7Ng3STgC/uu5acVTP0Dj87M0l54=
-#+END_SRC
-
-- ISSUES from 1.31.0 continuing
-**** 1.30.0 OK ✓
-
-- nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.30.0.tar.gz
-
-#+NAME: dub_version_1_30_0
-#+BEGIN_SRC nix
-1.30.0
-#+END_SRC
-
-#+NAME: dub_hash_1_30_0
-#+BEGIN_SRC nix
-sha256-iVl7bjblvIxvrUX7Phq6h4AIAmZjNVkGYYFA1hhsE7c=
-#+END_SRC
-
-**** 1.29.1
-
-- nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.29.1.tar.gz
-
-#+NAME: dub_version_1_29_1
-#+BEGIN_SRC nix
-1.29.1
-#+END_SRC
-
-#+NAME: dub_hash_1_29_1
-#+BEGIN_SRC nix
-sha256-XDV9p1bDhRL6gX+nizzjoErNJm8NnQK5O8wNnizloss=
-#+END_SRC
-
-**** 1.28.0
-
-- nix-prefetch-url --unpack https://github.com/dlang/dub/archive/refs/tags/v1.28.0.tar.gz
-
-#+NAME: dub_version_1_28_0
-#+BEGIN_SRC nix
-1.28.0
-#+END_SRC
-
-#+NAME: dub_hash_1_28_0
-#+BEGIN_SRC nix
-sha256-GOeaQyu8Y/DxZEAJPdlGH9ie/ZRTqvAw2jjvM3dESbg=
-#+END_SRC
-
** dtools OK ✓
*** info
**** links
@@ -1809,130 +1334,283 @@ sha256-GOeaQyu8Y/DxZEAJPdlGH9ie/ZRTqvAw2jjvM3dESbg=
#+HEADER: :tangle "../nix-overlays/dtools/default.nix"
#+BEGIN_SRC nix
-{ stdenv, lib, fetchFromGitHub, fetchpatch, ldc, curl, gnumake42 }:
+import ./package.nix
+#+END_SRC
+
+**** package.nix
+
+#+HEADER: :tangle "../nix-overlays/dtools/package.nix"
+#+BEGIN_SRC nix
+{
+ lib,
+ stdenv,
+ fetchFromGitHub,
+ ldc,
+ curl,
+}:
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
pname = "dtools";
version = "<<dtools_version>>";
src = fetchFromGitHub {
owner = "dlang";
repo = "tools";
- rev = "v${version}";
- sha256 = "<<dtools_hash>>";
+ rev = "v${finalAttrs.version}";
+ hash = "<<dtools_hash>>";
name = "dtools";
};
patches = [
- (fetchpatch {
- # part of https://github.com/dlang/tools/pull/441
- url = "https://github.com/dlang/tools/commit/6c6a042d1b08e3ec1790bd07a7f69424625ee866.patch"; # Fix LDC arm64 build
- sha256 = "sha256-x6EclTYN1Y5FG57KLhbBK0BZicSYcZoWO7MTVcP4T18=";
- })
+ # Disable failing tests
+ ./disabled-tests.diff
+ # Fix LDC arm64 build
+ ./fix-ldc-arm64.diff
];
- nativeBuildInputs = [ ldc gnumake42 ]; # fails with make 4.4
+ nativeBuildInputs = [ ldc ];
buildInputs = [ curl ];
- makeCmd = ''
- make -f posix.mak all DMD_DIR=dmd DMD=${ldc.out}/bin/ldmd2 CC=${stdenv.cc}/bin/cc
- '';
+ makeFlags = [
+ "CC=${stdenv.cc}/bin/cc"
+ "DMD=${ldc.out}/bin/ldmd2"
+ "INSTALL_DIR=$(out)"
+ ];
- buildPhase = ''
- $makeCmd
- '';
+ enableParallelBuilding = true;
doCheck = true;
-
- checkPhase = ''
- $makeCmd test_rdmd
- '';
-
- installPhase = ''
- $makeCmd INSTALL_DIR=$out install
- '';
+ checkTarget = "test_rdmd";
meta = with lib; {
- description = "Ancillary tools for the D programming language compiler";
+ description = "Ancillary tools for the D programming language";
homepage = "https://github.com/dlang/tools";
- license = lib.licenses.boost;
- maintainers = with maintainers; [ ThomasMader ];
- platforms = lib.platforms.unix;
+ license = licenses.boost;
+ maintainers = with maintainers; [ jtbx ];
+ platforms = platforms.unix;
};
-}
+})
#+END_SRC
-*** versions SET
+#+HEADER: :tangle "../nix-overlays/dtools/disabled-tests.diff"
+#+BEGIN_SRC diff
+--- a/rdmd_test.d
++++ b/rdmd_test.d
+@@ -616,7 +616,7 @@ void runTests(string rdmdApp, string compiler, string model)
+ enforce(res.status == 1, res.output);
+ }
+
+- version (Posix)
++ version (none)
+ {
+ import std.conv : to;
+ auto makeVersion = execute(["make", "--version"]).output.splitLines()[0];
+#+END_SRC
+
+#+HEADER: :tangle "../nix-overlays/dtools/fix-ldc-arm64.diff"
+#+BEGIN_SRC diff
+Adapted from https://github.com/dlang/tools/commit/6c6a042d1b08e3ec1790bd07a7f69424625ee866.patch
+--- /dev/null
++++ b/osmodel.mak
+@@ -0,0 +1,75 @@
++# osmodel.mak
++#
++# Detects and sets the macros:
++#
++# OS = one of {osx,linux,freebsd,openbsd,netbsd,dragonflybsd,solaris}
++# MODEL = one of { 32, 64 }
++# MODEL_FLAG = one of { -m32, -m64 }
++# ARCH = one of { x86, x86_64, aarch64 }
++#
++# Note:
++# Keep this file in sync between druntime, phobos, and dmd repositories!
++# Source: https://github.com/dlang/dmd/blob/master/src/osmodel.mak
++
++
++ifeq (,$(OS))
++ uname_S:=$(shell uname -s)
++ ifeq (Darwin,$(uname_S))
++ OS:=osx
++ endif
++ ifeq (Linux,$(uname_S))
++ OS:=linux
++ endif
++ ifeq (FreeBSD,$(uname_S))
++ OS:=freebsd
++ endif
++ ifeq (OpenBSD,$(uname_S))
++ OS:=openbsd
++ endif
++ ifeq (NetBSD,$(uname_S))
++ OS:=netbsd
++ endif
++ ifeq (DragonFly,$(uname_S))
++ OS:=dragonflybsd
++ endif
++ ifeq (Solaris,$(uname_S))
++ OS:=solaris
++ endif
++ ifeq (SunOS,$(uname_S))
++ OS:=solaris
++ endif
++ ifeq (,$(OS))
++ $(error Unrecognized or unsupported OS for uname: $(uname_S))
++ endif
++endif
++
++# When running make from XCode it may set environment var OS=MACOS.
++# Adjust it here:
++ifeq (MACOS,$(OS))
++ OS:=osx
++endif
++
++ifeq (,$(MODEL))
++ ifeq ($(OS), solaris)
++ uname_M:=$(shell isainfo -n)
++ else
++ uname_M:=$(shell uname -m)
++ endif
++ ifneq (,$(findstring $(uname_M),x86_64 amd64))
++ MODEL:=64
++ ARCH:=x86_64
++ endif
++ ifneq (,$(findstring $(uname_M),aarch64 arm64))
++ MODEL:=64
++ ARCH:=aarch64
++ endif
++ ifneq (,$(findstring $(uname_M),i386 i586 i686))
++ MODEL:=32
++ ARCH:=x86
++ endif
++ ifeq (,$(MODEL))
++ $(error Cannot figure 32/64 model and arch from uname -m: $(uname_M))
++ endif
++endif
++
++MODEL_FLAG:=-m$(MODEL)
+--- a/Makefile
++++ b/Makefile
+@@ -9,9 +9,8 @@ DUB=dub
+ WITH_DOC = no
+ DOC = ../dlang.org
+
+-# Load operating system $(OS) (e.g. linux, osx, ...) and $(MODEL) (e.g. 32, 64) detection Makefile from dmd
+-$(shell [ ! -d $(DMD_DIR) ] && git clone --depth=1 https://github.com/dlang/dmd $(DMD_DIR))
+-include $(DMD_DIR)/compiler/src/osmodel.mak
++# Load operating system $(OS) (e.g. linux, osx, ...) and $(MODEL) (e.g. 32, 64) detection Makefile
++include osmodel.mak
+
+ ifeq (windows,$(OS))
+ DOTEXE:=.exe
+@@ -30,7 +29,7 @@ DFLAGS = $(MODEL_FLAG) $(if $(findstring windows,$(OS)),,-fPIC) -preview=dip1000
+ DFLAGS += $(WARNINGS)
+
+ # Default DUB flags (DUB uses a different architecture format)
+-DUBFLAGS = --arch=$(subst 32,x86,$(subst 64,x86_64,$(MODEL)))
++DUBFLAGS = --arch=$(ARCH)
+
+ TOOLS = \
+ $(ROOT)/catdoc$(DOTEXE) \
+#+END_SRC
+
+** versions GET
+*** direnv
+***** select version
+
+#+NAME: direnv_version
+#+HEADER: :noweb yes
+#+BEGIN_SRC emacs-lisp
+<<./nix-develop-dlang-shared.org:direnv-version()>>
+#+END_SRC
+
+#+NAME: direnv_hash
+#+BEGIN_SRC emacs-lisp
+<<./nix-develop-dlang-shared.org:direnv-hash()>>
+#+END_SRC
+
+*** ldc
+***** version & sha256 nix composite
-- https://github.com/dlang/tools
+#+NAME: ldc_version_info
+#+BEGIN_SRC emacs-lisp
+<<./nix-develop-dlang-shared.org:ldc-version-info()>>
+#+END_SRC
-**** selected version SET OK ✓
+***** selected version
-#+NAME: dtools_version
-#+BEGIN_SRC nix
-<<dtools_version_2_103_1>>
+#+NAME: ldc_version
+#+HEADER: :noweb yes
+#+BEGIN_SRC emacs-lisp
+<<./nix-develop-dlang-shared.org:ldc-version()>>
#+END_SRC
-#+NAME: dtools_hash
-#+BEGIN_SRC nix
-<<dtools_hash_2_103_1>>
+#+NAME: ldc_hash
+#+BEGIN_SRC emacs-lisp
+<<./nix-develop-dlang-shared.org:ldc-hash()>>
#+END_SRC
-**** 2.103.1 OK ✓
+#+NAME: ldc_llvm_set
+#+BEGIN_SRC emacs-lisp
+<<./nix-develop-dlang-shared.org:ldc-llvm-set()>>
+#+END_SRC
-- https://github.com/dlang/tools/releases/tag/v2.103.1
+*** dmd
+**** selected version
-#+NAME: dtools_version_2_103_1
-#+BEGIN_SRC nix
-2.103.1
+#+NAME: dmd_version
+#+HEADER: :noweb yes
+#+BEGIN_SRC emacs-lisp
+<<./nix-develop-dlang-shared.org:dmd-version()>>
#+END_SRC
-#+NAME: dtools_hash_2_103_1
-#+BEGIN_SRC nix
-sha256-XM4gUxcarQCOBR8W/o0iWAI54PyLDkH6CsDce22Cnu4=
+#+NAME: dmd_hash
+#+BEGIN_SRC org
+<<./nix-develop-dlang-shared.org:dmd-hash()>>
#+END_SRC
-**** 2.102.2
+#+NAME: phobos_hash
+#+BEGIN_SRC org
+<<./nix-develop-dlang-shared.org:phobos-hash()>>
+#+END_SRC
-- https://github.com/dlang/tools/releases/tag/v2.102.2
+*** dub
+**** selected version
-#+NAME: dtools_version_2_102_2
-#+BEGIN_SRC nix
-2.102.2
+#+NAME: dub_version
+#+HEADER: :noweb yes
+#+BEGIN_SRC emacs-lisp
+<<./nix-develop-dlang-shared.org:dub-version()>>
#+END_SRC
-#+NAME: dtools_hash_2_102_2
+#+NAME: dub_hash
#+BEGIN_SRC nix
-sha256-XM4gUxcarQCOBR8W/o0iWAI54PyLDkH6CsDce22Cnu4=
+<<./nix-develop-dlang-shared.org:dub-hash()>>
#+END_SRC
-**** 2.095.1 current nixpkgs 20-03-17 OK ✓
+*** dtools
+**** selected version
-- https://github.com/dlang/tools/releases/tag/v2.095.1
-
-#+NAME: dtools_version_2_095_1
-#+BEGIN_SRC nix
-2.095.1
+#+NAME: dtools_version
+#+HEADER: :noweb yes
+#+BEGIN_SRC emacs-lisp
+<<./nix-develop-dlang-shared.org:dtools-version()>>
#+END_SRC
-#+NAME: dtools_hash_2_095_1
-#+BEGIN_SRC nix
-sha256:0rdfk3mh3fjrb0h8pr8skwlq6ac9hdl1fkrkdl7n1fa2806b740b
+#+NAME: dtools_hash
+#+BEGIN_SRC emacs-lisp
+<<./nix-develop-dlang-shared.org:dtools-hash()>>
#+END_SRC
** sha256 blank_hash
#+NAME: sha256-blank
-#+BEGIN_SRC nix
-sha256-0000000000000000000000000000000000000000000=
+#+BEGIN_SRC emacs-lisp
+<<./nix-develop-dlang-shared.org:sha256-blank()>>
#+END_SRC
#+NAME: blank_hash
-#+BEGIN_SRC nix
-sha256-0000000000000000000000000000000000000000000=
+#+BEGIN_SRC emacs-lisp
+<<./nix-develop-dlang-shared.org:sha256-blank()>>
#+END_SRC
-#+NAME: assumed_hash
-#+BEGIN_SRC nix
-sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
-#+END_SRC
+* __END__
diff --git a/src/ext_depends/arsd/cgi.d b/src/ext_depends/arsd/cgi.d
index 0af9f25..d1d2ad1 100644
--- a/src/ext_depends/arsd/cgi.d
+++ b/src/ext_depends/arsd/cgi.d
@@ -2735,7 +2735,7 @@ class Cgi {
}
// closing the last chunk...
- if(nph && rawDataOutput !is null && responseChunked)
+ if(requestMethod != RequestMethod.HEAD && nph && rawDataOutput !is null && responseChunked)
rawDataOutput(cast(const(ubyte)[]) "0\r\n\r\n");
if(flushDelegate)
@@ -3132,7 +3132,7 @@ struct Uri {
string scheme; /// e.g. "http" in "http://example.com/"
string userinfo; /// the username (and possibly a password) in the uri
- string host; /// the domain name
+ string host; /// the domain name. note it may be an ip address or have percent encoding too.
int port; /// port number, if given. Will be zero if a port was not explicitly given
string path; /// e.g. "/folder/file.html" in "http://example.com/folder/file.html"
string query; /// the stuff after the ? in a uri
diff --git a/src/ext_depends/arsd/core.d b/src/ext_depends/arsd/core.d
index 52f71ba..5fec19f 100644
--- a/src/ext_depends/arsd/core.d
+++ b/src/ext_depends/arsd/core.d
@@ -26,6 +26,20 @@
+/
module arsd.core;
+/+
+ Intended to be Supported OSes:
+ * Windows (at least Vista, MAYBE XP)
+ * Linux
+ * FreeBSD 14 (maybe 13 too)
+ * Mac OS
+
+ Eventually also:
+ * ios
+ * OpenBSD
+ * Android
+ * maybe apple watch os?
++/
+
static if(__traits(compiles, () { import core.interpolation; })) {
import core.interpolation;
@@ -42,6 +56,13 @@ static if(__traits(compiles, () { import core.interpolation; })) {
struct InterpolatedExpression(string code) {}
}
+// arsd core is now default but you can opt out for a lil while
+version(no_arsd_core) {
+
+} else {
+ version=use_arsd_core;
+}
+
version(use_arsd_core)
enum use_arsd_core = true;
else
@@ -90,6 +111,16 @@ else
version=OSXCocoa;
version(iOS)
version=OSXCocoa;
+ } else version(DigitalMars) {
+ version(OSX)
+ version=OSXCocoa;
+ version(iOS)
+ version=OSXCocoa;
+ } else version(LDC) {
+ version(OSX)
+ version=OSXCocoa;
+ version(iOS)
+ version=OSXCocoa;
}
version = HasFile;
@@ -127,9 +158,12 @@ import core.time;
version(OSXCocoa) {
version(ArsdNoCocoa)
enum bool UseCocoa = false;
- else
+ else {
+ version=UseCocoa;
enum bool UseCocoa = true;
-}
+ }
+} else
+ enum bool UseCocoa = false;
import core.attribute;
static if(!__traits(hasMember, core.attribute, "mustuse"))
@@ -189,28 +223,32 @@ version(Emscripten) {
// THIS FILE DOESN'T ACTUALLY EXIST, WE NEED TO MAKE IT
import core.sys.openbsd.sys.event;
} else version(OSX) {
- version=Arsd_core_kqueue;
+ version=Arsd_core_dispatch;
import core.sys.darwin.sys.event;
} else version(iOS) {
- version=Arsd_core_kqueue;
+ version=Arsd_core_dispatch;
import core.sys.darwin.sys.event;
}
// FIXME: pragma(linkerDirective, "-framework", "Cocoa") works in ldc
-version(OSXCocoa)
+static if(UseCocoa)
enum CocoaAvailable = true;
else
enum CocoaAvailable = false;
version(D_OpenD) {
- version(OSXCocoa)
+ static if(UseCocoa) {
pragma(linkerDirective, "-framework", "Cocoa");
+ pragma(linkerDirective, "-framework", "QuartzCore");
+ }
} else {
- version(OSXCocoa)
- version(LDC)
+ static if(UseCocoa)
+ version(LDC) {
pragma(linkerDirective, "-framework", "Cocoa");
+ pragma(linkerDirective, "-framework", "QuartzCore");
+ }
}
version(Posix) {
@@ -282,6 +320,55 @@ ref T reinterpretCast(T, V)(return ref V value) @system {
}
/++
+ Determines whether `needle` is a slice of `haystack`.
+
+ History:
+ Added on February 11, 2025.
+ +/
+bool isSliceOf(T1, T2)(scope const(T1)[] needle, scope const(T2)[] haystack) @trusted pure nothrow @nogc {
+ return (
+ needle.ptr >= haystack.ptr
+ && ((needle.ptr + needle.length) <= (haystack.ptr + haystack.length))
+ );
+}
+
+///
+@safe unittest {
+ string s0 = "01234";
+ const(char)[] s1 = s0[1 .. $];
+ const(void)[] s2 = s1.castTo!(const(void)[]);
+ string s3 = s1.idup;
+
+ assert( s0.isSliceOf(s0));
+ assert( s1.isSliceOf(s0));
+ assert( s2.isSliceOf(s0));
+ assert(!s3.isSliceOf(s0));
+
+ assert(!s0.isSliceOf(s1));
+ assert( s1.isSliceOf(s1));
+ assert( s2.isSliceOf(s1));
+ assert(!s3.isSliceOf(s1));
+
+ assert(!s0.isSliceOf(s2));
+ assert( s1.isSliceOf(s2));
+ assert( s2.isSliceOf(s2));
+ assert(!s3.isSliceOf(s2));
+
+ assert(!s0.isSliceOf(s3));
+ assert(!s1.isSliceOf(s3));
+ assert(!s2.isSliceOf(s3));
+ assert( s3.isSliceOf(s3));
+
+ assert(s1.length == 4);
+ assert(s1[0 .. 0].isSliceOf(s1));
+ assert(s1[0 .. 1].isSliceOf(s1));
+ assert(s1[1 .. 2].isSliceOf(s1));
+ assert(s1[1 .. 3].isSliceOf(s1));
+ assert(s1[1 .. $].isSliceOf(s1));
+ assert(s1[$ .. $].isSliceOf(s1));
+}
+
+/++
Does math as a 64 bit number, but saturates at int.min and int.max when converting back to a 32 bit int.
History:
@@ -374,6 +461,46 @@ struct stringz {
}
/+
+/++
+ A runtime tagged union, aka a sumtype.
+
+ History:
+ Added February 15, 2025
++/
+struct Union(T...) {
+ private uint contains_;
+ private union {
+ private T payload;
+ }
+
+ static foreach(index, type; T)
+ @implicit public this(type t) {
+ contains_ = index;
+ payload[index] = t;
+ }
+
+ bool contains(Part)() const {
+ static assert(indexFor!Part != -1);
+ return contains_ == indexFor!Part;
+ }
+
+ inout(Part) get(Part)() inout {
+ if(!contains!Part) {
+ throw new ArsdException!"Dynamic type mismatch"(indexFor!Part, contains_);
+ }
+ return payload[indexFor!Part];
+ }
+
+ private int indexFor(Part)() {
+ foreach(idx, thing; T)
+ static if(is(T == Part))
+ return idx;
+ return -1;
+ }
+}
++/
+
+/+
DateTime
year: 16 bits (-32k to +32k)
month: 4 bits
@@ -917,7 +1044,7 @@ struct LimitedVariant {
auto d = getDouble();
import core.stdc.stdio;
- char[128] buffer;
+ char[64] buffer;
auto count = snprintf(buffer.ptr, buffer.length, "%.17lf", d);
return buffer[0 .. count].idup;
case invalid:
@@ -1261,6 +1388,7 @@ struct CharzBuffer {
buffer[0 .. data.length] = data[];
buffer[data.length] = 0;
+ buffer = buffer[0 .. data.length + 1];
}
}
@@ -1441,19 +1569,31 @@ char[] intToString(long value, char[] buffer, IntToStringArgs args = IntToString
int start = pos;
int digitCount;
+ int groupCount;
do {
auto remainder = value % radix;
value = value / radix;
+ if(groupSize && groupCount == groupSize) {
+ buffer[pos++] = args.separator;
+ groupCount = 0;
+ }
+
buffer[pos++] = cast(char) (remainder < 10 ? (remainder + '0') : (remainder - 10 + args.ten));
+ groupCount++;
digitCount++;
} while(value);
if(digitsPad > 0) {
while(digitCount < digitsPad) {
+ if(groupSize && groupCount == groupSize) {
+ buffer[pos++] = args.separator;
+ groupCount = 0;
+ }
buffer[pos++] = args.padWith;
digitCount++;
+ groupCount++;
}
}
@@ -1504,6 +1644,105 @@ struct IntToStringArgs {
}
}
+struct FloatToStringArgs {
+ private {
+ // whole number component
+ ubyte padTo;
+ char padWith;
+ ubyte groupSize;
+ char separator;
+
+ // for the fractional component
+ ubyte minimumPrecision = 0; // will always show at least this many digits after the decimal (if it is 0 there may be no decimal)
+ ubyte maximumPrecision = 32; // will round to this many after the decimal
+
+ bool useScientificNotation; // if this is true, note the whole number component will always be exactly one digit, so the pad stuff applies to the exponent only and it assumes pad with zero's to two digits
+ }
+
+ FloatToStringArgs withPadding(int padTo, char padWith = '0') {
+ FloatToStringArgs args = this;
+ args.padTo = cast(ubyte) padTo;
+ args.padWith = padWith;
+ return args;
+ }
+
+ FloatToStringArgs withGroupSeparator(int groupSize, char separator = '_') {
+ FloatToStringArgs args = this;
+ args.groupSize = cast(ubyte) groupSize;
+ args.separator = separator;
+ return args;
+ }
+
+ FloatToStringArgs withPrecision(int minDigits, int maxDigits = 0) {
+ FloatToStringArgs args = this;
+ args.minimumPrecision = cast(ubyte) minDigits;
+ if(maxDigits < minDigits)
+ maxDigits = minDigits;
+ args.maximumPrecision = cast(ubyte) maxDigits;
+ return args;
+ }
+
+ FloatToStringArgs withScientificNotation(bool enabled) {
+ FloatToStringArgs args = this;
+ args.useScientificNotation = enabled;
+ return args;
+ }
+}
+
+char[] floatToString(double value, char[] buffer, FloatToStringArgs args = FloatToStringArgs.init) {
+ // actually doing this is pretty painful, so gonna pawn it off on the C lib
+ import core.stdc.stdio;
+ // FIXME: what if there's a locale in place that changes the decimal point?
+ auto ret = snprintf(buffer.ptr, buffer.length, args.useScientificNotation ? "%.*e" : "%.*f", args.maximumPrecision, value);
+ if(!args.useScientificNotation && (args.padTo || args.groupSize)) {
+ char[32] scratch = void;
+ auto idx = buffer[0 .. ret].indexOf(".");
+
+ int digitsOutput = 0;
+ int digitsGrouped = 0;
+ if(idx > 0) {
+ // there is a whole number component
+ int pos = cast(int) scratch.length;
+
+ auto splitPoint = idx;
+
+ while(idx) {
+ if(args.groupSize && digitsGrouped == args.groupSize) {
+ scratch[--pos] = args.separator;
+ digitsGrouped = 0;
+ }
+ scratch[--pos] = buffer[--idx];
+
+ digitsOutput++;
+ digitsGrouped++;
+ }
+
+ if(args.padTo)
+ while(digitsOutput < args.padTo) {
+ if(args.groupSize && digitsGrouped == args.groupSize) {
+ scratch[--pos] = args.separator;
+ digitsGrouped = 0;
+ }
+
+ scratch[--pos] = args.padWith;
+
+ digitsOutput++;
+ digitsGrouped++;
+ }
+
+ char[32] remainingBuffer;
+ remainingBuffer[0 .. ret - splitPoint]= buffer[splitPoint .. ret];
+
+ buffer[0 .. scratch.length - pos] = scratch[pos .. $];
+ buffer[scratch.length - pos .. scratch.length - pos + ret - splitPoint] = remainingBuffer[0 .. ret - splitPoint];
+
+ ret = cast(int) scratch.length - pos + ret - splitPoint;
+ }
+ }
+ // FIXME: if maximum precision....?
+ return buffer[0 .. ret];
+}
+
unittest {
char[32] buffer;
assert(intToString(0, buffer[]) == "0");
@@ -1521,6 +1760,24 @@ unittest {
assert(intToString(0xef1, buffer[], IntToStringArgs().withRadix(16).withPadding(8)) == "00000ef1");
assert(intToString(-0xef1, buffer[], IntToStringArgs().withRadix(16).withPadding(8)) == "-00000ef1");
assert(intToString(-0xef1, buffer[], IntToStringArgs().withRadix(16, 'A').withPadding(8, ' ')) == "- EF1");
+
+ assert(intToString(4000, buffer[], IntToStringArgs().withPadding(4).withGroupSeparator(3, ',')) == "4,000");
+ assert(intToString(400, buffer[], IntToStringArgs().withPadding(4).withGroupSeparator(3, ',')) == "0,400");
+
+ const pi = 3.14159256358979;
+ assert(floatToString(pi, buffer[], FloatToStringArgs().withPrecision(3)) == "3.142");
+ assert(floatToString(pi, buffer[], FloatToStringArgs().withPrecision(2)) == "3.14");
+ assert(floatToString(pi, buffer[], FloatToStringArgs().withPrecision(0)) == "3");
+
+ assert(floatToString(4.0, buffer[], FloatToStringArgs().withPrecision(0)) == "4");
+ assert(floatToString(4.0, buffer[], FloatToStringArgs().withPrecision(3)) == "4.000");
+
+ assert(floatToString(4.0, buffer[], FloatToStringArgs().withPadding(3).withPrecision(3)) == "004.000");
+ assert(floatToString(4.0, buffer[], FloatToStringArgs().withPadding(3).withGroupSeparator(3, ',').withPrecision(3)) == "004.000");
+ assert(floatToString(4.0, buffer[], FloatToStringArgs().withPadding(4).withGroupSeparator(3, ',').withPrecision(3)) == "0,004.000");
+ assert(floatToString(4000.0, buffer[], FloatToStringArgs().withPadding(4).withGroupSeparator(3, ',').withPrecision(3)) == "4,000.000");
+
+ assert(floatToString(pi*10, buffer[], FloatToStringArgs().withPrecision(2).withScientificNotation(true)) == "3.14e+01");
}
/++
@@ -1576,8 +1833,12 @@ inout(char)[] stripRightInternal(return inout(char)[] s) {
Moved from color.d to core.d in March 2023 (dub v11.0).
+/
string toStringInternal(T)(T t) {
- char[32] buffer;
- static if(is(T : string))
+ return writeGuts(null, null, null, false, &makeString, t);
+ /+
+ char[64] buffer;
+ static if(is(typeof(t.toString) : string))
+ return t.toString();
+ else static if(is(T : string))
return t;
else static if(is(T == enum)) {
switch(t) {
@@ -1599,10 +1860,15 @@ string toStringInternal(T)(T t) {
}
ret ~= "]";
return ret;
+ } else static if(is(T : double)) {
+ import core.stdc.stdio;
+ auto ret = snprintf(buffer.ptr, buffer.length, "%f", t);
+ return buffer[0 .. ret].idup;
} else {
static assert(0, T.stringof ~ " makes compile too slow");
// import std.conv; return to!string(t);
}
+ +/
}
/++
@@ -1808,7 +2074,7 @@ unittest {
assert(decodeUriComponent("+", true) == " ");
}
-private auto toDelegate(T)(T t) {
+public auto toDelegate(T)(T t) {
// static assert(is(T == function)); // lol idk how to do what i actually want here
static if(is(T Return == return))
@@ -1819,8 +2085,8 @@ private auto toDelegate(T)(T t) {
}
}
return &((cast(Wrapper*) t).call);
- } else static assert(0, "could not get params");
- else static assert(0, "could not get return value");
+ } else static assert(0, "could not get params; is it already a delegate you can pass directly?");
+ else static assert(0, "could not get return value, if it is a functor maybe try getting a delegate with `&yourobj.opCall` instead of toDelegate(yourobj)");
}
@system unittest {
@@ -2845,13 +3111,16 @@ interface ICoreEventLoop {
1: run before each loop OS wait call
2: run after each loop OS wait call
3: run both before and after each OS wait call
- 4: single shot?
- 8: no-coalesce? (if after was just run, it will skip the before loops unless this flag is set)
+ 4: single shot? NOT IMPLEMENTED
+ 8: no-coalesce? NOT IMPLEMENTED (if after was just run, it will skip the before loops unless this flag is set)
+ FIXME: it should return a handle you can use to unregister it
+/
void addDelegateOnLoopIteration(void delegate() dg, uint timingFlags);
final void addDelegateOnLoopIteration(void function() dg, uint timingFlags) {
+ if(timingFlags == 0)
+ assert(0, "would never run");
addDelegateOnLoopIteration(toDelegate(dg), timingFlags);
}
@@ -2875,6 +3144,8 @@ interface ICoreEventLoop {
version(Arsd_core_epoll) {
impl.unregisterFd(fd);
+ } else version(Arsd_core_dispatch) {
+ throw new NotYetImplementedException();
} else version(Arsd_core_kqueue) {
// intentionally blank - all registrations are one-shot there
// FIXME: actually it might not have gone off yet, in that case we do need to delete the filter
@@ -2904,6 +3175,8 @@ interface ICoreEventLoop {
version(Arsd_core_epoll) {
impl.unregisterFd(fd);
+ } else version(Arsd_core_dispatch) {
+ throw new NotYetImplementedException();
} else version(Arsd_core_kqueue) {
// intentionally blank - all registrations are one-shot there
// FIXME: actually it might not have gone off yet, in that case we do need to delete the filter
@@ -3885,20 +4158,51 @@ else class AsyncFile {
Tip: prefer the callback ones. If settings where async is possible, it will do async, and if not, it will sync.
- NOT IMPLEMENTED
+ NOT FULLY IMPLEMENTED
+/
void writeFile(string filename, const(void)[] contents) {
-
+ // FIXME: stop using the C lib and start error checking
+ import core.stdc.stdio;
+ CharzBuffer fn = filename;
+ auto file = fopen(fn.ptr, "wb");
+ if(file is null)
+ throw new ErrnoApiException("fopen", errno, [SavedArgument("filename", LimitedVariant(filename))]);
+ fwrite(contents.ptr, 1, contents.length, file);
+ fclose(file);
}
/// ditto
-string readTextFile(string filename, string fileEncoding = null) {
- return null;
+const(ubyte[]) readBinaryFile(string filename) {
+ // FIXME: stop using the C lib and check for more errors
+
+ import core.stdc.stdio;
+ CharzBuffer fn = filename;
+ auto file = fopen(fn.ptr, "rb");
+ if(file is null)
+ throw new ErrnoApiException("fopen", errno, [SavedArgument("filename", LimitedVariant(filename))]);
+ ubyte[] buffer = new ubyte[](64 * 1024);
+ ubyte[] contents;
+
+ while(true) {
+ auto ret = fread(buffer.ptr, 1, buffer.length, file);
+ if(ret < buffer.length) {
+ if(contents is null)
+ contents = buffer[0 .. ret];
+ else
+ contents ~= buffer[0 .. ret];
+ break;
+ } else {
+ contents ~= buffer[0 .. ret];
+ }
+ }
+ fclose(file);
+
+ return contents;
}
/// ditto
-const(ubyte[]) readBinaryFile(string filename) {
- return null;
+string readTextFile(string filename, string fileEncoding = null) {
+ return cast(string) readBinaryFile(filename);
}
/+
@@ -4430,7 +4734,8 @@ class Timer {
version(Windows) {} else
static void unregister(arsd.core.ICoreEventLoop.UnregisterToken urt) {
- urt.unregister();
+ if(urt.impl !is null)
+ urt.unregister();
}
@@ -4487,7 +4792,7 @@ class Timer {
CallbackHelper cbh;
} else version(linux) {
int fd = -1;
- } else version(OSXCocoa) {
+ } else static if(UseCocoa) {
} else static assert(0, "timer not supported");
}
@@ -6372,9 +6677,10 @@ private class CoreEventLoopImplementation : ICoreEventLoop {
}
LoopIterationDelegate[] loopIterationDelegates;
- void runLoopIterationDelegates() {
+ void runLoopIterationDelegates(bool isAfter) {
foreach(lid; loopIterationDelegates)
- lid.dg();
+ if((!isAfter && (lid.flags & 1)) || (isAfter && (lid.flags & 2)))
+ lid.dg();
}
}
@@ -6382,12 +6688,98 @@ private class CoreEventLoopImplementation : ICoreEventLoop {
loopIterationDelegates ~= LoopIterationDelegate(dg, timingFlags);
}
+ version(Arsd_core_dispatch) {
+
+ private NSRunLoop ttrl;
+
+ private this() {
+ ttrl = NSRunLoop.currentRunLoop;
+ }
+
+ // FIXME: this lies!! it runs until completion
+ RunOnceResult runOnce(Duration timeout = Duration.max) {
+ scope(exit) eventLoopRound++;
+
+ // FIXME: autorelease pool
+
+ if(false /*isWorker*/) {
+ runLoopIterationDelegates(false);
+
+ // FIXME: timeout is wrong
+ auto retValue = ttrl.runMode(NSDefaultRunLoopMode, beforeDate: NSDate.distantFuture);
+ if(retValue == false)
+ throw new Exception("could not start run loop");
+
+ runLoopIterationDelegates(true);
+
+ // NSApp.run();
+ // exitApplication();
+ //return RunOnceResult(RunOnceResult.Possibilities.GlobalExit);
+ return RunOnceResult(RunOnceResult.Possibilities.CarryOn);
+ } else {
+ // ui thread needs to pump nsapp events...
+ runLoopIterationDelegates(false);
+
+ auto timeoutNs = NSDate.distantFuture; // FIXME timeout here, future means no timeout
+
+ again:
+ NSEvent event = NSApp.nextEventMatchingMask(
+ NSEventMask.NSEventMaskAny,
+ timeoutNs,
+ NSDefaultRunLoopMode,
+ true
+ );
+ if(event !is null) {
+ NSApp.sendEvent(event);
+ timeoutNs = NSDate.distantPast; // only keep going if it won't block; we just want to clear the queue
+ goto again;
+ }
+
+ runLoopIterationDelegates(true);
+ return RunOnceResult(RunOnceResult.Possibilities.CarryOn);
+ }
+ }
+
+ UnregisterToken addCallbackOnFdReadable(int fd, CallbackHelper cb) {
+ auto input_src = dispatch_source_create(DISPATCH_SOURCE_TYPE_READ, fd, 0, dispatch_get_main_queue());
+ // FIXME: can the GC reap this prematurely?
+ auto b = block(() {
+ cb.call();
+ });
+ // FIXME: should prolly free it eventually idk
+ import core.memory;
+ GC.addRoot(b);
+
+ dispatch_source_set_event_handler(input_src, b);
+ // dispatch_source_set_cancel_handler(input_src, ^{ close(my_file); });
+ dispatch_resume(input_src);
+
+ return UnregisterToken(this, fd, cb);
+
+ }
+ RearmToken addCallbackOnFdReadableOneShot(int fd, CallbackHelper cb) {
+ throw new NotYetImplementedException();
+ }
+ RearmToken addCallbackOnFdWritableOneShot(int fd, CallbackHelper cb) {
+ throw new NotYetImplementedException();
+ }
+ private void rearmFd(RearmToken token) {
+ if(token.readable)
+ cast(void) addCallbackOnFdReadableOneShot(token.fd, token.cb);
+ else
+ cast(void) addCallbackOnFdWritableOneShot(token.fd, token.cb);
+ }
+ }
+
version(Arsd_core_kqueue) {
// this thread apc dispatches go as a custom event to the queue
// the other queues go through one byte at a time pipes (barf). freebsd 13 and newest nbsd have eventfd too tho so maybe i can use them but the other kqueue systems don't.
RunOnceResult runOnce(Duration timeout = Duration.max) {
scope(exit) eventLoopRound++;
+
+ runLoopIterationDelegates(false);
+
kevent_t[16] ev;
//timespec tout = timespec(1, 0);
auto nev = kevent(kqueuefd, null, 0, ev.ptr, ev.length, null/*&tout*/);
@@ -6410,7 +6802,7 @@ private class CoreEventLoopImplementation : ICoreEventLoop {
}
}
- runLoopIterationDelegates();
+ runLoopIterationDelegates(true);
return RunOnceResult(RunOnceResult.Possibilities.CarryOn);
}
@@ -6557,6 +6949,9 @@ private class CoreEventLoopImplementation : ICoreEventLoop {
RunOnceResult runOnce(Duration timeout = Duration.max) {
scope(exit) eventLoopRound++;
+
+ runLoopIterationDelegates(false);
+
if(isWorker) {
// this function is only supported on Windows Vista and up, so using this
// means dropping support for XP.
@@ -6607,7 +7002,7 @@ private class CoreEventLoopImplementation : ICoreEventLoop {
}
}
- runLoopIterationDelegates();
+ runLoopIterationDelegates(true);
return RunOnceResult(RunOnceResult.Possibilities.CarryOn);
}
@@ -6893,6 +7288,9 @@ private class CoreEventLoopImplementation : ICoreEventLoop {
RunOnceResult runOnce(Duration timeout = Duration.max) {
scope(exit) eventLoopRound++;
+
+ runLoopIterationDelegates(false);
+
epoll_event[16] events;
auto ret = epoll_wait(epollfd, events.ptr, cast(int) events.length, -1); // FIXME: timeout
if(ret == -1) {
@@ -6916,7 +7314,7 @@ private class CoreEventLoopImplementation : ICoreEventLoop {
}
}
- runLoopIterationDelegates();
+ runLoopIterationDelegates(true);
return RunOnceResult(RunOnceResult.Possibilities.CarryOn);
}
@@ -8196,7 +8594,7 @@ class LoggerOf(T, size_t bufferSize = 16) {
int missedMessages = 0;
long n;
synchronized(logger) {
- while(logger.active && connected && logger.writeBufferPosition < readBufferPosition) {
+ while(logger.active && connected && logger.writeBufferPosition <= readBufferPosition) {
logger.condition.wait();
}
@@ -8210,15 +8608,15 @@ class LoggerOf(T, size_t bufferSize = 16) {
auto startPos = readBufferPosition % bufferSize;
auto endPos = us.writeBufferPosition % bufferSize;
if(endPos > startPos) {
- buffer[0 .. n] = us.ring[startPos .. endPos];
+ buffer[0 .. cast(size_t) n] = us.ring[cast(size_t) startPos .. cast(size_t) endPos];
} else {
auto ourSplit = us.ring.length - startPos;
- buffer[0 .. ourSplit] = us.ring[startPos .. $];
- buffer[ourSplit .. ourSplit + endPos] = us.ring[0 .. endPos];
+ buffer[0 .. cast(size_t) ourSplit] = us.ring[cast(size_t) startPos .. $];
+ buffer[cast(size_t) ourSplit .. cast(size_t) (ourSplit + endPos)] = us.ring[0 .. cast(size_t) endPos];
}
readBufferPosition = us.writeBufferPosition;
}
- foreach(item; buffer[0 .. n]) {
+ foreach(item; buffer[0 .. cast(size_t) n]) {
if(!connected)
break;
dg(item, missedMessages);
@@ -8382,6 +8780,16 @@ shared(LoggerOf!GenericEmbeddableInterpolatedSequence) logger() {
return _commonLogger;
}
+/++
+ Makes note of an exception you catch and otherwise ignore.
+
+ History:
+ Added April 17, 2025
++/
+void logSwallowedException(Exception e) {
+ logger.error(InterpolationHeader(), e.toString(), InterpolationFooter());
+}
+
/+
// using this requires a newish compiler so we just uncomment when necessary
unittest {
@@ -8649,12 +9057,35 @@ private void appendToBuffer(ref char[] buffer, ref int pos, scope const(char)[]
}
private void appendToBuffer(ref char[] buffer, ref int pos, long what) {
- if(buffer.length < pos + 16)
- buffer.length = pos + 16;
+ if(buffer.length < pos + 32)
+ buffer.length = pos + 32;
auto sliced = intToString(what, buffer[pos .. $]);
pos += sliced.length;
}
+private void appendToBuffer(ref char[] buffer, ref int pos, double what) {
+ if(buffer.length < pos + 32)
+ buffer.length = pos + 32;
+ auto sliced = floatToString(what, buffer[pos .. $]);
+ pos += sliced.length;
+}
+
+
+/++
+ You can use `mixin(dumpParams);` to put out a debug print of your current function call w/ params.
++/
+enum string dumpParams = q{
+ {
+ import arsd.core;
+ arsd.core.dumpParamsImpl(__FUNCTION__, __traits(parameters));
+ }
+};
+
+/// Don't call this directly, use `mixin(dumpParams);` instead
+public void dumpParamsImpl(T...)(string func, T args) {
+ writeGuts(func ~ "(", ")\n", ", ", false, &actuallyWriteToStdout, args);
+}
+
/++
A `writeln` that actually works, at least for some basic types.
@@ -8662,16 +9093,52 @@ private void appendToBuffer(ref char[] buffer, ref int pos, long what) {
This always does text. See also WritableStream and WritableTextStream when they are implemented.
+/
-void writeln(bool printInterpolatedCode = false, T...)(T t) {
+void writeln(T...)(T t) {
+ writeGuts(null, "\n", null, false, &actuallyWriteToStdout, t);
+}
+
+///
+void writelnStderr(T...)(T t) {
+ writeGuts(null, "\n", null, false, &actuallyWriteToStderr, t);
+}
+
+/++
+
++/
+package(arsd) string enumNameForValue(T)(T t) {
+ switch(t) {
+ foreach(memberName; __traits(allMembers, T)) {
+ case __traits(getMember, T, memberName):
+ return memberName;
+ }
+ default:
+ return "<unknown>";
+ }
+}
+
+/+
+ Purposes:
+ * debugging
+ * writing
+ * converting single value to string?
++/
+private string writeGuts(T...)(string prefix, string suffix, string argSeparator, bool printInterpolatedCode, string function(scope char[] result) writer, T t) {
char[256] bufferBacking;
char[] buffer = bufferBacking[];
int pos;
- foreach(arg; t) {
+ if(prefix.length)
+ appendToBuffer(buffer, pos, prefix);
+
+ foreach(i, arg; t) {
+ static if(i)
+ if(argSeparator.length)
+ appendToBuffer(buffer, pos, argSeparator);
+
static if(is(typeof(arg) Base == enum)) {
appendToBuffer(buffer, pos, typeof(arg).stringof);
appendToBuffer(buffer, pos, ".");
- appendToBuffer(buffer, pos, toStringInternal(arg));
+ appendToBuffer(buffer, pos, enumNameForValue(arg));
appendToBuffer(buffer, pos, "(");
appendToBuffer(buffer, pos, cast(Base) arg);
appendToBuffer(buffer, pos, ")");
@@ -8682,13 +9149,9 @@ void writeln(bool printInterpolatedCode = false, T...)(T t) {
} else static if(is(typeof(arg) : long)) {
appendToBuffer(buffer, pos, arg);
} else static if(is(typeof(arg) : double)) {
- import core.stdc.stdio;
- char[128] fb;
- auto count = snprintf(fb.ptr, fb.length, "%.4lf", arg);
-
- appendToBuffer(buffer, pos, fb[0 .. count]);
+ appendToBuffer(buffer, pos, arg);
} else static if(is(typeof(arg) == InterpolatedExpression!code, string code)) {
- static if(printInterpolatedCode) {
+ if(printInterpolatedCode) {
appendToBuffer(buffer, pos, code);
appendToBuffer(buffer, pos, " = ");
}
@@ -8718,34 +9181,50 @@ void writeln(bool printInterpolatedCode = false, T...)(T t) {
}
}
- appendToBuffer(buffer, pos, "\n");
+ if(suffix.length)
+ appendToBuffer(buffer, pos, suffix);
- actuallyWriteToStdout(buffer[0 .. pos]);
+ return writer(buffer[0 .. pos]);
}
debug void dump(T...)(T t, string file = __FILE__, size_t line = __LINE__) {
- writeln!true(file, ":", line, ": ", t);
-}
+ string separator;
+ static if(T.length && is(T[0] == InterpolationHeader))
+ separator = null;
+ else
+ separator = "; ";
-private void actuallyWriteToStdout(scope char[] buffer) @trusted {
+ writeGuts(file ~ ":" ~ toStringInternal(line) ~ ": ", "\n", separator, true, &actuallyWriteToStdout, t);
+}
+private string makeString(scope char[] buffer) @safe {
+ return buffer.idup;
+}
+private string actuallyWriteToStdout(scope char[] buffer) @safe {
+ return actuallyWriteToStdHandle(1, buffer);
+}
+private string actuallyWriteToStderr(scope char[] buffer) @safe {
+ return actuallyWriteToStdHandle(2, buffer);
+}
+private string actuallyWriteToStdHandle(int whichOne, scope char[] buffer) @trusted {
version(UseStdioWriteln)
{
import std.stdio;
- writeln(buffer);
+ (whichOne == 1 ? stdout : stderr).writeln(buffer);
}
else version(Windows) {
import core.sys.windows.wincon;
- auto hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
+ auto h = whichOne == 1 ? STD_OUTPUT_HANDLE : STD_ERROR_HANDLE;
+
+ auto hStdOut = GetStdHandle(h);
if(hStdOut == null || hStdOut == INVALID_HANDLE_VALUE) {
AllocConsole();
- hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
+ hStdOut = GetStdHandle(h);
}
if(GetFileType(hStdOut) == FILE_TYPE_CHAR) {
- wchar[256] wbuffer;
- auto toWrite = makeWindowsString(buffer, wbuffer, WindowsStringConversionFlags.convertNewLines);
+ WCharzBuffer toWrite = WCharzBuffer(buffer, WindowsStringConversionFlags.convertNewLines);
DWORD written;
WriteConsoleW(hStdOut, toWrite.ptr, cast(DWORD) toWrite.length, &written, null);
@@ -8755,8 +9234,10 @@ private void actuallyWriteToStdout(scope char[] buffer) @trusted {
}
} else {
import unix = core.sys.posix.unistd;
- unix.write(1, buffer.ptr, buffer.length);
+ unix.write(whichOne, buffer.ptr, buffer.length);
}
+
+ return null;
}
/+
@@ -9153,12 +9634,14 @@ package(arsd) version(Windows) extern(Windows) {
int WSARecvFrom(SOCKET, LPWSABUF, DWORD, LPDWORD, LPDWORD, sockaddr*, LPINT, LPOVERLAPPED, LPOVERLAPPED_COMPLETION_ROUTINE);
}
-package(arsd) version(OSXCocoa) {
+package(arsd) version(UseCocoa) {
/* Copy/paste chunk from Jacob Carlborg { */
// from https://raw.githubusercontent.com/jacob-carlborg/druntime/550edd0a64f0eb2c4f35d3ec3d88e26b40ac779e/src/core/stdc/clang_block.d
// with comments stripped (see docs in the original link), code reformatted, and some names changed to avoid potential conflicts
+// note these should always be passed by pointer!
+
import core.stdc.config;
struct ObjCBlock(R = void, Params...) {
private:
@@ -9177,18 +9660,30 @@ private:
this.isa = isa;
this.flags = flags;
this.invoke = invoke;
- this.dg = dg;
this.descriptor = &.objcblock_descriptor;
+
+ // FIXME: is this needed or not? it could be held by the OS and not be visible to GC i think
+ // import core.memory; GC.addRoot(dg.ptr);
+
+ this.dg = dg;
}
}
-ObjCBlock!(R, Params) block(R, Params...)(R delegate(Params) dg) {
+ObjCBlock!(R, Params) blockOnStack(R, Params...)(R delegate(Params) dg) {
static if (Params.length == 0)
- enum flags = 0x50000000;
+ enum flags = 0x50000000;
else
enum flags = 0x40000000;
return ObjCBlock!(R, Params)(&_NSConcreteStackBlock, flags, &objcblock_invoke!(R, Params), dg);
}
+ObjCBlock!(R, Params)* block(R, Params...)(R delegate(Params) dg) {
+ static if (Params.length == 0)
+ enum flags = 0x50000000;
+ else
+ enum flags = 0x40000000;
+
+ return new ObjCBlock!(R, Params)(&_NSConcreteStackBlock, flags, &objcblock_invoke!(R, Params), dg);
+}
private struct Descriptor {
c_ulong reserved;
@@ -9279,8 +9774,19 @@ If you are not sure if Cocoa thinks your application is multithreaded or not, yo
void getCharacters(wchar* buffer, NSRange range) @selector("getCharacters:range:");
bool getBytes(void* buffer, NSUInteger maxBufferCount, NSUInteger* usedBufferCount, NSStringEncoding encoding, NSStringEncodingConversionOptions options, NSRange range, NSRange* leftover) @selector("getBytes:maxLength:usedLength:encoding:options:range:remainingRange:");
+
+ CGSize sizeWithAttributes(NSDictionary attrs) @selector("sizeWithAttributes:");
+ }
+
+ // FIXME: it is a generic in objc with <KeyType, ObjectType>
+ extern class NSDictionary : NSObject {
+ static NSDictionary dictionaryWithObject(NSObject object, NSid key) @selector("dictionaryWithObject:forKey:");
+ // static NSDictionary initWithObjects(NSArray objects, NSArray forKeys) @selector("initWithObjects:forKeys:");
}
+ alias NSAttributedStringKey = NSString;
+ /* const */extern __gshared NSAttributedStringKey NSFontAttributeName;
+
struct NSRange {
NSUInteger loc;
NSUInteger len;
@@ -9406,7 +9912,42 @@ If you are not sure if Cocoa thinks your application is multithreaded or not, yo
void run() @selector("run");
+ void stop(NSid sender) @selector("stop:");
+
+ void finishLaunching() @selector("finishLaunching");
+
void terminate(void*) @selector("terminate:");
+
+ void sendEvent(NSEvent event) @selector("sendEvent:");
+ NSEvent nextEventMatchingMask(
+ NSEventMask mask,
+ NSDate untilDate,
+ NSRunLoopMode inMode,
+ bool dequeue
+ ) @selector("nextEventMatchingMask:untilDate:inMode:dequeue:");
+ }
+
+ enum NSEventMask : ulong {
+ NSEventMaskAny = ulong.max
+ }
+
+ version(OSX)
+ extern class NSRunLoop : NSObject {
+ static @property NSRunLoop currentRunLoop() @selector("currentRunLoop");
+ static @property NSRunLoop mainRunLoop() @selector("mainRunLoop");
+ bool runMode(NSRunLoopMode mode, NSDate beforeDate) @selector("runMode:beforeDate:");
+ }
+
+ alias NSRunLoopMode = NSString;
+
+ extern __gshared NSRunLoopMode NSDefaultRunLoopMode;
+
+ version(OSX)
+ extern class NSDate : NSObject {
+ static @property NSDate distantFuture() @selector("distantFuture");
+ static @property NSDate distantPast() @selector("distantPast");
+ static @property NSDate now() @selector("now");
+
}
version(OSX)
@@ -9523,6 +10064,7 @@ If you are not sure if Cocoa thinks your application is multithreaded or not, yo
NSRect frame() @selector("frame");
NSRect contentRectForFrameRect(NSRect frameRect) @selector("contentRectForFrameRect:");
+ NSRect frameRectForContentRect(NSRect contentRect) @selector("frameRectForContentRect:");
NSString title() @selector("title");
void title(NSString value) @selector("setTitle:");
@@ -9533,6 +10075,8 @@ If you are not sure if Cocoa thinks your application is multithreaded or not, yo
void delegate_(NSWindowDelegate) @selector("setDelegate:");
void setBackgroundColor(NSColor color) @selector("setBackgroundColor:");
+
+ void setIsVisible(bool b) @selector("setIsVisible:");
}
version(OSX)
@@ -9749,4 +10293,95 @@ If you are not sure if Cocoa thinks your application is multithreaded or not, yo
extern(C) __gshared void* _D4arsd4core6NSView7__ClassZ = null;
extern(C) __gshared void* _D4arsd4core8NSWindow7__ClassZ = null;
}
+
+
+
+ extern(C) { // grand central dispatch bindings
+
+ // /Library/Developer/CommandLineTools/SDKs/MacOSX13.1.sdk/usr/include/dispatch
+ // https://swiftlang.github.io/swift-corelibs-libdispatch/tutorial/
+ // https://man.freebsd.org/cgi/man.cgi?query=dispatch_main&sektion=3&apropos=0&manpath=macOS+14.3.1
+
+ struct dispatch_source_type_s {}
+ private __gshared immutable extern {
+ dispatch_source_type_s _dispatch_source_type_timer;
+ dispatch_source_type_s _dispatch_source_type_proc;
+ dispatch_source_type_s _dispatch_source_type_signal;
+ dispatch_source_type_s _dispatch_source_type_read;
+ dispatch_source_type_s _dispatch_source_type_write;
+ dispatch_source_type_s _dispatch_source_type_vnode;
+ // also memory pressure and some others
+ }
+
+ immutable DISPATCH_SOURCE_TYPE_TIMER = &_dispatch_source_type_timer;
+ immutable DISPATCH_SOURCE_TYPE_PROC = &_dispatch_source_type_proc;
+ immutable DISPATCH_SOURCE_TYPE_SIGNAL = &_dispatch_source_type_signal;
+ immutable DISPATCH_SOURCE_TYPE_READ = &_dispatch_source_type_read;
+ immutable DISPATCH_SOURCE_TYPE_WRITE = &_dispatch_source_type_write;
+ immutable DISPATCH_SOURCE_TYPE_VNODE = &_dispatch_source_type_vnode;
+ // also are some for internal data change things and a couple others
+
+ enum DISPATCH_PROC_EXIT = 0x80000000; // process exited
+ enum DISPATCH_PROC_FORK = 0x40000000; // it forked
+ enum DISPATCH_PROC_EXEC = 0x20000000; // it execed
+ enum DISPATCH_PROC_SIGNAL = 0x08000000; // it received a signal
+
+ enum DISPATCH_VNODE_DELETE = 0x1;
+ enum DISPATCH_VNODE_WRITE = 0x2;
+ enum DISPATCH_VNODE_EXTEND = 0x4;
+ enum DISPATCH_VNODE_ATTRIB = 0x8;
+ enum DISPATCH_VNODE_LINK = 0x10;
+ enum DISPATCH_VNODE_RENAME = 0x20;
+ enum DISPATCH_VNODE_REVOKE = 0x40;
+ enum DISPATCH_VNODE_FUNLOCK = 0x100;
+
+ private struct dispatch_source_s;
+ private struct dispatch_queue_s {}
+
+ alias dispatch_source_type_t = const(dispatch_source_type_s)*;
+
+ alias dispatch_source_t = dispatch_source_s*; // NSObject<OS_dispatch_source>
+ alias dispatch_queue_t = dispatch_queue_s*; // NSObject<OS_dispatch_queue>
+ alias dispatch_object_t = void*; // actually a "transparent union" of the dispatch_source_t, dispatch_queue_t, and others
+ alias dispatch_block_t = ObjCBlock!(void)*;
+ static if(void*.sizeof == 8)
+ alias uintptr_t = ulong;
+ else
+ alias uintptr_t = uint;
+
+ dispatch_source_t dispatch_source_create(dispatch_source_type_t type, uintptr_t handle, c_ulong mask, dispatch_queue_t queue);
+ void dispatch_source_set_event_handler(dispatch_source_t source, dispatch_block_t handler);
+ void dispatch_source_set_cancel_handler(dispatch_source_t source, dispatch_block_t handler);
+ void dispatch_source_cancel(dispatch_source_t source);
+
+ // DISPATCH_DECL_SUBCLASS(dispatch_queue_main, dispatch_queue_serial);
+ // dispatch_queue_t dispatch_get_main_queue();
+
+ extern __gshared dispatch_queue_s _dispatch_main_q;
+
+ extern(D) dispatch_queue_t dispatch_get_main_queue() {
+ return &_dispatch_main_q;
+ }
+
+ // FIXME: what is dispatch_time_t ???
+ // dispatch_time
+ // dispatch_walltime
+
+ // void dispatch_source_set_timer(dispatch_source_t source, dispatch_time_t start, ulong interval, ulong leeway);
+
+ void dispatch_retain(dispatch_object_t object);
+ void dispatch_release(dispatch_object_t object);
+
+ void dispatch_resume(dispatch_object_t object);
+ void dispatch_pause(dispatch_object_t object);
+
+ void* dispatch_get_context(dispatch_object_t object);
+ void dispatch_set_context(dispatch_object_t object, void* context);
+
+ // sends a function to the given queue
+ void dispatch_sync(dispatch_queue_t queue, scope dispatch_block_t block);
+ void dispatch_async(dispatch_queue_t queue, dispatch_block_t block);
+
+ } // grand central dispatch bindings
+
}