On Wednesday, 27 August 2014 at 05:40:51 UTC, eles wrote:
On Wednesday, 27 August 2014 at 01:40:41 UTC, Nick Sabalausky wrote:
All it would do is provide many tempting and creative ways to accidentally obfuscate the package description file.

I agree partially with this, this is why I am not pushing for D. A declarative language seems to be more appropriate in this case.

Ideally we wouldn't even need that, but reality is rarely so kind. I suppose if we can't be sufficiently Perl-like, maybe Portage-like is the next best thing. :/

Thought dump:
The DUB package specification is versioned, right? So, in the vein of the Package Manager Specification, for a given...let's call it "DUBAPI version"... provide higher-level functions that abstract away things that are common or things that are tricky to get right if you try to always do them manually. Package them in modules that can be imported and use the DUBAPI version within the module to select version-specific behaviour. For those of stern fortitude, an ugly ebuild-like thing; a...uhm, "dubuild":

DUBAPI=1;
import dub.autotools;
import dub.git;
import dub.utils : patch;

DESCRIPTION = "Plugin providing semi-solids for bread";
HOMEPAGE = "http://toa.st/spread";;
LICENSE = "zlib";
PHOBOS_VERSION = "<=2.065"; // TODO: fix the failure
GIT_REPO_URI = "http://github.com/toast/spread";;
GIT_BRANCH = "butter"; // Vars defined in the dub.git module
DEPEND = {">=libyeast-1.3", ">=libbread-2.2" }; // Build-time dependency

// Each of these phase functions overrides a default.
// If it doesn't need overridden, the default is used.
src_unpack(){
    git_fetch(GIT_BRANCH); // No argument gets master branch
    patch("files/melt_butter.patch"); // Apply our local patch
}

src_configure() {
assert(autoreconf(), "configure failed!"); // Die if this fails.
}

src_install() {
    dub_install("~/toast/plugins/"); // Non-standard location
}

post_install() {
dublog("Activate the spread plugin under Tools -> Options -> Plugins");
}

NOTE: I want to believe this is overkill and we'll never need to consider anything even resembling this route, but experience makes that hard.

-Wyatt

Reply via email to