From bc2c4e51320599fb18d457c7e0e1b5d10223f666 Mon Sep 17 00:00:00 2001
From: Ralph Amissah <ralph.amissah@gmail.com>
Date: Sat, 22 Mar 2025 13:44:51 -0400
Subject: overlays at ldc-1.40.1, dub-1.39.0, dtools-2.110.0

- following nixpkgs pretty much
  - ldc-1.40.1 (based on D 2.110.0)
  - dub-1.39.0
  - dtools-2.110.0 (overlay changes)
---
 nix-overlays/ldc/bootstrap.nix |  11 ++++-
 nix-overlays/ldc/package.nix   | 105 +++++++++++++++++++++--------------------
 2 files changed, 63 insertions(+), 53 deletions(-)

(limited to 'nix-overlays/ldc')

diff --git a/nix-overlays/ldc/bootstrap.nix b/nix-overlays/ldc/bootstrap.nix
index d81e5a4..8f76b5b 100644
--- a/nix-overlays/ldc/bootstrap.nix
+++ b/nix-overlays/ldc/bootstrap.nix
@@ -1,4 +1,13 @@
-{ lib, stdenv, fetchurl, curl, tzdata, autoPatchelfHook, fixDarwinDylibNames, libxml2 }:
+{
+  lib,
+  stdenv,
+  fetchurl,
+  curl,
+  tzdata,
+  autoPatchelfHook,
+  fixDarwinDylibNames,
+  libxml2,
+}:
 
 let
   inherit (stdenv) hostPlatform;
diff --git a/nix-overlays/ldc/package.nix b/nix-overlays/ldc/package.nix
index c20084c..39b510a 100644
--- a/nix-overlays/ldc/package.nix
+++ b/nix-overlays/ldc/package.nix
@@ -1,26 +1,27 @@
-{ 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,
+  cmake,
+  ninja,
+  llvm_19,
+  curl,
+  tzdata,
+  lit,
+  gdb,
+  unzip,
+  darwin,
+  callPackage,
+  makeWrapper,
+  runCommand,
+  writeText,
+  targetPackages,
+
+  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 +31,13 @@ in
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "ldc";
-  version = "1.40.0";
+  version = "1.40.1";
 
   src = fetchFromGitHub {
     owner = "ldc-developers";
     repo = "ldc";
     rev = "v${finalAttrs.version}";
-    hash = "sha256-LT85DlAebecPpBUgZP0ayKTVrTUqN6DMJVEWTatLOxY=";
+    hash = "sha256-WdnwdH25A5oMNNY3uWG2hxnaAT+S1hNuP7LElH3uuuk=";
     fetchSubmodules = true;
   };
 
@@ -106,8 +107,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
@@ -147,34 +147,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"];
     };
   };
 })
-- 
cgit v1.2.3