diff configure.d @ 134:89e8b0d92f36

Ported to bob2 !!!
author David Bryant <bagnose@gmail.com>
date Thu, 02 Aug 2012 17:20:52 +0930
parents 9e1a313d8003
children be50d20643a1
line wrap: on
line diff
--- a/configure.d	Thu Aug 02 15:34:17 2012 +0930
+++ b/configure.d	Thu Aug 02 17:20:52 2012 +0930
@@ -1,84 +1,83 @@
-// Configure script, to be run with rdmd.
 //
-// Checks dependencies, sets up a build directory, builds
-// a local copy of the builder into the build directory,
-// and puts assorted scripts into the build directory to
-// facilitate building.
-//
-// If your project depends on installed libraries, you need to
-// add an options file containing command-line options such as:
-//    -L-lgtkd
-// You also need to install the libraries somewhere that the compiler
-// can find them. Two simple options are:
-// * In the dmd installation directory, or
-// * Elsewhere, and edit dmd.conf to point to there.
-// 
-// 
-// The source paths you depend on need to be listed in a uses file.
-// Uses files are not transitive - only the one in the directory
-// you execute the configure script applies.
-//
-// Usage:  rdmd configure.d <target-path>
-//
-// eg: rdmd configure.d ~/builds/myproject
+// Configure script for the reuse repo
 //
 
+import configure_functions;
 
-import std.stdio;
-import std.path;
+import std.process;
+import std.string;
 import std.file;
-import std.string;
-import std.stdio;
-import std.process;
+
+
+void main(string args[]) {
+    auto data = initialise(args, "doodle");
+
+    //
+    // open
+    //
+
+    // libssh2 and dependencies required by net
+    usePackage(data, "libssh2", Constraint.AtLeast, "1.2");
+    useHeader( data, "gcrypt.h");
+    useLibrary(data, "libgcrypt.so");
+    
+    // TAO is required by corba-tao
+    //useTao(data);
 
 
-int main(string[] args) {
+    //
+    // reuse
+    //
 
-    string sourcePath = getcwd;
+    usePackage(data, "libxml-2.0");
+    usePackage(data, "libpng");
+    usePackage(data, "freetype2");
+    usePackage(data, "gtkmm-2.4", Constraint.AtLeast, "2.18");
+    usePackage(data, "gtkglext-1.0");
+    usePackage(data, "gstreamer-0.10", Constraint.AtLeast, "0.10.22");
+    usePackage(data, "gstreamermm-0.10", Constraint.AtLeast, "0.10.1");
+    usePackage(data, "xv");
+    usePackage(data, "xext");
+    usePackage(data, "xextproto");
+    usePackage(data, "neon", Constraint.AtLeast, "0.28.2");
+    usePackage(data, "libconfig", Constraint.AtLeast, "1.3.1");
+    usePackage(data, "libconfig++", Constraint.AtLeast, "1.3.1");
+
+    useHeader( data, "jpeglib.h");
+    useLibrary(data, "libjpeg.so");
+
+    useExecutable(data, "IMAGE_MAGICK_CONVERT", ["convert"]);
+    useExecutable(data, "ZIP", ["zip"]);
 
-    // parse command-line options
-    if (args.length < 2) {
-        writefln("Error - usage is: rdmd <configure.d-path> <build-path>");
-        return -1;
-    }
-    string targetPath = args[1];
+    appendBobVar(data, "CCFLAGS",
+                 ["-DGTKMM_MACRO_SHADOW_ERROR",
+                 "-DGTKMM_DISABLE_DEPRECATED",
+                 "-DGDKMM_DISABLE_DEPRECATED",
+                 "-DGLIBMM_DISABLE_DEPRECATED",
+                 "-DGDK_DISABLE_DEPRECATED",
+                 "-DG_DISABLE_DEPRECATED",
+                 "-DLIBSIGC_DISABLE_DEPRECATED",
+                 "-DGTK_DISABLE_DEPRECATED",
+                 "-DGSEAL_ENABLE"]);
 
-    // check that source_path looks like a source tree by making sure
-    // that a README and options file are present
-    writefln("Examining source");
-    if (!buildPath(sourcePath, "README").exists || !buildPath(sourcePath, "options").exists) {
-        writefln("Error - current directory must contain README and options");
-        return -1;
+    if (exists("/opt/acacia/ecw")) {
+        string[][Use] dirs;
+        dirs[Use.Inc] = ["/opt/acacia/ecw/include"];
+        dirs[Use.Lib] = ["/opt/acacia/ecw/lib"];
+        setProjectDirs(data, dirs);
+
+        useHeader( data, "NCSFile.h");
+        useLibrary(data, "libNCSUtil.so");
+        useLibrary(data, "libNCSCnet.so");
+        useLibrary(data, "libNCSEcw.so");
+
+        appendBobVar(data, "CCFLAGS",       ["-DUSE_ECW_CHARTING_RASTER_SOURCE"]);
+        appendBobVar(data, "ECW_LIBRARIES", ["NCSEcw", "NCSUtil", "NCSCnet"]);
     }
 
-    // ensure that target_path exists
-    writefln("Establishing build directory");
-    if (targetPath.exists) {
-        writefln("Error - %s exists - abandoning configure", targetPath);
-        return -1;
-    }
-    targetPath.mkdirRecurse;
-    string binPath = buildPath(targetPath, "bin");
-    binPath.mkdir;
 
-    // compile builder into bin_path
-    writefln("Building the builder");
-    int ret = system(format("dmd -m64 -w -wi %s -O -of%s",
-                            buildPath(sourcePath, "builder.d"), buildPath(binPath, "builder")));
-    if (ret) {
-        writefln("Error - builder failed to compile");
-        return -1;
-    }
-    buildPath(binPath, "builder.o").remove;
-
-    // set up scripts
-    {
-        auto file = File(buildPath(targetPath, "build"), "w");
-        file.writefln("#!/bin/bash");
-        file.writefln("%s %s %s", buildPath(binPath, "builder"), sourcePath, targetPath);
-    }
-    system("chmod +x " ~ buildPath(targetPath, "build"));
-    writefln("All done");
-
-    return 0;
+   appendRunVar(data, "GST_PLUGIN_PATH", ["${DIST_PATH}/lib/plugins"]);
+   
+   
+   finalise(data, [/*"open"*/]);
 }