unicap: use stdenv

This replaces use of `builderDefsPackage`. Also fix build.

+24 -46
+24 -46
pkgs/development/libraries/unicap/default.nix
··· 1 - x@{builderDefsPackage 2 - , libusb, libraw1394, dcraw, intltool, perl 3 - , ...}: 4 - builderDefsPackage 5 - (a : 6 - let 7 - helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 8 - []; 1 + { stdenv, fetchurl, libusb, libraw1394, dcraw, intltool, perl, v4l_utils }: 9 2 10 - buildInputs = map (n: builtins.getAttr n x) 11 - (builtins.attrNames (builtins.removeAttrs x helperArgNames)); 12 - sourceInfo = rec { 13 - baseName="libunicap"; 14 - version="0.9.12"; 15 - name="${baseName}-${version}"; 16 - url="http://www.unicap-imaging.org/downloads/${name}.tar.gz"; 17 - hash="05zcnnm4dfc6idihfi0fq5xka6x86zi89wip2ca19yz768sd33s9"; 18 - }; 19 - in 20 - rec { 21 - src = a.fetchurl { 22 - url = sourceInfo.url; 23 - sha256 = sourceInfo.hash; 3 + stdenv.mkDerivation rec { 4 + name = "libunicap-${version}"; 5 + version="0.9.12"; 6 + 7 + src = fetchurl { 8 + url = "http://www.unicap-imaging.org/downloads/${name}.tar.gz"; 9 + sha256 = "05zcnnm4dfc6idihfi0fq5xka6x86zi89wip2ca19yz768sd33s9"; 24 10 }; 25 11 26 - inherit (sourceInfo) name version; 27 - inherit buildInputs; 12 + buildInputs = [ libusb libraw1394 dcraw intltool perl v4l_utils ]; 28 13 29 - /* doConfigure should be removed if not needed */ 30 - phaseNames = ["fixIncludes" "fixMakefiles" "doConfigure" "doMakeInstall"]; 14 + patches = [ 15 + # Debian has a patch that fixes the build. 16 + (fetchurl { 17 + url = "https://sources.debian.net/data/main/u/unicap/0.9.12-2/debian/patches/1009_v4l1.patch"; 18 + sha256 = "1lgypmhdj681m7d1nmzgvh19cz8agj2f31wlnfib0ha8i3g5hg5w"; 19 + }) 20 + ]; 31 21 32 - fixIncludes = a.fullDepEntry ('' 22 + postPatch = '' 33 23 find . -type f -exec sed -e '/linux\/types\.h/d' -i '{}' ';' 34 - '') ["minInit" "doUnpack"]; 35 - 36 - fixMakefiles = a.fullDepEntry ('' 37 24 sed -e 's@/etc/udev@'"$out"'/&@' -i data/Makefile.* 38 - '') ["minInit" "doUnpack"]; 25 + ''; 39 26 40 - meta = { 27 + meta = with stdenv.lib; { 41 28 description = "Universal video capture API"; 42 - maintainers = with a.lib.maintainers; 43 - [ 44 - raskin 45 - ]; 46 - platforms = with a.lib.platforms; 47 - linux; 48 - broken = true; 29 + homepage = http://www.unicap-imaging.org/; 30 + maintainers = [ maintainers.raskin ]; 31 + license = licenses.gpl2Plus; 32 + platforms = platforms.linux; 49 33 }; 50 - passthru = { 51 - updateInfo = { 52 - downloadPage = "http://unicap-imaging.org/download.htm"; 53 - }; 54 - }; 55 - }) x 56 - 34 + }