Add package.nix and cleanup build process

This commit is contained in:
2026-07-07 12:09:06 +01:00
parent 2930d71889
commit 10e0de5b05
4 changed files with 88 additions and 7 deletions
+54
View File
@@ -0,0 +1,54 @@
{ stdenv
, ruby
, makeWrapper
, pkg-config
, xorg
, rubyPackages
, gcc
, lib
}:
stdenv.mkDerivation {
pname = "kutu";
version = "0.1.0";
src = ./.;
nativeBuildInputs = [
pkg-config
makeWrapper
gcc
];
buildInputs = [
(ruby.withPackages (ps: [
ps.ffi
]))
xorg.libxcb
xorg.xcbutilwm
xorg.xrandr
xorg.xprop
];
buildPhase = ''
./setup.sh
'';
installPhase = ''
mkdir -p $out/bin
mkdir -p $out/build
mkdir -p $out/src
cp bin/kutu.rb $out/bin/kutu.rb
cp bin/kutu-run.rb $out/bin/kutu-run.rb
cp build/X-kutu.so $out/build/
cp -r src $out/src
wrapProgram $out/bin/kutu.rb \
--prefix PATH : ${lib.makeBinPath [
xorg.xrandr
xorg.xprop
]}
'';
}