From 3f88e14031e46eb45b7842d9e806bce588c4f93f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 24 Jan 2023 19:08:13 -0500 Subject: nix & build housekeeping --- org/config_make.org | 41 ++++++++++++++++++++++++++++++----------- org/config_nix.org | 30 +++++++++++++++++++++++------- 2 files changed, 53 insertions(+), 18 deletions(-) (limited to 'org') diff --git a/org/config_make.org b/org/config_make.org index 92e5155..4f91db4 100644 --- a/org/config_make.org +++ b/org/config_make.org @@ -54,15 +54,6 @@ SpineSearchAction := 'https://sisudoc.org/spine_search' SpineCGIform := 'spine_search' SpineSQLdb := 'spine.search.db' -# nix build -build: - nix-build - -# cp cgi search form -cp-cgi: - sudo cp -vi /var/www/cgi/cgi-bin/spine_search /var/www/cgi/cgi-bin/spine_search_old && \ - sudo cp -vi result/share/cgi-bin/spine_search /var/www/cgi/cgi-bin/spine_search - get_depends: hwd=$$(echo `pwd`) && \ gwd="$${hwd}/src/ext_depends" && \ @@ -657,7 +648,9 @@ gitsnapshot: distclean tangle #+HEADER: :noweb yes #+BEGIN_SRC makefile <> +<> <> +<> #+END_SRC *** make @@ -671,10 +664,38 @@ SpineSearchAction := 'https://sisudoc.org/spine_search' SpineCGIform := 'spine_search' SpineSQLdb := 'spine.search.db' +#+END_SRC + +**** nix + +#+NAME: make_set_nix +#+BEGIN_SRC makefile +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"; \ + nix flake update && nix flake check --show-trace && nix flake show && nix develop .#devShell + # nix build build: nix-build +nix-build-default: + nix build .#default --print-build-logs + +nix-build-dmd: + nix build .#spine-dmd --print-build-logs + +nix-build-ldc: + nix build .#spine-ldc --print-build-logs + +nix-build-gdc: + nix build .#spine-gdc --print-build-logs + +#+END_SRC + +**** post build copy + +#+NAME: make_copy_cgi_search +#+BEGIN_SRC makefile # cp cgi search form cp-cgi: sudo cp -vi /var/www/cgi/cgi-bin/spine_search /var/www/cgi/cgi-bin/spine_search_old && \ @@ -736,8 +757,6 @@ export NIX_PATH=/nix/var/nix/profiles/per-user/root/channels/nixos - /srv/www/spine/latex -** make - ** notes - vim {the_wealth_of_networks.yochai_benkler,two_bits.christopher_kelty,viral_spiral.david_bollier}.en.a4.portrait.tex diff --git a/org/config_nix.org b/org/config_nix.org index 21aff72..9af553c 100644 --- a/org/config_nix.org +++ b/org/config_nix.org @@ -87,7 +87,6 @@ if ! has nix_direnv_version || ! nix_direnv_version ${NixDirEnvVersion}; then # source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/${NixDirEnvVersion}/direnvrc" "sha256-0000000000000000000000000000000000000000000=" source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/${NixDirEnvVersion}/direnvrc" "sha256-5EwyKnkJNQeXrRkYbwwRBcXbibosCJqyIUuz9Xq+LRc=" fi -# reload when these files change watch_file flake.lock watch_file flake.nix nix flake update && nix flake check --show-trace && nix flake show @@ -193,9 +192,12 @@ postInstall: let pname = "spine_search"; version = "<>"; + shell = ./shell.nix; # ./default.nix; + devEnv = ./shell.nix; # ./default.nix; supportedSystems = [ "x86_64-linux" ]; # [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ]; forAllSystems = nixpkgs.lib.genAttrs supportedSystems; nixpkgsFor = forAllSystems (system: import nixpkgs { inherit system; }); # nixpkgs instantiated for supported system types. + <> in { packages = forAllSystems (system: let pkgs = nixpkgsFor.${system}; @@ -205,8 +207,8 @@ postInstall: inherit version; executable = true; src = self; - shell = ./default.nix; - devEnv = ./devenv.nix; + inherit shell; + inherit devEnv; buildInputs = [ sqlite ]; nativeBuildInputs = [ dub dmd ldc gdc gnumake ]; # [ dub dmd ]; [ dub ldc ]; [ dub gdc ]; buildPhase = '' @@ -221,7 +223,9 @@ postInstall: dub build --compiler=$DC --build=$DC_ --combined --skip-registry=all runHook postBuild ''; - <> + inherit checkPhase; + inherit installPhase; + inherit postInstall; }; spine-search-dmd = stdenv.mkDerivation { inherit pname; @@ -229,6 +233,8 @@ postInstall: meta.mainProgram = "spine_search-dmd"; executable = true; src = self; + inherit shell; + inherit devEnv; buildInputs = [ sqlite ]; nativeBuildInputs = [ dub dmd gnumake ]; buildPhase = '' @@ -236,7 +242,9 @@ postInstall: dub build --compiler=$(type -P dmd) --build=dmd --combined --skip-registry=all runHook postBuild ''; - <> + inherit checkPhase; + inherit installPhase; + inherit postInstall; }; spine-search-ldc = stdenv.mkDerivation { inherit pname; @@ -244,6 +252,8 @@ postInstall: meta.mainProgram = "spine_search-ldc"; executable = true; src = self; + inherit shell; + inherit devEnv; buildInputs = [ sqlite ]; nativeBuildInputs = [ dub ldc gnumake ]; buildPhase = '' @@ -251,7 +261,9 @@ postInstall: dub build --compiler=$(type -P ldc2) --build=ldc2 --combined --skip-registry=all runHook postBuild ''; - <> + inherit checkPhase; + inherit installPhase; + inherit postInstall; }; spine-search-gdc = stdenv.mkDerivation { inherit pname; @@ -259,6 +271,8 @@ postInstall: meta.mainProgram = "spine_search-gdc"; executable = true; src = self; + inherit shell; + inherit devEnv; buildInputs = [ sqlite ]; nativeBuildInputs = [ dub gdc gnumake ]; buildPhase = '' @@ -266,7 +280,9 @@ postInstall: dub build --compiler=$(type -P gdc) --build=gdc --combined --skip-registry=all runHook postBuild ''; - <> + inherit checkPhase; + inherit installPhase; + inherit postInstall; }; #vendorSha256 = "sha256-0Q00000000000000000000000000000000000000000="; }); -- cgit v1.2.3