git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #49725 from pbogdan/chrootenv-strip

chrootenv: strip the binary

commit77dad17ab6c8c1e1ff05a8017df62bee893dc304 authorYegor Timoshenko <yegortimoshenko@riseup.net> dateMon 5 Nov 2018, 18:57 (8 years ago) parent5c63ee6cea0e92
3 files changed+11−9
pkgs/build-support/build-fhs-userenv/chrootenv/default.nix+4−7 pkgs/build-support/build-fhs-userenv/chrootenv/meson.build+5 pkgs/build-support/build-fhs-userenv/default.nix+2−2
pkgs/build-support/build-fhs-userenv/chrootenv/default.nix+4−7
@@ -1,18 +1,15 @@
1−{ stdenv, pkgconfig, glib }:
1+{ stdenv, meson, ninja, pkgconfig, glib }:
22
33stdenv.mkDerivation {
44 name = "chrootenv";
5+ src = ./.;
56
6− nativeBuildInputs = [ pkgconfig ];
7+ nativeBuildInputs = [ meson ninja pkgconfig ];
78 buildInputs = [ glib ];
89
9− buildCommand = ''
10− cc ${./chrootenv.c} $(pkg-config --cflags --libs glib-2.0) -o $out
11− '';
12−
1310 meta = with stdenv.lib; {
1411 description = "Setup mount/user namespace for FHS emulation";
15− license = licenses.free;
12+ license = licenses.mit;
1613 maintainers = with maintainers; [ yegortimoshenko ];
1714 platforms = platforms.linux;
1815 };
pkgs/build-support/build-fhs-userenv/chrootenv/meson.buildnew file+5
@@ -0,0 +1,5 @@
1+project('chrootenv', 'c')
2+
3+glib = dependency('glib-2.0')
4+
5+executable('chrootenv', 'chrootenv.c', dependencies: [glib], install: true)
pkgs/build-support/build-fhs-userenv/default.nix+2−2
@@ -28,7 +28,7 @@ in runCommand name {
2828 passthru = passthru // {
2929 env = runCommand "${name}-shell-env" {
3030 shellHook = ''
31− exec ${chrootenv} ${init runScript} "$(pwd)"
31+ exec ${chrootenv}/bin/chrootenv ${init runScript} "$(pwd)"
3232 '';
3333 } ''
3434 echo >&2 ""
@@ -41,7 +41,7 @@ in runCommand name {
4141 mkdir -p $out/bin
4242 cat <<EOF >$out/bin/${name}
4343 #! ${stdenv.shell}
44− exec ${chrootenv} ${init runScript} "\$(pwd)" "\$@"
44+ exec ${chrootenv}/bin/chrootenv ${init runScript} "\$(pwd)" "\$@"
4545 EOF
4646 chmod +x $out/bin/${name}
4747 ${extraInstallCommands}