[Nix-dev] x264 snapshot expression, is it the expression or the makefile please?

Tony White tonywhite100 at googlemail.com
Mon Jun 15 22:41:48 CEST 2009


2009/6/15 Lluís Batlle <viriketo at gmail.com>:
> In general you can use "-K" to nix-env or nix-build, and the temp
> directory won't be deleted after an unsuccesful build.
> There you will have a file called "env-vars", which you can source in
> bash, and have the same building environment as the setup scrip had.
> Then you can interactively try to understand what happens.
>
> Regards,
> Lluís.
>
> 2009/6/15 Tony White <tonywhite100 at googlemail.com>:
>> Hi,
>> The x264 snapshot in the x264 expression is over six months old so I
>> decided to try to update it here, I've hit a problem and I don't know
>> what's going wrong. Is anyone able to suggest anything?
>>
>> I have :
>>
>> /etc/nixos/nixpkgs/pkgs/development/libraries/x264/default.nix
>>
>> Like this :
>>
>> args:
>> args.stdenv.mkDerivation rec {
>>  version = "snapshot-20090614-2245";
>>  name = "x264-${version}";
>>
>>  src = args.fetchurl {
>>    url = "ftp://ftp.videolan.org/pub/videolan/x264/snapshots/x264-${version}.tar.bz2";
>>    sha256 = "9ca85cd8c4cfe4e8e0c20e2ec55182a0aa285c788d3588832e33bcf69f1662cf";
>>  };
>>
>>  # buildPhase = "true";
>>  unpackPhase = [ "tar jxvf $src && cd x264-* && echo ''#! $SHELL'' >
>> configure && echo ''#'' > config.mak" ];
>>
>>  # configurePhase = [ "./configure --prefix=$out" ];
>>
>>  configureFlags= if args.stdenv.system == "x86_64-linux" then
>> ["--enable-shared --enable-pic --host=linux"] else ["--enable-shared
>> --host=linux"];
>>
>>  buildInputs =(with args; []);
>>
>>  meta = {
>>      description = "library for encoding H264/AVC video streams";
>>      homepage = http://www.videolan.org/developers/x264.html;
>>      license = "GPL";
>>  };
>> }
>>
>>
>>
>> But the error message is :
>>
>> patching sources
>> configuring
>> configure flags:
>> --prefix=/nix/store/g3cflp5vi0x6bhc463d7rmibj64kdn3q-x264-snapshot-20090614-2245
>> --enable-shared --host=linux
>> building
>> make flags:
>> building .depend
>> rm -f .depend
>> cc   common/mc.c -MT common/mc.o -MM -g0 1>> .depend;  cc
>> common/predict.c -MT common/predict.o -MM -g0 1>> .depend;  cc
>> common/pixel.c -MT common/pixel.o -MM -g0 1>> .depend;  cc
>> common/macroblock.c -MT common/macroblock.o -MM -g0 1>> .depend;  cc
>> common/frame.c -MT common/frame.o -MM -g0 1>> .depend;  cc
>> common/dct.c -MT common/dct.o -MM -g0 1>> .depend;  cc   common/cpu.c
>> -MT common/cpu.o -MM -g0 1>> .depend;  cc   common/cabac.c -MT
>> common/cabac.o -MM -g0 1>> .depend;  cc   common/common.c -MT
>> common/common.o -MM -g0 1>> .depend;  cc   common/mdate.c -MT
>> common/mdate.o -MM -g0 1>> .depend;  cc   common/set.c -MT
>> common/set.o -MM -g0 1>> .depend;  cc   common/quant.c -MT
>> common/quant.o -MM -g0 1>> .depend;  cc   common/vlc.c -MT
>> common/vlc.o -MM -g0 1>> .depend;  cc   encoder/analyse.c -MT
>> encoder/analyse.o -MM -g0 1>> .depend;  cc   encoder/me.c -MT
>> encoder/me.o -MM -g0 1>> .depend;  cc   encoder/ratecontrol.c -MT
>> encoder/ratecontrol.o -MM -g0 1>> .depend;  cc   encoder/set.c -MT
>> encoder/set.o -MM -g0 1>> .depend;  cc   encoder/macroblock.c -MT
>> encoder/macroblock.o -MM -g0 1>> .depend;  cc   encoder/cabac.c -MT
>> encoder/cabac.o -MM -g0 1>> .depend;  cc   encoder/cavlc.c -MT
>> encoder/cavlc.o -MM -g0 1>> .depend;  cc   encoder/encoder.c -MT
>> encoder/encoder.o -MM -g0 1>> .depend;  cc   extras/getopt.c -MT
>> extras/getopt.o -MM -g0 1>> .depend;  cc   x264.c -MT x264.o -MM -g0
>> 1>> .depend;  cc   matroska.c -MT matroska.o -MM -g0 1>> .depend;  cc
>>  muxers.c -MT muxers.o -MM -g0 1>> .depend;
>> In file included from common/mc.c:24:
>> common/common.h:68:18: error: x264.h: No such file or directory
>> In file included from common/predict.c:28:
>> common/common.h:68:18: error: x264.h: No such file or directory
>> In file included from common/pixel.c:24:
>> common/common.h:68:18: error: x264.h: No such file or directory
>> In file included from common/macroblock.c:25:
>> common/common.h:68:18: error: x264.h: No such file or directory
>> common/macroblock.c:26:24: error: encoder/me.h: No such file or
>> directory
>> In file included from common/frame.c:25:
>> common/common.h:68:18: error: x264.h: No such file or directory
>> In file included from common/dct.c:24:
>> common/common.h:68:18: error: x264.h: No such file or directory
>> In file included from common/cpu.c:42:
>> common/common.h:68:18: error: x264.h: No such file or directory
>> In file included from common/cabac.c:24:
>> common/common.h:68:18: error: x264.h: No such file or directory
>> In file included from common/common.c:31:
>> common/common.h:68:18: error: x264.h: No such file or directory
>> In file included from common/mdate.c:29:
>> common/common.h:68:18: error: x264.h: No such file or directory
>> In file included from common/set.c:21:
>> common/common.h:68:18: error: x264.h: No such file or directory
>> In file included from common/quant.c:24:
>> common/common.h:68:18: error: x264.h: No such file or directory
>> In file included from common/vlc.c:21:
>> common/common.h:68:18: error: x264.h: No such file or directory
>> encoder/analyse.c:32:27: error: common/common.h: No such file or
>> directory
>> encoder/analyse.c:33:24: error: common/cpu.h: No such file or
>> directory
>> In file included from encoder/analyse.c:34:
>> encoder/macroblock.h:27:31: error: common/macroblock.h: No such file
>> or directory
>> encoder/me.c:25:27: error: common/common.h: No such file or directory
>> In file included from encoder/me.c:26:
>> encoder/macroblock.h:27:31: error: common/macroblock.h: No such file
>> or directory
>> encoder/ratecontrol.c:33:27: error: common/common.h: No such file or
>> directory
>> encoder/ratecontrol.c:34:24: error: common/cpu.h: No such file or
>> directory
>> encoder/set.c:26:27: error: common/common.h: No such file or directory
>> encoder/set.c:28:20: error: config.h: No such file or directory
>> encoder/macroblock.c:25:27: error: common/common.h: No such file or
>> directory
>> In file included from encoder/macroblock.c:26:
>> encoder/macroblock.h:27:31: error: common/macroblock.h: No such file
>> or directory
>> encoder/cabac.c:25:27: error: common/common.h: No such file or
>> directory
>> In file included from encoder/cabac.c:26:
>> encoder/macroblock.h:27:31: error: common/macroblock.h: No such file
>> or directory
>> encoder/cavlc.c:25:27: error: common/common.h: No such file or
>> directory
>> In file included from encoder/cavlc.c:26:
>> encoder/macroblock.h:27:31: error: common/macroblock.h: No such file
>> or directory
>> encoder/encoder.c:27:27: error: common/common.h: No such file or
>> directory
>> encoder/encoder.c:28:24: error: common/cpu.h: No such file or
>> directory
>> In file included from encoder/encoder.c:33:
>> encoder/macroblock.h:27:31: error: common/macroblock.h: No such file
>> or directory
>> In file included from x264.c:31:
>> common/common.h:68:18: error: x264.h: No such file or directory
>> x264.c:37:20: error: config.h: No such file or directory
>> In file included from muxers.c:24:
>> common/common.h:68:18: error: x264.h: No such file or directory
>> muxers.c:30:20: error: config.h: No such file or directory
>> make: *** [.depend] Error 1
>> builder for `/nix/store/cd3ndwslxgsgl0khsf8xb592sqgcmkn9-x264-snapshot-20090614-2245.drv'
>> failed with exit code 2
>> cannot build derivation
>> `/nix/store/hfraij21v3m8w5lcch5q47m1719a6iq5-system-path.drv': 1
>> dependencies couldn't be built
>> cannot build derivation
>> `/nix/store/bkczf9fbxzf777rxjzskrrnxdlb0fxix-system.drv': 1
>> dependencies couldn't be built
>> error: build of `/nix/store/bkczf9fbxzf777rxjzskrrnxdlb0fxix-system.drv' failed
>>
>> Is my expression causing the problem and does anyone have a solution please?
>>
>> Thanks,
>> Tony
>> _______________________________________________
>> nix-dev mailing list
>> nix-dev at cs.uu.nl
>> https://mail.cs.uu.nl/mailman/listinfo/nix-dev
>>
> _______________________________________________
> nix-dev mailing list
> nix-dev at cs.uu.nl
> https://mail.cs.uu.nl/mailman/listinfo/nix-dev
>

Thanks Lluís,
That was very helpful and I used the method to find out what was going wrong.
It was :

"echo ''#! $SHELL'' > configure"

Which I was trying to use to remove the #! /bin/bash line at the top
of configure because of course, that won't work in stdenv.
I'd like to use something like :

 sed '1s/.*/#! $SHELL/' configure

instead. However I don't know how to escape the special characters
used to wrap the sed arguments.
Is there a way to escape them so that they don't get evaluated?

Or is there a better way to replace #! /bin/bash at the top of a
configure script?
Anything I could use to replace the bash line would work.

Thanks,
Tony



More information about the nix-dev mailing list