1{ stdenv, fetchFromGitHub, fetchurl, python2Packages, hexio
2, which, cmake, bash, arpa2cm, git, asn2quickder, pkgconfig }:
3
4stdenv.mkDerivation rec {
5 pname = "quickder";
6 name = "${pname}-${version}";
7 version = "1.2-6";
8
9 src = fetchFromGitHub {
10 sha256 = "00wifjydgmqw2i5vmr049visc3shjqccgzqynkmmhkjhs86ghzr6";
11 rev = "version-${version}";
12 owner = "vanrein";
13 repo = "quick-der";
14 };
15
16 buildInputs = with python2Packages; [
17 arpa2cm
18 asn1ate
19 bash
20 cmake
21 git
22 hexio
23 pyparsing
24 python
25 six
26 which
27 asn1ate
28 asn2quickder
29 pkgconfig
30 ];
31
32 postPatch = ''
33 substituteInPlace ./CMakeLists.txt \
34 --replace "get_version_from_git" "set (Quick-DER_VERSION 1.2) #"
35 substituteInPlace ./CMakeLists.txt \
36 --replace \$\{ARPA2CM_TOOLCHAIN_DIR} "$out/share/ARPA2CM/toolchain/"
37 patchShebangs python/scripts/
38 '';
39
40 cmakeFlags = [
41 "-DNO_TESTING=ON"
42 "-DARPA2CM_TOOLCHAIN_DIR=$out/share/ARPA2CM/toolchain/"
43 "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
44 "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
45 "-DPACKAGE_NO_PACKAGE_REGISTRY=ON"
46 ];
47
48 preConfigure = ''
49 export PREFIX=$out
50 '';
51
52 meta = with stdenv.lib; {
53 description = "Quick (and Easy) DER, a Library for parsing ASN.1";
54 homepage = https://github.com/vanrein/quick-der;
55 license = licenses.bsd2;
56 platforms = platforms.linux;
57 maintainers = with maintainers; [ leenaars ];
58 };
59}