2021-01-11 08:54:33 +01:00
|
|
|
{ lib, stdenv, fetchFromGitiles, fetchFromGitHub, fetchurl, trousers, leveldb, unzip
|
2021-01-17 04:51:22 +01:00
|
|
|
, scons, pkg-config, glib, dbus_cplusplus, dbus, protobuf, openssl, snappy, pam
|
2019-12-02 23:29:40 +01:00
|
|
|
}:
|
2015-07-03 22:59:57 +02:00
|
|
|
|
|
|
|
let
|
2019-12-02 23:29:40 +01:00
|
|
|
src_chromebase = fetchFromGitiles {
|
|
|
|
url = "https://chromium.googlesource.com/chromium/src/base";
|
2015-07-03 22:59:57 +02:00
|
|
|
rev = "2dfe404711e15e24e79799516400c61b2719d7af";
|
|
|
|
sha256 = "2bd93a3ace4b6767db2c1bd1e16f426c97b8d2133a9cb15f8372b2516cfa65c5";
|
|
|
|
};
|
|
|
|
|
|
|
|
src_gmock = fetchurl {
|
|
|
|
url = "https://googlemock.googlecode.com/files/gmock-1.7.0.zip";
|
|
|
|
sha256 = "0nq98cpnv2jsx2byp4ilam6kydcnziflkc16ikydajmp4mcvpz16";
|
|
|
|
};
|
|
|
|
|
2019-12-02 23:29:40 +01:00
|
|
|
src_platform2 = fetchFromGitiles {
|
2015-07-03 22:59:57 +02:00
|
|
|
url = "https://chromium.googlesource.com/chromiumos/platform2";
|
|
|
|
rev = "e999e989eaa71c3db7314fc7b4e20829b2b5473b";
|
2017-11-13 19:27:34 +01:00
|
|
|
sha256 = "15n1bsv6r7cny7arx0hdb223xzzbk7vkxg2r7xajhl4nsj39adjh";
|
2015-07-03 22:59:57 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "chaps-0.42-6812";
|
|
|
|
version = "0.42-6812";
|
|
|
|
|
2019-12-02 23:29:40 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "chaps-linux";
|
2015-07-03 22:59:57 +02:00
|
|
|
rev = "989aadc45cdb216ca35b0c97d13fc691576fa1d7";
|
2016-06-02 13:26:44 +02:00
|
|
|
sha256 = "0chk6pnn365d5kcz6vfqx1d0383ksk97icc0lzg0vvb0kvyj0ff1";
|
2015-07-03 22:59:57 +02:00
|
|
|
};
|
|
|
|
|
2019-01-17 10:05:14 +01:00
|
|
|
NIX_CFLAGS_COMPILE = [
|
|
|
|
# readdir_r(3) is deprecated in glibc >= 2.24
|
|
|
|
"-Wno-error=deprecated-declarations"
|
|
|
|
# gcc8 catching polymorphic type error
|
|
|
|
"-Wno-error=catch-value"
|
|
|
|
];
|
2016-08-26 23:46:47 +02:00
|
|
|
|
2015-07-03 22:59:57 +02:00
|
|
|
patches = [ ./fix_absolute_path.patch ./fix_environment_variables.patch ./fix_scons.patch ./insert_prefetches.patch ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace makefile --replace @@NIXOS_SRC_CHROMEBASE@@ ${src_chromebase}
|
|
|
|
substituteInPlace makefile --replace @@NIXOS_SRC_GMOCK@@ ${src_gmock}
|
|
|
|
substituteInPlace makefile --replace @@NIXOS_SRC_PLATFORM2@@ ${src_platform2}
|
|
|
|
substituteInPlace makefile --replace @@NIXOS_LEVELDB@@ ${leveldb}
|
|
|
|
'';
|
|
|
|
|
2021-01-17 04:51:22 +01:00
|
|
|
nativeBuildInputs = [ unzip scons pkg-config ];
|
2015-07-03 22:59:57 +02:00
|
|
|
|
|
|
|
buildInputs = [ trousers glib dbus_cplusplus dbus protobuf openssl snappy leveldb pam ];
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
make build
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp ${name}/out/chapsd $out/bin/.
|
|
|
|
cp ${name}/out/chaps_client $out/bin/.
|
|
|
|
|
|
|
|
mkdir -p $out/lib
|
|
|
|
cp ${name}/out/libchaps.so.* $out/lib/.
|
|
|
|
mkdir -p $out/lib/security
|
|
|
|
cp ${name}/out/pam_chaps.so $out/lib/security/.
|
|
|
|
|
|
|
|
mkdir -p $out/include
|
|
|
|
cp -r ${name}/out/chaps $out/include/.
|
|
|
|
|
|
|
|
mkdir -p $out/etc/dbus-1/system.d
|
|
|
|
cp ${name}/out/org.chromium.Chaps.conf $out/etc/dbus-1/system.d/.
|
|
|
|
mkdir -p $out/etc/dbus-1/system-services
|
|
|
|
cp ${name}/platform2/chaps/org.chromium.Chaps.service $out/etc/dbus-1/system-services/.
|
|
|
|
|
|
|
|
mkdir -p $out/usr/share/pam-configs/chaps
|
|
|
|
mkdir -p $out/usr/share/man/man8
|
|
|
|
cp ${name}/man/* $out/usr/share/man/man8/.
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2015-07-03 22:59:57 +02:00
|
|
|
description = "PKCS #11 implementation based on trusted platform module (TPM)";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.chromium.org/developers/design-documents/chaps-technical-design";
|
2015-07-03 22:59:57 +02:00
|
|
|
maintainers = [ maintainers.tstrobel ];
|
2015-07-22 11:37:38 +02:00
|
|
|
platforms = [ "x86_64-linux" ];
|
2015-07-03 22:59:57 +02:00
|
|
|
license = licenses.bsd3;
|
2017-07-31 22:42:49 +02:00
|
|
|
broken = true; # build failure withn openssl 1.1
|
2015-07-03 22:59:57 +02:00
|
|
|
};
|
|
|
|
}
|