From de52a00258a1bd98ddba022da9ecb27ab8be50cc Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 28 Nov 2020 13:30:26 -0500 Subject: nix derivation, dub & dub2nix using ldc2 1.24.0 ok - dmd 2.091.1 & dub 1.14.0 broken in nix unstable - dmd 2.094.2 & dub 1.23.0 current dlang - built using modified local nixpkgs dub modified to use ldc (without calls to dmd) - provide overlay for current( dub using ldc ) --- org/spine_build_scaffold.org | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'org/spine_build_scaffold.org') diff --git a/org/spine_build_scaffold.org b/org/spine_build_scaffold.org index d5e8aa8..02a2dd5 100644 --- a/org/spine_build_scaffold.org +++ b/org/spine_build_scaffold.org @@ -1040,6 +1040,15 @@ gitsnapshot: distclean tangle tangle gitsnapshot #+END_SRC +* dub.settings.json :dub:config:json: + +#+BEGIN_SRC json :NO-tangle ../dub.settings.json +{ + "defaultArchitecture": "x86_64", + "defaultCompiler": "ldc" +} +#+END_SRC + * dub.json :dub:config:json: ** dub.json @@ -1777,6 +1786,7 @@ aria2c https://raw.githubusercontent.com/lionello/dub2nix/master/mkDub.nix make modificatons if desired - run: nix-build + nix-build -I nixpkgs=[path-to]/nixpkgs ** envrc :envrc: @@ -1796,7 +1806,7 @@ if [ -e .envrc-local ]; then fi #+END_SRC -** shells shell.nix :shell: +** shells shell.nix SELECT :shell: *** dmd shell :dmd: - ln -sf nixDevEnv/shells/shell-dmd-verNix.nix shell.nix @@ -1938,12 +1948,8 @@ let in with pkgs; [ nix - dub - ninja ldc - rdmd sqlite - dub2nix nix-prefetch-git validatePkgConfig ] @@ -2012,7 +2018,7 @@ mkDubDerivation rec { description = "a sisu like document parser"; license = licenses.agpl3Plus; platforms = platforms.linux; - maintainers = [ Ralph Amissah ]; + maintainers = [ RalphAmissah ]; }; } #+END_SRC @@ -2117,7 +2123,7 @@ in { export HOME=$PWD ${lib.concatMapStringsSep "\n" dub-add-local deps} - dub build -b release --combined --skip-registry=all + dub build --build=release --combined --skip-registry=all runHook postBuild ''; @@ -2156,9 +2162,6 @@ in { #+BEGIN_SRC nix :tangle ../nixDevEnv/dub/mkDub-ldc.nix { pkgs ? import {}, stdenv ? pkgs.stdenv, - rdmd ? pkgs.rdmd, - #dmd ? pkgs.dmd, - #gcc ? pkgs.gcc, ldc ? pkgs.ldc, dub ? pkgs.dub }: @@ -2179,7 +2182,7 @@ let fromDub = dubDep: mkDerivation rec { name = "${src.name}-${version}"; version = rev-to-version dubDep.fetch.rev; - nativeBuildInputs = [ rdmd ldc dub ]; + nativeBuildInputs = [ ldc dub ]; src = dep2src dubDep; buildPhase = '' @@ -2205,7 +2208,7 @@ let targetOf = package: "${package.targetPath or "."}/${package.targetName or package.name}"; # Remove reference to build tools and library sources - disallowedReferences = deps: [ ldc rdmd dub ] ++ builtins.map dep2src deps; + disallowedReferences = deps: [ ldc dub ] ++ builtins.map dep2src deps; removeExpr = refs: ''remove-references-to ${lib.concatMapStrings (ref: " -t ${ref}") refs}''; @@ -2225,11 +2228,11 @@ in { pname = package.name; - nativeBuildInputs = [ rdmd ldc dub pkgs.removeReferencesTo ] ++ nativeBuildInputs; + nativeBuildInputs = [ ldc dub pkgs.removeReferencesTo ] ++ nativeBuildInputs; disallowedReferences = disallowedReferences deps; passthru = passthru // { - inherit dub ldc rdmd pkgs; + inherit dub ldc pkgs; }; src = lib.cleanSourceWith { @@ -2247,7 +2250,6 @@ in { export HOME=$PWD ${lib.concatMapStringsSep "\n" dub-add-local deps} dub build --compiler=ldc2 --build=release --combined --skip-registry=all - #dub build -b optimize -b inline --combined --skip-registry=all runHook postBuild ''; @@ -2381,8 +2383,8 @@ year = "2020"; !CHANGELOG !makefile !version.txt -!dub.json -!dub.sdl +!*.json +!*.sdl !meson.build !tangle !*.org -- cgit v1.2.3