[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#654951: gdc-4.6: gdc, gdmd, dmd, and rdmd are missing



Hello:

On 07/01/12 07:37, Matthias Klose wrote:
On 01/07/2012 03:23 AM, Jerome BENOIT wrote:
Package: gdc-4.6
Version: 0.29.1-4.6.2-4
Severity: normal

Hello:

It appears that there is not gdc link to gdc-4.6, and no gdmd link to gdmd-4.6.

just install the gdc package.

Second, rdmd, which is needed to write D script, is really missing while its
d source is distributed withing the source.
dmd is certainly need as cc is needed.

please send a patch for gdc-4.6 to build and install it.

Please find in attachment a patch for `rdmd.d'.
I can build it on my amd64 box.
Unfortunately I am not familiar with Debian package maintenance,
so I cannot go further but I guess that the main part was done.

hth,
Jerome
--- original/rdmd.d	2011-10-04 20:42:20.000000000 +0200
+++ rdmd.d	2012-01-08 02:46:04.000000000 +0100
@@ -47,7 +47,7 @@
 
 bool verbose = false;
 
-import std.c.stdlib, std.file, std.md5, std.process, std.stdio, std.string;
+import std.c.stdlib, std.file, std.md5, std.process, std.conv, std.array, std.stdio, std.string, std.algorithm;
 
 version (Unix)
 {
@@ -67,7 +67,19 @@
     }
     version (Windows)
     {
-        tmpdir = toString(getenv("TEMP"));
+        tmpdir = to!string(getenv("TEMP"));
+    }
+    version (linux)
+    {
+        tmpdir = to!string(getenv("TMPDIR"));
+        if(tmpdir.empty)
+        {
+          tmpdir = to!string(getenv("TMP"));
+          if(tmpdir.empty)
+          {
+            tmpdir = "/tmp";
+          }
+        }
     }
 
     .myname = args[0];
@@ -78,7 +90,7 @@
         if(i == 0)
             continue;
 
-        if(find(arg,".d") >= 0  ||  find(arg,".ds") >= 0)
+        if(arg.endsWith(".d") || arg.endsWith(".ds"))
         {
             havefile = true;
             dfilepath = arg;
@@ -99,13 +111,13 @@
                     const string cs = "--compiler=";
                     if(arg.length > cs.length && arg[0..cs.length] == cs)
                     {
-                        compiler = split(arg,"=")[1];
+                        compiler = std.string.split(arg,"=")[1];
                         skip = true;
                     }
                     const string td = "--tmpdir=";
                     if(arg.length > td.length && arg[0..td.length] == td)
                     {
-                        tmpdir = split(arg,"=")[1];
+                        tmpdir = std.string.split(arg,"=")[1];
                         skip = true;
                     }
                 }
@@ -137,12 +149,12 @@
 
         if(verbose)
         {
-            fwritef(stderr,"running: ");
+            stderr.writef("running: ");
             foreach(string arg; exeargv)
             {
-                fwritef(stderr,arg," ");
+                stderr.writef(arg," ");
             }
-            fwritefln(stderr);
+            stderr.writeln();
         }
 
         // execute
@@ -164,30 +176,40 @@
     return retval;
 }
 
+version (linux)
+{
+  version (X86_64) 
+  {
+    alias std.file.struct_stat64 struct_stat;
+    alias std.file.stat64 stat;
+  }
+  alias std.process.getenv getenv;
+}
+
 string myname;
 string defcmp;
 void error(string errmsg, int errno)
 {
-    fwritefln(stderr,myname,": ",errmsg);
+    stderr.writefln(myname,": ",errmsg);
     exit(errno);
 }
 
 void usage()
 {
-    fwritefln(stderr,"Usage:");
-    fwritefln(stderr,"  ",myname," [D compiler arguments] [",myname," arguments] progfile.d [program arguments]");
-    fwritefln(stderr);
-    fwritefln(stderr,myname," arguments:");
-    fwritefln(stderr,"  --help\t\tThis message");
-    fwritefln(stderr,"  --force\t\tForce re-compilation of source code [default = do not force]");
-    fwritefln(stderr,"  --verbose\t\tShow detailed info of operations [default = do not show]");
-    fwritefln(stderr,"  --compiler=(dmd|gdmd)\tSpecify compiler [default = "~ .defcmp ~"]");
-    fwritefln(stderr,"  --tmpdir=tmp_dir_path\tSpecify directory to store cached program and other temporaries [default = /tmp]");
-    fwritefln(stderr);
-    fwritefln(stderr,"Notes:");
-    fwritefln(stderr,"  dmd or gdmd must be in the current user context $PATH");
-    fwritefln(stderr,"  ",myname," does not support execution of D source code via stdin");
-    fwritefln(stderr,"  ",myname," will only compile and execute files with a '.d' file extension");
+    stderr.writefln("Usage:");
+    stderr.writefln("  ",myname," [D compiler arguments] [",myname," arguments] progfile.d [program arguments]");
+    stderr.writeln();
+    stderr.writefln(myname," arguments:");
+    stderr.writefln("  --help\t\tThis message");
+    stderr.writefln("  --force\t\tForce re-compilation of source code [default = do not force]");
+    stderr.writefln("  --verbose\t\tShow detailed info of operations [default = do not show]");
+    stderr.writefln("  --compiler=(dmd|gdmd)\tSpecify compiler [default = "~ .defcmp ~"]");
+    stderr.writefln("  --tmpdir=tmp_dir_path\tSpecify directory to store cached program and other temporaries [default = /tmp]");
+    stderr.writeln();
+    stderr.writefln("Notes:");
+    stderr.writefln("  dmd or gdmd must be in the current user context $PATH");
+    stderr.writefln("  ",myname," does not support execution of D source code via stdin");
+    stderr.writefln("  ",myname," will only compile and execute files with a '.d' file extension");
     exit(EXIT_SUCCESS);
 }
 
@@ -198,8 +220,8 @@
     struct_stat dfilestat;  // D source code file status info.
     int filrv = stat(toStringz(dfilepath),&dfilestat);
 
-    string[] pathcomps = split(dfilepath,fileSeparator);
-    string exefile = split(pathcomps[$-1],".")[0];
+    string[] pathcomps = std.string.split(dfilepath,fileSeparator);
+    string exefile = std.string.split(pathcomps[$-1],".")[0];
 
     string cmdline = compiler ~ " -quiet";
     foreach(string str; cmpv)
@@ -223,8 +245,8 @@
     version(Windows)
         uid_str = getuid();
     else
-        uid_str = toString(getuid());
-    exepath = tmpdir ~ exefile ~ "-" ~ uid_str ~ "-" ~ toString(dfilestat.st_dev) ~ "-" ~ toString(dfilestat.st_ino) ~ "-" ~ digestToString(digest) ~ exeExtension;
+        uid_str = to!string(getuid());
+    exepath = tmpdir ~ exefile ~ "-" ~ uid_str ~ "-" ~ to!string(dfilestat.st_dev) ~ "-" ~ to!string(dfilestat.st_ino) ~ "-" ~ digestToString(digest) ~ exeExtension;
 
     struct_stat exestat;    // temp. executable status info.
     int exerv = stat(toStringz(exepath),&exestat);
@@ -237,10 +259,10 @@
         cmdline ~= " " ~ dfilepath ~ " -of" ~ exepath ~ " -od" ~ tmpdir;
         if(verbose)
         {
-            fwritefln(stderr,"running: ",cmdline);
+            stderr.writefln("running: ",cmdline);
         }
         retval = std.process.system(cmdline);   // compile ("system" is also in std.c.stdlib)
-        chmod(toStringz(exepath),0700);
+        chmod(toStringz(exepath),std.conv.octal!700);
     }
 
     // remove object file
@@ -256,12 +278,12 @@
     try
     {
         int prgrv;
-        if(find(program,fileSeparator) >= 0)
+        if(canFind(program,fileSeparator))
             prgrv = stat(toStringz(program), &progstat);
         else
         {
             // There's got to be a better way...
-            string[] pathdirs = split(toString(getenv("PATH")),pathSeparator);
+            string[] pathdirs = std.string.split(to!string(getenv("PATH")),pathSeparator);
             foreach(string dir; pathdirs)
             {
                 prgrv = stat(toStringz(dir ~ fileSeparator ~ program), &progstat);
@@ -279,6 +301,7 @@
 
 version (Unix)
 {
+extern(C) int getErrno(); 
 extern(C) char* strerror(int);
 
 int spawnapp(string pathname, string[] argv)
@@ -319,7 +342,7 @@
 
 Lerror:
     retval = getErrno;
-    error("Cannot spawn " ~ pathname ~ "; " ~ toString(strerror(retval)) ~ " [errno " ~ toString(retval) ~ "]", retval);
+    error("Cannot spawn " ~ pathname ~ "; " ~ to!string(strerror(retval)) ~ " [errno " ~ to!string(retval) ~ "]", retval);
     return retval;
 }
 
@@ -367,7 +390,7 @@
     }
     if(verbose)
     {
-      fwritefln(stderr,"stat: ",toString(name)," : ",retval);
+      stderr.writefln("stat: ",toString(name)," : ",retval);
     }
     return retval;
   }

Reply to: