2023-08-10 07:59:29 +00:00
|
|
|
{ lib, mkDerivation, fetchFromGitHub }:
|
|
|
|
|
|
|
|
mkDerivation rec {
|
|
|
|
pname = "1lab";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "unstable-2024-03-07";
|
2023-08-10 07:59:29 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "plt-amy";
|
|
|
|
repo = pname;
|
2024-04-21 15:54:59 +00:00
|
|
|
rev = "d698f21793c4815082c94d174b9eafae912abb1a";
|
|
|
|
hash = "sha256-v8avF9zNNz32kLuAacPdEVeUI9rjn6JCiWPzkXfzBS0=";
|
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 ];
|
|
|
|
};
|
|
|
|
}
|