uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead
https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948 this can do it nicely. Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
commit
56de2bcd43
30691 changed files with 3076956 additions and 0 deletions
51
pkgs/os-specific/linux/libwebcam/default.nix
Normal file
51
pkgs/os-specific/linux/libwebcam/default.nix
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, cmake
|
||||
, pkg-config
|
||||
, libxml2
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "libwebcam";
|
||||
version = "0.2.5";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/project/${pname}/source/${pname}-src-${version}.tar.gz";
|
||||
sha256 = "0hcxv8di83fk41zjh0v592qm7c0v37a3m3n3lxavd643gff1k99w";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./uvcdynctrl_symlink_support_and_take_data_dir_from_env.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [ cmake pkg-config ];
|
||||
buildInputs = [ libxml2 ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace ./uvcdynctrl/CMakeLists.txt \
|
||||
--replace "/lib/udev" "$out/lib/udev"
|
||||
|
||||
substituteInPlace ./uvcdynctrl/udev/scripts/uvcdynctrl \
|
||||
--replace 'debug=0' 'debug=''${NIX_UVCDYNCTRL_UDEV_DEBUG:-0}' \
|
||||
--replace 'uvcdynctrlpath=uvcdynctrl' "uvcdynctrlpath=$out/bin/uvcdynctrl"
|
||||
|
||||
substituteInPlace ./uvcdynctrl/udev/rules/80-uvcdynctrl.rules \
|
||||
--replace "/lib/udev" "$out/lib/udev"
|
||||
'';
|
||||
|
||||
|
||||
preConfigure = ''
|
||||
cmakeFlagsArray=(
|
||||
$cmakeFlagsArray
|
||||
"-DCMAKE_INSTALL_PREFIX=$out"
|
||||
)
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "The webcam-tools package";
|
||||
platforms = platforms.linux;
|
||||
license = licenses.lgpl3;
|
||||
maintainers = with maintainers; [ jraygauthier ];
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,65 @@
|
|||
diff --git a/uvcdynctrl/main.c b/uvcdynctrl/main.c
|
||||
index b7befd1..f3a768c 100644
|
||||
--- a/uvcdynctrl/main.c
|
||||
+++ b/uvcdynctrl/main.c
|
||||
@@ -674,27 +674,31 @@ get_filename (const char *dir_path, const char *vid)
|
||||
printf ( "checking dir: %s \n", dir_path);
|
||||
while ((dp = readdir(dir)) != NULL)
|
||||
{
|
||||
- if((dp->d_type == DT_DIR) && (fnmatch("[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]", dp->d_name, 0) == 0))
|
||||
+ if((dp->d_type == DT_DIR || dp->d_type == DT_LNK ) && (fnmatch("[[:xdigit:]][[:xdigit:]][[:xdigit:]][[:xdigit:]]", dp->d_name, 0) == 0))
|
||||
{
|
||||
if( strcasecmp(vid, dp->d_name) != 0)
|
||||
{
|
||||
/*doesn't match - clean up and move to the next entry*/
|
||||
continue;
|
||||
}
|
||||
-
|
||||
+
|
||||
char *tmp = path_cat (dir_path, dp->d_name);
|
||||
- printf("found dir: %s \n", dp->d_name);
|
||||
+
|
||||
DIR * subdir = opendir(tmp);
|
||||
- while ((sdp = readdir(subdir)) != NULL)
|
||||
+ if ( subdir != NULL )
|
||||
{
|
||||
- if( fnmatch("*.xml", sdp->d_name, 0) == 0 )
|
||||
+ printf("found dir: %s \n", dp->d_name);
|
||||
+ while ((sdp = readdir(subdir)) != NULL)
|
||||
{
|
||||
- file_list[nf-1] = path_cat (tmp, sdp->d_name);
|
||||
- printf("found: %s \n", file_list[nf-1]);
|
||||
- nf++;
|
||||
- file_list = realloc(file_list,nf*sizeof(file_list));
|
||||
- file_list[nf-1] = NULL;
|
||||
- }
|
||||
+ if( fnmatch("*.xml", sdp->d_name, 0) == 0 )
|
||||
+ {
|
||||
+ file_list[nf-1] = path_cat (tmp, sdp->d_name);
|
||||
+ printf("found: %s \n", file_list[nf-1]);
|
||||
+ nf++;
|
||||
+ file_list = realloc(file_list,nf*sizeof(file_list));
|
||||
+ file_list[nf-1] = NULL;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
closedir(subdir);
|
||||
free (tmp);
|
||||
@@ -869,9 +873,15 @@ main (int argc, char **argv)
|
||||
pid_set = 1; /*flag pid.xml check*/
|
||||
//printf("vid:%s pid:%s\n", vid, pid);
|
||||
}
|
||||
-
|
||||
+
|
||||
+ const char* dataDir = getenv( "NIX_UVCDYNCTRL_DATA_DIR" );
|
||||
+ // When unavailable, fallback on data dir specified at build time.
|
||||
+ if ( !dataDir ) {
|
||||
+ dataDir = DATA_DIR;
|
||||
+ }
|
||||
+
|
||||
/* get xml file list from DATA_DIR/vid/ */
|
||||
- char **xml_files = get_filename (DATA_DIR, vid);
|
||||
+ char **xml_files = get_filename (dataDir, vid);
|
||||
|
||||
/*check for pid.xml*/
|
||||
char fname[9];
|
||||
Loading…
Add table
Add a link
Reference in a new issue