Hi, i was following this “tutorial” for Packaging existing software with Nix:
I got to the end, but I get this error:
[tux@nixos:~/Documents/nix_projeckts]$ nix-build -A icat
this derivation will be built:
/nix/store/rknvrff07mm81mmlid5la0zri70gw550-icat-v0.5.drv
building ‘/nix/store/rknvrff07mm81mmlid5la0zri70gw550-icat-v0.5.drv’…
Running phase: unpackPhase
unpacking source archive /nix/store/rx21f6fgnmxgp1sw0wbqll9wds4xc6v0-source
source root is source
Running phase: patchPhase
Running phase: updateAutotoolsGnuConfigScriptsPhase
Running phase: configurePhase
no configure script, doing nothing
Running phase: buildPhase
build flags: SHELL=/nix/store/1jzhbwq5rjjaqa75z88ws2b424vh7m53-bash-5.2p32/bin/bash
gcc -c -Wall -pedantic -std=c99 -D_BSD_SOURCE -o icat.o icat.c
In file included from /nix/store/jig62nn8174n4dlk05lqwsvs5wd2c64r-glibc-2.39-52-dev/include/bits/libc-header-start.h:33,
from /nix/store/jig62nn8174n4dlk05lqwsvs5wd2c64r-glibc-2.39-52-dev/include/stdio.h:28,
from icat.c:31:
/nix/store/jig62nn8174n4dlk05lqwsvs5wd2c64r-glibc-2.39-52-dev/include/features.h:196:3: warning: #warning “_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE”
196 | # warning “_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE”
| ^~~~~~~
icat.c: In function ‘main’:
icat.c:319:33: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
319 | write(tempfile, &buf, 1);
| ^~~~~~~~~~~~~~~~~~~~~~~~
gcc -o icat icat.o -lImlib2
Running phase: installPhase
mkdir: cannot create directory ‘/nix/store/amaq46l144p9p72yai6nf1am4rd2b80l-icat-v0.5/bin’: No such file or directory
error: builder for ‘/nix/store/rknvrff07mm81mmlid5la0zri70gw550-icat-v0.5.drv’ failed with exit code 1;
last 23 log lines:
> Running phase: unpackPhase
> unpacking source archive /nix/store/rx21f6fgnmxgp1sw0wbqll9wds4xc6v0-source
> source root is source
> Running phase: patchPhase
> Running phase: updateAutotoolsGnuConfigScriptsPhase
> Running phase: configurePhase
> no configure script, doing nothing
> Running phase: buildPhase
> build flags: SHELL=/nix/store/1jzhbwq5rjjaqa75z88ws2b424vh7m53-bash-5.2p32/bin/bash
> gcc -c -Wall -pedantic -std=c99 -D_BSD_SOURCE -o icat.o icat.c
> In file included from /nix/store/jig62nn8174n4dlk05lqwsvs5wd2c64r-glibc-2.39-52-dev/include/bits/libc-header-start.h:33,
> from /nix/store/jig62nn8174n4dlk05lqwsvs5wd2c64r-glibc-2.39-52-dev/include/stdio.h:28,
> from icat.c:31:
> /nix/store/jig62nn8174n4dlk05lqwsvs5wd2c64r-glibc-2.39-52-dev/include/features.h:196:3: warning: #warning “_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE”
> 196 | # warning “_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE”
> | ^~~~~~~
> icat.c: In function ‘main’:
> icat.c:319:33: warning: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’
> 319 | write(tempfile, &buf, 1);
> | ^~~~~~~~~~~~~~~~~~~~~~~~
> gcc -o icat icat.o -lImlib2
> Running phase: installPhase
> mkdir: cannot create directory ‘/nix/store/amaq46l144p9p72yai6nf1am4rd2b80l-icat-v0.5/bin’: No such file or directory
For full logs, run ‘nix log /nix/store/rknvrff07mm81mmlid5la0zri70gw550-icat-v0.5.drv’.
default.nix
let
nixpkgs = fetchTarball “https://github.com/NixOS/nixpkgs/tarball/nixos-24.05”;
pkgs = import nixpkgs { config = {}; overlays = ; };
in
{
hello = pkgs.callPackage ./hello.nix { };
icat = pkgs.callPackage ./icat.nix { };
}
icat.nix
{
stdenv,
fetchFromGitHub,
imlib2,
xorg,
}:
stdenv.mkDerivation {
pname = “icat”;
version = “v0.5”;
src = fetchFromGitHub {
owner = “atextor”;
repo = “icat”;
rev = “v0.5”;
sha256 = “0wyy2ksxp95vnh71ybj1bbmqd5ggp13x3mk37pzr99ljs9awy8ka”;
};
buildInputs = [ imlib2 xorg.libX11 ];
installPhase = ‘’
runHook preInstall
mkdir - p $out/bin
cp icat $out/bin
runHook postInstall
‘’;
}
Am i doing something wrong?