Commit 6257c8d2 authored by Jeremy Baxter's avatar Jeremy Baxter
Browse files

gdmd: init at 0.1.0-unstable-2024-05-30

Closes #324961
parent 5b50a938
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
--- a/dmd-script
+++ b/dmd-script
@@ -72,7 +72,7 @@ my @run_args;
 # for the target prefix.
 basename($0) =~ m/^(.*-)?g?dmd(-.*)?$/;
 my $target_prefix = $1?$1:"";
-my $gdc_dir = abs_path(dirname($0));
+my $gdc_dir = "@gdc_dir@";
 my $gdc = File::Spec->catfile( $gdc_dir, $target_prefix . "gdc" . ($2?$2:""));
 
 sub osHasEXE() {
+49 −0
Original line number Diff line number Diff line
{
  lib,
  stdenvNoCC,
  fetchFromGitHub,
  substituteAll,
  gdc,
  perl,
}:
stdenvNoCC.mkDerivation {
  pname = "gdmd";
  version = "0.1.0-unstable-2024-05-30";

  src = fetchFromGitHub {
    owner = "D-Programming-GDC";
    repo = "gdmd";
    rev = "dc0ad9f739795f3ce5c69825efcd5d1d586bb013";
    hash = "sha256-Sw8ExEPDvGqGKcM9VKnOI6MGgXW0tAu51A90Wi4qrRE=";
  };

  patches = [
    (substituteAll {
      src = ./0001-gdc-store-path.diff;
      gdc_dir = "${gdc}/bin";
    })
  ];

  buildInputs = [
    gdc
    perl
  ];

  installFlags = [
    "DESTDIR=$(out)"
    "prefix="
  ];

  preInstall = ''
    install -d $out/bin $out/share/man/man1
  '';

  meta = {
    description = "Wrapper for GDC that emulates DMD's command line";
    homepage = "https://gdcproject.org";
    license = lib.licenses.gpl3Plus;
    platforms = lib.platforms.all;
    maintainers = with lib.maintainers; [ jtbx ];
    mainProgram = "gdmd";
  };
}