Skip to content

Commit 9df6213

Browse files
authored
gdmd: init at 0.1.0-unstable-2024-05-30 (#330572)
2 parents 11ca1c3 + 6257c8d commit 9df6213

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
--- a/dmd-script
2+
+++ b/dmd-script
3+
@@ -72,7 +72,7 @@ my @run_args;
4+
# for the target prefix.
5+
basename($0) =~ m/^(.*-)?g?dmd(-.*)?$/;
6+
my $target_prefix = $1?$1:"";
7+
-my $gdc_dir = abs_path(dirname($0));
8+
+my $gdc_dir = "@gdc_dir@";
9+
my $gdc = File::Spec->catfile( $gdc_dir, $target_prefix . "gdc" . ($2?$2:""));
10+
11+
sub osHasEXE() {

pkgs/by-name/gd/gdmd/package.nix

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
lib,
3+
stdenvNoCC,
4+
fetchFromGitHub,
5+
substituteAll,
6+
gdc,
7+
perl,
8+
}:
9+
stdenvNoCC.mkDerivation {
10+
pname = "gdmd";
11+
version = "0.1.0-unstable-2024-05-30";
12+
13+
src = fetchFromGitHub {
14+
owner = "D-Programming-GDC";
15+
repo = "gdmd";
16+
rev = "dc0ad9f739795f3ce5c69825efcd5d1d586bb013";
17+
hash = "sha256-Sw8ExEPDvGqGKcM9VKnOI6MGgXW0tAu51A90Wi4qrRE=";
18+
};
19+
20+
patches = [
21+
(substituteAll {
22+
src = ./0001-gdc-store-path.diff;
23+
gdc_dir = "${gdc}/bin";
24+
})
25+
];
26+
27+
buildInputs = [
28+
gdc
29+
perl
30+
];
31+
32+
installFlags = [
33+
"DESTDIR=$(out)"
34+
"prefix="
35+
];
36+
37+
preInstall = ''
38+
install -d $out/bin $out/share/man/man1
39+
'';
40+
41+
meta = {
42+
description = "Wrapper for GDC that emulates DMD's command line";
43+
homepage = "https://gdcproject.org";
44+
license = lib.licenses.gpl3Plus;
45+
platforms = lib.platforms.all;
46+
maintainers = with lib.maintainers; [ jtbx ];
47+
mainProgram = "gdmd";
48+
};
49+
}

0 commit comments

Comments
 (0)