aboutsummaryrefslogtreecommitdiffhomepage
path: root/derivation.nix
diff options
context:
space:
mode:
authorRalph Amissah <ralph.amissah@gmail.com>2022-06-01 21:47:14 -0400
committerRalph Amissah <ralph.amissah@gmail.com>2022-06-14 19:58:00 -0400
commit4808d0fa49816390772c3a2f2560dafde73dde2d (patch)
treef21fb14e2b6eac372796038934a93ec00f5fe08f /derivation.nix
parenthtml links to output, flags for a bit finer control (diff)
build related, mostly nix flakes
Diffstat (limited to 'derivation.nix')
-rw-r--r--derivation.nix53
1 files changed, 25 insertions, 28 deletions
diff --git a/derivation.nix b/derivation.nix
index 2594859..6aa38cb 100644
--- a/derivation.nix
+++ b/derivation.nix
@@ -7,15 +7,14 @@
}:
assert dcompiler != null;
with (
- assert dcompiler != null;
with lib;
let
- # Filter function to remove the .dub package folder from src
+ # filter function to remove the .dub package folder from src
filterDub = name: type: let baseName = baseNameOf (toString name); in ! (
type == "directory" && baseName == ".dub"
);
targetOf = package: "${package.targetPath or "."}/${package.targetName or package.name}";
- # Remove reference to build tools and library sources
+ # remove reference to build tools and library sources
disallowedReferences = deps: [ dcompiler dub ];
removeExpr = refs: ''remove-references-to ${lib.concatMapStrings (ref: " -t ${ref}") refs}'';
in {
@@ -42,24 +41,25 @@ with (
'';
buildPhase = ''
runHook preBuild
- export HOME=$PWD
- for dc_ in dmd ldmd2 gdmd; do
- echo "- check for D compiler $dc_"
- dc=$(type -P $dc_ || echo "")
- if [ ! "$dc" == "" ]; then
+ HOME="$PWD"
+ DFLAGS="-O2 -inline"
+ for DC_ in dmd ldmd2 gdmd; do
+ echo "- check for D compiler $DC_"
+ DC=$(type -P $DC_ || echo "")
+ if [ ! "$DC" == "" ]; then
break
fi
done
- if [ "$dc" == "" ]; then
+ if [ "$DC" == "" ]; then
exit "Error: could not find D compiler"
fi
- echo "$dc_ used as D compiler to build $pname"
- dub build --compiler=$dc --build=release --combined --skip-registry=all
+ echo "$DC_ used as D compiler to build $pname"
+ dub build --compiler=$DC --build=release --combined --skip-registry=all
runHook postBuild
'';
checkPhase = ''
runHook preCheck
- export HOME=$PWD
+ HOME="$PWD"
dub test --combined --skip-registry=all
runHook postCheck
'';
@@ -73,32 +73,29 @@ with (
description = package.description;
} // attrs.meta or {};
} // lib.optionalAttrs (!(attrs ? version)) {
- # Use name from dub.json, unless pname and version are specified
+ # use name from dub.json, unless pname and version are specified
name = package.name;
}));
}
);
mkDubDerivation rec {
- name = "spine-${version}";
- version = "0.11.3";
- src = ./.;
- buildInputs = with pkgs; [
- nixFlakes
- ## package manager
+ pname = "spine";
+ version = "0.11.3";
+ src = ./.;
+ nativeBuildInputs = with pkgs; [
dub
- ## compiler
ldc
- #rund
- ## linker
- #lld
- #mold
- ## builder
- #ninja
+ ];
+ buildInputs = with pkgs; [
+ nixFlakes
sqlite
];
meta = with pkgs.lib; {
- homepage = https://sisudoc.org;
- description = "a sisu like document parser";
+ description = "A sisu like parser and document generator";
+ longDescription = ''
+ A sisu like parser and document generator
+ '';
+ homepage = "https://sisudoc.org";
license = licenses.agpl3Plus;
platforms = platforms.linux;
maintainers = [ "RalphAmissah" ];