From 9ebdbda7a948661a201b0112f7e8f4d0bcaec335 Mon Sep 17 00:00:00 2001 From: i97henka Date: Sat, 3 Jun 2023 15:43:56 +0100 Subject: [PATCH 01/13] updated hello tar gz link. --- pills/08-generic-builders.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pills/08-generic-builders.xml b/pills/08-generic-builders.xml index 2a34f71..596d6cf 100644 --- a/pills/08-generic-builders.xml +++ b/pills/08-generic-builders.xml @@ -34,7 +34,7 @@ GNU hello world, despite its name, is a simple yet complete project which uses autotools. Fetch the latest tarball here: - https://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz. + https://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz. From b865367523546269eb6f86b5f2bdbc15c576f3e8 Mon Sep 17 00:00:00 2001 From: i97henka Date: Sat, 3 Jun 2023 16:20:54 +0100 Subject: [PATCH 02/13] updating builder new hello version. --- pills/08/hello-builder.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pills/08/hello-builder.txt b/pills/08/hello-builder.txt index 14787f4..3ad635e 100644 --- a/pills/08/hello-builder.txt +++ b/pills/08/hello-builder.txt @@ -1,6 +1,6 @@ export PATH="$gnutar/bin:$gcc/bin:$gnumake/bin:$coreutils/bin:$gawk/bin:$gzip/bin:$gnugrep/bin:$gnused/bin:$bintools/bin" tar -xzf $src -cd hello-2.10 +cd hello-2.12.1 ./configure --prefix=$out make make install From a826d304a09d11606a9fe3b1d03dc464ce081315 Mon Sep 17 00:00:00 2001 From: i97henka Date: Sat, 3 Jun 2023 16:28:36 +0100 Subject: [PATCH 03/13] changing hello.nix NB Darwin variant still outstanding. --- pills/08/hello-nix.txt | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/pills/08/hello-nix.txt b/pills/08/hello-nix.txt index 80377bc..2fc5c74 100644 --- a/pills/08/hello-nix.txt +++ b/pills/08/hello-nix.txt @@ -1,10 +1,12 @@ -with (import {}); -derivation { - name = "hello"; - builder = "${bash}/bin/bash"; - args = [ ./hello_builder.sh ]; - inherit gnutar gzip gnumake gcc coreutils gawk gnused gnugrep; - bintools = binutils.bintools; - src = ./hello-2.10.tar.gz; - system = builtins.currentSystem; -} +let + pkgs = import {}; +in + pkgs.stdenv.mkDerivation { + name = "hello"; + builder = "${pkgs.bash}/bin/bash"; + args = [ ./hello_builder.sh ]; + inherit (pkgs) gnutar gzip gnumake gcc coreutils gawk gnused gnugrep; + bintools = pkgs.binutils.bintools; + src = ./hello-2.12.1.tar.gz; + system = builtins.currentSystem; + } From d4deaeaebe5b2abc94d5b885683bb2d7828f374a Mon Sep 17 00:00:00 2001 From: i97henka Date: Sat, 3 Jun 2023 23:41:45 +0100 Subject: [PATCH 04/13] updated autotools.nix - reduced scope of with. --- pills/08/autotools-nix.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pills/08/autotools-nix.txt b/pills/08/autotools-nix.txt index 43264e1..ba61142 100644 --- a/pills/08/autotools-nix.txt +++ b/pills/08/autotools-nix.txt @@ -1,11 +1,11 @@ pkgs: attrs: - with pkgs; let defaultAttrs = { - builder = "${bash}/bin/bash"; + builder = "${pkgs.bash}/bin/bash"; args = [ ./builder.sh ]; - baseInputs = [ gnutar gzip gnumake gcc coreutils gawk gnused gnugrep binutils.bintools ]; + baseInputs = with pkgs; [ gnutar gzip gnumake gcc coreutils gawk gnused gnugrep binutils.bintools]; buildInputs = []; system = builtins.currentSystem; }; in - derivation (defaultAttrs // attrs) + pkgs.stdenv.mkDerivation (defaultAttrs // attrs) + From 73658ddd83af4379c15d657c6e997276375993af Mon Sep 17 00:00:00 2001 From: i97henka Date: Sat, 3 Jun 2023 23:48:26 +0100 Subject: [PATCH 05/13] updated third version of hello file. --- pills/08/hello-nix-rev-2.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pills/08/hello-nix-rev-2.txt b/pills/08/hello-nix-rev-2.txt index c216fb1..94c6fec 100644 --- a/pills/08/hello-nix-rev-2.txt +++ b/pills/08/hello-nix-rev-2.txt @@ -1,7 +1,8 @@ let pkgs = import {}; - mkDerivation = import ./autotools.nix pkgs; -in mkDerivation { + mymkDerivation = import ./autotools.nix pkgs; +in +mymkDerivation { name = "hello"; - src = ./hello-2.10.tar.gz; + src = ./hello-2.12.1.tar.gz; } From 5bafd468eb9bcc7835ee262bc328dd05030fe5cd Mon Sep 17 00:00:00 2001 From: i97henka Date: Sun, 4 Jun 2023 00:01:01 +0100 Subject: [PATCH 06/13] changed function name mymkDerivation to avoid collision & confusion with standard function. --- pills/08-generic-builders.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pills/08-generic-builders.xml b/pills/08-generic-builders.xml index 596d6cf..7fbee52 100644 --- a/pills/08-generic-builders.xml +++ b/pills/08-generic-builders.xml @@ -297,7 +297,7 @@ Out of this pill we managed to create a generic builder for autotools - projects, and a function mkDerivation that composes by default + projects, and a function mymkDerivation that composes by default the common components used in autotools projects instead of repeating them in all the packages we would write. From 6bce7954ef726b98bd8b5ef923cfaa991c48d61f Mon Sep 17 00:00:00 2001 From: i97henka Date: Sun, 4 Jun 2023 00:04:42 +0100 Subject: [PATCH 07/13] improved indentation --- pills/08/hello-nix-rev-2.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pills/08/hello-nix-rev-2.txt b/pills/08/hello-nix-rev-2.txt index 94c6fec..410f493 100644 --- a/pills/08/hello-nix-rev-2.txt +++ b/pills/08/hello-nix-rev-2.txt @@ -2,7 +2,7 @@ let pkgs = import {}; mymkDerivation = import ./autotools.nix pkgs; in -mymkDerivation { - name = "hello"; - src = ./hello-2.12.1.tar.gz; -} + mymkDerivation { + name = "hello"; + src = ./hello-2.12.1.tar.gz; + } From b1a8646ce95a32401b4f259ab5fb678a1bf1fb3f Mon Sep 17 00:00:00 2001 From: i97henka Date: Sun, 4 Jun 2023 00:07:16 +0100 Subject: [PATCH 08/13] updated darwin version accordingly. not tested --- pills/08/hello-nix-darwin.txt | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/pills/08/hello-nix-darwin.txt b/pills/08/hello-nix-darwin.txt index 735d816..f7423da 100644 --- a/pills/08/hello-nix-darwin.txt +++ b/pills/08/hello-nix-darwin.txt @@ -1,11 +1,13 @@ -with (import {}); -derivation { - name = "hello"; - builder = "${bash}/bin/bash"; - args = [ ./hello_builder.sh ]; - inherit gnutar gzip gnumake coreutils gawk gnused gnugrep; - gcc = clang; - bintools = clang.bintools.bintools_bin; - src = ./hello-2.10.tar.gz; - system = builtins.currentSystem; -} +let + pkgs = import {}; +in + pkgs.stdenv.mkDerivation { + name = "hello"; + builder = "${pkgs.bash}/bin/bash"; + args = [ ./hello_builder.sh ]; + inherit (pkgs) gnutar gzip gnumake coreutils gawk gnused gnugrep; + gcc = pkgs.clang; + bintools = pkgs.clang.bintools.bintools_bin; + src = ./hello-2.12.1.tar.gz; + system = builtins.currentSystem; + } From 6cdbf506833964c3cdd9f0a272fce8887ead080c Mon Sep 17 00:00:00 2001 From: Henrik Date: Sun, 4 Jun 2023 21:21:20 +0100 Subject: [PATCH 09/13] Update autotools-nix.txt --- pills/08/autotools-nix.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pills/08/autotools-nix.txt b/pills/08/autotools-nix.txt index ba61142..fbd0871 100644 --- a/pills/08/autotools-nix.txt +++ b/pills/08/autotools-nix.txt @@ -2,7 +2,7 @@ pkgs: attrs: let defaultAttrs = { builder = "${pkgs.bash}/bin/bash"; args = [ ./builder.sh ]; - baseInputs = with pkgs; [ gnutar gzip gnumake gcc coreutils gawk gnused gnugrep binutils.bintools]; + baseInputs = with pkgs; [ gnutar gzip gnumake gcc coreutils gawk gnused gnugrep binutils.bintools ]; buildInputs = []; system = builtins.currentSystem; }; From f316006776e323719fed0fd68e43fe606c466a13 Mon Sep 17 00:00:00 2001 From: Henrik Date: Sun, 4 Jun 2023 21:21:52 +0100 Subject: [PATCH 10/13] Update autotools-nix.txt --- pills/08/autotools-nix.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/pills/08/autotools-nix.txt b/pills/08/autotools-nix.txt index fbd0871..8fdd6e8 100644 --- a/pills/08/autotools-nix.txt +++ b/pills/08/autotools-nix.txt @@ -8,4 +8,3 @@ pkgs: attrs: }; in pkgs.stdenv.mkDerivation (defaultAttrs // attrs) - From 04337a7e63b495d9138e46562fc1ae6da8fa4df1 Mon Sep 17 00:00:00 2001 From: i97henka Date: Mon, 5 Jun 2023 21:42:34 +0100 Subject: [PATCH 11/13] changing to using builtins derivation and rename renaming to mkDerivation --- pills/08/hello-nix-darwin.txt | 2 +- pills/08/hello-nix-rev-1.txt | 20 +++++++++++--------- pills/08/hello-nix-rev-2.txt | 4 ++-- pills/08/hello-nix.txt | 2 +- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/pills/08/hello-nix-darwin.txt b/pills/08/hello-nix-darwin.txt index f7423da..79e8b1f 100644 --- a/pills/08/hello-nix-darwin.txt +++ b/pills/08/hello-nix-darwin.txt @@ -1,7 +1,7 @@ let pkgs = import {}; in - pkgs.stdenv.mkDerivation { + derivation { name = "hello"; builder = "${pkgs.bash}/bin/bash"; args = [ ./hello_builder.sh ]; diff --git a/pills/08/hello-nix-rev-1.txt b/pills/08/hello-nix-rev-1.txt index 053e715..67b5efd 100644 --- a/pills/08/hello-nix-rev-1.txt +++ b/pills/08/hello-nix-rev-1.txt @@ -1,9 +1,11 @@ -with (import {}); -derivation { - name = "hello"; - builder = "${bash}/bin/bash"; - args = [ ./builder.sh ]; - buildInputs = [ gnutar gzip gnumake gcc coreutils gawk gnused gnugrep binutils.bintools ]; - src = ./hello-2.10.tar.gz; - system = builtins.currentSystem; -} +let + pkgs = import {}; +in + derivation { + name = "hello"; + builder = "${pkgs.bash}/bin/bash"; + args = [ ./builder.sh ]; + buildInputs = with pkgs; [ gnutar gzip gnumake gcc coreutils gawk gnused gnugrep binutils.bintools ]; + src = ./hello-2.12.1.tar.gz; + system = builtins.currentSystem; + } diff --git a/pills/08/hello-nix-rev-2.txt b/pills/08/hello-nix-rev-2.txt index 410f493..403b783 100644 --- a/pills/08/hello-nix-rev-2.txt +++ b/pills/08/hello-nix-rev-2.txt @@ -1,8 +1,8 @@ let pkgs = import {}; - mymkDerivation = import ./autotools.nix pkgs; + mkDerivation = import ./autotools.nix pkgs; in - mymkDerivation { + mkDerivation { name = "hello"; src = ./hello-2.12.1.tar.gz; } diff --git a/pills/08/hello-nix.txt b/pills/08/hello-nix.txt index 2fc5c74..ba7f10a 100644 --- a/pills/08/hello-nix.txt +++ b/pills/08/hello-nix.txt @@ -1,7 +1,7 @@ let pkgs = import {}; in - pkgs.stdenv.mkDerivation { + derivation { name = "hello"; builder = "${pkgs.bash}/bin/bash"; args = [ ./hello_builder.sh ]; From c9b9aae961ca508ea174355f44e7b40bb642a3e5 Mon Sep 17 00:00:00 2001 From: Henrik Date: Tue, 6 Jun 2023 11:28:42 +0100 Subject: [PATCH 12/13] Update autotools-nix.txt now using derivation instead of pkgs.stdenv.mkDerivation --- pills/08/autotools-nix.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pills/08/autotools-nix.txt b/pills/08/autotools-nix.txt index 8fdd6e8..fda44fa 100644 --- a/pills/08/autotools-nix.txt +++ b/pills/08/autotools-nix.txt @@ -7,4 +7,4 @@ pkgs: attrs: system = builtins.currentSystem; }; in - pkgs.stdenv.mkDerivation (defaultAttrs // attrs) + derivation (defaultAttrs // attrs) From e1b2be6893ec6403ad4690721d1e4474526953d2 Mon Sep 17 00:00:00 2001 From: Henrik Date: Thu, 22 Jun 2023 07:49:45 +0100 Subject: [PATCH 13/13] Update pills/08-generic-builders.xml Co-authored-by: Zach Mitchell, PhD --- pills/08-generic-builders.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pills/08-generic-builders.xml b/pills/08-generic-builders.xml index 7fbee52..fe70c11 100644 --- a/pills/08-generic-builders.xml +++ b/pills/08-generic-builders.xml @@ -34,7 +34,7 @@ GNU hello world, despite its name, is a simple yet complete project which uses autotools. Fetch the latest tarball here: - https://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz. + https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz.