From 0de4f2c1f970d911cf413bab89ec91896b12c30b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 13 Nov 2020 22:58:26 -0500 Subject: ldc in need of newer dub --- org/spine_build_scaffold.org | 121 +++++++++++++++++++++---------------------- 1 file changed, 58 insertions(+), 63 deletions(-) (limited to 'org/spine_build_scaffold.org') diff --git a/org/spine_build_scaffold.org b/org/spine_build_scaffold.org index 39c275f..d5e8aa8 100644 --- a/org/spine_build_scaffold.org +++ b/org/spine_build_scaffold.org @@ -1810,14 +1810,8 @@ fi - ln -sf nixDevEnv/dub/mkDub-dmd.nix mkDub.nix #+BEGIN_SRC nix :tangle ../nixDevEnv/shells/shell-dmd-verNix.nix -{ pkgs ? import - <> -}: -let - <> -in pkgs.mkShell { - <> -} +{ pkgs ? import {} }: +<> #+END_SRC **** user @@ -1826,14 +1820,8 @@ in pkgs.mkShell { - ln -sf nixDevEnv/dub/mkDub-dmd.nix mkDub.nix #+BEGIN_SRC nix :tangle ../nixDevEnv/shells/shell-dmd-verUser.nix -{ pkgs ? import - <> -}: -let - <> -in pkgs.mkShell { - <> -} +<> +<> #+END_SRC *** ldc shell :ldc: @@ -1849,14 +1837,8 @@ in pkgs.mkShell { - ln -sf nixDevEnv/dub/mkDub-ldc.nix mkDub.nix #+BEGIN_SRC nix :tangle ../nixDevEnv/shells/shell-ldc-verNix.nix -{ pkgs ? import - <> -}: -let - <> -in pkgs.mkShell { - <> -} +{ pkgs ? import {} }: +<> #+END_SRC **** user @@ -1865,22 +1847,31 @@ in pkgs.mkShell { - ln -sf nixDevEnv/dub/mkDub-ldc.nix mkDub.nix #+BEGIN_SRC nix :tangle ../nixDevEnv/shells/shell-ldc-verUser.nix -{ pkgs ? import {}, }: -let - <> -in pkgs.mkShell { - <> -} +<> +<> #+END_SRC -- overlay header +***** (import ./nixDevEnv/overlays/ldcVersion.nix) +#+NAME: nix_shell_overlay_user_version_ldc #+BEGIN_SRC nix -{ pkgs ? import - <> -}: +{ pkgs ? import { + overlays = [ (import ../overlays/ldcVersion.nix) ]; +} }: #+END_SRC +**** mkShell with build inputs + +#+NAME: nix_shell_mkshell_with_buildInputs_ldc +#+BEGIN_SRC nix +pkgs.mkShell { + buildInputs = with pkgs; + [ (import ./packages-ldc.nix { inherit pkgs; }) ]; +} +#+END_SRC + +- overlay header + *** parts **** dub2nix @@ -1905,7 +1896,9 @@ no working overlay, default none: #+NAME: nix_shell_overlay_user_version_dmd #+BEGIN_SRC nix -{ overlays = [ ]; } +{ pkgs ? import + { overlays = [ ]; } +}: #+END_SRC use if working overlay: @@ -1916,41 +1909,44 @@ use if working overlay: ]; } #+END_SRC -***** (import ./nixDevEnv/overlays/ldcVersion.nix) - -#+NAME: nix_shell_overlay_user_version_ldc -#+BEGIN_SRC nix -{ overlays = [ - (import ../overlays/ldcVersion.nix) -]; } -#+END_SRC - **** build inputs -#+NAME: nix_shell_buildInputs_dmd +#+NAME: nix_shell_mkshell_with_buildInputs_dmd #+BEGIN_SRC nix -buildInputs = with pkgs; [ - nix - dub - dmd - rdmd - sqlite - dub2nix - nix-prefetch-git -]; +pkgs.mkShell { + buildInputs = with pkgs; [ + nix + dub + dmd + rdmd + sqlite + dub2nix + nix-prefetch-git + ]; +} #+END_SRC -#+NAME: nix_shell_buildInputs_ldc -#+BEGIN_SRC nix -buildInputs = with pkgs; [ +**** build inputs ldc + +#+BEGIN_SRC nix :tangle ../nixDevEnv/shells/packages-ldc.nix +{ pkgs ? import {} }: +let + dub2nix-src = fetchTarball { + url = "https://github.com/lionello/dub2nix/archive/master.tar.gz"; + }; + dub2nix = (import dub2nix-src) { inherit pkgs; }; +in +with pkgs; [ nix dub + ninja ldc rdmd sqlite dub2nix nix-prefetch-git -]; + validatePkgConfig +] #+END_SRC *** shell with dmd & ldc :shell: @@ -2291,10 +2287,9 @@ in { #+BEGIN_SRC nix :tangle ../nixDevEnv/overlays/ldcVersion.nix self: super: rec { - pname = "ldc"; - <> ldc = super.ldc.overrideAttrs(oldAttrs: rec { - inherit pname version sha256; + pname = "ldc"; + <> name = "${pname}-${version}"; src = super.fetchurl { url = "https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz"; @@ -2313,10 +2308,10 @@ no working overlay, tangle to work on #+BEGIN_SRC nix :NO-tangle ../nixDevEnv/overlays/dmdVersion.nix self: super: rec { + pname = "dmd"; <> dmd = super.dmd.overrideAttrs(oldAttrs: rec { - inherit year version sha256; - pname = oldAttrs.pname; + inherit pname year version sha256; name = "${pname}-${version}"; src = super.fetchurl { url = "http://downloads.dlang.org/releases/${year}/dmd.${version}.linux.tar.xz"; -- cgit v1.2.3