forked from mirrors/nixpkgs
chrootenv: use meson
This commit is contained in:
parent
ccb76eeb3c
commit
cea0e9226f
|
@ -1,19 +1,15 @@
|
|||
{ stdenv, pkgconfig, glib }:
|
||||
{ stdenv, meson, ninja, pkgconfig, glib }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "chrootenv";
|
||||
src = ./.;
|
||||
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
nativeBuildInputs = [ meson ninja pkgconfig ];
|
||||
buildInputs = [ glib ];
|
||||
|
||||
buildCommand = ''
|
||||
cc ${./chrootenv.c} $(pkg-config --cflags --libs glib-2.0) -o $out
|
||||
${stdenv.cc.bintools.bintools}/bin/strip $out
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Setup mount/user namespace for FHS emulation";
|
||||
license = licenses.free;
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ yegortimoshenko ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
project('chrootenv', 'c')
|
||||
|
||||
glib = dependency('glib-2.0')
|
||||
|
||||
executable('chrootenv', 'chrootenv.c', dependencies: [glib], install: true)
|
|
@ -28,7 +28,7 @@ in runCommand name {
|
|||
passthru = passthru // {
|
||||
env = runCommand "${name}-shell-env" {
|
||||
shellHook = ''
|
||||
exec ${chrootenv} ${init runScript} "$(pwd)"
|
||||
exec ${chrootenv}/bin/chrootenv ${init runScript} "$(pwd)"
|
||||
'';
|
||||
} ''
|
||||
echo >&2 ""
|
||||
|
@ -41,7 +41,7 @@ in runCommand name {
|
|||
mkdir -p $out/bin
|
||||
cat <<EOF >$out/bin/${name}
|
||||
#! ${stdenv.shell}
|
||||
exec ${chrootenv} ${init runScript} "\$(pwd)" "\$@"
|
||||
exec ${chrootenv}/bin/chrootenv ${init runScript} "\$(pwd)" "\$@"
|
||||
EOF
|
||||
chmod +x $out/bin/${name}
|
||||
${extraInstallCommands}
|
||||
|
|
Loading…
Reference in a new issue