dictdDBs.wordnet: fix reproducibility with faketime

This commit is contained in:
Bjørn Forsman 2023-06-22 18:41:42 +02:00
parent fe5f8b9c47
commit e65dc530ba

View File

@ -1,10 +1,10 @@
{lib, stdenv, python3, wordnet, writeScript}:
{lib, stdenv, python3, wordnet, writeScript, libfaketime}:
stdenv.mkDerivation rec {
version = "542";
pname = "dict-db-wordnet";
buildInputs = [python3 wordnet];
buildInputs = [python3 wordnet libfaketime];
convert = ./wordnet_structures.py;
builder = writeScript "builder.sh" ''
@ -16,7 +16,8 @@ stdenv.mkDerivation rec {
DATA="$DATA `echo $i | sed -e s,data,index,` $i";
done
python ${convert} $DATA
source_date=$(date --utc --date=@$SOURCE_DATE_EPOCH "+%F %T")
faketime -f "$source_date" python ${convert} $DATA
echo en_US.UTF-8 > locale
'';