mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-25 12:22:37 +03:00
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 {
|
stdenv.mkDerivation {
|
||||||
name = "chrootenv";
|
name = "chrootenv";
|
||||||
|
src = ./.;
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ meson ninja pkgconfig ];
|
||||||
buildInputs = [ glib ];
|
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; {
|
meta = with stdenv.lib; {
|
||||||
description = "Setup mount/user namespace for FHS emulation";
|
description = "Setup mount/user namespace for FHS emulation";
|
||||||
license = licenses.free;
|
license = licenses.mit;
|
||||||
maintainers = with maintainers; [ yegortimoshenko ];
|
maintainers = with maintainers; [ yegortimoshenko ];
|
||||||
platforms = platforms.linux;
|
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 // {
|
passthru = passthru // {
|
||||||
env = runCommand "${name}-shell-env" {
|
env = runCommand "${name}-shell-env" {
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
exec ${chrootenv} ${init runScript} "$(pwd)"
|
exec ${chrootenv}/bin/chrootenv ${init runScript} "$(pwd)"
|
||||||
'';
|
'';
|
||||||
} ''
|
} ''
|
||||||
echo >&2 ""
|
echo >&2 ""
|
||||||
@ -41,7 +41,7 @@ in runCommand name {
|
|||||||
mkdir -p $out/bin
|
mkdir -p $out/bin
|
||||||
cat <<EOF >$out/bin/${name}
|
cat <<EOF >$out/bin/${name}
|
||||||
#! ${stdenv.shell}
|
#! ${stdenv.shell}
|
||||||
exec ${chrootenv} ${init runScript} "\$(pwd)" "\$@"
|
exec ${chrootenv}/bin/chrootenv ${init runScript} "\$(pwd)" "\$@"
|
||||||
EOF
|
EOF
|
||||||
chmod +x $out/bin/${name}
|
chmod +x $out/bin/${name}
|
||||||
${extraInstallCommands}
|
${extraInstallCommands}
|
||||||
|
Loading…
Reference in New Issue
Block a user