Skip to content

Commit

Permalink
gdmd: init at 0.1.0-unstable-2024-05-30
Browse files Browse the repository at this point in the history
Closes #324961
  • Loading branch information
jtbx committed Jul 28, 2024
1 parent 5b50a93 commit 6257c8d
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkgs/by-name/gd/gdmd/0001-gdc-store-path.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- 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 changes: 49 additions & 0 deletions pkgs/by-name/gd/gdmd/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
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";
};
}

0 comments on commit 6257c8d

Please sign in to comment.