2023-08-10 07:59:29 +00:00
|
|
|
{ lib, mkDerivation, fetchFromGitHub }:
|
|
|
|
|
|
|
|
mkDerivation rec {
|
|
|
|
pname = "1lab";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "unstable-2024-08-05";
|
2023-08-10 07:59:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2024-09-19 14:19:46 +00:00
|
|
|
owner = "the1lab";
|
2023-08-10 07:59:29 +00:00
|
|
|
repo = pname;
|
2024-09-19 14:19:46 +00:00
|
|
|
rev = "7cc9bf7bbe90be5491e0d64da90a36afa29a540b";
|
|
|
|
hash = "sha256-hOyf6ZzejDAFDRj6liFZsBc9bKdxV5bzTPP4kGXIhW0=";
|
2023-08-10 07:59:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2024-02-07 01:22:34 +00:00
|
|
|
# We don't need anything in support; avoid installing LICENSE.agda
|
2023-08-10 07:59:29 +00:00
|
|
|
rm -rf support
|
2024-02-07 01:22:34 +00:00
|
|
|
|
|
|
|
# Remove verbosity options as they make Agda take longer and use more memory.
|
|
|
|
shopt -s globstar extglob
|
2024-04-21 15:54:59 +00:00
|
|
|
files=(src/**/*.@(agda|lagda.md))
|
|
|
|
sed -Ei '/OPTIONS/s/ -v ?[^ #]+//g' "''${files[@]}"
|
|
|
|
|
|
|
|
# Generate all-pages manually instead of building the build script.
|
|
|
|
mkdir -p _build
|
|
|
|
for f in "''${files[@]}"; do
|
|
|
|
f=''${f#src/} f=''${f%%.*} f=''${f//\//.}
|
|
|
|
echo "open import $f"
|
|
|
|
done > _build/all-pages.agda
|
2023-08-10 07:59:29 +00:00
|
|
|
'';
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
libraryName = "1lab";
|
2023-08-10 07:59:29 +00:00
|
|
|
libraryFile = "1lab.agda-lib";
|
2024-04-21 15:54:59 +00:00
|
|
|
everythingFile = "_build/all-pages.agda";
|
2023-08-10 07:59:29 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description =
|
|
|
|
"A formalised, cross-linked reference resource for mathematics done in Homotopy Type Theory ";
|
|
|
|
homepage = src.meta.homepage;
|
2024-04-21 15:54:59 +00:00
|
|
|
license = licenses.agpl3Only;
|
2023-08-10 07:59:29 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ ncfavier ];
|
|
|
|
};
|
|
|
|
}
|