Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pill 8 update #214

Merged
merged 13 commits into from
Jul 10, 2023
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.10.tar.gz</link>.
henrik-ch marked this conversation as resolved.
Show resolved Hide resolved
</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
7 changes: 3 additions & 4 deletions pills/08/autotools-nix.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
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)
henrik-ch marked this conversation as resolved.
Show resolved Hide resolved
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
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;
}
11 changes: 6 additions & 5 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;
}
mymkDerivation = import ./autotools.nix pkgs;
in
mymkDerivation {
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
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;
}