git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #117242 from OPNA2608/update/libftdi1-1.5/21.05

libftdi1: 1.4 -> 1.5

commitd535600060e15e7fc2a0a396c80af3dc222cbb74 authorRobert Scott <code@humanleg.org.uk> dateSat 3 Apr 2021, 00:17 (6 years ago) parentefef5afcfba508
2 files changed+60−26
pkgs/development/libraries/libftdi/1.x.nix+51−25 pkgs/development/tools/misc/blackmagic/default.nix+9−1
pkgs/development/libraries/libftdi/1.x.nix+51−25
@@ -1,47 +1,73 @@
1−{ lib, stdenv, fetchurl, cmake, pkg-config, libusb1, libconfuse
2−, cppSupport ? true, boost ? null
3−, pythonSupport ? true, python3 ? null, swig ? null
4−, docSupport ? true, doxygen ? null
1+{ lib
2+, stdenv
3+, fetchgit
4+, cmake
5+, pkg-config
6+, libusb1
7+, libconfuse
8+, cppSupport ? true
9+, boost
10+, pythonSupport ? true
11+, python3
12+, swig
13+, docSupport ? true
14+, doxygen
15+, graphviz
516}:
617
7−assert cppSupport -> boost != null;
8−assert pythonSupport -> python3 != null && swig != null;
9−assert docSupport -> doxygen != null;
10−
18+let
19+ inherit (lib) optionals optionalString;
20+ onOff = a: if a then "ON" else "OFF";
21+in
1122stdenv.mkDerivation rec {
12− name = "libftdi1-1.4";
23+ pname = "libftdi";
24+ version = "1.5";
1325
14− src = fetchurl {
15− url = "https://www.intra2net.com/en/developer/libftdi/download/${name}.tar.bz2";
16− sha256 = "0x0vncf6i92slgrn0h7ghkskqbglbs534220qa84d0qg114zndpc";
26+ src = fetchgit {
27+ url = "git://developer.intra2net.com/libftdi";
28+ rev = "v${version}";
29+ sha256 = "0vipg3y0kbbzjhxky6hfyxy42mpqhvwn1r010zr5givcfp8ghq26";
1730 };
1831
19− nativeBuildInputs = [ cmake pkg-config ];
20− buildInputs = with lib; [ libconfuse ]
32+ nativeBuildInputs = [ cmake pkg-config ]
33+ ++ optionals docSupport [ doxygen graphviz ]
34+ ++ optionals pythonSupport [ swig ];
35+
36+ buildInputs = [ libconfuse ]
2137 ++ optionals cppSupport [ boost ]
22− ++ optionals pythonSupport [ python3 swig ]
23− ++ optionals docSupport [ doxygen ];
38+ ++ optionals pythonSupport [ python3 ];
2439
25− preBuild = lib.optionalString docSupport ''
26− make doc_i
27− '';
40+ cmakeFlags = [
41+ "-DFTDIPP=${onOff cppSupport}"
42+ "-DBUILD_TESTS=${onOff cppSupport}"
43+ "-DLINK_PYTHON_LIBRARY=${onOff pythonSupport}"
44+ "-DPYTHON_BINDINGS=${onOff pythonSupport}"
45+ "-DDOCUMENTATION=${onOff docSupport}"
46+ ];
2847
2948 propagatedBuildInputs = [ libusb1 ];
3049
3150 postInstall = ''
3251 mkdir -p "$out/etc/udev/rules.d/"
3352 cp ../packages/99-libftdi.rules "$out/etc/udev/rules.d/"
53+ '' + optionalString docSupport ''
3454 cp -r doc/man "$out/share/"
35− '' + lib.optionalString docSupport ''
36− mkdir -p "$out/share/libftdi/doc/"
37− cp -r doc/html "$out/share/libftdi/doc/"
55+ cp -r doc/html "$out/share/doc/libftdi1/"
56+ '';
57+
58+ postFixup = optionalString cppSupport ''
59+ # This gets misassigned to the C++ version's path for some reason
60+ for fileToFix in $out/{bin/libftdi1-config,lib/pkgconfig/libftdi1.pc}; do
61+ substituteInPlace $fileToFix \
62+ --replace "$out/include/libftdipp1" "$out/include/libftdi1"
63+ done
3864 '';
3965
4066 meta = with lib; {
4167 description = "A library to talk to FTDI chips using libusb";
4268 homepage = "https://www.intra2net.com/en/developer/libftdi/";
43− license = with licenses; [ lgpl2 gpl2 ];
44− platforms = with platforms; linux ++ darwin;
45− maintainers = [ maintainers.bjornfor ];
69+ license = with licenses; [ lgpl2Only gpl2Only ];
70+ platforms = platforms.all;
71+ maintainers = with maintainers; [ bjornfor ];
4672 };
4773}
pkgs/development/tools/misc/blackmagic/default.nix+9−1
@@ -1,4 +1,4 @@
1−{ stdenv, lib, fetchFromGitHub
1+{ stdenv, lib, fetchFromGitHub, fetchpatch
22, gcc-arm-embedded, libftdi1, libusb-compat-0_1, pkg-config
33, python3
44}:
@@ -19,6 +19,14 @@ stdenv.mkDerivation rec {
1919 fetchSubmodules = true;
2020 };
2121
22+ patches = [
23+ # Fix deprecation warning with libftdi 1.5
24+ (fetchpatch {
25+ url = "https://github.com/blacksphere/blackmagic/commit/dea4be2539c5ea63836ec78dca08b52fa8b26ab5.patch";
26+ sha256 = "0f81simij1wdhifsxaavalc6yxzagfbgwry969dbjmxqzvrsrds5";
27+ })
28+ ];
29+
2230 nativeBuildInputs = [
2331 gcc-arm-embedded pkg-config
2432 python3