From 0a1a8ce68c7b27cc4e86e9fab71a99e311d9e7d0 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 7 May 2024 10:11:24 -0400 Subject: configuration a& build related --- .envrc-local | 5 ++-- .envrc-local_ | 5 ++-- .envrc-nix | 26 +++++++++++++++---- derivation.nix | 2 +- dub.json | 13 +++++----- flake.lock | 26 +++++++++---------- flake.nix | 73 +++++++++++++++++++++++++++++++++------------------ makefile | 10 ++----- org/config_dub.org | 13 +++++----- org/config_env.org | 31 +++++++++++++++++----- org/config_make.org | 10 ++----- org/config_nix.org | 75 ++++++++++++++++++++++++++++++++++------------------- 12 files changed, 180 insertions(+), 109 deletions(-) diff --git a/.envrc-local b/.envrc-local index 4d8d1ca..392dd6e 100644 --- a/.envrc-local +++ b/.envrc-local @@ -1,5 +1,6 @@ -export DFLAGS="-O2 -inline -boundscheck=on -color=on" export SpineVER=$(git describe --long --tags | sed 's/^[ a-z_-]\+\([0-9.]\+\)/\1/;s/\([^-]*-g\)/r\1/;s/-/./g') export SpineSearchBIN=result/share/cgi-bin -export SpineCGIbin=/var/www/cgi/cgi-bin +# ❯❯ cgi search form name: export SpineCGIform='spine_search' +# ❯❯ configuration cgi search form path: +export SpineCGIbin=/var/www/cgi/cgi-bin diff --git a/.envrc-local_ b/.envrc-local_ index 4d8d1ca..392dd6e 100644 --- a/.envrc-local_ +++ b/.envrc-local_ @@ -1,5 +1,6 @@ -export DFLAGS="-O2 -inline -boundscheck=on -color=on" export SpineVER=$(git describe --long --tags | sed 's/^[ a-z_-]\+\([0-9.]\+\)/\1/;s/\([^-]*-g\)/r\1/;s/-/./g') export SpineSearchBIN=result/share/cgi-bin -export SpineCGIbin=/var/www/cgi/cgi-bin +# ❯❯ cgi search form name: export SpineCGIform='spine_search' +# ❯❯ configuration cgi search form path: +export SpineCGIbin=/var/www/cgi/cgi-bin diff --git a/.envrc-nix b/.envrc-nix index b942a6a..a98cf57 100644 --- a/.envrc-nix +++ b/.envrc-nix @@ -20,20 +20,36 @@ echo ' ❯❯ nix flake show ❯❯ nix flake update && nix flake check && nix flake show -- for a dev shell: +- for a dev shell (development environment): ❯❯ nix develop ❯❯ nix develop ".#" --print-build-logs -c zsh + ❯❯ nix develop ".#dsh-nixpkgs-dmd-dub" --print-build-logs -c zsh + ❯❯ nix develop ".#dsh-overlay-dmd-dub" --print-build-logs -c zsh + ❯❯ nix develop ".#dsh-nixpkgs-ldc-dub" --print-build-logs -c zsh + ❯❯ nix develop ".#dsh-overlay-ldc-dub" --print-build-logs -c zsh - to build project: ❯❯ nix build --print-build-logs ❯❯ nix build ".#" --print-build-logs + +- to build project (for build dependencies select appropriate dev env & build): + ❯❯ nix build ".#spine-search-nixpkgs-dmd" --print-build-logs ❯❯ nix build ".#spine-search-overlay-dmd" --print-build-logs + ❯❯ nix build ".#spine-search-nixpkgs-ldc" --print-build-logs ❯❯ nix build ".#spine-search-overlay-ldc" --print-build-logs - - (see nix other/additional build options): - ❯❯ nix flake show - ❯❯ nix flake update && nix flake check --show-trace && nix flake show && nix develop ".#devShell" -c zsh - ❯❯ dub build --compiler=ldmd --build=release --combined --skip-registry=all +- to build using dub on nix (get dependencies by setting your development environment): + + ❯❯ nix develop ".#dsh-nixpkgs-dmd-dub" --print-build-logs -c zsh + ❯❯ dub run --compiler=dmd --config=dmd --combined --skip-registry=all + + ❯❯ nix develop ".#dsh-nixpkgs-ldc-dub" --print-build-logs -c zsh + ❯❯ dub run --compiler=ldmd2 --config=ldmd2 --combined --skip-registry=all + +- for develop environment & build options + ❯❯ nix flake show + ❯❯ nix flake update && nix flake check && nix flake show + ' diff --git a/derivation.nix b/derivation.nix index 2720a35..eb08f56 100644 --- a/derivation.nix +++ b/derivation.nix @@ -60,7 +60,7 @@ with ( 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 + dub run --compiler=$DC --build=release --combined --skip-registry=all runHook postBuild ''; checkPhase = '' diff --git a/dub.json b/dub.json index b7b1dfc..713c531 100644 --- a/dub.json +++ b/dub.json @@ -9,33 +9,34 @@ "homepage": "https://sisudoc.org", "license": "AGPL-3.0+", "targetPath": "./cgi-bin", - "sourcePaths": [ "./src" ], + "sourcePaths": [ "./src/sisudoc" ], + "importPaths": [ "./views" ], "stringImportPaths": [ "./views" ], "buildRequirements": [ "allowWarnings" ], "targetType": "executable", "buildTypes": { "dmd": { - "dflags": [ "-J=views", "-I=src" ], + "dflags": [ "-O", "-J=views", "-I=src/sisudoc" ], "buildOptions": [ "inline", "verbose" ], "buildRequirements": [ "allowWarnings" ] }, "ldc2": { - "dflags": [ "-O2", "-J=views", "-I=src" ], + "lflags": [ "-O2", "-I=src/sisudoc" ], "buildOptions": [ "optimize", "inline", "verbose" ], "buildRequirements": [ "allowWarnings" ] }, "ldmd2": { - "dflags": [ "-O2", "-boundscheck=on", "-J=views", "-I=src", "-color=on" ], + "dflags": [ "-O", "-J=views", "-I=src/sisudoc" ], "buildOptions": [ "optimize", "inline", "verbose" ], "buildRequirements": [ "allowWarnings" ] }, "gdc": { - "dflags": [ "-O2", "-J=views", "-I=src" ], + "lflags": [ "-O2", "-J=views", "-I=src/sisudoc" ], "buildOptions": [ "optimize", "inline" ], "buildRequirements": [ "allowWarnings" ] }, "gdmd": { - "dflags": [ "-O2", "-J=views", "-I=src" ], + "dflags": [ "-O", "-J=views", "-I=src/sisudoc" ], "buildOptions": [ "optimize", "inline" ], "buildRequirements": [ "allowWarnings" ] } diff --git a/flake.lock b/flake.lock index ce10a44..995efc3 100644 --- a/flake.lock +++ b/flake.lock @@ -8,11 +8,11 @@ ] }, "locked": { - "lastModified": 1713975110, - "narHash": "sha256-IPLYErdCwfF1HKGT/ks/xBatC7+NGizcd29O9KMQtUQ=", + "lastModified": 1714710163, + "narHash": "sha256-n8zU0sLfLOJRG5LjLJ3+nKKYm7OtMJsXRYb3D5z98wQ=", "ref": "refs/heads/main", - "rev": "7591439b407b39ecfc37b667bc3d54192aa4b9ef", - "revCount": 1, + "rev": "13c0d60e6822f6799c9bf9a36641945268a7cbfb", + "revCount": 4, "type": "git", "url": "git://git.sisudoc.org/package/dlang-nix-overlays-and-flake" }, @@ -26,11 +26,11 @@ "systems": "systems" }, "locked": { - "lastModified": 1694529238, - "narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "ff7b65b44d01cf9ba6a71320833626af21126384", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -44,11 +44,11 @@ "systems": "systems_2" }, "locked": { - "lastModified": 1701680307, - "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=", + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", "owner": "numtide", "repo": "flake-utils", - "rev": "4022d587cbbfd70fe950c1e2083a02621806a725", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", "type": "github" }, "original": { @@ -59,11 +59,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1702539185, - "narHash": "sha256-KnIRG5NMdLIpEkZTnN5zovNYc0hhXjAgv6pfd5Z4c7U=", + "lastModified": 1715037484, + "narHash": "sha256-OUt8xQFmBU96Hmm4T9tOWTu4oCswCzoVl+pxSq/kiFc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "aa9d4729cbc99dabacb50e3994dcefb3ea0f7447", + "rev": "ad7efee13e0d216bf29992311536fce1d3eefbef", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index d5c9317..2a6115c 100644 --- a/flake.nix +++ b/flake.nix @@ -29,7 +29,7 @@ ldc = prev.callPackage ./nix-overlays/ldc { }; dmd = prev.callPackage ./nix-overlays/dmd { }; dub = prev.callPackage ./nix-overlays/dub { }; - #gdc = prev.callPackage ./nix-overlays/gdc { }; # empty + #gdc = prev.callPackage ./nix-overlays/gdc { }; }); pkgsForSystem = system: import nixpkgs { overlays = [ @@ -54,7 +54,7 @@ pkgs-ovl = pkgsForSystem system; pkgs-nix = nixpkgsFor.${system}; in - with pkgs-ovl; { + with pkgs-nix; { default = stdenv.mkDerivation { inherit pname; inherit version; @@ -73,7 +73,7 @@ done if [ "$DC" == "" ]; then exit "Error: could not find D compiler"; fi echo "$DC_ used as D compiler to build $pname" - buildCMD="dub build --cache=local --compiler=$DC --build=$DC_ --combined --skip-registry=all" + buildCMD="dub run --cache=local --compiler=$DC --build=$DC_ --combined --skip-registry=all" echo $buildCMD $buildCMD echo $buildCMD @@ -92,11 +92,11 @@ src = self; inherit shell; inherit devEnv; - buildInputs = with pkgs-nix; [sqlite]; - nativeBuildInputs = with pkgs-nix; [dub dmd gnumake]; + buildInputs = [sqlite]; + nativeBuildInputs = [dub dmd gnumake]; buildPhase = '' runHook preBuild - buildCMD="dub build --cache=local --compiler=$(type -P dmd) --build=dmd --combined --skip-registry=all" + buildCMD="dub run --cache=local --compiler=$(type -P dmd) --build=dmd --combined --skip-registry=all" echo $buildCMD $buildCMD echo $buildCMD @@ -115,11 +115,11 @@ src = self; inherit shell; inherit devEnv; - buildInputs = with pkgs-nix; [sqlite]; - nativeBuildInputs = with pkgs-nix; [dub ldc gnumake]; + buildInputs = [sqlite]; + nativeBuildInputs = [dub ldc gnumake]; buildPhase = '' runHook preBuild - buildCMD="dub build --cache=local --compiler=$(type -P ldc2) --build=ldc2 --combined --skip-registry=all" + buildCMD="dub run --cache=local --compiler=$(type -P ldmd2) --build=ldmd2 --combined --skip-registry=all" echo $buildCMD $buildCMD echo $buildCMD @@ -138,11 +138,11 @@ src = self; inherit shell; inherit devEnv; - buildInputs = [sqlite]; - nativeBuildInputs = [dub dmd gnumake]; + buildInputs = with pkgs-ovl; [sqlite]; + nativeBuildInputs = with pkgs-ovl; [dub dmd gnumake]; buildPhase = '' runHook preBuild - buildCMD="dub build --cache=local --compiler=$(type -P dmd) --build=dmd --combined --skip-registry=all" + buildCMD="dub run --cache=local --compiler=$(type -P dmd) --build=dmd --combined --skip-registry=all" echo $buildCMD $buildCMD echo $buildCMD @@ -161,11 +161,11 @@ src = self; inherit shell; inherit devEnv; - buildInputs = [sqlite]; - nativeBuildInputs = [dub ldc gnumake]; + buildInputs = with pkgs-ovl; [sqlite]; + nativeBuildInputs = with pkgs-ovl; [dub ldc gnumake]; buildPhase = '' runHook preBuild - buildCMD="dub build --cache=local --compiler=$(type -P ldc2) --build=ldc2 --combined --skip-registry=all" + buildCMD="dub run --cache=local --compiler=$(type -P ldmd2) --build=ldmd2 --combined --skip-registry=all" echo $buildCMD $buildCMD echo $buildCMD @@ -184,11 +184,11 @@ # src = self; # inherit shell; # inherit devEnv; - # buildInputs = [ sqlite ]; - # nativeBuildInputs = [ dub gdc gnumake ]; + # buildInputs = with pkgs-ovl; [ sqlite ]; + # nativeBuildInputs = with pkgs-ovl; [ dub gdc gnumake ]; # buildPhase = '' # runHook preBuild - # dub build --cache=local --compiler=$(type -P gdc) --build=gdc --combined --skip-registry=all + # dub run --cache=local --compiler=$(type -P gdc) --build=gdc --combined --skip-registry=all # runHook postBuild # ''; # inherit preBuild; @@ -202,17 +202,17 @@ pkgs-ovl = pkgsForSystem system; pkgs-nix = nixpkgsFor.${system}; shellHook = '' - export DFLAGS="-O2 -boundscheck=on" export Date=`date "+%Y%m%d"` ## set local values in .envrc-local (or here if you must) ''; in - with pkgs-ovl; { + with pkgs-nix; { + dsh-d-overlay = d-overlay.devShells.${system}.default; dsh-overlay = mkShell { name = "spine base dev shell"; inherit shell; inherit devEnv; - packages = [ + packages = with pkgs-ovl; [ ldc #dmd dub @@ -221,8 +221,7 @@ ]; inherit shellHook; }; - dsh-d-overlay = d-overlay.devShells.${system}.default; - dsh-overlay-dmd-dub = mkShell { + dsh-nixpkgs-dmd-dub = mkShell { name = "spine base dev shell"; inherit shell; inherit devEnv; @@ -235,10 +234,34 @@ inherit shellHook; }; dsh-nixpkgs-ldc-dub = mkShell { - name = "nixpkgs - ldc - dub"; + name = "spine base dev shell"; + inherit shell; + inherit devEnv; + packages = [ + ldc + dub + gnumake + sqlite + ]; + inherit shellHook; + }; + dsh-overlay-dmd-dub = mkShell { + name = "spine base dev shell"; + inherit shell; + inherit devEnv; + packages = with pkgs-ovl; [ + dmd + dub + gnumake + sqlite + ]; + inherit shellHook; + }; + dsh-overlay-ldc-dub = mkShell { + name = "spine base dev shell"; inherit shell; inherit devEnv; - packages = with pkgs-nix; [ + packages = with pkgs-ovl; [ ldc dub gnumake diff --git a/makefile b/makefile index 7589a63..b032d64 100644 --- a/makefile +++ b/makefile @@ -1,10 +1,4 @@ -include .envrc-local -#SpineBIN := "${SpineBIN}" # 'result/bin' -#SpineOUT := "${SpineOUT}" # '/srv/www/spine' -#SpinePOD := "${SpinePOD}" # '~/grotto/repo/git.repo/projects/project-spine/doc-reform-markup/spine-markup-samples/markup/pod' -#SpineSearchAction := 'https://sisudoc.org/spine_search' -#SpineCGIform := 'spine_search' -#SpineSQLdb := 'spine.search.db' +#include .envrc-local PROG_VER_GIT :=$(shell echo `git describe --long --tags | sed -e "s/^[ a-z_-]\+\([0-9.]\+\)/\1/;s/\([^-]*-g\)/r\1/;s/-/./g"`) PROG_VER_DECLARED :=$(shell echo `cat ./views/version.txt | grep --color=never "enum" | sed 's/.\+(\([0-9]\+\),[ \t]\+\([0-9]\+\),[ \t]\+\([0-9]\+\)[ \t]*).\+/\1.\2.\3/g'`) @@ -20,7 +14,7 @@ flake-check: echo -e '❯❯ nix build ".#spine-ldc" --print-build-logs |& nom\n❯❯ nix build ".#spine-dmd" --print-build-logs |& nom\n'; \ echo -e '❯❯ make -s\n❯❯ make -s nix-build-ldc\n❯❯ make -s nix-build-dmd\n'; \ echo -e '❯❯ make -s ldc\n❯❯ make -s dmd\n'; \ - echo -e '❯❯ $(DUB) --compiler=ldc2 --build=ldc2\n❯❯ $(DUB) --compiler=dmd --build=dmd\n'; + echo -e '❯❯ $(DUB) --compiler=ldmd2 --build=ldmd2\n❯❯ $(DUB) --compiler=dmd --build=dmd\n'; nix-devshell: echo -ne '\n❯❯ nix flake update && nix flake check --show-trace && nix flake show && nix develop ".#devShell"\n\n❯❯ nix build ".#default" --print-build-logs\n❯❯ nix build ".#spine-search-dmd" --print-build-logs\n❯❯ nix build ".#spine-search-ldc" --print-build-logs\n❯❯ nix build ".#spine-search-gdc" --print-build-logs\n\n'; \ diff --git a/org/config_dub.org b/org/config_dub.org index 42c5f6f..61405f6 100644 --- a/org/config_dub.org +++ b/org/config_dub.org @@ -54,33 +54,34 @@ "homepage": "https://sisudoc.org", "license": "AGPL-3.0+", "targetPath": "./cgi-bin", - "sourcePaths": [ "./src" ], + "sourcePaths": [ "./src/sisudoc" ], + "importPaths": [ "./views" ], "stringImportPaths": [ "./views" ], "buildRequirements": [ "allowWarnings" ], "targetType": "executable", "buildTypes": { "dmd": { - "dflags": [ "-J=views", "-I=src" ], + "dflags": [ "-O", "-J=views", "-I=src/sisudoc" ], "buildOptions": [ "inline", "verbose" ], "buildRequirements": [ "allowWarnings" ] }, "ldc2": { - "dflags": [ "-O2", "-J=views", "-I=src" ], + "lflags": [ "-O2", "-I=src/sisudoc" ], "buildOptions": [ "optimize", "inline", "verbose" ], "buildRequirements": [ "allowWarnings" ] }, "ldmd2": { - "dflags": [ "-O2", "-boundscheck=on", "-J=views", "-I=src", "-color=on" ], + "dflags": [ "-O", "-J=views", "-I=src/sisudoc" ], "buildOptions": [ "optimize", "inline", "verbose" ], "buildRequirements": [ "allowWarnings" ] }, "gdc": { - "dflags": [ "-O2", "-J=views", "-I=src" ], + "lflags": [ "-O2", "-J=views", "-I=src/sisudoc" ], "buildOptions": [ "optimize", "inline" ], "buildRequirements": [ "allowWarnings" ] }, "gdmd": { - "dflags": [ "-O2", "-J=views", "-I=src" ], + "dflags": [ "-O", "-J=views", "-I=src/sisudoc" ], "buildOptions": [ "optimize", "inline" ], "buildRequirements": [ "allowWarnings" ] } diff --git a/org/config_env.org b/org/config_env.org index 6f1c1c7..dab1d81 100644 --- a/org/config_env.org +++ b/org/config_env.org @@ -76,22 +76,38 @@ echo ' ❯❯ nix flake show ❯❯ nix flake update && nix flake check && nix flake show -- for a dev shell: +- for a dev shell (development environment): ❯❯ nix develop ❯❯ nix develop ".#" --print-build-logs -c zsh + ❯❯ nix develop ".#dsh-nixpkgs-dmd-dub" --print-build-logs -c zsh + ❯❯ nix develop ".#dsh-overlay-dmd-dub" --print-build-logs -c zsh + ❯❯ nix develop ".#dsh-nixpkgs-ldc-dub" --print-build-logs -c zsh + ❯❯ nix develop ".#dsh-overlay-ldc-dub" --print-build-logs -c zsh - to build project: ❯❯ nix build --print-build-logs ❯❯ nix build ".#" --print-build-logs + +- to build project (for build dependencies select appropriate dev env & build): + ❯❯ nix build ".#spine-search-nixpkgs-dmd" --print-build-logs ❯❯ nix build ".#spine-search-overlay-dmd" --print-build-logs + ❯❯ nix build ".#spine-search-nixpkgs-ldc" --print-build-logs ❯❯ nix build ".#spine-search-overlay-ldc" --print-build-logs - - (see nix other/additional build options): - ❯❯ nix flake show - ❯❯ nix flake update && nix flake check --show-trace && nix flake show && nix develop ".#devShell" -c zsh - ❯❯ dub build --compiler=ldmd --build=release --combined --skip-registry=all +- to build using dub on nix (get dependencies by setting your development environment): + + ❯❯ nix develop ".#dsh-nixpkgs-dmd-dub" --print-build-logs -c zsh + ❯❯ dub run --compiler=dmd --config=dmd --combined --skip-registry=all + + ❯❯ nix develop ".#dsh-nixpkgs-ldc-dub" --print-build-logs -c zsh + ❯❯ dub run --compiler=ldmd2 --config=ldmd2 --combined --skip-registry=all + +- for develop environment & build options + ❯❯ nix flake show + ❯❯ nix flake update && nix flake check && nix flake show + ' #+END_SRC @@ -164,9 +180,10 @@ fi #+HEADER: :tangle ../.envrc-local #+HEADER: :noweb yes #+BEGIN_SRC sh -export DFLAGS="-O2 -inline -boundscheck=on -color=on" export SpineVER=$(git describe --long --tags | sed 's/^[ a-z_-]\+\([0-9.]\+\)/\1/;s/\([^-]*-g\)/r\1/;s/-/./g') export SpineSearchBIN=result/share/cgi-bin -export SpineCGIbin=/var/www/cgi/cgi-bin +# ❯❯ cgi search form name: export SpineCGIform='spine_search' +# ❯❯ configuration cgi search form path: +export SpineCGIbin=/var/www/cgi/cgi-bin #+END_SRC diff --git a/org/config_make.org b/org/config_make.org index 3f97ff4..2c7e8d9 100644 --- a/org/config_make.org +++ b/org/config_make.org @@ -49,13 +49,7 @@ #+HEADER: :tangle ../makefile #+HEADER: :noweb yes #+BEGIN_SRC makefile -include .envrc-local -#SpineBIN := "${SpineBIN}" # 'result/bin' -#SpineOUT := "${SpineOUT}" # '/srv/www/spine' -#SpinePOD := "${SpinePOD}" # '~/grotto/repo/git.repo/projects/project-spine/doc-reform-markup/spine-markup-samples/markup/pod' -#SpineSearchAction := 'https://sisudoc.org/spine_search' -#SpineCGIform := 'spine_search' -#SpineSQLdb := 'spine.search.db' +#include .envrc-local PROG_VER_GIT :=$(shell echo `git describe --long --tags | sed -e "s/^[ a-z_-]\+\([0-9.]\+\)/\1/;s/\([^-]*-g\)/r\1/;s/-/./g"`) PROG_VER_DECLARED :=$(shell echo `cat ./views/version.txt | grep --color=never "enum" | sed 's/.\+(\([0-9]\+\),[ \t]\+\([0-9]\+\),[ \t]\+\([0-9]\+\)[ \t]*).\+/\1.\2.\3/g'`) @@ -71,7 +65,7 @@ flake-check: echo -e '❯❯ nix build ".#spine-ldc" --print-build-logs |& nom\n❯❯ nix build ".#spine-dmd" --print-build-logs |& nom\n'; \ echo -e '❯❯ make -s\n❯❯ make -s nix-build-ldc\n❯❯ make -s nix-build-dmd\n'; \ echo -e '❯❯ make -s ldc\n❯❯ make -s dmd\n'; \ - echo -e '❯❯ $(DUB) --compiler=ldc2 --build=ldc2\n❯❯ $(DUB) --compiler=dmd --build=dmd\n'; + echo -e '❯❯ $(DUB) --compiler=ldmd2 --build=ldmd2\n❯❯ $(DUB) --compiler=dmd --build=dmd\n'; nix-devshell: echo -ne '\n❯❯ nix flake update && nix flake check --show-trace && nix flake show && nix develop ".#devShell"\n\n❯❯ nix build ".#default" --print-build-logs\n❯❯ nix build ".#spine-search-dmd" --print-build-logs\n❯❯ nix build ".#spine-search-ldc" --print-build-logs\n❯❯ nix build ".#spine-search-gdc" --print-build-logs\n\n'; \ diff --git a/org/config_nix.org b/org/config_nix.org index 0bf2362..3eb9498 100644 --- a/org/config_nix.org +++ b/org/config_nix.org @@ -56,7 +56,7 @@ ldc = prev.callPackage ./nix-overlays/ldc { }; dmd = prev.callPackage ./nix-overlays/dmd { }; dub = prev.callPackage ./nix-overlays/dub { }; - #gdc = prev.callPackage ./nix-overlays/gdc { }; # empty + #gdc = prev.callPackage ./nix-overlays/gdc { }; }); pkgsForSystem = system: import nixpkgs { overlays = [ @@ -81,7 +81,7 @@ pkgs-ovl = pkgsForSystem system; pkgs-nix = nixpkgsFor.${system}; in - with pkgs-ovl; { + with pkgs-nix; { default = stdenv.mkDerivation { inherit pname; inherit version; @@ -100,7 +100,7 @@ done if [ "$DC" == "" ]; then exit "Error: could not find D compiler"; fi echo "$DC_ used as D compiler to build $pname" - buildCMD="dub build --cache=local --compiler=$DC --build=$DC_ --combined --skip-registry=all" + buildCMD="dub run --cache=local --compiler=$DC --build=$DC_ --combined --skip-registry=all" echo $buildCMD $buildCMD echo $buildCMD @@ -119,11 +119,11 @@ src = self; inherit shell; inherit devEnv; - buildInputs = with pkgs-nix; [sqlite]; - nativeBuildInputs = with pkgs-nix; [dub dmd gnumake]; + buildInputs = [sqlite]; + nativeBuildInputs = [dub dmd gnumake]; buildPhase = '' runHook preBuild - buildCMD="dub build --cache=local --compiler=$(type -P dmd) --build=dmd --combined --skip-registry=all" + buildCMD="dub run --cache=local --compiler=$(type -P dmd) --build=dmd --combined --skip-registry=all" echo $buildCMD $buildCMD echo $buildCMD @@ -142,11 +142,11 @@ src = self; inherit shell; inherit devEnv; - buildInputs = with pkgs-nix; [sqlite]; - nativeBuildInputs = with pkgs-nix; [dub ldc gnumake]; + buildInputs = [sqlite]; + nativeBuildInputs = [dub ldc gnumake]; buildPhase = '' runHook preBuild - buildCMD="dub build --cache=local --compiler=$(type -P ldc2) --build=ldc2 --combined --skip-registry=all" + buildCMD="dub run --cache=local --compiler=$(type -P ldmd2) --build=ldmd2 --combined --skip-registry=all" echo $buildCMD $buildCMD echo $buildCMD @@ -165,11 +165,11 @@ src = self; inherit shell; inherit devEnv; - buildInputs = [sqlite]; - nativeBuildInputs = [dub dmd gnumake]; + buildInputs = with pkgs-ovl; [sqlite]; + nativeBuildInputs = with pkgs-ovl; [dub dmd gnumake]; buildPhase = '' runHook preBuild - buildCMD="dub build --cache=local --compiler=$(type -P dmd) --build=dmd --combined --skip-registry=all" + buildCMD="dub run --cache=local --compiler=$(type -P dmd) --build=dmd --combined --skip-registry=all" echo $buildCMD $buildCMD echo $buildCMD @@ -188,11 +188,11 @@ src = self; inherit shell; inherit devEnv; - buildInputs = [sqlite]; - nativeBuildInputs = [dub ldc gnumake]; + buildInputs = with pkgs-ovl; [sqlite]; + nativeBuildInputs = with pkgs-ovl; [dub ldc gnumake]; buildPhase = '' runHook preBuild - buildCMD="dub build --cache=local --compiler=$(type -P ldc2) --build=ldc2 --combined --skip-registry=all" + buildCMD="dub run --cache=local --compiler=$(type -P ldmd2) --build=ldmd2 --combined --skip-registry=all" echo $buildCMD $buildCMD echo $buildCMD @@ -211,11 +211,11 @@ # src = self; # inherit shell; # inherit devEnv; - # buildInputs = [ sqlite ]; - # nativeBuildInputs = [ dub gdc gnumake ]; + # buildInputs = with pkgs-ovl; [ sqlite ]; + # nativeBuildInputs = with pkgs-ovl; [ dub gdc gnumake ]; # buildPhase = '' # runHook preBuild - # dub build --cache=local --compiler=$(type -P gdc) --build=gdc --combined --skip-registry=all + # dub run --cache=local --compiler=$(type -P gdc) --build=gdc --combined --skip-registry=all # runHook postBuild # ''; # inherit preBuild; @@ -229,17 +229,17 @@ pkgs-ovl = pkgsForSystem system; pkgs-nix = nixpkgsFor.${system}; shellHook = '' - export DFLAGS="-O2 -boundscheck=on" export Date=`date "+%Y%m%d"` ## set local values in .envrc-local (or here if you must) ''; in - with pkgs-ovl; { + with pkgs-nix; { + dsh-d-overlay = d-overlay.devShells.${system}.default; dsh-overlay = mkShell { name = "spine base dev shell"; inherit shell; inherit devEnv; - packages = [ + packages = with pkgs-ovl; [ ldc #dmd dub @@ -248,8 +248,7 @@ ]; inherit shellHook; }; - dsh-d-overlay = d-overlay.devShells.${system}.default; - dsh-overlay-dmd-dub = mkShell { + dsh-nixpkgs-dmd-dub = mkShell { name = "spine base dev shell"; inherit shell; inherit devEnv; @@ -262,10 +261,34 @@ inherit shellHook; }; dsh-nixpkgs-ldc-dub = mkShell { - name = "nixpkgs - ldc - dub"; + name = "spine base dev shell"; + inherit shell; + inherit devEnv; + packages = [ + ldc + dub + gnumake + sqlite + ]; + inherit shellHook; + }; + dsh-overlay-dmd-dub = mkShell { + name = "spine base dev shell"; + inherit shell; + inherit devEnv; + packages = with pkgs-ovl; [ + dmd + dub + gnumake + sqlite + ]; + inherit shellHook; + }; + dsh-overlay-ldc-dub = mkShell { + name = "spine base dev shell"; inherit shell; inherit devEnv; - packages = with pkgs-nix; [ + packages = with pkgs-ovl; [ ldc dub gnumake @@ -480,7 +503,7 @@ with ( 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 + dub run --compiler=$DC --build=release --combined --skip-registry=all runHook postBuild ''; checkPhase = '' -- cgit v1.2.3