Skip to content

Commit

Permalink
Merge pull request #214 from henrik-ch/pill8
Browse files Browse the repository at this point in the history
Pill 8 update
  • Loading branch information
proofconstruction committed Jul 10, 2023
2 parents ea8ef42 + e1b2be6 commit d13c02c
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 40 deletions.
4 changes: 2 additions & 2 deletions pills/08-generic-builders.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<link xlink:href="https://www.gnu.org/software/hello/">GNU hello world</link>,
despite its name, is a simple yet complete project which uses autotools.
Fetch the latest tarball here:
<link xlink:href="https://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz">https://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz</link>.
<link xlink:href="https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz">https://ftp.gnu.org/gnu/hello/hello-2.12.1.tar.gz</link>.
</para>

<para>
Expand Down Expand Up @@ -297,7 +297,7 @@

<para>
Out of this pill we managed to create a generic builder for autotools
projects, and a function <code>mkDerivation</code> that composes by default
projects, and a function <code>mymkDerivation</code> that composes by default
the common components used in autotools projects instead of repeating them
in all the packages we would write.
</para>
Expand Down
5 changes: 2 additions & 3 deletions pills/08/autotools-nix.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
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;
};
Expand Down
2 changes: 1 addition & 1 deletion pills/08/hello-builder.txt
Original file line number Diff line number Diff line change
@@ -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
24 changes: 13 additions & 11 deletions pills/08/hello-nix-darwin.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
with (import <nixpkgs> {});
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 <nixpkgs> {};
in
derivation {
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;
}
20 changes: 11 additions & 9 deletions pills/08/hello-nix-rev-1.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
with (import <nixpkgs> {});
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 <nixpkgs> {};
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;
}
9 changes: 5 additions & 4 deletions pills/08/hello-nix-rev-2.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
let
pkgs = import <nixpkgs> {};
mkDerivation = import ./autotools.nix pkgs;
in mkDerivation {
name = "hello";
src = ./hello-2.10.tar.gz;
}
in
mkDerivation {
name = "hello";
src = ./hello-2.12.1.tar.gz;
}
22 changes: 12 additions & 10 deletions pills/08/hello-nix.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
with (import <nixpkgs> {});
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 <nixpkgs> {};
in
derivation {
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;
}

0 comments on commit d13c02c

Please sign in to comment.