about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/science')
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/astrolabe-generator/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/astrolog/default.nix65
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/calcmysky/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/celestia/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/gildas/aarch64.patch12
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/gildas/clang.patch22
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/gildas/default.nix72
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/gildas/wrapper.patch20
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/gnuastro/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/gpredict/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/gprojector/default.nix52
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/gravit/default.nix57
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/kstars/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/phd2/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/siril/default.nix55
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/stellarium/default.nix104
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/xearth/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/science/astronomy/xplanet/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/science/biology/EZminc/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/science/biology/N3/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/science/biology/angsd/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/science/biology/ants/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/science/biology/aragorn/default.nix53
-rw-r--r--nixpkgs/pkgs/applications/science/biology/astral/default.nix79
-rw-r--r--nixpkgs/pkgs/applications/science/biology/astral/make-deterministic.patch21
-rw-r--r--nixpkgs/pkgs/applications/science/biology/bamtools/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/science/biology/bayescan/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/science/biology/bcftools/default.nix44
-rw-r--r--nixpkgs/pkgs/applications/science/biology/bedops/default.nix63
-rw-r--r--nixpkgs/pkgs/applications/science/biology/bedtools/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/science/biology/bftools/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/science/biology/bioawk/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/science/biology/blast/bin.nix61
-rw-r--r--nixpkgs/pkgs/applications/science/biology/blast/default.nix109
-rw-r--r--nixpkgs/pkgs/applications/science/biology/blast/no_slash_bin.patch178
-rw-r--r--nixpkgs/pkgs/applications/science/biology/bowtie/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/science/biology/bowtie2/default.nix62
-rw-r--r--nixpkgs/pkgs/applications/science/biology/bppsuite/default.nix22
-rw-r--r--nixpkgs/pkgs/applications/science/biology/bwa-mem2/default.nix56
-rw-r--r--nixpkgs/pkgs/applications/science/biology/bwa/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/science/biology/cd-hit/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/science/biology/clustal-omega/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/biology/cmtk/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/science/biology/conglomerate/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/science/biology/dcm2niix/default.nix69
-rw-r--r--nixpkgs/pkgs/applications/science/biology/dcm2niix/dont-fetch-external-libs.patch25
-rw-r--r--nixpkgs/pkgs/applications/science/biology/deeptools/default.nix65
-rw-r--r--nixpkgs/pkgs/applications/science/biology/delly/default.nix70
-rw-r--r--nixpkgs/pkgs/applications/science/biology/diamond/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/science/biology/dssp/default.nix61
-rw-r--r--nixpkgs/pkgs/applications/science/biology/ecopcr/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/science/biology/eggnog-mapper/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/science/biology/emboss/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/science/biology/est-sfs/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/biology/exonerate/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/science/biology/fastp/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/science/biology/febio-studio/default.nix62
-rw-r--r--nixpkgs/pkgs/applications/science/biology/febio-studio/febio-studio-cmake.patch38
-rw-r--r--nixpkgs/pkgs/applications/science/biology/flywheel-cli/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/science/biology/freebayes/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/science/biology/gatk/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/science/biology/genmap/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/science/biology/genmap/gtest.patch30
-rw-r--r--nixpkgs/pkgs/applications/science/biology/hh-suite/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/science/biology/hisat2/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/science/biology/hmmer/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/science/biology/igv/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/science/biology/inormalize/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/science/biology/inormalize/lgmask-interp.patch10
-rw-r--r--nixpkgs/pkgs/applications/science/biology/inormalize/nu_correct_norm-interp.patch10
-rw-r--r--nixpkgs/pkgs/applications/science/biology/iqtree/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/science/biology/itsx/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/science/biology/iv/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/science/biology/jbrowse/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/science/biology/kalign/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/science/biology/kallisto/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/science/biology/kent/default.nix85
-rw-r--r--nixpkgs/pkgs/applications/science/biology/kssd/default.nix57
-rw-r--r--nixpkgs/pkgs/applications/science/biology/last/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/science/biology/macs2/default.nix55
-rw-r--r--nixpkgs/pkgs/applications/science/biology/macse/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/science/biology/mafft/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/science/biology/manta/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/science/biology/megahit/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/science/biology/meme-suite/default.nix21
-rw-r--r--nixpkgs/pkgs/applications/science/biology/messer-slim/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/science/biology/migrate/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/science/biology/minc-tools/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/science/biology/minc-widgets/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/biology/minia/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/science/biology/minia/no-bundle.patch222
-rw-r--r--nixpkgs/pkgs/applications/science/biology/minimap2/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/biology/mmseqs2/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/science/biology/mni_autoreg/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/science/biology/mrbayes/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/science/biology/mrtrix/default.nix112
-rw-r--r--nixpkgs/pkgs/applications/science/biology/muscle/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/science/biology/nest/default.nix86
-rw-r--r--nixpkgs/pkgs/applications/science/biology/neuron/default.nix104
-rw-r--r--nixpkgs/pkgs/applications/science/biology/neuron/neuron_darwin_rpath.patch11
-rw-r--r--nixpkgs/pkgs/applications/science/biology/niftyreg/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/science/biology/niftyseg/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/science/biology/obitools/obitools3.nix36
-rw-r--r--nixpkgs/pkgs/applications/science/biology/octopus/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/science/biology/paml/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/science/biology/picard-tools/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/biology/platypus/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/science/biology/plink-ng/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/science/biology/poretools/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/science/biology/prodigal/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/science/biology/quast/default.nix60
-rw-r--r--nixpkgs/pkgs/applications/science/biology/raxml/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/science/biology/repseek/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/science/biology/sambamba/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/science/biology/samblaster/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/science/biology/samtools/default.nix44
-rw-r--r--nixpkgs/pkgs/applications/science/biology/samtools/samtools-0.1.19-no-curses.patch22
-rw-r--r--nixpkgs/pkgs/applications/science/biology/samtools/samtools_0_1_19.nix34
-rw-r--r--nixpkgs/pkgs/applications/science/biology/seaview/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/science/biology/seqkit/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/science/biology/seqtk/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/science/biology/snpeff/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/science/biology/somatic-sniper/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/science/biology/somatic-sniper/somatic-sniper.patch26
-rw-r--r--nixpkgs/pkgs/applications/science/biology/sortmerna/default.nix50
-rw-r--r--nixpkgs/pkgs/applications/science/biology/spades/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/science/biology/sratoolkit/default.nix56
-rw-r--r--nixpkgs/pkgs/applications/science/biology/stacks/default.nix20
-rw-r--r--nixpkgs/pkgs/applications/science/biology/star/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/science/biology/strelka/default.nix63
-rw-r--r--nixpkgs/pkgs/applications/science/biology/subread/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/science/biology/sumatools/default.nix68
-rw-r--r--nixpkgs/pkgs/applications/science/biology/svaba/default.nix57
-rw-r--r--nixpkgs/pkgs/applications/science/biology/tandem-aligner/default.nix67
-rw-r--r--nixpkgs/pkgs/applications/science/biology/tebreak/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/science/biology/treemix/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/science/biology/trf/default.nix21
-rw-r--r--nixpkgs/pkgs/applications/science/biology/trimal/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/science/biology/trimmomatic/default.nix74
-rw-r--r--nixpkgs/pkgs/applications/science/biology/truvari/default.nix86
-rw-r--r--nixpkgs/pkgs/applications/science/biology/varscan/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/science/biology/vcftools/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/science/biology/veryfasttree/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/science/biology/whisper/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/science/biology/xenomapper/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/apbs/default.nix114
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/autodock-vina/default.nix57
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/autodock-vina/python-bindings.nix56
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/avogadro2/default.nix50
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/chemtool/default.nix57
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/cp2k/default.nix222
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/d-seams/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/dkh/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/element/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/ergoscf/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/ergoscf/math-constants.patch19
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/gwyddion/codegen.patch22
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/gwyddion/default.nix74
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/jmol/default.nix63
-rwxr-xr-xnixpkgs/pkgs/applications/science/chemistry/marvin/LicenseManager.desktop9
-rwxr-xr-xnixpkgs/pkgs/applications/science/chemistry/marvin/MarvinSketch.desktop10
-rwxr-xr-xnixpkgs/pkgs/applications/science/chemistry/marvin/MarvinView.desktop10
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/marvin/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/molden/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/molden/dont_register_file_types.patch29
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/mopac/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/nwchem/default.nix217
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/octopus/default.nix111
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/openmolcas/default.nix158
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/openmolcas/openblasPath.patch12
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/openmolcas/qcmaquis.patch46
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/pymol/default.nix79
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/quantum-espresso/default.nix131
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/siesta/default.nix86
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/wxmacmolplt/default.nix44
-rw-r--r--nixpkgs/pkgs/applications/science/computer-architecture/accelergy/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/science/computer-architecture/qtrvsim/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/science/computer-architecture/timeloop/default.nix103
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/adms/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/alliance/default.nix58
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/appcsxcad/default.nix55
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/archimedes/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/bitscope/common.nix62
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/bitscope/packages.nix146
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/caneda/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/caneda/gcc6.patch13
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/csxcad/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/csxcad/searchPath.patch11
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/dataexplorer/default.nix66
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/degate/default.nix76
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/digital/default.nix68
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/diylc/default.nix78
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/dsview/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/dsview/install.patch23
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/dwfv/default.nix21
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/eagle/eagle.nix81
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/eagle/eagle7_fixer.c134
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/flatcam/default.nix104
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/flopoco/default.nix93
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/fparser/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/fped/default.nix50
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/fritzing/default.nix119
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/gaw/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/geda/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/gerbv/default.nix56
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/gtkwave/0001-Fix-detection-of-quartz-in-gdk-3.0-target.patch40
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/gtkwave/0002-Check-GDK_WINDOWING_X11-macro-when-using-GtkPlug.patch101
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/gtkwave/default.nix52
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix153
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/horizon-eda/base.nix58
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/horizon-eda/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/hyp2mat/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/kicad/addons/default.nix5
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/kicad/addons/kikit.nix52
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/kicad/base.nix210
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/kicad/default.nix292
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/kicad/libraries.nix39
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/kicad/runtime_stock_data_path.patch15
-rwxr-xr-xnixpkgs/pkgs/applications/science/electronics/kicad/update.sh260
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/kicad/versions.nix70
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/kicad/writable.patch49
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/kingstvis/default.nix59
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/lepton-eda/default.nix62
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/librepcb/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/linux-gpib/common.nix24
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/linux-gpib/kernel.nix23
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/linux-gpib/user.nix25
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/magic-vlsi/default.nix55
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/nanovna-saver/default.nix59
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/nvc/default.nix66
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/openboardview/default.nix76
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/openems/default.nix69
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/openhantek6022/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/openroad/0001-Disable-failing-regression-tests.patch83
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/openroad/0002-Ignore-warning-on-stderr.patch41
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/openroad/default.nix133
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/pcb/default.nix68
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/picoscope/default.nix139
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/picoscope/sources.json69
-rwxr-xr-xnixpkgs/pkgs/applications/science/electronics/picoscope/update.py44
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/pulseview/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/qucs-s/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/simulide/default.nix129
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/sv-lang/default.nix75
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/systemc/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/tkgate/1.x.nix43
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/verilator/default.nix61
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/verilog/default.nix80
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/vhd2vl/default.nix52
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/xcircuit/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/xoscope/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/xschem/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/xyce/default.nix190
-rw-r--r--nixpkgs/pkgs/applications/science/engineering/brmodelo/default.nix110
-rw-r--r--nixpkgs/pkgs/applications/science/engineering/jflap/default.nix70
-rw-r--r--nixpkgs/pkgs/applications/science/geometry/antiprism/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/science/geometry/gama/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/science/geometry/tetgen/1.4.nix24
-rw-r--r--nixpkgs/pkgs/applications/science/geometry/tetgen/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/science/logic/abc/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/science/logic/abella/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/science/logic/acgtk/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/science/logic/aiger/default.nix60
-rw-r--r--nixpkgs/pkgs/applications/science/logic/aiger/fix-missing-header.patch11
-rw-r--r--nixpkgs/pkgs/applications/science/logic/alt-ergo/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/science/logic/anders/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/science/logic/aspino/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/science/logic/avy/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/science/logic/avy/glucose-fenv.patch57
-rw-r--r--nixpkgs/pkgs/applications/science/logic/avy/minisat-fenv.patch57
-rw-r--r--nixpkgs/pkgs/applications/science/logic/beluga/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/science/logic/bitwuzla/default.nix70
-rw-r--r--nixpkgs/pkgs/applications/science/logic/boolector/default.nix67
-rw-r--r--nixpkgs/pkgs/applications/science/logic/btor2tools/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/science/logic/cadical/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/science/logic/cbmc/0001-Do-not-download-sources-in-cmake.patch41
-rw-r--r--nixpkgs/pkgs/applications/science/logic/cbmc/default.nix88
-rw-r--r--nixpkgs/pkgs/applications/science/logic/cedille/Fix-to-string.agda-to-compile-with-Agda-2.6.1.patch31
-rw-r--r--nixpkgs/pkgs/applications/science/logic/cedille/default.nix60
-rw-r--r--nixpkgs/pkgs/applications/science/logic/celf/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/science/logic/clprover/clprover.nix28
-rw-r--r--nixpkgs/pkgs/applications/science/logic/coq/default.nix242
-rw-r--r--nixpkgs/pkgs/applications/science/logic/cryptominisat/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/science/logic/cryptoverif/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/science/logic/cubicle/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/science/logic/cvc3/cvc3-2.4.1-gccv6-fix.patch76
-rw-r--r--nixpkgs/pkgs/applications/science/logic/cvc3/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/science/logic/cvc4/cvc4-bash-patsub-replacement.patch39
-rw-r--r--nixpkgs/pkgs/applications/science/logic/cvc4/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/science/logic/cvc4/minisat-fenv.patch65
-rw-r--r--nixpkgs/pkgs/applications/science/logic/cvc5/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/science/logic/dafny/default.nix65
-rw-r--r--nixpkgs/pkgs/applications/science/logic/dafny/deps.nix181
-rw-r--r--nixpkgs/pkgs/applications/science/logic/drat-trim/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/science/logic/easycrypt/default.nix56
-rw-r--r--nixpkgs/pkgs/applications/science/logic/easycrypt/runtest.nix26
-rw-r--r--nixpkgs/pkgs/applications/science/logic/egglog/Cargo.lock1415
-rw-r--r--nixpkgs/pkgs/applications/science/logic/egglog/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/logic/ekrhyper/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/science/logic/elan/0001-dynamically-patchelf-binaries.patch42
-rw-r--r--nixpkgs/pkgs/applications/science/logic/elan/default.nix69
-rw-r--r--nixpkgs/pkgs/applications/science/logic/eprover/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/science/logic/fast-downward/default.nix68
-rw-r--r--nixpkgs/pkgs/applications/science/logic/formula/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/science/logic/formula/nuget.nix111
-rw-r--r--nixpkgs/pkgs/applications/science/logic/gappa/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/science/logic/glucose/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/science/logic/hol/default.nix88
-rw-r--r--nixpkgs/pkgs/applications/science/logic/hol_light/default.nix65
-rw-r--r--nixpkgs/pkgs/applications/science/logic/iprover/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/science/logic/isabelle/components/default.nix5
-rw-r--r--nixpkgs/pkgs/applications/science/logic/isabelle/components/isabelle-linter.nix35
-rw-r--r--nixpkgs/pkgs/applications/science/logic/isabelle/default.nix251
-rw-r--r--nixpkgs/pkgs/applications/science/logic/key/default.nix121
-rw-r--r--nixpkgs/pkgs/applications/science/logic/kissat/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/science/logic/kissat/writable-passwd-is-ok.patch13
-rw-r--r--nixpkgs/pkgs/applications/science/logic/klee/default.nix134
-rw-r--r--nixpkgs/pkgs/applications/science/logic/klee/klee-uclibc.nix101
-rw-r--r--nixpkgs/pkgs/applications/science/logic/lci/default.nix17
-rw-r--r--nixpkgs/pkgs/applications/science/logic/lean/default.nix59
-rw-r--r--nixpkgs/pkgs/applications/science/logic/lean2/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/science/logic/lean4/default.nix68
-rw-r--r--nixpkgs/pkgs/applications/science/logic/leo2/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/science/logic/leo3/binary.nix30
-rw-r--r--nixpkgs/pkgs/applications/science/logic/lingeling/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/science/logic/logisim-evolution/default.nix67
-rw-r--r--nixpkgs/pkgs/applications/science/logic/logisim/default.nix66
-rw-r--r--nixpkgs/pkgs/applications/science/logic/ltl2ba/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/science/logic/mcrl2/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/science/logic/mcy/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/science/logic/metis-prover/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/logic/minisat/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/science/logic/monosat/default.nix100
-rw-r--r--nixpkgs/pkgs/applications/science/logic/msat/default.nix14
-rw-r--r--nixpkgs/pkgs/applications/science/logic/naproche/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/science/logic/netlistsvg/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/science/logic/netlistsvg/package-lock.json9761
-rw-r--r--nixpkgs/pkgs/applications/science/logic/netlistsvg/test.v7
-rw-r--r--nixpkgs/pkgs/applications/science/logic/nuXmv/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/science/logic/nusmv/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/science/logic/open-wbo/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/science/logic/opensmt/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/science/logic/ott/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/science/logic/petrinizer/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/science/logic/picosat/default.nix44
-rw-r--r--nixpkgs/pkgs/applications/science/logic/poly/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/science/logic/potassco/clingcon.nix42
-rw-r--r--nixpkgs/pkgs/applications/science/logic/potassco/clingo.nix26
-rw-r--r--nixpkgs/pkgs/applications/science/logic/prooftree/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/science/logic/prover9/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/science/logic/proverif/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/science/logic/redprl/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/science/logic/satallax/default.nix90
-rw-r--r--nixpkgs/pkgs/applications/science/logic/satallax/fix-declaration-gcc9.patch21
-rw-r--r--nixpkgs/pkgs/applications/science/logic/saw-tools/default.nix59
-rw-r--r--nixpkgs/pkgs/applications/science/logic/sharpsat-td/default.nix83
-rw-r--r--nixpkgs/pkgs/applications/science/logic/spass/default.nix42
-rw-r--r--nixpkgs/pkgs/applications/science/logic/statverif/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/science/logic/stp/default.nix47
-rw-r--r--nixpkgs/pkgs/applications/science/logic/stp/stdint.patch16
-rw-r--r--nixpkgs/pkgs/applications/science/logic/surelog/default.nix75
-rw-r--r--nixpkgs/pkgs/applications/science/logic/symbiyosys/default.nix62
-rw-r--r--nixpkgs/pkgs/applications/science/logic/symfpu/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/science/logic/tamarin-prover/default.nix133
-rw-r--r--nixpkgs/pkgs/applications/science/logic/tlaplus/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/science/logic/tlaplus/tlaplus18.nix39
-rw-r--r--nixpkgs/pkgs/applications/science/logic/tlaplus/tlaps.nix60
-rw-r--r--nixpkgs/pkgs/applications/science/logic/tlaplus/toolbox.nix105
-rw-r--r--nixpkgs/pkgs/applications/science/logic/tptp/default.nix50
-rw-r--r--nixpkgs/pkgs/applications/science/logic/twelf/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/science/logic/uhdm/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/science/logic/vampire/default.nix55
-rw-r--r--nixpkgs/pkgs/applications/science/logic/verifast/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/science/logic/verit/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/science/logic/why3/default.nix76
-rw-r--r--nixpkgs/pkgs/applications/science/logic/why3/with-provers.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/logic/workcraft/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/logic/yices/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/science/logic/yices/linux-no-ldconfig.patch13
-rw-r--r--nixpkgs/pkgs/applications/science/logic/z3/default.nix109
-rw-r--r--nixpkgs/pkgs/applications/science/logic/z3/tptp.nix30
-rw-r--r--nixpkgs/pkgs/applications/science/logic/zchaff/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/science/logic/zchaff/sat_solver.patch12
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/fasttext/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/finalfrontier/default.nix52
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/finalfusion-utils/default.nix55
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/labelimg/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/nengo-gui/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/openbugs/default.nix22
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/sc2-headless/default.nix62
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/sc2-headless/maps.nix63
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/shogun/default.nix208
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/shogun/eigen-3.4.patch74
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/shogun/fix-virtual-destruction.patch20
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/shogun/svmlight-scrubber.patch76
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/starspace/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/uarmsolver/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/vowpal-wabbit/default.nix64
-rw-r--r--nixpkgs/pkgs/applications/science/math/4ti2/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/science/math/LiE/default.nix48
-rw-r--r--nixpkgs/pkgs/applications/science/math/R/default.nix150
-rw-r--r--nixpkgs/pkgs/applications/science/math/R/no-usr-local-search-paths.patch24
-rw-r--r--nixpkgs/pkgs/applications/science/math/R/setup-hook.sh7
-rw-r--r--nixpkgs/pkgs/applications/science/math/adolc/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/science/math/almonds/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/science/math/bcal/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/science/math/bliss/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/science/math/caffe/darwin.patch47
-rw-r--r--nixpkgs/pkgs/applications/science/math/caffe/default.nix162
-rw-r--r--nixpkgs/pkgs/applications/science/math/caffe/python.patch70
-rw-r--r--nixpkgs/pkgs/applications/science/math/calc/default.nix69
-rw-r--r--nixpkgs/pkgs/applications/science/math/calculix/calculix.patch23
-rw-r--r--nixpkgs/pkgs/applications/science/math/calculix/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/science/math/cbc/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/science/math/cemu-ti/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/science/math/clp/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/science/math/colpack/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/science/math/cplex/default.nix88
-rw-r--r--nixpkgs/pkgs/applications/science/math/csdp/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/science/math/dap/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/science/math/ecm/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/science/math/eigenmath/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/science/math/engauge-digitizer/default.nix61
-rw-r--r--nixpkgs/pkgs/applications/science/math/eukleides/default.nix75
-rw-r--r--nixpkgs/pkgs/applications/science/math/eukleides/gs-allowpstransparency.patch10
-rw-r--r--nixpkgs/pkgs/applications/science/math/eukleides/use-CC.patch11
-rw-r--r--nixpkgs/pkgs/applications/science/math/form/default.nix22
-rw-r--r--nixpkgs/pkgs/applications/science/math/fricas/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/science/math/gap/default.nix158
-rw-r--r--nixpkgs/pkgs/applications/science/math/geogebra/default.nix100
-rw-r--r--nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix89
-rw-r--r--nixpkgs/pkgs/applications/science/math/getdp/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/math/gfan/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/science/math/gfan/gfan-0.6.2-cddlib-prefix.patch55
-rw-r--r--nixpkgs/pkgs/applications/science/math/giac/default.nix135
-rw-r--r--nixpkgs/pkgs/applications/science/math/giac/increase-pari-stack-size.patch18
-rw-r--r--nixpkgs/pkgs/applications/science/math/ginac/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/science/math/glsurf/default.nix73
-rw-r--r--nixpkgs/pkgs/applications/science/math/gmsh/default.nix71
-rw-r--r--nixpkgs/pkgs/applications/science/math/gmsh/fix-python.patch50
-rw-r--r--nixpkgs/pkgs/applications/science/math/gretl/default.nix67
-rw-r--r--nixpkgs/pkgs/applications/science/math/gurobi/default.nix57
-rw-r--r--nixpkgs/pkgs/applications/science/math/hmetis/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/science/math/jags/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/science/math/labplot/default.nix107
-rw-r--r--nixpkgs/pkgs/applications/science/math/lp_solve/default.nix68
-rw-r--r--nixpkgs/pkgs/applications/science/math/lrcalc/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/science/math/mathematica/10.nix132
-rw-r--r--nixpkgs/pkgs/applications/science/math/mathematica/11.nix146
-rw-r--r--nixpkgs/pkgs/applications/science/math/mathematica/9.nix118
-rw-r--r--nixpkgs/pkgs/applications/science/math/mathematica/default.nix83
-rw-r--r--nixpkgs/pkgs/applications/science/math/mathematica/generic.nix206
-rw-r--r--nixpkgs/pkgs/applications/science/math/mathematica/versions.nix193
-rw-r--r--nixpkgs/pkgs/applications/science/math/maxima/default.nix118
-rw-r--r--nixpkgs/pkgs/applications/science/math/mpsolve/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/science/math/msieve/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/math/mxnet/default.nix90
-rw-r--r--nixpkgs/pkgs/applications/science/math/nasc/default.nix86
-rw-r--r--nixpkgs/pkgs/applications/science/math/nauty/default.nix50
-rw-r--r--nixpkgs/pkgs/applications/science/math/nota/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/science/math/numworks-epsilon/0001-ion-linux-makerules.patch12
-rw-r--r--nixpkgs/pkgs/applications/science/math/numworks-epsilon/default.nix63
-rw-r--r--nixpkgs/pkgs/applications/science/math/pagsuite/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/science/math/palp/default.nix91
-rw-r--r--nixpkgs/pkgs/applications/science/math/pari/default.nix84
-rw-r--r--nixpkgs/pkgs/applications/science/math/pari/gp2c.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/math/pcalc/default.nix27
-rw-r--r--nixpkgs/pkgs/applications/science/math/perseus/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/science/math/polymake/default.nix83
-rw-r--r--nixpkgs/pkgs/applications/science/math/programmer-calculator/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/science/math/pspp/default.nix58
-rw-r--r--nixpkgs/pkgs/applications/science/math/pynac/default.nix60
-rw-r--r--nixpkgs/pkgs/applications/science/math/qalculate-gtk/default.nix29
-rw-r--r--nixpkgs/pkgs/applications/science/math/qalculate-qt/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/science/math/ratpoints/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/science/math/readstat/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/science/math/ries/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/science/math/ripser/default.nix59
-rw-r--r--nixpkgs/pkgs/applications/science/math/rofi-calc/0001-Patch-plugindir-to-output.patch25
-rw-r--r--nixpkgs/pkgs/applications/science/math/rofi-calc/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/README.md46
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/default.nix177
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/dist-tests.nix17
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/env-locations.nix45
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/patches/disable-slow-glpk-test.patch17
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/patches/linbox-1.7-upgrade.patch58
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch62
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/patches/sympow-cache.patch21
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/python-modules/sage-docbuild.nix34
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/python-modules/sage-setup.nix30
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/sage-env.nix194
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/sage-src.nix97
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/sage-tests.nix61
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/sage-with-env.nix137
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/sage.nix65
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/sagedoc.nix67
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/sagelib.nix216
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/threejs-sage.nix19
-rw-r--r--nixpkgs/pkgs/applications/science/math/scalp/default.nix59
-rw-r--r--nixpkgs/pkgs/applications/science/math/scilab-bin/default.nix103
-rw-r--r--nixpkgs/pkgs/applications/science/math/scotch/default.nix36
-rw-r--r--nixpkgs/pkgs/applications/science/math/singular/default.nix172
-rw-r--r--nixpkgs/pkgs/applications/science/math/speedcrunch/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/science/math/symmetrica/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/science/math/weka/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/math/wolfram-engine/default.nix155
-rw-r--r--nixpkgs/pkgs/applications/science/math/wolfram-engine/l10ns.nix72
-rw-r--r--nixpkgs/pkgs/applications/science/math/wolfram-engine/notebook.nix9
-rw-r--r--nixpkgs/pkgs/applications/science/math/wxmaxima/default.nix55
-rw-r--r--nixpkgs/pkgs/applications/science/math/yacas/default.nix86
-rw-r--r--nixpkgs/pkgs/applications/science/math/yacas/jsoncpp-fix-include.patch63
-rw-r--r--nixpkgs/pkgs/applications/science/math/zegrapher/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/science/medicine/dcmtk/default.nix35
-rw-r--r--nixpkgs/pkgs/applications/science/medicine/xmedcon/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/science/misc/bada-bib/default.nix82
-rw-r--r--nixpkgs/pkgs/applications/science/misc/boinc/default.nix84
-rw-r--r--nixpkgs/pkgs/applications/science/misc/colmap/default.nix54
-rw-r--r--nixpkgs/pkgs/applications/science/misc/convertall/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/science/misc/cwltool/default.nix93
-rw-r--r--nixpkgs/pkgs/applications/science/misc/cytoscape/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/science/misc/cytoscape/gen_vmoptions_to_homedir.patch19
-rw-r--r--nixpkgs/pkgs/applications/science/misc/fityk/default.nix50
-rw-r--r--nixpkgs/pkgs/applications/science/misc/foldingathome/client.nix87
-rw-r--r--nixpkgs/pkgs/applications/science/misc/foldingathome/control.nix57
-rw-r--r--nixpkgs/pkgs/applications/science/misc/foldingathome/viewer.nix56
-rw-r--r--nixpkgs/pkgs/applications/science/misc/gephi/default.nix49
-rw-r--r--nixpkgs/pkgs/applications/science/misc/golly/default.nix52
-rw-r--r--nixpkgs/pkgs/applications/science/misc/gplates/boost-placeholders.patch75
-rw-r--r--nixpkgs/pkgs/applications/science/misc/gplates/default.nix76
-rw-r--r--nixpkgs/pkgs/applications/science/misc/graphia/breakpad-sigstksz.patch13
-rw-r--r--nixpkgs/pkgs/applications/science/misc/graphia/default.nix57
-rw-r--r--nixpkgs/pkgs/applications/science/misc/megam/default.nix65
-rw-r--r--nixpkgs/pkgs/applications/science/misc/megam/ocaml-3.12.patch12
-rw-r--r--nixpkgs/pkgs/applications/science/misc/megam/ocaml-includes.patch21
-rw-r--r--nixpkgs/pkgs/applications/science/misc/netlogo/default.nix60
-rw-r--r--nixpkgs/pkgs/applications/science/misc/nextinspace/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/combined/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/default.nix17
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix101
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/src-main.nix7
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix63
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omedit/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/fakegit.nix49
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/src-libs.nix81
-rwxr-xr-xnixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/update-src-libs.sh39
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/Makefile.in.patch22
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omplot/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omshell/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omsimulator/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmvg/default.nix83
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmvs/default.nix82
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openrefine/default.nix137
-rwxr-xr-xnixpkgs/pkgs/applications/science/misc/openrefine/update.sh20
-rw-r--r--nixpkgs/pkgs/applications/science/misc/reason-shell/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/science/misc/rink/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/science/misc/root/5.nix162
-rw-r--r--nixpkgs/pkgs/applications/science/misc/root/default.nix279
-rw-r--r--nixpkgs/pkgs/applications/science/misc/root/disable_libc_dicts_root5.patch27
-rw-r--r--nixpkgs/pkgs/applications/science/misc/root/purify_include_paths_root5.patch204
-rw-r--r--nixpkgs/pkgs/applications/science/misc/root/root5-python311-fix.patch17
-rw-r--r--nixpkgs/pkgs/applications/science/misc/root/setup-hook.sh19
-rw-r--r--nixpkgs/pkgs/applications/science/misc/root/sw_vers.patch86
-rw-r--r--nixpkgs/pkgs/applications/science/misc/root/sw_vers_root5.patch104
-rw-r--r--nixpkgs/pkgs/applications/science/misc/root/tests/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/misc/root/tests/test-thisroot.nix49
-rw-r--r--nixpkgs/pkgs/applications/science/misc/sasview/default.nix78
-rw-r--r--nixpkgs/pkgs/applications/science/misc/sasview/xhtml2pdf.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/misc/simgrid/default.nix125
-rw-r--r--nixpkgs/pkgs/applications/science/misc/snakemake/default.nix102
-rw-r--r--nixpkgs/pkgs/applications/science/misc/toil/default.nix90
-rw-r--r--nixpkgs/pkgs/applications/science/misc/tulip/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/science/misc/vite/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/molecular-dynamics/dl-poly-classic/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/science/molecular-dynamics/gromacs/default.nix150
-rw-r--r--nixpkgs/pkgs/applications/science/molecular-dynamics/gromacs/pkgconfig.patch24
-rw-r--r--nixpkgs/pkgs/applications/science/molecular-dynamics/lammps/default.nix121
-rw-r--r--nixpkgs/pkgs/applications/science/molecular-dynamics/raspa/data.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/molecular-dynamics/raspa/default.nix79
-rw-r--r--nixpkgs/pkgs/applications/science/molecular-dynamics/viennarna/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/science/networking/sumo/default.nix69
-rw-r--r--nixpkgs/pkgs/applications/science/physics/MCFM/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/physics/crystfel/default.nix242
-rw-r--r--nixpkgs/pkgs/applications/science/physics/crystfel/disable-fmemopen-on-aarch64-darwin.patch13
-rw-r--r--nixpkgs/pkgs/applications/science/physics/crystfel/libccp4-use-hardcoded-syminfo-lib.patch40
-rw-r--r--nixpkgs/pkgs/applications/science/physics/crystfel/link-to-argp-standalone-if-needed.patch26
-rw-r--r--nixpkgs/pkgs/applications/science/physics/dawn/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/science/physics/dawncut/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/science/physics/elmerfem/default.nix63
-rw-r--r--nixpkgs/pkgs/applications/science/physics/fasthenry/default.nix61
-rw-r--r--nixpkgs/pkgs/applications/science/physics/nnpdf/default.nix66
-rw-r--r--nixpkgs/pkgs/applications/science/physics/professor/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/science/physics/quantomatic/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/physics/sacrifice/compat.patch12
-rw-r--r--nixpkgs/pkgs/applications/science/physics/sacrifice/default.nix51
-rw-r--r--nixpkgs/pkgs/applications/science/physics/sacrifice/pythia83xx.patch55
-rw-r--r--nixpkgs/pkgs/applications/science/physics/sherpa/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/science/physics/shtns/default.nix22
-rw-r--r--nixpkgs/pkgs/applications/science/physics/xfitter/0001-src-GetChisquare.f-use-correct-types-in-calls-to-DSY.patch50
-rw-r--r--nixpkgs/pkgs/applications/science/physics/xfitter/default.nix64
-rw-r--r--nixpkgs/pkgs/applications/science/physics/xflr5/default.nix24
-rw-r--r--nixpkgs/pkgs/applications/science/physics/xnec2c/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/science/programming/fdr/default.nix70
-rw-r--r--nixpkgs/pkgs/applications/science/programming/groove/default.nix55
-rw-r--r--nixpkgs/pkgs/applications/science/programming/plm/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/science/robotics/apmplanner2/default.nix43
-rw-r--r--nixpkgs/pkgs/applications/science/robotics/betaflight-configurator/default.nix58
-rw-r--r--nixpkgs/pkgs/applications/science/robotics/emuflight-configurator/default.nix52
-rw-r--r--nixpkgs/pkgs/applications/science/robotics/inav-configurator/default.nix59
-rw-r--r--nixpkgs/pkgs/applications/science/robotics/mavproxy/default.nix39
-rw-r--r--nixpkgs/pkgs/applications/science/robotics/mission-planner/default.nix60
-rw-r--r--nixpkgs/pkgs/applications/science/robotics/mujoco/default.nix188
-rw-r--r--nixpkgs/pkgs/applications/science/robotics/mujoco/mujoco-system-deps-dont-fetch.patch519
-rw-r--r--nixpkgs/pkgs/applications/science/robotics/mujoco/sdflib-system-deps.patch192
-rw-r--r--nixpkgs/pkgs/applications/science/robotics/qgroundcontrol/default.nix82
-rw-r--r--nixpkgs/pkgs/applications/science/robotics/sumorobot-manager/default.nix45
-rw-r--r--nixpkgs/pkgs/applications/science/robotics/yarp/default.nix36
618 files changed, 46641 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/science/astronomy/astrolabe-generator/default.nix b/nixpkgs/pkgs/applications/science/astronomy/astrolabe-generator/default.nix
new file mode 100644
index 000000000000..c58b09889772
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/astrolabe-generator/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, jre, makeWrapper, unzip }:
+
+stdenv.mkDerivation rec {
+  pname = "astrolabe-generator";
+  version = "3.3";
+
+  src = fetchurl {
+    url = "https://github.com/wymarc/astrolabe-generator/releases/download/v${version}/AstrolabeGenerator-${version}.zip";
+    sha256 = "141gfmrqa1mf2qas87qig4phym9fg9gbrcfl2idzd5gi91824dn9";
+  };
+
+  buildInputs = [ jre ];
+  nativeBuildInputs = [ makeWrapper unzip ];
+  sourceRoot = ".";
+
+  installPhase = ''
+    mkdir -p $out/{bin,share/java}
+    cp AstrolabeGenerator-${version}.jar $out/share/java
+
+    makeWrapper ${jre}/bin/java $out/bin/AstrolabeGenerator \
+      --add-flags "-jar $out/share/java/AstrolabeGenerator-${version}.jar"
+  '';
+
+  meta = with lib;{
+    homepage = "https://www.astrolabeproject.com";
+    description = "A Java-based tool for generating EPS files for constructing astrolabes and related tools";
+    sourceProvenance = with sourceTypes; [ binaryBytecode ];
+    license = licenses.gpl3;
+    maintainers = [ ];
+    mainProgram = "AstrolabeGenerator";
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/astrolog/default.nix b/nixpkgs/pkgs/applications/science/astronomy/astrolog/default.nix
new file mode 100644
index 000000000000..7ad05e35e24e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/astrolog/default.nix
@@ -0,0 +1,65 @@
+{ lib, stdenv, fetchzip, fetchurl, xorg
+, withBigAtlas ? true
+, withEphemeris ? true
+, withMoonsEphemeris ? true
+}:
+stdenv.mkDerivation rec {
+  pname = "astrolog";
+  version = "7.30";
+
+  src = fetchzip {
+    url = "http://www.astrolog.org/ftp/ast73src.zip";
+    sha256 = "0nry4gxwy5aa99zzr8dlb6babpachsc3jjyk0vw82c7x3clbhl7l";
+    stripRoot = false;
+  };
+
+  patchPhase = ''
+    sed -i "s:~/astrolog:$out/astrolog:g" astrolog.h
+    substituteInPlace Makefile --replace cc "$CC" --replace strip "$STRIP"
+  '';
+
+  buildInputs = [ xorg.libX11 ];
+  env.NIX_CFLAGS_COMPILE = "-Wno-format-security";
+
+  installPhase =
+  let
+    ephemeris = fetchzip {
+      url = "http://astrolog.org/ftp/ephem/astephem.zip";
+      sha256 = "1mwvpvfk3lxjcc79zvwl4ypqzgqzipnc01cjldxrmx56xkc35zn7";
+      stripRoot = false;
+    };
+    moonsEphemeris = fetchzip {
+      url = "https://www.astrolog.org/ftp/ephem/moons/sepm.zip";
+      sha256 = "0labcidm8mrwvww93nwpp5738m9ff9q48cqzbgd18xny1jf6f8xd";
+      stripRoot = false;
+    };
+    atlas = fetchurl {
+      url = "http://astrolog.org/ftp/atlas/atlasbig.as";
+      sha256 = "001bmqyldsbk4bdliqfl4a9ydrh1ff13wccvfniwaxlmvkridx2q";
+    };
+  in ''
+    mkdir -p $out/bin $out/astrolog
+    cp *.as $out/astrolog
+    install astrolog $out/bin
+    ${lib.optionalString withBigAtlas "cp ${atlas} $out/astrolog/atlas.as"}
+    ${lib.optionalString withEphemeris ''
+      sed -i "/-Yi1/s#\".*\"#\"$out/ephemeris\"#" $out/astrolog/astrolog.as
+      mkdir -p $out/ephemeris
+      cp -r ${ephemeris}/*.se1 $out/ephemeris
+    ''}
+    ${lib.optionalString withMoonsEphemeris ''
+      sed -i "/-Yi1/s#\".*\"#\"$out/ephemeris\"#" $out/astrolog/astrolog.as
+      mkdir -p $out/ephemeris
+      cp -r ${moonsEphemeris}/*.se1 $out/ephemeris
+    ''}
+  '';
+
+  meta = with lib; {
+    maintainers = [ maintainers.kmein ];
+    homepage = "https://astrolog.org/astrolog.htm";
+    description = "Freeware astrology program";
+    mainProgram = "astrolog";
+    platforms = platforms.linux;
+    license = licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/calcmysky/default.nix b/nixpkgs/pkgs/applications/science/astronomy/calcmysky/default.nix
new file mode 100644
index 000000000000..9b7f50415ecd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/calcmysky/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, wrapQtAppsHook
+, glm
+, eigen
+, qtbase
+, stellarium
+}:
+
+stdenv.mkDerivation rec {
+  pname = "calcmysky";
+  version = "0.3.2";
+
+  src = fetchFromGitHub {
+    owner = "10110111";
+    repo = "CalcMySky";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-AP6YkORbvH8PzF869s2OWbTwTfwMC+RLJx3V3BqVy88=";
+  };
+
+  nativeBuildInputs = [ cmake wrapQtAppsHook ];
+  buildInputs = [ glm eigen qtbase ];
+
+  cmakeFlags = [ "-DQT_VERSION=6" ];
+
+  doCheck = true;
+
+  passthru.tests = {
+    inherit stellarium;
+  };
+
+  meta = with lib;{
+    description = "Simulator of light scattering by planetary atmospheres";
+    homepage = "https://github.com/10110111/CalcMySky";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ nickcao ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/celestia/default.nix b/nixpkgs/pkgs/applications/science/astronomy/celestia/default.nix
new file mode 100644
index 000000000000..8b40196fdbff
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/celestia/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, freeglut, gtk2, gtkglext
+, libjpeg_turbo, libtheora, libXmu, lua, libGLU, libGL, perl, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "celestia";
+  version = "1.6.4";
+
+  src = fetchFromGitHub {
+    owner = "CelestiaProject";
+    repo = "Celestia";
+    rev = version;
+    sha256 = "sha256-MkElGo1ZR0ImW/526QlDE1ePd+VOQxwkX7l+0WyZ6Vs=";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+  buildInputs = [
+    freeglut gtk2 gtkglext lua perl
+    libjpeg_turbo libtheora libXmu libGLU libGL
+  ];
+
+  configureFlags = [
+    "--with-gtk"
+    "--with-lua=${lua}"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://celestia.space/";
+    description = "Real-time 3D simulation of space";
+    mainProgram = "celestia";
+    changelog = "https://github.com/CelestiaProject/Celestia/releases/tag/${version}";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ hjones2199 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/gildas/aarch64.patch b/nixpkgs/pkgs/applications/science/astronomy/gildas/aarch64.patch
new file mode 100644
index 000000000000..40696a03dec7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/gildas/aarch64.patch
@@ -0,0 +1,12 @@
+diff -ruN gildas-src-jul18a/admin/define-system.sh gildas-src-jul18a.aarch64/admin/define-system.sh
+--- gildas-src-jul18a/admin/define-system.sh	2018-06-12 15:22:32.000000000 +0200
++++ gildas-src-jul18a.aarch64/admin/define-system.sh	2018-07-21 13:05:52.000000000 +0200
+@@ -174,7 +174,7 @@
+     DEFAULT_CONFIG=          # Default config is empty
+     case `uname` in
+         Linux)
+-            if [ `uname -m | grep -c "x86_64"` -ne 0 ]; then
++            if [ `uname -m | grep -c "64"` -ne 0 ]; then
+         	GAG_MACHINE=x86_64
+             else
+         	GAG_MACHINE=pc
diff --git a/nixpkgs/pkgs/applications/science/astronomy/gildas/clang.patch b/nixpkgs/pkgs/applications/science/astronomy/gildas/clang.patch
new file mode 100644
index 000000000000..4d6654a99aee
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/gildas/clang.patch
@@ -0,0 +1,22 @@
+diff -ruN gildas-src-jun18a/admin/define-system.sh gildas-src-jun18a.clang/admin/define-system.sh
+--- gildas-src-jun18a/admin/define-system.sh	2018-03-12 11:07:57.000000000 +0100
++++ gildas-src-jun18a.clang/admin/define-system.sh	2018-06-12 14:56:14.000000000 +0200
+@@ -218,13 +218,13 @@
+         	else
+         	    GAG_MACHINE=pc
+         	fi
+-                if which gcc > /dev/null 2>&1; then
+-                    DEFAULT_CCOMPILER=gcc
++                if which clang > /dev/null 2>&1; then
++                    DEFAULT_CCOMPILER=clang
+                 fi
+-                if which g++ > /dev/null 2>&1; then
+-                    DEFAULT_CXXCOMPILER=g++
+-                elif which clang++ > /dev/null 2>&1; then
++                if which clang++ > /dev/null 2>&1; then
+                     DEFAULT_CXXCOMPILER=clang++
++                elif which g++ > /dev/null 2>&1; then
++                    DEFAULT_CXXCOMPILER=g++
+                 fi
+         	if which ifort > /dev/null 2>&1; then
+         	    DEFAULT_FCOMPILER=ifort
diff --git a/nixpkgs/pkgs/applications/science/astronomy/gildas/default.nix b/nixpkgs/pkgs/applications/science/astronomy/gildas/default.nix
new file mode 100644
index 000000000000..b5b92bd8fe4f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/gildas/default.nix
@@ -0,0 +1,72 @@
+{ lib, stdenv, fetchurl, gtk2-x11 , pkg-config , python3 , gfortran , lesstif
+, cfitsio , getopt , perl , groff , which, darwin, ncurses
+}:
+
+let
+  python3Env = python3.withPackages(ps: with ps; [ numpy setuptools ]);
+in
+
+stdenv.mkDerivation rec {
+  srcVersion = "aug23a";
+  version = "20230801_a";
+  pname = "gildas";
+
+  src = fetchurl {
+    # For each new release, the upstream developers of Gildas move the
+    # source code of the previous release to a different directory
+    urls = [ "http://www.iram.fr/~gildas/dist/gildas-src-${srcVersion}.tar.xz"
+      "http://www.iram.fr/~gildas/dist/archive/gildas/gildas-src-${srcVersion}.tar.xz" ];
+    sha256 = "sha256-jlyv2K1V+510C4uLek4oofm13d40nGJ46wqjW+tjfq4=";
+  };
+
+  nativeBuildInputs = [ pkg-config groff perl getopt gfortran which ];
+
+  buildInputs = [ gtk2-x11 lesstif cfitsio python3Env ncurses ]
+    ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation ]);
+
+  patches = [ ./wrapper.patch ./clang.patch ./aarch64.patch ];
+
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument";
+
+  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin (with darwin.apple_sdk.frameworks; "-F${CoreFoundation}/Library/Frameworks");
+
+  configurePhase=''
+    substituteInPlace admin/wrapper.sh --replace '%%OUT%%' $out
+    substituteInPlace admin/wrapper.sh --replace '%%PYTHONHOME%%' ${python3Env}
+    substituteInPlace utilities/main/gag-makedepend.pl --replace '/usr/bin/perl' ${perl}/bin/perl
+    source admin/gildas-env.sh -c gfortran -o openmp
+    echo "gag_doc:        $out/share/doc/" >> kernel/etc/gag.dico.lcl
+  '';
+
+  userExec = "astro class greg imager mapping sic";
+
+  postInstall=''
+    mkdir -p $out/bin
+    cp -a ../gildas-exe-${srcVersion}/* $out
+    mv $out/$GAG_EXEC_SYSTEM $out/libexec
+    for i in ${userExec} ; do
+      cp admin/wrapper.sh $out/bin/$i
+      chmod 755 $out/bin/$i
+    done
+  '';
+
+  meta = {
+    description = "Radioastronomy data analysis software";
+    longDescription = ''
+      GILDAS is a collection of state-of-the-art software
+      oriented toward (sub-)millimeter radioastronomical
+      applications (either single-dish or interferometer).
+      It is daily used to reduce all data acquired with the
+      IRAM 30M telescope and Plateau de Bure Interferometer
+      PDBI (except VLBI observations). GILDAS is easily
+      extensible. GILDAS is written in Fortran-90, with a
+      few parts in C/C++ (mainly keyboard interaction,
+      plotting, widgets).'';
+    homepage = "http://www.iram.fr/IRAMFR/GILDAS/gildas.html";
+    license = lib.licenses.free;
+    maintainers = [ lib.maintainers.bzizou lib.maintainers.smaret ];
+    platforms = lib.platforms.all;
+    broken = stdenv.isDarwin && stdenv.isAarch64;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/gildas/wrapper.patch b/nixpkgs/pkgs/applications/science/astronomy/gildas/wrapper.patch
new file mode 100644
index 000000000000..3843937bf1bc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/gildas/wrapper.patch
@@ -0,0 +1,20 @@
+diff --new-file -r -u gildas-src-feb17d.orig/admin/wrapper.sh gildas-src-feb17d/admin/wrapper.sh
+--- gildas-src-feb17d.orig/admin/wrapper.sh	1970-01-01 01:00:00.000000000 +0100
++++ gildas-src-feb17d/admin/wrapper.sh	2017-05-18 21:00:01.660778782 +0200
+@@ -0,0 +1,16 @@
++#!/bin/sh -e
++
++export GAG_ROOT_DIR="%%OUT%%"
++export GAG_PATH="${GAG_ROOT_DIR}/etc"
++export GAG_EXEC_SYSTEM="libexec"
++export GAG_GAG="${HOME}/.gag"
++export PYTHONHOME="%%PYTHONHOME%%"
++if [ -z "\$PYTHONPATH" ]; then
++  PYTHONPATH="${GAG_ROOT_DIR}/${GAG_EXEC_SYSTEM}/python"
++else
++  PYTHONPATH="${GAG_ROOT_DIR}/${GAG_EXEC_SYSTEM}/python:${PYTHONPATH}"
++fi
++export PYTHONPATH
++export LD_LIBRARY_PATH=${GAG_ROOT_DIR}/${GAG_EXEC_SYSTEM}/lib/
++me=`basename $0`
++exec ${GAG_ROOT_DIR}/${GAG_EXEC_SYSTEM}/bin/${me} ${*}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/gnuastro/default.nix b/nixpkgs/pkgs/applications/science/astronomy/gnuastro/default.nix
new file mode 100644
index 000000000000..d1c40d3fefb3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/gnuastro/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, libtool
+, cfitsio, curl, ghostscript, gsl, libgit2, libjpeg, libtiff, lzlib, wcslib }:
+
+stdenv.mkDerivation rec {
+  pname = "gnuastro";
+  version = "0.22";
+
+  src = fetchurl {
+    url = "mirror://gnu/gnuastro/gnuastro-${version}.tar.gz";
+    sha256 = "sha256-f9fxaga95VrtliggkM2SITW+6pAjaeWvgUOJ6rnMcwg=";
+  };
+
+  nativeBuildInputs = [ libtool ];
+
+  buildInputs = [
+    cfitsio
+    curl
+    ghostscript
+    gsl
+    libgit2
+    libjpeg
+    libtiff
+    lzlib
+    wcslib
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "GNU astronomy utilities and library";
+    homepage = "https://www.gnu.org/software/gnuastro/";
+    changelog = "https://git.savannah.gnu.org/cgit/gnuastro.git/plain/NEWS?id=gnuastro_v${version}";
+    license = licenses.gpl3Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ sikmir ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/gpredict/default.nix b/nixpkgs/pkgs/applications/science/astronomy/gpredict/default.nix
new file mode 100644
index 000000000000..56c5a92460dd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/gpredict/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, intltool
+, gtk3, glib, curl, goocanvas2, gpsd
+, hamlib, wrapGAppsHook
+}:
+
+let
+  version = "2.2.1";
+in stdenv.mkDerivation {
+  pname = "gpredict";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://github.com/csete/gpredict/releases/download/v${version}/gpredict-${version}.tar.bz2";
+    sha256 = "0hwf97kng1zy8rxyglw04x89p0bg07zq30hgghm20yxiw2xc8ng7";
+  };
+
+  patches = [
+    # Pull upstream fix for -fno-common toolchains:
+    #   https://github.com/csete/gpredict/issues/195
+    (fetchpatch {
+      name = "fno-common.patch";
+      url = "https://github.com/csete/gpredict/commit/c565bb3d48777bfe17114b5d01cd81150521f056.patch";
+      sha256 = "1jhy9hpqlachq32bkij60q3dxkgi1kkr80rm29jjxqpmambf406a";
+    })
+  ];
+
+  nativeBuildInputs = [ pkg-config intltool wrapGAppsHook ];
+  buildInputs = [ curl glib gtk3 goocanvas2 gpsd hamlib ];
+
+  meta = with lib; {
+    description = "Real time satellite tracking and orbit prediction";
+    mainProgram = "gpredict";
+    longDescription = ''
+      Gpredict is a real time satellite tracking and orbit prediction program
+      written using the GTK widgets. Gpredict is targetted mainly towards ham radio
+      operators but others interested in satellite tracking may find it useful as
+      well. Gpredict uses the SGP4/SDP4 algorithms, which are compatible with the
+      NORAD Keplerian elements.
+    '';
+    license = licenses.gpl2Only;
+    platforms = platforms.linux;
+    homepage = "http://gpredict.oz9aec.net/";
+    maintainers = [ maintainers.markuskowa maintainers.cmcdragonkai ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/gprojector/default.nix b/nixpkgs/pkgs/applications/science/astronomy/gprojector/default.nix
new file mode 100644
index 000000000000..ec05733374e0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/gprojector/default.nix
@@ -0,0 +1,52 @@
+{ stdenvNoCC
+, lib
+, fetchzip
+, jre
+, makeDesktopItem
+, copyDesktopItems
+, makeWrapper
+, extraJavaArgs ? "-Xms512M -Xmx2000M"
+}:
+
+stdenvNoCC.mkDerivation rec {
+  pname = "gprojector";
+  version = "3.1.0";
+
+  src = fetchzip {
+    url = "https://www.giss.nasa.gov/tools/gprojector/download/G.ProjectorJ-${version}.tgz";
+    sha256 = "sha256-cMmjyitetXxQzfSBh5ry5tIsLWOnBaaYOD1eQg1IX+w=";
+  };
+
+  desktopItems = [ (makeDesktopItem {
+    name = "gprojector";
+    exec = "gprojector";
+    desktopName = "G.Projector";
+    comment = meta.description;
+    categories = [ "Science" ];
+    startupWMClass = "gov-nasa-giss-projector-GProjector";
+  }) ];
+
+  buildInputs = [ jre ];
+  nativeBuildInputs = [ makeWrapper copyDesktopItems ];
+
+  dontConfigure = true;
+  dontBuild = true;
+  dontFixup = true;
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/share
+    cp -r $src/jars $out/share/java
+    makeWrapper ${jre}/bin/java $out/bin/gprojector --add-flags "-jar $out/share/java/G.Projector.jar" --add-flags "${extraJavaArgs}"
+    runHook postInstall
+  '';
+
+  meta = {
+    description = "G.Projector transforms an input map image into any of about 200 global and regional map projections";
+    homepage = "https://www.giss.nasa.gov/tools/gprojector/";
+    sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
+    maintainers = with lib.maintainers; [ alyaeanyx ];
+    license = lib.licenses.unfree;
+    inherit (jre.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/gravit/default.nix b/nixpkgs/pkgs/applications/science/astronomy/gravit/default.nix
new file mode 100644
index 000000000000..36f58d8d18a1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/gravit/default.nix
@@ -0,0 +1,57 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, SDL, SDL_ttf, SDL_image, libSM, libICE, libGLU, libGL, libpng, lua5, autoconf, automake }:
+
+stdenv.mkDerivation rec {
+  pname = "gravit";
+  version = "0.5.1";
+
+  src = fetchFromGitHub {
+    owner = "gak";
+    repo = pname;
+    rev = version;
+    hash = "sha256-JuqnLLD5+Ec8kQI0SK98V1O6TTbGM6+yKn5KCHe85eM=";
+  };
+
+  patches = [
+    # Pull fix pending upstream inclusion for -fno-common toolchains:
+    #   https://github.com/gak/gravit/pull/100
+    (fetchpatch {
+      name = "fno-common.patch";
+      url = "https://github.com/gak/gravit/commit/0f848834889212f16201fd404d2d5b9bb5b47d23.patch";
+      hash = "sha256-k1aMIg7idMt53o6dFgIKJflOMp0Jp5NwgWEijcIwXrQ=";
+    })
+  ];
+
+  buildInputs = [ libGLU libGL SDL SDL_ttf SDL_image lua5 libpng libSM libICE ];
+
+  nativeBuildInputs = [ autoconf automake ];
+
+  preConfigure = ''
+    ./autogen.sh
+
+    # Build fails on Linux with windres.
+    export ac_cv_prog_WINDRES=
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    broken = (stdenv.isLinux && stdenv.isAarch64);
+    homepage = "https://github.com/gak/gravit";
+    description = "Beautiful OpenGL-based gravity simulator";
+    mainProgram = "gravit";
+    license = lib.licenses.gpl2Plus;
+
+    longDescription = ''
+      Gravit is a gravity simulator which runs under Linux, Windows and
+      macOS. It uses Newtonian physics using the Barnes-Hut N-body
+      algorithm. Although the main goal of Gravit is to be as accurate
+      as possible, it also creates beautiful looking gravity patterns.
+      It records the history of each particle so it can animate and
+      display a path of its travels. At any stage you can rotate your
+      view in 3D and zoom in and out.
+    '';
+
+    platforms = lib.platforms.mesaPlatforms;
+    hydraPlatforms = lib.platforms.linux; # darwin times out
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/kstars/default.nix b/nixpkgs/pkgs/applications/science/astronomy/kstars/default.nix
new file mode 100644
index 000000000000..ab141666c0aa
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/kstars/default.nix
@@ -0,0 +1,54 @@
+{
+  lib, mkDerivation, extra-cmake-modules, fetchurl,
+
+  kconfig, kdoctools, kguiaddons, ki18n, kinit, kiconthemes, kio,
+  knewstuff, kplotting, kwidgetsaddons, kxmlgui, knotifyconfig,
+
+
+  qtx11extras, qtwebsockets, qtkeychain, libsecret,
+
+  eigen, zlib,
+
+  cfitsio, indi-full, xplanet, libnova, libraw, gsl, wcslib, stellarsolver
+}:
+
+mkDerivation rec {
+  pname = "kstars";
+  version = "3.6.7";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/kstars/kstars-${version}.tar.xz";
+    sha256 = "sha256-uEgzvhlHHpXyvi3Djfwg3GmYeZq+r48m7OJFIDARpe4=";
+  };
+
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+  buildInputs = [
+    kconfig kdoctools kguiaddons ki18n kinit kiconthemes kio
+    knewstuff kplotting kwidgetsaddons kxmlgui knotifyconfig
+
+    qtx11extras qtwebsockets qtkeychain libsecret
+
+    eigen zlib
+
+    cfitsio indi-full xplanet libnova libraw gsl wcslib stellarsolver
+  ];
+
+  cmakeFlags = [
+    "-DINDI_PREFIX=${indi-full}"
+    "-DXPLANET_PREFIX=${xplanet}"
+  ];
+
+  meta = with lib; {
+    description = "Virtual planetarium astronomy software";
+    mainProgram = "kstars";
+    homepage = "https://kde.org/applications/education/org.kde.kstars";
+    longDescription = ''
+      It provides an accurate graphical simulation of the night sky, from any location on Earth, at any date and time.
+      The display includes up to 100 million stars, 13.000 deep-sky objects, all 8 planets, the Sun and Moon, and thousands of comets, asteroids, supernovae, and satellites.
+      For students and teachers, it supports adjustable simulation speeds in order to view phenomena that happen over long timescales, the KStars Astrocalculator to predict conjunctions, and many common astronomical calculations.
+    '';
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ timput hjones2199 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/phd2/default.nix b/nixpkgs/pkgs/applications/science/astronomy/phd2/default.nix
new file mode 100644
index 000000000000..9c66df83dd4b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/phd2/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, cmake, gtk3, wxGTK32
+, curl, gettext, glib, indi-full, libnova, wrapGAppsHook }:
+
+stdenv.mkDerivation rec {
+  pname = "phd2";
+  version = "2.6.13";
+
+  src = fetchFromGitHub {
+    owner = "OpenPHDGuiding";
+    repo = "phd2";
+    rev = "v${version}";
+    sha256 = "sha256-GnT/tyk975caqESBSu4mdX5IWGi5O+RljLSd+CwoGWo=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    gtk3
+    wxGTK32
+    curl
+    gettext
+    glib
+    indi-full
+    libnova
+  ];
+
+  cmakeFlags = [
+    "-DOPENSOURCE_ONLY=1"
+  ];
+
+  # Fix broken wrapped name scheme by moving wrapped binary to where wrapper expects it
+  postFixup = ''
+    mv $out/bin/.phd2.bin-wrapped $out/bin/.phd2-wrapped.bin
+  '';
+
+  meta = with lib; {
+    homepage = "https://openphdguiding.org/";
+    description = "Telescope auto-guidance application";
+    changelog = "https://github.com/OpenPHDGuiding/phd2/releases/tag/v${version}";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ hjones2199 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/siril/default.nix b/nixpkgs/pkgs/applications/science/astronomy/siril/default.nix
new file mode 100644
index 000000000000..255927d893d2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/siril/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv, fetchFromGitLab, fetchpatch, pkg-config, meson, ninja, cmake
+, git, criterion, gtk3, libconfig, gnuplot, opencv, json-glib
+, fftwFloat, cfitsio, gsl, exiv2, librtprocess, wcslib, ffmpeg
+, libraw, libtiff, libpng, libjpeg, libheif, ffms, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "siril";
+  version = "1.2.0";
+
+  src = fetchFromGitLab {
+    owner = "free-astro";
+    repo = "siril";
+    rev = version;
+    hash = "sha256-lCoFQ7z6cZbyNPEm5s40DNdvTwFonHK3KCd8RniqQWs=";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "siril-1.2-exiv2-0.28.patch";
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sci-astronomy/siril/files/siril-1.2-exiv2-0.28.patch?id=002882203ad6a2b08ce035a18b95844a9f4b85d0";
+      hash = "sha256-R1yslW6hzvJHKo0/IqBxkCuqcX6VrdRSz68gpAExxVE=";
+    })
+  ];
+
+  nativeBuildInputs = [
+    meson ninja cmake pkg-config git criterion wrapGAppsHook
+  ];
+
+  buildInputs = [
+    gtk3 cfitsio gsl exiv2 gnuplot opencv fftwFloat librtprocess wcslib
+    libconfig libraw libtiff libpng libjpeg libheif ffms ffmpeg json-glib
+  ];
+
+  # Necessary because project uses default build dir for flatpaks/snaps
+  dontUseMesonConfigure = true;
+  dontUseCmakeConfigure = true;
+
+  configureScript = ''
+    ${meson}/bin/meson --buildtype release nixbld .
+  '';
+
+  postConfigure = ''
+    cd nixbld
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.siril.org/";
+    description = "Astrophotographic image processing tool";
+    license = licenses.gpl3Plus;
+    changelog = "https://gitlab.com/free-astro/siril/-/blob/HEAD/ChangeLog";
+    maintainers = with maintainers; [ hjones2199 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/stellarium/default.nix b/nixpkgs/pkgs/applications/science/astronomy/stellarium/default.nix
new file mode 100644
index 000000000000..59472c4b25ce
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/stellarium/default.nix
@@ -0,0 +1,104 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, perl
+, wrapGAppsHook
+, wrapQtAppsHook
+, qtbase
+, qtcharts
+, qtpositioning
+, qtmultimedia
+, qtserialport
+, qtwayland
+, qtwebengine
+, calcmysky
+, qxlsx
+, indilib
+, libnova
+, qttools
+, exiv2
+, nlopt
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "stellarium";
+  version = "23.4";
+
+  src = fetchFromGitHub {
+    owner = "Stellarium";
+    repo = "stellarium";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-rDqDs6sFaZQbqJcCRhY5w8sFM2mYHHvw0Ud2Niimg4Y=";
+  };
+
+  patches = [
+    # Compatibility with INDI 2.0 series from https://github.com/Stellarium/stellarium/pull/3269
+    (fetchpatch {
+      url = "https://github.com/Stellarium/stellarium/commit/31fd7bebf33fa710ce53ac8375238a24758312bc.patch";
+      hash = "sha256-eJEqqitZgtV6noeCi8pDBYMVTFIVWXZU1fiEvoilX8o=";
+    })
+  ];
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace CMakeLists.txt \
+      --replace 'SET(CMAKE_INSTALL_PREFIX "''${PROJECT_BINARY_DIR}/Stellarium.app/Contents")' \
+                'SET(CMAKE_INSTALL_PREFIX "${placeholder "out"}/Applications/Stellarium.app/Contents")'
+    substituteInPlace src/CMakeLists.txt \
+      --replace "\''${_qt_bin_dir}/../" "${qtmultimedia}/lib/qt-6/"
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    perl
+    wrapGAppsHook
+    wrapQtAppsHook
+    qttools
+  ];
+
+  buildInputs = [
+    qtbase
+    qtcharts
+    qtpositioning
+    qtmultimedia
+    qtserialport
+    qtwebengine
+    calcmysky
+    qxlsx
+    indilib
+    libnova
+    exiv2
+    nlopt
+  ] ++ lib.optionals stdenv.isLinux [
+    qtwayland
+  ];
+
+  preConfigure = ''
+    export SOURCE_DATE_EPOCH=$(date -d 20${lib.versions.major finalAttrs.version}0101 +%s)
+  '' + lib.optionalString stdenv.isDarwin ''
+    export LC_ALL=en_US.UTF-8
+  '';
+
+  # fatal error: 'QtSerialPort/QSerialPortInfo' file not found
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-F${qtserialport}/lib";
+
+  dontWrapGApps = true;
+
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    makeWrapper $out/Applications/Stellarium.app/Contents/MacOS/Stellarium $out/bin/stellarium
+  '';
+
+  preFixup = ''
+    qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
+  '';
+
+  meta =  {
+    description = "Free open-source planetarium";
+    mainProgram = "stellarium";
+    homepage = "https://stellarium.org/";
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ kilianar ];
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/astronomy/xearth/default.nix b/nixpkgs/pkgs/applications/science/astronomy/xearth/default.nix
new file mode 100644
index 000000000000..6123f277fd12
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/xearth/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, imake, gccmakedep, libXt, libXext }:
+
+stdenv.mkDerivation rec {
+  pname = "xearth";
+  version = "1.1";
+
+  src = fetchurl {
+    url = "http://xearth.org/${pname}-${version}.tar.gz";
+    sha256 = "bcb1407cc35b3f6dd3606b2c6072273b6a912cbd9ed1ae22fb2d26694541309c";
+  };
+
+  nativeBuildInputs = [ imake gccmakedep ];
+  buildInputs = [ libXt libXext ];
+
+  installFlags = [ "DESTDIR=$(out)/" "BINDIR=bin" "MANDIR=man/man1"];
+  installTargets = [ "install" "install.man" ];
+
+  meta = with lib; {
+    description = "sets the X root window to an image of the Earth";
+    mainProgram = "xearth";
+    homepage = "https://xearth.org";
+    longDescription =
+      '' Xearth  sets  the X root window to an image of the Earth, as seen from your favorite vantage point in space,
+         correctly shaded for the current position of the Sun.
+         By default, xearth updates the displayed image every  five  minutes.
+      '';
+    maintainers = [ maintainers.mafo ];
+    license  = {
+      fullName = "xearth license";
+      url = "https://xearth.org/copyright.html";
+      free = true;
+    };
+    platforms=platforms.unix;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/science/astronomy/xplanet/default.nix b/nixpkgs/pkgs/applications/science/astronomy/xplanet/default.nix
new file mode 100644
index 000000000000..677bc0cdf077
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/astronomy/xplanet/default.nix
@@ -0,0 +1,39 @@
+{lib, stdenv, fetchurl, fetchpatch, pkg-config, freetype, pango, libpng, libtiff
+, giflib, libjpeg, netpbm}:
+
+stdenv.mkDerivation rec {
+  pname = "xplanet";
+  version = "1.3.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xplanet/${pname}-${version}.tar.gz";
+    sha256 = "1rzc1alph03j67lrr66499zl0wqndiipmj99nqgvh9xzm1qdb023";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ freetype pango libpng libtiff giflib libjpeg netpbm ];
+
+  patches = [
+    (fetchpatch {
+      name = "giflib6.patch";
+      url = "https://raw.githubusercontent.com/archlinux/svntogit-community/ce6f25eb369dc011161613894f01fd0a6ae85a09/trunk/giflib6.patch";
+      sha256 = "173l0xkqq0v2bpaff7hhwc7y2aw5cclqw8988k1nalhyfbrjb8bl";
+    })
+    (fetchpatch {
+      name = "xplanet-c++11.patch";
+      url = "https://raw.githubusercontent.com/archlinux/svntogit-community/ce6f25eb369dc011161613894f01fd0a6ae85a09/trunk/xplanet-c++11.patch";
+      sha256 = "0vldai78ixw49bxch774pps6pq4sp0p33qvkvxywcz7p8kzpg8q2";
+    })
+  ];
+
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
+
+  meta = with lib; {
+    description = "Renders an image of the earth or other planets into the X root window";
+    mainProgram = "xplanet";
+    homepage = "https://xplanet.sourceforge.net";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ lassulus sander ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/EZminc/default.nix b/nixpkgs/pkgs/applications/science/biology/EZminc/default.nix
new file mode 100644
index 000000000000..a4bb8c62f1c4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/EZminc/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libminc, bicpl, itk, fftwFloat, gsl }:
+
+stdenv.mkDerivation rec {
+  pname = "EZminc";
+  version = "unstable-2019-03-12";
+
+  src = fetchFromGitHub {
+    owner  = "BIC-MNI";
+    repo   = pname;
+    rev    = "5e3333ee356f914d34d66d33ea8df809c7f7fa51";
+    sha256 = "0wy8cppf5xpgfqvgb3mqs1cjh81n6qzkk6zxv29wvng8nar9wsy4";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ itk libminc bicpl fftwFloat gsl ];
+
+  cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/cmake"
+                 "-DEZMINC_BUILD_TOOLS=TRUE"
+                 "-DEZMINC_BUILD_MRFSEG=TRUE"
+                 "-DEZMINC_BUILD_DD=TRUE" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/BIC-MNI/${pname}";
+    description = "Collection of Perl and shell scripts for processing MINC files";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license = licenses.free;
+    broken = true;  # ITK5 compatibility issue (https://github.com/BIC-MNI/EZminc/issues/15)
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/N3/default.nix b/nixpkgs/pkgs/applications/science/biology/N3/default.nix
new file mode 100644
index 000000000000..e7ae8fb3cea3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/N3/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper,
+  perlPackages,
+  libminc, ebtks }:
+
+stdenv.mkDerivation rec {
+  pname = "N3";
+  version = "unstable-2018-08-09";
+
+  src = fetchFromGitHub {
+    owner  = "BIC-MNI";
+    repo   = pname;
+    rev    = "010fc2ac58ce1d67b8e6a863fac0809d3203cb9b";
+    sha256 = "06hci7gzhy8p34ggvx7gah2k9yxpwhgmq1cgw8pcd1r82g4rg6kd";
+  };
+
+  postPatch = ''
+    substituteInPlace src/VolumeHist/DHistogram.cc \
+      --replace "register " ""
+  '';
+
+  nativeBuildInputs = [ cmake makeWrapper ];
+  buildInputs = [ libminc ebtks ];
+  propagatedBuildInputs = with perlPackages; [ perl MNI-Perllib GetoptTabular ];
+
+  cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/cmake" "-DEBTKS_DIR=${ebtks}/lib/" ];
+
+  postFixup = ''
+    for p in $out/bin/*; do
+      wrapProgram $p --prefix PERL5LIB : $PERL5LIB
+    done
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/BIC-MNI/N3";
+    description = "MRI non-uniformity correction for MINC files";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license   = licenses.free;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/angsd/default.nix b/nixpkgs/pkgs/applications/science/biology/angsd/default.nix
new file mode 100644
index 000000000000..71366dc0d364
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/angsd/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, htslib
+, zlib
+, bzip2
+, xz
+, curl
+, openssl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "angsd";
+  version = "0.940";
+
+  src = fetchFromGitHub {
+    owner = "ANGSD";
+    repo = "angsd";
+    sha256 = "sha256-Ppxgy54pAnqJUzNX5c12NHjKTQyEEcPSpCEEVOyZ/LA=";
+    rev = version;
+  };
+
+  patches = [
+    # Pull pending inclusion upstream patch for parallel buil fixes:
+    #   https://github.com/ANGSD/angsd/pull/590
+    (fetchpatch {
+      name = "parallel-make.patch";
+      url = "https://github.com/ANGSD/angsd/commit/89fd1d898078016df390e07e25b8a3eeadcedf43.patch";
+      hash = "sha256-KQgUfr3v8xc+opAm4qcSV2eaupztv4gzJJHyzJBCxqA=";
+    })
+  ];
+
+  buildInputs = [ htslib zlib bzip2 xz curl openssl ];
+
+  enableParallelBuilding = true;
+
+  makeFlags = [ "HTSSRC=systemwide" "prefix=$(out)" ];
+
+  meta = with lib; {
+    description = "Program for analysing NGS data";
+    homepage = "http://www.popgen.dk/angsd";
+    maintainers = [ maintainers.bzizou ];
+    license = licenses.gpl2;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/science/biology/ants/default.nix b/nixpkgs/pkgs/applications/science/biology/ants/default.nix
new file mode 100644
index 000000000000..c7a1391c3007
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/ants/default.nix
@@ -0,0 +1,54 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, makeBinaryWrapper
+, itk
+, vtk
+, Cocoa
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "ANTs";
+  version = "2.5.1";
+
+  src = fetchFromGitHub {
+    owner = "ANTsX";
+    repo = "ANTs";
+    rev = "refs/tags/v${finalAttrs.version}";
+    hash = "sha256-q252KC6SKUN5JaQWAcsVmDprVkLXDvkYzNhC7yHJNpk=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    makeBinaryWrapper
+  ];
+
+  buildInputs = [
+    itk
+    vtk
+  ] ++ lib.optionals stdenv.isDarwin [
+    Cocoa
+  ];
+
+  cmakeFlags = [
+    "-DANTS_SUPERBUILD=FALSE"
+    "-DUSE_VTK=TRUE"
+  ];
+
+  postInstall = ''
+    for file in $out/bin/*; do
+      wrapProgram $file --set PATH "$out/bin"
+    done
+  '';
+
+  meta = {
+    changelog = "https://github.com/ANTsX/ANTs/releases/tag/v${finalAttrs.version}";
+    description = "Advanced normalization toolkit for medical image registration and other processing";
+    homepage = "https://github.com/ANTsX/ANTs";
+    license = lib.licenses.asl20;
+    mainProgram = "antsRegistration";
+    maintainers = with lib.maintainers; [ bcdarwin ];
+    platforms = lib.platforms.unix;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/biology/aragorn/default.nix b/nixpkgs/pkgs/applications/science/biology/aragorn/default.nix
new file mode 100644
index 000000000000..3ec62ada04c9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/aragorn/default.nix
@@ -0,0 +1,53 @@
+{ lib
+, stdenv
+, fetchurl
+, installShellFiles
+}:
+let
+  man = fetchurl {
+    url = "https://web.archive.org/web/20230608093053if_/http://www.ansikte.se/ARAGORN/Downloads/aragorn.1";
+    hash = "sha256-bjD22dpkQZcGR0TwMxdpaed4VZZO2NUOoAw4o66iyS4=";
+  };
+in
+
+stdenv.mkDerivation (finalAttrs: {
+  version = "1.2.41";
+  pname = "aragorn";
+
+  src = fetchurl {
+    url = "http://www.ansikte.se/ARAGORN/Downloads/aragorn${finalAttrs.version}.c";
+    hash = "sha256-kqMcxcCwrRbU17AZkZibd18H0oFd8TX+bj6riPXpf0o=";
+  };
+
+  dontUnpack = true;
+
+  nativeBuildInputs = [
+    installShellFiles
+  ];
+
+  buildPhase = ''
+    runHook preBuild
+
+    $CC -O3 -ffast-math -finline-functions -o aragorn $src
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin && cp aragorn $out/bin
+    installManPage ${man}
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Detects tRNA, mtRNA, and tmRNA genes in nucleotide sequences";
+    mainProgram = "aragorn";
+    homepage = "http://www.ansikte.se/ARAGORN/";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.bzizou ];
+    platforms = platforms.unix;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/biology/astral/default.nix b/nixpkgs/pkgs/applications/science/biology/astral/default.nix
new file mode 100644
index 000000000000..34077949b97d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/astral/default.nix
@@ -0,0 +1,79 @@
+{ lib
+, stdenvNoCC
+, fetchFromGitHub
+, jdk8
+, jre8
+, strip-nondeterminism
+, makeWrapper
+, zip
+}:
+
+let
+  jdk = jdk8;
+  jre = jre8;
+in
+stdenvNoCC.mkDerivation (finalAttrs: {
+  pname = "astral";
+  version = "5.7.1";
+
+  src = fetchFromGitHub {
+    owner = "smirarab";
+    repo = "ASTRAL";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-VhcsX9BxiZ0nISN6Xe4N+kq0iBMCtNhyxDrm9cwXfBA=";
+  };
+
+  patches = [
+    # we can't use stripJavaArchivesHook here, because the build process puts a .jar file into a zip file
+    # this patch calls strip-nondeterminism manually
+    ./make-deterministic.patch
+  ];
+
+  nativeBuildInputs = [
+    jdk
+    zip
+    strip-nondeterminism
+    makeWrapper
+  ];
+
+  buildPhase = ''
+    runHook preBuild
+    patchShebangs ./make.sh
+    ./make.sh
+    runHook postBuild
+  '';
+
+  doCheck = true;
+
+  checkPhase = ''
+    runHook preCheck
+    java -jar astral.${finalAttrs.version}.jar -i main/test_data/song_primates.424.gene.tre
+    runHook postCheck
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm644 astral.${finalAttrs.version}.jar -t $out/share
+    install -Dm644 lib/*.jar -t $out/share/lib
+    install -Dm644 Astral.${finalAttrs.version}.zip -t $out/share
+    cp -a main/test_data $out/share
+
+    makeWrapper ${jre}/bin/java $out/bin/astral \
+        --add-flags "-jar $out/share/astral.${finalAttrs.version}.jar"
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/smirarab/ASTRAL";
+    description = "Tool for estimating an unrooted species tree given a set of unrooted gene trees";
+    mainProgram = "astral";
+    sourceProvenance = with sourceTypes; [
+      fromSource
+      binaryBytecode # source bundles dependencies as jars
+    ];
+    license = licenses.asl20;
+    maintainers = with maintainers; [ bzizou tomasajt ];
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/biology/astral/make-deterministic.patch b/nixpkgs/pkgs/applications/science/biology/astral/make-deterministic.patch
new file mode 100644
index 000000000000..940182e2f49f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/astral/make-deterministic.patch
@@ -0,0 +1,21 @@
+diff --git a/make.sh b/make.sh
+index 3ff6529..937b1a2 100644
+--- a/make.sh
++++ b/make.sh
+@@ -17,6 +17,8 @@ jar cvfm ../astral.$version.jar ../manifest.text phylonet/util/BitSet.* phylonet
+ 
+ cd ..
+ 
++strip-nondeterminism --type jar astral.$version.jar
++
+ chmod +x astral.$version.jar
+ sed -e "s/__astral.jar__/astral.$version.jar/g" -e "s/__astral.zip__/Astral.$version.zip/g" README.template.md > README.md
+ sed -e "s/__astral.jar__/astral.$version.jar/g" -e "s/__astral.zip__/Astral.$version.zip/g" astral-tutorial-template.md > astral-tutorial.md
+@@ -32,6 +34,7 @@ ln -s ../astral-tutorial.pdf .
+ cd ..
+ rm -f Astral.$version.zip
+ zip -r Astral.$version.zip Astral 
++strip-nondeterminism --type zip Astral.$version.zip
+ 
+ set +x
+ echo "
diff --git a/nixpkgs/pkgs/applications/science/biology/bamtools/default.nix b/nixpkgs/pkgs/applications/science/biology/bamtools/default.nix
new file mode 100644
index 000000000000..602254e2966a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/bamtools/default.nix
@@ -0,0 +1,42 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, jsoncpp
+, pkg-config
+, zlib
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "bamtools";
+  version = "2.5.2";
+
+  src = fetchFromGitHub {
+    owner = "pezmaster31";
+    repo = "bamtools";
+    rev = "refs/tags/v${finalAttrs.version}";
+    hash = "sha256-l2DmA4P1kPneTCL9YVACE6LcQHT0F+mufPyM69VkksE=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  buildInputs = [
+    jsoncpp
+    zlib
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "C++ API & command-line toolkit for working with BAM data";
+    mainProgram = "bamtools";
+    homepage = "https://github.com/pezmaster31/bamtools";
+    changelog = "https://github.com/pezmaster31/bamtools/releases/tag/${finalAttrs.src.rev}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ natsukium ];
+    platforms = platforms.unix;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/biology/bayescan/default.nix b/nixpkgs/pkgs/applications/science/biology/bayescan/default.nix
new file mode 100644
index 000000000000..e715ff4b45b0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/bayescan/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchurl, unzip, llvmPackages }:
+
+stdenv.mkDerivation rec {
+  pname = "bayescan";
+  version = "2.1";
+
+  src = fetchurl {
+    url = "http://cmpg.unibe.ch/software/BayeScan/files/BayeScan${version}.zip";
+    sha256 = "0ismima8j8z0zj9yc267rpf7z90w57b2pbqzjnayhc3ab8mcbfy6";
+  };
+
+  nativeBuildInputs = [ unzip ];
+  buildInputs = lib.optional stdenv.cc.isClang llvmPackages.openmp;
+
+  # Disable FORTIFY_SOURCE or the binary fails with "buffer overflow"
+  hardeningDisable = [ "fortify" ];
+
+  sourceRoot = "BayeScan${version}/source";
+
+  postPatch = ''
+    substituteInPlace Makefile --replace "-static" "" \
+                               --replace "g++" "c++"
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mkdir -p $out/share/doc/bayescan
+    cp bayescan_${version} $out/bin
+    cp -r ../*pdf ../input_examples ../"R functions" $out/share/doc/bayescan
+  '';
+
+  env.NIX_CFLAGS_COMPILE = toString [ "-std=c++14" ];
+
+  meta = with lib; {
+    description = "Detecting natural selection from population-based genetic data";
+    homepage = "http://cmpg.unibe.ch/software/BayeScan";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.bzizou ];
+    mainProgram = "bayescan_${version}";
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/bcftools/default.nix b/nixpkgs/pkgs/applications/science/biology/bcftools/default.nix
new file mode 100644
index 000000000000..19e5f99fe2f6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/bcftools/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchurl, htslib, zlib, bzip2, xz, curl, perl, python3, bash }:
+
+stdenv.mkDerivation rec {
+  pname = "bcftools";
+  version = "1.19";
+
+  src = fetchurl {
+    url = "https://github.com/samtools/bcftools/releases/download/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-eCtfG8aQQVGSIx6CITs0k7BH9F5jDcjvbxVNYSarPmg=";
+  };
+
+  nativeBuildInputs = [
+    perl
+    python3
+  ];
+
+  buildInputs = [ htslib zlib bzip2 xz curl ];
+
+  strictDeps = true;
+
+  makeFlags = [
+    "HSTDIR=${htslib}"
+    "prefix=$(out)"
+    "CC=${stdenv.cc.targetPrefix}cc"
+  ];
+
+  preCheck = ''
+    patchShebangs misc/
+    patchShebangs test/
+    sed -ie 's|/bin/bash|${bash}/bin/bash|' test/test.pl
+  '';
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Tools for manipulating BCF2/VCF/gVCF format, SNP and short indel sequence variants";
+    license = licenses.mit;
+    homepage = "http://www.htslib.org/";
+    platforms = platforms.unix;
+    maintainers = [ maintainers.mimame ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/bedops/default.nix b/nixpkgs/pkgs/applications/science/biology/bedops/default.nix
new file mode 100644
index 000000000000..d455e98264cc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/bedops/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv, fetchFromGitHub, zlib, bzip2, jansson, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "bedops";
+  version = "2.4.41";
+
+  src = fetchFromGitHub {
+    owner = "bedops";
+    repo = "bedops";
+    rev = "v${version}";
+    sha256 = "sha256-VJBoi1+tHA4oOVOsClUfimB+mOV5ZSQsDcDq3vAZwBA=";
+  };
+
+  buildInputs = [ zlib bzip2 jansson ];
+  nativeBuildInputs = [ makeWrapper ];
+
+  preConfigure = ''
+    # We use nixpkgs versions of these libraries
+    rm -r third-party
+    sed -i '/^LIBS/d' system.mk/*
+    sed -i 's|^LIBRARIES.*$|LIBRARIES = -lbz2 -lz -ljansson|' */*/*/*/Makefile*
+
+    # `make support` installs above libraries
+    substituteInPlace system.mk/* \
+      --replace ": support" ":"
+
+    # Variable name is different in this makefile
+    substituteInPlace applications/bed/sort-bed/src/Makefile.darwin \
+      --replace "DIST_DIR" "BINDIR"
+
+    # `mkdir -p $BINDIR` is missing
+    substituteInPlace applications/bed/sort-bed/src/Makefile.darwin \
+      --replace 'mkdir -p ''${OBJ_DIR}' 'mkdir -p ''${OBJ_DIR} ''${BINDIR}'
+
+    substituteInPlace applications/bed/starch/src/Makefile --replace '$(LIBRARIES)' ""
+
+    # Function name is different in nixpkgs provided libraries
+    for f in interfaces/src/data/starch/starchFileHelpers.c applications/bed/starch/src/starchcat.c ; do
+      substituteInPlace $f --replace deflateInit2cpp deflateInit2
+    done
+
+    # Don't force static
+    for f in */*/*/*/Makefile* ; do
+      substituteInPlace $f --replace '-static' ""
+    done
+  '';
+
+  makeFlags = [ "BINDIR=$(out)/bin" ];
+
+  postFixup = ''
+    for f in $out/bin/* ; do
+      wrapProgram $f --prefix PATH : "$out/bin"
+    done
+  '';
+
+  meta = with lib; {
+    description = "Suite of tools for addressing questions arising in genomics studies";
+    homepage = "https://github.com/bedops/bedops";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ jbedo ];
+    platforms = platforms.x86_64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/bedtools/default.nix b/nixpkgs/pkgs/applications/science/biology/bedtools/default.nix
new file mode 100644
index 000000000000..76780298120e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/bedtools/default.nix
@@ -0,0 +1,34 @@
+{lib, stdenv, fetchFromGitHub, zlib, python3, bzip2, xz}:
+
+stdenv.mkDerivation rec {
+  pname = "bedtools";
+  version = "2.31.1";
+
+  src = fetchFromGitHub {
+    owner = "arq5x";
+    repo = "bedtools2";
+    rev = "v${version}";
+    sha256 = "sha256-rrk+FSv1bGL0D1lrIOsQu2AT7cw2T4lkDiCnzil5fpg=";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [
+    python3
+  ];
+
+  buildInputs = [ zlib bzip2 xz ];
+
+  cxx = if stdenv.cc.isClang then "clang++" else "g++";
+  cc = if stdenv.cc.isClang then "clang" else "gcc";
+  buildPhase = "make prefix=$out SHELL=${stdenv.shell} CXX=${cxx} CC=${cc} -j $NIX_BUILD_CORES";
+  installPhase = "make prefix=$out SHELL=${stdenv.shell} CXX=${cxx} CC=${cc} install";
+
+  meta = with lib; {
+    description = "A powerful toolset for genome arithmetic";
+    license = licenses.gpl2;
+    homepage = "https://bedtools.readthedocs.io/en/latest/";
+    maintainers = with maintainers; [ jbedo ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/bftools/default.nix b/nixpkgs/pkgs/applications/science/biology/bftools/default.nix
new file mode 100644
index 000000000000..a8bb739bbed8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/bftools/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, lib, makeWrapper, fetchzip, jre }:
+
+stdenv.mkDerivation rec {
+  pname = "bftools";
+  version = "6.3.0";
+
+  src = fetchzip {
+    url = "http://downloads.openmicroscopy.org/bio-formats/${version}/artifacts/bftools.zip";
+    sha256 = "02nvvmpfglpah1ihd08aw65g1794w588c988cdar1hfl4s80qwhb";
+  };
+
+  installPhase = ''
+    find . -maxdepth 1 -perm -111 -type f -not -name "*.sh" \
+      -exec install -vD {} "$out"/bin/{} \;
+
+    mkdir $out/libexec
+    mkdir -p $out/share/java
+
+    cp ./*.sh $out/libexec
+    cp ./*.jar $out/share/java
+
+    for file in $out/bin/*; do
+      substituteInPlace $file --replace "\$BF_DIR" $out/libexec
+    done
+    substituteInPlace $out/libexec/bf.sh --replace "\$BF_JAR_DIR" $out/share/java
+  '';
+
+  postFixup = ''
+    wrapProgram $out/libexec/bf.sh --prefix PATH : "${lib.makeBinPath [ jre ]}"
+  '';
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  meta = with lib; {
+    description = "A bundle of scripts for using Bio-Formats on the command line with bioformats_package.jar already included";
+    sourceProvenance = with sourceTypes; [ binaryBytecode ];
+    license = licenses.gpl2;
+    platforms = platforms.all;
+    homepage = "https://www.openmicroscopy.org/bio-formats/";
+    maintainers = [ maintainers.tbenst ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/bioawk/default.nix b/nixpkgs/pkgs/applications/science/biology/bioawk/default.nix
new file mode 100644
index 000000000000..f7da30fc4f72
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/bioawk/default.nix
@@ -0,0 +1,51 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, installShellFiles
+, bison
+, zlib
+}:
+
+stdenv.mkDerivation {
+  pname = "bioawk";
+  version = "unstable-2017-09-11";
+
+  src = fetchFromGitHub {
+    owner = "lh3";
+    repo = "bioawk";
+    rev = "fd40150b7c557da45e781a999d372abbc634cc21";
+    hash = "sha256-WWgz96DPP83J45isWkMbgEvOlibq6WefK//ImV6+AU0=";
+  };
+
+  nativeBuildInputs = [
+    bison
+    installShellFiles
+  ];
+
+  buildInputs = [
+    zlib
+  ];
+
+  buildFlags = [
+    "CC=${stdenv.cc.targetPrefix}cc"
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm755 bioawk -t $out/bin
+    mv awk.1 bioawk.1
+    installManPage bioawk.1
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "BWK awk modified for biological data";
+    mainProgram = "bioawk";
+    homepage = "https://github.com/lh3/bioawk";
+    license = licenses.hpnd;
+    maintainers = with maintainers; [ natsukium ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/blast/bin.nix b/nixpkgs/pkgs/applications/science/biology/blast/bin.nix
new file mode 100644
index 000000000000..48537a568e4b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/blast/bin.nix
@@ -0,0 +1,61 @@
+{ lib
+, stdenv
+, fetchurl
+, python3
+, perl
+, blast
+, autoPatchelfHook
+, zlib
+, bzip2
+, glib
+, libxml2
+, coreutils
+}:
+let
+  pname = "blast-bin";
+  version = "2.14.1";
+
+  srcs = rec {
+    x86_64-linux = fetchurl {
+      url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-x64-linux.tar.gz";
+      hash = "sha256-OO8MNOk6k0J9FlAGyCOhP+hirEIT6lL+rIInB8dQWEU=";
+    };
+    aarch64-linux = fetchurl {
+      url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-aarch64-linux.tar.gz";
+      hash = "sha256-JlOyoxZQBbvUcHIMv5muTuGQgrh2uom3rzDurhHQ+FM=";
+    };
+    x86_64-darwin = fetchurl {
+      url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-x64-macosx.tar.gz";
+      hash = "sha256-eMfuwMCD6VlDgeshLslDhYBBp0YOpL+6q/zSchR0bAs=";
+    };
+    aarch64-darwin = x86_64-darwin;
+  };
+  src = srcs.${stdenv.hostPlatform.system};
+in
+stdenv.mkDerivation {
+  inherit pname version src;
+
+  nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ];
+
+  buildInputs = [ python3 perl ] ++ lib.optionals stdenv.isLinux [ zlib bzip2 glib libxml2 ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm755 bin/* -t $out/bin
+
+    runHook postInstall
+  '';
+
+  preFixup = ''
+    substituteInPlace $out/bin/get_species_taxids.sh \
+      --replace /bin/rm ${coreutils}/bin/rm
+  '';
+
+  meta = with lib; {
+    inherit (blast.meta) description homepage license;
+    platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin" ];
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    maintainers = with maintainers; [ natsukium ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/blast/default.nix b/nixpkgs/pkgs/applications/science/biology/blast/default.nix
new file mode 100644
index 000000000000..407d38970b0f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/blast/default.nix
@@ -0,0 +1,109 @@
+{ lib, stdenv, buildPackages, fetchurl, zlib, bzip2, perl, cpio, gawk, coreutils, ApplicationServices }:
+
+stdenv.mkDerivation rec {
+  pname = "blast";
+  version = "2.14.1";
+
+  src = fetchurl {
+    url = "https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-src.tar.gz";
+    sha256 = "sha256-cSwtvfD7E8wcLU9O9d0c5LBsO1fpbf6o8j5umfWxZQ4=";
+  };
+
+  sourceRoot = "ncbi-blast-${version}+-src/c++";
+
+  configureFlags = [
+    # With flat Makefile we can use all_projects in order not to build extra.
+    # These extra cause clang to hang on Darwin.
+    "--with-flat-makefile"
+    "--without-makefile-auto-update"
+    "--with-dll"  # build dynamic libraries (static are default)
+    ];
+
+  makeFlags = [ "all_projects=app/" ];
+
+  preConfigure = ''
+    export NCBICXX_RECONF_POLICY=warn
+    export PWD=$(pwd)
+    export HOME=$PWD
+
+    # The configure scripts wants to set AR="ar cr" unless it is already set in
+    # the environment. Because stdenv sets AR="ar", the result is a bad call to
+    # the assembler later in the process. Thus, we need to unset AR
+    unset AR
+
+    for awks in scripts/common/impl/is_log_interesting.awk \
+        scripts/common/impl/report_duplicates.awk; do
+
+        substituteInPlace $awks \
+              --replace /usr/bin/awk ${gawk}/bin/awk
+    done
+
+    for mk in src/build-system/Makefile.meta.in \
+        src/build-system/helpers/run_with_lock.c ; do
+
+        substituteInPlace $mk \
+        --replace /bin/rm ${coreutils}/bin/rm
+    done
+
+    for mk in src/build-system/Makefile.meta.gmake=no \
+        src/build-system/Makefile.meta_l \
+        src/build-system/Makefile.meta_r \
+        src/build-system/Makefile.requirements \
+        src/build-system/Makefile.rules_with_autodep.in; do
+
+        substituteInPlace $mk \
+            --replace /bin/echo ${coreutils}/bin/echo
+    done
+    for mk in src/build-system/Makefile.meta_p \
+        src/build-system/Makefile.rules_with_autodep.in \
+        src/build-system/Makefile.protobuf.in ; do
+
+        substituteInPlace $mk \
+            --replace /bin/mv ${coreutils}/bin/mv
+    done
+
+
+    substituteInPlace src/build-system/configure \
+        --replace /bin/pwd ${coreutils}/bin/pwd \
+        --replace /bin/ln ${coreutils}/bin/ln
+
+    substituteInPlace src/build-system/configure.ac \
+        --replace /bin/pwd ${coreutils}/bin/pwd \
+        --replace /bin/ln ${coreutils}/bin/ln
+
+    substituteInPlace src/build-system/Makefile.meta_l \
+        --replace /bin/date ${coreutils}/bin/date
+  '';
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ perl ];
+
+  # perl is necessary in buildInputs so that installed perl scripts get patched
+  # correctly
+  buildInputs = [ coreutils perl gawk zlib bzip2 cpio ]
+    ++ lib.optionals stdenv.isDarwin [ ApplicationServices ];
+  hardeningDisable = [ "format" ];
+
+  postInstall = ''
+    substituteInPlace $out/bin/get_species_taxids.sh \
+        --replace /bin/rm ${coreutils}/bin/rm
+  '';
+  patches = [ ./no_slash_bin.patch ];
+
+  enableParallelBuilding = true;
+
+  # Many tests require either network access or locally available databases
+  doCheck = false;
+
+  meta = with lib; {
+    description = ''Basic Local Alignment Search Tool (BLAST) finds regions of
+    similarity between biological sequences'';
+    homepage = "https://blast.ncbi.nlm.nih.gov/Blast.cgi";
+    license = licenses.publicDomain;
+
+    # Version 2.10.0 fails on Darwin
+    # See https://github.com/NixOS/nixpkgs/pull/61430
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ luispedro ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/blast/no_slash_bin.patch b/nixpkgs/pkgs/applications/science/biology/blast/no_slash_bin.patch
new file mode 100644
index 000000000000..851e37fa905d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/blast/no_slash_bin.patch
@@ -0,0 +1,178 @@
+diff -u --recursive ncbi-blast-2.9.0+-src/scripts/common/impl/collect_outside_libs.sh ncbi-blast-2.9.0+-src.patched/scripts/common/impl/collect_outside_libs.sh
+--- ncbi-blast-2.9.0+-src/scripts/common/impl/collect_outside_libs.sh	2014-08-01 22:01:17.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/scripts/common/impl/collect_outside_libs.sh	2019-05-15 12:40:44.145239480 +0800
+@@ -1,8 +1,5 @@
+ #!/bin/sh
+ set -e
+-PATH=/bin:/usr/bin
+-export PATH
+-unset CDPATH
+ 
+ base=$1
+ search=`echo ${2-$LD_LIBRARY_PATH} | tr : ' '`
+diff -u --recursive ncbi-blast-2.9.0+-src/scripts/common/impl/create_flat_tuneups.sh ncbi-blast-2.9.0+-src.patched/scripts/common/impl/create_flat_tuneups.sh
+--- ncbi-blast-2.9.0+-src/scripts/common/impl/create_flat_tuneups.sh	2011-08-17 02:55:10.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/scripts/common/impl/create_flat_tuneups.sh	2019-05-15 12:40:48.449276574 +0800
+@@ -1,9 +1,6 @@
+ #!/bin/sh
+ id='$Id: create_flat_tuneups.sh 331412 2011-08-16 18:55:10Z ucko $'
+ 
+-PATH=/bin:/usr/bin
+-export PATH
+-
+ exec > auto_flat_tuneups.mk
+ 
+ cat <<EOF
+diff -u --recursive ncbi-blast-2.9.0+-src/scripts/common/impl/get_lock.sh ncbi-blast-2.9.0+-src.patched/scripts/common/impl/get_lock.sh
+--- ncbi-blast-2.9.0+-src/scripts/common/impl/get_lock.sh	2011-08-20 04:12:28.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/scripts/common/impl/get_lock.sh	2019-05-15 12:40:52.901315000 +0800
+@@ -1,7 +1,5 @@
+ #!/bin/sh
+ 
+-PATH=/bin:/usr/bin
+-export PATH
+ 
+ dir=$1.lock
+ 
+diff -u --recursive ncbi-blast-2.9.0+-src/scripts/common/impl/if_diff.sh ncbi-blast-2.9.0+-src.patched/scripts/common/impl/if_diff.sh
+--- ncbi-blast-2.9.0+-src/scripts/common/impl/if_diff.sh	2014-07-30 22:06:45.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/scripts/common/impl/if_diff.sh	2019-05-15 12:42:57.298410841 +0800
+@@ -4,9 +4,6 @@
+ # Author:  Denis Vakatov (vakatov@ncbi.nlm.nih.gov)
+ #################################
+ 
+-orig_PATH=$PATH
+-PATH=/bin:/usr/bin
+-
+ script_name=`basename $0`
+ script_args="$*"
+ 
+@@ -16,7 +13,7 @@
+ base_action=`basename "$action"`
+ case "$base_action" in
+   cp | cp\ * | ln | ln\ * )
+-      action=/bin/$base_action
++      action=$base_action
+       rm="rm -f"
+       ;;
+   * )
+@@ -58,10 +55,8 @@
+   shift
+   cmd="$* $dest_file"
+   test "$quiet" = yes || echo "$cmd"
+-  PATH=$orig_PATH
+   "$@" "$dest"
+   status=$?
+-  PATH=/bin:/usr/bin
+   return $status
+ }
+ 
+@@ -74,7 +69,7 @@
+   case "$base_action" in
+     ln | ln\ -f )
+       test "$quiet" = yes || echo "failed; trying \"cp -p ...\" instead"
+-      cmd="/bin/cp -p $src_file $dest_file"
++      cmd="cp -p $src_file $dest_file"
+       ExecHelper "$dest_file" /bin/cp -p "$src_file"  ||
+       Usage "\"$cmd\" failed"
+       ;;
+diff -u --recursive ncbi-blast-2.9.0+-src/scripts/common/impl/make_lock_map.sh ncbi-blast-2.9.0+-src.patched/scripts/common/impl/make_lock_map.sh
+--- ncbi-blast-2.9.0+-src/scripts/common/impl/make_lock_map.sh	2011-11-17 04:43:52.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/scripts/common/impl/make_lock_map.sh	2019-05-15 12:40:56.769348434 +0800
+@@ -1,8 +1,6 @@
+ #!/bin/sh
+ # $Id: make_lock_map.sh 344587 2011-11-16 20:43:52Z ucko $
+ 
+-PATH=/bin:/usr/bin
+-export PATH
+ 
+ act=false
+ cache_dir='.#SRC-cache'
+diff -u --recursive ncbi-blast-2.9.0+-src/scripts/common/impl/run_with_lock.sh ncbi-blast-2.9.0+-src.patched/scripts/common/impl/run_with_lock.sh
+--- ncbi-blast-2.9.0+-src/scripts/common/impl/run_with_lock.sh	2015-10-29 22:36:05.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/scripts/common/impl/run_with_lock.sh	2019-05-15 12:41:53.401842849 +0800
+@@ -1,10 +1,6 @@
+ #!/bin/sh
+ # $Id: run_with_lock.sh 483249 2015-10-29 14:36:05Z ucko $
+ 
+-orig_PATH=$PATH
+-PATH=/bin:/usr/bin
+-export PATH
+-
+ base=
+ logfile=
+ map=
+@@ -23,7 +19,7 @@
+ : ${base:=`basename "$1"`}
+ 
+ clean_up () {
+-    /bin/rm -rf "$base.lock"
++    rm -rf "$base.lock"
+ }
+ 
+ case $0 in
+@@ -45,7 +41,7 @@
+     trap "clean_up; exit $error_status" 1 2 15
+     if [ -n "$logfile" ]; then
+         status_file=$base.lock/status
+-        (PATH=$orig_PATH; export PATH; "$@"; echo $? > "$status_file") 2>&1 \
++        ("$@"; echo $? > "$status_file") 2>&1 \
+             | tee "$logfile.new"
+         # Emulate egrep -q to avoid having to move from under scripts.
+         if [ ! -f "$logfile" ]  \
+@@ -58,8 +54,6 @@
+             status=1
+         fi
+     else
+-        PATH=$orig_PATH
+-        export PATH
+         "$@"
+         status=$?
+     fi
+diff -u --recursive ncbi-blast-2.9.0+-src/scripts/common/impl/strip_for_install.sh ncbi-blast-2.9.0+-src.patched/scripts/common/impl/strip_for_install.sh
+--- ncbi-blast-2.9.0+-src/scripts/common/impl/strip_for_install.sh	2013-09-24 03:06:51.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/scripts/common/impl/strip_for_install.sh	2019-05-15 12:40:13.272975092 +0800
+@@ -1,8 +1,5 @@
+ #!/bin/sh
+ 
+-PATH=/bin:/usr/bin:/usr/ccs/bin
+-export PATH
+-
+ case "$1" in
+     --dirs )
+         shift
+--- ncbi-blast-2.9.0+-src/scripts/common/impl/update_configurable.sh	2017-07-13 22:53:24.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/scripts/common/impl/update_configurable.sh	2019-05-15 15:03:35.861276083 +0800
+@@ -1,6 +1,4 @@
+ #!/bin/sh
+-PATH=/bin:/usr/bin
+-export PATH
+ 
+ script_name=`basename $0`
+ script_dir=`dirname $0`
+--- ncbi-blast-2.9.0+-src/src/build-system/Makefile.mk.in	2019-01-04 01:38:37.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/src/build-system/Makefile.mk.in	2019-05-15 15:14:41.749416495 +0800
+@@ -50,12 +50,12 @@
+ 
+ ### Auxiliary commands, filters
+ 
+-RM       = /bin/rm -f
+-RMDIR    = /bin/rm -rf
+-COPY     = /bin/cp -p
++RM       = rm -f
++RMDIR    = rm -rf
++COPY     = cp -p
+ BINCOPY  = @BINCOPY@
+ TOUCH    = @TOUCH@
+-MKDIR    = /bin/mkdir
++MKDIR    = mkdir
+ BINTOUCH = $(TOUCH)
+ LN_S     = @LN_S@
+ GREP     = @GREP@
+--- ncbi-blast-2.9.0+-src/src/build-system/configure	2019-03-05 00:49:08.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/src/build-system/configure	2019-05-15 16:55:40.711795042 +0800
+@@ -10417,4 +10417,0 @@
+-case "$LN_S" in
+-    /*) ;;
+-    * ) LN_S=/bin/$LN_S ;;
+-esac
diff --git a/nixpkgs/pkgs/applications/science/biology/bowtie/default.nix b/nixpkgs/pkgs/applications/science/biology/bowtie/default.nix
new file mode 100644
index 000000000000..bec263a2d931
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/bowtie/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "bowtie";
+  version = "1.3.1";
+
+  src = fetchFromGitHub {
+    owner = "BenLangmead";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-mWItmrTMPst/NnzSpxxTHcBztDqHPCza9yOsZPwp7G4=";
+  };
+
+  patches = [
+    # Without this patch, compiling with clang on an M1 Mac fails because
+    # 'cpuid.h' is included. It only works on x86 and throws an error.
+    (fetchpatch {
+      name = "fix_compilation_on_arm64";
+      url = "https://github.com/BenLangmead/bowtie/commit/091d72f4cb69ca0713704d38bd7f9b37e6c4ff2d.patch";
+      sha256 = "sha256-XBvgICUBnE5HKpJ36IHTDiKjJgLFKETsIaJC46uN+2I=";
+    })
+
+    # Without this patch, compilation adds the current source directory to the
+    # include search path, and #include <version> in standard library code can
+    # end up picking the unrelated VERSION source code file on case-insensitive
+    # file systems.
+    (fetchpatch {
+      name = "fix_include_search_path";
+      url = "https://github.com/BenLangmead/bowtie/commit/c208b9db936eab0bc3ffdf0182b4f59a9017a1c4.patch";
+      sha256 = "sha256-772EE+oWFWXssSMabPryb0AfIS1tC10mPTRCBm7RrUs=";
+    })
+  ];
+
+  buildInputs = [ zlib ];
+
+  installFlags = [ "prefix=$(out)" ];
+
+  meta = with lib; {
+    description = "An ultrafast memory-efficient short read aligner";
+    license = licenses.artistic2;
+    homepage = "https://bowtie-bio.sourceforge.net";
+    maintainers = with maintainers; [ prusnak ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/bowtie2/default.nix b/nixpkgs/pkgs/applications/science/biology/bowtie2/default.nix
new file mode 100644
index 000000000000..dbcecb7ac3fb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/bowtie2/default.nix
@@ -0,0 +1,62 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, perl
+, python3
+, tbb
+, zlib
+, runCommand
+, bowtie2
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "bowtie2";
+  version = "2.5.3";
+
+  src = fetchFromGitHub {
+    owner = "BenLangmead";
+    repo = "bowtie2";
+    rev = "refs/tags/v${finalAttrs.version}";
+    fetchSubmodules = true;
+    hash = "sha256-vjJRA9KFfJChxxg2wxBkwsnDw7fx5SNH3JhRXQw+7XA=";
+  };
+
+  # because of this flag, gcc on aarch64 cannot find the Threads
+  # Could NOT find Threads (missing: Threads_FOUND)
+  # TODO: check with other distros and report upstream
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace "-m64" ""
+  '';
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ tbb zlib python3 perl ];
+
+  cmakeFlags = lib.optional (!stdenv.hostPlatform.isx86) ["-DCMAKE_CXX_FLAGS=-I${finalAttrs.src}/third_party"];
+
+  # ctest fails because of missing dependencies between tests
+  doCheck = false;
+
+  passthru.tests = {
+    ctest = runCommand "${finalAttrs.pname}-test" { } ''
+      mkdir $out
+      ${lib.getExe bowtie2} -x ${finalAttrs.src}/example/index/lambda_virus ${finalAttrs.src}/example/reads/longreads.fq -u 10
+      ${bowtie2}/bin/bowtie2-build-s -c GGGCGGCGACCTCGCGGGTTTTCGCTA $out/small
+      ${bowtie2}/bin/bowtie2-inspect-s $out/small
+      ${bowtie2}/bin/bowtie2-build-l -c GGGCGGCGACCTCGCGGGTTTTCGCTA $out/large
+      ${bowtie2}/bin/bowtie2-inspect-l $out/large
+    '';
+  };
+
+  meta = with lib; {
+    description = "An ultrafast and memory-efficient tool for aligning sequencing reads to long reference sequences";
+    license = licenses.gpl3Plus;
+    homepage = "http://bowtie-bio.sf.net/bowtie2";
+    changelog = "https://github.com/BenLangmead/bowtie2/releases/tag/${finalAttrs.src.rev}";
+    maintainers = with maintainers; [ rybern ];
+    platforms = platforms.all;
+    mainProgram = "bowtie2";
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/biology/bppsuite/default.nix b/nixpkgs/pkgs/applications/science/biology/bppsuite/default.nix
new file mode 100644
index 000000000000..a465ca04910d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/bppsuite/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchFromGitHub, cmake, bpp-core, bpp-seq, bpp-phyl, bpp-popgen }:
+
+stdenv.mkDerivation rec {
+  pname = "bppsuite";
+
+  inherit (bpp-core) version;
+
+  src = fetchFromGitHub {
+    owner = "BioPP";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1wdwcgczqbc3m116vakvi0129wm3acln3cfc7ivqnalwvi6lrpds";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ bpp-core bpp-seq bpp-phyl bpp-popgen ];
+
+  meta = bpp-core.meta // {
+    homepage = "https://github.com/BioPP/bppsuite";
+    changelog = "https://github.com/BioPP/bppsuite/blob/master/ChangeLog";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/bwa-mem2/default.nix b/nixpkgs/pkgs/applications/science/biology/bwa-mem2/default.nix
new file mode 100644
index 000000000000..c339baf446d2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/bwa-mem2/default.nix
@@ -0,0 +1,56 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, zlib
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "bwa-mem2";
+  version = "unstable-2023-03-18";
+
+  src = fetchFromGitHub {
+    owner = "bwa-mem2";
+    repo = "bwa-mem2";
+    rev = "cf4306a47dac35e7e79a9e75398a35f33900cfd0";
+    fetchSubmodules = true;
+    hash = "sha256-1AYSn7nBrDwbX7oSrdEoa1d3t6xzwKnA0S87Y/XeXJg=";
+  };
+
+  buildInputs = [ zlib ];
+
+  # see https://github.com/bwa-mem2/bwa-mem2/issues/93
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    sed -i 's/memset_s/memset8_s/g' ext/safestringlib/include/safe_mem_lib.h
+    sed -i 's/memset_s/memset8_s/g' ext/safestringlib/safeclib/memset16_s.c
+    sed -i 's/memset_s/memset8_s/g' ext/safestringlib/safeclib/memset32_s.c
+    sed -i 's/memset_s/memset8_s/g' ext/safestringlib/safeclib/memset_s.c
+    sed -i 's/memset_s/memset8_s/g' ext/safestringlib/safeclib/wmemset_s.c
+  '';
+
+  buildFlags = [
+    (if stdenv.hostPlatform.sse4_2Support then "arch=sse42"
+    else if stdenv.hostPlatform.avxSupport then "arch=avx"
+    else if stdenv.hostPlatform.avx2Support then "arch=avx2"
+    else if stdenv.hostPlatform.avx512Support then "arch=avx512"
+    else "arch=sse41")
+  ];
+  enableParallelBuilding = true;
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin
+    cp bwa-mem2* $out/bin/
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Next version of the bwa-mem algorithm in bwa, a software package for mapping low-divergent sequences against a large reference genome";
+    mainProgram = "bwa-mem2";
+    license = licenses.mit;
+    homepage = "https://github.com/bwa-mem2/bwa-mem2/";
+    changelog = "https://github.com/bwa-mem2/bwa-mem2/blob/${finalAttrs.src.rev}/NEWS.md";
+    platforms = platforms.x86_64;
+    maintainers = with maintainers; [ alxsimon ];
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/biology/bwa/default.nix b/nixpkgs/pkgs/applications/science/biology/bwa/default.nix
new file mode 100644
index 000000000000..8c883e2617bf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/bwa/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchFromGitHub, zlib }:
+
+stdenv.mkDerivation {
+  pname = "bwa";
+  version = "unstable-2022-09-23";
+
+  src = fetchFromGitHub {
+    owner = "lh3";
+    repo = "bwa";
+    rev = "139f68fc4c3747813783a488aef2adc86626b01b";
+    hash = "sha256-8u35lTK6gBKeapYoIkG9MuJ/pyy/HFA2OiPn+Ml2C6c=";
+  };
+
+  buildInputs = [ zlib ];
+
+  # Avoid hardcoding gcc to allow environments with a different
+  # C compiler to build
+  preConfigure = ''
+    sed -i '/^CC/d' Makefile
+  '';
+
+  makeFlags = lib.optional stdenv.hostPlatform.isStatic "AR=${stdenv.cc.targetPrefix}ar";
+
+  # it's unclear which headers are intended to be part of the public interface
+  # so we may find ourselves having to add more here over time
+  installPhase = ''
+    runHook preInstall
+
+    install -vD -t $out/bin bwa
+    install -vD -t $out/lib libbwa.a
+    install -vD -t $out/include bntseq.h
+    install -vD -t $out/include bwa.h
+    install -vD -t $out/include bwamem.h
+    install -vD -t $out/include bwt.h
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "A software package for mapping low-divergent sequences against a large reference genome, such as the human genome";
+    mainProgram = "bwa";
+    license     = licenses.gpl3Plus;
+    homepage    = "https://bio-bwa.sourceforge.net/";
+    maintainers = with maintainers; [ luispedro ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/cd-hit/default.nix b/nixpkgs/pkgs/applications/science/biology/cd-hit/default.nix
new file mode 100644
index 000000000000..474c0f292af4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/cd-hit/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, makeWrapper, zlib, perl, perlPackages, openmp }:
+
+stdenv.mkDerivation rec {
+  version = "4.8.1";
+  pname = "cd-hit";
+
+  src = fetchFromGitHub {
+    owner = "weizhongli";
+    repo = "cdhit";
+    rev = "V${version}";
+    sha256 = "032nva6iiwmw59gjipm1mv0xlcckhxsf45mc2qbnv19lbis0q22i";
+  };
+
+  propagatedBuildInputs = [ perl perlPackages.TextNSP perlPackages.ImageMagick ];
+
+  nativeBuildInputs = [ zlib makeWrapper ];
+  buildInputs = lib.optional stdenv.cc.isClang openmp;
+
+  makeFlags = [
+    "CC=${stdenv.cc.targetPrefix}c++" # remove once https://github.com/weizhongli/cdhit/pull/114 is merged
+    "PREFIX=$(out)/bin"
+  ];
+
+  preInstall = "mkdir -p $out/bin";
+
+  postFixup = ''
+    wrapProgram $out/bin/FET.pl --prefix PERL5LIB : $PERL5LIB
+    wrapProgram $out/bin/plot_2d.pl --prefix PERL5LIB : $PERL5LIB
+    wrapProgram $out/bin/clstr_list_sort.pl --prefix PERL5LIB : $PERL5LIB
+  '';
+  meta = with lib; {
+    description = "Clustering and comparing protein or nucleotide sequences";
+    homepage = "http://weizhongli-lab.org/cd-hit/";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.bzizou ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/clustal-omega/default.nix b/nixpkgs/pkgs/applications/science/biology/clustal-omega/default.nix
new file mode 100644
index 000000000000..6a39a889f55f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/clustal-omega/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, argtable }:
+
+stdenv.mkDerivation rec {
+  version = "1.2.4";
+  pname = "clustal-omega";
+
+  src = fetchurl {
+    url = "http://www.clustal.org/omega/${pname}-${version}.tar.gz";
+    sha256 = "1vm30mzncwdv881vrcwg11vzvrsmwy4wg80j5i0lcfk6dlld50w6";
+  };
+
+  buildInputs = [ argtable ];
+
+  preConfigure = ''
+    for f in configure \
+             src/clustal-omega-config.h \
+             src/clustal-omega-config.h \
+             src/config.h.in \
+             src/mymain.c
+    do
+      sed -i -re 's/argtable2/argtable3/g' $f
+    done
+  '';
+
+  meta = with lib; {
+    description = "General purpose multiple sequence alignment program for protein and DNA/RNA";
+    homepage = "http://www.clustal.org/omega/";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.bzizou ];
+    mainProgram = "clustalo";
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/cmtk/default.nix b/nixpkgs/pkgs/applications/science/biology/cmtk/default.nix
new file mode 100644
index 000000000000..d7d23dd2d46e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/cmtk/default.nix
@@ -0,0 +1,48 @@
+{ lib
+, stdenv
+, bzip2
+, cmake
+, fetchurl
+, fftw
+, llvmPackages
+, zlib
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "cmtk";
+  version = "3.3.2";
+
+  src = fetchurl {
+    name = "cmtk-source.tar.gz";
+    url = "https://www.nitrc.org/frs/download.php/13188/CMTK-${finalAttrs.version}-Source.tar.gz//?i_agree=1&download_now=1";
+    hash = "sha256-iE164NCOSOypZLLZfZy9RTyrS+YnY9ECqfb4QhlsMS4=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [
+    bzip2
+    fftw
+    zlib
+  ] ++ lib.optionals stdenv.cc.isClang [
+    llvmPackages.openmp
+  ];
+
+  env.NIX_CFLAGS_COMPILE = toString [
+    (lib.optionalString stdenv.cc.isGNU "-std=c++11")
+    (lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing")
+    (lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) "-Dfinite=isfinite")
+  ];
+
+  meta = with lib; {
+    description = "Computational Morphometry Toolkit";
+    mainProgram = "cmtk";
+    longDescription = ''A software toolkit for computational morphometry of
+      biomedical images, CMTK comprises a set of command line tools and a
+      back-end general-purpose library for processing and I/O'';
+    maintainers = with maintainers; [ tbenst ];
+    platforms = platforms.all;
+    license = licenses.gpl3Plus;
+    homepage = "https://www.nitrc.org/projects/cmtk/";
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/biology/conglomerate/default.nix b/nixpkgs/pkgs/applications/science/biology/conglomerate/default.nix
new file mode 100644
index 000000000000..d9092b9eeb11
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/conglomerate/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, cmake, coreutils, perlPackages, bicpl, libminc, zlib, minc_tools,
+  makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "conglomerate";
+  version = "unstable-2017-09-10";
+
+  src = fetchFromGitHub {
+    owner  = "BIC-MNI";
+    repo   = pname;
+    rev    = "7343238bc6215942c7ecc885a224f24433a291b0";
+    sha256 = "1mlqgmy3jc13bv7d01rjwldxq0p4ayqic85xcl222hhifi3w2prr";
+  };
+
+  nativeBuildInputs = [ cmake makeWrapper ];
+  buildInputs = [ libminc zlib bicpl ];
+  propagatedBuildInputs = [ coreutils minc_tools ] ++ (with perlPackages; [ perl GetoptTabular MNI-Perllib ]);
+
+  cmakeFlags = [
+    "-DLIBMINC_DIR=${libminc}/lib/cmake"
+    "-DBICPL_DIR=${bicpl}/lib"
+  ];
+
+  postFixup = ''
+    for p in $out/bin/*; do
+      wrapProgram $p --prefix PERL5LIB : $PERL5LIB --set PATH "${lib.makeBinPath [ coreutils minc_tools ]}";
+    done
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/BIC-MNI/conglomerate";
+    description = "More command-line utilities for working with MINC files";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license   = licenses.hpndUc;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/dcm2niix/default.nix b/nixpkgs/pkgs/applications/science/biology/dcm2niix/default.nix
new file mode 100644
index 000000000000..a7f30dbc075d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/dcm2niix/default.nix
@@ -0,0 +1,69 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, substituteAll
+, cmake
+, openjpeg
+, yaml-cpp
+, batchVersion ? false
+, withJpegLs ? true
+, withOpenJpeg ? true
+, withCloudflareZlib ? true
+}:
+
+let
+  cloudflareZlib = fetchFromGitHub {
+    owner = "ningfei";
+    repo = "zlib";
+    # HEAD revision of the gcc.amd64 branch on 2023-03-28. Reminder to update
+    # whenever bumping package version.
+    rev = "f49b13c3380cf9677ae9a93641ebc6f770899def";
+    sha256 = "sha256-8HNFUGx2uuEb8UrGUiqkN+uVDX83YIisT2uO1Z7GCxc=";
+  };
+in
+stdenv.mkDerivation rec {
+  version = "1.0.20230411";
+  pname = "dcm2niix";
+
+  src = fetchFromGitHub {
+    owner = "rordenlab";
+    repo = "dcm2niix";
+    rev = "v${version}";
+    sha256 = "sha256-kOVEoqrk4l6sH8iDVx1QmOYP5tCufxsWnCnn9BibZ08=";
+  };
+
+  patches = lib.optionals withCloudflareZlib [
+    (substituteAll {
+      src = ./dont-fetch-external-libs.patch;
+      inherit cloudflareZlib;
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = lib.optionals batchVersion [ yaml-cpp ]
+    ++ lib.optionals withOpenJpeg [ openjpeg openjpeg.dev ];
+
+  cmakeFlags = lib.optionals batchVersion [
+    "-DBATCH_VERSION=ON"
+    "-DYAML-CPP_DIR=${yaml-cpp}/lib/cmake/yaml-cpp"
+  ] ++ lib.optionals withJpegLs [
+    "-DUSE_JPEGLS=ON"
+  ] ++ lib.optionals withOpenJpeg [
+    "-DUSE_OPENJPEG=ON"
+    "-DOpenJPEG_DIR=${openjpeg}/lib/${openjpeg.pname}-${lib.versions.majorMinor openjpeg.version}"
+  ] ++ lib.optionals withCloudflareZlib [
+    "-DZLIB_IMPLEMENTATION=Cloudflare"
+  ];
+
+  meta = with lib; {
+    description = "DICOM to NIfTI converter";
+    mainProgram = "dcm2niix";
+    longDescription = ''
+      dcm2niix is designed to convert neuroimaging data from the DICOM format to the NIfTI format.
+    '';
+    homepage = "https://www.nitrc.org/projects/dcm2nii";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ ashgillman rbreslow ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/dcm2niix/dont-fetch-external-libs.patch b/nixpkgs/pkgs/applications/science/biology/dcm2niix/dont-fetch-external-libs.patch
new file mode 100644
index 000000000000..a8f97b434fc7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/dcm2niix/dont-fetch-external-libs.patch
@@ -0,0 +1,25 @@
+diff --git a/SuperBuild/External-CLOUDFLARE-ZLIB.cmake b/SuperBuild/External-CLOUDFLARE-ZLIB.cmake
+index 9f064eb..fe74df5 100644
+--- a/SuperBuild/External-CLOUDFLARE-ZLIB.cmake
++++ b/SuperBuild/External-CLOUDFLARE-ZLIB.cmake
+@@ -1,8 +1,5 @@
+-set(CLOUDFLARE_BRANCH gcc.amd64) # Cloudflare zlib branch
+-
+ ExternalProject_Add(zlib
+-    GIT_REPOSITORY "https://github.com/ningfei/zlib.git"
+-    GIT_TAG "${CLOUDFLARE_BRANCH}"
++    URL file://@cloudflareZlib@
+     SOURCE_DIR cloudflare-zlib
+     BINARY_DIR cloudflare-zlib-build
+     CMAKE_ARGS
+diff --git a/SuperBuild/SuperBuild.cmake b/SuperBuild/SuperBuild.cmake
+index 2a0a956..81354a7 100644
+--- a/SuperBuild/SuperBuild.cmake
++++ b/SuperBuild/SuperBuild.cmake
+@@ -1,6 +1,1 @@
+-# Check if git exists
+-find_package(Git)
+-if(NOT GIT_FOUND)
+-    message(FATAL_ERROR "Cannot find Git. Git is required for Superbuild")
+-endif()
+ 
diff --git a/nixpkgs/pkgs/applications/science/biology/deeptools/default.nix b/nixpkgs/pkgs/applications/science/biology/deeptools/default.nix
new file mode 100644
index 000000000000..2abd0825e6e3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/deeptools/default.nix
@@ -0,0 +1,65 @@
+{ lib
+, python3
+, fetchFromGitHub
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "deeptools";
+  version = "3.5.5";
+  pyproject = true;
+
+  src = fetchFromGitHub {
+    owner = "deeptools";
+    repo = "deepTools";
+    rev = "refs/tags/${version}";
+    hash = "sha256-2kSlL7Y5f/FjVtStnmz+GlTw2oymrtxOCaXlqgbQ7FU=";
+  };
+
+  nativeBuildInputs = with python3.pkgs; [
+    setuptools
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    numpy
+    numpydoc
+    scipy
+    py2bit
+    pybigwig
+    pysam
+    matplotlib
+    plotly
+    deeptoolsintervals
+    importlib-metadata
+  ];
+
+  nativeCheckInputs = with python3.pkgs; [
+    pytestCheckHook
+  ];
+
+  preCheck = ''
+    export PATH="$out/bin:$PATH"
+  '';
+
+  disabledTestPaths = [
+    # tests trip on `len(sys.argv) == 1`
+    "deeptools/test/test_bigwigAverage.py"
+    "deeptools/test/test_bigwigCompare_and_multiBigwigSummary.py"
+    "deeptools/test/test_heatmapper.py"
+    "deeptools/test/test_multiBamSummary.py"
+  ];
+
+  meta = with lib; {
+    homepage = "https://deeptools.readthedocs.io/en/develop";
+    description = "Tools for exploring deep DNA sequencing data";
+    longDescription = ''
+      deepTools contains useful modules to process the mapped reads data for multiple
+      quality checks, creating normalized coverage files in standard bedGraph and bigWig
+      file formats, that allow comparison between different files (for example, treatment and control).
+      Finally, using such normalized and standardized files, deepTools can create many
+      publication-ready visualizations to identify enrichments and for functional
+      annotations of the genome.
+    '';
+    license = with licenses; [ mit bsd3 ];
+    maintainers = with maintainers; [ scalavision ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/delly/default.nix b/nixpkgs/pkgs/applications/science/biology/delly/default.nix
new file mode 100644
index 000000000000..34ea942b4f5c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/delly/default.nix
@@ -0,0 +1,70 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, boost
+, bzip2
+, htslib
+, llvmPackages
+, xz
+, zlib
+, delly
+, runCommand
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "delly";
+  version = "1.2.6";
+
+  src = fetchFromGitHub {
+    owner = "dellytools";
+    repo = "delly";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-OO5nnaIcfNAV8pc03Z8YS5kE96bFOrJXA9QTiLi7vPc=";
+  };
+
+  buildInputs = [
+    boost
+    bzip2
+    htslib
+    xz
+    zlib
+  ] ++ lib.optional stdenv.isDarwin llvmPackages.openmp;
+
+  makeFlags = [
+    "EBROOTHTSLIB=${htslib}"
+    "PARALLEL=1"
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm555 src/delly $out/bin/delly
+
+    runHook postInstall
+  '';
+
+  passthru.tests = {
+    simple = runCommand "${finalAttrs.pname}-test" { } ''
+      mkdir $out
+      ${lib.getExe delly} call -g ${delly.src}/example/ref.fa ${delly.src}/example/sr.bam > $out/sr.vcf
+      ${lib.getExe delly} lr -g ${delly.src}/example/ref.fa ${delly.src}/example/lr.bam > $out/lr.vcf
+      ${lib.getExe delly} cnv -g ${delly.src}/example/ref.fa -m ${delly.src}/example/map.fa.gz ${delly.src}/example/sr.bam > cnv.vcf
+    '';
+  };
+
+  meta = with lib; {
+    description = "Structural variant caller for mapped DNA sequenced data";
+    mainProgram = "delly";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ scalavision ];
+    platforms = platforms.unix;
+    longDescription = ''
+      Delly is an integrated structural variant (SV) prediction method
+      that can discover, genotype and visualize deletions, tandem duplications,
+      inversions and translocations at single-nucleotide resolution in
+      short-read massively parallel sequencing data. It uses paired-ends,
+      split-reads and read-depth to sensitively and accurately delineate
+      genomic rearrangements throughout the genome.
+    '';
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/biology/diamond/default.nix b/nixpkgs/pkgs/applications/science/biology/diamond/default.nix
new file mode 100644
index 000000000000..f3afff0f5eb7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/diamond/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, cmake, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "diamond";
+  version = "2.1.9";
+
+  src = fetchFromGitHub {
+    owner = "bbuchfink";
+    repo = "diamond";
+    rev = "v${version}";
+    sha256 = "sha256-cTg9TEpz3FSgX2tpfU4y55cCgFY5+mQY86FziHAwd+s=";
+  };
+
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib ];
+
+  meta = with lib; {
+    description = "Accelerated BLAST compatible local sequence aligner";
+    mainProgram = "diamond";
+    longDescription = ''
+      DIAMOND is a sequence aligner for protein and translated DNA searches, designed for high performance analysis of big sequence data. The key features are:
+      - Pairwise alignment of proteins and translated DNA at 100x-10,000x speed of BLAST.
+      - Frameshift alignments for long read analysis.
+      - Low resource requirements and suitable for running on standard desktops or laptops.
+      - Various output formats, including BLAST pairwise, tabular and XML, as well as taxonomic classification.
+
+      When using the tool in published research, please cite:
+      - Buchfink B, Reuter K, Drost HG, "Sensitive protein alignments at tree-of-life scale using DIAMOND", Nature Methods 18, 366–368 (2021). doi:10.1038/s41592-021-01101-x
+    '';
+    homepage = "https://github.com/bbuchfink/diamond";
+    license = lib.licenses.gpl3Plus;
+    maintainers = with lib.maintainers; [ thyol ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/dssp/default.nix b/nixpkgs/pkgs/applications/science/biology/dssp/default.nix
new file mode 100644
index 000000000000..6c7157a91764
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/dssp/default.nix
@@ -0,0 +1,61 @@
+{ lib
+, stdenv
+, cmake
+, eigen
+, fetchFromGitHub
+, fetchpatch
+, libcifpp
+, libmcfp
+, zlib
+}:
+let
+  libcifpp' = libcifpp.overrideAttrs (oldAttrs: {
+    # dssp 4.4.3 requires specific version "5.2.0" of libcifpp
+    version = "5.2.0";
+    src = fetchFromGitHub {
+      inherit (oldAttrs.src) owner repo rev;
+      hash = "sha256-Sj10j6HxUoUvQ66cd2B8CO7CVBRd7w9CTovxkwPDOvs=";
+    };
+    patches = [
+      (fetchpatch {
+        # https://github.com/PDB-REDO/libcifpp/issues/51
+        name = "fix-build-on-darwin.patch";
+        url = "https://github.com/PDB-REDO/libcifpp/commit/641f06a7e7c0dc54af242b373820f2398f59e7ac.patch";
+        hash = "sha256-eWNfp9nA/+2J6xjZR6Tj+5OM3L5MxdfRi0nBzyaqvS0=";
+      })
+    ];
+  });
+in
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "dssp";
+  version = "4.4.5";
+
+  src = fetchFromGitHub {
+    owner = "PDB-REDO";
+    repo = "dssp";
+    rev = "refs/tags/v${finalAttrs.version}";
+    hash = "sha256-X0aMWqoMhmQVRHWKVm2S6JAOYiBuBBMzMoivMdpNx0M=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = [
+    eigen
+    libcifpp'
+    libmcfp
+    zlib
+  ];
+
+  meta = with lib; {
+    description = "Calculate the most likely secondary structure assignment given the 3D structure of a protein";
+    mainProgram = "mkdssp";
+    homepage = "https://github.com/PDB-REDO/dssp";
+    changelog = "https://github.com/PDB-REDO/libcifpp/releases/tag/${finalAttrs.src.rev}";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ natsukium ];
+    platforms = platforms.unix;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/biology/ecopcr/default.nix b/nixpkgs/pkgs/applications/science/biology/ecopcr/default.nix
new file mode 100644
index 000000000000..c5ab32a68838
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/ecopcr/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, gcc, zlib, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "ecopcr";
+  version = "1.0.1";
+
+  src = fetchurl {
+    url = "https://git.metabarcoding.org/obitools/ecopcr/-/archive/ecopcr_v${version}/ecopcr-ecopcr_v${version}.tar.gz";
+    hash = "sha256-ssvWpi7HuuRRAkpqqrX3ijLuBqM3QsrmrG+t7/m6fZA=";
+  };
+
+  buildInputs = [ gcc python3 zlib ];
+
+  preConfigure = ''
+    cd src
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -v ecoPCR $out/bin
+    cp -v ecogrep $out/bin
+    cp -v ecofind $out/bin
+    cp -v ../tools/ecoPCRFormat.py $out/bin/ecoPCRFormat
+    chmod a+x $out/bin/ecoPCRFormat
+  '';
+
+  meta = with lib; {
+    description = "Electronic PCR software tool";
+    longDescription = ''
+      ecoPCR is an electronic PCR software developed by the LECA. It
+      helps you estimate Barcode primers quality. In conjunction with
+      OBITools, you can postprocess ecoPCR output to compute barcode
+      coverage and barcode specificity. New barcode primers can be
+      developed using the ecoPrimers software.
+    '';
+    homepage = "https://git.metabarcoding.org/obitools/ecopcr/wikis/home";
+    license = licenses.cecill20;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/eggnog-mapper/default.nix b/nixpkgs/pkgs/applications/science/biology/eggnog-mapper/default.nix
new file mode 100644
index 000000000000..d7bba930abca
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/eggnog-mapper/default.nix
@@ -0,0 +1,54 @@
+{ lib
+, autoPatchelfHook
+, fetchFromGitHub
+, python3Packages
+, wget
+, zlib
+}:
+
+python3Packages.buildPythonApplication rec {
+  pname = "eggnog-mapper";
+  version = "2.1.12";
+
+  src = fetchFromGitHub {
+    owner = "eggnogdb";
+    repo = pname;
+    rev = "refs/tags/${version}";
+    hash = "sha256-+luxXQmtGufYrA/9Ak3yKzbotOj2HM3vhIoOxE+Ty1U=";
+  };
+
+  postPatch = ''
+    # Not a great solution...
+    substituteInPlace setup.cfg \
+      --replace "==" ">="
+  '';
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+  ];
+
+  buildInputs = [
+    zlib
+  ];
+
+  propagatedBuildInputs = [
+    wget
+  ] ++ (with python3Packages; [
+    biopython
+    psutil
+    xlsxwriter
+  ]);
+
+  # Tests rely on some of the databases being available, which is not bundled
+  # with this package as (1) in total, they represent >100GB of data, and (2)
+  # the user can download only those that interest them.
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Fast genome-wide functional annotation through orthology assignment";
+    license = licenses.gpl2;
+    homepage = "https://github.com/eggnogdb/eggnog-mapper/wiki";
+    maintainers = with maintainers; [ luispedro ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/emboss/default.nix b/nixpkgs/pkgs/applications/science/biology/emboss/default.nix
new file mode 100644
index 000000000000..d590a5da8a67
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/emboss/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, readline, perl, libharu, libX11, libpng, libXt, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "emboss";
+  version = "6.6.0";
+
+  src = fetchurl {
+    url = "ftp://emboss.open-bio.org/pub/EMBOSS/EMBOSS-${version}.tar.gz";
+    sha256 = "7184a763d39ad96bb598bfd531628a34aa53e474db9e7cac4416c2a40ab10c6e";
+  };
+
+  buildInputs = [ readline perl libharu libpng libX11 libXt zlib ];
+
+  configureFlags = [ "--with-hpdf=${libharu}" "--with-pngdriver=${zlib}" ];
+
+  postConfigure = ''
+    sed -i 's@$(bindir)/embossupdate@true@' Makefile
+  '';
+
+  meta = {
+    description = "The European Molecular Biology Open Software Suite";
+    longDescription = ''EMBOSS is a free Open Source software analysis package
+    specially developed for the needs of the molecular biology (e.g. EMBnet)
+    user community, including libraries. The software automatically copes with
+    data in a variety of formats and even allows transparent retrieval of
+    sequence data from the web.'';
+    license = lib.licenses.gpl2;
+    homepage = "https://emboss.sourceforge.net/";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/est-sfs/default.nix b/nixpkgs/pkgs/applications/science/biology/est-sfs/default.nix
new file mode 100644
index 000000000000..c306cfd71c39
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/est-sfs/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, gsl }:
+
+stdenv.mkDerivation rec {
+  pname = "est-sfs";
+  version = "2.03";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/est-usfs/${pname}-release-${version}.tar.gz";
+    sha256 = "1hvamrgagz0xi89w8qafyd9mjrdpyika8zm22drddnjkp4sdj65n";
+  };
+
+  buildInputs = [ gsl ];
+
+  makeFlags = [
+    "CC=${stdenv.cc.targetPrefix}cc"
+  ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mkdir -p $out/share/doc/${pname}
+    cp est-sfs $out/bin
+    cp est-sfs-documentation.pdf $out/share/doc/${pname}
+  '';
+
+  meta = with lib; {
+    homepage = "https://sourceforge.net/projects/est-usfs";
+    description = "Estimate the unfolded site frequency spectrum and ancestral states";
+    mainProgram = "est-sfs";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.bzizou ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/exonerate/default.nix b/nixpkgs/pkgs/applications/science/biology/exonerate/default.nix
new file mode 100644
index 000000000000..f7b6bf6c14ce
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/exonerate/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, glib, pkg-config }:
+
+stdenv.mkDerivation rec {
+  version = "2.4.0";
+  pname = "exonerate";
+
+  src = fetchurl {
+    url = "http://ftp.ebi.ac.uk/pub/software/vertebrategenomics/exonerate/${pname}-${version}.tar.gz";
+    sha256 = "0hj0m9xygiqsdxvbg79wq579kbrx1mdrabi2bzqz2zn9qwfjcjgq";
+  };
+
+  doCheck = true;
+
+  buildInputs = [ glib ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  meta = with lib; {
+    description = "Generic tool for sequence alignment";
+    homepage = "https://www.ebi.ac.uk/about/vertebrate-genomics/software/exonerate";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.bzizou ];
+    platforms = platforms.unix ;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/fastp/default.nix b/nixpkgs/pkgs/applications/science/biology/fastp/default.nix
new file mode 100644
index 000000000000..0495da0e3c3d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/fastp/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, zlib
+, libdeflate
+, isa-l
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fastp";
+  version = "0.23.4";
+
+  src = fetchFromGitHub {
+    owner = "OpenGene";
+    repo = "fastp";
+    rev = "v${version}";
+    sha256 = "sha256-hkCo8CiZNJuVcL9Eg/R7YzM7/FEcGEnovV325oWa7y8=";
+  };
+
+  buildInputs = [ zlib libdeflate isa-l ];
+
+  installPhase = ''
+    install -D fastp $out/bin/fastp
+  '';
+
+  meta = with lib; {
+    description = "Ultra-fast all-in-one FASTQ preprocessor";
+    mainProgram = "fastp";
+    license = licenses.mit;
+    homepage = "https://github.com/OpenGene/fastp";
+    maintainers = with maintainers; [ jbedo ];
+    platforms = platforms.x86_64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/febio-studio/default.nix b/nixpkgs/pkgs/applications/science/biology/febio-studio/default.nix
new file mode 100644
index 000000000000..708bd0f4305a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/febio-studio/default.nix
@@ -0,0 +1,62 @@
+{ lib, stdenv, fetchFromGitHub, cmake, zlib, libglvnd, libGLU, wrapQtAppsHook
+, sshSupport ? true, openssl, libssh
+, tetgenSupport ? true, tetgen
+, ffmpegSupport ? true, ffmpeg_4
+, dicomSupport  ? false, dcmtk
+, withModelRepo ? true
+, withCadFeatures ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "febio-studio";
+  version = "1.6.1";
+
+  src = fetchFromGitHub {
+    owner = "febiosoftware";
+    repo = "FEBioStudio";
+    rev = "v${version}";
+    sha256 = "0r6pg49i0q9idp7pjymj7mlxd63qjvmfvg0l7fmx87y1yd2hfw4h";
+  };
+
+  patches = [
+    ./febio-studio-cmake.patch # Fix Errors that appear with certain Cmake flags
+  ];
+
+  cmakeFlags = [
+    "-DQt_Ver=5"
+    "-DNOT_FIRST=On"
+    "-DOpenGL_GL_PREFERENCE=GLVND"
+  ]
+    ++ lib.optional sshSupport "-DUSE_SSH=On"
+    ++ lib.optional tetgenSupport "-DUSE_TETGEN=On"
+    ++ lib.optional ffmpegSupport "-DUSE_FFMPEG=On"
+    ++ lib.optional dicomSupport "-DUSE_DICOM=On"
+    ++ lib.optional withModelRepo "-DMODEL_REPO=On"
+    ++ lib.optional withCadFeatures "-DCAD_FEATURES=On"
+  ;
+
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/
+    cp -R bin $out/
+    runHook postInstall
+  '';
+
+  nativeBuildInputs = [ cmake wrapQtAppsHook ];
+  buildInputs = [ zlib libglvnd libGLU openssl libssh ]
+    ++ lib.optional sshSupport openssl
+    ++ lib.optional tetgenSupport tetgen
+    ++ lib.optional ffmpegSupport ffmpeg_4
+    ++ lib.optional dicomSupport dcmtk
+  ;
+
+  meta = with lib; {
+    description = "FEBio Suite Solver";
+    mainProgram = "FEBioStudio";
+    license = with licenses; [ mit ];
+    homepage = "https://febio.org/";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ Scriptkiddi ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/febio-studio/febio-studio-cmake.patch b/nixpkgs/pkgs/applications/science/biology/febio-studio/febio-studio-cmake.patch
new file mode 100644
index 000000000000..e694f6c3b89f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/febio-studio/febio-studio-cmake.patch
@@ -0,0 +1,38 @@
+diff --git a/FEBioStudio/RepositoryPanel.cpp b/FEBioStudio/RepositoryPanel.cpp
+index 382db303..314cdc68 100644
+--- a/FEBioStudio/RepositoryPanel.cpp
++++ b/FEBioStudio/RepositoryPanel.cpp
+@@ -1364,10 +1364,10 @@ void CRepositoryPanel::loadingPageProgress(qint64 bytesSent, qint64 bytesTotal)
+ 

+ #else

+ 

+-CRepositoryPanel::CRepositoryPanel(CMainWindow* pwnd, QWidget* parent){}

++CRepositoryPanel::CRepositoryPanel(CMainWindow* pwnd, QDockWidget* parent){}

+ CRepositoryPanel::~CRepositoryPanel(){}

+ void CRepositoryPanel::OpenLink(const QString& link) {}

+-// void CRepositoryPanel::Raise() {}

++void CRepositoryPanel::Raise() {}

+ void CRepositoryPanel::SetModelList(){}

+ void CRepositoryPanel::ShowMessage(QString message) {}

+ void CRepositoryPanel::ShowWelcomeMessage(QByteArray messages) {}

+@@ -1396,6 +1396,7 @@ void CRepositoryPanel::on_actionSearch_triggered() {}
+ void CRepositoryPanel::on_actionClearSearch_triggered() {}

+ void CRepositoryPanel::on_actionDeleteRemote_triggered() {}

+ void CRepositoryPanel::on_actionModify_triggered() {}

++void CRepositoryPanel::on_actionCopyPermalink_triggered() {}

+ void CRepositoryPanel::on_treeWidget_itemSelectionChanged() {}

+ void CRepositoryPanel::on_treeWidget_customContextMenuRequested(const QPoint &pos) {}

+ void CRepositoryPanel::DownloadItem(CustomTreeWidgetItem *item) {}

+diff --git a/FEBioStudio/WzdUpload.cpp b/FEBioStudio/WzdUpload.cpp
+index 5ce74346..20062e06 100644
+--- a/FEBioStudio/WzdUpload.cpp
++++ b/FEBioStudio/WzdUpload.cpp
+@@ -1183,7 +1183,7 @@ void CWzdUpload::on_saveJson_triggered()
+ 		getProjectJson(&projectInfo);
+ 
+ 		QFile file(filedlg.selectedFiles()[0]);
+-		file.open(QIODeviceBase::WriteOnly);
++		file.open(QIODevice::WriteOnly);
+ 		file.write(projectInfo);
+ 		file.close();
+ 	}
diff --git a/nixpkgs/pkgs/applications/science/biology/flywheel-cli/default.nix b/nixpkgs/pkgs/applications/science/biology/flywheel-cli/default.nix
new file mode 100644
index 000000000000..51600d31c513
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/flywheel-cli/default.nix
@@ -0,0 +1,51 @@
+{ lib
+, stdenv
+, fetchurl
+, unzip
+}:
+
+let
+  inherit (stdenv.hostPlatform) system;
+  throwSystem = throw "Unsupported system: ${system}";
+
+  os = {
+    x86_64-darwin = "darwin";
+    x86_64-linux = "linux";
+  }.${system} or throwSystem;
+
+  sha256 = {
+    x86_64-darwin = "sha256-OIyEu3Hsobui9s5+T9nC10SxMw0MhgmTA4SN9Ridyzo=";
+    x86_64-linux = "sha256-SxBjRd95hoh2zwX6IDnkZnTWVduQafPHvnWw8qTuM78=";
+  }.${system} or throwSystem;
+in
+stdenv.mkDerivation rec {
+  pname = "flywheel-cli";
+  version = "16.2.0";
+
+  src = fetchurl {
+    url = "https://storage.googleapis.com/flywheel-dist/cli/${version}/fw-${os}_amd64-${version}.zip";
+    inherit sha256;
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  unpackPhase = ''
+    unzip ${src}
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    install -Dt $out/bin ./${os}_amd64/fw
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Library and command line interface for interacting with a Flywheel site";
+    mainProgram = "fw";
+    homepage = "https://gitlab.com/flywheel-io/public/python-cli";
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    license = licenses.mit;
+    maintainers = with maintainers; [ rbreslow ];
+    platforms = [ "x86_64-darwin" "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/freebayes/default.nix b/nixpkgs/pkgs/applications/science/biology/freebayes/default.nix
new file mode 100644
index 000000000000..0ceaab4ab46b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/freebayes/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, zlib, bzip2, xz }:
+
+stdenv.mkDerivation rec {
+  pname = "freebayes";
+  version = "1.3.1";
+
+  src = fetchFromGitHub {
+    name = "freebayes-${version}-src";
+    owner  = "ekg";
+    repo   = "freebayes";
+    rev    = "v${version}";
+    sha256 = "035nriknjqq8gvil81vvsmvqwi35v80q8h1cw24vd1gdyn1x7bys";
+    fetchSubmodules = true;
+  };
+
+  buildInputs = [ zlib bzip2 xz ];
+
+  # Workaround build failure on -fno-common toolchains like upstream
+  # gcc-10. Otherwise build fails as:
+  #   ld: foomatic_rip-options.o:/build/foomatic-filters-4.0.17/options.c:49: multiple definition of `cupsfilter';
+  #     foomatic_rip-foomaticrip.o:/build/foomatic-filters-4.0.17/foomaticrip.c:158: first defined here
+  env.NIX_CFLAGS_COMPILE = "-fcommon";
+
+  installPhase = ''
+    install -vD bin/freebayes bin/bamleftalign scripts/* -t $out/bin
+  '';
+
+  meta = with lib; {
+    description = "Bayesian haplotype-based polymorphism discovery and genotyping";
+    license     = licenses.mit;
+    homepage    = "https://github.com/ekg/freebayes";
+    maintainers = with maintainers; [ jdagilliland ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/gatk/default.nix b/nixpkgs/pkgs/applications/science/biology/gatk/default.nix
new file mode 100644
index 000000000000..9884e3a77111
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/gatk/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchzip, jre, makeWrapper, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "gatk";
+  version = "4.5.0.0";
+  src = fetchzip {
+    url = "https://github.com/broadinstitute/gatk/releases/download/${version}/gatk-${version}.zip";
+    sha256 = "sha256-c3YZsSCjZY75jooiqtc8x/xsWTvYm9labUcOydDlSRQ=";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ python3 ];
+
+  dontUnpack = true;
+
+  installPhase = ''
+    mkdir -p $out/bin
+    install -m755 -D $src/gatk-package-${version}-local.jar $out/bin/
+    install -m755 -D $src/gatk-package-${version}-spark.jar $out/bin/
+    install -m755 -D $src/gatk $out/bin/
+  '';
+  postFixup = ''
+    wrapProgram $out/bin/gatk --prefix PATH : ${lib.makeBinPath [ jre ]}
+  '';
+
+  meta = with lib; {
+    homepage = "https://gatk.broadinstitute.org/hc/en-us";
+    description = "A wide variety of tools with a primary focus on variant discovery and genotyping." ;
+    license = licenses.asl20;
+    sourceProvenance = with lib.sourceTypes; [ binaryBytecode ] ;
+    maintainers = with maintainers; [ apraga ];
+    longDescription = ''
+      The GATK is the industry standard for identifying SNPs and indels in germline
+      DNA and RNAseq data. Its scope is now expanding to include somatic short variant
+      calling, and to tackle copy number (CNV) and structural variation (SV). In
+      addition to the variant callers themselves, the GATK also includes many
+      utilities to perform related tasks such as processing and quality control of
+      high-throughput sequencing data, and bundles the popular Picard toolkit.
+
+      These tools were primarily designed to process exomes and whole genomes
+      generated with Illumina sequencing technology, but they can be adapted to handle
+      a variety of other technologies and experimental designs. And although it was
+      originally developed for human genetics, the GATK has since evolved to handle
+      genome data from any organism, with any level of ploidy.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/genmap/default.nix b/nixpkgs/pkgs/applications/science/biology/genmap/default.nix
new file mode 100644
index 000000000000..235135cb6050
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/genmap/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, gtest
+, which
+}:
+
+stdenv.mkDerivation rec {
+  pname = "genmap";
+  version = "1.3.0";
+
+  src = fetchFromGitHub {
+    owner = "cpockrandt";
+    repo = "genmap";
+    rev = "genmap-v${version}";
+    fetchSubmodules = true;
+    sha256 = "sha256-7sIKBRMNzyCrZ/c2nXkknb6a5YsXe6DRE2IFhp6AviY=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  doCheck = true;
+  patches = [ ./gtest.patch ];
+  nativeCheckInputs = [ gtest which ];
+  preCheck = "make genmap_algo_test";
+
+  # disable benchmarks
+  preConfigure = ''
+    echo > benchmarks/CMakeLists.txt
+  '';
+
+  meta = {
+    description = "Ultra-fast computation of genome mappability";
+    mainProgram = "genmap";
+    license = lib.licenses.bsd3;
+    homepage = "https://github.com/cpockrandt/genmap";
+    maintainers = with lib.maintainers; [ jbedo ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/genmap/gtest.patch b/nixpkgs/pkgs/applications/science/biology/genmap/gtest.patch
new file mode 100644
index 000000000000..f01d0e115eb5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/genmap/gtest.patch
@@ -0,0 +1,30 @@
+diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
+index 67ec8f9..ed0b2e0 100644
+--- a/tests/CMakeLists.txt
++++ b/tests/CMakeLists.txt
+@@ -2,23 +2,14 @@
+ #  GenMap tests
+ # ===========================================================================
+ 
+-include (ExternalProject)
+-ExternalProject_Add (googletest
+-                     PREFIX "${CMAKE_CURRENT_BINARY_DIR}/googletest"
+-                     GIT_REPOSITORY "https://github.com/google/googletest.git"
+-                     INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}"
+-                     CMAKE_ARGS "-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR}"
+-                     GIT_TAG release-1.10.0
+-                     UPDATE_DISCONNECTED YES)
+ 
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") # TODO: --coverage
+ add_executable (genmap_algo_test tests.cpp)
+-add_dependencies (genmap_algo_test googletest)
+ 
+ include_directories (${CMAKE_CURRENT_BINARY_DIR}/include)
+ target_link_libraries (genmap_algo_test ${SEQAN_LIBRARIES})
+-target_link_libraries (genmap_algo_test ${CMAKE_CURRENT_BINARY_DIR}/lib/libgtest.a)
+-target_link_libraries (genmap_algo_test ${CMAKE_CURRENT_BINARY_DIR}/lib/libgtest_main.a)
++target_link_libraries (genmap_algo_test -lgtest)
++target_link_libraries (genmap_algo_test -lgtest_main)
+ target_link_libraries (genmap_algo_test pthread)
+ 
+ add_test(NAME algo_test COMMAND genmap_algo_test)
diff --git a/nixpkgs/pkgs/applications/science/biology/hh-suite/default.nix b/nixpkgs/pkgs/applications/science/biology/hh-suite/default.nix
new file mode 100644
index 000000000000..76c6544b3430
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/hh-suite/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, xxd
+, enableMpi ? false
+, mpi
+, openmp
+}:
+stdenv.mkDerivation rec {
+  pname = "hh-suite";
+  version = "3.3.0";
+
+  src = fetchFromGitHub {
+    owner = "soedinglab";
+    repo = "hh-suite";
+    rev = "v${version}";
+    hash = "sha256-kjNqJddioCZoh/cZL3YNplweIGopWIGzCYQOnKDqZmw=";
+  };
+
+  patches = [
+    # Should be removable as soon as this upstream PR is merged: https://github.com/soedinglab/hh-suite/pull/357
+    (fetchpatch {
+      name = "fix-gcc13-build-issues.patch";
+      url = "https://github.com/soedinglab/hh-suite/commit/cec47cba5dcd580e668b1ee507c9282fbdc8e7d7.patch";
+      hash = "sha256-Msdmj9l8voPYXK0SSwUA6mEbFLBhTjjE/Kjp0VL4Kf4=";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake xxd ];
+  cmakeFlags = lib.optional stdenv.hostPlatform.isx86 "-DHAVE_SSE2=1"
+    ++ lib.optional stdenv.hostPlatform.isAarch "-DHAVE_ARM8=1"
+    ++ lib.optional stdenv.hostPlatform.avx2Support "-DHAVE_AVX2=1"
+    ++ lib.optional stdenv.hostPlatform.sse4_1Support "-DHAVE_SSE4_1=1";
+
+  buildInputs = lib.optional stdenv.cc.isClang openmp
+    ++ lib.optional enableMpi mpi;
+
+  meta = with lib; {
+    description = "Remote protein homology detection suite";
+    homepage = "https://github.com/soedinglab/hh-suite";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ natsukium ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/hisat2/default.nix b/nixpkgs/pkgs/applications/science/biology/hisat2/default.nix
new file mode 100644
index 000000000000..67c39031b773
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/hisat2/default.nix
@@ -0,0 +1,46 @@
+{lib, stdenv, fetchFromGitHub, unzip, which, python3, perl}:
+
+stdenv.mkDerivation rec {
+  pname = "hisat2";
+  version = "2.2.1";
+
+  src = fetchFromGitHub {
+    owner = "DaehwanKimLab";
+    repo = "hisat2";
+    rev = "v${version}";
+    sha256 = "0lmzdhzjkvxw7n5w40pbv5fgzd4cz0f9pxczswn3d4cr0k10k754";
+  };
+
+  nativeBuildInputs = [ unzip which ];
+  buildInputs = [ python3 perl ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp hisat2 \
+       hisat2-inspect-l \
+       hisat2-build-s \
+       hisat2-align-l \
+       hisat2-inspect \
+       hisat2-align-s \
+       hisat2-inspect-s \
+       hisat2-build-l \
+       hisat2-build \
+       extract_exons.py \
+       extract_splice_sites.py \
+       hisat2_extract_exons.py \
+       hisat2_extract_snps_haplotypes_UCSC.py \
+       hisat2_extract_snps_haplotypes_VCF.py \
+       hisat2_extract_splice_sites.py \
+       hisat2_simulate_reads.py \
+       $out/bin
+  '';
+
+  meta = with lib; {
+    description = "Graph based aligner";
+    license = licenses.gpl3Plus;
+    homepage = "https://daehwankimlab.github.io/hisat2/";
+    maintainers = with maintainers; [ jbedo ];
+    platforms = [ "x86_64-linux" "i686-linux" ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/hmmer/default.nix b/nixpkgs/pkgs/applications/science/biology/hmmer/default.nix
new file mode 100644
index 000000000000..243e067ddec3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/hmmer/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "3.4";
+  pname = "hmmer";
+
+  src = fetchurl {
+    url = "http://eddylab.org/software/hmmer/${pname}-${version}.tar.gz";
+    sha256 = "sha256-ynDZT9DPJxvXBjQjqrsRbULeUzEXNDqbJ6ZcF/8G+/M=";
+  };
+
+  meta = with lib; {
+    description = "Biosequence analysis using profile hidden Markov models";
+    longDescription = ''
+      HMMER is used for searching sequence databases for sequence homologs, and for making sequence alignments. It implements methods using probabilistic models called profile hidden Markov models (profile HMMs).
+      HMMER is often used together with a profile database, such as Pfam or many of the databases that participate in Interpro. But HMMER can also work with query sequences, not just profiles, just like BLAST. For example, you can search a protein query sequence against a database with phmmer, or do an iterative search with jackhmmer.
+      HMMER is designed to detect remote homologs as sensitively as possible, relying on the strength of its underlying probability models. In the past, this strength came at significant computational expense, but as of the new HMMER3 project, HMMER is now essentially as fast as BLAST.
+      HMMER can be downloaded and installed as a command line tool on your own hardware, and now it is also more widely accessible to the scientific community via new search servers at the European Bioinformatics Institute.
+    '';
+    homepage = "http://hmmer.org/";
+    changelog = "https://github.com/EddyRivasLab/hmmer/blob/hmmer-${version}/release-notes/RELEASE-${version}.md";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.iimog ];
+    # at least SSE is *required*
+    platforms = platforms.x86_64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/igv/default.nix b/nixpkgs/pkgs/applications/science/biology/igv/default.nix
new file mode 100644
index 000000000000..0d8d87ac4109
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/igv/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchzip, jdk17, testers, wrapGAppsHook, igv }:
+
+stdenv.mkDerivation rec {
+  pname = "igv";
+  version = "2.17.3";
+  src = fetchzip {
+    url = "https://data.broadinstitute.org/igv/projects/downloads/${lib.versions.majorMinor version}/IGV_${version}.zip";
+    sha256 = "sha256-SGqkWBv4nol0+lnGN7wBHJvndcIqZ5+Wt1wAcXA42cU=";
+  };
+
+  installPhase = ''
+    mkdir -pv $out/{share,bin}
+    cp -Rv * $out/share/
+
+    sed -i "s#prefix=.*#prefix=$out/share#g" $out/share/igv.sh
+    sed -i 's#java#${jdk17}/bin/java#g' $out/share/igv.sh
+
+    sed -i "s#prefix=.*#prefix=$out/share#g" $out/share/igvtools
+    sed -i 's#java#${jdk17}/bin/java#g' $out/share/igvtools
+
+    ln -s $out/share/igv.sh $out/bin/igv
+    ln -s $out/share/igvtools $out/bin/igvtools
+
+    chmod +x $out/bin/igv
+    chmod +x $out/bin/igvtools
+  '';
+  nativeBuildInputs = [ wrapGAppsHook ];
+
+  passthru.tests.version = testers.testVersion {
+    package = igv;
+  };
+
+
+  meta = with lib; {
+    homepage = "https://www.broadinstitute.org/igv/";
+    description = "A visualization tool for interactive exploration of genomic datasets";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.mimame ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/inormalize/default.nix b/nixpkgs/pkgs/applications/science/biology/inormalize/default.nix
new file mode 100644
index 000000000000..bf24f0ce19bf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/inormalize/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper,
+  perlPackages,
+  libminc, ebtks }:
+
+stdenv.mkDerivation rec {
+  pname = "inormalize";
+  version  = "unstable-2014-10-21";
+
+  src = fetchFromGitHub {
+    owner  = "BIC-MNI";
+    repo   = pname;
+    rev    = "79cea9cdfe7b99abfd40afda89ab2253b596ad2f";
+    sha256 = "1ahqv5q0ljvji99a5q8azjkdf6bgp6nr8lwivkqwqs3jm0k5clq7";
+  };
+
+  patches = [ ./lgmask-interp.patch ./nu_correct_norm-interp.patch ];
+
+  postPatch = ''
+    substituteInPlace inormalize.cc \
+      --replace "clamp" "::clamp"
+  '';
+
+  nativeBuildInputs = [ cmake makeWrapper ];
+  buildInputs = [ libminc ebtks ];
+  propagatedBuildInputs = with perlPackages; [ perl GetoptTabular MNI-Perllib ];
+
+  cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/cmake" "-DEBTKS_DIR=${ebtks}/lib/" ];
+
+  postFixup = ''
+    for p in $out/bin/*; do
+      wrapProgram $p --prefix PERL5LIB : $PERL5LIB
+    done
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/BIC-MNI/${pname}";
+    description = "Program to normalize intensity of MINC files";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license   = licenses.free;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/inormalize/lgmask-interp.patch b/nixpkgs/pkgs/applications/science/biology/inormalize/lgmask-interp.patch
new file mode 100644
index 000000000000..953bce9a1848
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/inormalize/lgmask-interp.patch
@@ -0,0 +1,10 @@
+diff --git a/lgmask.in b/lgmask.in
+index 17dbe4d..2195d91 100644
+--- a/lgmask.in
++++ b/lgmask.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/env perl
+ 
+ #---------------------------------------------------------------------------
+ #@COPYRIGHT :
diff --git a/nixpkgs/pkgs/applications/science/biology/inormalize/nu_correct_norm-interp.patch b/nixpkgs/pkgs/applications/science/biology/inormalize/nu_correct_norm-interp.patch
new file mode 100644
index 000000000000..75dc46a799ce
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/inormalize/nu_correct_norm-interp.patch
@@ -0,0 +1,10 @@
+diff --git a/nu_correct_norm.in b/nu_correct_norm.in
+index 1dc84ac..1bc6235 100644
+--- a/nu_correct_norm.in
++++ b/nu_correct_norm.in
+@@ -1,4 +1,4 @@
+-#! @PERL@
++#! /usr/bin/perl
+  
+ #---------------------------------------------------------------------------
+ #@COPYRIGHT :
diff --git a/nixpkgs/pkgs/applications/science/biology/iqtree/default.nix b/nixpkgs/pkgs/applications/science/biology/iqtree/default.nix
new file mode 100644
index 000000000000..17b2ba9f9bde
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/iqtree/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, boost
+, eigen
+, zlib
+, llvmPackages
+}:
+
+stdenv.mkDerivation rec {
+  pname = "iqtree";
+  version = "2.2.2.7";
+
+  src = fetchFromGitHub {
+    owner = "iqtree";
+    repo = "iqtree2";
+    rev = "v${version}";
+    hash = "sha256-XyjVo5TYMoB+ZOAGc4ivYqFGnEO1M7mhxXrG45TP44Y=";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [
+    boost
+    eigen
+    zlib
+  ] ++ lib.optionals stdenv.isDarwin [
+    llvmPackages.openmp
+  ];
+
+  meta = with lib; {
+    homepage = "http://www.iqtree.org/";
+    description = "Efficient and versatile phylogenomic software by maximum likelihood";
+    mainProgram = "iqtree2";
+    license = licenses.lgpl2;
+    maintainers = with maintainers; [ bzizou ];
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/itsx/default.nix b/nixpkgs/pkgs/applications/science/biology/itsx/default.nix
new file mode 100644
index 000000000000..366b4add2ed7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/itsx/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl, hmmer, perl }:
+
+stdenv.mkDerivation rec {
+  version = "1.1.1";
+  pname = "itsx";
+
+  src = fetchurl {
+    url = "http://microbiology.se/sw/ITSx_${version}.tar.gz";
+    sha256 = "0lrmy2n3ax7f208k0k8l3yz0j5cpz05hv4hx1nnxzn0c51z1pc31";
+  };
+
+  buildInputs = [ hmmer perl ];
+
+  buildPhase = ''
+    sed -e "s,profileDB = .*,profileDB = \"$out/share/ITSx_db/HMMs\";," -i ITSx
+    sed "3 a \$ENV{\'PATH\'}='${hmmer}/bin:'.\"\$ENV{\'PATH\'}\";" -i ITSx
+    mkdir bin
+    mv ITSx bin
+  '';
+
+  installPhase = ''
+    mkdir -p $out/share/doc && cp -a bin $out/
+    cp *pdf $out/share/doc
+    cp -r ITSx_db $out/share
+  '';
+
+  meta = with lib; {
+    description = "Improved software detection and extraction of ITS1 and ITS2 from ribosomal ITS sequences of fungi and other eukaryotes for use in environmental sequencing";
+    mainProgram = "ITSx";
+    homepage = "https://microbiology.se/software/itsx/";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.bzizou ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/iv/default.nix b/nixpkgs/pkgs/applications/science/biology/iv/default.nix
new file mode 100644
index 000000000000..ba1b91298bb3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/iv/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, stdenv
+, fetchurl
+, neuron-version
+, libX11
+, libXext
+, patchelf
+}:
+
+stdenv.mkDerivation rec {
+  pname = "iv";
+  version = "19";
+
+  src = fetchurl {
+    url = "https://www.neuron.yale.edu/ftp/neuron/versions/v${neuron-version}/iv-${version}.tar.gz";
+    sha256 = "07a3g8zzay4h0bls7fh89dd0phn7s34c2g15pij6dsnwpmjg06yx";
+  };
+
+  nativeBuildInputs = [ patchelf ];
+  buildInputs = [ libXext ];
+  propagatedBuildInputs = [ libX11 ];
+
+  hardeningDisable = [ "format" ];
+
+  postInstall = ''
+    for dir in $out/*; do # */
+      if [ -d $dir/lib ]; then
+        mv $dir/* $out # */
+        rmdir $dir
+        break
+      fi
+    done
+  '' + lib.optionalString stdenv.isLinux ''
+    patchelf --add-needed ${libX11}/lib/libX11.so $out/lib/libIVhines.so
+  '';
+
+  meta = with lib; {
+    description = "InterViews graphical library for Neuron";
+    license = licenses.bsd3;
+    homepage = "http://www.neuron.yale.edu/neuron";
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/jbrowse/default.nix b/nixpkgs/pkgs/applications/science/biology/jbrowse/default.nix
new file mode 100644
index 000000000000..15694ae3e638
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/jbrowse/default.nix
@@ -0,0 +1,40 @@
+{ lib, fetchurl, appimageTools, wrapGAppsHook }:
+
+let
+  pname = "jbrowse";
+  version = "2.5.0";
+
+  src = fetchurl {
+    url = "https://github.com/GMOD/jbrowse-components/releases/download/v${version}/jbrowse-desktop-v${version}-linux.AppImage";
+    sha256 = "sha256-YLsyA+RVoFvjE4MfAtglJYdUgic487SxwdUhvolzBPc=";
+  };
+
+  appimageContents = appimageTools.extractType2 {
+    inherit pname version src;
+  };
+
+in
+appimageTools.wrapType2 {
+  inherit pname version src;
+  unshareIpc = false;
+
+  extraInstallCommands = ''
+    mkdir -p $out/bin
+    mv $out/bin/jbrowse-${version} $out/bin/jbrowse-desktop
+
+    install -m 444 -D ${appimageContents}/jbrowse-desktop.desktop $out/share/applications/jbrowse-desktop.desktop
+    install -m 444 -D ${appimageContents}/jbrowse-desktop.png \
+       $out/share/icons/hicolor/512x512/apps/jbrowse-desktop.png
+    substituteInPlace $out/share/applications/jbrowse-desktop.desktop \
+      --replace 'Exec=AppRun --no-sandbox' 'Exec=jbrowse-desktop'
+  '';
+
+  meta = with lib; {
+    description = "The next-generation genome browser";
+    mainProgram = "jbrowse-desktop";
+    homepage = "https://jbrowse.org/jb2/";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ benwbooth ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/kalign/default.nix b/nixpkgs/pkgs/applications/science/biology/kalign/default.nix
new file mode 100644
index 000000000000..f26b679f799d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/kalign/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, stdenv
+, cmake
+, fetchFromGitHub
+, llvmPackages
+, enableSse4_1 ? stdenv.hostPlatform.sse4_1Support
+, enableAvx ? stdenv.hostPlatform.avxSupport
+, enableAvx2 ? stdenv.hostPlatform.avx2Support
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "kalign";
+  version = "3.4.0";
+
+  src = fetchFromGitHub {
+    owner = "TimoLassmann";
+    repo = "kalign";
+    rev = "refs/tags/v${finalAttrs.version}";
+    hash = "sha256-QcFNaCTqj6CFiOzQ6ezfBL0mu8PDU11hyNdkcsLOPzA=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = lib.optionals stdenv.cc.isClang [
+    llvmPackages.openmp
+  ];
+
+  cmakeFlags =
+    # these flags are ON by default
+    lib.optional (!enableSse4_1) "-DENABLE_SSE=OFF"
+    ++ lib.optional (!enableAvx) "-DENABLE_AVX=OFF"
+    ++ lib.optional (!enableAvx2) "-DENABLE_AVX2=OFF";
+
+  doCheck = true;
+
+  meta = {
+    description = "A fast multiple sequence alignment program";
+    mainProgram = "kalign";
+    homepage = "https://github.com/TimoLassmann/kalign";
+    changelog = "https://github.com/TimoLassmann/kalign/releases/tag/${finalAttrs.src.rev}";
+    license = lib.licenses.gpl3Plus;
+    maintainers = with lib.maintainers; [ natsukium ];
+    platforms = lib.platforms.unix;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/biology/kallisto/default.nix b/nixpkgs/pkgs/applications/science/biology/kallisto/default.nix
new file mode 100644
index 000000000000..55c555e387de
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/kallisto/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, autoconf, cmake, hdf5, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "kallisto";
+  version = "0.50.1";
+
+  src = fetchFromGitHub {
+    repo = "kallisto";
+    owner = "pachterlab";
+    rev = "v${version}";
+    sha256 = "sha256-JJZJOl4u6FzngrrMuC2AfD5ry2LBOT8tdz2piH+9LFE=";
+  };
+
+  nativeBuildInputs = [ autoconf cmake ];
+
+  buildInputs = [ hdf5 zlib ];
+
+  cmakeFlags = [ "-DUSE_HDF5=ON" ];
+
+  # Parallel build fails in some cases: https://github.com/pachterlab/kallisto/issues/160
+  enableParallelBuilding = false;
+
+  meta = with lib; {
+    description = "Program for quantifying abundances of transcripts from RNA-Seq data";
+    mainProgram = "kallisto";
+    homepage = "https://pachterlab.github.io/kallisto";
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ arcadio ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/kent/default.nix b/nixpkgs/pkgs/applications/science/biology/kent/default.nix
new file mode 100644
index 000000000000..b6e4661ccfd6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/kent/default.nix
@@ -0,0 +1,85 @@
+{ lib, stdenv
+, libpng
+, libuuid
+, zlib
+, bzip2
+, xz
+, openssl
+, curl
+, libmysqlclient
+, bash
+, fetchFromGitHub
+, which
+}:
+stdenv.mkDerivation rec {
+  pname = "kent";
+  version = "446";
+
+  src = fetchFromGitHub {
+    owner = "ucscGenomeBrowser";
+    repo = pname;
+    rev = "v${version}_base";
+    hash = "sha256-d8gcoyMwINdHoD6xaNKt4rCKrKir99+i4KIzJ2YnxRw=";
+  };
+
+  buildInputs = [ libpng libuuid zlib bzip2 xz openssl curl libmysqlclient ];
+
+  postPatch = ''
+    substituteInPlace ./src/checkUmask.sh \
+      --replace "/bin/bash" "${bash}/bin/bash"
+
+    substituteInPlace ./src/hg/sqlEnvTest.sh \
+      --replace "which mysql_config" "${which}/bin/which ${libmysqlclient}/bin/mysql_config"
+  '';
+
+  buildPhase = ''
+    runHook preBuild
+
+    export MACHTYPE=$(uname -m)
+    export CFLAGS="-fPIC"
+    export MYSQLINC=$(mysql_config --include | sed -e 's/^-I//g')
+    export MYSQLLIBS=$(mysql_config --libs)
+    export HOME=$TMPDIR
+    export DESTBINDIR=$HOME/bin
+
+    mkdir -p $HOME/lib $HOME/bin/x86_64
+
+    cd ./src
+    chmod +x ./checkUmask.sh
+    ./checkUmask.sh
+
+    make libs
+    cd jkOwnLib
+    make
+
+    cp ../lib/x86_64/jkOwnLib.a $HOME/lib
+    cp ../lib/x86_64/jkweb.a $HOME/lib
+    cp -r ../inc  $HOME/
+
+    cd ../utils
+    make
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin $out/lib $out/inc
+    cp $HOME/lib/jkOwnLib.a $out/lib
+    cp $HOME/lib/jkweb.a $out/lib
+    cp $HOME/bin/x86_64/* $out/bin
+    cp -r $HOME/inc/* $out/inc/
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "UCSC Genome Bioinformatics Group's suite of biological analysis tools, i.e. the kent utilities";
+    homepage = "http://genome.ucsc.edu";
+    changelog = "https://github.com/ucscGenomeBrowser/kent/releases/tag/v${version}_base";
+    license = licenses.unfree;
+    maintainers = with maintainers; [ scalavision ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/kssd/default.nix b/nixpkgs/pkgs/applications/science/biology/kssd/default.nix
new file mode 100644
index 000000000000..8f60b8b991ed
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/kssd/default.nix
@@ -0,0 +1,57 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, zlib
+, kssd
+, runCommand
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "kssd";
+  version = "2.21";
+
+  src = fetchFromGitHub {
+    owner = "yhg926";
+    repo = "public_kssd";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-D/s1jL2oKE0rSdRMVljskYFsw5UPOv1L95Of+K+e17w=";
+  };
+
+  patches = [
+    # https://github.com/yhg926/public_kssd/pull/11
+    (fetchpatch {
+      name = "allocate-enough-memory.patch";
+      url = "https://github.com/yhg926/public_kssd/commit/b1e66bbcc04687bc3201301cd742a0b26a87cb5d.patch";
+      hash = "sha256-yFyJetpsGKeu+H6Oxrmn5ea4ESVtblb3YJDja4JEAEM=";
+    })
+  ];
+
+  buildInputs = [ zlib ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -vD kssd $out/bin/kssd
+
+    runHook postInstall
+  '';
+
+  passthru.tests = {
+    simple = runCommand "${finalAttrs.pname}-test" { } ''
+      mkdir $out
+      ${lib.getExe kssd} dist -L ${kssd.src}/shuf_file/L3K10.shuf -r ${kssd.src}/test_fna/seqs1 -o $out/reference
+      ${lib.getExe kssd} dist -L ${kssd.src}/shuf_file/L3K10.shuf -o $out/query ${kssd.src}/test_fna/seqs2
+      ${lib.getExe kssd} dist -r $out/reference -o $out/distout $out/query
+    '';
+  };
+
+  meta = with lib; {
+    description = "K-mer substring space decomposition";
+    license     = licenses.asl20;
+    homepage    = "https://github.com/yhg926/public_kssd";
+    maintainers = with maintainers; [ unode ];
+    platforms = platforms.linux;
+    mainProgram = "kssd";
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/biology/last/default.nix b/nixpkgs/pkgs/applications/science/biology/last/default.nix
new file mode 100644
index 000000000000..3bc84e414bb7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/last/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, stdenv
+, fetchFromGitLab
+, unzip
+, zlib
+, python3
+, parallel
+}:
+
+stdenv.mkDerivation rec {
+  pname = "last";
+  version = "1542";
+
+  src = fetchFromGitLab {
+    owner = "mcfrith";
+    repo = "last";
+    rev = "refs/tags/${version}";
+    hash = "sha256-ZzvyyecYiBscogfN9/FnDbHg/lqb8y14n9C2KLIqhFA=";
+  };
+
+  nativeBuildInputs = [
+    unzip
+  ];
+
+  buildInputs = [
+    zlib
+    python3
+  ];
+
+  makeFlags = [
+    "prefix=${placeholder "out"}"
+  ];
+
+  postFixup = ''
+    for f in $out/bin/parallel-* ; do
+      sed -i 's|parallel |${parallel}/bin/parallel |' $f
+    done
+  '';
+
+  meta = with lib; {
+    description = "Genomic sequence aligner";
+    homepage = "https://gitlab.com/mcfrith/last";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ jbedo ];
+    platforms = platforms.x86_64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/macs2/default.nix b/nixpkgs/pkgs/applications/science/biology/macs2/default.nix
new file mode 100644
index 000000000000..73f12af6a605
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/macs2/default.nix
@@ -0,0 +1,55 @@
+{ lib, python3, fetchpatch, fetchPypi }:
+
+python3.pkgs.buildPythonPackage rec {
+  pname = "macs2";
+  version = "2.2.9.1";
+  format = "pyproject";
+
+  src = fetchPypi {
+    pname = lib.toUpper pname;
+    inherit version;
+    hash = "sha256-jVa8N/uCP8Y4fXgTjOloQFxUoKjNl3ZoJwX9CYMlLRY=";
+  };
+
+  patches = [
+    # https://github.com/macs3-project/MACS/pull/590
+    (fetchpatch {
+      name = "remove-pip-build-dependency.patch";
+      url = "https://github.com/macs3-project/MACS/commit/cf95a930daccf9f16e5b9a9224c5a2670cf67939.patch";
+      hash = "sha256-WB3Ubqk5fKtZt97QYo/sZDU/yya9MUo1NL4VsKXR+Yo=";
+    })
+  ];
+
+  nativeBuildInputs = with python3.pkgs; [
+    cython
+    numpy
+    setuptools
+    wheel
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    numpy
+  ];
+
+  __darwinAllowLocalNetworking = true;
+
+  nativeCheckInputs = with python3.pkgs; [
+    unittestCheckHook
+  ];
+
+  unittestFlagsArray = [
+    "-s"
+    "test"
+  ];
+
+  pythonImportsCheck = [ "MACS2" ];
+
+  meta = with lib; {
+    description = "Model-based Analysis for ChIP-Seq";
+    mainProgram = "macs2";
+    homepage = "https://github.com/macs3-project/MACS/";
+    changelog = "https://github.com/macs3-project/MACS/releases/tag/v${version}";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ gschwartz ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/macse/default.nix b/nixpkgs/pkgs/applications/science/biology/macse/default.nix
new file mode 100644
index 000000000000..06937f7e645e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/macse/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, jre, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "macse";
+  version = "2.03";
+
+  src = fetchurl {
+    url = "https://bioweb.supagro.inra.fr/${pname}/releases/${pname}_v${version}.jar";
+    sha256 = "0jnjyz4f255glg37rawzdv4m6nfs7wfwc5dny7afvx4dz2sv4ssh";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  dontUnpack = true;
+  dontBuild = true;
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/share/java
+    cp -s $src $out/share/java/macse.jar
+    makeWrapper ${jre}/bin/java $out/bin/macse --add-flags "-jar $out/share/java/macse.jar"
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Multiple alignment of coding sequences";
+    mainProgram = "macse";
+    homepage = "https://bioweb.supagro.inra.fr/macse/";
+    sourceProvenance = with sourceTypes; [ binaryBytecode ];
+    license = licenses.gpl2;
+    maintainers = [ maintainers.bzizou ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/mafft/default.nix b/nixpkgs/pkgs/applications/science/biology/mafft/default.nix
new file mode 100644
index 000000000000..f2e3ead2e913
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/mafft/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitLab }:
+
+stdenv.mkDerivation rec {
+  pname = "mafft";
+  version = "7.525";
+
+  src = fetchFromGitLab {
+    owner = "sysimm";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-ckBmvFssYAmYcBHAEftjQqBV0MB0theGfemaPx3XUws=";
+  };
+
+  preBuild = ''
+    cd ./core
+    make clean
+  '';
+
+  makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "PREFIX=$(out)" ];
+
+  meta = with lib;
+    {
+      description = "Multiple alignment program for amino acid or nucleotide sequences";
+      homepage = "https://mafft.cbrc.jp/alignment/software/";
+      license = licenses.bsd3;
+      maintainers = with maintainers; [ natsukium ];
+      platforms = platforms.unix;
+    };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/manta/default.nix b/nixpkgs/pkgs/applications/science/biology/manta/default.nix
new file mode 100644
index 000000000000..1f46e0141da3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/manta/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, cmake, zlib, python2 }:
+
+stdenv.mkDerivation rec {
+  pname = "manta";
+  version = "1.6.0";
+
+  src = fetchFromGitHub {
+    owner = "Illumina";
+    repo = "manta";
+    rev = "v${version}";
+    sha256 = "1711xkcw8rpw9xv3bbm7v1aryjz4r341rkq5255192dg38sgq7w2";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib python2 ];
+  postFixup = ''
+    sed -i 's|/usr/bin/env python2|${python2.interpreter}|' $out/lib/python/makeRunScript.py
+    sed -i 's|/usr/bin/env python|${python2.interpreter}|' $out/lib/python/pyflow/pyflow.py
+    sed -i 's|/bin/bash|${stdenv.shell}|' $out/lib/python/pyflow/pyflowTaskWrapper.py
+  '';
+  doInstallCheck = true;
+  installCheckPhase = ''
+    rm $out/lib/python/**/*.pyc
+    PYTHONPATH=$out/lib/python:$PYTHONPATH python -c 'import makeRunScript'
+    PYTHONPATH=$out/lib/python/pyflow:$PYTHONPATH python -c 'import pyflowTaskWrapper; import pyflow'
+  '';
+
+  meta = with lib; {
+    description = "Structural variant caller";
+    license = licenses.gpl3;
+    homepage = "https://github.com/Illumina/manta";
+    maintainers = with maintainers; [ jbedo ];
+    platforms =  platforms.x86_64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/megahit/default.nix b/nixpkgs/pkgs/applications/science/biology/megahit/default.nix
new file mode 100644
index 000000000000..5fa9420bc87c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/megahit/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, zlib }:
+
+stdenv.mkDerivation rec {
+  pname    = "megahit";
+  version = "1.2.9";
+
+  src = fetchFromGitHub {
+    owner = "voutcn";
+    repo = "megahit";
+    rev = "v${version}";
+    sha256 = "1r5d9nkdmgjsbrpj43q9hy3s8jwsabaz3ji561v18hy47v58923c";
+  };
+
+  patches = [
+    # Fix gcc-13 build failure:
+    #   https://github.com/voutcn/megahit/pull/366
+    (fetchpatch {
+      name = "gcc-13.patch";
+      url = "https://github.com/voutcn/megahit/commit/4cb2f793503087163bda8592222f105f27e33e66.patch";
+      hash = "sha256-b5mhzif+OPcMjmg+BnaUc5CB6Acn/KTBOJEw+WYEhbs=";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib ];
+
+  cmakeFlags = lib.optionals stdenv.hostPlatform.isStatic [
+    "-DSTATIC_BUILD=ON"
+    ];
+  meta = with lib; {
+    description = "An ultra-fast single-node solution for large and complex metagenomics assembly via succinct de Bruijn graph";
+    license     = licenses.gpl3;
+    homepage    = "https://github.com/voutcn/megahit";
+    maintainers = with maintainers; [ luispedro ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/meme-suite/default.nix b/nixpkgs/pkgs/applications/science/biology/meme-suite/default.nix
new file mode 100644
index 000000000000..c0f67c314161
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/meme-suite/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, python3, perl, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "meme-suite";
+  version = "5.1.1";
+
+  src = fetchurl {
+    url = "https://meme-suite.org/meme-software/${version}/meme-${version}.tar.gz";
+    sha256 = "38d73d256d431ad4eb7da2c817ce56ff2b4e26c39387ff0d6ada088938b38eb5";
+  };
+
+  buildInputs = [ zlib ];
+  nativeBuildInputs = [ perl python3 ];
+
+  meta = with lib; {
+    description = "Motif-based sequence analysis tools";
+    license = licenses.unfree;
+    maintainers = with maintainers; [ gschwartz ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/messer-slim/default.nix b/nixpkgs/pkgs/applications/science/biology/messer-slim/default.nix
new file mode 100644
index 000000000000..d4ce4071a274
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/messer-slim/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, cmake, gcc, gcc-unwrapped }:
+
+stdenv.mkDerivation rec {
+  version = "4.1";
+  pname = "messer-slim";
+
+  src = fetchFromGitHub {
+    owner = "MesserLab";
+    repo = "SLiM";
+    rev = "v${version}";
+    sha256 = "sha256-mb6xcu28QYAFm2906lRNY0zciQBKSGcz3q/cvOEh/VE=";
+  };
+
+  nativeBuildInputs = [ cmake gcc gcc-unwrapped ];
+
+  cmakeFlags = [ "-DCMAKE_AR=${gcc-unwrapped}/bin/gcc-ar"
+                 "-DCMAKE_RANLIB=${gcc-unwrapped}/bin/gcc-ranlib" ];
+
+  meta = {
+     description = "An evolutionary simulation framework";
+     homepage = "https://messerlab.org/slim/";
+     license = with lib.licenses; [ gpl3 ];
+     maintainers = with lib.maintainers; [ bzizou ];
+     platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/migrate/default.nix b/nixpkgs/pkgs/applications/science/biology/migrate/default.nix
new file mode 100644
index 000000000000..31e4eb2fcb42
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/migrate/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, lib, gccStdenv, fetchurl, zlib, mpi }:
+
+gccStdenv.mkDerivation rec {
+  version = "3.7.2";
+  pname = "migrate";
+
+  src = fetchurl {
+    url = "https://peterbeerli.com/migrate-html5/download_version3/${pname}-${version}.src.tar.gz";
+    sha256 = "1p2364ffjc56i82snzvjpy6pkf6wvqwvlvlqxliscx2c303fxs8v";
+  };
+
+  buildInputs = [ zlib mpi ];
+  setSourceRoot = "sourceRoot=$(echo */src)";
+  buildFlags = [ "thread" "mpis" ];
+  preInstall = "mkdir -p $out/man/man1";
+
+  meta = with lib; {
+    broken = stdenv.isDarwin;
+    description = "Estimates population size, migration, population splitting parameters using genetic/genomic data";
+    homepage = "https://peterbeerli.com/migrate-html5/index.html";
+    license = licenses.mit;
+    maintainers = [ maintainers.bzizou ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/minc-tools/default.nix b/nixpkgs/pkgs/applications/science/biology/minc-tools/default.nix
new file mode 100644
index 000000000000..3dece25915b4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/minc-tools/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper, flex, bison, perl, TextFormat,
+  libminc, libjpeg, nifticlib, zlib }:
+
+stdenv.mkDerivation rec {
+  pname   = "minc-tools";
+  version = "unstable-2020-07-25";
+
+  src = fetchFromGitHub {
+    owner  = "BIC-MNI";
+    repo   = pname;
+    rev    = "fb0a68a07d281e4e099c5d54df29925240de14c1";
+    sha256 = "0zcv2sdj3k6k0xjqdq8j5bxq8smm48dzai90vwsmz8znmbbm6kvw";
+  };
+
+  nativeBuildInputs = [ cmake flex bison makeWrapper ];
+  buildInputs = [ libminc libjpeg nifticlib zlib ];
+  propagatedBuildInputs = [ perl TextFormat ];
+
+  cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/cmake"
+                 "-DZNZ_INCLUDE_DIR=${nifticlib}/include/nifti"
+                 "-DNIFTI_INCLUDE_DIR=${nifticlib}/include/nifti" ];
+
+  postFixup = ''
+    for prog in minccomplete minchistory mincpik; do
+      wrapProgram $out/bin/$prog --prefix PERL5LIB : $PERL5LIB
+    done
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/BIC-MNI/minc-tools";
+    description = "Command-line utilities for working with MINC files";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license   = licenses.free;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/minc-widgets/default.nix b/nixpkgs/pkgs/applications/science/biology/minc-widgets/default.nix
new file mode 100644
index 000000000000..42178722b551
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/minc-widgets/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper,
+  perlPackages,
+  libminc, octave, coreutils, minc_tools }:
+
+stdenv.mkDerivation rec {
+  pname = "minc-widgets";
+  version = "unstable-2016-04-20";
+
+  src = fetchFromGitHub {
+    owner  = "BIC-MNI";
+    repo   = pname;
+    rev    = "f08b643894c81a1a2e0fbfe595a17a42ba8906db";
+    sha256 = "1b9g6lf37wpp211ikaji4rf74rl9xcmrlyqcw1zq3z12ji9y33bm";
+  };
+
+  nativeBuildInputs = [ cmake makeWrapper ];
+  buildInputs = [ libminc ];
+  propagatedBuildInputs = (with perlPackages; [ perl GetoptTabular MNI-Perllib ]) ++ [ octave coreutils minc_tools ];
+
+  postFixup = ''
+    for p in $out/bin/*; do
+      wrapProgram $p --prefix PERL5LIB : $PERL5LIB --set PATH "${lib.makeBinPath [ coreutils minc_tools ]}";
+    done
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/BIC-MNI/${pname}";
+    description = "Collection of Perl and shell scripts for processing MINC files";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license = licenses.free;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/minia/default.nix b/nixpkgs/pkgs/applications/science/biology/minia/default.nix
new file mode 100644
index 000000000000..3665639a2cd9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/minia/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, cmake, hdf5, boost }:
+
+stdenv.mkDerivation rec {
+  pname = "minia";
+  version = "3.2.1";
+
+  src = fetchFromGitHub {
+    owner = "GATB";
+    repo = "minia";
+    rev = "v${version}";
+    sha256 = "0bmfrywixaaql898l0ixsfkhxjf2hb08ssnqzlzacfizxdp46siq";
+    fetchSubmodules = true;
+  };
+
+  patches = [ ./no-bundle.patch ];
+
+  env.NIX_CFLAGS_COMPILE = toString [ "-Wformat" ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ hdf5 boost ];
+
+  prePatch = ''
+    rm -rf thirdparty/gatb-core/gatb-core/thirdparty/{hdf5,boost}
+  '';
+
+  meta = with lib; {
+    description = "Short read genome assembler";
+    mainProgram = "minia";
+    homepage = "https://github.com/GATB/minia";
+    license = licenses.agpl3Plus;
+    maintainers = with maintainers; [ jbedo ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/minia/no-bundle.patch b/nixpkgs/pkgs/applications/science/biology/minia/no-bundle.patch
new file mode 100644
index 000000000000..21d12c7f6f2d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/minia/no-bundle.patch
@@ -0,0 +1,222 @@
+diff --git a/thirdparty/gatb-core/gatb-core/CMakeLists.txt b/thirdparty/gatb-core/gatb-core/CMakeLists.txt
+index f48a70b..0e11ece 100644
+--- a/thirdparty/gatb-core/gatb-core/CMakeLists.txt
++++ b/thirdparty/gatb-core/gatb-core/CMakeLists.txt
+@@ -257,7 +257,6 @@ ADD_SUBDIRECTORY(thirdparty)
+ #  DEPENDENCIES 
+ ################################################################################
+ # we must be sure that hdf5 is built and installed before building gatb-core
+-ADD_DEPENDENCIES (gatbcore-static hdf5 hdf5_postbuild)
+ 
+ ################################################################################
+ #  DOCUMENTATION GENERATION 
+@@ -288,7 +287,6 @@ IF (NOT DEFINED GATB_CORE_INSTALL_EXCLUDE)
+     INSTALL (FILES ${PROJECT_SOURCE_DIR}/doc/misc/README.txt  DESTINATION . OPTIONAL)
+     INSTALL (FILES ${PROJECT_SOURCE_DIR}/LICENCE              DESTINATION . OPTIONAL)
+     INSTALL (FILES ${PROJECT_SOURCE_DIR}/THIRDPARTIES.md      DESTINATION . OPTIONAL)
+-    INSTALL (DIRECTORY ${PROJECT_SOURCE_DIR}/thirdparty/boost DESTINATION ./include)
+ ENDIF()
+ 
+ ################################################################################
+diff --git a/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/LargeInt.hpp b/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/LargeInt.hpp
+index dfeee1c..d5553a2 100644
+--- a/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/LargeInt.hpp
++++ b/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/LargeInt.hpp
+@@ -35,7 +35,7 @@
+ #include <stdint.h>
+ #include <algorithm>
+ #include <iostream>
+-#include <hdf5/hdf5.h>
++#include <hdf5.h>
+ 
+ #include <gatb/system/api/Exception.hpp>
+ #include <gatb/system/api/config.hpp>
+diff --git a/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt128.hpp b/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt128.hpp
+index 60be5d5..25ae75e 100644
+--- a/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt128.hpp
++++ b/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt128.hpp
+@@ -33,7 +33,7 @@
+ /********************************************************************************/
+ 
+ #include <iostream>
+-#include <hdf5/hdf5.h>
++#include <hdf5.h>
+ 
+ #include <gatb/system/api/types.hpp>
+ #include <gatb/tools/misc/api/Abundance.hpp>
+diff --git a/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt16.hpp b/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt16.hpp
+index 6a71bb0..b9205df 100644
+--- a/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt16.hpp
++++ b/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt16.hpp
+@@ -31,7 +31,7 @@
+ #include <iostream>
+ #include <gatb/system/api/types.hpp>
+ #include <gatb/tools/misc/api/Abundance.hpp>
+-#include <hdf5/hdf5.h>
++#include <hdf5.h>
+ 
+ /********************************************************************************/
+ namespace gatb  {
+diff --git a/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt32.hpp b/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt32.hpp
+index c22b892..62e6586 100644
+--- a/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt32.hpp
++++ b/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt32.hpp
+@@ -31,7 +31,7 @@
+ #include <iostream>
+ #include <gatb/system/api/types.hpp>
+ #include <gatb/tools/misc/api/Abundance.hpp>
+-#include <hdf5/hdf5.h>
++#include <hdf5.h>
+ 
+ /********************************************************************************/
+ namespace gatb  {
+diff --git a/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt64.hpp b/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt64.hpp
+index c06aaab..e0befba 100644
+--- a/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt64.hpp
++++ b/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt64.hpp
+@@ -31,7 +31,7 @@
+ #include <iostream>
+ #include <gatb/system/api/types.hpp>
+ #include <gatb/tools/misc/api/Abundance.hpp>
+-#include <hdf5/hdf5.h>
++#include <hdf5.h>
+ 
+ extern const unsigned char revcomp_4NT[];
+ extern const unsigned char comp_NT    [];
+diff --git a/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt8.hpp b/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt8.hpp
+index 9659874..0c79ff6 100644
+--- a/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt8.hpp
++++ b/thirdparty/gatb-core/gatb-core/src/gatb/tools/math/NativeInt8.hpp
+@@ -31,7 +31,7 @@
+ #include <iostream>
+ #include <gatb/system/api/types.hpp>
+ #include <gatb/tools/misc/api/Abundance.hpp>
+-#include <hdf5/hdf5.h>
++#include <hdf5.h>
+ 
+ /********************************************************************************/
+ namespace gatb  {
+diff --git a/thirdparty/gatb-core/gatb-core/src/gatb/tools/misc/api/Abundance.hpp b/thirdparty/gatb-core/gatb-core/src/gatb/tools/misc/api/Abundance.hpp
+index 3cb84f8..cd5d382 100644
+--- a/thirdparty/gatb-core/gatb-core/src/gatb/tools/misc/api/Abundance.hpp
++++ b/thirdparty/gatb-core/gatb-core/src/gatb/tools/misc/api/Abundance.hpp
+@@ -31,7 +31,7 @@
+ /********************************************************************************/
+ 
+ #include <sys/types.h>
+-#include <hdf5/hdf5.h>
++#include <hdf5.h>
+ 
+ /********************************************************************************/
+ namespace gatb      {
+diff --git a/thirdparty/gatb-core/gatb-core/src/gatb/tools/misc/api/IHistogram.hpp b/thirdparty/gatb-core/gatb-core/src/gatb/tools/misc/api/IHistogram.hpp
+index b8f6c79..a040832 100644
+--- a/thirdparty/gatb-core/gatb-core/src/gatb/tools/misc/api/IHistogram.hpp
++++ b/thirdparty/gatb-core/gatb-core/src/gatb/tools/misc/api/IHistogram.hpp
+@@ -28,7 +28,7 @@
+ 
+ #include <gatb/system/api/ISmartPointer.hpp>
+ #include <gatb/tools/storage/impl/Storage.hpp>
+-#include <hdf5/hdf5.h>
++#include <hdf5.h>
+ 
+ /********************************************************************************/
+ namespace gatb      {
+diff --git a/thirdparty/gatb-core/gatb-core/src/gatb/tools/storage/impl/CollectionHDF5.hpp b/thirdparty/gatb-core/gatb-core/src/gatb/tools/storage/impl/CollectionHDF5.hpp
+index 2645abd..fad48c0 100644
+--- a/thirdparty/gatb-core/gatb-core/src/gatb/tools/storage/impl/CollectionHDF5.hpp
++++ b/thirdparty/gatb-core/gatb-core/src/gatb/tools/storage/impl/CollectionHDF5.hpp
+@@ -40,7 +40,7 @@
+ #include <string>
+ #include <vector>
+ #include <stdarg.h>
+-#include <hdf5/hdf5.h>
++#include <hdf5.h>
+ 
+ /********************************************************************************/
+ namespace gatb      {
+diff --git a/thirdparty/gatb-core/gatb-core/src/gatb/tools/storage/impl/CollectionHDF5Patch.hpp b/thirdparty/gatb-core/gatb-core/src/gatb/tools/storage/impl/CollectionHDF5Patch.hpp
+index a92b729..66d552f 100644
+--- a/thirdparty/gatb-core/gatb-core/src/gatb/tools/storage/impl/CollectionHDF5Patch.hpp
++++ b/thirdparty/gatb-core/gatb-core/src/gatb/tools/storage/impl/CollectionHDF5Patch.hpp
+@@ -40,7 +40,7 @@
+ #include <string>
+ #include <vector>
+ #include <stdarg.h>
+-#include <hdf5/hdf5.h>
++#include <hdf5.h>
+ 
+ /********************************************************************************/
+ namespace gatb      {
+diff --git a/thirdparty/gatb-core/gatb-core/src/gatb/tools/storage/impl/StorageHDF5.hpp b/thirdparty/gatb-core/gatb-core/src/gatb/tools/storage/impl/StorageHDF5.hpp
+index 29e0949..0565cc4 100644
+--- a/thirdparty/gatb-core/gatb-core/src/gatb/tools/storage/impl/StorageHDF5.hpp
++++ b/thirdparty/gatb-core/gatb-core/src/gatb/tools/storage/impl/StorageHDF5.hpp
+@@ -33,7 +33,7 @@
+ #include <gatb/tools/storage/impl/CollectionHDF5.hpp>
+ #include <gatb/tools/storage/impl/CollectionHDF5Patch.hpp>
+ #include <gatb/system/impl/System.hpp>
+-#include <hdf5/hdf5.h>
++#include <hdf5.h>
+ #include <sstream>
+ 
+ /********************************************************************************/
+diff --git a/thirdparty/gatb-core/gatb-core/thirdparty/CMakeLists.txt b/thirdparty/gatb-core/gatb-core/thirdparty/CMakeLists.txt
+index 6e0b5c4..34aef28 100644
+--- a/thirdparty/gatb-core/gatb-core/thirdparty/CMakeLists.txt
++++ b/thirdparty/gatb-core/gatb-core/thirdparty/CMakeLists.txt
+@@ -1,54 +1,3 @@
+-################################################################################
+-#  HDF5 GENERATION 
+-################################################################################
+-
+-#SET (HDF5_ENABLE_THREADSAFE       ON)
+-#SET (H5_HAVE_THREADSAFE 1)
+-
+-##########  MOMENTARY DEACTIVATED => CRASH ON MACOS TO BE INVESTIGATED  ##########
+-SET (HDF5_BUILD_TOOLS             ON CACHE BOOL "Build HDF5 Tools")
+-#SET (CMAKE_EXE_LINKER_FLAGS       "-lpthread -lz")
+-
+-SET (HDF5_EXTERNALLY_CONFIGURED     ON)
+-
+-#SET (HDF5_INSTALL_BIN_DIR           ${PROJECT_BINARY_DIR}/bin/${CMAKE_BUILD_TYPE})
+-#SET (HDF5_INSTALL_LIB_DIR           ${PROJECT_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE})
+-SET (HDF5_INSTALL_BIN_DIR           bin)
+-SET (HDF5_INSTALL_LIB_DIR           lib)
+-
+-SET (HDF5_INSTALL_INCLUDE_DIR       ${PROJECT_BINARY_DIR}/include/${CMAKE_BUILD_TYPE}/hdf5)
+-SET (HDF5_INSTALL_DATA_DIR          ${PROJECT_BINARY_DIR}/share/${CMAKE_BUILD_TYPE})
+-SET (HDF5_INSTALL_CMAKE_DIR         ${PROJECT_BINARY_DIR}/share/${CMAKE_BUILD_TYPE})
+-
+-IF (NOT DEFINED GATB_CORE_INSTALL_EXCLUDE)
+-    SET (HDF5_EXPORTED_TARGETS          "gatb-hdf5")
+-ENDIF()
+-
+-IF (NOT DEFINED GATB_CORE_EXCLUDE_HDF5_ZLIB)
+-	OPTION (HDF5_ENABLE_Z_LIB_SUPPORT "Enable Zlib Filters" ON)
+-ENDIF()
+-
+-# We don't want warnings from HDF5 compilation
+-set (COMPILE_DEFINITIONS  "${COMPILE_DEFINITIONS}  -w")
+-add_definitions (${COMPILE_DEFINITIONS})
+-
+-# add HDF5 generation
+-ADD_SUBDIRECTORY (hdf5)
+-
+-# We add a custom target for copying header files.
+-add_custom_target (hdf5_postbuild ALL)
+-
+-# We build the output directory
+-add_custom_command (TARGET hdf5_postbuild POST_BUILD  COMMAND ${CMAKE_COMMAND} -E make_directory ${HDF5_INSTALL_INCLUDE_DIR})
+-
+-# We define all the header files to be copied
+-file (GLOB headerfiles ${PROJECT_SOURCE_DIR}/thirdparty/hdf5/src/*.h ${PROJECT_BINARY_DIR}/thirdparty/hdf5/H5pubconf.h)
+-
+-# We copy each header file
+-foreach (header ${headerfiles})
+-  add_custom_command (TARGET hdf5_postbuild POST_BUILD  COMMAND ${CMAKE_COMMAND} -E copy_if_different ${header} ${HDF5_INSTALL_INCLUDE_DIR}  )
+-endforeach()
+-
+ # include other smaller libraries (json, Boophf)
+ 
+ add_custom_target (thirdparty_copy ALL)
diff --git a/nixpkgs/pkgs/applications/science/biology/minimap2/default.nix b/nixpkgs/pkgs/applications/science/biology/minimap2/default.nix
new file mode 100644
index 000000000000..eeb31dee0538
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/minimap2/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "minimap2";
+  version = "2.27";
+
+  src = fetchFromGitHub {
+    repo = pname;
+    owner = "lh3";
+    rev = "v${version}";
+    sha256 = "sha256-F6IJrYD2dk+5bKKVIahLiNnD/Hd/CjNQQd9zz0Gkans=";
+  };
+
+  buildInputs = [ zlib ];
+
+  makeFlags = lib.optionals stdenv.isAarch64 [ "arm_neon=1" "aarch64=1" ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp minimap2 $out/bin
+    mkdir -p $out/share/man/man1
+    cp minimap2.1 $out/share/man/man1
+  '';
+
+  meta = with lib; {
+    description = "A versatile pairwise aligner for genomic and spliced nucleotide sequences";
+    mainProgram = "minimap2";
+    homepage = "https://lh3.github.io/minimap2";
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = [ maintainers.arcadio ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/mmseqs2/default.nix b/nixpkgs/pkgs/applications/science/biology/mmseqs2/default.nix
new file mode 100644
index 000000000000..18acee7a5f14
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/mmseqs2/default.nix
@@ -0,0 +1,51 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, xxd
+, perl
+, installShellFiles
+, enableAvx2 ? stdenv.hostPlatform.avx2Support
+, enableSse4_1 ? stdenv.hostPlatform.sse4_1Support
+, enableMpi ? false
+, mpi
+, openmp
+, zlib
+, bzip2
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mmseqs2";
+  version = "15-6f452";
+
+  src = fetchFromGitHub {
+    owner = "soedinglab";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-L+zOWrGkCLz/wqpBuji8H4/93sDFpcfnDOE8FHq1j84=";
+  };
+
+  nativeBuildInputs = [ cmake xxd perl installShellFiles ];
+  cmakeFlags =
+    lib.optional enableAvx2 "-DHAVE_AVX2=1"
+    ++ lib.optional enableSse4_1 "-DHAVE_SSE4_1=1"
+    ++ lib.optional enableMpi "-DHAVE_MPI=1";
+
+  buildInputs =
+    lib.optionals stdenv.cc.isClang [ openmp zlib bzip2 ]
+    ++ lib.optional enableMpi mpi;
+
+  postInstall = ''
+    installShellCompletion --bash --cmd mmseqs $out/util/bash-completion.sh
+    rm -r $out/util/
+  '';
+
+  meta = with lib; {
+    description = "Ultra fast and sensitive sequence search and clustering suite";
+    mainProgram = "mmseqs";
+    homepage = "https://mmseqs.com/";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ natsukium ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/mni_autoreg/default.nix b/nixpkgs/pkgs/applications/science/biology/mni_autoreg/default.nix
new file mode 100644
index 000000000000..29ab02ee3139
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/mni_autoreg/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper, perlPackages, libminc }:
+
+stdenv.mkDerivation rec {
+  pname = "mni_autoreg";
+  version = "unstable-2022-05-20";
+
+  src = fetchFromGitHub {
+    owner = "BIC-MNI";
+    repo = pname;
+    rev = "be7bd25bf7776974e0f2c1d90b6e7f8ccc0c8874";
+    sha256 = "sGMZbCrdV6yAOgGiqvBFOUr6pGlTCqwy8yNrPxMoKco=";
+  };
+
+  nativeBuildInputs = [ cmake makeWrapper ];
+  buildInputs = [ libminc ];
+  propagatedBuildInputs = with perlPackages; [ perl GetoptTabular MNI-Perllib ];
+
+  cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/cmake" ];
+  # testing broken: './minc_wrapper: Permission denied' from Testing/ellipse0.mnc
+
+  postFixup = ''
+    for prog in autocrop mritoself mritotal xfmtool; do
+      echo $out/bin/$prog
+      wrapProgram $out/bin/$prog --prefix PERL5LIB : $PERL5LIB;
+    done
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/BIC-MNI/mni_autoreg";
+    description = "Tools for automated registration using the MINC image format";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license = licenses.free;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/mrbayes/default.nix b/nixpkgs/pkgs/applications/science/biology/mrbayes/default.nix
new file mode 100644
index 000000000000..54f5b9bbb370
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/mrbayes/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, readline }:
+
+stdenv.mkDerivation rec {
+  pname = "mrbayes";
+  version = "3.2.7a";
+
+  src = fetchFromGitHub {
+    owner = "NBISweden";
+    repo = "MrBayes";
+    rev = "v${version}";
+    sha256 = "sha256-pkkxZ6YHRn/I1SJpT9A+EK4S5hWGmFdcDBJS0zh5mLA=";
+  };
+
+  meta = with lib; {
+    description = "Bayesian Inference of Phylogeny";
+    mainProgram = "mb";
+    longDescription = ''
+      Bayesian inference of phylogeny is based upon a
+      quantity called the posterior probability distribution of trees, which is
+      the probability of a tree conditioned on the observations. The conditioning
+      is accomplished using Bayes's theorem. The posterior probability
+      distribution of trees is impossible to calculate analytically; instead,
+      MrBayes uses a simulation technique called Markov chain Monte Carlo (or
+      MCMC) to approximate the posterior probabilities of trees.
+    '';
+    maintainers = with maintainers; [ ];
+    license = licenses.gpl2Plus;
+    homepage = "https://nbisweden.github.io/MrBayes/";
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/mrtrix/default.nix b/nixpkgs/pkgs/applications/science/biology/mrtrix/default.nix
new file mode 100644
index 000000000000..64eafa0f6968
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/mrtrix/default.nix
@@ -0,0 +1,112 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, python
+, makeWrapper
+, eigen
+, fftw
+, libtiff
+, libpng
+, zlib
+, ants
+, bc
+, qt5
+, libGL
+, libGLU
+, libX11
+, libXext
+, less
+, withGui ? true
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mrtrix";
+  version = "3.0.4";
+
+  src = fetchFromGitHub {
+    owner = "MRtrix3";
+    repo = "mrtrix3";
+    rev = "refs/tags/${version}";
+    hash = "sha256-87zBAoBLWQPccGS37XyQ8H0GhL01k8GQFgcLL6IwbcM=";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ eigen makeWrapper ] ++ lib.optional withGui qt5.wrapQtAppsHook;
+
+  buildInputs = [
+    ants
+    python
+    fftw
+    libtiff
+    libpng
+    zlib
+  ] ++ lib.optionals withGui [
+    libGL
+    libGLU
+    libX11
+    libXext
+    qt5.qtbase
+    qt5.qtsvg
+  ];
+
+  nativeInstallCheckInputs = [ bc ];
+
+  postPatch = ''
+    patchShebangs ./build ./configure ./run_tests ./bin/*
+
+    # patching interpreters before fixup is needed for tests:
+    patchShebangs ./bin/*
+    patchShebangs testing/binaries/data/vectorstats/*py
+
+    substituteInPlace ./run_tests  \
+      --replace 'git submodule update --init $datadir >> $LOGFILE 2>&1' ""
+
+    substituteInPlace ./build  \
+      --replace '"less -RX "' '"${less}/bin/less -RX "'
+  '';
+
+  configurePhase = ''
+    export EIGEN_CFLAGS="-isystem ${eigen}/include/eigen3"
+    unset LD  # similar to https://github.com/MRtrix3/mrtrix3/issues/1519
+    ./configure ${lib.optionalString (!withGui) "-nogui"};
+  '';
+
+  buildPhase = ''
+    ./build
+    (cd testing && ../build)
+  '';
+
+  installCheckPhase = ''
+    ./run_tests units
+    ./run_tests binaries
+
+    # can also `./run_tests scripts`, but this fails due to lack of FSL package
+    # (and there's no convenient way to disable individual tests)
+  '';
+  doInstallCheck = true;
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out
+    cp -ar lib $out/lib
+    cp -ar bin $out/bin
+    runHook postInstall
+  '';
+
+  postInstall = ''
+    for prog in $out/bin/*; do
+      if [[ -x "$prog" ]]; then
+        wrapProgram $prog --prefix PATH : ${lib.makeBinPath [ ants ]}
+      fi
+    done
+  '';
+
+  meta = with lib; {
+    broken = (stdenv.isLinux && stdenv.isAarch64);
+    homepage = "https://github.com/MRtrix3/mrtrix3";
+    description = "Suite of tools for diffusion imaging";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.linux;
+    license   = licenses.mpl20;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/muscle/default.nix b/nixpkgs/pkgs/applications/science/biology/muscle/default.nix
new file mode 100644
index 000000000000..cdcf6c7b50aa
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/muscle/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname   = "muscle";
+  version = "5.1.0";
+
+
+  src = fetchFromGitHub {
+    owner = "rcedgar";
+    repo = pname;
+    rev = version;
+    hash = "sha256-NpnJziZXga/T5OavUt3nQ5np8kJ9CFcSmwyg4m6IJsk=";
+  };
+
+  sourceRoot = "${src.name}/src";
+
+  installPhase = ''
+    install -m755 -D Linux/muscle $out/bin/muscle
+  '';
+
+  meta = with lib; {
+    description = "Multiple sequence alignment with top benchmark scores scalable to thousands of sequences";
+    mainProgram = "muscle";
+    license     = licenses.gpl3Plus;
+    homepage    = "https://www.drive5.com/muscle/";
+    maintainers = with maintainers; [ unode thyol ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/nest/default.nix b/nixpkgs/pkgs/applications/science/biology/nest/default.nix
new file mode 100644
index 000000000000..5f0ad540f696
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/nest/default.nix
@@ -0,0 +1,86 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, testers
+, cmake
+, gsl
+, libtool
+, findutils
+, llvmPackages
+, mpi
+, nest
+, pkg-config
+, boost
+, python3
+, readline
+, autoPatchelfHook
+, withPython ? false
+, withMpi ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "nest";
+  version = "3.6";
+
+  src = fetchFromGitHub {
+    owner = "nest";
+    repo = "nest-simulator";
+    rev = "v${version}";
+    hash = "sha256-sXtF4JmHYoLp0t3o4KF6R2E0qLnKrzSPMXOxVJAm+sU=";
+  };
+
+  postPatch = ''
+    patchShebangs cmake/CheckFiles/check_return_val.sh
+    # fix PyNEST installation path
+    # it expects CMAKE_INSTALL_LIBDIR to be relative
+    substituteInPlace cmake/ProcessOptions.cmake \
+      --replace "\''${CMAKE_INSTALL_LIBDIR}/python" "lib/python"
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    findutils
+  ];
+
+  buildInputs = [
+    gsl
+    readline
+    libtool # libltdl
+    boost
+  ] ++ lib.optionals withPython [
+    python3
+    python3.pkgs.cython
+  ] ++ lib.optional withMpi mpi
+    ++ lib.optional stdenv.isDarwin llvmPackages.openmp;
+
+  propagatedBuildInputs = with python3.pkgs; [
+    numpy
+  ];
+
+  cmakeFlags = [
+    "-Dwith-python=${if withPython then "ON" else "OFF"}"
+    "-Dwith-mpi=${if withMpi then "ON" else "OFF"}"
+    "-Dwith-openmp=ON"
+  ];
+
+  postInstall = ''
+    # Alternative to autoPatchElf, moves libraries where
+    # Nest expects them to be
+    find $out/lib/nest -exec ln -s {} $out/lib \;
+  '';
+
+  passthru.tests.version = testers.testVersion {
+    package = nest;
+    command = "nest --version";
+  };
+
+  meta = with lib; {
+    description = "NEST is a command line tool for simulating neural networks";
+    homepage = "https://www.nest-simulator.org/";
+    changelog = "https://github.com/nest/nest-simulator/releases/tag/v${version}";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ jiegec davidcromp ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/neuron/default.nix b/nixpkgs/pkgs/applications/science/biology/neuron/default.nix
new file mode 100644
index 000000000000..6e5e4feb16fc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/neuron/default.nix
@@ -0,0 +1,104 @@
+{ lib
+, stdenv
+, fetchurl
+, readline
+, xorg
+, mpi
+, cmake
+, bison
+, flex
+, git
+, perl
+, gsl
+, xcbuild
+, python3
+, useMpi ? false
+, useIv ? true
+, useCore ? false
+, useRx3d ? false
+}:
+
+
+stdenv.mkDerivation rec {
+  pname = "neuron";
+  version = "8.2.3";
+
+  # format is for pythonModule conversion
+  format = "other";
+
+  nativeBuildInputs = [
+    cmake
+    bison
+    flex
+    git
+  ] ++ lib.optionals useCore [ perl gsl ]
+  ++ lib.optionals stdenv.isDarwin [ xcbuild ];
+
+  buildInputs = lib.optionals useIv [
+    xorg.libX11.dev
+    xorg.libXcomposite.dev
+    xorg.libXext.dev
+  ];
+
+  propagatedBuildInputs = [
+    readline
+    python3
+    python3.pkgs.wheel
+    python3.pkgs.setuptools
+    python3.pkgs.scikit-build
+    python3.pkgs.matplotlib
+  ] ++ lib.optionals useMpi [
+    mpi
+  ] ++ lib.optionals useMpi [
+    python3.pkgs.mpi4py
+  ] ++ lib.optionals useRx3d [
+    python3.pkgs.cython
+    python3.pkgs.numpy
+  ];
+
+  patches = [ ./neuron_darwin_rpath.patch ];
+
+  # Patch build shells for cmake (bin, src, cmake) and submodules (external)
+  postPatch = ''
+    patchShebangs ./bin ./src ./external ./cmake
+    sed -e 's#DESTDIR =#DESTDIR = '"$out"'#' -i external/coreneuron/extra/nrnivmodl_core_makefile.in
+  '';
+
+  cmakeFlags = [
+    "-DNRN_ENABLE_INTERVIEWS=${if useIv then "ON" else "OFF"}"
+    "-DNRN_ENABLE_MPI=${if useMpi then "ON" else "OFF"}"
+    "-DNRN_ENABLE_CORENEURON=${if useCore then "ON" else "OFF"}"
+    "-DNRN_ENABLE_RX3D=${if useRx3d then "ON" else "OFF"}"
+  ];
+
+  postInstall = ''
+    mkdir -p $out/${python3.sitePackages}
+    mv $out/lib/python/* $out/${python3.sitePackages}/
+    rm -rf $out/lib/python build
+    for entry in $out/lib/*.so; do
+      # remove references to build
+      patchelf --set-rpath $(patchelf --print-rpath $entry | tr ':' '\n' | sed '/^\/build/d' | tr '\n' ':') $entry
+    done
+  '';
+
+  src = fetchurl {
+    url = "https://github.com/neuronsimulator/nrn/releases/download/${version}/full-src-package-${version}.tar.gz";
+    sha256 = "sha256-k8+71BRfh+a73sZho6v0QFRxVmrfx6jqrgaqammdtDI=";
+  };
+
+  meta = with lib; {
+    description = "Simulation environment for empirically-based simulations of neurons and networks of neurons";
+    longDescription = ''
+      NEURON is a simulation environment for developing and exercising models of
+      neurons and networks of neurons. It is particularly well-suited to problems where
+      cable properties of cells play an important role, possibly including extracellular
+      potential close to the membrane), and where cell membrane properties are complex,
+      involving many ion-specific channels, ion accumulation, and second messengers
+    '';
+    sourceProvenance = with sourceTypes; [ fromSource ];
+    license = licenses.bsd3;
+    homepage = "http://www.neuron.yale.edu/neuron";
+    maintainers = with maintainers; [ adev davidcromp ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/neuron/neuron_darwin_rpath.patch b/nixpkgs/pkgs/applications/science/biology/neuron/neuron_darwin_rpath.patch
new file mode 100644
index 000000000000..1b0fa2670782
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/neuron/neuron_darwin_rpath.patch
@@ -0,0 +1,11 @@
+--- a/src/nrnpython/setup.py.in
++++ b/src/nrnpython/setup.py.in
+@@ -124,7 +124,7 @@ libdirs = [destdir + get_escaped_path("@NRN_LIBDIR@"),
+ rpath_prefix_flag='-Wl,-R'
+ extra_link_args = [@NRN_LINK_FLAGS_COMMA_SEPARATED_STRINGS@]
+ @MAC_DARWIN_FALSE@extra_link_args += [rpath_prefix_flag+lib_path for lib_path in libdirs]
+-@MAC_DARWIN_TRUE@extra_link_args.append("-Wl,-rpath,@loader_path/../../")
++@MAC_DARWIN_TRUE@extra_link_args.append("-Wl,-rpath,@loader_path/../../../")
+ @MAC_DARWIN_TRUE@extra_link_args.append("-Wl,-rpath,%s" % ivlibdir)
+
+ # as neuron module will be built during make, add build/lib
diff --git a/nixpkgs/pkgs/applications/science/biology/niftyreg/default.nix b/nixpkgs/pkgs/applications/science/biology/niftyreg/default.nix
new file mode 100644
index 000000000000..0be59bcd726a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/niftyreg/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, cmake, zlib }:
+
+stdenv.mkDerivation rec {
+  pname   = "niftyreg";
+  version = "1.3.9";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/nifty_reg-${version}/nifty_reg-${version}.tar.gz";
+    sha256 = "07v9v9s41lvw72wpb1jgh2nzanyc994779bd35p76vg8mzifmprl";
+  };
+
+  env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=narrowing" ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib ];
+
+  meta = with lib; {
+    homepage = "http://cmictig.cs.ucl.ac.uk/wiki/index.php/NiftyReg";
+    description = "Medical image registration software";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = [ "x86_64-linux" ];
+    license   = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/niftyseg/default.nix b/nixpkgs/pkgs/applications/science/biology/niftyseg/default.nix
new file mode 100644
index 000000000000..0fd658b0addc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/niftyseg/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, cmake, eigen, zlib }:
+
+stdenv.mkDerivation rec {
+  pname   = "niftyseg";
+  version = "1.0";
+
+  src = fetchFromGitHub {
+    owner = "KCL-BMEIS";
+    repo = "NiftySeg";
+    rev = "v${version}";
+    sha256 = "sha256-FDthq1ild9XOw3E3O7Lpfn6hBF1Frhv1NxfEA8500n8=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ eigen zlib ];
+
+  meta = with lib; {
+    homepage = "http://cmictig.cs.ucl.ac.uk/research/software/software-nifty/niftyseg";
+    description = "Software for medical image segmentation, bias field correction, and cortical thickness calculation";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license   = licenses.bsd3;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/obitools/obitools3.nix b/nixpkgs/pkgs/applications/science/biology/obitools/obitools3.nix
new file mode 100644
index 000000000000..f415c9c39141
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/obitools/obitools3.nix
@@ -0,0 +1,36 @@
+{ stdenv, lib, fetchurl, python3Packages, cmake, python3 }:
+
+python3Packages.buildPythonApplication rec {
+  pname = "obitools3";
+  version = "3.0.1b11";
+
+  src = fetchurl {
+    url = "https://git.metabarcoding.org/obitools/${pname}/repository/v${version}/archive.tar.gz";
+    sha256 = "1x7a0nrr9agg1pfgq8i1j8r1p6c0jpyxsv196ylix1dd2iivmas1";
+  };
+
+  nativeBuildInputs = [ python3Packages.cython cmake ];
+
+  postPatch = lib.optionalString stdenv.isAarch64 ''
+      substituteInPlace setup.py \
+      --replace "'-msse2'," ""
+  '';
+
+  preBuild = ''
+    substituteInPlace src/CMakeLists.txt --replace \$'{PYTHONLIB}' "$out/${python3.sitePackages}";
+    export NIX_CFLAGS_COMPILE="-L $out/${python3.sitePackages} $NIX_CFLAGS_COMPILE"
+  '';
+
+  dontConfigure = true;
+
+  doCheck = true;
+
+  meta = with lib ; {
+    description = "Management of analyses and data in DNA metabarcoding";
+    mainProgram = "obi";
+    homepage = "https://git.metabarcoding.org/obitools/obitools3";
+    license = licenses.cecill20;
+    maintainers = [ maintainers.bzizou ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/octopus/default.nix b/nixpkgs/pkgs/applications/science/biology/octopus/default.nix
new file mode 100644
index 000000000000..c594108c6f47
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/octopus/default.nix
@@ -0,0 +1,47 @@
+{lib, stdenv, fetchurl, fetchFromGitHub, cmake, boost179, gmp, htslib, zlib, xz, pkg-config}:
+
+stdenv.mkDerivation rec {
+  pname = "octopus";
+  version = "0.7.4";
+
+  src = fetchFromGitHub {
+    owner = "luntergroup";
+    repo = "octopus";
+    rev = "v${version}";
+    sha256 = "sha256-FAogksVxUlzMlC0BqRu22Vchj6VX+8yNlHRLyb3g1sE=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ boost179 gmp htslib zlib xz ];
+
+  patches = [ (fetchurl {
+    url = "https://github.com/luntergroup/octopus/commit/17a597d192bcd5192689bf38c5836a98b824867a.patch";
+    sha256 = "sha256-VaUr63v7mzhh4VBghH7a7qrqOYwl6vucmmKzTi9yAjY=";
+  }) ];
+
+  postPatch = ''
+    # Disable -Werror to avoid build failure on fresh toolchains like
+    # gcc-13.
+    substituteInPlace lib/date/CMakeLists.txt --replace-fail ' -Werror ' ' '
+    substituteInPlace lib/ranger/CMakeLists.txt --replace-fail ' -Werror ' ' '
+    substituteInPlace lib/tandem/CMakeLists.txt --replace-fail ' -Werror ' ' '
+    substituteInPlace src/CMakeLists.txt --replace-fail ' -Werror ' ' '
+
+    # Fix gcc-13 build due to missing <cstdint> header.
+    sed -e '1i #include <cstdint>' -i src/core/tools/vargen/utils/assembler.hpp
+  '';
+
+  postInstall = ''
+    mkdir $out/bin
+    mv $out/octopus $out/bin
+  '';
+
+  meta = with lib; {
+    description = "Bayesian haplotype-based mutation calling";
+    mainProgram = "octopus";
+    license = licenses.mit;
+    homepage = "https://github.com/luntergroup/octopus";
+    maintainers = with maintainers; [ jbedo ];
+    platforms = platforms.x86_64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/paml/default.nix b/nixpkgs/pkgs/applications/science/biology/paml/default.nix
new file mode 100644
index 000000000000..c593b5ed3d34
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/paml/default.nix
@@ -0,0 +1,48 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "paml";
+  version = "4.10.7";
+
+  src = fetchFromGitHub {
+    owner = "abacus-gene";
+    repo = "paml";
+    rev = "refs/tags/${finalAttrs.version}";
+    hash = "sha256-P/oHaLxoQzjFuvmHyRdShHv1ayruy6O/I9w8aTyya2s=";
+  };
+
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-D_POSIX_C_SOURCE";
+
+  preBuild = ''
+    cd ./src/
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -pv $out/bin
+    cp -v codeml $out/bin
+    cp -v baseml $out/bin
+    cp -v basemlg $out/bin
+    cp -v chi2 $out/bin
+    cp -v codeml $out/bin
+    cp -v evolver $out/bin
+    cp -v mcmctree $out/bin
+    cp -v pamp $out/bin
+    cp -v yn00 $out/bin
+
+    runHook postInstall
+  '';
+
+  meta = {
+    description     = "Phylogenetic Analysis by Maximum Likelihood (PAML)";
+    longDescription = "PAML is a package of programs for phylogenetic analyses of DNA or protein sequences using maximum likelihood. It is maintained and distributed for academic use free of charge by Ziheng Yang. ANSI C source codes are distributed for UNIX/Linux/Mac OSX, and executables are provided for MS Windows. PAML is not good for tree making. It may be used to estimate parameters and test hypotheses to study the evolutionary process, when you have reconstructed trees using other programs such as PAUP*, PHYLIP, MOLPHY, PhyML, RaxML, etc.";
+    license     = lib.licenses.gpl3Only;
+    homepage    = "http://abacus.gene.ucl.ac.uk/software/paml.html";
+    changelog = "https://github.com/abacus-gene/paml/releases/tag/${finalAttrs.src.rev}";
+    platforms = lib.platforms.unix;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/biology/picard-tools/default.nix b/nixpkgs/pkgs/applications/science/biology/picard-tools/default.nix
new file mode 100644
index 000000000000..880ea77e9d24
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/picard-tools/default.nix
@@ -0,0 +1,33 @@
+{lib, stdenv, fetchurl, jre, makeWrapper}:
+
+stdenv.mkDerivation rec {
+  pname = "picard-tools";
+  version = "3.1.1";
+
+  src = fetchurl {
+    url = "https://github.com/broadinstitute/picard/releases/download/${version}/picard.jar";
+    sha256 = "sha256-FcefUf0KwAEEn53XubrB2991ncsCMKicf20fJG6LurQ=";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ jre ];
+
+  dontUnpack = true;
+
+  installPhase = ''
+    mkdir -p $out/libexec/picard
+    cp $src $out/libexec/picard/picard.jar
+    mkdir -p $out/bin
+    makeWrapper ${jre}/bin/java $out/bin/picard --add-flags "-jar $out/libexec/picard/picard.jar"
+  '';
+
+  meta = with lib; {
+    description = "Tools for high-throughput sequencing (HTS) data and formats such as SAM/BAM/CRAM and VCF";
+    license = licenses.mit;
+    homepage = "https://broadinstitute.github.io/picard/";
+    sourceProvenance = with sourceTypes; [ binaryBytecode ];
+    maintainers = with maintainers; [ jbedo ];
+    mainProgram = "picard";
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/platypus/default.nix b/nixpkgs/pkgs/applications/science/biology/platypus/default.nix
new file mode 100644
index 000000000000..d602395b8757
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/platypus/default.nix
@@ -0,0 +1,39 @@
+{lib, stdenv, fetchFromGitHub, python27, htslib, zlib, makeWrapper}:
+
+let python = python27.withPackages (ps: with ps; [ cython ]);
+
+in stdenv.mkDerivation {
+  pname = "platypus-unstable";
+  version = "2018-07-22";
+
+  src = fetchFromGitHub {
+    owner = "andyrimmer";
+    repo = "Platypus";
+    rev = "3e72641c69800da0cd4906b090298e654d316ee1";
+    sha256 = "0nah6r54b8xm778gqyb8b7rsd76z8ji4g73sm6rvpw5s96iib1vw";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ htslib python zlib ];
+
+  buildPhase = ''
+    patchShebangs .
+    make
+  '';
+
+  installPhase = ''
+    mkdir -p $out/libexec/platypus
+    cp -r ./* $out/libexec/platypus
+
+    mkdir -p $out/bin
+    makeWrapper ${python}/bin/python $out/bin/platypus --add-flags "$out/libexec/platypus/bin/Platypus.py"
+  '';
+
+  meta = with lib; {
+    description = "The Platypus variant caller";
+    license = licenses.gpl3;
+    homepage = "https://github.com/andyrimmer/Platypus";
+    maintainers = with maintainers; [ jbedo ];
+    platforms = platforms.x86_64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/plink-ng/default.nix b/nixpkgs/pkgs/applications/science/biology/plink-ng/default.nix
new file mode 100644
index 000000000000..0e65bed4cf3e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/plink-ng/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitHub, zlib, blas, lapack, darwin}:
+
+stdenv.mkDerivation rec {
+  pname = "plink-ng";
+  version = "1.90b3";
+
+  src = fetchFromGitHub {
+    owner = "chrchang";
+    repo = "plink-ng";
+    rev = "v${version}";
+    sha256 = "1zhffjbwpd50dxywccbnv1rxy9njwz73l4awc5j7i28rgj3davcq";
+  };
+
+  buildInputs = [ zlib ] ++ (if stdenv.isDarwin then [ darwin.apple_sdk.frameworks.Accelerate ] else [ blas lapack ]) ;
+
+  preBuild = ''
+    sed -i 's|zlib-1.2.8/zlib.h|zlib.h|g' *.c *.h
+    ${lib.optionalString stdenv.cc.isClang "sed -i 's|g++|clang++|g' Makefile.std"}
+
+    makeFlagsArray+=(
+      ZLIB=-lz
+      BLASFLAGS="-lblas -lcblas -llapack"
+    );
+  '';
+
+  makefile = "Makefile.std";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp plink $out/bin
+  '';
+
+  meta = {
+    broken = (stdenv.isLinux && stdenv.isAarch64);
+    description = "A comprehensive update to the PLINK association analysis toolset";
+    mainProgram = "plink";
+    homepage = "https://www.cog-genomics.org/plink2";
+    license = lib.licenses.gpl3;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/poretools/default.nix b/nixpkgs/pkgs/applications/science/biology/poretools/default.nix
new file mode 100644
index 000000000000..47ffd507efda
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/poretools/default.nix
@@ -0,0 +1,23 @@
+{ lib, python2Packages, fetchFromGitHub }:
+
+python2Packages.buildPythonPackage rec {
+  pname = "poretools";
+  version = "unstable-2016-07-10";
+
+  src = fetchFromGitHub {
+    repo = pname;
+    owner = "arq5x";
+    rev = "e426b1f09e86ac259a00c261c79df91510777407";
+    sha256 = "0bglj833wxpp3cq430p1d3xp085ls221js2y90w7ir2x5ay8l7am";
+  };
+
+  propagatedBuildInputs = [ python2Packages.h5py python2Packages.matplotlib python2Packages.seaborn python2Packages.pandas ];
+
+  meta = {
+    description = "a toolkit for working with nanopore sequencing data from Oxford Nanopore";
+    license = lib.licenses.mit;
+    homepage = "https://poretools.readthedocs.io/en/latest/";
+    maintainers = [ lib.maintainers.rybern ];
+    broken = true; # Build error: h5py-3.9.0 not supported for interpreter python2.7
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/prodigal/default.nix b/nixpkgs/pkgs/applications/science/biology/prodigal/default.nix
new file mode 100644
index 000000000000..cd83a723f91e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/prodigal/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "prodigal";
+  version = "2.6.3";
+
+  src = fetchFromGitHub {
+    repo = "Prodigal";
+    owner = "hyattpd";
+    rev = "v${version}";
+    sha256 = "1fs1hqk83qjbjhrvhw6ni75zakx5ki1ayy3v6wwkn3xvahc9hi5s";
+  };
+
+  makeFlags = [
+    "CC=${stdenv.cc.targetPrefix}cc"
+    "INSTALLDIR=$(out)/bin"
+  ];
+
+  meta = with lib; {
+    description = "Fast, reliable protein-coding gene prediction for prokaryotic genomes";
+    mainProgram = "prodigal";
+    homepage = "https://github.com/hyattpd/Prodigal";
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ luispedro ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/quast/default.nix b/nixpkgs/pkgs/applications/science/biology/quast/default.nix
new file mode 100644
index 000000000000..f280f81fae84
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/quast/default.nix
@@ -0,0 +1,60 @@
+{ lib, stdenv, fetchurl, python3Packages, zlib, bash }:
+
+let
+  pythonPackages = python3Packages;
+  inherit (pythonPackages) python;
+in
+
+pythonPackages.buildPythonApplication rec {
+  pname = "quast";
+  version = "5.0.2";
+
+  src = fetchurl {
+    url = "https://github.com/ablab/quast/releases/download/${pname}_${version}/${pname}-${version}.tar.gz";
+    sha256 = "13ml8qywbb4cc7wf2x7z5mz1rjqg51ab8wkizwcg4f6c40zgif6d";
+  };
+
+  pythonPath = with pythonPackages; [ simplejson joblib setuptools matplotlib ];
+
+  buildInputs = [ zlib ] ++ pythonPath;
+
+  dontConfigure = true;
+
+  dontBuild = true;
+
+  installPhase = ''
+    substituteInPlace quast_libs/bedtools/Makefile \
+      --replace "/bin/bash" "${bash}/bin/bash"
+    mkdir -p "$out/${python.sitePackages}"
+    export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"
+    ${python.pythonOnBuildForHost.interpreter} setup.py install \
+      --install-lib=$out/${python.sitePackages} \
+      --prefix="$out"
+  '';
+
+   postFixup = ''
+   for file in $(find $out -type f -type f -perm /0111); do
+       old_rpath=$(patchelf --print-rpath $file) && \
+       patchelf --set-rpath $old_rpath:${stdenv.cc.cc.lib}/lib $file || true
+   done
+   # Link to the master program
+   ln -s $out/bin/quast.py $out/bin/quast
+  '';
+
+  dontPatchELF = true;
+
+  # Tests need to download data files, so manual run after packaging is needed
+  doCheck = false;
+
+  meta = with lib ; {
+    description = "Evaluates genome assemblies by computing various metrics";
+    homepage = "https://github.com/ablab/quast";
+    sourceProvenance = with sourceTypes; [
+      fromSource
+      binaryNativeCode  # source bundles binary dependencies
+    ];
+    license = licenses.gpl2;
+    maintainers = [ maintainers.bzizou ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/raxml/default.nix b/nixpkgs/pkgs/applications/science/biology/raxml/default.nix
new file mode 100644
index 000000000000..0cc20b063503
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/raxml/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv
+, fetchFromGitHub
+, useMpi ? false
+, mpi
+}:
+
+stdenv.mkDerivation rec {
+  pname = "RAxML${lib.optionalString useMpi "-mpi"}";
+  version = "8.2.13";
+
+  src = fetchFromGitHub {
+    owner = "stamatak";
+    repo = "standard-RAxML";
+    rev = "v${version}";
+    sha256 = "sha256-w+Eqi0GhVira1H6ZnMNeZGBMzDjiGT7JSFpQEVXONyk=";
+  };
+
+  buildInputs = lib.optionals useMpi [ mpi ];
+
+  # TODO darwin, AVX and AVX2 makefile targets
+  buildPhase = if useMpi then ''
+      make -f Makefile.MPI.gcc
+    '' else ''
+      make -f Makefile.SSE3.PTHREADS.gcc
+    '';
+
+  installPhase = if useMpi then ''
+    mkdir -p $out/bin && cp raxmlHPC-MPI $out/bin
+  '' else ''
+    mkdir -p $out/bin && cp raxmlHPC-PTHREADS-SSE3 $out/bin
+  '';
+
+  meta = with lib; {
+    description = "A tool for Phylogenetic Analysis and Post-Analysis of Large Phylogenies";
+    license = licenses.gpl3;
+    homepage = "https://sco.h-its.org/exelixis/web/software/raxml/";
+    maintainers = [ maintainers.unode ];
+    platforms = [ "i686-linux" "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/repseek/default.nix b/nixpkgs/pkgs/applications/science/biology/repseek/default.nix
new file mode 100644
index 000000000000..e5e0193f7911
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/repseek/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "repseek";
+  version = "9Sep2014";
+  src = fetchurl {
+    url = "https://bioinfo.mnhn.fr/abi/public/RepSeek/RepSeek.${version}.tgz";
+    sha256 = "1jiknji3ivrv7zmrfbf2mccfpdwhin3lfxfsciaqwf69b3sda8nf";
+  };
+
+  preConfigure = ''
+    mkdir -p $out/bin
+    substituteInPlace Makefile \
+      --replace "INSTALLDIR = \$\$HOME/bin" "INSTALLDIR = $out/bin/" \
+      --replace "CC= gcc" "CC = $CC"
+  '' + lib.optionalString stdenv.isLinux ''
+    substituteInPlace Makefile --replace "MACHINE = MACOSX" "MACHINE = LINUX"
+  '';
+
+  meta = {
+    description = "Tool to retrieve approximate repeats from large DNA sequences";
+    mainProgram = "repseek";
+    homepage = "https://bioinfo.mnhn.fr/abi/public/RepSeek";
+    maintainers = [ lib.maintainers.bzizou ];
+    license = lib.licenses.lgpl21;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/sambamba/default.nix b/nixpkgs/pkgs/applications/science/biology/sambamba/default.nix
new file mode 100644
index 000000000000..b6635f02aacd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/sambamba/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, python3
+, which
+, ldc
+, zlib
+, lz4
+}:
+
+stdenv.mkDerivation rec {
+  pname = "sambamba";
+  version = "1.0.1";
+
+  src = fetchFromGitHub {
+    owner = "biod";
+    repo = "sambamba";
+    rev = "v${version}";
+    sha256 = "sha256-3O9bHGpMuCgdR2Wm7Dv1VUjMT1QTn8K1hdwgjvwhFDw=";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ which python3 ldc ];
+  buildInputs = [ zlib lz4 ];
+
+  buildFlags = [
+    "CC=${stdenv.cc.targetPrefix}cc"
+  ];
+
+  # Upstream's install target is broken; copy manually
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm755 bin/sambamba-${version} $out/bin/sambamba
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "SAM/BAM processing tool";
+    mainProgram = "sambamba";
+    homepage = "https://lomereiter.github.io/sambamba/";
+    maintainers = with maintainers; [ jbedo ];
+    license = with licenses; gpl2;
+    platforms = platforms.x86_64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/samblaster/default.nix b/nixpkgs/pkgs/applications/science/biology/samblaster/default.nix
new file mode 100644
index 000000000000..f16d0e42d8ef
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/samblaster/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "samblaster";
+  version = "0.1.26";
+
+  src = fetchFromGitHub {
+    owner = "GregoryFaust";
+    repo = "samblaster";
+    rev = "v.${version}";
+    sha256 = "0g24fq5hplnfgqkh3xqpg3lgx3wmxwnh9c7m6yw7pbi40lmgl1jv";
+  };
+
+  makeFlags = [ "CPP=${stdenv.cc.targetPrefix}c++" ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp samblaster $out/bin
+  '';
+
+  meta = with lib; {
+    description = "Tool for marking duplicates and extracting discordant/split reads from SAM/BAM files";
+    mainProgram = "samblaster";
+    maintainers = with maintainers; [ jbedo ];
+    license = licenses.mit;
+    homepage = "https://github.com/GregoryFaust/samblaster";
+    platforms = platforms.x86_64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/samtools/default.nix b/nixpkgs/pkgs/applications/science/biology/samtools/default.nix
new file mode 100644
index 000000000000..70f436a088e1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/samtools/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchurl, fetchpatch, zlib, htslib, perl, ncurses ? null }:
+
+stdenv.mkDerivation rec {
+  pname = "samtools";
+  version = "1.19.2";
+
+  src = fetchurl {
+    url = "https://github.com/samtools/samtools/releases/download/${version}/${pname}-${version}.tar.bz2";
+    hash = "sha256-cfYEmWaOTAjn10X7/yTBXMigl3q6sazV0rtBm9sGXpY=";
+  };
+
+  # tests require `bgzip` from the htslib package
+  nativeCheckInputs = [ htslib ];
+
+  nativeBuildInputs = [ perl ];
+
+  buildInputs = [ zlib ncurses htslib ];
+
+  preConfigure = lib.optional stdenv.hostPlatform.isStatic ''
+    export LIBS="-lz -lbz2 -llzma"
+  '';
+  makeFlags = lib.optional stdenv.hostPlatform.isStatic "AR=${stdenv.cc.targetPrefix}ar";
+
+  configureFlags = [ "--with-htslib=${htslib}" ]
+    ++ lib.optional (ncurses == null) "--without-curses"
+    ++ lib.optionals stdenv.hostPlatform.isStatic ["--without-curses" ]
+    ;
+
+  preCheck = ''
+    patchShebangs test/
+  '';
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Tools for manipulating SAM/BAM/CRAM format";
+    license = licenses.mit;
+    homepage = "http://www.htslib.org/";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ mimame unode ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/samtools/samtools-0.1.19-no-curses.patch b/nixpkgs/pkgs/applications/science/biology/samtools/samtools-0.1.19-no-curses.patch
new file mode 100644
index 000000000000..a7782a1a0264
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/samtools/samtools-0.1.19-no-curses.patch
@@ -0,0 +1,22 @@
+diff --git a/Makefile b/Makefile
+index 2f51bfc..395d6f1 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,7 +1,7 @@
+ CC=			gcc
+ CFLAGS=		-g -Wall -O2
+ #LDFLAGS=		-Wl,-rpath,\$$ORIGIN/../lib
+-DFLAGS=		-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE -D_CURSES_LIB=1
++DFLAGS=		-D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_USE_KNETFILE # -D_CURSES_LIB=1
+ KNETFILE_O=	knetfile.o
+ LOBJS=		bgzf.o kstring.o bam_aux.o bam.o bam_import.o sam.o bam_index.o	\
+ 			bam_pileup.o bam_lpileup.o bam_md.o razf.o faidx.o bedidx.o \
+@@ -15,7 +15,7 @@ PROG=		samtools
+ INCLUDES=	-I.
+ SUBDIRS=	. bcftools misc
+ LIBPATH=
+-LIBCURSES=	-lcurses # -lXCurses
++LIBCURSES=	# -lcurses # -lXCurses
+ 
+ .SUFFIXES:.c .o
+ .PHONY: all lib
diff --git a/nixpkgs/pkgs/applications/science/biology/samtools/samtools_0_1_19.nix b/nixpkgs/pkgs/applications/science/biology/samtools/samtools_0_1_19.nix
new file mode 100644
index 000000000000..edb3a9a9da5b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/samtools/samtools_0_1_19.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "samtools";
+  version = "0.1.19";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/samtools/${pname}-${version}.tar.bz2";
+    sha256 = "d080c9d356e5f0ad334007e4461cbcee3c4ca97b8a7a5a48c44883cf9dee63d4";
+  };
+
+  patches = [
+    ./samtools-0.1.19-no-curses.patch
+  ];
+
+  buildInputs = [ zlib ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mkdir -p $out/share/man
+
+    cp samtools $out/bin
+    cp samtools.1 $out/share/man
+  '';
+
+  meta = with lib; {
+    description = "Tools for manipulating SAM/BAM/CRAM format";
+    mainProgram = "samtools";
+    license = licenses.mit;
+    homepage = "https://samtools.sourceforge.net/";
+    platforms = platforms.unix;
+    maintainers = [ maintainers.unode ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/seaview/default.nix b/nixpkgs/pkgs/applications/science/biology/seaview/default.nix
new file mode 100644
index 000000000000..06549748018d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/seaview/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchurl, coreutils, fltk, libjpeg }:
+
+stdenv.mkDerivation rec {
+  version = "5.0.5";
+  pname = "seaview";
+
+  src = fetchurl {
+    url = "ftp://pbil.univ-lyon1.fr/pub/mol_phylogeny/seaview/archive/seaview_${version}.tar.gz";
+    sha256 = "sha256-zo9emLpHiDv6kekbx55NOibxWN2Zg7XngzGkUqSx+PI=";
+  };
+
+  buildInputs = [ fltk libjpeg ];
+
+  patchPhase = "sed -i 's#PATH=/bin:/usr/bin rm#'${coreutils}/bin/rm'#' seaview.cxx";
+  installPhase = "mkdir -p $out/bin; cp seaview $out/bin";
+
+  meta = with lib; {
+    description = "GUI for molecular phylogeny";
+    mainProgram = "seaview";
+    longDescription = ''
+      SeaView is a multiplatform, graphical user interface for multiple sequence alignment and molecular phylogeny.
+        - SeaView reads and writes various file formats (NEXUS, MSF, CLUSTAL, FASTA, PHYLIP, MASE, Newick) of DNA and protein sequences and of phylogenetic trees.
+        - SeaView drives programs muscle or Clustal Omega for multiple sequence alignment, and also allows to use any external alignment algorithm able to read and write FASTA-formatted files.
+        - Seaview drives the Gblocks program to select blocks of evolutionarily conserved sites.
+        - SeaView computes phylogenetic trees by
+          + parsimony, using PHYLIP's dnapars/protpars algorithm,
+          + distance, with NJ or BioNJ algorithms on a variety of evolutionary distances,
+          + maximum likelihood, driving program PhyML 3.1.
+        - Seaview can use the Transfer Bootstrap Expectation method to compute the bootstrap support of PhyML and distance trees.
+        - SeaView prints and draws phylogenetic trees on screen, SVG, PDF or PostScript files.
+        - SeaView allows to download sequences from EMBL/GenBank/UniProt using the Internet.
+
+      Seaview is published in:
+
+          Gouy M., Guindon S. & Gascuel O. (2010) SeaView version 4 : a multiplatform graphical user interface for sequence alignment and phylogenetic tree building. Molecular Biology and Evolution 27(2):221-224.
+    '';
+    homepage = "https://doua.prabi.fr/software/seaview";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.iimog ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/seqkit/default.nix b/nixpkgs/pkgs/applications/science/biology/seqkit/default.nix
new file mode 100644
index 000000000000..1c572ba56354
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/seqkit/default.nix
@@ -0,0 +1,25 @@
+{ lib
+, fetchFromGitHub
+, buildGoModule
+}:
+
+buildGoModule rec {
+  pname = "seqkit";
+  version = "2.8.0";
+
+  src = fetchFromGitHub {
+    owner = "shenwei356";
+    repo = "seqkit";
+    rev = "v${version}";
+    sha256 = "sha256-JsrmRUbSNCFJ58tIblKq+VRXCD1mBeCAcosDGiVb5Gs=";
+  };
+
+  vendorHash = "sha256-0//kySYhNmfiwiys/Ku0/8RzKpnxO0+byD8pcIkvDY0=";
+
+  meta = with lib; {
+    description = "cross-platform and ultrafast toolkit for FASTA/Q file manipulation";
+    homepage = "https://github.com/shenwei356/seqkit";
+    license = licenses.mit;
+    maintainers = with maintainers; [ bzizou ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/seqtk/default.nix b/nixpkgs/pkgs/applications/science/biology/seqtk/default.nix
new file mode 100644
index 000000000000..417bec9c062f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/seqtk/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, zlib
+, libdeflate
+, isa-l
+}:
+
+stdenv.mkDerivation rec {
+  pname = "seqtk";
+  version = "1.4";
+
+  src = fetchFromGitHub {
+    owner = "lh3";
+    repo = "seqtk";
+    rev = "v${version}";
+    hash = "sha256-W6IUn7R9tlnWrKe/qOHJL+43AL4EZB7zj7M5u9l83WE=";
+  };
+
+  buildInputs = [ zlib libdeflate isa-l ];
+
+  makeFlags = [ "CC=cc" ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm755 -t $out/bin seqtk
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Toolkit for processing sequences in FASTA/Q formats";
+    mainProgram = "seqtk";
+    license = licenses.mit;
+    homepage = "https://github.com/lh3/seqtk";
+    platforms = platforms.all;
+    maintainers = with maintainers; [ bwlang ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/snpeff/default.nix b/nixpkgs/pkgs/applications/science/biology/snpeff/default.nix
new file mode 100644
index 000000000000..269d6e307f1d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/snpeff/default.nix
@@ -0,0 +1,35 @@
+{lib, stdenv, fetchurl, jre, unzip, makeWrapper}:
+
+stdenv.mkDerivation rec {
+  pname = "snpeff";
+  version = "4.3t";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/snpeff/snpEff_v${builtins.replaceStrings [ "." ] [ "_" ] version}_core.zip";
+    sha256 = "0i12mv93bfv8xjwc3rs2x73d6hkvi7kgbbbx3ry984l3ly4p6nnm";
+  };
+
+  nativeBuildInputs = [ makeWrapper unzip ];
+  buildInputs = [ jre ];
+
+  sourceRoot = "snpEff";
+
+  installPhase = ''
+    mkdir -p $out/libexec/snpeff
+    cp *.jar *.config $out/libexec/snpeff
+
+    mkdir -p $out/bin
+    makeWrapper ${jre}/bin/java $out/bin/snpeff --add-flags "-jar $out/libexec/snpeff/snpEff.jar"
+    makeWrapper ${jre}/bin/java $out/bin/snpsift --add-flags "-jar $out/libexec/snpeff/SnpSift.jar"
+  '';
+
+  meta = with lib; {
+    description = "Genetic variant annotation and effect prediction toolbox";
+    license = licenses.lgpl3;
+    homepage = "https://snpeff.sourceforge.net/";
+    sourceProvenance = with sourceTypes; [ binaryBytecode ];
+    maintainers = with maintainers; [ jbedo ];
+    platforms = platforms.all;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/somatic-sniper/default.nix b/nixpkgs/pkgs/applications/science/biology/somatic-sniper/default.nix
new file mode 100644
index 000000000000..553725fb4566
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/somatic-sniper/default.nix
@@ -0,0 +1,30 @@
+{lib, stdenv, fetchFromGitHub, cmake, zlib, ncurses}:
+
+stdenv.mkDerivation rec {
+  pname = "somatic-sniper";
+  version = "1.0.5.0";
+
+  src = fetchFromGitHub {
+    owner = "genome";
+    repo = "somatic-sniper";
+    rev = "v${version}";
+    sha256 = "0lk7p9sp6mp50f6w1nppqhr40fcwy1asw06ivw8w8jvvnwaqf987";
+  };
+
+  patches = [ ./somatic-sniper.patch ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib ncurses ];
+
+  enableParallelBuilding = false;
+
+  meta = with lib; {
+    description = "Identify single nucleotide positions that are different between tumor and normal";
+    mainProgram = "bam-somaticsniper";
+    license = licenses.mit;
+    homepage = "https://github.com/genome/somatic-sniper";
+    maintainers = with maintainers; [ jbedo ];
+    platforms = platforms.linux;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/somatic-sniper/somatic-sniper.patch b/nixpkgs/pkgs/applications/science/biology/somatic-sniper/somatic-sniper.patch
new file mode 100644
index 000000000000..9af04c0a0696
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/somatic-sniper/somatic-sniper.patch
@@ -0,0 +1,26 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 6d5a180..7254292 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -11,7 +11,7 @@ set(CMAKE_MODULE_PATH
+     )
+ 
+ include(TestHelper)
+-include(VersionHelper)
++#include(VersionHelper)
+ include(ProjectHelper)
+ 
+ # NOTE: for sniper we want the exe suffix to be like 0.7.4, not just 0.7
+diff --git a/vendor/samtools.patch b/vendor/samtools.patch
+index f173017..654f878 100644
+--- a/vendor/samtools.patch
++++ b/vendor/samtools.patch
+@@ -6,7 +6,7 @@ diff -Nuar a/Makefile b/Makefile
+  
+  samtools:lib $(AOBJS)
+ -		$(CC) $(CFLAGS) -o $@ $(AOBJS) -lm $(LIBPATH) $(LIBCURSES) -lz -L. -lbam
+-+		$(CC) $(CFLAGS) -o $@ $(AOBJS) -lm $(LIBPATH) $(LIBCURSES) -L. -lbam -lz
+++		$(CC) $(CFLAGS) -o $@ $(AOBJS) -lm $(LIBPATH) -lncurses -L. -lbam -lz
+  
+  razip:razip.o razf.o
+  		$(CC) $(CFLAGS) -o $@ razf.o razip.o -lz
diff --git a/nixpkgs/pkgs/applications/science/biology/sortmerna/default.nix b/nixpkgs/pkgs/applications/science/biology/sortmerna/default.nix
new file mode 100644
index 000000000000..d47aae9ce665
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/sortmerna/default.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, cmake, rocksdb, rapidjson, pkg-config, fetchFromGitHub, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "sortmerna";
+  version = "4.2.0";
+
+  src = fetchFromGitHub {
+    repo = pname;
+    owner = "biocore";
+    rev = "v${version}";
+    sha256 = "0r91viylzr069jm7kpcgb45kagvf8sqcj5zc1af4arl9sgfs1f3j";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ zlib rocksdb rapidjson ];
+
+  cmakeFlags = [
+    "-DPORTABLE=off"
+    "-DRAPIDJSON_HOME=${rapidjson}"
+    "-DROCKSDB_HOME=${rocksdb}"
+    "-DROCKSDB_STATIC=off"
+    "-DZLIB_STATIC=off"
+  ];
+
+  postPatch = ''
+    # Fix formatting string error:
+    # https://github.com/biocore/sortmerna/issues/255
+    substituteInPlace src/sortmerna/indexdb.cpp \
+      --replace 'is_verbose, ss' 'is_verbose, "%s", ss'
+
+    # Fix missing pthread dependency for the main binary.
+    substituteInPlace src/sortmerna/CMakeLists.txt \
+      --replace "target_link_libraries(sortmerna" \
+        "target_link_libraries(sortmerna Threads::Threads"
+
+    # Fix gcc-13 build by adding missing <cstdint> includes:
+    #   https://github.com/sortmerna/sortmerna/issues/412
+    sed -e '1i #include <cstdint>' -i include/kseq_load.hpp
+  '';
+
+  meta = with lib; {
+    description = "Tools for filtering, mapping, and OTU-picking from shotgun genomics data";
+    mainProgram = "sortmerna";
+    license = licenses.lgpl3;
+    platforms = platforms.x86_64;
+    homepage = "https://bioinfo.lifl.fr/RNA/sortmerna/";
+    maintainers = with maintainers; [ luispedro ];
+    broken = stdenv.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/spades/default.nix b/nixpkgs/pkgs/applications/science/biology/spades/default.nix
new file mode 100644
index 000000000000..0b0491a71aae
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/spades/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, zlib, bzip2, cmake, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "SPAdes";
+  version = "3.15.5";
+
+  src = fetchurl {
+    url = "http://cab.spbu.ru/files/release${version}/${pname}-${version}.tar.gz";
+    sha256 = "sha256-FVw2QNVx8uexmgUDHR/Q0ZvYLfeF04hw+5O9JBsSu/o=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ zlib bzip2 python3 ];
+
+  doCheck = true;
+
+  sourceRoot = "${pname}-${version}/src";
+
+  env.CXXFLAGS = toString [
+    # GCC 13: error: 'uint32_t' does not name a type
+    "-include cstdint"
+  ];
+
+  meta = with lib; {
+    description = "St. Petersburg genome assembler: assembly toolkit containing various assembly pipelines";
+    license = licenses.gpl2Only;
+    homepage = "http://cab.spbu.ru/software/spades/";
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+    maintainers = [ maintainers.bzizou ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/sratoolkit/default.nix b/nixpkgs/pkgs/applications/science/biology/sratoolkit/default.nix
new file mode 100644
index 000000000000..a36157ed5d16
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/sratoolkit/default.nix
@@ -0,0 +1,56 @@
+{ stdenv
+, lib
+, fetchurl
+, autoPatchelfHook
+, libidn
+, zlib
+, bzip2
+}:
+
+
+let
+  libidn11 = libidn.overrideAttrs (old: {
+    pname = "libidn";
+    version = "1.34";
+    src = fetchurl {
+      url = "mirror://gnu/libidn/libidn-1.34.tar.gz";
+      sha256 = "0g3fzypp0xjcgr90c5cyj57apx1cmy0c6y9lvw2qdcigbyby469p";
+    };
+  });
+
+in
+
+stdenv.mkDerivation rec {
+  pname = "sratoolkit";
+  version = "2.11.3";
+
+  src = fetchurl {
+    url = "https://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/${version}/sratoolkit.${version}-ubuntu64.tar.gz";
+    sha256 = "1590lc4cplxr3lhjqci8fjncy67imn2h14qd2l87chmhjh243qvx";
+  };
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+  ];
+
+  buildInputs = [
+    libidn11
+    zlib
+    bzip2
+    stdenv.cc.cc.lib
+  ];
+
+  sourceRoot = "sratoolkit.${version}-ubuntu64/bin";
+
+  installPhase = ''
+    find -L . -executable -type f -! -name "*remote-fuser*" -exec install -m755 -D {} $out/bin/{} \;
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/ncbi/sra-tools";
+    description = "The SRA Toolkit and SDK from NCBI is a collection of tools and libraries for using data in the INSDC Sequence Read Archives.";
+    license = licenses.publicDomain;
+    maintainers = with maintainers; [ thyol ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/stacks/default.nix b/nixpkgs/pkgs/applications/science/biology/stacks/default.nix
new file mode 100644
index 000000000000..3d385b54d469
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/stacks/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "stacks";
+  version = "2.66";
+  src = fetchurl {
+    url = "http://catchenlab.life.illinois.edu/stacks/source/${pname}-${version}.tar.gz";
+    sha256 = "sha256-9pHmcLYMdn9xy3vhlOU42Io/4L61auoncfpZNRPUN/I=";
+  };
+
+  buildInputs = [ zlib ];
+
+  meta = {
+    description = "Software pipeline for building loci from short-read sequences";
+    homepage = "http://catchenlab.life.illinois.edu/stacks/";
+    maintainers = [ lib.maintainers.bzizou ];
+    license = lib.licenses.gpl3Plus;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/star/default.nix b/nixpkgs/pkgs/applications/science/biology/star/default.nix
new file mode 100644
index 000000000000..3383a78e1d38
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/star/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchFromGitHub, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "star";
+  version = "2.7.10b";
+
+  src = fetchFromGitHub {
+    repo = "STAR";
+    owner = "alexdobin";
+    rev = version;
+    sha256 = "sha256-58Y4lzqXwBhRlXcionUg2IhAg5znNUuyr/FsuNZd+5Q=";
+  };
+
+  sourceRoot = "${src.name}/source";
+
+  postPatch = ''
+    substituteInPlace Makefile --replace "/bin/rm" "rm"
+  '';
+
+  buildInputs = [ zlib ];
+
+  buildFlags = [ "STAR" "STARlong" ];
+
+  enableParallelBuilding = true;
+
+  installPhase = ''
+    runHook preInstall
+    install -D STAR STARlong -t $out/bin
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Spliced Transcripts Alignment to a Reference";
+    homepage = "https://github.com/alexdobin/STAR";
+    license = licenses.gpl3Plus;
+    platforms = [ "x86_64-linux" ];
+    maintainers = [ maintainers.arcadio ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/strelka/default.nix b/nixpkgs/pkgs/applications/science/biology/strelka/default.nix
new file mode 100644
index 000000000000..ad6c0d9e5a4c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/strelka/default.nix
@@ -0,0 +1,63 @@
+{lib, stdenv, fetchFromGitHub, fetchpatch, cmake, boost, zlib, python2}:
+
+stdenv.mkDerivation rec {
+  pname = "strelka";
+  version = "2.9.10";
+
+  src = fetchFromGitHub {
+    owner = "Illumina";
+    repo = "strelka";
+    rev = "v${version}";
+    sha256 = "1nykbmim1124xh22nrhrsn8xgjb3s2y7akrdapn9sl1gdych4ppf";
+  };
+
+  patches = [
+    # Pull pending fix for gcc-12:
+    #   https://github.com/Illumina/strelka/pull/204
+    (fetchpatch {
+      name = "limits.patch";
+      url = "https://github.com/Illumina/strelka/commit/98272cd345c6e4c672e6a5b7721204fcac0502d6.patch";
+      hash = "sha256-psBiuN32nvwZ+QX51JQjIdRhEE3k7PfwbkD10ckqvZk=";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace src/cmake/boost.cmake \
+      --replace "1.58.0" "${boost.version}" \
+      --replace "Boost_USE_STATIC_LIBS ON" "Boost_USE_STATIC_LIBS OFF"
+  '';
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost zlib python2 ];
+
+  cmakeFlags = [
+    "-DCMAKE_CXX_STANDARD=14"
+  ];
+
+  env.NIX_CFLAGS_COMPILE = toString [
+    "-Wno-error=maybe-uninitialized"
+    "-Wno-error=pessimizing-move"
+  ];
+
+  preConfigure = ''
+    sed -i 's|/usr/bin/env python|${python2}/bin/python|' src/python/lib/makeRunScript.py
+    patchShebangs .
+  '';
+
+  postFixup = ''
+    pushd $out/lib/python/pyflow
+    sed -i 's|/bin/bash|${stdenv.shell}|' pyflowTaskWrapper.py
+    rm pyflowTaskWrapper.pyc
+    echo "import pyflowTaskWrapper" | python2
+    popd
+  '';
+
+  meta = with lib; {
+    description = "Germline and small variant caller";
+    license = licenses.gpl3;
+    homepage = "https://github.com/Illumina/strelka";
+    maintainers = with maintainers; [ jbedo ];
+    platforms = platforms.linux;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/subread/default.nix b/nixpkgs/pkgs/applications/science/biology/subread/default.nix
new file mode 100644
index 000000000000..62ea61af9192
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/subread/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, stdenv
+, fetchurl
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "subread";
+  version = "2.0.6";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/subread/subread-${version}/subread-${version}-source.tar.gz";
+    sha256 = "sha256-8P3aa5hjTSlGAolIwiAlPhCg8nx/pfJJE7ZbOsbLsEU=";
+  };
+
+  buildInputs = [
+    zlib
+  ];
+
+  configurePhase = ''
+    cd src
+    cp Makefile.${if stdenv.isLinux then "Linux" else "MacOS"} Makefile
+  '';
+
+  makeFlags = [ "CC_EXEC=cc" ];
+
+  installPhase = ''
+    mkdir $out
+    cp -r ../bin $out
+  '';
+
+  meta = with lib; {
+    broken = stdenv.isDarwin;
+    description = "High-performance read alignment, quantification and mutation discovery";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ jbedo ];
+    platforms = [ "x86_64-darwin" "x86_64-linux" ];
+    homepage = "https://subread.sourceforge.net/";
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/sumatools/default.nix b/nixpkgs/pkgs/applications/science/biology/sumatools/default.nix
new file mode 100644
index 000000000000..2a30f33172b9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/sumatools/default.nix
@@ -0,0 +1,68 @@
+{ lib, gccStdenv, fetchFromGitLab, zlib }:
+
+let
+  stdenv = gccStdenv;
+  meta = with lib; {
+    description = "Fast and exact comparison and clustering of sequences";
+    homepage = "https://metabarcoding.org/sumatra";
+    maintainers = [ maintainers.bzizou ];
+    platforms = platforms.unix;
+  };
+
+in rec {
+
+  # Suma library
+  sumalibs = stdenv.mkDerivation rec {
+    version = "1.0.34";
+    pname = "sumalibs";
+    src = fetchFromGitLab {
+      domain = "git.metabarcoding.org";
+      owner = "obitools";
+      repo = pname;
+      rev = "sumalib_v${version}";
+      sha256 = "0hwkrxzfz7m5wdjvmrhkjg8kis378iaqr5n4nhdhkwwhn8x1jn5a";
+    };
+    makeFlags = [ "PREFIX=$(out)" ];
+    inherit meta;
+  };
+
+  # Sumatra
+  sumatra = stdenv.mkDerivation rec {
+    version = "1.0.34";
+    pname = "sumatra";
+    src = fetchFromGitLab {
+      domain = "git.metabarcoding.org";
+      owner = "obitools";
+      repo = pname;
+      rev = "${pname}_v${version}";
+      sha256 = "1bbpbdkshdc3xffqnr1qfy8qk64ldsmdc3s8mrcrlx132rgbi5f6";
+    };
+    buildInputs = [ sumalibs zlib ];
+    makeFlags = [
+      "LIBSUMA=${sumalibs}/lib/libsuma.a"
+      "LIBSUMAPATH=-L${sumalibs}"
+      "PREFIX=$(out)"
+    ];
+    inherit meta;
+  };
+
+  # Sumaclust
+  sumaclust = stdenv.mkDerivation rec {
+    version = "1.0.34";
+    pname = "sumaclust";
+    src = fetchFromGitLab {
+      domain = "git.metabarcoding.org";
+      owner = "obitools";
+      repo = pname;
+      rev = "${pname}_v${version}";
+      sha256 = "0x8yi3k3jxhmv2krp4rcjlj2f9zg0qrk7gx4kpclf9c3yxgsgrds";
+    };
+    buildInputs = [ sumalibs ];
+    makeFlags = [
+      "LIBSUMA=${sumalibs}/lib/libsuma.a"
+      "LIBSUMAPATH=-L${sumalibs}"
+      "PREFIX=$(out)"
+    ];
+    inherit meta;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/svaba/default.nix b/nixpkgs/pkgs/applications/science/biology/svaba/default.nix
new file mode 100644
index 000000000000..fec5a5a3b92d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/svaba/default.nix
@@ -0,0 +1,57 @@
+{ lib, stdenv, zlib, bzip2, xz, fetchFromGitHub } :
+
+stdenv.mkDerivation rec {
+  version = "1.1.0";
+  pname = "svaba";
+
+  src = fetchFromGitHub {
+    owner = "walaj";
+    repo = pname;
+    rev = version;
+    sha256 = "1vv5mc9z5d22kgdy7mm27ya5aahnqgkcrskdr2405058ikk9g8kp";
+    fetchSubmodules = true;
+  };
+
+  buildInputs = [ zlib bzip2 xz ];
+
+  postPatch = ''
+    # Fix gcc-13 build failure due to missing includes
+    sed -e '1i #include <cstdint>' -i \
+      SeqLib/src/non_api/Histogram.h \
+      src/svaba/Histogram.h
+  '';
+
+  # Workaround build failure on -fno-common toolchains like upstream
+  # gcc-10. Otherwise build fails as:
+  #   ld: ./libfml.a(rle.o):/build/source/SeqLib/fermi-lite/rle.h:33: multiple definition of
+  #     `rle_auxtab'; ./libfml.a(misc.o):/build/source/SeqLib/fermi-lite/rle.h:33: first defined here
+  env.NIX_CFLAGS_COMPILE = "-fcommon";
+
+  installPhase = ''
+    runHook preInstall
+    install -Dm555 src/svaba/svaba $out/bin/svaba
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    broken = (stdenv.isLinux && stdenv.isAarch64);
+    description = "Structural variant and INDEL caller for DNA sequencing data, using genome-wide local assembly";
+    mainProgram = "svaba";
+    license = licenses.gpl3;
+    homepage = "https://github.com/walaj/svaba";
+    maintainers = with maintainers; [ scalavision ];
+    platforms = platforms.linux;
+    longDescription = ''
+      SvABA is a method for detecting structural variants in sequencing data
+      using genome-wide local assembly. Under the hood, SvABA uses a custom
+      implementation of SGA (String Graph Assembler) by Jared Simpson,
+      and BWA-MEM by Heng Li. Contigs are assembled for every 25kb window
+      (with some small overlap) for every region in the genome.
+      The default is to use only clipped, discordant, unmapped and indel reads,
+      although this can be customized to any set of reads at the command line using VariantBam rules.
+      These contigs are then immediately aligned to the reference with BWA-MEM and parsed to identify variants.
+      Sequencing reads are then realigned to the contigs with BWA-MEM, and variants are scored by their read support.
+    '';
+
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/tandem-aligner/default.nix b/nixpkgs/pkgs/applications/science/biology/tandem-aligner/default.nix
new file mode 100644
index 000000000000..0b3f2520d82b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/tandem-aligner/default.nix
@@ -0,0 +1,67 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, zlib
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "TandemAligner";
+  version = "0.1";
+
+  src = fetchFromGitHub {
+    owner = "seryrzu";
+    repo = "tandem_aligner";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-iMDj1HZ8LzmZckuAM3lbG3eSJSd/5JGVA6SBs7+AgX8=";
+  };
+
+  patches = [
+    (fetchpatch {
+      # https://github.com/seryrzu/tandem_aligner/pull/4
+      url = "https://github.com/seryrzu/tandem_aligner/commit/8b516c94f90aaa9cb84278aa811285d4204b03a9.patch";
+      hash = "sha256-kD46SykXklG/avK0+sc61YKFw9Bes8ZgFAjVXmcpN8k=";
+      stripLen = 1;
+    })
+  ];
+
+  sourceRoot = "${finalAttrs.src.name}/tandem_aligner";
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ zlib ];
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/bin
+    cp src/projects/tandem_aligner/tandem_aligner $out/bin
+    runHook postInstall
+  '';
+
+  doCheck = true;
+
+  # adapted from target test_launch in Makefile
+  checkPhase = ''
+    runHook preCheck
+    mkdir -p $TMPDIR/test_launch
+    src/projects/tandem_aligner/tandem_aligner \
+      --first $src/tandem_aligner/test_dataset/first.fasta \
+      --second $src/tandem_aligner/test_dataset/second.fasta \
+      -o $TMPDIR/test_launch \
+      --debug
+    grep -q "Thank you for using TandemAligner!" $TMPDIR/test_launch/tandem_aligner.log
+    diff $TMPDIR/test_launch/cigar.txt $src/tandem_aligner/test_dataset/true_cigar.txt
+    runHook postCheck
+  '';
+
+  meta = {
+    description = "A parameter-free algorithm for sequence alignment";
+    homepage = "https://github.com/seryrzu/tandem_aligner";
+    changelog = "https://github.com/seryrzu/tandem_aligner/releases/tag/v${finalAttrs.version}";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ amesgen ];
+    platforms = lib.platforms.linux;
+    mainProgram = "tandem_aligner";
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/biology/tebreak/default.nix b/nixpkgs/pkgs/applications/science/biology/tebreak/default.nix
new file mode 100644
index 000000000000..879f9b95d846
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/tebreak/default.nix
@@ -0,0 +1,49 @@
+{ lib, fetchFromGitHub, last, exonerate, minia, python3, bwa
+, samtools }:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "tebreak";
+  version = "1.1";
+
+  src = fetchFromGitHub {
+    owner = "adamewing";
+    repo = "tebreak";
+    rev = version;
+    sha256 = "13mgh775d8hkl340923lfwwm4r5ps70girn8d6wgfxzwzxylz8iz";
+  };
+
+  nativeBuildInputs = [ python3.pkgs.cython ];
+  propagatedBuildInputs = with python3.pkgs; [
+    pysam
+    scipy
+    bx-python
+    scikit-bio
+  ];
+
+  preConfigure = ''
+    # patch the paths to all required software
+    for f in $(find . -type f) ; do
+      sed -i "s|'bwa'|'${bwa}/bin/bwa'|" $f
+      sed -i "s|'minia'|'${minia}/bin/minia'|" $f
+      sed -i "s|'exonerate'|'${exonerate}/bin/exonerate'|" $f
+      sed -i "s|'samtools'|'${samtools}/bin/samtools'|" $f
+      sed -i "s|'lastal'|'${last}/bin/lastal'|" $f
+      sed -i "s|'lastdb'|'${last}/bin/lastdb'|" $f
+    done
+  '';
+
+  checkPhase = ''
+    $out/bin/tebreak -b test/data/example.ins.bam  -r test/data/Homo_sapiens_chr4_50000000-60000000_assembly19.fasta -p 4 --pickle test/example.pickle --detail_out test/example.tebreak.detail.out -i lib/teref.human.fa
+    pushd test
+    ${python3.interpreter} checktest.py
+  '';
+
+  meta = with lib; {
+    description = "Find and characterise transposable element insertions";
+    mainProgram = "tebreak";
+    homepage = "https://github.com/adamewing/tebreak";
+    license = licenses.mit;
+    maintainers = with maintainers; [ jbedo ];
+    platforms = platforms.x86_64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/treemix/default.nix b/nixpkgs/pkgs/applications/science/biology/treemix/default.nix
new file mode 100644
index 000000000000..7bf966919a67
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/treemix/default.nix
@@ -0,0 +1,27 @@
+{ lib
+, stdenv
+, fetchurl
+, zlib
+, gsl
+, boost
+}:
+
+stdenv.mkDerivation rec {
+  pname = "treemix";
+  version = "1.13";
+
+  src = fetchurl {
+    url = "https://bitbucket.org/nygcresearch/treemix/downloads/${pname}-${version}.tar.gz";
+    sha256 = "1nd3rzsdgk47r8b8k43mdfvaagln533sm08s1jr0dz8km8nlym7y";
+  };
+
+  buildInputs = [ zlib gsl boost ];
+
+  meta = with lib ; {
+    description = "Inference of patterns of population splitting and mixing from genome-wide allele frequency data";
+    homepage = "https://bitbucket.org/nygcresearch/treemix/wiki/Home";
+    license = licenses.gpl3Only;
+    maintainers = [ maintainers.bzizou ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/trf/default.nix b/nixpkgs/pkgs/applications/science/biology/trf/default.nix
new file mode 100644
index 000000000000..f36788eb612c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/trf/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "trf";
+  version = "4.09.1";
+
+  src = fetchFromGitHub {
+    owner = "Benson-Genomics-Lab";
+    repo = "trf";
+    rev = "v${version}";
+    sha256 = "sha256-73LypVqBdlRdDCblf9JNZQmS5Za8xpId4ha5GjTJHDo=";
+  };
+
+  meta = with lib; {
+    description = "Tandem Repeats Finder: a program to analyze DNA sequences";
+    homepage = "https://tandem.bu.edu/trf/trf.html";
+    license = licenses.agpl3Plus;
+    maintainers = with maintainers; [ natsukium ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/trimal/default.nix b/nixpkgs/pkgs/applications/science/biology/trimal/default.nix
new file mode 100644
index 000000000000..b27a63a2135a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/trimal/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "trimal";
+  version = "1.4.1";
+
+  src = fetchFromGitHub {
+    repo = pname;
+    owner = "scapella";
+    rev = "v${version}";
+    sha256 = "0isc7s3514di4z953xq53ncjkbi650sh4q9yyw5aag1n9hqnh7k0";
+  };
+
+  postUnpack = ''
+    sourceRoot=''${sourceRoot}/source
+    echo Source root reset to ''${sourceRoot}
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -a trimal readal statal $out/bin
+  '';
+
+  meta = with lib; {
+    description = "A tool for the automated removal of spurious sequences or poorly aligned regions from a multiple sequence alignment";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    homepage = "http://trimal.cgenomics.org";
+    maintainers = [ maintainers.bzizou ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/trimmomatic/default.nix b/nixpkgs/pkgs/applications/science/biology/trimmomatic/default.nix
new file mode 100644
index 000000000000..db19278eaa47
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/trimmomatic/default.nix
@@ -0,0 +1,74 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, ant
+, jdk
+, jre
+, makeWrapper
+, stripJavaArchivesHook
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "trimmomatic";
+  version = "0.39";
+
+  src = fetchFromGitHub {
+    owner = "usadellab";
+    repo = "Trimmomatic";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-u+ubmacwPy/vsEi0YQCv0fTnVDesQvqeQDEwCbS8M6I=";
+  };
+
+  # Remove jdk version requirement
+  postPatch = ''
+    substituteInPlace ./build.xml \
+      --replace 'source="1.5" target="1.5"' ""
+  '';
+
+  nativeBuildInputs = [
+    ant
+    jdk
+    makeWrapper
+    stripJavaArchivesHook
+  ];
+
+  buildPhase = ''
+    runHook preBuild
+
+    ant
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm644 dist/jar/trimmomatic-*.jar -t $out/share/trimmomatic
+    cp -r adapters $out/share/trimmomatic
+
+    makeWrapper ${jre}/bin/java $out/bin/trimmomatic \
+        --add-flags "-jar $out/share/trimmomatic/trimmomatic-*.jar"
+
+    runHook postInstall
+  '';
+
+  meta = {
+    changelog = "https://github.com/usadellab/Trimmomatic/blob/main/versionHistory.txt";
+    description = "A flexible read trimming tool for Illumina NGS data";
+    longDescription = ''
+      Trimmomatic performs a variety of useful trimming tasks for illumina
+      paired-end and single ended data: adapter trimming, quality trimming,
+      cropping to a specified length, length filtering, quality score
+      conversion.
+    '';
+    homepage = "http://www.usadellab.org/cms/?page=trimmomatic";
+    downloadPage = "https://github.com/usadellab/Trimmomatic/releases";
+    license = lib.licenses.gpl3Only;
+    sourceProvenance = [
+      lib.sourceTypes.fromSource
+      lib.sourceTypes.binaryBytecode # source bundles dependencies as jars
+    ];
+    mainProgram = "trimmomatic";
+    maintainers = [ lib.maintainers.kupac ];
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/biology/truvari/default.nix b/nixpkgs/pkgs/applications/science/biology/truvari/default.nix
new file mode 100644
index 000000000000..946f4be60632
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/truvari/default.nix
@@ -0,0 +1,86 @@
+{ lib
+, fetchFromGitHub
+, python3Packages
+, runtimeShell
+, bcftools
+, htslib
+}:
+
+let
+  ssshtest = fetchFromGitHub {
+    owner = "ryanlayer";
+    repo = "ssshtest";
+    rev = "d21f7f928a167fca6e2eb31616673444d15e6fd0";
+    hash = "sha256-zecZHEnfhDtT44VMbHLHOhRtNsIMWeaBASupVXtmrks=";
+  };
+in python3Packages.buildPythonApplication rec {
+  pname = "truvari";
+  version = "4.1.0";
+  pyproject = true;
+
+  src = fetchFromGitHub {
+    owner = "ACEnglish";
+    repo = "truvari";
+    rev = "v${version}";
+    hash = "sha256-HFVAv1TTL/nMjr62tQKhMdwh25P/y4nBGzSbxoJxMmo=";
+  };
+
+  postPatch = ''
+    substituteInPlace truvari/utils.py \
+      --replace "/bin/bash" "${runtimeShell}"
+    patchShebangs repo_utils/test_files
+  '';
+
+  nativeBuildInputs = [
+    python3Packages.setuptools
+  ];
+
+  propagatedBuildInputs = with python3Packages; [
+    pywfa
+    rich
+    edlib
+    pysam
+    intervaltree
+    joblib
+    numpy
+    pytabix
+    bwapy
+    pandas
+  ];
+
+  makeWrapperArgs = [
+    "--prefix" "PATH" ":" (lib.makeBinPath [ bcftools htslib ])
+  ];
+
+  pythonImportsCheck = [ "truvari" ];
+
+  nativeCheckInputs = [
+    bcftools
+    htslib
+  ] ++ (with python3Packages; [
+    coverage
+  ]);
+
+  checkPhase = ''
+    runHook preCheck
+
+    ln -s ${ssshtest}/ssshtest .
+    bash repo_utils/truvari_ssshtests.sh
+
+    runHook postCheck
+  '';
+
+  meta = with lib; {
+    description = "Structural variant comparison tool for VCFs";
+    homepage = "https://github.com/ACEnglish/truvari";
+    changelog = "https://github.com/ACEnglish/truvari/releases/tag/${src.rev}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ natsukium scalavision ];
+    longDescription = ''
+      Truvari is a benchmarking tool for comparison sets of SVs.
+      It can calculate the recall, precision, and f-measure of a
+      vcf from a given structural variant caller. The tool
+      is created by Spiral Genetics.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/varscan/default.nix b/nixpkgs/pkgs/applications/science/biology/varscan/default.nix
new file mode 100644
index 000000000000..bf6d16c3701d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/varscan/default.nix
@@ -0,0 +1,38 @@
+{lib, stdenv, fetchurl, jre, makeWrapper}:
+
+stdenv.mkDerivation rec {
+  pname = "varscan";
+  version = "2.4.6";
+
+  src = fetchurl {
+    url = "https://github.com/dkoboldt/varscan/raw/master/VarScan.v${version}.jar";
+    sha256 = "sha256-6CcjC0epbKsDXFxxeOUImSGh4cjR5INqawL/iOOkwqs=";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ jre ];
+
+  dontUnpack = true;
+
+  installPhase = ''
+    mkdir -p $out/libexec/varscan
+    cp $src $out/libexec/varscan/varscan.jar
+    mkdir -p $out/bin
+    makeWrapper ${jre}/bin/java $out/bin/varscan --add-flags "-jar $out/libexec/varscan/varscan.jar"
+  '';
+
+  meta = with lib; {
+    description = "Variant calling and somatic mutation/CNV detection for next-generation sequencing data";
+    # VarScan 2 is free for non-commercial use by academic,
+    # government, and non-profit/not-for-profit institutions. A
+    # commercial version of the software is available, and licensed
+    # through the Office of Technology Management at Washington
+    # University School of Medicine.
+    license = licenses.unfree;
+    homepage = "https://github.com/dkoboldt/varscan";
+    sourceProvenance = with sourceTypes; [ binaryBytecode ];
+    maintainers = with maintainers; [ jbedo ];
+    platforms = platforms.all;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/vcftools/default.nix b/nixpkgs/pkgs/applications/science/biology/vcftools/default.nix
new file mode 100644
index 000000000000..a4ec84d4d506
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/vcftools/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, zlib, autoreconfHook, pkg-config, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "vcftools";
+  version = "0.1.16";
+
+  src = fetchFromGitHub {
+    repo = pname;
+    owner = "vcftools";
+    rev = "v${version}";
+    sha256 = "0msb09d2cnm8rlpg8bsc1lhjddvp3kf3i9dsj1qs4qgsdlzhxkyx";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+  buildInputs = [ zlib perl ];
+
+  meta = with lib; {
+    description = "A set of tools written in Perl and C++ for working with VCF files, such as those generated by the 1000 Genomes Project";
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    homepage = "https://vcftools.github.io/index.html";
+    maintainers = [ maintainers.rybern ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/veryfasttree/default.nix b/nixpkgs/pkgs/applications/science/biology/veryfasttree/default.nix
new file mode 100644
index 000000000000..6c054fecd742
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/veryfasttree/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, llvmPackages
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "veryfasttree";
+  version = "4.0.3";
+
+  src = fetchFromGitHub {
+    owner = "citiususc";
+    repo = "veryfasttree";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-Sp331VJRaYv/BTwFj3HwUcUsWjYf6YEXWjYdOzDhBBA=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = lib.optional stdenv.cc.isClang llvmPackages.openmp;
+
+  installPhase = ''
+    runHook preInstall
+
+    install -m755 -D VeryFastTree $out/bin/VeryFastTree
+
+    runHook postInstall
+  '';
+
+  meta = {
+    description = "Speeding up the estimation of phylogenetic trees for large alignments through parallelization and vectorization strategies";
+    mainProgram = "VeryFastTree";
+    homepage = "https://github.com/citiususc/veryfasttree";
+    license = lib.licenses.gpl3Plus;
+    maintainers = with lib.maintainers; [ thyol ];
+    platforms = lib.platforms.all;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/biology/whisper/default.nix b/nixpkgs/pkgs/applications/science/biology/whisper/default.nix
new file mode 100644
index 000000000000..4cc211547610
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/whisper/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "whisper";
+  version = "2.0.1";
+
+  src = fetchFromGitHub {
+    owner = "refresh-bio";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0wpx1w1mar2d6zq2v14vy6nn896ds1n3zshxhhrrj5d528504iyw";
+  };
+
+  patches = [
+    # gcc-13 compatibility fixes:
+    #   https://github.com/refresh-bio/Whisper/pull/17
+    (fetchpatch {
+      name = "gcc-13.patch";
+      url = "https://github.com/refresh-bio/Whisper/commit/d67e110dd6899782e4687188f6b432494315b0b4.patch";
+      hash = "sha256-Z8GrkUMIKO/ccEdwulQh+WUox3CEckr6NgoBSzYvfuw=";
+    })
+  ];
+
+  preConfigure = ''
+    cd src
+
+    # disable default static linking
+    sed -i 's/ -static / /' makefile
+  '';
+
+  enableParallelBuilding = true;
+
+  installPhase = ''
+    runHook preInstall
+    install -Dt $out/bin whisper whisper-index
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    broken = stdenv.isDarwin;
+    description = "Short read sequence mapper";
+    license = licenses.gpl3;
+    homepage = "https://github.com/refresh-bio/whisper";
+    maintainers = with maintainers; [ jbedo ];
+    platforms = platforms.x86_64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/biology/xenomapper/default.nix b/nixpkgs/pkgs/applications/science/biology/xenomapper/default.nix
new file mode 100644
index 000000000000..194db966915e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/biology/xenomapper/default.nix
@@ -0,0 +1,23 @@
+{ python3, lib, fetchFromGitHub }:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "xenomapper";
+  version = "1.0.2";
+
+  src = fetchFromGitHub {
+    owner = "genomematt";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0mnmfzlq5mhih6z8dq5bkx95vb8whjycz9mdlqwbmlqjb3gb3zhr";
+  };
+
+  propagatedBuildInputs = with python3.pkgs; [ statistics ];
+
+  meta = with lib; {
+    homepage = "https://github.com/genomematt/xenomapper";
+    description = "A utility for post processing mapped reads that have been aligned to a primary genome and a secondary genome and binning reads into species specific, multimapping in each species, unmapped and unassigned bins";
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = [ maintainers.jbedo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/apbs/default.nix b/nixpkgs/pkgs/applications/science/chemistry/apbs/default.nix
new file mode 100644
index 000000000000..ec8f8e7ffbf6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/apbs/default.nix
@@ -0,0 +1,114 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, blas
+, superlu
+, suitesparse
+, python3
+, libintl
+, libiconv
+}:
+let
+  # this is a fork version of fetk (http://www.fetk.org/)
+  # which is maintained by apbs team
+  fetk = stdenv.mkDerivation (finalAttrs: {
+    pname = "fetk";
+    version = "1.9.3";
+
+    src = fetchFromGitHub {
+      owner = "Electrostatics";
+      repo = "fetk";
+      rev = "refs/tags/${finalAttrs.version}";
+      hash = "sha256-uFA1JRR05cNcUGaJj9IyGNONB2hU9IOBPzOj/HucNH4=";
+    };
+
+    nativeBuildInputs = [
+      cmake
+    ];
+
+    cmakeFlags = [
+      "-DBLAS_LIBRARIES=${blas}/lib"
+      "-DBLA_STATIC=OFF"
+      "-DBUILD_SUPERLU=OFF"
+    ];
+
+    env = lib.optionalAttrs stdenv.cc.isClang {
+      NIX_CFLAGS_COMPILE = "-Wno-error=implicit-int";
+    };
+
+    buildInputs = [
+      blas
+      superlu
+      suitesparse
+    ];
+
+    meta = with lib; {
+      description = "Fork of the Finite Element ToolKit from fetk.org";
+      homepage = "https://github.com/Electrostatics/FETK";
+      changelog = "https://github.com/Electrostatics/FETK/releases/tag/${finalAttrs.version}";
+      license = licenses.lgpl21Plus;
+      maintainers = with maintainers; [ natsukium ];
+      platforms = platforms.unix;
+    };
+  });
+in
+stdenv.mkDerivation (finalAttrs: {
+  pname = "apbs";
+  version = "3.4.1";
+
+  src = fetchFromGitHub {
+    owner = "Electrostatics";
+    repo = "apbs";
+    rev = "refs/tags/v${finalAttrs.version}";
+    hash = "sha256-2DnHU9hMDl4OJBaTtcRiB+6R7gAeFcuOUy7aI63A3gQ=";
+  };
+
+  postPatch = ''
+    # ImportFETK.cmake downloads source and builds fetk
+    substituteInPlace CMakeLists.txt \
+      --replace "include(ImportFETK)" "" \
+      --replace 'import_fetk(''${FETK_VERSION})' ""
+
+    # U was removed in python 3.11 because it had no effect
+    substituteInPlace tools/manip/inputgen.py \
+      --replace '"rU"' '"r"'
+  '';
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = [
+    fetk
+    suitesparse
+    blas
+    python3
+  ] ++ lib.optionals stdenv.isDarwin [
+    libintl
+    libiconv
+  ];
+
+  cmakeFlags = [
+    "-DPYTHON_VERSION=${python3.version}"
+    "-DAPBS_LIBS=mc;maloc"
+    "-DCMAKE_MODULE_PATH=${fetk}/share/fetk/cmake;"
+    "-DENABLE_TESTS=1"
+  ];
+
+  env = lib.optionalAttrs stdenv.cc.isClang {
+    NIX_CFLAGS_COMPILE = "-Wno-error=incompatible-function-pointer-types";
+  };
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Software for biomolecular electrostatics and solvation calculations";
+    mainProgram = "apbs";
+    homepage = "https://www.poissonboltzmann.org/";
+    changelog = "https://github.com/Electrostatics/apbs/releases/tag/v${finalAttrs.version}";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ natsukium ];
+    platforms = platforms.unix;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/chemistry/autodock-vina/default.nix b/nixpkgs/pkgs/applications/science/chemistry/autodock-vina/default.nix
new file mode 100644
index 000000000000..d56b8a02a20d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/autodock-vina/default.nix
@@ -0,0 +1,57 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, boost
+, glibc
+}:
+let
+  boost' = boost.override {
+    enableShared = false;
+  };
+in
+stdenv.mkDerivation (finalAttrs: {
+  pname = "autodock-vina";
+  version = "1.2.5";
+
+  src = fetchFromGitHub {
+    owner = "ccsb-scripps";
+    repo = "autodock-vina";
+    rev = "refs/tags/v${finalAttrs.version}";
+    hash = "sha256-yguUMEX0tn75wKrPKyqlCYbBFaEwC5b1s3k9xept1Fw=";
+  };
+
+  sourceRoot = "${finalAttrs.src.name}/build/${
+    if stdenv.hostPlatform.isDarwin then "mac"
+    else "linux"
+  }/release";
+
+  buildInputs = [
+    boost'
+  ] ++ lib.optionals stdenv.isLinux [
+    glibc.static
+  ];
+
+  makeFlags = [
+    "GPP=${stdenv.cc.targetPrefix}c++"
+    "BASE=${boost'}"
+    "BOOST_INCLUDE=${lib.getDev boost'}/include"
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm755 vina vina_split -t $out/bin/
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "One of the fastest and most widely used open-source docking engines";
+    homepage = "https://vina.scripps.edu/";
+    changelog = "https://github.com/ccsb-scripps/AutoDock-Vina/releases/tag/v${finalAttrs.version}";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ natsukium ];
+    platforms = platforms.unix;
+    mainProgram = "vina";
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/chemistry/autodock-vina/python-bindings.nix b/nixpkgs/pkgs/applications/science/chemistry/autodock-vina/python-bindings.nix
new file mode 100644
index 000000000000..fb7fd1ece0e6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/autodock-vina/python-bindings.nix
@@ -0,0 +1,56 @@
+{ lib
+, buildPythonPackage
+, autodock-vina
+, boost
+, swig
+, setuptools
+, numpy
+}:
+
+buildPythonPackage {
+  inherit (autodock-vina) pname version src meta;
+
+  format = "pyproject";
+
+  sourceRoot = "${autodock-vina.src.name}/build/python";
+
+  postPatch = ''
+    # wildcards are not allowed
+    # https://github.com/ccsb-scripps/AutoDock-Vina/issues/176
+    substituteInPlace setup.py \
+      --replace "python_requires='>=3.5.*'" "python_requires='>=3.5'"
+
+    # setupPyBuildFlags are not applied with `format = "pyproject"`
+    substituteInPlace setup.py \
+      --replace "= locate_boost()" "= '${lib.getDev boost}/include', '${boost}/lib'"
+
+    # this line attempts to delete the source code
+    substituteInPlace setup.py \
+      --replace "shutil.rmtree('src')" "..."
+
+    # np.int is deprecated
+    # https://github.com/ccsb-scripps/AutoDock-Vina/pull/167 and so on
+    substituteInPlace vina/vina.py \
+      --replace "np.int" "int"
+  '';
+
+  nativeBuildInputs = [
+    setuptools
+    swig
+  ];
+
+  buildInputs = [
+    boost
+  ];
+
+  propagatedBuildInputs = [
+    numpy
+  ];
+
+  # upstrem has no tests
+  doCheck = false;
+
+  pythonImportsCheck = [
+    "vina"
+  ];
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/avogadro2/default.nix b/nixpkgs/pkgs/applications/science/chemistry/avogadro2/default.nix
new file mode 100644
index 000000000000..7ee42c1a793c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/avogadro2/default.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchFromGitHub, cmake, eigen, avogadrolibs, molequeue, hdf5
+, openbabel, qttools, wrapQtAppsHook
+}:
+
+let
+  avogadroI18N = fetchFromGitHub {
+    owner = "OpenChemistry";
+    repo = "avogadro-i18n";
+    rev = "7eef0b83ded6221a3ddb85c0118cc26f9a35375c";
+    hash = "sha256-AR/y70zeYR9xBzWDB5JXjJdDM+NLOX6yxCQte2lYN/U=";
+  };
+
+in stdenv.mkDerivation rec {
+  pname = "avogadro2";
+  version = "1.99.0";
+
+  src = fetchFromGitHub {
+    owner = "OpenChemistry";
+    repo = "avogadroapp";
+    rev = version;
+    hash = "sha256-m8kX4WzOmPE/BZQRePOoUAdMPdWb6pmcqtPvDdEIIao=";
+  };
+
+  postUnpack = ''
+    cp -r ${avogadroI18N} avogadro-i18n
+  '';
+
+  nativeBuildInputs = [ cmake wrapQtAppsHook ];
+
+  buildInputs = [
+    avogadrolibs
+    molequeue
+    eigen
+    hdf5
+    qttools
+  ];
+
+  propagatedBuildInputs = [ openbabel ];
+
+  qtWrapperArgs = [ "--prefix PATH : ${lib.getBin openbabel}/bin" ];
+
+  meta = with lib; {
+    description = "Molecule editor and visualizer";
+    mainProgram = "avogadro2";
+    maintainers = with maintainers; [ sheepforce ];
+    homepage = "https://github.com/OpenChemistry/avogadroapp";
+    platforms = platforms.mesaPlatforms;
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/chemtool/default.nix b/nixpkgs/pkgs/applications/science/chemistry/chemtool/default.nix
new file mode 100644
index 000000000000..fe2d658b5a44
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/chemtool/default.nix
@@ -0,0 +1,57 @@
+{ lib
+, stdenv
+, fetchurl
+, pkg-config
+, libX11
+, gtk2
+, fig2dev
+, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "chemtool";
+  version = "1.6.14";
+
+  src = fetchurl {
+    url = "http://ruby.chemie.uni-freiburg.de/~martin/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "hhYaBGE4azNKX/sXzfCUpJGUGIRngnL0V0mBNRTdr8s=";
+  };
+
+  nativeBuildInputs = [ pkg-config wrapGAppsHook ];
+  buildInputs = [
+    libX11
+    gtk2
+    fig2dev
+  ];
+
+  # Workaround build on -fno-common toolchains like upstream gcc-10.
+  # Otherwise built fails as:
+  #   ld: inout.o:/build/chemtool-1.6.14/ct1.h:279: multiple definition of
+  #     `outtype'; draw.o:/build/chemtool-1.6.14/ct1.h:279: first defined here
+  env.NIX_CFLAGS_COMPILE = "-fcommon";
+
+  preFixup = ''
+    gappsWrapperArgs+=(--prefix PATH : "${lib.makeBinPath [ fig2dev ]}")
+  '';
+
+  meta = with lib; {
+    homepage = "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/";
+    description = "Draw chemical structures";
+    longDescription = ''
+      Chemtool is a program for drawing organic molecules. It runs under the X
+      Window System using the GTK widget set.
+
+      Most operations in chemtool can be accomplished using the mouse - the
+      first (usually the left) button is used to select or place things, the
+      middle button modifies properties (e.g. reverses the direction of a bond),
+      and the right button is used to delete objects.
+
+      The program offers essentially unlimited undo/redo, two text fonts plus
+      symbols, seven colors, drawing at several zoom scales, and square and
+      hexagonal backdrop grids for easier alignment.
+    '';
+    license = licenses.mit;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/cp2k/default.nix b/nixpkgs/pkgs/applications/science/chemistry/cp2k/default.nix
new file mode 100644
index 000000000000..42bfc6ffe32e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/cp2k/default.nix
@@ -0,0 +1,222 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, mpiCheckPhaseHook
+, python3
+, gfortran
+, blas
+, lapack
+, fftw
+, libint
+, libvori
+, libxc
+, mpi
+, gsl
+, scalapack
+, openssh
+, makeWrapper
+, libxsmm
+, spglib
+, which
+, pkg-config
+, plumed
+, zlib
+, hdf5-fortran
+, sirius
+, libvdwxc
+, spla
+, spfft
+, enableElpa ? false
+, elpa
+, cudaPackages
+, rocmPackages
+, config
+, gpuBackend ? (
+  if config.cudaSupport
+  then "cuda"
+  else if config.rocmSupport
+  then "rocm"
+  else "none"
+)
+# Change to a value suitable for your target GPU.
+# For AMD values see https://github.com/cp2k/cp2k/blob/master/INSTALL.md#2v-rocmhip-support-for-amd-gpu
+# and for Nvidia see https://github.com/cp2k/cp2k/blob/master/INSTALL.md#2i-cuda-optional-improved-performance-on-gpu-systems
+, gpuVersion ? ( if gpuBackend == "cuda" then "A100" else "Mi100" )
+, gpuArch ? ( if gpuBackend == "cuda" then "sm_80" else "gfx908" )
+}:
+
+assert builtins.elem gpuBackend [ "none" "cuda" "rocm" ];
+
+let
+  cp2kVersion = "psmp";
+  arch = "Linux-x86-64-gfortran";
+
+in
+stdenv.mkDerivation rec {
+  pname = "cp2k";
+  version = "2024.1";
+
+  src = fetchFromGitHub {
+    owner = "cp2k";
+    repo = "cp2k";
+    rev = "v${version}";
+    hash = "sha256-6PB6wjdTOa55dXV7QIsjxI77hhc95WFEjNePfupBUJQ=";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ python3 which openssh makeWrapper pkg-config ]
+    ++ lib.optional (gpuBackend == "cuda") cudaPackages.cuda_nvcc;
+
+  buildInputs = [
+    gfortran
+    fftw
+    gsl
+    libint
+    libvori
+    libxc
+    libxsmm
+    spglib
+    scalapack
+    blas
+    lapack
+    plumed
+    zlib
+    hdf5-fortran
+    sirius
+    spla
+    spfft
+    libvdwxc
+  ]
+  ++ lib.optional enableElpa elpa
+  ++ lib.optionals (gpuBackend == "cuda") [
+    cudaPackages.cuda_cudart
+    cudaPackages.libcublas
+    cudaPackages.cuda_nvrtc
+  ] ++ lib.optionals (gpuBackend == "rocm") [
+    rocmPackages.clr
+    rocmPackages.rocm-core
+    rocmPackages.hipblas
+    rocmPackages.hipfft
+    rocmPackages.rocblas
+  ]
+  ;
+
+  propagatedBuildInputs = [ mpi ];
+  propagatedUserEnvPkgs = [ mpi ];
+
+  makeFlags = [
+    "ARCH=${arch}"
+    "VERSION=${cp2kVersion}"
+  ];
+
+  doCheck = gpuBackend == "none";
+
+  enableParallelBuilding = true;
+
+  postPatch = ''
+    patchShebangs tools exts/dbcsr/tools/build_utils exts/dbcsr/.cp2k
+    substituteInPlace exts/build_dbcsr/Makefile \
+      --replace '/usr/bin/env python3' '${python3}/bin/python' \
+      --replace 'SHELL = /bin/sh' 'SHELL = bash'
+  '';
+
+  configurePhase = ''
+    cat > arch/${arch}.${cp2kVersion} << EOF
+    CC         = mpicc
+    CPP        =
+    FC         = mpif90
+    LD         = mpif90
+    AR         = ar -r
+    ${lib.strings.optionalString (gpuBackend == "cuda") ''
+    OFFLOAD_CC = nvcc
+    OFFLOAD_FLAGS = -O3 -g -w --std=c++11 -arch ${gpuArch}
+    OFFLOAD_TARGET = cuda
+    GPUVER = ${gpuVersion}
+    CXX = mpicxx
+    CXXFLAGS = -std=c++11 -fopenmp
+    ''}
+    ${lib.strings.optionalString (gpuBackend == "rocm") ''
+    GPUVER = ${gpuVersion}
+    OFFLOAD_CC = hipcc
+    OFFLOAD_FLAGS = -fopenmp -m64 -pthread -fPIC -D__GRID_HIP -O2 --offload-arch=${gpuArch} --rocm-path=${rocmPackages.rocm-core}
+    OFFLOAD_TARGET = hip
+    CXX = mpicxx
+    CXXFLAGS = -std=c++11 -fopenmp -D__HIP_PLATFORM_AMD__
+    ''}
+    DFLAGS     = -D__FFTW3 -D__LIBXC -D__LIBINT -D__parallel -D__SCALAPACK \
+                 -D__MPI_VERSION=3 -D__F2008 -D__LIBXSMM -D__SPGLIB \
+                 -D__MAX_CONTR=4 -D__LIBVORI ${lib.optionalString enableElpa "-D__ELPA"} \
+                 -D__PLUMED2 -D__HDF5 -D__GSL -D__SIRIUS -D__LIBVDWXC -D__SPFFT -D__SPLA \
+                 ${lib.strings.optionalString (gpuBackend == "cuda") "-D__OFFLOAD_CUDA -D__ACC -D__DBCSR_ACC -D__NO_OFFLOAD_PW"} \
+                 ${lib.strings.optionalString (gpuBackend == "rocm") "-D__OFFLOAD_HIP -D__DBCSR_ACC -D__NO_OFFLOAD_PW"}
+    CFLAGS    = -fopenmp -I${lib.getDev hdf5-fortran}/include -I${lib.getDev gsl}/include
+    FCFLAGS    = \$(DFLAGS) -O2 -ffree-form -ffree-line-length-none \
+                 -ftree-vectorize -funroll-loops -msse2 \
+                 -std=f2008 \
+                 -fopenmp -ftree-vectorize -funroll-loops \
+                 -I${lib.getDev libint}/include ${lib.optionalString enableElpa "$(pkg-config --variable=fcflags elpa)"} \
+                 -I${lib.getDev sirius}/include/sirius \
+                 -I${lib.getDev libxc}/include -I${lib.getDev libxsmm}/include \
+                 -I${lib.getDev hdf5-fortran}/include \
+                 -fallow-argument-mismatch
+    LIBS       = -lfftw3 -lfftw3_threads \
+                 -lscalapack -lblas -llapack \
+                 -lxcf03 -lxc -lxsmmf -lxsmm -lsymspg \
+                 -lint2 -lstdc++ -lvori \
+                 -lgomp -lpthread -lm \
+                 -fopenmp ${lib.optionalString enableElpa "$(pkg-config --libs elpa)"} \
+                 -lz -ldl ${lib.optionalString (mpi.pname == "openmpi") "$(mpicxx --showme:link)"} \
+                 -lplumed -lhdf5_fortran -lhdf5_hl -lhdf5 -lgsl -lsirius -lspla -lspfft -lvdwxc \
+                 ${lib.strings.optionalString (gpuBackend == "cuda") ''
+                   -L${cudaPackages.cuda_cudart}/lib/stubs/ \
+                   -lcudart -lnvrtc -lcuda -lcublas
+                   ''
+                 } \
+                 ${lib.strings.optionalString (gpuBackend == "rocm") "-lamdhip64 -lhipfft -lhipblas -lrocblas"}
+    LDFLAGS    = \$(FCFLAGS) \$(LIBS)
+    include ${plumed}/lib/plumed/src/lib/Plumed.inc
+    EOF
+  '';
+
+  nativeCheckInputs = [
+    mpiCheckPhaseHook
+    openssh
+  ];
+
+  checkPhase = ''
+    runHook preCheck
+
+    export CP2K_DATA_DIR=data
+    mpirun -np 2 exe/${arch}/libcp2k_unittest.${cp2kVersion}
+
+    runHook postCheck
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/cp2k
+
+    cp exe/${arch}/* $out/bin
+    rm $out/bin/*_unittest.*
+
+    for i in cp2k cp2k_shell graph; do
+      wrapProgram $out/bin/$i.${cp2kVersion} \
+        --set-default CP2K_DATA_DIR $out/share/cp2k
+    done
+
+    wrapProgram $out/bin/cp2k.popt \
+      --set-default CP2K_DATA_DIR $out/share/cp2k \
+      --set OMP_NUM_THREADS 1
+
+    cp -r data/* $out/share/cp2k
+  '';
+
+  passthru = { inherit mpi; };
+
+  meta = with lib; {
+    description = "Quantum chemistry and solid state physics program";
+    homepage = "https://www.cp2k.org";
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.sheepforce ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/d-seams/default.nix b/nixpkgs/pkgs/applications/science/chemistry/d-seams/default.nix
new file mode 100644
index 000000000000..5b5d8cfbd9d4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/d-seams/default.nix
@@ -0,0 +1,41 @@
+{ clangStdenv, fetchFromGitHub, fetchpatch, catch2, rang, fmt, yaml-cpp, cmake
+, eigen, lua, luaPackages, liblapack, blas, lib, boost, gsl }:
+
+clangStdenv.mkDerivation rec {
+  version = "1.0.1";
+  pname = "d-SEAMS";
+
+  src = fetchFromGitHub {
+    owner = "d-SEAMS";
+    repo = "seams-core";
+    rev = "v${version}";
+    sha256 = "03zhhl9vhi3rhc3qz1g3zb89jksgpdlrk15fcr8xcz8pkj6r5b1i";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "use_newer_cxxopts_which_builds_with_clang11.patch";
+      url = "https://github.com/d-SEAMS/seams-core/commit/f6156057e43d0aa1a0df9de67d8859da9c30302d.patch";
+      hash = "sha256-PLbT1lqdw+69lIHH96MPcGRjfIeZyb88vc875QLYyqw=";
+    })
+  ];
+  nativeBuildInputs = [ cmake lua luaPackages.luafilesystem ];
+  buildInputs = [ fmt rang yaml-cpp eigen catch2 boost gsl liblapack blas ];
+
+  meta = with lib; {
+    description =
+      "d-SEAMS: Deferred Structural Elucidation Analysis for Molecular Simulations";
+    mainProgram = "yodaStruct";
+    longDescription = ''
+      d-SEAMS, is a free and open-source postprocessing engine for the analysis
+      of molecular dynamics trajectories, which is specifically able to
+      qualitatively classify ice structures in both strong-confinement and bulk
+      systems. The engine is in C++, with extensions via the Lua scripting
+      interface.
+    '';
+    homepage = "https://dseams.info";
+    license = licenses.gpl3Plus;
+    platforms = [ "x86_64-linux" ];
+    maintainers = [ maintainers.HaoZeke ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/dkh/default.nix b/nixpkgs/pkgs/applications/science/chemistry/dkh/default.nix
new file mode 100644
index 000000000000..a0bed24336a9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/dkh/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, gfortran, fetchFromGitHub, cmake } :
+
+stdenv.mkDerivation rec {
+  pname = "dkh";
+  version = "1.2";
+
+  src = fetchFromGitHub  {
+    owner = "psi4";
+    repo = pname;
+    rev = "v${version}";
+    sha256= "1wb4qmb9f8rnrwnnw1gdhzx1fmhy628bxfrg56khxy3j5ljxkhck";
+  };
+
+  nativeBuildInputs = [
+    gfortran
+    cmake
+  ];
+
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
+
+  hardeningDisable = [
+    "format"
+  ];
+
+  meta = with lib; {
+    description = "Arbitrary-order scalar-relativistic Douglas-Kroll-Hess module";
+    license = licenses.lgpl3Only;
+    homepage = "https://github.com/psi4/dkh";
+    platforms = platforms.unix;
+    maintainers = [ maintainers.sheepforce ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/element/default.nix b/nixpkgs/pkgs/applications/science/chemistry/element/default.nix
new file mode 100644
index 000000000000..c3c4a0fe582e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/element/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "element";
+  version = "1.0.1";
+
+  src = fetchFromGitHub {
+    owner = "gennaro-tedesco";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-06RDZnie0Lv7i95AwnBGl6PPucuj8pIT6DHW3e3mu1o=";
+  };
+
+  vendorHash = "sha256-A4g2rQTaYrA4/0rqldUv7iuibzNINEvx9StUnaN2/Yg=";
+
+  meta = with lib; {
+    description = "The periodic table on the command line";
+    mainProgram = "element";
+    homepage = "https://github.com/gennaro-tedesco/element";
+    license = licenses.asl20;
+    maintainers = [ maintainers.j0hax ];
+    broken = stdenv.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/ergoscf/default.nix b/nixpkgs/pkgs/applications/science/chemistry/ergoscf/default.nix
new file mode 100644
index 000000000000..3ee33cf19b74
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/ergoscf/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchurl, blas, lapack } :
+
+stdenv.mkDerivation rec {
+  pname = "ergoscf";
+  version = "3.8.2";
+
+  src = fetchurl {
+    url = "http://www.ergoscf.org/source/tarfiles/ergo-${version}.tar.gz";
+    sha256 = "sha256-U0NVREEZ8HI0Q0ZcbwvZsYA76PWMh7bqgDG1uaUc01c=";
+  };
+
+  buildInputs = [ blas lapack ];
+
+  patches = [ ./math-constants.patch ];
+
+  postPatch = ''
+    patchShebangs ./test
+  '';
+
+  configureFlags = [
+    "--enable-linalgebra-templates"
+    "--enable-performance"
+  ] ++ lib.optional stdenv.isx86_64 "--enable-sse-intrinsics";
+
+  LDFLAGS = "-lblas -llapack";
+
+  enableParallelBuilding = true;
+
+  OMP_NUM_THREADS = 2; # required for check phase
+
+  # With "fortify3", there are test failures, such as:
+  # Testing cnof CAMB3LYP/6-31G using FMM
+  # *** buffer overflow detected ***: terminated
+  # ./test_fmm_camb3lyp.sh: line 81: 1061289 Aborted                 (core dumped) ./ergo <<EOINPUT > /dev/null
+  hardeningDisable = [ "fortify3" ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Quantum chemistry program for large-scale self-consistent field calculations";
+    mainProgram = "ergo";
+    homepage = "http://www.ergoscf.org";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.markuskowa ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/ergoscf/math-constants.patch b/nixpkgs/pkgs/applications/science/chemistry/ergoscf/math-constants.patch
new file mode 100644
index 000000000000..62209f1a3d84
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/ergoscf/math-constants.patch
@@ -0,0 +1,19 @@
+diff --git a/source/dft/functionals.h b/source/dft/functionals.h
+index fde49ba..f7a61fc 100644
+--- a/source/dft/functionals.h
++++ b/source/dft/functionals.h
+@@ -59,6 +59,14 @@
+ #define EXTERN_C
+ #endif
+ 
++#ifndef M_PI
++#define M_PI 3.14159265358979323846
++#endif
++
++#ifndef M_SQRT2
++#define M_SQRT2        1.41421356237309504880
++#endif
++
+ typedef ergo_real real;
+ 
+ #if defined(FUNC_PRECISION) && FUNC_PRECISION == 1
diff --git a/nixpkgs/pkgs/applications/science/chemistry/gwyddion/codegen.patch b/nixpkgs/pkgs/applications/science/chemistry/gwyddion/codegen.patch
new file mode 100644
index 000000000000..eb306d99f8a3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/gwyddion/codegen.patch
@@ -0,0 +1,22 @@
+--- gwyddion-2.55.orig/configure	2019-11-04 01:25:31.000000000 -0800
++++ gwyddion-2.55/configure	2020-03-20 18:49:43.860452655 -0700
+@@ -18560,7 +18560,7 @@
+ fi
+   if test "x$embed_pygtk" = xno; then
+     if test "x$PYGTK_CODEGENDIR" = 'x'; then
+-      PYGTK_CODEGENDIR=`$PKG_CONFIG --variable=codegendir pygtk-2.0`
++      PYGTK_CODEGENDIR=`$PKG_CONFIG --variable=codegendir pygobject-2.0`
+     fi
+   else
+     # Some silly OSes want to remove pygtk2.  We can build pygwy without
+--- gwyddion-2.55.orig/configure.ac	2019-11-04 01:25:16.000000000 -0800
++++ gwyddion-2.55/configure.ac	2020-03-20 18:52:55.042724547 -0700
+@@ -270,7 +270,7 @@
+                     [embed_pygtk=yes; pygwy_warn=" (embedded pygtk2)"])
+   if test "x$embed_pygtk" = xno; then
+     if test "x$PYGTK_CODEGENDIR" = 'x'; then
+-      PYGTK_CODEGENDIR=`$PKG_CONFIG --variable=codegendir pygtk-2.0`
++      PYGTK_CODEGENDIR=`$PKG_CONFIG --variable=codegendir pygobject-2.0`
+     fi
+   else
+     # Some silly OSes want to remove pygtk2.  We can build pygwy without
diff --git a/nixpkgs/pkgs/applications/science/chemistry/gwyddion/default.nix b/nixpkgs/pkgs/applications/science/chemistry/gwyddion/default.nix
new file mode 100644
index 000000000000..7c1312f27f25
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/gwyddion/default.nix
@@ -0,0 +1,74 @@
+{ lib, stdenv, fetchurl, gtk2, pkg-config, fftw, file,
+  pythonSupport ? false, python2Packages,
+  gnome2,
+  openexrSupport ? true, openexr,
+  libzipSupport ? true, libzip,
+  libxml2Support ? true, libxml2,
+  libwebpSupport ? true, libwebp,
+  # libXmu is not used if libunique is.
+  libXmuSupport ? false, xorg,
+  libxsltSupport ? true, libxslt,
+  fitsSupport ? true, cfitsio,
+  zlibSupport ? true, zlib,
+  libuniqueSupport ? true, libunique,
+  libpngSupport ? true, libpng,
+  openglSupport ? !stdenv.isDarwin, libGL
+}:
+
+let
+    inherit (python2Packages) pygtk pygobject2 python;
+in
+
+stdenv.mkDerivation rec {
+  pname = "gwyddion";
+   version = "2.65";
+  src = fetchurl {
+    url = "mirror://sourceforge/gwyddion/gwyddion-${version}.tar.xz";
+    sha256 = "sha256-kRX7CoPJY8YkYNode5g0OCyWmL+5sM8puCmk9ZE2nqM=";
+  };
+
+  nativeBuildInputs = [ pkg-config file ];
+
+  buildInputs = with lib;
+    [ gtk2 fftw ] ++
+    optionals openglSupport [ gnome2.gtkglext libGL ] ++
+    optional openexrSupport openexr ++
+    optional libXmuSupport xorg.libXmu ++
+    optional fitsSupport cfitsio ++
+    optional libpngSupport libpng ++
+    optional libxsltSupport libxslt ++
+    optional libxml2Support libxml2 ++
+    optional libwebpSupport libwebp ++
+    optional zlibSupport zlib ++
+    optional libuniqueSupport libunique ++
+    optional libzipSupport libzip;
+
+  propagatedBuildInputs = with lib;
+    optionals pythonSupport [ pygtk pygobject2 python gnome2.gtksourceview ];
+
+  # This patch corrects problems with python support, but should apply cleanly
+  # regardless of whether python support is enabled, and have no effects if
+  # it is disabled.
+  patches = [ ./codegen.patch ];
+  meta = {
+    homepage = "http://gwyddion.net/";
+
+    description = "Scanning probe microscopy data visualization and analysis";
+
+    longDescription = ''
+      A modular program for SPM (scanning probe microscopy) data
+      visualization and analysis. Primarily it is intended for the
+      analysis of height fields obtained by scanning probe microscopy
+      techniques (AFM, MFM, STM, SNOM/NSOM) and it supports a lot of
+      SPM data formats. However, it can be used for general height
+      field and (greyscale) image processing, for instance for the
+      analysis of profilometry data or thickness maps from imaging
+      spectrophotometry.
+    '';
+    license = lib.licenses.gpl2;
+    platforms = with lib.platforms; linux ++ darwin;
+    maintainers = [ lib.maintainers.cge ];
+    # never built on aarch64-darwin since first introduction in nixpkgs
+    broken = stdenv.isDarwin && stdenv.isAarch64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/jmol/default.nix b/nixpkgs/pkgs/applications/science/chemistry/jmol/default.nix
new file mode 100644
index 000000000000..ee3ab5f1f3a5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/jmol/default.nix
@@ -0,0 +1,63 @@
+{ stdenv
+, lib
+, fetchurl
+, unzip
+, makeDesktopItem
+, jre
+}:
+
+let
+  desktopItem = makeDesktopItem {
+    name = "jmol";
+    exec = "jmol";
+    desktopName = "JMol";
+    genericName = "Molecular Modeler";
+    mimeTypes = [
+      "chemical/x-pdb"
+      "chemical/x-mdl-molfile"
+      "chemical/x-mol2"
+      "chemical/seq-aa-fasta"
+      "chemical/seq-na-fasta"
+      "chemical/x-xyz"
+      "chemical/x-mdl-sdf"
+    ];
+    categories = [ "Graphics" "Education" "Science" "Chemistry" ];
+  };
+in
+stdenv.mkDerivation rec {
+  version = "16.1.63";
+  pname = "jmol";
+
+  src = let
+    baseVersion = "${lib.versions.major version}.${lib.versions.minor version}";
+  in fetchurl {
+    url = "mirror://sourceforge/jmol/Jmol/Version%20${baseVersion}/Jmol%20${version}/Jmol-${version}-binary.tar.gz";
+    hash = "sha256-zUX3msosz0LNQJuEUbFgT32Hw0Wq4CgW1iHMkvReysU=";
+  };
+
+  patchPhase = ''
+    sed -i -e "4s:.*:command=${jre}/bin/java:" -e "10s:.*:jarpath=$out/share/jmol/Jmol.jar:" -e "11,21d" jmol
+  '';
+
+  installPhase = ''
+    mkdir -p "$out/share/jmol" "$out/bin"
+
+    ${unzip}/bin/unzip jsmol.zip -d "$out/share/"
+
+    cp *.jar jmol.sh "$out/share/jmol"
+    cp -r ${desktopItem}/share/applications $out/share
+    cp jmol $out/bin
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+     description = "A Java 3D viewer for chemical structures";
+     mainProgram = "jmol";
+     homepage = "https://sourceforge.net/projects/jmol";
+     sourceProvenance = with sourceTypes; [ binaryBytecode ];
+     license = licenses.lgpl2;
+     platforms = platforms.all;
+     maintainers = with maintainers; [ mounium ] ++ teams.sage.members;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/marvin/LicenseManager.desktop b/nixpkgs/pkgs/applications/science/chemistry/marvin/LicenseManager.desktop
new file mode 100755
index 000000000000..90b8ed7d20a5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/marvin/LicenseManager.desktop
@@ -0,0 +1,9 @@
+#!/usr/bin/env xdg-open
+[Desktop Entry]
+Type=Application
+Name=ChemAxon License Manager
+Exec=@out@/bin/LicenseManager
+Icon=LicenseManager
+Categories=Education;Science;Chemistry;
+StartupWMClass=com-install4j-runtime-launcher-UnixLauncher
+Comment=License manager for ChemAxon software like MarvinSketch
diff --git a/nixpkgs/pkgs/applications/science/chemistry/marvin/MarvinSketch.desktop b/nixpkgs/pkgs/applications/science/chemistry/marvin/MarvinSketch.desktop
new file mode 100755
index 000000000000..d6e0343a78c3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/marvin/MarvinSketch.desktop
@@ -0,0 +1,10 @@
+#!/usr/bin/env xdg-open
+[Desktop Entry]
+Type=Application
+Name=MarvinSketch
+Exec=@out@/bin/msketch %f
+Icon=MarvinSketch
+MimeType=text/xml;text/plain;chemical/x-cml;chemical/x-mdl-molfile;chemical/x-mdl-sdfile;chemical/x-mol2;chemical/x-pdb;chemical/x-xyz;chemical/x-mdl-rdfile;chemical/x-mdl-rxnfile;chemical/x-inchi;
+Categories=Education;Science;Chemistry;
+StartupWMClass=com-install4j-runtime-launcher-UnixLauncher
+Comment=Molecular modelling, analysis and structure drawing program
diff --git a/nixpkgs/pkgs/applications/science/chemistry/marvin/MarvinView.desktop b/nixpkgs/pkgs/applications/science/chemistry/marvin/MarvinView.desktop
new file mode 100755
index 000000000000..07a3c3c7cf33
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/marvin/MarvinView.desktop
@@ -0,0 +1,10 @@
+#!/usr/bin/env xdg-open
+[Desktop Entry]
+Type=Application
+Name=MarvinView
+Exec=@out@/bin/mview %f
+Icon=MarvinView
+Comment=Molecule viewing program
+MimeType=text/xml;text/plain;chemical/x-cml;chemical/x-mdl-molfile;chemical/x-mdl-sdfile;chemical/x-mol2;chemical/x-pdb;chemical/x-xyz;chemical/x-mdl-rdfile;chemical/x-mdl-rxnfile;chemical/x-inchi;
+Categories=Education;Science;Chemistry;
+StartupWMClass=com-install4j-runtime-launcher-UnixLauncher
diff --git a/nixpkgs/pkgs/applications/science/chemistry/marvin/default.nix b/nixpkgs/pkgs/applications/science/chemistry/marvin/default.nix
new file mode 100644
index 000000000000..090c252bb82c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/marvin/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchurl, dpkg, makeWrapper, coreutils, gawk, gnugrep, gnused, openjdk17 }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "marvin";
+  version = "23.17.0";
+
+  src = fetchurl {
+    name = "marvin-${version}.deb";
+    url = "http://dl.chemaxon.com/marvin/${version}/marvin_linux_${versions.majorMinor version}.deb";
+    hash = "sha256-zE/9EaOsNJwzE4Doasm9N8QG4t7wDOxqpV/Nhc4p7Ws=";
+  };
+
+  nativeBuildInputs = [ dpkg makeWrapper ];
+
+  unpackPhase = ''
+    dpkg-deb -x $src opt
+  '';
+
+  installPhase = ''
+    wrapBin() {
+      makeWrapper $1 $out/bin/$(basename $1) \
+        --set INSTALL4J_JAVA_HOME "${openjdk17}" \
+        --prefix PATH : ${makeBinPath [ coreutils gawk gnugrep gnused ]}
+    }
+    cp -r opt $out
+    mkdir -p $out/bin $out/share/pixmaps $out/share/applications
+    for name in LicenseManager MarvinSketch MarvinView; do
+      wrapBin $out/opt/chemaxon/marvinsuite/$name
+      ln -s {$out/opt/chemaxon/marvinsuite/.install4j,$out/share/pixmaps}/$name.png
+    done
+    for name in cxcalc cxtrain evaluate molconvert mview msketch; do
+      wrapBin $out/opt/chemaxon/marvinsuite/bin/$name
+    done
+    ${concatStrings (map (name: ''
+      substitute ${./. + "/${name}.desktop"} $out/share/applications/${name}.desktop --subst-var out
+    '') [ "LicenseManager" "MarvinSketch" "MarvinView" ])}
+  '';
+
+  meta = {
+    description = "A chemical modelling, analysis and structure drawing program";
+    homepage = "https://chemaxon.com/products/marvin";
+    maintainers = with maintainers; [ fusion809 ];
+    license = licenses.unfree;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/molden/default.nix b/nixpkgs/pkgs/applications/science/chemistry/molden/default.nix
new file mode 100644
index 000000000000..7a15ef9363b5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/molden/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchurl, which, gfortran, libGLU, xorg } :
+
+stdenv.mkDerivation rec {
+  version = "6.3";
+  pname = "molden";
+
+  src = fetchurl {
+    url = "https://ftp.science.ru.nl/Molden//molden${version}.tar.gz";
+    sha256 = "02qi16pz2wffn3cc47dpjqhfafzwfmb79waw4nnhfyir8a4h3cq1";
+  };
+
+  nativeBuildInputs = [ which ];
+  buildInputs = [ gfortran libGLU xorg.libX11 xorg.libXmu ];
+
+  patches = [ ./dont_register_file_types.patch ];
+
+  postPatch = ''
+     substituteInPlace ./makefile --replace '-L/usr/X11R6/lib'  "" \
+                                  --replace '-I/usr/X11R6/include' "" \
+                                  --replace '/usr/local/' $out/ \
+                                  --replace 'sudo' "" \
+                                  --replace '-C surf depend' '-C surf' \
+                                  --replace 'FFLAGS =' 'FFLAGS = -fallow-argument-mismatch'
+
+     substituteInPlace ambfor/makefile --replace 'FFLAGS =' 'FFLAGS = -fallow-argument-mismatch'
+
+     sed -in '/^# DO NOT DELETE THIS LINE/q;' surf/Makefile
+  '';
+
+  preInstall = ''
+     mkdir -p $out/bin
+  '';
+
+  enableParallelBuilding = false;
+
+  meta = with lib; {
+     description = "Display and manipulate molecular structures";
+     homepage = "http://www3.cmbi.umcn.nl/molden/";
+     license = {
+       fullName = "Free for academic/non-profit use";
+       url = "http://www3.cmbi.umcn.nl/molden/CopyRight.html";
+       free = false;
+     };
+     platforms = platforms.linux;
+     maintainers = with maintainers; [ markuskowa ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/molden/dont_register_file_types.patch b/nixpkgs/pkgs/applications/science/chemistry/molden/dont_register_file_types.patch
new file mode 100644
index 000000000000..75ce593ed29a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/molden/dont_register_file_types.patch
@@ -0,0 +1,29 @@
+diff --git a/makefile b/makefile
+index 58a9e74..64615b6 100644
+--- a/makefile
++++ b/makefile
+@@ -32,8 +32,6 @@ os :=
+ ifeq ($(uname), Linux)
+  os := $(shell head -n 1 /etc/issue | cut -d" " -f1)
+  ifeq ($(os), Ubuntu)
+-    EXTEN = exten
+-    EXTENZ = exten2
+     LIBSG = -L/usr/X11R6/lib -lGLU -lGL -lX11 -lm
+  endif
+  ifeq ($(os), Debian)
+@@ -278,7 +276,7 @@ LIBSOGL = -lglut -lGLU -lGL -lXmu -lX11 -lm
+ #
+ #LIBSG = -L/usr/X11R6/lib -Wl,-framework -Wl,GLUT -Wl,-framework -Wl,OpenGL -Wl,-framework -Wl,Cocoa -lGLU -lGL -lXmu -lX11 -lm
+ 
+-all:	molden gmolden ambfor/ambfor ambfor/ambmd surf/surf $(EXTEN)
++all:	molden gmolden ambfor/ambfor ambfor/ambmd surf/surf
+ xwin.o:	xwin.c rots.h
+ xwingl.o:	xwin.c rots.h
+ 
+@@ -344,5 +342,5 @@ exten:
+ exten2:
+ 	./register_extension.sh /usr/local/bin
+ 
+-install:	$(EXTENZ)
++install:
+ 	sudo install -t /usr/local/bin -m 755 molden gmolden ambfor/ambfor ambfor/ambmd surf/surf
diff --git a/nixpkgs/pkgs/applications/science/chemistry/mopac/default.nix b/nixpkgs/pkgs/applications/science/chemistry/mopac/default.nix
new file mode 100644
index 000000000000..4e8e29c993e1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/mopac/default.nix
@@ -0,0 +1,43 @@
+{ stdenv
+, lib
+, gfortran
+, fetchFromGitHub
+, cmake
+, blas
+, lapack
+, python3Packages
+}:
+
+assert blas.isILP64 == lapack.isILP64;
+
+stdenv.mkDerivation rec {
+  pname = "mopac";
+  version = "22.1.1";
+
+  src = fetchFromGitHub {
+    owner = "openmopac";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-tdVb/u89EBggfG3Ofz1ICBE2ug4fbMsUWAILwJP9Ito=";
+  };
+
+  nativeBuildInputs = [ gfortran cmake ];
+
+  buildInputs = [ blas lapack ];
+
+  checkInputs = with python3Packages; [ python numpy ];
+
+  doCheck = true;
+
+  preCheck = ''
+    export OMP_NUM_THREADS=2
+  '';
+
+  meta = with lib; {
+    description = "Semiempirical quantum chemistry";
+    homepage = "https://github.com/openmopac/mopac";
+    license = licenses.lgpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ sheepforce markuskowa ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/nwchem/default.nix b/nixpkgs/pkgs/applications/science/chemistry/nwchem/default.nix
new file mode 100644
index 000000000000..61266a9f0285
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/nwchem/default.nix
@@ -0,0 +1,217 @@
+{ lib
+, stdenv
+, pkgs
+, fetchFromGitHub
+, fetchurl
+, mpiCheckPhaseHook
+, which
+, openssh
+, gcc
+, gfortran
+, perl
+, mpi
+, blas
+, lapack
+, python3
+, tcsh
+, bash
+, automake
+, autoconf
+, libtool
+, makeWrapper
+}:
+
+assert blas.isILP64 == lapack.isILP64;
+
+let
+  versionGA = "5.8.2"; # Fixed by nwchem
+
+  gaSrc = fetchFromGitHub {
+    owner = "GlobalArrays";
+    repo = "ga";
+    rev = "v${versionGA}";
+    hash = "sha256-2ffQIg9topqKX7ygnWaa/UunL9d0Lj9qr9xucsjLuoY=";
+  };
+
+  dftd3Src = fetchurl {
+    url = "https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3/dftd3.tgz";
+    hash = "sha256-2Xz5dY9hqoH9hUJUSPv0pujOB8EukjZzmDGjrzKID1k=";
+  };
+
+  versionLibxc = "6.1.0";
+  libxcSrc = fetchurl {
+    url = "https://gitlab.com/libxc/libxc/-/archive/${versionLibxc}/libxc-${versionLibxc}.tar.gz";
+    hash = "sha256-9ZN0X6R+v7ndxGeqr9wvoSdfDXJQxpLOl2E4mpDdjq8=";
+  };
+
+  plumedSrc = fetchFromGitHub {
+    owner = "edoapra";
+    repo = "plumed2";
+    rev = "e7c908da50bde1c6399c9f0e445d6ea3330ddd9b";
+    hash = "sha256-CNlb6MTEkD977hj3xonYqZH1/WlQ1EdVD7cvL//heRM=";
+  };
+
+in
+stdenv.mkDerivation rec {
+  pname = "nwchem";
+  version = "7.2.2";
+
+  src = fetchFromGitHub {
+    owner = "nwchemgit";
+    repo = "nwchem";
+    rev = "v${version}-release";
+    hash = "sha256-BcYRqPaPR24OTRY0MJgBxi46HvUG4uFaY0unZmu5b9k=";
+  };
+
+  nativeBuildInputs = [
+    perl
+    automake
+    autoconf
+    libtool
+    makeWrapper
+    gfortran
+    which
+  ];
+  buildInputs = [
+    tcsh
+    openssh
+    blas
+    lapack
+    python3
+  ];
+  propagatedBuildInputs = [ mpi ];
+  propagatedUserEnvPkgs = [ mpi ];
+
+  postUnpack = ''
+    # These run 'configure' in source tree and
+    # require a writable directory
+    cp -r ${gaSrc}/ source/src/tools/ga-${versionGA}
+    chmod -R u+w source/src/tools/ga-${versionGA}
+
+    cp -r ${plumedSrc} source/src/libext/plumed/plumed2
+    chmod -R u+w source/src/libext/plumed/plumed2
+
+    # Provide tarball in expected location
+    ln -s ${dftd3Src} source/src/nwpw/nwpwlib/nwpwxc/dftd3.tgz
+    ln -s ${libxcSrc} source/src/libext/libxc/libxc-${versionLibxc}.tar.gz
+  '';
+
+  postPatch = ''
+    find -type f -executable -exec sed -i "s:/bin/csh:${tcsh}/bin/tcsh:" \{} \;
+    find -type f -name "GNUmakefile" -exec sed -i "s:/usr/bin/gcc:${gcc}/bin/gcc:" \{} \;
+    find -type f -name "GNUmakefile" -exec sed -i "s:/bin/rm:rm:" \{} \;
+    find -type f -executable -exec sed -i "s:/bin/rm:rm:" \{} \;
+    find -type f -name "makelib.h" -exec sed -i "s:/bin/rm:rm:" \{} \;
+
+    # Overwrite script, skipping the download
+    echo -e '#!/bin/sh\n cd ga-${versionGA};autoreconf -ivf' > src/tools/get-tools-github
+
+    # /usr/bin/env bash fails in sandbox/Makefile setting
+    substituteInPlace src/config/makefile.h --replace '/usr/bin/env bash' "${stdenv.shell}"
+
+    patchShebangs ./
+  '';
+
+  # There is no configure script. Instead the build is controlled via
+  # environment variables passed to the Makefile
+  configurePhase = ''
+    runHook preConfigure
+
+    # config parameters
+    export NWCHEM_TARGET="LINUX64"
+
+    export ARMCI_NETWORK="MPI-PR"
+    export USE_MPI="y"
+    export USE_MPIF="y"
+
+    export NWCHEM_MODULES="all python"
+
+    export USE_PYTHONCONFIG="y"
+    export USE_PYTHON64="n"
+    export PYTHONLIBTYPE="so"
+    export PYTHONHOME="${python3}"
+    export PYTHONVERSION=${lib.versions.majorMinor python3.version}
+
+    export BLASOPT="-L${blas}/lib -lblas"
+    export LAPACK_LIB="-L${lapack}/lib -llapack"
+    export BLAS_SIZE=${if blas.isILP64 then "8" else "4"}
+
+    # extra TCE related options
+    export MRCC_METHODS="y"
+    export EACCSD="y"
+    export IPCCSD="y"
+
+    export CCSDTQ="y"
+
+    export NWCHEM_TOP="$(pwd)"
+
+    runHook postConfigure
+  '';
+
+  enableParallelBuilding = true;
+
+  preBuild = ''
+    ln -s ${gaSrc} src/tools/ga-${versionGA}.tar.gz
+    cd src
+    make nwchem_config
+    ${lib.optionalString (!blas.isILP64) "make 64_to_32"}
+  '';
+
+  postBuild = ''
+    cd $NWCHEM_TOP/src/util
+    make version
+    make
+    cd $NWCHEM_TOP/src
+    make link
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/nwchem
+
+    cp $NWCHEM_TOP/bin/LINUX64/nwchem $out/bin/nwchem
+    cp -r $NWCHEM_TOP/src/data $out/share/nwchem/
+    cp -r $NWCHEM_TOP/src/basis/libraries $out/share/nwchem/data
+    cp -r $NWCHEM_TOP/src/nwpw/libraryps $out/share/nwchem/data
+
+    wrapProgram $out/bin/nwchem \
+      --set-default NWCHEM_BASIS_LIBRARY $out/share/nwchem/data/libraries/
+
+    cat > $out/share/nwchem/nwchemrc << EOF
+    nwchem_basis_library $out/share/nwchem/data/libraries/
+    nwchem_nwpw_library $out/share/nwchem//data/libraryps/
+    ffield amber
+    amber_1 $out/share/nwchem/data/amber_s/
+    amber_2 $out/share/nwchem/data/amber_q/
+    amber_3 $out/share/nwchem/data/amber_x/
+    amber_4 $out/share/nwchem/data/amber_u/
+    spce    $out/share/nwchem/data/solvents/spce.rst
+    charmm_s $out/share/nwchem/data/charmm_s/
+    charmm_x $out/share/nwchem/data/charmm_x/
+    EOF
+  '';
+
+  doCheck = false;
+
+  doInstallCheck = true;
+  nativeCheckInputs = [ mpiCheckPhaseHook ];
+  installCheckPhase = ''
+    runHook preInstallCheck
+
+    # run a simple water test
+    mpirun -np 2 $out/bin/nwchem $NWCHEM_TOP/QA/tests/h2o/h2o.nw > h2o.out
+    grep "Total SCF energy" h2o.out  | grep 76.010538
+
+    runHook postInstallCheck
+  '';
+
+  passthru = { inherit mpi; };
+
+  meta = with lib; {
+    description = "Open Source High-Performance Computational Chemistry";
+    mainProgram = "nwchem";
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ sheepforce markuskowa ];
+    homepage = "https://nwchemgit.github.io";
+    license = licenses.ecl20;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/octopus/default.nix b/nixpkgs/pkgs/applications/science/chemistry/octopus/default.nix
new file mode 100644
index 000000000000..93fec7149604
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/octopus/default.nix
@@ -0,0 +1,111 @@
+{ lib
+, stdenv
+, fetchFromGitLab
+, gfortran
+, which
+, perl
+, procps
+, libvdwxc
+, libyaml
+, libxc
+, fftw
+, blas
+, lapack
+, gsl
+, netcdf
+, arpack
+, autoreconfHook
+, scalapack
+, mpi
+, enableMpi ? true
+, python3
+, enableFma ? stdenv.hostPlatform.fmaSupport
+, enableFma4 ? stdenv.hostPlatform.fma4Support
+, enableAvx ? stdenv.hostPlatform.avx2Support
+, enableAvx512 ? stdenv.hostPlatform.avx512Support
+}:
+
+assert (!blas.isILP64) && (!lapack.isILP64);
+assert (blas.isILP64 == arpack.isILP64);
+
+stdenv.mkDerivation rec {
+  pname = "octopus";
+  version = "13.0";
+
+  src = fetchFromGitLab {
+    owner = "octopus-code";
+    repo = "octopus";
+    rev = version;
+    sha256 = "sha256-CZ+Qmv6aBQ6w11mLvTP6QAJzaGs+vmmXuNGnSyAqVDU=";
+  };
+
+  nativeBuildInputs = [
+    which
+    perl
+    procps
+    autoreconfHook
+    gfortran
+  ];
+
+  buildInputs = [
+    libyaml
+    libxc
+    blas
+    lapack
+    gsl
+    fftw
+    netcdf
+    arpack
+    libvdwxc
+    (python3.withPackages (ps: [ ps.pyyaml ]))
+  ] ++ lib.optional enableMpi scalapack;
+
+  propagatedBuildInputs = lib.optional enableMpi mpi;
+  propagatedUserEnvPkgs = lib.optional enableMpi mpi;
+
+  configureFlags = with lib; [
+    "--with-yaml-prefix=${lib.getDev libyaml}"
+    "--with-blas=-lblas"
+    "--with-lapack=-llapack"
+    "--with-fftw-prefix=${lib.getDev fftw}"
+    "--with-gsl-prefix=${lib.getDev gsl}"
+    "--with-libxc-prefix=${lib.getDev libxc}"
+    "--with-libvdwxc"
+    "--enable-openmp"
+  ]
+  ++ optional enableFma "--enable-fma3"
+  ++ optional enableFma4 "--enable-fma4"
+  ++ optional enableAvx "--enable-avx"
+  ++ optional enableAvx512 "--enable-avx512"
+  ++ optionals enableMpi [
+    "--enable-mpi"
+    "--with-scalapack=-lscalapack"
+    "CC=mpicc"
+    "FC=mpif90"
+  ];
+
+
+  nativeCheckInputs = lib.optional.enableMpi mpi;
+  doCheck = false;
+  checkTarget = "check-short";
+
+  postPatch = ''
+    patchShebangs ./
+  '';
+
+  postConfigure = ''
+    patchShebangs testsuite/oct-run_testsuite.sh
+  '';
+
+  enableParallelBuilding = true;
+
+  passthru = lib.attrsets.optionalAttrs enableMpi { inherit mpi; };
+
+  meta = with lib; {
+    description = "Real-space time dependent density-functional theory code";
+    homepage = "https://octopus-code.org";
+    maintainers = with maintainers; [ markuskowa ];
+    license = with licenses; [ gpl2Only asl20 lgpl3Plus bsd3 ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/openmolcas/default.nix b/nixpkgs/pkgs/applications/science/chemistry/openmolcas/default.nix
new file mode 100644
index 000000000000..8ad979473955
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/openmolcas/default.nix
@@ -0,0 +1,158 @@
+{ lib
+, stdenv
+, fetchFromGitLab
+, fetchFromGitHub
+, cmake
+, gfortran
+, perl
+, blas-ilp64
+, hdf5-cpp
+, python3
+, texliveMinimal
+, armadillo
+, libxc
+, makeWrapper
+, gsl
+, boost180
+, autoPatchelfHook
+  # Note that the CASPT2 module is broken with MPI
+  # See https://gitlab.com/Molcas/OpenMolcas/-/issues/169
+, enableMpi ? false
+, mpi
+, globalarrays
+}:
+
+assert blas-ilp64.isILP64;
+assert lib.elem blas-ilp64.passthru.implementation [ "openblas" "mkl" ];
+
+let
+  python = python3.withPackages (ps: with ps; [ six pyparsing numpy h5py ]);
+  qcmaquisSrc = fetchFromGitHub {
+    owner = "qcscine";
+    repo = "qcmaquis";
+    rev = "release-3.1.1"; # Must match tag in cmake/custom/qcmaquis.cmake
+    hash = "sha256-diLDWj/Om6EHrVp+Hd24jsN6R9vV2vRl0y9gqyRWhkI=";
+  };
+  nevtp2Src = fetchFromGitHub {
+    owner = "qcscine";
+    repo = "nevpt2";
+    rev = "e1484fd"; # Must match tag in cmake/custom/nevpt2.cmake
+    hash = "sha256-Vl+FhwhJBbD/7U2CwsYE9BClSQYLJ8DKXV9EXxQUmz0=";
+  };
+
+in
+stdenv.mkDerivation rec {
+  pname = "openmolcas";
+  version = "24.02";
+
+  src = fetchFromGitLab {
+    owner = "Molcas";
+    repo = "OpenMolcas";
+    rev = "v${version}";
+    hash = "sha256-4Ek0cnaRfLEbj1Nj31rRp9b2sois4rIFTcpOUq9h2mw=";
+  };
+
+  patches = [
+    # Required to handle openblas multiple outputs
+    ./openblasPath.patch
+
+    # Required for a local QCMaquis build
+    ./qcmaquis.patch
+  ];
+
+  postPatch = ''
+    # Using env fails in the sandbox
+    substituteInPlace Tools/pymolcas/export.py --replace \
+      "/usr/bin/env','python3" "python3"
+
+    # Pointing CMake to local QCMaquis and NEVPT2 archives
+    substituteInPlace cmake/custom/qcmaquis.cmake \
+      --subst-var-by "qcmaquis_src_url" "file://${qcmaquisSrc}"
+
+    substituteInPlace cmake/custom/nevpt2.cmake \
+      --subst-var-by "nevpt2_src_url" "file://${nevtp2Src}"
+  '';
+
+  nativeBuildInputs = [
+    perl
+    gfortran
+    cmake
+    texliveMinimal
+    makeWrapper
+    autoPatchelfHook
+  ];
+
+  buildInputs = [
+    blas-ilp64.passthru.provider
+    hdf5-cpp
+    python
+    armadillo
+    libxc
+    gsl.dev
+    boost180
+  ] ++ lib.optionals enableMpi [
+    mpi
+    globalarrays
+  ];
+
+  passthru = lib.optionalAttrs enableMpi { inherit mpi; };
+
+  cmakeFlags = [
+    "-DOPENMP=ON"
+    "-DLINALG=OpenBLAS"
+    "-DTOOLS=ON"
+    "-DHDF5=ON"
+    "-DFDE=ON"
+    "-DEXTERNAL_LIBXC=${lib.getDev libxc}"
+    "-DDMRG=ON"
+    "-DNEVPT2=ON"
+    "-DCMAKE_SKIP_BUILD_RPATH=ON"
+  ] ++ lib.optionals (blas-ilp64.passthru.implementation == "openblas") [
+    "-DOPENBLASROOT=${blas-ilp64.passthru.provider.dev}"
+    "-DLINALG=OpenBLAS"
+  ] ++ lib.optionals (blas-ilp64.passthru.implementation == "mkl") [
+    "-DMKLROOT=${blas-ilp64.passthru.provider}"
+    "-DLINALG=MKL"
+  ] ++ lib.optionals enableMpi [
+    "-DGA=ON"
+    "-DMPI=ON"
+  ];
+
+  preConfigure = lib.optionalString enableMpi ''
+    export GAROOT=${globalarrays};
+  '';
+
+  postConfigure = ''
+    # The Makefile will install pymolcas during the build grrr.
+    mkdir -p $out/bin
+    export PATH=$PATH:$out/bin
+  '';
+
+  postInstall = ''
+    mv $out/pymolcas $out/bin
+    find $out/Tools -type f -exec mv \{} $out/bin \;
+    rm -r $out/Tools
+  '';
+
+  # DMRG executables contain references to /build, however, they are properly
+  # removed by autopatchelf
+  noAuditTmpdir = true;
+
+  postFixup = ''
+    # Wrong store path in shebang (no Python pkgs), force re-patching
+    sed -i "1s:/.*:/usr/bin/env python:" $out/bin/pymolcas
+    patchShebangs $out/bin
+
+    wrapProgram $out/bin/pymolcas --set MOLCAS $out
+  '';
+
+  meta = with lib; {
+    description = "Advanced quantum chemistry software package";
+    homepage = "https://gitlab.com/Molcas/OpenMolcas";
+    maintainers = [ maintainers.markuskowa ];
+    license = with licenses; [ lgpl21Only bsd3 ];
+    platforms = [ "aarch64-linux" "x86_64-linux" ];
+    mainProgram = "pymolcas";
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/science/chemistry/openmolcas/openblasPath.patch b/nixpkgs/pkgs/applications/science/chemistry/openmolcas/openblasPath.patch
new file mode 100644
index 000000000000..e47adcc3e9a3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/openmolcas/openblasPath.patch
@@ -0,0 +1,12 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 276ae4e2..db13e6e3 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1507,7 +1507,6 @@ if (LINALG STREQUAL "OpenBLAS")
+     NAMES openblas
+     PATHS ${OPENBLASROOT}
+     PATH_SUFFIXES lib
+-    NO_DEFAULT_PATH
+   )
+ 
+   if (NOT LIBOPENBLAS)
diff --git a/nixpkgs/pkgs/applications/science/chemistry/openmolcas/qcmaquis.patch b/nixpkgs/pkgs/applications/science/chemistry/openmolcas/qcmaquis.patch
new file mode 100644
index 000000000000..ca276bb3fb58
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/openmolcas/qcmaquis.patch
@@ -0,0 +1,46 @@
+diff --git a/cmake/custom/nevpt2.cmake b/cmake/custom/nevpt2.cmake
+index 789739ec8..6c86a7b8c 100644
+--- a/cmake/custom/nevpt2.cmake
++++ b/cmake/custom/nevpt2.cmake
+@@ -67,6 +67,7 @@ list(APPEND NEVPT2CMakeArgs
+   "-DMOLCAS_BUILD_DIR=${PROJECT_BINARY_DIR}"
+   "-DCMAKE_Fortran_MODULE_DIRECTORY=${mod_dir}"
+   "-DDMRG_INCLUDE=${HDF5_QCM_INCLUDE}"
++  "-DCMAKE_SKIP_BUILD_RPATH=ON"
+   )
+ 
+ if(HDF5_ROOT)
+@@ -118,9 +119,7 @@ endif ()
+ 
+ ExternalProject_Add(${EP_PROJECT}
+                     PREFIX ${CUSTOM_NEVPT2_LOCATION}
+-                    GIT_REPOSITORY ${reference_git_repo}
+-                    GIT_TAG ${reference_git_commit}
+-                    UPDATE_DISCONNECTED ${EP_SkipUpdate}
++                    URL @nevpt2_src_url@
+                     CMAKE_ARGS "${NEVPT2CMakeArgs}"
+                     INSTALL_DIR "${PROJECT_BINARY_DIR}/qcmaquis"
+                    )
+diff --git a/cmake/custom/qcmaquis.cmake b/cmake/custom/qcmaquis.cmake
+index 176d02761..e160b7bc8 100644
+--- a/cmake/custom/qcmaquis.cmake
++++ b/cmake/custom/qcmaquis.cmake
+@@ -78,6 +78,7 @@ list(APPEND QCMaquisCMakeArgs
+   -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
+   -DCMAKE_CXX_FLAGS=${QCM_CMake_CXX_FLAGS}
+   -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
++  -DCMAKE_SKIP_BUILD_RPATH=ON
+   )
+ if(HDF5_ROOT)
+   list(APPEND QCMaquisCMakeArgs
+@@ -278,9 +279,7 @@ set (CMAKE_DISABLE_SOURCE_CHANGES OFF)
+ 
+     ExternalProject_Add(${EP_PROJECT}
+         PREFIX ${extprojpath}
+-        GIT_REPOSITORY ${reference_git_repo}
+-        GIT_TAG ${reference_git_commit}
+-        UPDATE_DISCONNECTED ${EP_SkipUpdate}
++        URL @qcmaquis_src_url@
+ 
+         SOURCE_SUBDIR dmrg
+         CMAKE_ARGS ${EP_CMAKE_ARGS}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/pymol/default.nix b/nixpkgs/pkgs/applications/science/chemistry/pymol/default.nix
new file mode 100644
index 000000000000..0e4728dd65d6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/pymol/default.nix
@@ -0,0 +1,79 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, makeDesktopItem
+, python3
+, python3Packages
+, netcdf
+, glew
+, glm
+, libpng
+, libxml2
+, freetype
+, msgpack
+, qt5
+}:
+let
+  pname = "pymol";
+  description = "A Python-enhanced molecular graphics tool";
+
+  desktopItem = makeDesktopItem {
+    name = pname;
+    exec = pname;
+    desktopName = "PyMol Molecular Graphics System";
+    genericName = "Molecular Modeler";
+    comment = description;
+    icon = pname;
+    mimeTypes = [
+      "chemical/x-pdb"
+      "chemical/x-mdl-molfile"
+      "chemical/x-mol2"
+      "chemical/seq-aa-fasta"
+      "chemical/seq-na-fasta"
+      "chemical/x-xyz"
+      "chemical/x-mdl-sdf"
+    ];
+    categories = [ "Graphics" "Education" "Science" "Chemistry" ];
+  };
+in
+python3Packages.buildPythonApplication rec {
+  inherit pname;
+  version = "2.5.0";
+  src = fetchFromGitHub {
+    owner = "schrodinger";
+    repo = "pymol-open-source";
+    rev = "v${version}";
+    sha256 = "sha256-JdsgcVF1w1xFPZxVcyS+GcWg4a1Bd4SvxFOuSdlz9SM=";
+  };
+
+  nativeBuildInputs = [ qt5.wrapQtAppsHook ];
+  buildInputs = [ python3Packages.numpy python3Packages.pyqt5 glew glm libpng libxml2 freetype msgpack netcdf ];
+  env.NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2";
+  hardeningDisable = [ "format" ];
+
+  installPhase = ''
+    python setup.py install --home="$out"
+    runHook postInstall
+  '';
+
+  postInstall = with python3Packages; ''
+    wrapProgram $out/bin/pymol \
+      --prefix PYTHONPATH : ${lib.makeSearchPathOutput "lib" python3.sitePackages [ pyqt5 pyqt5.pyqt5-sip ]}
+
+    mkdir -p "$out/share/icons/"
+    ln -s ../../lib/python/pymol/pymol_path/data/pymol/icons/icon2.svg "$out/share/icons/pymol.svg"
+    cp -r "${desktopItem}/share/applications/" "$out/share/"
+  '';
+
+  preFixup = ''
+    wrapQtApp "$out/bin/pymol"
+  '';
+
+  meta = with lib; {
+    inherit description;
+    mainProgram = "pymol";
+    homepage = "https://www.pymol.org/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ samlich ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/quantum-espresso/default.nix b/nixpkgs/pkgs/applications/science/chemistry/quantum-espresso/default.nix
new file mode 100644
index 000000000000..4c4482919772
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/quantum-espresso/default.nix
@@ -0,0 +1,131 @@
+{ lib
+, stdenv
+, fetchFromGitLab
+, fetchFromGitHub
+, fetchurl
+, git
+, cmake
+, gnum4
+, gfortran
+, pkg-config
+, fftw
+, blas
+, lapack
+, scalapack
+, wannier90
+, hdf5
+, libmbd
+, libxc
+, enableMpi ? true
+, mpi
+}:
+
+assert ! blas.isILP64;
+assert ! lapack.isILP64;
+
+let
+  # "rev"s must exactly match the git submodule commits in the QE repo
+  gitSubmodules = {
+    devxlib = fetchFromGitLab {
+      group = "max-centre";
+      owner = "components";
+      repo = "devicexlib";
+      rev = "a6b89ef77b1ceda48e967921f1f5488d2df9226d";
+      hash = "sha256-p3fRplVG4YSN6ILNlOwf+aSEhpTJPXqiS1+wnzWVA2U=";
+    };
+
+    pw2qmcpack = fetchFromGitHub {
+      owner = "QMCPACK";
+      repo = "pw2qmcpack";
+      rev = "f72ab25fa4ea755c1b4b230ae8074b47d5509c70";
+      hash = "sha256-K1Z90xexsUvk4SdEb8FGryRal0GAFoLz3j1h/RT2nYw=";
+    };
+  };
+
+in
+stdenv.mkDerivation rec {
+  version = "7.2";
+  pname = "quantum-espresso";
+
+  src = fetchFromGitLab {
+    owner = "QEF";
+    repo = "q-e";
+    rev = "qe-${version}";
+    hash = "sha256-0q0QWX4BVjVHjcbKOBpjbBADuL+2S5LAALyrxmjVs4c=";
+  };
+
+  # add git submodules manually and fix pkg-config file
+  prePatch = ''
+    chmod -R +rwx external/
+
+    substituteInPlace external/devxlib.cmake \
+      --replace "qe_git_submodule_update(external/devxlib)" ""
+    substituteInPlace external/CMakeLists.txt \
+      --replace "qe_git_submodule_update(external/pw2qmcpack)" "" \
+      --replace "qe_git_submodule_update(external/d3q)" "" \
+      --replace "qe_git_submodule_update(external/qe-gipaw)" ""
+
+    ${builtins.toString (builtins.attrValues
+      (builtins.mapAttrs
+        (name: val: ''
+          cp -r ${val}/* external/${name}/.
+          chmod -R +rwx external/${name}
+        '')
+        gitSubmodules
+      )
+    )}
+
+    substituteInPlace cmake/quantum_espresso.pc.in \
+      --replace 'libdir="''${prefix}/@CMAKE_INSTALL_LIBDIR@"' 'libdir="@CMAKE_INSTALL_FULL_LIBDIR@"'
+  '';
+
+  passthru = { inherit mpi; };
+
+  nativeBuildInputs = [
+    cmake
+    gfortran
+    git
+    pkg-config
+  ];
+
+  buildInputs = [
+    fftw
+    blas
+    lapack
+    wannier90
+    libmbd
+    libxc
+    hdf5
+  ] ++ lib.optional enableMpi scalapack;
+
+  propagatedBuildInputs = lib.optional enableMpi mpi;
+  propagatedUserEnvPkgs = lib.optional enableMpi mpi;
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DWANNIER90_ROOT=${wannier90}"
+    "-DMBD_ROOT=${libmbd}"
+    "-DQE_ENABLE_OPENMP=ON"
+    "-DQE_ENABLE_LIBXC=ON"
+    "-DQE_ENABLE_HDF5=ON"
+    "-DQE_ENABLE_PLUGINS=pw2qmcpack"
+  ] ++ lib.optionals enableMpi [
+    "-DQE_ENABLE_MPI=ON"
+    "-DQE_ENABLE_MPI_MODULE=ON"
+    "-DQE_ENABLE_SCALAPACK=ON"
+  ];
+
+  meta = with lib; {
+    description = "Electronic-structure calculations and materials modeling at the nanoscale";
+    longDescription = ''
+      Quantum ESPRESSO is an integrated suite of Open-Source computer codes for
+      electronic-structure calculations and materials modeling at the
+      nanoscale. It is based on density-functional theory, plane waves, and
+      pseudopotentials.
+    '';
+    homepage = "https://www.quantum-espresso.org/";
+    license = licenses.gpl2;
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+    maintainers = [ maintainers.costrouc ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/siesta/default.nix b/nixpkgs/pkgs/applications/science/chemistry/siesta/default.nix
new file mode 100644
index 000000000000..02586dea2e29
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/siesta/default.nix
@@ -0,0 +1,86 @@
+{ lib, stdenv
+, gfortran, blas, lapack, scalapack
+, useMpi ? false
+, mpi
+, fetchFromGitLab
+}:
+
+stdenv.mkDerivation rec {
+  version = "4.1.5";
+  pname = "siesta";
+
+  src = fetchFromGitLab {
+    owner = "siesta-project";
+    repo = "siesta";
+    rev = "v${version}";
+    sha256 = "0lz8rfl5xwdj17zn7a30ipi7cgjwqki21a7wg9rdg7iwx27bpnmg";
+  };
+
+  postPatch = ''
+    substituteInPlace Src/siesta_init.F --replace '/bin/rm' 'rm'
+  '';
+
+  passthru = {
+    inherit mpi;
+  };
+
+  nativeBuildInputs = [ gfortran ];
+
+  buildInputs = [ blas lapack ]
+    ++ lib.optionals useMpi [ mpi scalapack ];
+
+  enableParallelBuilding = false;  # Started making trouble with gcc-11
+
+  # Must do manually because siesta does not do the regular
+  # ./configure; make; make install
+  configurePhase = ''
+    cd Obj
+    sh ../Src/obj_setup.sh
+    cp gfortran.make arch.make
+  '';
+
+  preBuild = ''
+    # See https://gitlab.com/siesta-project/siesta/-/commit/a10bf1628e7141ba263841889c3503c263de1582
+    # This may be fixed in the next release.
+    makeFlagsArray=(
+        FFLAGS="-fallow-argument-mismatch"
+    )
+    '' + (if useMpi then ''
+    makeFlagsArray+=(
+        CC="mpicc" FC="mpifort"
+        FPPFLAGS="-DMPI" MPI_INTERFACE="libmpi_f90.a" MPI_INCLUDE="."
+        COMP_LIBS="" LIBS="-lblas -llapack -lscalapack"
+    );
+  '' else ''
+    makeFlagsArray+=(
+      COMP_LIBS="" LIBS="-lblas -llapack"
+    );
+  '');
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -a siesta $out/bin
+  '';
+
+  meta = with lib; {
+    description = "A first-principles materials simulation code using DFT";
+    mainProgram = "siesta";
+    longDescription = ''
+         SIESTA is both a method and its computer program
+         implementation, to perform efficient electronic structure
+         calculations and ab initio molecular dynamics simulations of
+         molecules and solids. SIESTA's efficiency stems from the use
+         of strictly localized basis sets and from the implementation
+         of linear-scaling algorithms which can be applied to suitable
+         systems. A very important feature of the code is that its
+         accuracy and cost can be tuned in a wide range, from quick
+         exploratory calculations to highly accurate simulations
+         matching the quality of other approaches, such as plane-wave
+         and all-electron methods.
+      '';
+    homepage = "https://siesta-project.org/siesta/";
+    license = licenses.gpl2;
+    platforms = [ "x86_64-linux" ];
+    maintainers = [ maintainers.costrouc ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/wxmacmolplt/default.nix b/nixpkgs/pkgs/applications/science/chemistry/wxmacmolplt/default.nix
new file mode 100644
index 000000000000..ae6c0df87905
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/wxmacmolplt/default.nix
@@ -0,0 +1,44 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, wxGTK32
+, libGL
+, libGLU
+, pkg-config
+, xorg
+, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "wxmacmolplt";
+  version = "7.7.3";
+
+  src = fetchFromGitHub {
+    owner = "brettbode";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-gFGstyq9bMmBaIS4QE6N3EIC9GxRvyJYUr8DUvwRQBc=";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+  buildInputs = [
+    wxGTK32
+    libGL
+    libGLU
+    xorg.libX11
+    xorg.libX11.dev
+  ];
+
+  configureFlags = [ "LDFLAGS=-lGL" ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Graphical user interface for GAMESS-US";
+    mainProgram = "wxmacmolplt";
+    homepage = "https://brettbode.github.io/wxmacmolplt/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ sheepforce markuskowa ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/computer-architecture/accelergy/default.nix b/nixpkgs/pkgs/applications/science/computer-architecture/accelergy/default.nix
new file mode 100644
index 000000000000..ec702d2b2906
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/computer-architecture/accelergy/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchFromGitHub, python3Packages, pkgs }:
+
+python3Packages.buildPythonApplication rec {
+  pname = "accelergy";
+  version = "unstable-2022-05-03";
+
+  src = fetchFromGitHub {
+    owner = "Accelergy-Project";
+    repo = "accelergy";
+    rev = "34df8e87a889ae55cecba58992d4573466b40565";
+    hash = "sha256-SRtt1EocHy5fKszpoumC+mOK/qhreoA2/Ff1wcu5WKo=";
+  };
+
+  propagatedBuildInputs = with python3Packages; [
+    pyyaml
+    yamlordereddictloader
+    pyfiglet
+    setuptools
+  ];
+
+  meta = with lib; {
+    description = "An architecture-level energy/area estimator for accelerator designs";
+    license = licenses.mit;
+    homepage = "https://accelergy.mit.edu/";
+    maintainers = with maintainers; [ gdinh ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/computer-architecture/qtrvsim/default.nix b/nixpkgs/pkgs/applications/science/computer-architecture/qtrvsim/default.nix
new file mode 100644
index 000000000000..c60ee224aa2a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/computer-architecture/qtrvsim/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, cmake, wrapQtAppsHook, qtbase }:
+
+stdenv.mkDerivation rec {
+  pname = "QtRVSim";
+  version = "0.9.7";
+
+  src = fetchFromGitHub {
+    owner = "cvut";
+    repo = "qtrvsim";
+    rev = "refs/tags/v${version}";
+    sha256 = "sha256-SelmqHauj5Yxg043NZqR4bhqW5clwg1h7UD8mW7j7vE=";
+  };
+
+  nativeBuildInputs = [ cmake wrapQtAppsHook ];
+
+  buildInputs = [ qtbase ];
+
+  meta = with lib; {
+    description = "RISC-V CPU simulator for education purposes";
+    longDescription = ''
+      RISC-V CPU simulator for education purposes with pipeline and cache visualization.
+      Developed at FEE CTU for computer architecture classes.
+    '';
+    homepage = "https://github.com/cvut/qtrvsim";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ jdupak ];
+    mainProgram = "qtrvsim_gui";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/computer-architecture/timeloop/default.nix b/nixpkgs/pkgs/applications/science/computer-architecture/timeloop/default.nix
new file mode 100644
index 000000000000..ec8ec3ed8abc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/computer-architecture/timeloop/default.nix
@@ -0,0 +1,103 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, scons
+, libconfig
+, boost
+, libyaml
+, yaml-cpp
+, ncurses
+, gpm
+, enableAccelergy ? true
+, enableISL ? false
+, accelergy
+}:
+
+stdenv.mkDerivation rec {
+  pname = "timeloop";
+  version = "3.0.3";
+
+  src = fetchFromGitHub {
+    owner = "NVlabs";
+    repo = "timeloop";
+    rev = "v${version}";
+    hash = "sha256-CGPhrBNzFdERAA/Eym2v0+FvFUe+VkBLnwYEqEMHE9k=";
+  };
+
+  nativeBuildInputs = [ scons ];
+
+  buildInputs = [
+    libconfig
+    boost
+    libyaml
+    yaml-cpp
+    ncurses
+    accelergy
+   ] ++ lib.optionals stdenv.isLinux [ gpm ];
+
+  preConfigure = ''
+    cp -r ./pat-public/src/pat ./src/pat
+  '';
+
+  enableParallelBuilding = true;
+
+  #link-time optimization fails on darwin
+  #see https://github.com/NixOS/nixpkgs/issues/19098
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-fno-lto";
+
+  postPatch = ''
+    # Fix gcc-13 build failure due to missing includes:
+    sed -e '1i #include <cstdint>' -i \
+      include/compound-config/compound-config.hpp
+
+    # use nix ar/ranlib
+    substituteInPlace ./SConstruct \
+      --replace-fail "env.Replace(AR = \"gcc-ar\")" "pass" \
+      --replace-fail "env.Replace(RANLIB = \"gcc-ranlib\")" "pass"
+    '' + lib.optionalString stdenv.isDarwin ''
+    # prevent clang from dying on errors that gcc is fine with
+    substituteInPlace ./src/SConscript --replace "-Werror" "-Wno-inconsistent-missing-override"
+
+    # disable LTO on macos
+    substituteInPlace ./src/SConscript --replace ", '-flto'" ""
+
+    # static builds on mac fail as no static libcrt is provided by apple
+    # see https://stackoverflow.com/questions/3801011/ld-library-not-found-for-lcrt0-o-on-osx-10-6-with-gcc-clang-static-flag
+    substituteInPlace ./src/SConscript \
+      --replace "'-static-libgcc', " "" \
+      --replace "'-static-libstdc++', " "" \
+      --replace "'-Wl,--whole-archive', '-static', " "" \
+      --replace ", '-Wl,--no-whole-archive'" ""
+
+    #remove hardcoding of gcc
+    sed -i '40i env.Replace(CC = "${stdenv.cc.targetPrefix}cc")' ./SConstruct
+    sed -i '40i env.Replace(CXX = "${stdenv.cc.targetPrefix}c++")' ./SConstruct
+
+    #gpm doesn't exist on darwin
+    substituteInPlace ./src/SConscript --replace ", 'gpm'" ""
+   '';
+
+  sconsFlags =
+    # will fail on clang/darwin on link without --static due to undefined extern
+    # however, will fail with static on linux as nixpkgs deps aren't static
+    lib.optional stdenv.isDarwin "--static"
+    ++ lib.optional enableAccelergy "--accelergy"
+    ++ lib.optional enableISL "--with-isl";
+
+
+  installPhase = ''
+    cp -r ./bin ./lib $out
+    mkdir -p $out/share
+    cp -r ./doc $out/share
+    mkdir -p $out/data
+    cp -r ./problem-shapes ./configs $out/data
+   '';
+
+  meta = with lib; {
+    description = "Chip modeling/mapping benchmarking framework";
+    homepage = "https://timeloop.csail.mit.edu";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ gdinh ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/adms/default.nix b/nixpkgs/pkgs/applications/science/electronics/adms/default.nix
new file mode 100644
index 000000000000..7b7e2a1af63a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/adms/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, flex, bison, gperf,
+  libxml2, perl, perlPackages, gd }:
+
+stdenv.mkDerivation rec {
+  version = "2.3.7";
+  pname = "adms";
+
+  src = fetchFromGitHub {
+    owner = "Qucs";
+    repo = "adms";
+    rev = "release-${version}";
+    sha256 = "0i37c9k6q1iglmzp9736rrgsnx7sw8xn3djqbbjw29zsyl3pf62c";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ flex bison gperf libxml2 perl gd perlPackages.XMLLibXML ];
+  configureFlags = [ "--enable-maintainer-mode" ];
+
+  meta = {
+    description = "automatic device model synthesizer";
+    homepage = "https://github.com/Qucs/adms";
+    license = lib.licenses.gpl3;
+    maintainers = with lib.maintainers; [disassembler];
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/alliance/default.nix b/nixpkgs/pkgs/applications/science/electronics/alliance/default.nix
new file mode 100644
index 000000000000..f4333be8475e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/alliance/default.nix
@@ -0,0 +1,58 @@
+{ lib, stdenv, fetchFromGitLab, xorgproto, motif, libX11, libXt, libXpm, bison
+, flex, automake, autoconf, libtool
+}:
+
+stdenv.mkDerivation rec {
+  pname = "alliance";
+  version = "unstable-2022-01-13";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.lip6.fr";
+    owner = "vlsi-eda";
+    repo = "alliance";
+    rev = "ebece102e15c110fc79f1da50524c68fd9523f0c";
+    hash = "sha256-NGtE3ZmN9LrgXG4NIKrp7dFRVzrKMoudlPUtYYKrZjY=";
+  };
+
+  prePatch = "cd alliance/src";
+
+  nativeBuildInputs = [ libtool automake autoconf flex ];
+  buildInputs = [ xorgproto motif libX11 libXt libXpm bison ];
+
+  # Disable parallel build, errors:
+  #  ./pat_decl_y.y:736:5: error: expected '=', ...
+  enableParallelBuilding = false;
+
+  ALLIANCE_TOP = placeholder "out";
+
+  configureFlags = [
+    "--prefix=${placeholder "out"}" "--enable-alc-shared"
+  ];
+
+  postPatch = ''
+    # texlive for docs seems extreme
+    substituteInPlace autostuff \
+      --replace "$newdirs documentation" "$newdirs"
+
+    substituteInPlace sea/src/DEF_grammar_lex.l --replace "ifndef FLEX_BETA" \
+      "if (YY_FLEX_MAJOR_VERSION <= 2) && (YY_FLEX_MINOR_VERSION < 6)"
+
+    ./autostuff
+  '';
+
+  postInstall = ''
+    sed -i "s|ALLIANCE_TOP|$out|" distrib/*.desktop
+    mkdir -p $out/share/applications
+    cp -p distrib/*.desktop $out/share/applications/
+    mkdir -p $out/icons/hicolor/48x48/apps/
+    cp -p distrib/*.png $out/icons/hicolor/48x48/apps/
+  '';
+
+  meta = with lib; {
+    description = "(deprecated) Complete set of free CAD tools and portable libraries for VLSI design";
+    homepage = "http://coriolis.lip6.fr/";
+    license = with licenses; gpl2Plus;
+    maintainers = with maintainers; [ l-as ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/appcsxcad/default.nix b/nixpkgs/pkgs/applications/science/electronics/appcsxcad/default.nix
new file mode 100644
index 000000000000..c401e150f35e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/appcsxcad/default.nix
@@ -0,0 +1,55 @@
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, cmake
+, csxcad
+, qcsxcad
+, hdf5
+, vtkWithQt5
+, qtbase
+, fparser
+, tinyxml
+, cgal
+, boost
+}:
+
+mkDerivation {
+  pname = "appcsxcad";
+  version = "unstable-2023-01-06";
+
+  src = fetchFromGitHub {
+    owner = "thliebig";
+    repo = "AppCSXCAD";
+    rev = "379ede4b8e00c11e8d0fb724c35547991b30c423";
+    hash = "sha256-L0ZEyovnfMzM7JuITBuhb4tJ2Aqgw52IiKEfEGq7Yo0=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = [
+    csxcad
+    qcsxcad
+    hdf5
+    vtkWithQt5
+    qtbase
+    fparser
+    tinyxml
+    cgal
+    boost
+  ];
+
+  postFixup = ''
+    rm $out/bin/AppCSXCAD.sh
+  '';
+
+  meta = with lib; {
+    description = "Minimal Application using the QCSXCAD library";
+    mainProgram = "AppCSXCAD";
+    homepage = "https://github.com/thliebig/AppCSXCAD";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ matthuszagh ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/archimedes/default.nix b/nixpkgs/pkgs/applications/science/electronics/archimedes/default.nix
new file mode 100644
index 000000000000..9d9498df00da
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/archimedes/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, fetchpatch }:
+
+stdenv.mkDerivation rec {
+  pname = "archimedes";
+  version = "2.0.1";
+
+  src = fetchurl {
+    url = "mirror://gnu/archimedes/archimedes-${version}.tar.gz";
+    sha256 = "0jfpnd3pns5wxcxbiw49v5sgpmm5b4v8s4q1a5292hxxk2hzmb3z";
+  };
+
+  patches = [
+    # Pull patch pending upstream inclusion to support c99 toolchains:
+    #   https://savannah.gnu.org/bugs/index.php?62703
+    (fetchpatch {
+      name = "c99.patch";
+      url = "https://savannah.gnu.org/bugs/download.php?file_id=53393";
+      sha256 = "1xmy1w4ln1gynldk3srdi2h0fxpx465dsa1yxc3rzrrjpxh6087f";
+    })
+  ];
+
+  meta = {
+    description = "GNU package for semiconductor device simulations";
+    mainProgram = "archimedes";
+    homepage = "https://www.gnu.org/software/archimedes";
+    license = lib.licenses.gpl2Plus;
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/bitscope/common.nix b/nixpkgs/pkgs/applications/science/electronics/bitscope/common.nix
new file mode 100644
index 000000000000..6a024748daf2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/bitscope/common.nix
@@ -0,0 +1,62 @@
+{ atk
+, buildFHSEnv
+, cairo
+, dpkg
+, gdk-pixbuf
+, glib
+, gtk2-x11
+, makeWrapper
+, pango
+, lib, stdenv
+, xorg
+}:
+
+{ src, toolName, version, ... } @ attrs:
+let
+  wrapBinary = libPaths: binaryName: ''
+    wrapProgram "$out/bin/${binaryName}" \
+      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath libPaths}"
+  '';
+  pkg = stdenv.mkDerivation (rec {
+    inherit (attrs) version src;
+
+    name = "${toolName}-${version}";
+
+    meta = with lib; {
+      homepage = "http://bitscope.com/software/";
+      sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+      license = licenses.unfree;
+      platforms = [ "x86_64-linux" ];
+      maintainers = with maintainers; [
+        vidbina
+      ];
+    } // (attrs.meta or {});
+
+    nativeBuildInputs = [ makeWrapper dpkg ];
+
+    libs = attrs.libs or [
+      atk
+      cairo
+      gdk-pixbuf
+      glib
+      gtk2-x11
+      pango
+      xorg.libX11
+    ];
+
+    dontBuild = true;
+
+    unpackPhase = attrs.unpackPhase or ''
+      dpkg-deb -x ${attrs.src} ./
+    '';
+
+    installPhase = attrs.installPhase or ''
+      mkdir -p "$out/bin"
+      cp -a usr/* "$out/"
+      ${(wrapBinary libs) attrs.toolName}
+    '';
+  });
+in buildFHSEnv {
+  name = "${attrs.toolName}-${attrs.version}";
+  runScript = "${pkg.outPath}/bin/${attrs.toolName}";
+} // { inherit (pkg) meta name; }
diff --git a/nixpkgs/pkgs/applications/science/electronics/bitscope/packages.nix b/nixpkgs/pkgs/applications/science/electronics/bitscope/packages.nix
new file mode 100644
index 000000000000..11e1ed524ed2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/bitscope/packages.nix
@@ -0,0 +1,146 @@
+{ callPackage
+, fetchurl
+}:
+
+let
+  mkBitscope = callPackage (import ./common.nix) { };
+in {
+  chart = let
+    toolName = "bitscope-chart";
+    version = "2.0.FK22M";
+  in mkBitscope {
+    inherit toolName version;
+
+    meta = {
+      description = "Multi-channel waveform data acquisition and chart recording application";
+      homepage = "http://bitscope.com/software/chart/";
+    };
+
+    src = fetchurl {
+      url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
+      sha256 = "08mc82pjamyyyhh15sagsv0sc7yx5v5n54bg60fpj7v41wdwrzxw";
+    };
+  };
+
+  console = let
+    toolName = "bitscope-console";
+    version = "1.0.FK29A";
+  in mkBitscope {
+    # NOTE: this is meant as a demo by BitScope
+    inherit toolName version;
+
+    meta = {
+      description = "Demonstrative communications program designed to make it easy to talk to any model BitScope";
+    };
+
+    src = fetchurl {
+      url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
+      sha256 = "00b4gxwz7w6pmfrcz14326b24kl44hp0gzzqcqxwi5vws3f0y49d";
+    };
+  };
+
+  display = let
+    toolName = "bitscope-display";
+    version = "1.0.EC17A";
+  in mkBitscope {
+    inherit toolName version;
+
+    meta = {
+      description = "Display diagnostic application for BitScope";
+      homepage = "http://bitscope.com/software/display/";
+    };
+
+    src = fetchurl {
+      url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
+      sha256 = "05xr5mnka1v3ibcasg74kmj6nlv1nmn3lca1wv77whkq85cmz0s1";
+    };
+  };
+
+  dso = let
+    toolName = "bitscope-dso";
+    version = "2.8.FE22H";
+  in mkBitscope {
+    inherit toolName version;
+
+    meta = {
+      description = "Test and measurement software for BitScope";
+      homepage = "http://bitscope.com/software/dso/";
+    };
+
+    src = fetchurl {
+      url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
+      sha256 = "0fc6crfkprj78dxxhvhbn1dx1db5chm0cpwlqpqv8sz6whp12mcj";
+    };
+  };
+
+  logic = let
+    toolName = "bitscope-logic";
+    version = "1.2.FC20C";
+  in mkBitscope {
+    inherit toolName version;
+
+    meta = {
+      description = "Mixed signal logic timing and serial protocol analysis software for BitScope";
+      homepage = "http://bitscope.com/software/logic/";
+    };
+
+    src = fetchurl {
+      url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
+      sha256 = "0lkb7z9gfkiyxdwh4dq1zxfls8gzdw0na1vrrbgnxfg3klv4xns3";
+    };
+  };
+
+  meter = let
+    toolName = "bitscope-meter";
+    version = "2.0.FK22G";
+  in mkBitscope {
+    inherit toolName version;
+
+    meta = {
+      description = "Automated oscilloscope, voltmeter and frequency meter for BitScope";
+      homepage = "http://bitscope.com/software/logic/";
+    };
+
+    src = fetchurl {
+      url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
+      sha256 = "0nirbci6ymhk4h4bck2s4wbsl5r9yndk2jvvv72zwkg21248mnbp";
+    };
+  };
+
+  proto = let
+    toolName = "bitscope-proto";
+    version = "0.9.FG13B";
+  in mkBitscope {
+    inherit toolName version;
+    # NOTE: this is meant as a demo by BitScope
+    # NOTE: clicking on logo produces error
+    # TApplication.HandleException Executable not found: "http://bitscope.com/blog/DK/?p=DK15A"
+
+    meta = {
+      description = "Demonstrative prototype oscilloscope built using the BitScope Library";
+      homepage = "http://bitscope.com/blog/DK/?p=DK15A";
+    };
+
+    src = fetchurl {
+      url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
+      sha256 = "1ybjfbh3narn29ll4nci4b7rnxy0hj3wdfm4v8c6pjr8pfvv9spy";
+    };
+  };
+
+  server = let
+    toolName = "bitscope-server";
+    version = "1.0.FK26A";
+  in mkBitscope {
+    inherit toolName version;
+
+    meta = {
+      description = "Remote access server solution for any BitScope";
+      homepage = "http://bitscope.com/software/server/";
+    };
+
+    src = fetchurl {
+      url = "http://bitscope.com/download/files/${toolName}_${version}_amd64.deb";
+      sha256 = "1079n7msq6ks0n4aasx40rd4q99w8j9hcsaci71nd2im2jvjpw9a";
+    };
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/caneda/default.nix b/nixpkgs/pkgs/applications/science/electronics/caneda/default.nix
new file mode 100644
index 000000000000..4a4cf61c7f65
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/caneda/default.nix
@@ -0,0 +1,25 @@
+{ mkDerivation, lib, fetchFromGitHub, cmake, qtbase, qttools, qtsvg, qwt6_1}:
+
+mkDerivation rec {
+  pname = "caneda";
+  version = "0.3.1";
+
+  src = fetchFromGitHub {
+    owner = "Caneda";
+    repo = "Caneda";
+    rev = version;
+    sha256 = "0hx8qid50j9xvg2kpbpqmbdyakgyjn6m373m1cvhp70v2gp1v8l2";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ qtbase qttools qtsvg qwt6_1 ];
+
+  meta = {
+    description = "Open source EDA software focused on easy of use and portability";
+    mainProgram = "caneda";
+    homepage = "http://caneda.org";
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [viric];
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/caneda/gcc6.patch b/nixpkgs/pkgs/applications/science/electronics/caneda/gcc6.patch
new file mode 100644
index 000000000000..04c8f4502b2d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/caneda/gcc6.patch
@@ -0,0 +1,13 @@
+diff --git c/src/cgraphicsscene.cpp i/src/cgraphicsscene.cpp
+index ac2929a..c399706 100644
+--- c/src/cgraphicsscene.cpp
++++ i/src/cgraphicsscene.cpp
+@@ -1436,7 +1436,7 @@ namespace Caneda
+             QPointF newPos = m_currentWiringWire->mapFromScene(pos);
+             QPointF refPos = m_currentWiringWire->port1()->pos();
+ 
+-            if( abs(refPos.x()-newPos.x()) > abs(refPos.y()-newPos.y()) ) {
++            if( (refPos.x()-newPos.x()) > (refPos.y()-newPos.y()) ) {
+                 m_currentWiringWire->movePort2(QPointF(newPos.x(), refPos.y()));
+             }
+             else {
diff --git a/nixpkgs/pkgs/applications/science/electronics/csxcad/default.nix b/nixpkgs/pkgs/applications/science/electronics/csxcad/default.nix
new file mode 100644
index 000000000000..83ee992f4b28
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/csxcad/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, fparser
+, tinyxml
+, hdf5
+, cgal
+, vtk
+, boost
+, gmp
+, mpfr
+}:
+
+stdenv.mkDerivation rec {
+  pname = "csxcad";
+  version = "0.6.3";
+
+  src = fetchFromGitHub {
+    owner = "thliebig";
+    repo = "CSXCAD";
+    rev = "v${version}";
+    sha256 = "sha256-SSV5ulx3rCJg99I/oOQbqe+gOSs+BfcCo6UkWHVhnSs=";
+  };
+
+  patches = [./searchPath.patch ];
+
+  buildInputs = [
+    cgal
+    boost
+    gmp
+    mpfr
+    vtk
+    fparser
+    tinyxml
+    hdf5
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "A C++ library to describe geometrical objects";
+    homepage = "https://github.com/thliebig/CSXCAD";
+    license = licenses.lgpl3;
+    maintainers = with maintainers; [ matthuszagh ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/csxcad/searchPath.patch b/nixpkgs/pkgs/applications/science/electronics/csxcad/searchPath.patch
new file mode 100644
index 000000000000..2fc0d77b3202
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/csxcad/searchPath.patch
@@ -0,0 +1,11 @@
+--- CSXCAD/matlab/searchBinary.m	2019-07-14 09:24:02.154291745 -0700
++++ CSXCAD/matlab/searchBinary.m	2019-07-14 09:20:20.900248280 -0700
+@@ -33,7 +33,7 @@
+
+ % try all search paths
+ for n=1:numel(searchpath)
+-    binary_location = [searchpath{n} name];
++    binary_location = [searchpath{n} filesep name];
+     if exist(binary_location, 'file')
+         return
+     end
diff --git a/nixpkgs/pkgs/applications/science/electronics/dataexplorer/default.nix b/nixpkgs/pkgs/applications/science/electronics/dataexplorer/default.nix
new file mode 100644
index 000000000000..aa471d2bfcaf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/dataexplorer/default.nix
@@ -0,0 +1,66 @@
+{ lib
+, stdenv
+, fetchurl
+, jdk
+, ant
+, makeWrapper
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dataexplorer";
+  version = "3.8.5";
+
+  src = fetchurl {
+    url = "mirror://savannah/dataexplorer/dataexplorer-${version}-src.tar.gz";
+    sha256 = "sha256-b68xIZNbzHdPyZwLngcnjcoBtI6AeTdrblz/qx/HbGQ=";
+  };
+
+  nativeBuildInputs = [ ant makeWrapper ];
+
+  buildInputs = [ jdk ];
+
+  buildPhase = ''
+    ant -f build/build.xml dist
+  '';
+
+  doCheck = false;
+  # Missing dependencies (e.g. junit). Does not work.
+  #checkPhase = ''
+  #  ant -f build/build.xml check
+  #'';
+
+  installPhase = ''
+    ant -Dprefix=$out/share/ -f build/build.xml install
+
+    # The sources contain a wrapper script in $out/share/DataExplorer/DataExplorer
+    # but it hardcodes bash shebang and does not pin the java path.
+    # So we create our own wrapper, using similar cmdline args as upstream.
+    mkdir -p $out/bin
+    makeWrapper ${jdk}/bin/java $out/bin/DataExplorer \
+      --add-flags "-Xms64m -Xmx3092m -jar $out/share/DataExplorer/DataExplorer.jar" \
+      --set SWT_GTK3 0
+
+    makeWrapper ${jdk}/bin/java $out/bin/DevicePropertiesEditor \
+      --add-flags "-Xms32m -Xmx512m -classpath $out/share/DataExplorer/DataExplorer.jar gde.ui.dialog.edit.DevicePropertiesEditor" \
+      --set SWT_GTK3 0 \
+      --set LIBOVERLAY_SCROLLBAR 0
+
+    install -Dvm644 build/misc/GNU_LINUX_JUNSI_ICHARER_USB_UDEV_RULE/50-Junsi-iCharger-USB.rules \
+      $out/etc/udev/rules.d/50-Junsi-iCharger-USB.rules
+    install -Dvm644 build/misc/GNU_LINUX_SKYRC_UDEV_RULE/50-SkyRC-Charger.rules \
+      $out/etc/udev/rules.d/50-SkyRC-Charger.rules
+  '';
+
+  meta = with lib; {
+    description = "Graphical tool to analyze data, gathered from various hardware devices";
+    homepage = "https://www.nongnu.org/dataexplorer/index.html";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ panicgh ];
+    platforms = [ "x86_64-linux" ];
+    sourceProvenance = with sourceTypes; [
+      fromSource
+      binaryNativeCode  # contains RXTXcomm (JNI library with *.so files)
+      binaryBytecode    # contains thirdparty jar files, e.g. javax.json, org.glassfish.json
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/degate/default.nix b/nixpkgs/pkgs/applications/science/electronics/degate/default.nix
new file mode 100644
index 000000000000..30ded5d1354f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/degate/default.nix
@@ -0,0 +1,76 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, boost
+, qtbase
+, qtimageformats
+, qttools
+, wrapQtAppsHook
+}:
+
+let
+  boost_static = boost.override { enableStatic = true; };
+
+in stdenv.mkDerivation rec {
+  pname = "degate";
+  version = "2.0.0";
+
+  src = fetchFromGitHub {
+    owner = "DegateCommunity";
+    repo = "Degate";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-INoA3Z6ya03ZMn6E+nOCkXZLoxoo2WgPDw9v5miI09A=";
+  };
+
+  patches = [
+    # bump bundled catch2 to avoid incompatibility with modern glibc
+    (fetchpatch {
+      name = "catch2-2.13.9.patch";
+      url = "https://github.com/DegateCommunity/Degate/commit/06346dde4312cbb867854899eacf58679d6ac7e2.patch";
+      includes = [ "tests/catch2/catch.hpp" ];
+      hash = "sha256-SbSA813QI8RRVy1lvAOGMGAC2KUQKjwYR2imqX40pvU=";
+    })
+  ];
+
+  postPatch = ''
+    sed -i -E '/(_OUTPUT_DIRECTORY|DESTINATION)/s|\bout/||g' CMakeLists.txt
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    qttools
+    wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    boost_static
+    qtbase
+  ];
+
+  doCheck = true;
+  checkPhase = ''
+    runHook preCheck
+
+    (
+      cd tests/out/bin
+
+      # provide qtimageformats plugin to allow tests to read tiff files
+      export QT_PLUGIN_PATH="${qtimageformats}/${qtbase.qtPluginPrefix}"
+
+      ./DegateTests
+    )
+
+    runHook postCheck
+  '';
+
+  meta = with lib; {
+    description = "A modern and open-source cross-platform software for chips reverse engineering";
+    mainProgram = "Degate";
+    homepage = "https://degate.readthedocs.io/";
+    license = licenses.gpl3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ris ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/digital/default.nix b/nixpkgs/pkgs/applications/science/electronics/digital/default.nix
new file mode 100644
index 000000000000..41deecbb6224
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/digital/default.nix
@@ -0,0 +1,68 @@
+{ lib, fetchFromGitHub, makeDesktopItem, copyDesktopItems, makeWrapper
+, jre, maven
+}:
+
+let
+  pkgDescription = "A digital logic designer and circuit simulator.";
+  version = "0.30";
+  buildDate = "2023-02-03T08:00:56+01:00"; # v0.30 commit date
+
+  desktopItem = makeDesktopItem {
+    type = "Application";
+    name = "Digital";
+    desktopName = pkgDescription;
+    comment = "Easy-to-use digital logic designer and circuit simulator";
+    exec = "digital";
+    icon = "digital";
+    categories = [ "Education" "Electronics" ];
+    mimeTypes = [ "text/x-digital" ];
+    terminal = false;
+    keywords = [ "simulator" "digital" "circuits" ];
+  };
+
+  # Use the "no-git-rev" maven profile, which deactivates the plugin that
+  # inspect the .git folder to find the version number we are building, we then
+  # provide that version number manually as a property.
+  # (see https://github.com/hneemann/Digital/issues/289#issuecomment-513721481)
+  # Also use the commit date as a build and output timestamp.
+  mvnParameters = "-Pno-git-rev -Dgit.commit.id.describe=${version} -Dproject.build.outputTimestamp=${buildDate} -DbuildTimestamp=${buildDate}";
+in
+maven.buildMavenPackage rec {
+  pname = "digital";
+  inherit version jre;
+
+  src = fetchFromGitHub {
+    owner = "hneemann";
+    repo = "Digital";
+    rev = "v${version}";
+    hash = "sha256-cDykYlcFvDLFBy9UnX07iCR2LCq28SNU+h9vRT/AoJM=";
+  };
+
+  inherit mvnParameters;
+  mvnHash = "sha256-wm/axWJucoW9P98dKqHI4bjrUnmBTfosCOdJg9VBJ+4=";
+
+  nativeBuildInputs = [ copyDesktopItems makeWrapper ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mkdir -p $out/share/java
+
+    classpath=$(find $mvnDeps/.m2 -name "*.jar" -printf ':%h/%f');
+    install -Dm644 target/Digital.jar $out/share/java
+
+    makeWrapper ${jre}/bin/java $out/bin/${pname} \
+      --add-flags "-classpath $out/share/java/${pname}-${version}.jar:''${classpath#:}" \
+      --add-flags "-jar $out/share/java/Digital.jar"
+  '';
+
+  desktopItems = [ desktopItem ];
+
+  meta = with lib; {
+    homepage = "https://github.com/hneemann/Digital";
+    description = pkgDescription;
+    mainProgram = "digital";
+    license = licenses.gpl3Only;
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+    maintainers = with maintainers; [ Dettorer ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/diylc/default.nix b/nixpkgs/pkgs/applications/science/electronics/diylc/default.nix
new file mode 100644
index 000000000000..ced8c72d2155
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/diylc/default.nix
@@ -0,0 +1,78 @@
+{ lib, stdenv, fetchurl, makeDesktopItem, unzip, bash, jre8 }:
+
+let
+  pname = "diylc";
+  version = "4.18.0";
+  files = {
+    app = fetchurl {
+      url = "https://github.com/bancika/diy-layout-creator/releases/download/v${version}/diylc-${version}.zip";
+      sha256 = "09fpp3dn086clgnjz5yj4fh5bnjvj6mvxkx9n3zamcwszjmxr40d";
+    };
+    icon16 = fetchurl {
+      url = "https://raw.githubusercontent.com/bancika/diy-layout-creator/v${version}/diylc/diylc-core/src/org/diylc/core/images/icon_small.png";
+      sha256 = "1is50aidfwzwfzwqv57s2hwhx0r5c21cp77bkl93xkdqkh2wd8x4";
+    };
+    icon32 = fetchurl {
+      url = "https://raw.githubusercontent.com/bancika/diy-layout-creator/v${version}/diylc/diylc-core/src/org/diylc/core/images/icon_medium.png";
+      sha256 = "0a45p18n84xz1nd3zv3y16jlimvqzhbzg3q3f4lawgx4rcrn2n3d";
+    };
+    icon48 = fetchurl {
+      url = "https://raw.githubusercontent.com/bancika/diy-layout-creator/v${version}/diylc/diylc-core/src/org/diylc/core/images/icon_large.png";
+      sha256 = "06dkz0dcy8hfmnzr5ri5n1sh8r7mg83kzbvs3zy58wwhgzs1ddk6";
+    };
+  };
+  launcher = makeDesktopItem {
+    name = "diylc";
+    desktopName = "DIY Layout Creator";
+    comment = "Multi platform circuit layout and schematic drawing tool";
+    exec = "diylc";
+    icon = "diylc_icon";
+    categories = [ "Development" "Electronics" ];
+  };
+in
+stdenv.mkDerivation rec {
+  inherit pname version;
+
+  dontUnpack = true;
+
+  buildInputs = [ jre8 ];
+  nativeBuildInputs = [ unzip ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/share/diylc
+    unzip -UU ${files.app} -d $out/share/diylc
+    rm $out/share/diylc/diylc.exe
+    rm $out/share/diylc/run.sh
+
+    # Nope, the icon cannot be named 'diylc' because KDE does not like it.
+    install -Dm644 ${files.icon16} $out/share/icons/hicolor/16x16/apps/diylc_icon.png
+    install -Dm644 ${files.icon32} $out/share/icons/hicolor/32x32/apps/diylc_icon.png
+    install -Dm644 ${files.icon48} $out/share/icons/hicolor/48x48/apps/diylc_icon.png
+
+    mkdir -p $out/share/applications
+    ln -s ${launcher}/share/applications/* $out/share/applications/
+
+    mkdir -p $out/bin
+    cat <<EOF > $out/bin/diylc
+    #!${bash}/bin/sh
+    cd $out/share/diylc
+    ${jre8}/bin/java -Xms512m -Xmx2048m -Dorg.diylc.scriptRun=true -Dfile.encoding=UTF-8 -cp diylc.jar:lib org.diylc.DIYLCStarter
+    EOF
+    chmod +x $out/bin/diylc
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Multi platform circuit layout and schematic drawing tool";
+    mainProgram = "diylc";
+    homepage = "https://bancika.github.io/diy-layout-creator/";
+    changelog = "https://github.com/bancika/diy-layout-creator/releases";
+    license = licenses.gpl3Plus;
+    sourceProvenance = with sourceTypes; [ binaryBytecode ];
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/dsview/default.nix b/nixpkgs/pkgs/applications/science/electronics/dsview/default.nix
new file mode 100644
index 000000000000..3c8e7ad19064
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/dsview/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, lib, fetchFromGitHub, pkg-config, cmake, wrapQtAppsHook
+, libzip, boost, fftw, qtbase, qtwayland, qtsvg, libusb1
+, python3, fetchpatch, desktopToDarwinBundle
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dsview";
+
+  version = "1.3.1";
+
+  src = fetchFromGitHub {
+      owner = "DreamSourceLab";
+      repo = "DSView";
+      rev = "v${version}";
+      sha256 = "sha256-LwrlB+Nwq34YjwGmnbUWS3W//ZHr8Do2Wf2te+2oBeI=";
+  };
+
+  patches = [
+    # Fix absolute install paths
+    ./install.patch
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ]
+    ++ lib.optional stdenv.isDarwin desktopToDarwinBundle;
+
+  buildInputs = [
+    boost fftw qtbase qtsvg libusb1 libzip
+    python3
+  ] ++ lib.optional stdenv.isLinux qtwayland;
+
+  meta = with lib; {
+    description = "A GUI program for supporting various instruments from DreamSourceLab, including logic analyzer, oscilloscope, etc";
+    mainProgram = "DSView";
+    homepage = "https://www.dreamsourcelab.com/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ bachp carlossless ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/dsview/install.patch b/nixpkgs/pkgs/applications/science/electronics/dsview/install.patch
new file mode 100644
index 000000000000..9fc660bf8148
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/dsview/install.patch
@@ -0,0 +1,23 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index eb9be42..220817c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -662,16 +662,8 @@ install(FILES DSView/icons/logo.svg DESTINATION share/icons/hicolor/scalable/app
+ install(FILES DSView/icons/logo.svg DESTINATION share/pixmaps RENAME dsview.svg)
+ 
+ if(CMAKE_SYSTEM_NAME MATCHES "Linux")	
+-	install(FILES DSView/DSView.desktop DESTINATION /usr/share/applications RENAME dsview.desktop)
+-	
+-	if(IS_DIRECTORY /usr/lib/udev/rules.d)
+-		install(FILES DSView/DreamSourceLab.rules DESTINATION /usr/lib/udev/rules.d RENAME 60-dreamsourcelab.rules)
+-	elseif(IS_DIRECTORY /lib/udev/rules.d)
+-		install(FILES DSView/DreamSourceLab.rules DESTINATION /lib/udev/rules.d RENAME 60-dreamsourcelab.rules)
+-	elseif(IS_DIRECTORY /etc/udev/rules.d)
+-		install(FILES DSView/DreamSourceLab.rules DESTINATION /etc/udev/rules.d RENAME 60-dreamsourcelab.rules)
+-	endif()
+-
++	install(FILES DSView/DreamSourceLab.rules DESTINATION etc/udev/rules.d RENAME 60-dreamsourcelab.rules)
+ endif()
++install(FILES DSView/DSView.desktop DESTINATION share/applications RENAME dsview.desktop)
+ 
+ install(FILES NEWS25 DESTINATION share/DSView RENAME NEWS25)
diff --git a/nixpkgs/pkgs/applications/science/electronics/dwfv/default.nix b/nixpkgs/pkgs/applications/science/electronics/dwfv/default.nix
new file mode 100644
index 000000000000..2d88e2647dfd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/dwfv/default.nix
@@ -0,0 +1,21 @@
+{ lib, rustPlatform, fetchCrate }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "dwfv";
+  version = "0.4.1";
+
+  src = fetchCrate {
+    inherit version pname;
+    sha256 = "0xxgwbbbzaldbl04k5ksk61wa6i4f9mc84q04ljg438z0k8q6cr7";
+  };
+
+  cargoSha256 = "1z51yx3psdxdzmwny0rzlch5hjx2pssll73q79qij2bc7wgyjscy";
+
+  meta = with lib; {
+    description = "A simple digital waveform viewer with vi-like key bindings";
+    mainProgram = "dwfv";
+    homepage = "https://github.com/psurply/dwfv";
+    license = licenses.mit;
+    maintainers = with maintainers; [ newam ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/eagle/eagle.nix b/nixpkgs/pkgs/applications/science/electronics/eagle/eagle.nix
new file mode 100644
index 000000000000..6302c2dbfa38
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/eagle/eagle.nix
@@ -0,0 +1,81 @@
+{ lib, stdenv, mkDerivation, fetchurl, makeDesktopItem
+, libXrender, libXrandr, libXcursor, libX11, libXext, libXi, libxcb
+ , libGL, glib, nss, nspr, expat, alsa-lib
+, qtbase, qtdeclarative, qtsvg, qtlocation, qtwebchannel, qtwebengine
+}:
+
+let
+  libPath = lib.makeLibraryPath
+    [ libXrender libXrandr libXcursor libX11 libXext libXi libxcb
+      libGL glib nss nspr expat alsa-lib
+      qtbase qtdeclarative qtsvg qtlocation qtwebchannel qtwebengine
+    ];
+  in
+  mkDerivation rec {
+    pname = "eagle";
+    version = "9.6.2";
+
+    src = fetchurl {
+      url = "https://eagle-updates.circuits.io/downloads/${builtins.replaceStrings ["."] ["_"] version}/Autodesk_EAGLE_${version}_English_Linux_64bit.tar.gz";
+      sha256 = "18syygnskl286kn8aqfzzdsyzq59d2w19y1h1ynyxsnrvkyv71h0";
+    };
+
+    desktopItem = makeDesktopItem {
+      name = "eagle";
+      exec = "eagle";
+      icon = "eagle";
+      comment = "Schematic capture and PCB layout";
+      desktopName = "Eagle";
+      genericName = "Schematic editor";
+      categories = [ "Development" ];
+    };
+
+    buildInputs =
+      [ libXrender libXrandr libXcursor libX11 libXext libXi libxcb
+        libGL glib nss nspr expat alsa-lib
+        qtbase qtdeclarative qtsvg qtlocation qtwebchannel qtwebengine
+      ];
+
+    installPhase = ''
+      # Extract eagle tarball
+      mkdir "$out"
+      tar -xzf "$src" -C "$out"
+
+      # Install manpage
+      mkdir -p "$out"/share/man/man1
+      ln -s "$out"/eagle-${version}/doc/eagle.1 "$out"/share/man/man1/eagle.1
+
+      patchelf \
+        --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+        --set-rpath "${libPath}:$out/eagle-${version}/lib:${stdenv.cc.cc.lib}/lib" \
+        "$out"/eagle-${version}/eagle
+
+      mkdir -p "$out"/bin
+      ln -s "$out"/eagle-${version}/eagle "$out"/bin/eagle
+
+      # Remove bundled libraries that are available in nixpkgs
+      # TODO: There still may be unused bundled libraries
+      rm "$out"/eagle-${version}/lib/libQt5*.so.5
+      rm "$out"/eagle-${version}/lib/{libxcb-*.so.*,libX*.so.*,libxshmfence.so.1}
+      rm "$out"/eagle-${version}/lib/{libEGL.so.1,libglapi.so.0,libgbm.so.1}
+
+      # No longer needed (we don't use the bundled Qt libraries)
+      rm -r "$out"/eagle-${version}/libexec
+      rm -r "$out"/eagle-${version}/plugins
+
+      # Make desktop item
+      mkdir -p "$out"/share/applications
+      cp "$desktopItem"/share/applications/* "$out"/share/applications/
+      mkdir -p "$out"/share/pixmaps
+      ln -s "$out/eagle-${version}/bin/eagle-logo.png" "$out"/share/pixmaps/eagle.png
+    '';
+
+    meta = with lib; {
+      description = "Schematic editor and PCB layout tool from Autodesk (formerly CadSoft)";
+      homepage = "https://www.autodesk.com/products/eagle/overview";
+      sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+      license = licenses.unfree;
+      platforms = [ "x86_64-linux" ];
+      maintainers = [ ];
+    };
+  }
diff --git a/nixpkgs/pkgs/applications/science/electronics/eagle/eagle7_fixer.c b/nixpkgs/pkgs/applications/science/electronics/eagle/eagle7_fixer.c
new file mode 100644
index 000000000000..da9da4dcbd3a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/eagle/eagle7_fixer.c
@@ -0,0 +1,134 @@
+/*
+ * LD_PRELOAD trick to make Eagle (schematic editor and PCB layout tool from
+ * CadSoft) work from a read-only installation directory.
+ *
+ * When Eagle starts, it looks for the license file in <eagle>/bin/eagle.key
+ * (where <eagle> is the install path). If eagle.key is not found, Eagle checks
+ * for write access to <eagle>/bin/, shows a license dialog to the user and
+ * then attempts to write a license file to <eagle>/bin/.
+ *
+ * This will of course fail when Eagle is installed in the read-only Nix store.
+ * Hence this library that redirects accesses to the those paths in the
+ * following way:
+ *
+ *   <eagle>/bin              => $HOME
+ *   <eagle>/bin/eagle.key    => $HOME/.eagle.key
+ *
+ * Also, if copying an example project to ~/eagle/ (in the Eagle GUI), Eagle
+ * chmod's the destination with read-only permission bits (presumably because
+ * the source is read-only) and fails to complete the copy operation.
+ * Therefore, the mode argument in calls to chmod() is OR'ed with the S_IWUSR
+ * bit (write by owner).
+ *
+ * Usage:
+ *   gcc -shared -fPIC -DEAGLE_PATH="$out/eagle-${version}" eagle_fixer.c -o eagle_fixer.so -ldl
+ *   LD_PRELOAD=$PWD/eagle_fixer.so ./result/bin/eagle
+ *
+ * To see the paths that are modified at runtime, set the environment variable
+ * EAGLE_FIXER_DEBUG to 1.
+ */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <dlfcn.h>
+#include <limits.h>
+#include <sys/stat.h>
+
+#ifndef EAGLE_PATH
+#error Missing EAGLE_PATH, path to the eagle-${version} installation directory.
+#endif
+
+typedef FILE *(*fopen_func_t)(const char *path, const char *mode);
+typedef int (*access_func_t)(const char *pathname, int mode);
+typedef int (*chmod_func_t)(const char *path, mode_t mode);
+
+/*
+ * Map <eagle>/bin to $HOME and <eagle>/bin/eagle.key to $HOME/.eagle.key
+ *
+ * Path is truncated if bigger than PATH_MAX. It's not threadsafe, but that's
+ * OK.
+ */
+static const char *redirect(const char *pathname)
+{
+	static char buffer[PATH_MAX];
+	const char *homepath;
+	const char *new_path;
+	static int have_warned;
+
+	homepath = getenv("HOME");
+	if (!homepath) {
+		homepath = "/";
+		if (!have_warned && getenv("EAGLE_FIXER_DEBUG")) {
+			fprintf(stderr, "eagle_fixer: HOME is unset, using \"/\" (root) instead.\n");
+			have_warned = 1;
+		}
+	}
+
+	new_path = pathname;
+	if (strcmp(EAGLE_PATH "/bin", pathname) == 0) {
+		/* redirect to $HOME */
+		new_path = homepath;
+	} else if (strcmp(EAGLE_PATH "/bin/eagle.key", pathname) == 0) {
+		/* redirect to $HOME/.eagle.key */
+		snprintf(buffer, PATH_MAX, "%s/.eagle.key", homepath);
+		buffer[PATH_MAX-1] = '\0';
+		new_path = buffer;
+	}
+
+	return new_path;
+}
+
+FILE *fopen(const char *pathname, const char *mode)
+{
+	FILE *fp;
+	const char *path;
+	fopen_func_t orig_fopen;
+
+	orig_fopen = (fopen_func_t)dlsym(RTLD_NEXT, "fopen");
+	path = redirect(pathname);
+	fp = orig_fopen(path, mode);
+
+	if (path != pathname && getenv("EAGLE_FIXER_DEBUG")) {
+		fprintf(stderr, "eagle_fixer: fopen(\"%s\", \"%s\") => \"%s\": fp=%p\n", pathname, mode, path, fp);
+	}
+
+	return fp;
+}
+
+int access(const char *pathname, int mode)
+{
+	int ret;
+	const char *path;
+	access_func_t orig_access;
+
+	orig_access = (access_func_t)dlsym(RTLD_NEXT, "access");
+	path = redirect(pathname);
+	ret = orig_access(path, mode);
+
+	if (path != pathname && getenv("EAGLE_FIXER_DEBUG")) {
+		fprintf(stderr, "eagle_fixer: access(\"%s\", %d) => \"%s\": ret=%d\n", pathname, mode, path, ret);
+	}
+
+	return ret;
+}
+
+int chmod(const char *pathname, mode_t mode)
+{
+	int ret;
+	mode_t new_mode;
+	chmod_func_t orig_chmod;
+
+	orig_chmod = (chmod_func_t)dlsym(RTLD_NEXT, "chmod");
+	new_mode = mode | S_IWUSR;
+	ret = orig_chmod(pathname, new_mode);
+
+	if (getenv("EAGLE_FIXER_DEBUG")) {
+		fprintf(stderr, "eagle_fixer: chmod(\"%s\", %o) => %o: ret=%d\n", pathname, mode, new_mode, ret);
+	}
+
+	return ret;
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/flatcam/default.nix b/nixpkgs/pkgs/applications/science/electronics/flatcam/default.nix
new file mode 100644
index 000000000000..2235cf0b4a33
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/flatcam/default.nix
@@ -0,0 +1,104 @@
+{ lib
+, fetchFromBitbucket
+, buildPythonApplication
+, pyqt5
+, matplotlib
+, numpy
+, cycler
+, python-dateutil
+, kiwisolver
+, six
+, setuptools
+, dill
+, rtree
+, pyopengl
+, vispy
+, ortools
+, svg-path
+, simplejson
+, shapely
+, freetype-py
+, fonttools
+, rasterio
+, lxml
+, ezdxf
+, qrcode
+, reportlab
+, svglib
+, gdal
+, pyserial
+, python3
+}:
+
+buildPythonApplication rec {
+  pname = "flatcam";
+  version = "unstable-2022-02-02";
+
+  src = fetchFromBitbucket {
+    owner = "jpcgt";
+    repo = pname;
+    rev = "ebf5cb9e3094362c4b0774a54cf119559c02211d"; # beta branch as of 2022-02-02
+    hash = "sha256-QKkBPEM+HVYmSZ83b4JRmOmCMp7C3EUqbJKPqUXMiKE=";
+  };
+
+  format = "other";
+
+  dontBuild = true;
+
+  propagatedBuildInputs = [
+    pyqt5
+    matplotlib
+    numpy
+    cycler
+    python-dateutil
+    kiwisolver
+    six
+    setuptools
+    dill
+    rtree
+    pyopengl
+    vispy
+    ortools
+    svg-path
+    simplejson
+    shapely
+    freetype-py
+    fonttools
+    rasterio
+    lxml
+    ezdxf
+    qrcode
+    reportlab
+    svglib
+    gdal
+    pyserial
+  ];
+
+  preInstall = ''
+    patchShebangs .
+
+    sed -i "s|/usr/local/bin|$out/bin|" Makefile
+
+    mkdir -p $out/share/{flatcam,applications}
+    mkdir -p $out/bin
+  '';
+
+  installFlags = [
+    "USER_ID=0"
+    "LOCAL_PATH=/build/source/."
+    "INSTALL_PATH=${placeholder "out"}/share/flatcam"
+    "APPS_PATH=${placeholder "out"}/share/applications"
+  ];
+
+  postInstall = ''
+    sed -i "s|python3|${python3.withPackages (_: propagatedBuildInputs)}/bin/python3|" $out/bin/flatcam-beta
+    mv $out/bin/flatcam{-beta,}
+  '';
+
+  meta = with lib; {
+    description = "2-D post processing for PCB fabrication on CNC routers";
+    homepage = "https://bitbucket.org/jpcgt/flatcam";
+    license = licenses.mit;
+    maintainers = with maintainers; [ trepetti ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/flopoco/default.nix b/nixpkgs/pkgs/applications/science/electronics/flopoco/default.nix
new file mode 100644
index 000000000000..7ce1087209e2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/flopoco/default.nix
@@ -0,0 +1,93 @@
+{ lib
+, stdenv
+, fetchFromGitLab
+, fetchpatch
+, cmake
+, installShellFiles
+, bison
+, boost
+, flex
+, gmp
+, libxml2
+, mpfi
+, mpfr
+, scalp
+, sollya
+, wcpg
+}:
+
+stdenv.mkDerivation rec {
+  pname = "flopoco";
+  version = "4.1.3";
+
+  src = fetchFromGitLab {
+    owner = pname;
+    repo = pname;
+    # flopoco-4.1.3 is not tagged on GitLab
+    rev = "67598298207c9f3261c35679c8a5966480c4343c";
+    sha256 = "sha256-0jRjg4/qciqBcjsi6BTbKO4VJkcoEzpC98wFkUOIGbI=";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "fix-clang-error-sin-cos.patch";
+      url = "https://gitlab.com/flopoco/flopoco/-/commit/de3aa60ad19333952c176c2a2e51f12653ca736b.patch";
+      postFetch = ''
+        substituteInPlace $out \
+          --replace 'FixSinCosCORDIC.hpp' 'CordicSinCos.hpp'
+      '';
+      sha256 = "sha256-BlamA/MZuuqqvGYto+jPeQPop6gwva0y394Odw8pdwg=";
+    })
+    (fetchpatch {
+      name = "fix-clang-error-atan2.patch";
+      url = "https://gitlab.com/flopoco/flopoco/-/commit/a3ffe2436c1b59ee0809b3772b74f2d43c6edb99.patch";
+      sha256 = "sha256-dSYcufLHDL0p1V1ghmy6X6xse5f6mjUqckaVqLZnTaA=";
+    })
+  ];
+
+  postPatch = lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) ''
+    sed -i "s/-pg//g" {,src/Apps/TaMaDi/}CMakeLists.txt
+  '';
+
+  strictDeps = true;
+
+  nativeBuildInputs = [
+    bison
+    cmake
+    installShellFiles
+  ];
+
+  buildInputs = [
+    boost
+    flex
+    gmp
+    libxml2
+    mpfi
+    mpfr
+    scalp
+    sollya
+    wcpg
+  ];
+
+  postBuild = ''
+    ./flopoco BuildAutocomplete
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm755 flopoco $out/bin/flopoco
+    cp bin* fp* ieee* longacc* $out/bin/
+    installShellCompletion --bash flopoco_autocomplete
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "The FloPoCo arithmetic core generator";
+    homepage = "https://flopoco.org/";
+    license = licenses.unfree;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ wegank ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/fparser/default.nix b/nixpkgs/pkgs/applications/science/electronics/fparser/default.nix
new file mode 100644
index 000000000000..73db0575d0b1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/fparser/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fparser";
+  version = "unstable-2015-09-25";
+
+  src = fetchFromGitHub {
+    owner = "thliebig";
+    repo = "fparser";
+    rev = "a59e1f51e32096bfe2a0a2640d5dffc7ae6ba37b";
+    sha256 = "0wayml1mlyi922gp6am3fsidhzsilziksdn5kbnpcln01h8555ad";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "C++ Library for Evaluating Mathematical Functions";
+    homepage = "https://github.com/thliebig/fparser";
+    license = licenses.lgpl3;
+    maintainers = with maintainers; [ matthuszagh ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/fped/default.nix b/nixpkgs/pkgs/applications/science/electronics/fped/default.nix
new file mode 100644
index 000000000000..6d10426b298a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/fped/default.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchgit
+, flex, bison, fig2dev, imagemagick, netpbm, gtk2
+, pkg-config
+}:
+
+with lib;
+stdenv.mkDerivation {
+  pname = "fped";
+  version = "unstable-2017-05-11";
+
+  src = fetchgit {
+    url = "git://projects.qi-hardware.com/fped.git";
+    rev = "fa98e58157b6f68396d302c32421e882ac87f45b";
+    sha256 = "0xv364a00zwxhd9kg1z9sch5y0cxnrhk546asspyb9bh58sdzfy7";
+  };
+
+  # Workaround build failure on -fno-common toolchains:
+  #   ld: postscript.o:postscript.h:29: multiple definition of
+  #     `postscript_params'; fped.o:postscript.h:29: first defined here
+  env.NIX_CFLAGS_COMPILE = "-fcommon";
+
+  # This uses '/bin/bash', '/usr/local' and 'lex' by default
+  makeFlags = [
+    "PREFIX=${placeholder "out"}"
+    "LEX=flex"
+    "RGBDEF=${netpbm.out}/share/netpbm/misc/rgb.txt"
+  ];
+
+  nativeBuildInputs = [
+    flex
+    bison
+    pkg-config
+    imagemagick
+    fig2dev
+    netpbm
+  ];
+
+  buildInputs = [
+    gtk2
+  ];
+
+  meta = {
+    description = "An editor that allows the interactive creation of footprints electronic components";
+    mainProgram = "fped";
+    homepage = "http://projects.qi-hardware.com/index.php/p/fped/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ expipiplus1 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/fritzing/default.nix b/nixpkgs/pkgs/applications/science/electronics/fritzing/default.nix
new file mode 100644
index 000000000000..955edb9b59ae
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/fritzing/default.nix
@@ -0,0 +1,119 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, wrapQtAppsHook
+, qmake
+, pkg-config
+, qtbase
+, qtsvg
+, qttools
+, qtserialport
+, qtwayland
+, qt5compat
+, boost
+, libngspice
+, libgit2
+, quazip
+, clipper
+}:
+
+let
+  # SHA256 of the fritzing-parts HEAD on the master branch,
+  # which contains the latest stable parts definitions
+  partsSha = "015626e6cafb1fc7831c2e536d97ca2275a83d32";
+
+  parts = fetchFromGitHub {
+    owner = "fritzing";
+    repo = "fritzing-parts";
+    rev = partsSha;
+    hash = "sha256-5jw56cqxpT/8bf1q551WG53J6Lw5pH0HEtRUoNNMc+A=";
+  };
+
+  # Header-only library
+  svgpp = fetchFromGitHub {
+    owner = "svgpp";
+    repo = "svgpp";
+    rev = "v1.3.0";
+    hash = "sha256-kJEVnMYnDF7bThDB60bGXalYgpn9c5/JCZkRSK5GoE4=";
+  };
+in
+
+stdenv.mkDerivation {
+  pname = "fritzing";
+  version = "1.0.2";
+
+  src = fetchFromGitHub {
+    owner = "fritzing";
+    repo = "fritzing-app";
+    rev = "dbdbe34c843677df721c7b3fc3e32c0f737e7e95";
+    hash = "sha256-Xi5sPU2RGkqh7T+EOvwxJJKKYDhJfccyEZ8LBBTb2s4=";
+  };
+
+  nativeBuildInputs = [ qmake pkg-config qttools wrapQtAppsHook ];
+  buildInputs = [
+    qtbase
+    qtsvg
+    qtserialport
+    qt5compat
+    boost
+    libgit2
+    quazip
+    libngspice
+    clipper
+  ] ++ lib.optionals stdenv.isLinux [
+    qtwayland
+  ];
+
+  postPatch = ''
+    # Use packaged quazip, libgit and ngspice
+    sed -i "/pri\/quazipdetect.pri/d" phoenix.pro
+    sed -i "/pri\/spicedetect.pri/d" phoenix.pro
+    substituteInPlace pri/libgit2detect.pri \
+      --replace-fail 'LIBGIT_STATIC = true' 'LIBGIT_STATIC = false'
+
+    #TODO: Do not hardcode SHA.
+    substituteInPlace src/fapplication.cpp \
+      --replace-fail 'PartsChecker::getSha(dir.absolutePath());' '"${partsSha}";'
+
+    substituteInPlace phoenix.pro \
+      --replace-fail "6.5.10" "${qtbase.version}"
+
+    mkdir parts
+    cp -a ${parts}/* parts/
+  '';
+
+  env.NIX_CFLAGS_COMPILE = lib.concatStringsSep " " [
+    "-I${lib.getDev quazip}/include/QuaZip-Qt${lib.versions.major qtbase.version}-${quazip.version}"
+    "-I${svgpp}/include"
+    "-I${clipper}/include/polyclipping"
+  ];
+  env.NIX_LDFLAGS = "-lquazip1-qt${lib.versions.major qtbase.version}";
+
+  qmakeFlags = [
+    "phoenix.pro"
+  ];
+
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    mkdir $out/Applications
+    mv $out/bin/Fritzing.app $out/Applications/Fritzing.app
+    cp FritzingInfo.plist $out/Applications/Fritzing.app/Contents/Info.plist
+    makeWrapper $out/Applications/Fritzing.app/Contents/MacOS/Fritzing $out/bin/Fritzing
+  '';
+
+  postFixup = ''
+    # generate the parts.db file
+    QT_QPA_PLATFORM=offscreen "$out/bin/Fritzing" \
+      -db "$out/share/fritzing/parts/parts.db" \
+      -pp "$out/share/fritzing/parts" \
+      -folder "$out/share/fritzing"
+  '';
+
+  meta = with lib; {
+    description = "An open source prototyping tool for Arduino-based projects";
+    homepage = "https://fritzing.org/";
+    license = with licenses; [ gpl3 cc-by-sa-30 ];
+    maintainers = with maintainers; [ robberer muscaln ];
+    platforms = platforms.unix;
+    mainProgram = "Fritzing";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/gaw/default.nix b/nixpkgs/pkgs/applications/science/electronics/gaw/default.nix
new file mode 100644
index 000000000000..5dec368f454c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/gaw/default.nix
@@ -0,0 +1,35 @@
+{ stdenv
+, fetchurl
+, lib
+, gtk3
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gaw";
+  version = "20220315";
+
+  src = fetchurl {
+    url = "https://download.tuxfamily.org/gaw/download/gaw3-${version}.tar.gz";
+    sha256 = "0j2bqi9444s1mfbr7x9rqp232xf7ab9z7ifsnl305jsklp6qmrbg";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ gtk3 ];
+
+  meta = with lib; {
+    description = "Gtk Analog Wave viewer";
+    mainProgram = "gaw";
+    longDescription = ''
+      Gaw is a software tool for displaying analog waveforms from
+      sampled datas, for example from the output of simulators or
+      input from sound cards. Data can be imported to gaw using files,
+      direct tcp/ip connection or directly from the sound card.
+    '';
+    homepage = "http://gaw.tuxfamily.org";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ fbeffa ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/geda/default.nix b/nixpkgs/pkgs/applications/science/electronics/geda/default.nix
new file mode 100644
index 000000000000..160928633a3c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/geda/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, groff, pkg-config, guile, gtk2, flex, gawk, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "geda";
+  version = "1.10.2";
+
+  src = fetchurl {
+    url = "http://ftp.geda-project.org/geda-gaf/stable/v${lib.versions.majorMinor version}/${version}/geda-gaf-${version}.tar.gz";
+    hash = "sha256-6GKrJBUoU4+jvuJzkmH1aAERArYMXjmi8DWGY8BCyKQ=";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "geda-1.10.2-drop-xorn.patch";
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sci-electronics/geda/files/geda-1.10.2-drop-xorn.patch?id=5589cc7bc6c4f18f75c40725a550b8d76e7f5ca1";
+      hash = "sha256-jPQaHjEDwCEfZqDGku+xyIMl5WlWlVcpPv1W6Xf8Grs=";
+    })
+  ];
+
+  configureFlags = [
+    "--disable-update-xdg-database"
+    "--without-libfam"
+  ];
+
+  nativeBuildInputs = [ autoreconfHook groff pkg-config ];
+  buildInputs = [ guile gtk2 flex gawk perl ];
+
+  meta = with lib; {
+    description = "Full GPL'd suite of Electronic Design Automation tools";
+    homepage = "http://www.geda-project.org/";
+    maintainers = with maintainers; [ pjones ];
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/gerbv/default.nix b/nixpkgs/pkgs/applications/science/electronics/gerbv/default.nix
new file mode 100644
index 000000000000..5f178e08280a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/gerbv/default.nix
@@ -0,0 +1,56 @@
+{ lib
+, stdenv
+, autoconf
+, automake
+, autoreconfHook
+, cairo
+, fetchFromGitHub
+, gettext
+, gtk2-x11
+, libtool
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gerbv";
+  version = "2.10.0";
+
+  src = fetchFromGitHub {
+    owner = "gerbv";
+    repo = pname;
+    rev = "refs/tags/v${version}";
+    hash = "sha256-sr48RGLYcMKuyH9p+5BhnR6QpKBvNOqqtRryw3+pbBk=";
+  };
+
+  postPatch = ''
+    sed -i '/AC_INIT/s/m4_esyscmd.*/${version}])/' configure.ac
+  '';
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    autoreconfHook
+    pkg-config
+  ];
+
+  buildInputs = [
+    cairo
+    gettext
+    gtk2-x11
+    libtool
+  ];
+
+  configureFlags = [
+    "--disable-update-desktop-database"
+  ];
+
+  meta = with lib; {
+    description = "A Gerber (RS-274X) viewer";
+    mainProgram = "gerbv";
+    homepage = "https://gerbv.github.io/";
+    changelog = "https://github.com/gerbv/gerbv/releases/tag/v${version}";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ mog ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/gtkwave/0001-Fix-detection-of-quartz-in-gdk-3.0-target.patch b/nixpkgs/pkgs/applications/science/electronics/gtkwave/0001-Fix-detection-of-quartz-in-gdk-3.0-target.patch
new file mode 100644
index 000000000000..b28e0b8e9720
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/gtkwave/0001-Fix-detection-of-quartz-in-gdk-3.0-target.patch
@@ -0,0 +1,40 @@
+From 69a6ab80cf0908c2a44430c297932ef3659a1655 Mon Sep 17 00:00:00 2001
+From: Jiajie Chen <c@jia.je>
+Date: Wed, 22 Jun 2022 16:24:10 +0800
+Subject: [PATCH 1/2] Fix detection of quartz in gdk-3.0 target
+
+The GTK+3 built by Nix targets ``broadway quartz`` instead of only `quartz`,
+thus the target check is wrong. The script is modified to look up `quartz` in a
+loop. The variable name is renamed to `targets` in `gdk-3.0.pc` as well.
+
+---
+ configure | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/configure b/configure
+index 628a80f..9cb88d5 100755
+--- a/configure
++++ b/configure
+@@ -7361,7 +7361,10 @@ $as_echo "yes" >&6; }
+ fi
+         GTK_VER=`$PKG_CONFIG gtk+-3.0 --modversion`
+ 
+-        _gdk_tgt=`$PKG_CONFIG --variable=target gdk-3.0`
++        # gdk-3.0 may have multiple targets e.g. "broadway quartz"
++        _gdk_tgts=`$PKG_CONFIG --variable=targets gdk-3.0`
++        for _gdk_tgt in $_gdk_tgts;
++        do
+         if test "x$_gdk_tgt" = xquartz; then
+ 
+ pkg_failed=no
+@@ -7466,6 +7469,7 @@ fi
+            COCOA_GTK_LDFLAGS="-framework Cocoa -framework ApplicationServices"
+ 
+         fi
++        done
+ 
+         if test x$with_gconf = xyes; then
+ 
+-- 
+2.36.1
+
diff --git a/nixpkgs/pkgs/applications/science/electronics/gtkwave/0002-Check-GDK_WINDOWING_X11-macro-when-using-GtkPlug.patch b/nixpkgs/pkgs/applications/science/electronics/gtkwave/0002-Check-GDK_WINDOWING_X11-macro-when-using-GtkPlug.patch
new file mode 100644
index 000000000000..456f5fa278f3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/gtkwave/0002-Check-GDK_WINDOWING_X11-macro-when-using-GtkPlug.patch
@@ -0,0 +1,101 @@
+From 6045177a0d4753bb7a6a6ffc3f1a4a3e96129c6d Mon Sep 17 00:00:00 2001
+From: Jiajie Chen <c@jia.je>
+Date: Wed, 22 Jun 2022 17:03:29 +0800
+Subject: [PATCH 2/2] Check GDK_WINDOWING_X11 macro when using GtkPlug
+
+---
+ src/main.c     |  5 +++++
+ src/twinwave.c | 12 ++++++++++--
+ 2 files changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/src/main.c b/src/main.c
+index 81bf505..b89f629 100644
+--- a/src/main.c
++++ b/src/main.c
+@@ -2080,10 +2080,15 @@ if(!GLOBALS->socket_xid)
+ #ifdef WAVE_USE_XID
+ 	else
+ 	{
++#ifdef GDK_WINDOWING_X11
+         GLOBALS->mainwindow = gtk_plug_new(GLOBALS->socket_xid);
+         gtk_widget_show(GLOBALS->mainwindow);
+ 
+         g_signal_connect(XXX_GTK_OBJECT(GLOBALS->mainwindow), "destroy",   /* formerly was "destroy" */G_CALLBACK(plug_destroy),"Plug destroy");
++#else
++	fprintf(stderr, "GTKWAVE | GtkPlug widget is unavailable\n");
++	exit(1);
++#endif
+ 	}
+ #endif
+ }
+diff --git a/src/twinwave.c b/src/twinwave.c
+index 590c7f6..d5c60f2 100644
+--- a/src/twinwave.c
++++ b/src/twinwave.c
+@@ -143,15 +143,19 @@ if(GDK_IS_WAYLAND_DISPLAY(gdk_display_get_default()))
+ 	use_embedded = 0;
+ 	}
+ #endif
++#if defined(__GTK_SOCKET_H__) && defined(GDK_WINDOWING_X11)
+ 	{
+ 	xsocket[0] = gtk_socket_new ();
+ 	xsocket[1] = gtk_socket_new ();
+ 	gtk_widget_show (xsocket[0]);
+ 	gtk_widget_show (xsocket[1]);
+ 	}
++#endif
+ 
++#if defined(__GTK_SOCKET_H__) && defined(GDK_WINDOWING_X11)
+ if(!twinwayland)
+ g_signal_connect(XXX_GTK_OBJECT(xsocket[0]), "plug-removed", G_CALLBACK(plug_removed), NULL);
++#endif
+ 
+ #if GTK_CHECK_VERSION(3,0,0)
+ main_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);
+@@ -208,7 +212,7 @@ if(hMapFile != NULL)
+ 				memset(&pi, 0, sizeof(PROCESS_INFORMATION));
+ 
+ 				sprintf(buf, "0+%08X", shmid);
+-#ifdef MINGW_USE_XID
++#if defined(MINGW_USE_XID) && defined(__GTK_SOCKET_H__) && defined(GDK_WINDOWING_X11)
+ 				sprintf(buf2, "%x", gtk_socket_get_id (GTK_SOCKET(xsocket[0])));
+ #else
+ 				sprintf(buf2, "%x", 0);
+@@ -279,7 +283,7 @@ if(hMapFile != NULL)
+ 				memset(&pi, 0, sizeof(PROCESS_INFORMATION));
+ 
+ 				sprintf(buf, "1+%08X", shmid);
+-#ifdef MINGW_USE_XID
++#if defined(MINGW_USE_XID) && defined(__GTK_SOCKET_H__) && defined(GDK_WINDOWING_X11)
+ 				sprintf(buf2, "%x", gtk_socket_get_id (GTK_SOCKET(xsocket[1])));
+ #else
+ 				sprintf(buf2, "%x", 0);
+@@ -429,10 +433,12 @@ if(shmid >=0)
+ 				sprintf(buf, "0+%08X", shmid);
+ 				if(use_embedded)
+ 					{
++#if defined(__GTK_SOCKET_H__) && defined(GDK_WINDOWING_X11)
+ #ifdef MAC_INTEGRATION
+ 					sprintf(buf2, "%x", gtk_socket_get_id (GTK_SOCKET(xsocket[0])));
+ #else
+ 					sprintf(buf2, "%lx", (long)gtk_socket_get_id (GTK_SOCKET(xsocket[0])));
++#endif
+ #endif
+ 					}
+ 					else
+@@ -467,10 +473,12 @@ if(shmid >=0)
+ 			sprintf(buf, "1+%08X", shmid);
+ 			if(use_embedded)
+ 				{
++#if defined(__GTK_SOCKET_H__) && defined(GDK_WINDOWING_X11)
+ #ifdef MAC_INTEGRATION
+ 				sprintf(buf2, "%x", gtk_socket_get_id (GTK_SOCKET(xsocket[1])));
+ #else
+ 				sprintf(buf2, "%lx", (long)gtk_socket_get_id (GTK_SOCKET(xsocket[1])));
++#endif
+ #endif
+ 				}
+ 				else
+-- 
+2.36.1
+
diff --git a/nixpkgs/pkgs/applications/science/electronics/gtkwave/default.nix b/nixpkgs/pkgs/applications/science/electronics/gtkwave/default.nix
new file mode 100644
index 000000000000..7b7b54201bf7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/gtkwave/default.nix
@@ -0,0 +1,52 @@
+{ bzip2
+, fetchurl
+, glib
+, gperf
+, gtk3
+, gtk-mac-integration
+, judy
+, lib
+, pkg-config
+, stdenv
+, tcl
+, tk
+, wrapGAppsHook
+, xz
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gtkwave";
+  version = "3.3.118";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gtkwave/${pname}-gtk3-${version}.tar.gz";
+    sha256 = "sha256-D0MwwCiiqz0vTUzur222kl2wEMS2/VLRECLQ5d6gSGo=";
+  };
+
+  nativeBuildInputs = [ pkg-config wrapGAppsHook ];
+  buildInputs = [ bzip2 glib gperf gtk3 judy tcl tk xz ]
+    ++ lib.optional stdenv.isDarwin gtk-mac-integration;
+
+  # fix compilation under Darwin
+  # remove these patches upon next release
+  # https://github.com/gtkwave/gtkwave/pull/136
+  patches = [
+    ./0001-Fix-detection-of-quartz-in-gdk-3.0-target.patch
+    ./0002-Check-GDK_WINDOWING_X11-macro-when-using-GtkPlug.patch
+  ];
+
+  configureFlags = [
+    "--with-tcl=${tcl}/lib"
+    "--with-tk=${tk}/lib"
+    "--enable-judy"
+    "--enable-gtk3"
+  ];
+
+  meta = {
+    description = "VCD/Waveform viewer for Unix and Win32";
+    homepage = "https://gtkwave.sourceforge.net";
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [ thoughtpolice jiegec jleightcap ];
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix b/nixpkgs/pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix
new file mode 100644
index 000000000000..4c3692266a5c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix
@@ -0,0 +1,153 @@
+{ lib
+, stdenv
+, boost
+, cmake
+, fetchFromGitHub
+, fetchpatch
+, graphviz
+, igraph
+, llvmPackages
+, ninja
+, pkg-config
+, python3Packages
+, qtbase
+, qtsvg
+, quazip
+, rapidjson
+, spdlog
+, suitesparse
+, wrapQtAppsHook
+, z3
+}:
+
+let
+  # hal doesn't work with igraph 0.10.x yet https://github.com/emsec/hal/pull/487
+  igraph' = igraph.overrideAttrs (final: prev: {
+    version = "0.9.10";
+    src = fetchFromGitHub {
+      owner = "igraph";
+      repo = final.pname;
+      rev = final.version;
+      hash = "sha256-prDadHsNhDRkNp1i0niKIYxE0g85Zs0ngvUy6uK8evk=";
+    };
+    patches = (prev.patches or []) ++ [
+      # needed by clang
+      (fetchpatch {
+        name = "libxml2-2.11-compat.patch";
+        url = "https://github.com/igraph/igraph/commit/5ad464be5ae2f6ebb69c97cb0140c800cc8d97d6.patch";
+        hash = "sha256-adU5SctH+H54UaAmr5BZInytD3wjUzLtQbCwngAWs4o=";
+      })
+    ];
+    postPatch = prev.postPatch + lib.optionalString stdenv.isAarch64 ''
+      # https://github.com/igraph/igraph/issues/1694
+      substituteInPlace tests/CMakeLists.txt \
+        --replace "igraph_scg_grouping3" "" \
+        --replace "igraph_scg_semiprojectors2" ""
+    '';
+    NIX_CFLAGS_COMPILE = (prev.NIX_CFLAGS_COMPILE or []) ++ lib.optionals stdenv.cc.isClang [
+      "-Wno-strict-prototypes"
+      "-Wno-unused-but-set-parameter"
+      "-Wno-unused-but-set-variable"
+    ];
+    # general options brought back from the old 0.9.x package
+    buildInputs = prev.buildInputs ++ [ suitesparse ];
+    cmakeFlags = prev.cmakeFlags ++ [ "-DIGRAPH_USE_INTERNAL_CXSPARSE=OFF" ];
+  });
+
+in stdenv.mkDerivation rec {
+  version = "4.2.0";
+  pname = "hal-hardware-analyzer";
+
+  src = fetchFromGitHub {
+    owner = "emsec";
+    repo = "hal";
+    rev = "v${version}";
+    sha256 = "sha256-Yl86AClE3vWygqj1omCOXX8koJK2SjTkMZFReRThez0=";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "cmake-add-no-vendored-options.patch";
+      # https://github.com/emsec/hal/pull/529
+      url = "https://github.com/emsec/hal/commit/37d5c1a0eacb25de57cc552c13e74f559a5aa6e8.patch";
+      hash = "sha256-a30VjDt4roJOTntisixqnH17wwCgWc4VWeh1+RgqFuY=";
+    })
+    (fetchpatch {
+      name = "hal-fix-fmt-10.1-compat.patch";
+      # https://github.com/emsec/hal/pull/530
+      url = "https://github.com/emsec/hal/commit/b639a56b303141afbf6731b70b7cc7452551f024.patch";
+      hash = "sha256-a7AyDEKkqdbiHpa4OHTRuP9Yewb3Nxs/j6bwez5m0yU=";
+    })
+    (fetchpatch {
+      name = "fix-gcc-13-build.patch";
+      # https://github.com/emsec/hal/pull/557
+      url = "https://github.com/emsec/hal/commit/831b1a7866aa9aabd55ff288c084862dc6a138d8.patch";
+      hash = "sha256-kB/sJJtLGl5PUv+mmWVpee/okkJzp5HF0BCiCRCcTKw=";
+    })
+  ];
+
+  # make sure bundled dependencies don't get in the way - install also otherwise
+  # copies them in full to the output, bloating the package
+  postPatch = ''
+    shopt -s extglob
+    rm -rf deps/!(abc|sanitizers-cmake|subprocess)/*
+    shopt -u extglob
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    ninja
+    pkg-config
+    wrapQtAppsHook
+  ];
+  buildInputs = [
+    qtbase
+    qtsvg
+    boost
+    rapidjson
+    igraph'
+    spdlog
+    graphviz
+    z3
+    quazip
+  ]
+  ++ (with python3Packages; [ python pybind11 ])
+  ++ lib.optional stdenv.cc.isClang llvmPackages.openmp
+  ;
+
+  cmakeFlags = with lib.versions; [
+    "-DHAL_VERSION_RETURN=${version}"
+    "-DHAL_VERSION_MAJOR=${major version}"
+    "-DHAL_VERSION_MINOR=${minor version}"
+    "-DHAL_VERSION_PATCH=${patch version}"
+    "-DHAL_VERSION_TWEAK=0"
+    "-DHAL_VERSION_ADDITIONAL_COMMITS=0"
+    "-DHAL_VERSION_DIRTY=false"
+    "-DHAL_VERSION_BROKEN=false"
+    "-DENABLE_INSTALL_LDCONFIG=off"
+    "-DUSE_VENDORED_PYBIND11=off"
+    "-DUSE_VENDORED_SPDLOG=off"
+    "-DUSE_VENDORED_QUAZIP=off"
+    "-DUSE_VENDORED_IGRAPH=off"
+    "-DBUILD_ALL_PLUGINS=on"
+  ];
+  # needed for macos build - this is why we use wrapQtAppsHook instead of
+  # the qt mkDerivation - the latter forcibly overrides this.
+  cmakeBuildType = "MinSizeRel";
+
+  # some plugins depend on other plugins and need to be able to load them
+  postFixup = lib.optionalString stdenv.isLinux ''
+    find $out/lib/hal_plugins -name '*.so*' | while read -r f ; do
+      patchelf --set-rpath "$(patchelf --print-rpath "$f"):$out/lib/hal_plugins" "$f"
+    done
+  '';
+
+  meta = with lib; {
+    description = "A comprehensive reverse engineering and manipulation framework for gate-level netlists";
+    mainProgram = "hal";
+    homepage = "https://github.com/emsec/hal";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ris shamilton ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/horizon-eda/base.nix b/nixpkgs/pkgs/applications/science/electronics/horizon-eda/base.nix
new file mode 100644
index 000000000000..8ce75a6ce241
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/horizon-eda/base.nix
@@ -0,0 +1,58 @@
+{ lib
+, cppzmq
+, curl
+, fetchFromGitHub
+, glm
+, gtkmm3
+, libarchive
+, libepoxy
+, libgit2
+, librsvg
+, libuuid
+, opencascade-occt
+, pkg-config
+, podofo
+, sqlite
+}:
+
+# This base is used in horizon-eda and python3Packages.horizon-eda
+rec {
+  pname = "horizon-eda";
+  version = "2.5.0";
+
+  src = fetchFromGitHub {
+    owner = "horizon-eda";
+    repo = "horizon";
+    rev = "v${version}";
+    hash = "sha256-UcjbDJR6shyETpanNkRoH8LF8r6gFjsyNHVSCMHKqS8=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  buildInputs = [
+    cppzmq
+    curl
+    glm
+    gtkmm3
+    libarchive
+    libepoxy
+    libgit2
+    librsvg
+    libuuid
+    opencascade-occt
+    podofo
+    sqlite
+  ];
+
+  CASROOT = opencascade-occt;
+
+  meta = with lib; {
+    description = "A free EDA software to develop printed circuit boards";
+    homepage = "https://horizon-eda.org";
+    maintainers = with maintainers; [ guserav jue89 ];
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/horizon-eda/default.nix b/nixpkgs/pkgs/applications/science/electronics/horizon-eda/default.nix
new file mode 100644
index 000000000000..1fbc92f06115
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/horizon-eda/default.nix
@@ -0,0 +1,38 @@
+{ stdenv
+, boost
+, callPackage
+, coreutils
+, libspnav
+, python3
+, wrapGAppsHook
+}:
+
+let
+  base = callPackage ./base.nix { };
+in
+stdenv.mkDerivation rec {
+  inherit (base) pname version src meta CASROOT;
+
+  # provide base for python module
+  passthru = {
+    inherit base;
+  };
+
+  buildInputs = base.buildInputs ++ [
+    libspnav
+  ];
+
+  nativeBuildInputs = base.nativeBuildInputs ++ [
+    boost.dev
+    wrapGAppsHook
+    python3
+  ];
+
+  installFlags = [
+    "INSTALL=${coreutils}/bin/install"
+    "DESTDIR=$(out)"
+    "PREFIX="
+  ];
+
+  enableParallelBuilding = true;
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/hyp2mat/default.nix b/nixpkgs/pkgs/applications/science/electronics/hyp2mat/default.nix
new file mode 100644
index 000000000000..71da4a259d54
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/hyp2mat/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv
+, fetchFromGitHub
+, bison
+, flex
+, gengetopt
+, help2man
+, groff
+, libharu
+, autoreconfHook
+, pkg-config
+, libpng
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "hyp2mat";
+  version = "0.0.18";
+
+  src = fetchFromGitHub {
+    owner = "koendv";
+    repo = "hyp2mat";
+    rev = "v${version}";
+    sha256 = "03ibk51swxfl7pfrhcrfiffdi4mnf8kla0g1xj1lsrvrjwapfx03";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+  ];
+
+  buildInputs = [
+    libharu
+    libpng
+    zlib
+    bison
+    flex
+    gengetopt
+    help2man
+    groff
+  ];
+
+  configureFlags = [ "--enable-library" ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Import Hyperlynx Boardsim files to openEMS, an open source 3D full-wave electromagnetic field solver";
+    mainProgram = "hyp2mat";
+    homepage = "https://github.com/koendv/hyp2mat";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ matthuszagh ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/kicad/addons/default.nix b/nixpkgs/pkgs/applications/science/electronics/kicad/addons/default.nix
new file mode 100644
index 000000000000..5170e7efce36
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/kicad/addons/default.nix
@@ -0,0 +1,5 @@
+{ kicad }:
+{
+  kikit = kicad.callPackage ./kikit.nix { addonName = "kikit"; };
+  kikit-library = kicad.callPackage ./kikit.nix { addonName = "kikit-library"; };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/kicad/addons/kikit.nix b/nixpkgs/pkgs/applications/science/electronics/kicad/addons/kikit.nix
new file mode 100644
index 000000000000..6e5fc5ad9678
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/kicad/addons/kikit.nix
@@ -0,0 +1,52 @@
+# For building the multiple addons that are in the kikit repo.
+{ stdenv
+, bc
+, kikit
+, zip
+, python3
+, addonName
+, addonPath
+}:
+let
+  # This python is only used when building the package, it's not the python
+  # environment that will ultimately run the code packaged here. The python env defined
+  # in KiCad will import the python code packaged here when KiCad starts up.
+  python = python3.withPackages (ps: with ps; [ click ]);
+  kikit-module = python3.pkgs.toPythonModule (kikit.override { inherit python3; });
+
+  # The following different addons can be built from the same source.
+  targetSpecs = {
+    "kikit" = {
+      makeTarget = "pcm-kikit";
+      resultZip = "pcm-kikit.zip";
+      description = "KiCad plugin and a CLI tool to automate several tasks in a standard KiCad workflow";
+    };
+    "kikit-library" = {
+      makeTarget = "pcm-lib";
+      resultZip = "pcm-kikit-lib.zip";
+      description = "KiKit uses these symbols and footprints to annotate your boards (e.g., to place a tab in a panel).";
+    };
+  };
+  targetSpec = targetSpecs.${addonName};
+in
+stdenv.mkDerivation {
+  name = "kicadaddon-${addonName}";
+  inherit (kikit-module) src version;
+
+  nativeBuildInputs = [ python bc zip ];
+  propagatedBuildInputs = [ kikit-module ];
+
+  buildPhase = ''
+    patchShebangs scripts/setJson.py
+    make ${targetSpec.makeTarget}
+  '';
+
+  installPhase = ''
+    mkdir $out
+    mv build/${targetSpec.resultZip} $out/${addonPath}
+  '';
+
+  meta = kikit-module.meta // {
+    description = targetSpec.description;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/kicad/base.nix b/nixpkgs/pkgs/applications/science/electronics/kicad/base.nix
new file mode 100644
index 000000000000..d884a60c984f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/kicad/base.nix
@@ -0,0 +1,210 @@
+{ lib
+, stdenv
+, cmake
+, libGLU
+, libGL
+, zlib
+, wxGTK
+, gtk3
+, libX11
+, gettext
+, glew
+, glm
+, cairo
+, curl
+, openssl
+, boost
+, pkg-config
+, doxygen
+, graphviz
+, pcre
+, libpthreadstubs
+, libXdmcp
+, unixODBC
+, libgit2
+, libsecret
+, libgcrypt
+, libgpg-error
+
+, util-linux
+, libselinux
+, libsepol
+, libthai
+, libdatrie
+, libxkbcommon
+, libepoxy
+, dbus
+, at-spi2-core
+, libXtst
+, pcre2
+, libdeflate
+
+, swig4
+, python
+, wxPython
+, opencascade-occt
+, libngspice
+, valgrind
+
+, stable
+, testing
+, baseName
+, kicadSrc
+, kicadVersion
+, withNgspice
+, withScripting
+, withI18n
+, debug
+, sanitizeAddress
+, sanitizeThreads
+}:
+
+assert lib.assertMsg (!(sanitizeAddress && sanitizeThreads))
+  "'sanitizeAddress' and 'sanitizeThreads' are mutually exclusive, use one.";
+assert testing -> !stable
+  -> throw "testing implies stable and cannot be used with stable = false";
+
+let
+  inherit (lib) optional optionals optionalString;
+in
+stdenv.mkDerivation rec {
+  pname = "kicad-base";
+  version = if (stable) then kicadVersion else builtins.substring 0 10 src.rev;
+
+  src = kicadSrc;
+
+  patches = [
+    # upstream issue 12941 (attempted to upstream, but appreciably unacceptable)
+    ./writable.patch
+    # https://gitlab.com/kicad/code/kicad/-/issues/15687
+    ./runtime_stock_data_path.patch
+  ];
+
+  # tagged releases don't have "unknown"
+  # kicad testing and nightlies use git describe --dirty
+  # nix removes .git, so its approximated here
+  postPatch = lib.optionalString (!stable || testing) ''
+    substituteInPlace cmake/KiCadVersion.cmake \
+      --replace "unknown" "${builtins.substring 0 10 src.rev}"
+
+    substituteInPlace cmake/CreateGitVersionHeader.cmake \
+      --replace "0000000000000000000000000000000000000000" "${src.rev}"
+  '';
+
+  makeFlags = optionals (debug) [ "CFLAGS+=-Og" "CFLAGS+=-ggdb" ];
+
+  cmakeFlags = [
+    "-DKICAD_USE_EGL=ON"
+    "-DOCC_INCLUDE_DIR=${opencascade-occt}/include/opencascade"
+    # https://gitlab.com/kicad/code/kicad/-/issues/17133
+    "-DCMAKE_CTEST_ARGUMENTS='--exclude-regex;qa_spice'"
+  ]
+  ++ optional (stdenv.hostPlatform.system == "aarch64-linux")
+    "-DCMAKE_CTEST_ARGUMENTS=--exclude-regex;'qa_spice|qa_cli'"
+  ++ optional (stable && !withNgspice) "-DKICAD_SPICE=OFF"
+  ++ optionals (!withScripting) [
+    "-DKICAD_SCRIPTING_WXPYTHON=OFF"
+  ]
+  ++ optionals (withI18n) [
+    "-DKICAD_BUILD_I18N=ON"
+  ]
+  ++ optionals (!doInstallCheck) [
+    "-DKICAD_BUILD_QA_TESTS=OFF"
+  ]
+  ++ optionals (debug) [
+    "-DKICAD_STDLIB_DEBUG=ON"
+    "-DKICAD_USE_VALGRIND=ON"
+  ]
+  ++ optionals (sanitizeAddress) [
+    "-DKICAD_SANITIZE_ADDRESS=ON"
+  ]
+  ++ optionals (sanitizeThreads) [
+    "-DKICAD_SANITIZE_THREADS=ON"
+  ];
+
+  cmakeBuildType = if debug then "Debug" else "Release";
+
+  nativeBuildInputs = [
+    cmake
+    doxygen
+    graphviz
+    pkg-config
+    libgit2
+    libsecret
+    libgcrypt
+    libgpg-error
+  ]
+  # wanted by configuration on linux, doesn't seem to affect performance
+  # no effect on closure size
+  ++ optionals (stdenv.isLinux) [
+    util-linux
+    libselinux
+    libsepol
+    libthai
+    libdatrie
+    libxkbcommon
+    libepoxy
+    dbus
+    at-spi2-core
+    libXtst
+    pcre2
+  ];
+
+  buildInputs = [
+    libGLU
+    libGL
+    zlib
+    libX11
+    wxGTK
+    gtk3
+    pcre
+    libXdmcp
+    gettext
+    glew
+    glm
+    libpthreadstubs
+    cairo
+    curl
+    openssl
+    boost
+    swig4
+    python
+    unixODBC
+    libdeflate
+    opencascade-occt
+  ]
+  ++ optional (withScripting) wxPython
+  ++ optional (withNgspice) libngspice
+  ++ optional (debug) valgrind;
+
+  # some ngspice tests attempt to write to $HOME/.cache/
+  # this could be and was resolved with XDG_CACHE_HOME = "$TMP";
+  # but failing tests still attempt to create $HOME
+  # and the newer CLI tests seem to also use $HOME...
+  HOME = "$TMP";
+
+  # debug builds fail all but the python test
+  doInstallCheck = !(debug);
+  installCheckTarget = "test";
+
+  nativeInstallCheckInputs = [
+    (python.withPackages(ps: with ps; [
+      numpy
+      pytest
+      cairosvg
+      pytest-image-diff
+    ]))
+  ];
+
+  dontStrip = debug;
+
+  meta = {
+    description = "Just the built source without the libraries";
+    longDescription = ''
+      Just the build products, the libraries are passed via an env var in the wrapper, default.nix
+    '';
+    homepage = "https://www.kicad.org/";
+    license = lib.licenses.agpl3Plus;
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/kicad/default.nix b/nixpkgs/pkgs/applications/science/electronics/kicad/default.nix
new file mode 100644
index 000000000000..99670eee8a46
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/kicad/default.nix
@@ -0,0 +1,292 @@
+{ lib, stdenv
+, runCommand
+, newScope
+, fetchFromGitLab
+, makeWrapper
+, symlinkJoin
+, callPackage
+, callPackages
+
+, gnome
+, dconf
+, gtk3
+, wxGTK32
+, librsvg
+, cups
+, gsettings-desktop-schemas
+, hicolor-icon-theme
+
+, unzip
+, jq
+
+, pname ? "kicad"
+, stable ? true
+, testing ? false
+, withNgspice ? !stdenv.isDarwin
+, libngspice
+, withScripting ? true
+, python3
+, addons ? [ ]
+, debug ? false
+, sanitizeAddress ? false
+, sanitizeThreads ? false
+, with3d ? true
+, withI18n ? true
+, srcs ? { }
+}:
+
+# `addons`: https://dev-docs.kicad.org/en/addons/
+#
+# ```nix
+# kicad = pkgs.kicad.override {
+#   addons = with pkgs.kicadAddons; [ kikit kikit-library ];
+# };
+# ```
+
+# The `srcs` parameter can be used to override the kicad source code
+# and all libraries, which are otherwise inaccessible
+# to overlays since most of the kicad build expression has been
+# refactored into base.nix, most of the library build expressions have
+# been refactored into libraries.nix. Overrides are only applied when
+# building `kicad-unstable`. The `srcs` parameter has
+# no effect for stable `kicad`. `srcs` takes an attribute set in which
+# any of the following attributes are meaningful (though none are
+# mandatory): "kicad", "kicadVersion", "symbols", "templates",
+# "footprints", "packages3d", and "libVersion". "kicadVersion" and
+# "libVersion" should be set to a string with the desired value for
+# the version attribute in kicad's `mkDerivation` and the version
+# attribute in any of the library's `mkDerivation`, respectively.
+# "kicad", "symbols", "templates", "footprints", and "packages3d"
+# should be set to an appropriate fetcher (e.g. `fetchFromGitLab`).
+# So, for example, a possible overlay for kicad is:
+#
+# final: prev:
+
+# {
+#   kicad-unstable = (prev.kicad-unstable.override {
+#     srcs = {
+#       kicadVersion = "2020-10-08";
+#       kicad = prev.fetchFromGitLab {
+#         group = "kicad";
+#         owner = "code";
+#         repo = "kicad";
+#         rev = "fd22fe8e374ce71d57e9f683ba996651aa69fa4e";
+#         sha256 = "sha256-F8qugru/jU3DgZSpQXQhRGNFSk0ybFRkpyWb7HAGBdc=";
+#       };
+#     };
+#   });
+# }
+
+let
+  baseName = if (testing) then "kicad-testing"
+    else if (stable) then "kicad"
+    else "kicad-unstable";
+  versionsImport = import ./versions.nix;
+
+  # versions.nix does not provide us with version, src and rev. We
+  # need to turn this into approprate fetcher calls.
+  kicadSrcFetch = fetchFromGitLab {
+    group = "kicad";
+    owner = "code";
+    repo = "kicad";
+    rev = versionsImport.${baseName}.kicadVersion.src.rev;
+    sha256 = versionsImport.${baseName}.kicadVersion.src.sha256;
+  };
+
+  libSrcFetch = name: fetchFromGitLab {
+    group = "kicad";
+    owner = "libraries";
+    repo = "kicad-${name}";
+    rev = versionsImport.${baseName}.libVersion.libSources.${name}.rev;
+    sha256 = versionsImport.${baseName}.libVersion.libSources.${name}.sha256;
+  };
+
+  # only override `src` or `version` if building `kicad-unstable` with
+  # the appropriate attribute defined in `srcs`.
+  srcOverridep = attr: (!stable && builtins.hasAttr attr srcs);
+
+  # use default source and version (as defined in versions.nix) by
+  # default, or use the appropriate attribute from `srcs` if building
+  # unstable with `srcs` properly defined.
+  kicadSrc =
+    if srcOverridep "kicad" then srcs.kicad
+    else kicadSrcFetch;
+  kicadVersion =
+    if srcOverridep "kicadVersion" then srcs.kicadVersion
+    else versionsImport.${baseName}.kicadVersion.version;
+
+  libSrc = name: if srcOverridep name then srcs.${name} else libSrcFetch name;
+  # TODO does it make sense to only have one version for all libs?
+  libVersion =
+    if srcOverridep "libVersion" then srcs.libVersion
+    else versionsImport.${baseName}.libVersion.version;
+
+  wxGTK = wxGTK32;
+  python = python3;
+  wxPython = python.pkgs.wxpython;
+  addonPath = "addon.zip";
+  addonsDrvs = map (pkg: pkg.override { inherit addonPath python3; }) addons;
+
+  addonsJoined =
+    runCommand "addonsJoined"
+      {
+        inherit addonsDrvs;
+        nativeBuildInputs = [ unzip jq ];
+      } ''
+      mkdir $out
+
+      for pkg in $addonsDrvs; do
+        unzip $pkg/addon.zip -d unpacked
+
+        folder_name=$(jq .identifier unpacked/metadata.json --raw-output | tr . _)
+        for d in unpacked/*; do
+          if [ -d "$d" ]; then
+            dest=$out/share/kicad/scripting/$(basename $d)/$folder_name
+            mkdir -p $(dirname $dest)
+
+            mv $d $dest
+          fi
+        done
+        rm -r unpacked
+      done
+    '';
+
+  inherit (lib) concatStringsSep flatten optionalString optionals;
+in
+stdenv.mkDerivation rec {
+
+  # Common libraries, referenced during runtime, via the wrapper.
+  passthru.libraries = callPackages ./libraries.nix { inherit libSrc; };
+  passthru.callPackage = newScope { inherit addonPath python3; };
+  base = callPackage ./base.nix {
+    inherit stable testing baseName;
+    inherit kicadSrc kicadVersion;
+    inherit wxGTK python wxPython;
+    inherit withNgspice withScripting withI18n;
+    inherit debug sanitizeAddress sanitizeThreads;
+  };
+
+  inherit pname;
+  version = if (stable) then kicadVersion else builtins.substring 0 10 src.src.rev;
+
+  src = base;
+  dontUnpack = true;
+  dontConfigure = true;
+  dontBuild = true;
+  dontFixup = true;
+
+  pythonPath = optionals (withScripting)
+    [ wxPython python.pkgs.six python.pkgs.requests ] ++ addonsDrvs;
+
+  nativeBuildInputs = [ makeWrapper ]
+    ++ optionals (withScripting)
+    [ python.pkgs.wrapPython ];
+
+  # KICAD7_TEMPLATE_DIR only works with a single path (it does not handle : separated paths)
+  # but it's used to find both the templates and the symbol/footprint library tables
+  # https://gitlab.com/kicad/code/kicad/-/issues/14792
+  template_dir = symlinkJoin {
+    name = "KiCad_template_dir";
+    paths = with passthru.libraries; [
+      "${templates}/share/kicad/template"
+      "${footprints}/share/kicad/template"
+      "${symbols}/share/kicad/template"
+    ];
+  };
+  # We are emulating wrapGAppsHook, along with other variables to the wrapper
+  makeWrapperArgs = with passthru.libraries; [
+    "--prefix XDG_DATA_DIRS : ${base}/share"
+    "--prefix XDG_DATA_DIRS : ${hicolor-icon-theme}/share"
+    "--prefix XDG_DATA_DIRS : ${gnome.adwaita-icon-theme}/share"
+    "--prefix XDG_DATA_DIRS : ${gtk3}/share/gsettings-schemas/${gtk3.name}"
+    "--prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}"
+    # wrapGAppsHook did these two as well, no idea if it matters...
+    "--prefix XDG_DATA_DIRS : ${cups}/share"
+    "--prefix GIO_EXTRA_MODULES : ${dconf}/lib/gio/modules"
+    # required to open a bug report link in firefox-wayland
+    "--set-default MOZ_DBUS_REMOTE 1"
+    "--set-default KICAD8_FOOTPRINT_DIR ${footprints}/share/kicad/footprints"
+    "--set-default KICAD8_SYMBOL_DIR ${symbols}/share/kicad/symbols"
+    "--set-default KICAD8_TEMPLATE_DIR ${template_dir}"
+  ]
+  ++ optionals (addons != [ ]) (
+    let stockDataPath = symlinkJoin {
+      name = "kicad_stock_data_path";
+      paths = [
+        "${base}/share/kicad"
+        "${addonsJoined}/share/kicad"
+      ];
+    };
+    in
+    [ "--set-default NIX_KICAD8_STOCK_DATA_PATH ${stockDataPath}" ]
+  )
+  ++ optionals (with3d)
+  [
+    "--set-default KICAD8_3DMODEL_DIR ${packages3d}/share/kicad/3dmodels"
+  ]
+  ++ optionals (withNgspice) [ "--prefix LD_LIBRARY_PATH : ${libngspice}/lib" ]
+
+  # infinisil's workaround for #39493
+  ++ [ "--set GDK_PIXBUF_MODULE_FILE ${librsvg}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" ]
+  ;
+
+  # why does $makeWrapperArgs have to be added explicitly?
+  # $out and $program_PYTHONPATH don't exist when makeWrapperArgs gets set?
+  installPhase =
+    let
+      bin = if stdenv.isDarwin then "*.app/Contents/MacOS" else "bin";
+      tools = [ "kicad" "pcbnew" "eeschema" "gerbview" "pcb_calculator" "pl_editor" "bitmap2component" ];
+      utils = [ "dxf2idf" "idf2vrml" "idfcyl" "idfrect" "kicad-cli" ];
+    in
+    (concatStringsSep "\n"
+      (flatten [
+        "runHook preInstall"
+
+        (optionalString (withScripting) "buildPythonPath \"${base} $pythonPath\" \n")
+
+        # wrap each of the directly usable tools
+        (map
+          (tool: "makeWrapper ${base}/${bin}/${tool} $out/bin/${tool} $makeWrapperArgs"
+            + optionalString (withScripting) " --set PYTHONPATH \"$program_PYTHONPATH\""
+          )
+          tools)
+
+        # link in the CLI utils
+        (map (util: "ln -s ${base}/${bin}/${util} $out/bin/${util}") utils)
+
+        "runHook postInstall"
+      ])
+    )
+  ;
+
+  postInstall = ''
+    mkdir -p $out/share
+    ln -s ${base}/share/applications $out/share/applications
+    ln -s ${base}/share/icons $out/share/icons
+    ln -s ${base}/share/mime $out/share/mime
+    ln -s ${base}/share/metainfo $out/share/metainfo
+  '';
+
+  passthru.updateScript = {
+    command = [ ./update.sh "${pname}" ];
+    supportedFeatures = [ "commit" ];
+  };
+
+  meta = rec {
+    description = (if (stable)
+    then "Open Source Electronics Design Automation suite"
+    else if (testing) then "Open Source EDA suite, latest on stable branch"
+    else "Open Source EDA suite, latest on master branch")
+    + (lib.optionalString (!with3d) ", without 3D models");
+    homepage = "https://www.kicad.org/";
+    longDescription = ''
+      KiCad is an open source software suite for Electronic Design Automation.
+      The Programs handle Schematic Capture, and PCB Layout with Gerber output.
+    '';
+    license = lib.licenses.gpl3Plus;
+    maintainers = with lib.maintainers; [ evils ];
+    platforms = lib.platforms.all;
+    broken = stdenv.isDarwin;
+    mainProgram = "kicad";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/kicad/libraries.nix b/nixpkgs/pkgs/applications/science/electronics/kicad/libraries.nix
new file mode 100644
index 000000000000..327f77d1c42f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/kicad/libraries.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv
+, cmake
+, gettext
+, libSrc
+, stepreduce
+, parallel
+, zip
+}:
+let
+  mkLib = name:
+    stdenv.mkDerivation {
+      pname = "kicad-${name}";
+      version = builtins.substring 0 10 (libSrc name).rev;
+
+      src = libSrc name;
+
+      nativeBuildInputs = [ cmake ]
+        ++ lib.optionals (name == "packages3d") [
+          stepreduce
+          parallel
+          zip
+        ];
+
+      postInstall = lib.optional (name == "packages3d") ''
+        find $out -type f -name '*.step' | parallel 'stepreduce {} {} && zip -9 {.}.stpZ {} && rm {}'
+      '';
+
+      meta = rec {
+        license = lib.licenses.cc-by-sa-40;
+        platforms = lib.platforms.all;
+      };
+    };
+in
+{
+  symbols = mkLib "symbols";
+  templates = mkLib "templates";
+  footprints = mkLib "footprints";
+  packages3d = mkLib "packages3d";
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/kicad/runtime_stock_data_path.patch b/nixpkgs/pkgs/applications/science/electronics/kicad/runtime_stock_data_path.patch
new file mode 100644
index 000000000000..43e99a531cf5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/kicad/runtime_stock_data_path.patch
@@ -0,0 +1,15 @@
+diff --git a/common/paths.cpp b/common/paths.cpp
+index a74cdd9..790cc58 100644
+--- a/common/paths.cpp
++++ b/common/paths.cpp
+@@ -151,6 +151,10 @@ wxString PATHS::GetStockDataPath( bool aRespectRunFromBuildDir )
+ {
+     wxString path;
+
++    if( wxGetEnv( wxT( "NIX_KICAD8_STOCK_DATA_PATH" ), &path ) ) {
++        return path;
++    }
++
+     if( aRespectRunFromBuildDir && wxGetEnv( wxT( "KICAD_RUN_FROM_BUILD_DIR" ), nullptr ) )
+     {
+         // Allow debugging from build dir by placing relevant files/folders in the build root
diff --git a/nixpkgs/pkgs/applications/science/electronics/kicad/update.sh b/nixpkgs/pkgs/applications/science/electronics/kicad/update.sh
new file mode 100755
index 000000000000..b47e2d84b336
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/kicad/update.sh
@@ -0,0 +1,260 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p coreutils git nix curl jq
+# shellcheck shell=bash enable=all
+
+set -e
+shopt -s inherit_errexit
+
+# this script will generate versions.nix in the right location
+# this should contain the versions' revs and hashes
+# the stable revs are stored only for ease of skipping
+
+# by default nix-prefetch-url uses XDG_RUNTIME_DIR as tmp
+# which is /run/user/1000, which defaults to 10% of your RAM
+# unless you have over 64GB of ram that'll be insufficient
+# resulting in "tar: no space left on device" for packages3d
+# hence:
+export TMPDIR=/tmp
+
+# if something goes unrepairably wrong, run 'update.sh all clean'
+
+# TODO
+# support parallel instances for each pname
+#   currently risks reusing old data
+# no getting around manually checking if the build product works...
+# if there is, default to commiting?
+#   won't work when running in parallel?
+# remove items left in /nix/store?
+# reuse hashes of already checked revs (to avoid redownloading testing's packages3d)
+
+# nixpkgs' update.nix passes in UPDATE_NIX_PNAME to indicate which package is being updated
+# assigning a default value to that as shellcheck doesn't like the use of unassigned variables
+: "${UPDATE_NIX_PNAME:=""}"
+# update.nix can also parse JSON output of this script to formulate a commit
+# this requires we collect the version string in the old versions.nix for the updated package
+old_version=""
+new_version=""
+
+
+# get the latest tag that isn't an RC or *.99
+latest_tags="$(git ls-remote --tags --sort -version:refname https://gitlab.com/kicad/code/kicad.git)"
+# using a scratch variable to ensure command failures get caught (SC2312)
+scratch="$(grep -o 'refs/tags/[0-9]*\.[0-9]*\.[0-9]*$' <<< "${latest_tags}")"
+scratch="$(grep -ve '\.99' -e '\.9\.9' <<< "${scratch}")"
+scratch="$(sed -n '1p' <<< "${scratch}")"
+latest_tag="$(cut -d '/' -f 3 <<< "${scratch}")"
+
+# get the latest branch name for testing
+branches="$(git ls-remote --heads --sort -version:refname https://gitlab.com/kicad/code/kicad.git)"
+scratch="$(grep -o 'refs/heads/[0-9]*\.[0-9]*$' <<< "${branches}")"
+scratch="$(sed -n '1p' <<< "${scratch}")"
+testing_branch="$(cut -d '/' -f 3 <<< "${scratch}")"
+
+# "latest_tag" and "master" directly refer to what we want
+# "testing" uses "testing_branch" found above
+all_versions=( "${latest_tag}" testing master )
+
+prefetch="nix-prefetch-url --unpack --quiet"
+
+clean=""
+check_stable=""
+check_testing=1
+check_unstable=1
+commit=""
+
+for arg in "$@" "${UPDATE_NIX_PNAME}"; do
+  case "${arg}" in
+    help|-h|--help) echo "Read me!" >&2; exit 1; ;;
+    kicad|kicad-small|release|tag|stable|5*|6*|7*|8*) check_stable=1; check_testing=""; check_unstable="" ;;
+    *testing|kicad-testing-small) check_testing=1; check_unstable="" ;;
+    *unstable|*unstable-small|master|main) check_unstable=1; check_testing="" ;;
+    latest|now|today) check_unstable=1; check_testing=1 ;;
+    all|both|full) check_stable=1; check_testing=1; check_unstable=1 ;;
+    clean|fix|*fuck) check_stable=1; check_testing=1; check_unstable=1; clean=1 ;;
+    commit) commit=1 ;;
+    *) ;;
+  esac
+done
+
+here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+commit_date() {
+  gitlab_json="$(curl -s https://gitlab.com/api/v4/projects/kicad%2Fcode%2Fkicad/repository/commits/"$1")"
+  commit_created="$(jq .created_at --raw-output <<< "${gitlab_json}")"
+  date --date="${commit_created}" --iso-8601 --utc
+}
+
+file="${here}/versions.nix"
+# just in case this runs in parallel
+tmp="${here}/,versions.nix.${RANDOM}"
+
+libs=( symbols templates footprints packages3d )
+
+get_rev() {
+    git ls-remote "$@"
+}
+
+gitlab="https://gitlab.com/kicad"
+# append commit hash or tag
+src_pre="https://gitlab.com/api/v4/projects/kicad%2Fcode%2Fkicad/repository/archive.tar.gz?sha="
+lib_pre="https://gitlab.com/api/v4/projects/kicad%2Flibraries%2Fkicad-"
+lib_mid="/repository/archive.tar.gz?sha="
+
+# number of items updated
+count=0
+
+printf "Latest tag is %s\n" "${latest_tag}" >&2
+
+if [[ ! -f ${file} ]]; then
+  echo "No existing file, generating from scratch" >&2
+  check_stable=1; check_testing=1; check_unstable=1; clean=1
+fi
+
+printf "Writing %s\n" "${tmp}" >&2
+
+# not a dangling brace, grouping the output to redirect to file
+{
+
+printf "# This file was generated by update.sh\n\n"
+printf "{\n"
+
+for version in "${all_versions[@]}"; do
+
+  src_version=${version};
+  lib_version=${version};
+  # testing is the stable branch on the main repo
+  # but the libraries don't have such a branch
+  # only the latest release tag and a master branch
+  if [[ ${version} == "testing" ]]; then
+      src_version=${testing_branch};
+      lib_version=${latest_tag};
+  fi
+
+  if [[ ${version} == "master" ]]; then
+    pname="kicad-unstable"
+  elif [[ ${version} == "testing" ]]; then
+    pname="kicad-testing"
+  else
+    pname="kicad"
+  fi
+
+  # skip a version if we don't want to check it
+  if [[ (-n ${check_stable} && ${version} != "master" && ${version} != "testing") \
+     || (-n ${check_testing} && ${version} == "testing") \
+     || (-n ${check_unstable} && ${version} == "master" ) ]]; then
+
+    now=$(commit_date "${src_version}")
+
+    if [[ ${version} == "master" ]]; then
+      pname="kicad-unstable"
+      new_version="${now}"
+    elif [[ ${version} == "testing" ]]; then
+      pname="kicad-testing"
+      new_version="${testing_branch}-${now}"
+    else
+      pname="kicad"
+      new_version="${version}"
+    fi
+
+    printf "\nChecking %s\n" "${pname}" >&2
+
+    printf "%2s\"%s\" = {\n" "" "${pname}"
+      printf "%4skicadVersion = {\n" ""
+        printf "%6sversion =\t\t\t\"%s\";\n" "" "${new_version}"
+        printf "%6ssrc = {\n" ""
+
+    echo "Checking src" >&2
+    scratch="$(get_rev "${gitlab}"/code/kicad.git "${src_version}")"
+    src_rev="$(cut -f1 <<< "${scratch}")"
+    has_rev="$(grep -sm 1 "\"${pname}\"" -A 4 "${file}" | grep -sm 1 "${src_rev}" || true)"
+    has_hash="$(grep -sm 1 "\"${pname}\"" -A 5 "${file}" | grep -sm 1 "sha256" || true)"
+    old_version="$(grep -sm 1 "\"${pname}\"" -A 3 "${file}" | grep -sm 1 "version" | awk -F "\"" '{print $2}' || true)"
+
+    if [[ -n ${has_rev} && -n ${has_hash} && -z ${clean} ]]; then
+      echo "Reusing old ${pname}.src.sha256, already latest .rev at ${old_version}" >&2
+      scratch=$(grep -sm 1 "\"${pname}\"" -A 5 "${file}")
+      grep -sm 1 "rev" -A 1 <<< "${scratch}"
+    else
+          prefetched="$(${prefetch} "${src_pre}${src_rev}")"
+          printf "%8srev =\t\t\t\"%s\";\n" "" "${src_rev}"
+          printf "%8ssha256 =\t\t\"%s\";\n" "" "${prefetched}"
+          count=$((count+1))
+    fi
+        printf "%6s};\n" ""
+      printf "%4s};\n" ""
+
+      printf "%4slibVersion = {\n" ""
+        printf "%6sversion =\t\t\t\"%s\";\n" "" "${new_version}"
+        printf "%6slibSources = {\n" ""
+
+          for lib in "${libs[@]}"; do
+            echo "Checking ${lib}" >&2
+            url="${gitlab}/libraries/kicad-${lib}.git"
+            scratch="$(get_rev "${url}" "${lib_version}")"
+            scratch="$(cut -f1 <<< "${scratch}")"
+            lib_rev="$(tail -n1 <<< "${scratch}")"
+            has_rev="$(grep -sm 1 "\"${pname}\"" -A 19 "${file}" | grep -sm 1 "${lib_rev}" || true)"
+            has_hash="$(grep -sm 1 "\"${pname}\"" -A 20 "${file}" | grep -sm 1 "${lib}.sha256" || true)"
+            if [[ -n ${has_rev} && -n ${has_hash} && -z ${clean} ]]; then
+              echo "Reusing old kicad-${lib}-${new_version}.src.sha256, already latest .rev" >&2
+              scratch="$(grep -sm 1 "\"${pname}\"" -A 20 "${file}")"
+              grep -sm 1 "${lib}" -A 1 <<< "${scratch}"
+            else
+              prefetched="$(${prefetch} "${lib_pre}${lib}${lib_mid}${lib_rev}")"
+              printf "%8s%s.rev =\t" "" "${lib}"
+              case "${lib}" in
+                symbols|templates) printf "\t" ;; *) ;;
+              esac
+              printf "\"%s\";\n" "${lib_rev}"
+              printf "%8s%s.sha256 =\t\"%s\";\n" "" "${lib}" "${prefetched}"
+              count=$((count+1))
+            fi
+          done
+        printf "%6s};\n" ""
+      printf "%4s};\n" ""
+    printf "%2s};\n" ""
+  else
+    printf "\nReusing old %s\n" "${pname}" >&2
+    grep -sm 1 "\"${pname}\"" -A 21 "${file}"
+  fi
+done
+printf "}\n"
+} > "${tmp}"
+
+if grep '""' "${tmp}"; then
+  echo "empty value detected, out of space?" >&2
+  exit "1"
+fi
+
+mv "${tmp}" "${file}"
+
+printf "\nFinished\nMoved output to %s\n\n" "${file}" >&2
+
+if [[ ${count} -gt 0 ]]; then
+  if [[ ${count} -gt 1 ]]; then s="s"; else s=""; fi
+  echo "${count} revision${s} changed" >&2
+  if [[ -n ${commit} ]]; then
+    git commit -am "$(printf "kicad: automatic update of %s item%s\n" "${count}" "${s}")"
+  fi
+  echo "Please confirm the new versions.nix works before making a PR." >&2
+else
+  echo "No changes, those checked are up to date" >&2
+fi
+
+# using UPDATE_NIX_ATTR_PATH to detect if this is being called from update.nix
+# and output JSON to describe the changes
+if [[ -n ${UPDATE_NIX_ATTR_PATH} ]]; then
+
+  if [[ ${count} -eq 0 ]]; then echo "[{}]"; exit 0; fi
+
+  jq -n \
+    --arg attrpath "${UPDATE_NIX_PNAME}" \
+    --arg oldversion "${old_version}" \
+    --arg newversion "${new_version}" \
+    --arg file "${file}" \
+'[{
+  "attrPath": $attrpath,
+  "oldVersion": $oldversion,
+  "newVersion": $newversion,
+  "files": [ $file ]
+}]'
+fi
diff --git a/nixpkgs/pkgs/applications/science/electronics/kicad/versions.nix b/nixpkgs/pkgs/applications/science/electronics/kicad/versions.nix
new file mode 100644
index 000000000000..36114fff73a3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/kicad/versions.nix
@@ -0,0 +1,70 @@
+# This file was generated by update.sh
+
+{
+  "kicad" = {
+    kicadVersion = {
+      version =			"8.0.1";
+      src = {
+        rev =			"20421d65e5a7ede894345d337ab47b469f5ba154";
+        sha256 =		"096kvmm96ccxir1rspgzzjkp6y2j80l3w2vphg9iv3drxmjp7qjv";
+      };
+    };
+    libVersion = {
+      version =			"8.0.1";
+      libSources = {
+        symbols.rev =		"d6aff3948edfca2bacf36900ff080f6b3f65fe4c";
+        symbols.sha256 =	"00xnvikmqd1zkg9p1f89kvryvkybl5f20baij6babqyc29nbzkwy";
+        templates.rev =		"0a6c4f798a68a5c639d54b4d3093460ab9267816";
+        templates.sha256 =	"0m9bggz3cm27kqpjjwxy19mqzk0c69bywcjkqcni7kafr21c6k4z";
+        footprints.rev =	"226b4f3d5c10a4126d88b895188bdab629fe60b0";
+        footprints.sha256 =	"1bb3mb2a7vkridgmqqm9ib3hv2m4zx1i14mglb11sribypy0ma5p";
+        packages3d.rev =	"49c1cd4017499b8a7f6dedbe7ede834d1713eb28";
+        packages3d.sha256 =	"0b5jwr5bbd0kzb75nj3028knjrv0872dk54sbsnxaz669q8zaxap";
+      };
+    };
+  };
+  "kicad-testing" = {
+    kicadVersion = {
+      version =			"8.0-2024-02-23";
+      src = {
+        rev =			"14d71c8ca6b48d2eb956bb069acf05a37b1b2652";
+        sha256 =		"0xqd0xbpnvsvba75526nwgzr8l2cfxy99sjmg13sjxfx7rq16kqi";
+      };
+    };
+    libVersion = {
+      version =			"8.0-2024-02-23";
+      libSources = {
+        symbols.rev =		"e228d4e8b295364e90e36c57f4023d8285ba88cd";
+        symbols.sha256 =	"049h2a7yn6ks8sybppixa872dbvyd0rwf9r6nixvdg6d13fl6rwf";
+        templates.rev =		"2e00c233b67e35323f90d04c190bf70237a252f2";
+        templates.sha256 =	"0m9bggz3cm27kqpjjwxy19mqzk0c69bywcjkqcni7kafr21c6k4z";
+        footprints.rev =	"6e5329a6d4aaa81290e23af3eba88f505c2f61b0";
+        footprints.sha256 =	"0ypjlbmzmcl3pha3q2361va70c988b1drxy8320gm66jkzfc21a1";
+        packages3d.rev =	"d1e521228d9f5888836b1a6a35fb05fb925456fa";
+        packages3d.sha256 =	"0lcy1av7ixg1f7arflk50jllpc1749sfvf3h62hkxsz97wkr97xj";
+      };
+    };
+  };
+  "kicad-unstable" = {
+    kicadVersion = {
+      version =			"2024-02-23";
+      src = {
+        rev =			"b7b64d959f37f00bb0d14b007c3b3908196e1024";
+        sha256 =		"1gl7mjqpmqq4m55z6crwb77983g00gi2161ichsc7hsfhs4c8grh";
+      };
+    };
+    libVersion = {
+      version =			"2024-02-23";
+      libSources = {
+        symbols.rev =		"8b0c343d8694fe0a968e5c4af69fd161bacf7da1";
+        symbols.sha256 =	"049h2a7yn6ks8sybppixa872dbvyd0rwf9r6nixvdg6d13fl6rwf";
+        templates.rev =		"0a6c4f798a68a5c639d54b4d3093460ab9267816";
+        templates.sha256 =	"0m9bggz3cm27kqpjjwxy19mqzk0c69bywcjkqcni7kafr21c6k4z";
+        footprints.rev =	"ded6b053460faae5783c538a38e91e2b4bddcf2e";
+        footprints.sha256 =	"035bf37n4vrihaj4zfdncisdx9fly1vya7lhkxhlsbv5blpi4a5y";
+        packages3d.rev =	"984667325076d4e50dab14e755aeacf97f42194c";
+        packages3d.sha256 =	"0lkaxv02h4sxrnm8zr17wl9d07mazlisad78r35gry741i362cdg";
+      };
+    };
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/kicad/writable.patch b/nixpkgs/pkgs/applications/science/electronics/kicad/writable.patch
new file mode 100644
index 000000000000..a2969f26f43b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/kicad/writable.patch
@@ -0,0 +1,49 @@
+commit 6a72fd032405515e468797be91b5a6ebcbbb5fd8
+Author: Evils <evils.devils@protonmail.com>
+Date:   Wed Nov 23 19:49:13 2022 +0100
+
+    ensure new projects are writable
+
+diff --git a/kicad/kicad_manager_frame.cpp b/kicad/kicad_manager_frame.cpp
+index 7ee8090858..391514519c 100644
+--- a/kicad/kicad_manager_frame.cpp
++++ b/kicad/kicad_manager_frame.cpp
+@@ -638,6 +638,12 @@ void KICAD_MANAGER_FRAME::CreateNewProject( const wxFileName& aProjectFileName,
+ 
+                 // wxFFile dtor will close the file
+             }
++
++            if( destFileName.IsOk() && !destFileName.IsFileWritable() )
++            {
++                destFileName.SetPermissions(0644);
++            }
++
+         }
+     }
+ 
+diff --git a/kicad/project_template.cpp b/kicad/project_template.cpp
+index bf951fcddb..2bef94326b 100644
+--- a/kicad/project_template.cpp
++++ b/kicad/project_template.cpp
+@@ -282,6 +282,21 @@ bool PROJECT_TEMPLATE::CreateProject( wxFileName& aNewProjectPath, wxString* aEr
+ 
+             result = false;
+         }
++	else if( !destFile.IsFileWritable() && !destFile.SetPermissions(0644) )
++        {
++            if( aErrorMsg )
++            {
++                if( !aErrorMsg->empty() )
++                    *aErrorMsg += "\n";
++
++                wxString msg;
++
++                msg.Printf( _( "Cannot make file writable: '%s'." ), destFile.GetFullPath() );
++                *aErrorMsg += msg;
++            }
++
++            result = false;
++	}
+     }
+ 
+     return result;
diff --git a/nixpkgs/pkgs/applications/science/electronics/kingstvis/default.nix b/nixpkgs/pkgs/applications/science/electronics/kingstvis/default.nix
new file mode 100644
index 000000000000..3699aebbbff0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/kingstvis/default.nix
@@ -0,0 +1,59 @@
+{ buildFHSEnv
+, dbus
+, fetchzip
+, fontconfig
+, freetype
+, glib
+, lib
+, libGL
+, stdenv
+, xkeyboard_config
+, xorg
+, zlib
+}:
+
+let
+  name = "kingstvis";
+  version = "3.6.1";
+  src = fetchzip {
+    url = "http://res.kingst.site/kfs/KingstVIS_v${version}.tar.gz";
+    hash = "sha256-eZJ3RZWdmNx/El3Hh5kUf44pIwdvwOEkRysYBgUkS18=";
+  };
+in
+
+buildFHSEnv {
+  inherit name;
+
+  targetPkgs = pkgs: (with pkgs; [
+    dbus
+    fontconfig
+    freetype
+    glib
+    libGL
+    xkeyboard_config
+    xorg.libICE
+    xorg.libSM
+    xorg.libX11
+    xorg.libXext
+    xorg.libXi
+    xorg.libXrender
+    xorg.libxcb
+    zlib
+  ]);
+
+  extraInstallCommands = ''
+    install -Dvm644 ${src}/Driver/99-Kingst.rules \
+      $out/lib/udev/rules.d/99-Kingst.rules
+  '';
+
+  runScript = "${src}/KingstVIS";
+
+  meta = {
+    description = "Kingst Virtual Instruments Studio, software for logic analyzers";
+    homepage = "http://www.qdkingst.com/";
+    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
+    license = lib.licenses.unfree;
+    maintainers = [ lib.maintainers.luisdaranda ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/lepton-eda/default.nix b/nixpkgs/pkgs/applications/science/electronics/lepton-eda/default.nix
new file mode 100644
index 000000000000..00b0961895d3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/lepton-eda/default.nix
@@ -0,0 +1,62 @@
+{ stdenv
+, lib
+, pkg-config
+, makeWrapper
+, texinfo
+, fetchurl
+, autoreconfHook
+, guile
+, flex
+, gtk3
+, glib
+, gtksheet
+, gettext
+, gawk
+, shared-mime-info
+, groff
+, libstroke
+}:
+
+stdenv.mkDerivation rec {
+  pname = "lepton-eda";
+  version = "1.9.18-20220529";
+
+  src = fetchurl {
+    url = "https://github.com/lepton-eda/lepton-eda/releases/download/${version}/lepton-eda-${builtins.head (lib.splitString "-" version)}.tar.gz";
+    hash = "sha256-X9yNuosNR1Jf3gYWQZeOnKdxzJLld29Sn9XYsPGWYYI=";
+  };
+
+  nativeBuildInputs = [ pkg-config makeWrapper texinfo autoreconfHook ];
+
+  propagatedBuildInputs = [ guile flex gtk3 glib gtksheet gettext gawk shared-mime-info groff libstroke ];
+
+  configureFlags = [
+    "--disable-update-xdg-database"
+    "--with-gtk3"
+  ];
+
+  CFLAGS = [
+    "-DSCM_DEBUG_TYPING_STRICTNESS=2"
+  ];
+
+  postInstall = ''
+    libs="${lib.makeLibraryPath propagatedBuildInputs}"
+    for program in $out/bin/*; do
+      wrapProgram "$program" \
+        --prefix LD_LIBRARY_PATH : "$libs" \
+        --prefix LTDL_LIBRARY_PATH : "$out/lib"
+    done
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/lepton-eda";
+    description = "Lepton Electronic Design Automation";
+    longDescription = ''
+      Lepton EDA is a suite of free software tools for designing electronics.
+      It provides schematic capture, netlisting into over 30 netlist formats, and many other features.
+    '';
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ tesq0 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/librepcb/default.nix b/nixpkgs/pkgs/applications/science/electronics/librepcb/default.nix
new file mode 100644
index 000000000000..dfd679d4d531
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/librepcb/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, lib, fetchFromGitHub
+, qtbase, qttools, qtquickcontrols2, opencascade-occt, libGLU, libSM, freeimage, cmake, wrapQtAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "librepcb";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner  = pname;
+    repo   = pname;
+    rev    = version;
+    sha256 = "sha256-2o2Gue/RnDWxe8jk/Ehx9CM+B3ac5rEQn0H7yodUEZ8=";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ cmake qttools wrapQtAppsHook qtquickcontrols2 opencascade-occt libGLU ];
+  buildInputs = [ qtbase ];
+  propagatedBuildInputs = [ libSM freeimage ];
+
+  meta = with lib; {
+    description = "A free EDA software to develop printed circuit boards";
+    homepage    = "https://librepcb.org/";
+    maintainers = with maintainers; [ luz thoughtpolice ];
+    license     = licenses.gpl3Plus;
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/linux-gpib/common.nix b/nixpkgs/pkgs/applications/science/electronics/linux-gpib/common.nix
new file mode 100644
index 000000000000..e87751a18860
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/linux-gpib/common.nix
@@ -0,0 +1,24 @@
+{ pname, fetchurl, lib }: rec {
+  version = "4.3.6";
+  inherit pname;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/linux-gpib/linux-gpib%20for%203.x.x%20and%202.6.x%20kernels/${version}/linux-gpib-${version}.tar.gz";
+    hash = "sha256-Gze4xrvkhEgn+J5Jhrycezjp2uhlD1v6aX0WGv4J2Jg=";
+  };
+
+  unpackPhase = ''
+    tar xf $src
+    tar xf linux-gpib-${version}/${pname}-${version}.tar.gz
+  '';
+
+  sourceRoot = "${pname}-${version}";
+
+  meta = with lib; {
+    description = "Support package for GPIB (IEEE 488) hardware";
+    homepage = "https://linux-gpib.sourceforge.io/";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ fsagbuya ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/linux-gpib/kernel.nix b/nixpkgs/pkgs/applications/science/electronics/linux-gpib/kernel.nix
new file mode 100644
index 000000000000..d64e2fc81fbd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/linux-gpib/kernel.nix
@@ -0,0 +1,23 @@
+{ lib
+, stdenv
+, fetchurl
+, kernel
+, pahole
+}:
+
+stdenv.mkDerivation (import ./common.nix { inherit fetchurl lib; pname = "linux-gpib-kernel"; } // {
+
+  postPatch = ''
+    sed -i 's@/sbin/depmod -A@@g' Makefile
+  '';
+
+  buildInputs = [ pahole ] ++ kernel.moduleBuildDependencies;
+
+  makeFlags = [
+    "LINUX_SRCDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
+  ];
+
+  installFlags = [
+    "INSTALL_MOD_PATH=$(out)"
+  ];
+})
diff --git a/nixpkgs/pkgs/applications/science/electronics/linux-gpib/user.nix b/nixpkgs/pkgs/applications/science/electronics/linux-gpib/user.nix
new file mode 100644
index 000000000000..f9c9a2e1e6cb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/linux-gpib/user.nix
@@ -0,0 +1,25 @@
+{ lib
+, stdenv
+, fetchurl
+, autoconf
+, libtool
+, bison
+, flex
+, automake
+}:
+
+stdenv.mkDerivation (import ./common.nix { inherit fetchurl lib; pname = "linux-gpib-user"; } // {
+
+  nativeBuildInputs = [
+    autoconf
+    libtool
+    bison
+    flex
+    automake
+  ];
+
+  configureFlags = [
+    "--sysconfdir=$(out)/etc"
+    "--prefix=$(out)"
+  ];
+})
diff --git a/nixpkgs/pkgs/applications/science/electronics/magic-vlsi/default.nix b/nixpkgs/pkgs/applications/science/electronics/magic-vlsi/default.nix
new file mode 100644
index 000000000000..5fc4b0036f9f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/magic-vlsi/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv
+, fetchurl
+, python3
+, m4
+, cairo
+, libX11
+, mesa_glu
+, ncurses
+, tcl
+, tcsh
+, tk
+}:
+
+stdenv.mkDerivation rec {
+  pname = "magic-vlsi";
+  version = "8.3.465";
+
+  src = fetchurl {
+    url    = "http://opencircuitdesign.com/magic/archive/magic-${version}.tgz";
+    sha256 = "sha256-cb9A8rpjD3x3fJo+xexlyzn+/3M5iUJmSoBraom9zd8=";
+  };
+
+  nativeBuildInputs = [ python3 ];
+  buildInputs = [
+    cairo
+    libX11
+    m4
+    mesa_glu
+    ncurses
+    tcl
+    tcsh
+    tk
+  ];
+
+  enableParallelBuilding = true;
+
+  configureFlags = [
+    "--with-tcl=${tcl}"
+    "--with-tk=${tk}"
+    "--disable-werror"
+  ];
+
+  postPatch = ''
+    patchShebangs scripts/*
+  '';
+
+  env.NIX_CFLAGS_COMPILE = "-Wno-implicit-function-declaration";
+
+  meta = with lib; {
+    description = "VLSI layout tool written in Tcl";
+    homepage    = "http://opencircuitdesign.com/magic/";
+    license     = licenses.mit;
+    maintainers = with maintainers; [ thoughtpolice AndersonTorres ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/nanovna-saver/default.nix b/nixpkgs/pkgs/applications/science/electronics/nanovna-saver/default.nix
new file mode 100644
index 000000000000..d1b38d8b8e07
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/nanovna-saver/default.nix
@@ -0,0 +1,59 @@
+{
+  lib,
+  python3,
+  fetchFromGitHub,
+  fetchpatch,
+  qt6,
+}:
+python3.pkgs.buildPythonApplication rec {
+  pname = "nanovna-saver";
+  version = "0.6.3";
+
+  src = fetchFromGitHub {
+    owner = "NanoVNA-Saver";
+    repo = pname;
+    rev = "refs/tags/v${version}";
+    sha256 = "sha256-lL6n3hcsIbLmrRKPi/ckWW2XUAtmBqvMSplkWOF4VKQ=";
+  };
+
+   nativeBuildInputs = [
+    qt6.wrapQtAppsHook
+    qt6.qtbase
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    cython
+    scipy
+    pyqt6
+    pyserial
+    numpy
+    setuptools
+    setuptools-scm
+  ];
+
+  doCheck = false;
+
+  dontWrapGApps = true;
+  dontWrapQtApps = true;
+
+  preFixup = ''
+    makeWrapperArgs+=(
+      "''${gappsWrapperArgs[@]}"
+      "''${qtWrapperArgs[@]}"
+    )
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/NanoVNA-Saver/nanovna-saver";
+    description =
+      "A tool for reading, displaying and saving data from the NanoVNA";
+    mainProgram = "NanoVNASaver";
+    longDescription = ''
+      A multiplatform tool to save Touchstone files from the NanoVNA, sweep
+      frequency spans in segments to gain more than 101 data points, and
+      generally display and analyze the resulting data.
+    '';
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ zaninime tmarkus ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/nvc/default.nix b/nixpkgs/pkgs/applications/science/electronics/nvc/default.nix
new file mode 100644
index 000000000000..48c9b17816e9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/nvc/default.nix
@@ -0,0 +1,66 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, check
+, flex
+, pkg-config
+, which
+, elfutils
+, libffi
+, llvm
+, zlib
+, zstd
+}:
+
+stdenv.mkDerivation rec {
+  pname = "nvc";
+  version = "1.11.3";
+
+  src = fetchFromGitHub {
+    owner = "nickg";
+    repo = "nvc";
+    rev = "r${version}";
+    hash = "sha256-Z4YxXPf8uKlASSK9v6fbtHtkUibc9EeA4i+3kD/vBmY=";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    check
+    flex
+    pkg-config
+    which
+  ];
+
+  buildInputs = [
+    libffi
+    llvm
+    zlib
+    zstd
+  ] ++ lib.optionals stdenv.isLinux [
+    elfutils
+  ];
+
+  preConfigure = ''
+    mkdir build
+    cd build
+  '';
+
+  configureScript = "../configure";
+
+  configureFlags = [
+    "--enable-vhpi"
+    "--disable-lto"
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "VHDL compiler and simulator";
+    mainProgram = "nvc";
+    homepage = "https://www.nickg.me.uk/nvc/";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ wegank ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/openboardview/default.nix b/nixpkgs/pkgs/applications/science/electronics/openboardview/default.nix
new file mode 100644
index 000000000000..4eaf29133a44
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/openboardview/default.nix
@@ -0,0 +1,76 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, fetchpatch
+, gitUpdater
+, cmake
+, pkg-config
+, python3
+, SDL2
+, fontconfig
+, gtk3
+, wrapGAppsHook
+, darwin
+}:
+
+let
+  inherit (darwin.apple_sdk.frameworks) Cocoa;
+in
+stdenv.mkDerivation rec {
+  pname = "openboardview";
+  version = "9.95.0";
+
+  src = fetchFromGitHub {
+    owner = "OpenBoardView";
+    repo = "OpenBoardView";
+    rev = version;
+    sha256 = "sha256-sKDDOPpCagk7rBRlMlZhx+RYYbtoLzJsrnL8qKZMKW8=";
+    fetchSubmodules = true;
+  };
+
+  patches = [
+    # Fix gcc-13 build failure
+    (fetchpatch {
+      name = "gcc-13.patch";
+      url = "https://github.com/OpenBoardView/OpenBoardView/commit/b03d0f69ec1611f5eb93f81291b4ba8c58cd29eb.patch";
+      hash = "sha256-Hp7KgzulPC2bPtRsd6HJrTLu0oVoQEoBHl0p2DcOLQw=";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config python3 wrapGAppsHook ];
+  buildInputs = [ SDL2 fontconfig gtk3 ] ++ lib.optionals stdenv.isDarwin [
+    Cocoa
+  ];
+
+  postPatch = ''
+    substituteInPlace src/openboardview/CMakeLists.txt \
+      --replace "SDL2::SDL2main" ""
+    substituteInPlace CMakeLists.txt --replace "fixup_bundle" "#fixup_bundle"
+  '';
+
+  cmakeFlags = [
+    "-DGLAD_REPRODUCIBLE=On"
+  ];
+
+  dontWrapGApps = true;
+  postFixup = lib.optionalString stdenv.isDarwin ''
+      mkdir -p "$out/Applications"
+      mv "$out/openboardview.app" "$out/Applications/OpenBoardView.app"
+  '' + lib.optionalString (!stdenv.isDarwin) ''
+      wrapGApp "$out/bin/${pname}" \
+        --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ gtk3 ]}
+  '';
+
+  passthru.updateScript = gitUpdater {
+    ignoredVersions = ''.*\.90\..*'';
+  };
+
+  meta = with lib; {
+    description = "Linux SDL/ImGui edition software for viewing .brd files";
+    mainProgram = "openboardview";
+    homepage = "https://github.com/OpenBoardView/OpenBoardView";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ k3a ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/openems/default.nix b/nixpkgs/pkgs/applications/science/electronics/openems/default.nix
new file mode 100644
index 000000000000..864b120993d9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/openems/default.nix
@@ -0,0 +1,69 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, csxcad
+, fparser
+, tinyxml
+, hdf5
+, vtk
+, boost
+, zlib
+, cmake
+, octave
+, mpi
+, withQcsxcad ? true
+, withMPI ? false
+, withHyp2mat ? true
+, qcsxcad
+, hyp2mat
+}:
+
+stdenv.mkDerivation rec {
+  pname = "openems";
+  version = "0.0.36";
+
+  src = fetchFromGitHub {
+    owner = "thliebig";
+    repo = "openEMS";
+    rev = "v${version}";
+    sha256 = "sha256-wdH+Zw7G2ZigzBMX8p3GKdFVx/AhbTNL+P3w+YjI/dc=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  cmakeFlags = lib.optionals withMPI [ "-DWITH_MPI=ON" ];
+
+  buildInputs = [
+    fparser
+    tinyxml
+    hdf5
+    vtk
+    boost
+    zlib
+    csxcad
+    (octave.override { inherit hdf5; }) ]
+    ++ lib.optionals withQcsxcad [ qcsxcad ]
+    ++ lib.optionals withMPI [ mpi ]
+    ++ lib.optionals withHyp2mat [ hyp2mat ];
+
+  postFixup = ''
+    substituteInPlace $out/share/openEMS/matlab/setup.m \
+      --replace /usr/lib ${hdf5}/lib \
+      --replace /usr/include ${hdf5}/include
+
+    ${octave}/bin/mkoctfile -L${hdf5}/lib -I${hdf5}/include \
+      -lhdf5 $out/share/openEMS/matlab/h5readatt_octave.cc \
+      -o $out/share/openEMS/matlab/h5readatt_octave.oct
+  '';
+
+  meta = with lib; {
+    description = "Open Source Electromagnetic Field Solver";
+    homepage = "http://openems.de/index.php/Main_Page.html";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ matthuszagh ];
+    platforms = platforms.linux;
+    badPlatforms = platforms.aarch64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/openhantek6022/default.nix b/nixpkgs/pkgs/applications/science/electronics/openhantek6022/default.nix
new file mode 100644
index 000000000000..ca0c651fad27
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/openhantek6022/default.nix
@@ -0,0 +1,32 @@
+{ mkDerivation, lib, fetchFromGitHub, makeWrapper, cmake, qtbase, qttools, fftw, libusb1, libglvnd }:
+
+mkDerivation rec {
+  pname = "openhantek6022";
+  version = "3.3.3";
+
+  src = fetchFromGitHub {
+    owner = "OpenHantek";
+    repo = "OpenHantek6022";
+    rev = version;
+    sha256 = "sha256-y2pNLAa0P/r0YEdKjQ3iP66cqtTWERG8lTOZDR64WTk=";
+  };
+
+  nativeBuildInputs = [ cmake makeWrapper ];
+  buildInputs = [ fftw libusb1 libglvnd qtbase qttools ];
+
+  postPatch = ''
+    # Fix up install paths & checks
+    sed -i 's#if(EXISTS ".*")#if(1)#g' CMakeLists.txt
+    sed -i 's#/lib/udev#lib/udev#g' CMakeLists.txt
+    sed -i 's#/usr/share#share#g' CMakeLists.txt
+  '';
+
+  meta = with lib; {
+    description = "Free software for Hantek and compatible (Voltcraft/Darkwire/Protek/Acetech) USB digital signal oscilloscopes";
+    mainProgram = "OpenHantek";
+    homepage = "https://github.com/OpenHantek/OpenHantek6022";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ baracoder ];
+    platforms = qtbase.meta.platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/openroad/0001-Disable-failing-regression-tests.patch b/nixpkgs/pkgs/applications/science/electronics/openroad/0001-Disable-failing-regression-tests.patch
new file mode 100644
index 000000000000..e370bc860b55
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/openroad/0001-Disable-failing-regression-tests.patch
@@ -0,0 +1,83 @@
+From dc32aabd50d53aece41d968649b972ee667875bb Mon Sep 17 00:00:00 2001
+From: Tobias Mayer <tobim@fastmail.fm>
+Date: Sun, 27 Aug 2023 15:08:50 +0200
+Subject: [PATCH] Disable failing regression tests
+
+---
+ src/drt/test/regression_tests.tcl | 6 +++---
+ src/odb/test/regression_tests.tcl | 4 ++--
+ src/par/test/regression_tests.tcl | 2 +-
+ src/pdn/test/regression_tests.tcl | 2 +-
+ src/rcx/test/regression_tests.tcl | 6 +++---
+ 5 files changed, 10 insertions(+), 10 deletions(-)
+
+diff --git a/src/drt/test/regression_tests.tcl b/src/drt/test/regression_tests.tcl
+index 11705562d..15546244a 100644
+--- a/src/drt/test/regression_tests.tcl
++++ b/src/drt/test/regression_tests.tcl
+@@ -9,6 +9,6 @@ record_tests {
+   top_level_term
+   top_level_term2
+ }
+-record_pass_fail_tests {
+-  gc_test
+-}
++#record_pass_fail_tests {
++#  gc_test
++#}
+diff --git a/src/odb/test/regression_tests.tcl b/src/odb/test/regression_tests.tcl
+index b8e4f917a..7c6a0223a 100644
+--- a/src/odb/test/regression_tests.tcl
++++ b/src/odb/test/regression_tests.tcl
+@@ -34,9 +34,9 @@ record_tests {
+ }
+ 
+ record_pass_fail_tests {
+-  cpp_tests
++  #cpp_tests
+   dump_netlists
+   dump_netlists_withfill
+-  parser_unit_test
++  #parser_unit_test
+ }
+ 
+diff --git a/src/par/test/regression_tests.tcl b/src/par/test/regression_tests.tcl
+index 9ff31fb12..63d5d0dae 100644
+--- a/src/par/test/regression_tests.tcl
++++ b/src/par/test/regression_tests.tcl
+@@ -1,4 +1,4 @@
+ record_tests {
+   read_part
+-  partition_gcd
++  #partition_gcd
+ }
+diff --git a/src/pdn/test/regression_tests.tcl b/src/pdn/test/regression_tests.tcl
+index 86c334f24..b695c490c 100644
+--- a/src/pdn/test/regression_tests.tcl
++++ b/src/pdn/test/regression_tests.tcl
+@@ -10,7 +10,7 @@ record_tests {
+   max_width
+   min_spacing
+   widthtable
+-  design_width
++  #design_width
+   offgrid
+ 
+   core_grid
+diff --git a/src/rcx/test/regression_tests.tcl b/src/rcx/test/regression_tests.tcl
+index 7070cc45f..72f348d96 100644
+--- a/src/rcx/test/regression_tests.tcl
++++ b/src/rcx/test/regression_tests.tcl
+@@ -6,6 +6,6 @@ record_tests {
+   45_gcd
+   names
+ }
+-record_pass_fail_tests {
+-  rcx_unit_test
+-}
++#record_pass_fail_tests {
++#  rcx_unit_test
++#}
+-- 
+2.41.0
+
diff --git a/nixpkgs/pkgs/applications/science/electronics/openroad/0002-Ignore-warning-on-stderr.patch b/nixpkgs/pkgs/applications/science/electronics/openroad/0002-Ignore-warning-on-stderr.patch
new file mode 100644
index 000000000000..f0b0666789a7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/openroad/0002-Ignore-warning-on-stderr.patch
@@ -0,0 +1,41 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Nicolas Benes <nbenes.gh@xandea.de>
+Date: Sun, 2 Apr 2023 04:57:17 +0200
+Subject: [PATCH] Ignore warning on stderr
+
+The following warning is written to stderr, which causes the overall
+test to fail:
+
+```
+sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
+```
+
+diff --git a/src/dst/test/cpp_tests.tcl b/src/dst/test/cpp_tests.tcl
+index 9087c2c..63d0cb7 100644
+--- a/src/dst/test/cpp_tests.tcl
++++ b/src/dst/test/cpp_tests.tcl
+@@ -4,7 +4,7 @@ set test_dir [pwd]
+ set openroad_dir [file dirname [file dirname [file dirname $test_dir]]]
+ set tests_path [file join $openroad_dir "build" "src" "dst" "test" "cpp"]
+ 
+-set tests_list [split [exec sh -c "find $tests_path -maxdepth 1 -name 'Test*'"] \n]
++set tests_list [split [exec -ignorestderr sh -c "find $tests_path -maxdepth 1 -name 'Test*'"] \n]
+ 
+ foreach test $tests_list {
+     set test_name [file tail $test]
+diff --git a/src/odb/test/cpp_tests.tcl b/src/odb/test/cpp_tests.tcl
+index 091d576..6811760 100644
+--- a/src/odb/test/cpp_tests.tcl
++++ b/src/odb/test/cpp_tests.tcl
+@@ -4,7 +4,7 @@ set test_dir [pwd]
+ set openroad_dir [file dirname [file dirname [file dirname $test_dir]]]
+ set tests_path [file join $openroad_dir "build" "src" "odb" "test" "cpp"]
+ 
+-set tests_list [split [exec sh -c "find $tests_path -maxdepth 1 -name 'Test*' ! -name '*.cmake'"] \n]
++set tests_list [split [exec -ignorestderr sh -c "find $tests_path -maxdepth 1 -name 'Test*' ! -name '*.cmake'"] \n]
+ 
+ foreach test $tests_list {
+     set test_name [file tail $test]
+-- 
+2.38.4
+
diff --git a/nixpkgs/pkgs/applications/science/electronics/openroad/default.nix b/nixpkgs/pkgs/applications/science/electronics/openroad/default.nix
new file mode 100644
index 000000000000..16659892a6ee
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/openroad/default.nix
@@ -0,0 +1,133 @@
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, fetchpatch
+, bison
+, cmake
+, doxygen
+, flex
+, git
+, python3
+, swig4
+, boost179
+, cbc       # for clp
+, cimg
+, clp       # for or-tools
+, eigen
+, glpk
+, gtest
+, lcov
+, lemon-graph
+, libjpeg
+, or-tools
+, pcre
+, pkg-config
+, qtbase
+, re2       # for or-tools
+, readline
+, spdlog
+, tcl
+, tcllib
+, xorg
+, yosys
+, zlib
+}:
+
+mkDerivation rec {
+  pname = "openroad";
+  version = "unstable-2023-08-26";
+
+  src = fetchFromGitHub {
+    owner = "The-OpenROAD-Project";
+    repo = "OpenROAD";
+    rev = "6dba515c2aacd3fca58ef8135424884146efd95b";
+    fetchSubmodules = true;
+    hash = "sha256-LAj7X+Vq0+H3tIo5zgyUuIjQwTj+2DLL18/KMJ/kf4A=";
+  };
+
+  nativeBuildInputs = [
+    bison
+    cmake
+    doxygen
+    flex
+    git
+    pkg-config
+    swig4
+  ];
+
+  buildInputs = [
+    boost179
+    cbc
+    cimg
+    clp
+    eigen
+    glpk
+    lcov
+    lemon-graph
+    libjpeg
+    or-tools
+    pcre
+    python3
+    qtbase
+    re2
+    readline
+    spdlog
+    tcl
+    tcllib
+    yosys
+    xorg.libX11
+    zlib
+  ];
+
+  patches = [
+    # https://github.com/The-OpenROAD-Project/OpenROAD/pull/3911
+    (fetchpatch {
+      name = "openroad-fix-fmt-10.patch";
+      url = "https://github.com/The-OpenROAD-Project/OpenROAD/commit/9396f07f28e0260cd64acfc51909f6566b70e682.patch";
+      hash = "sha256-jy8K8pdhSswVz6V6otk8JAI7nndaFVMuKQ/4A3Kzwns=";
+    })
+    # Upstream is not aware of these failures
+    ./0001-Disable-failing-regression-tests.patch
+    # This is an issue we experience in the sandbox, and upstream
+    # probably wouldn't mind merging this change, but no PR was opened.
+    ./0002-Ignore-warning-on-stderr.patch
+  ];
+
+  postPatch = ''
+    patchShebangs --build etc/find_messages.py
+  '';
+
+  # Enable output images from the placer.
+  cmakeFlags = [
+    # Tries to download gtest 1.13 as part of the build. We currently rely on
+    # the regression tests so we can get by without building unit tests.
+    "-DENABLE_TESTS=OFF"
+    "-DUSE_SYSTEM_BOOST=ON"
+    "-DUSE_CIMG_LIB=ON"
+    "-DOPENROAD_VERSION=${src.rev}"
+  ];
+
+  # Resynthesis needs access to the Yosys binaries.
+  qtWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ yosys ]}" ];
+
+  # Upstream uses vendored package versions for some dependencies, so regression testing is prudent
+  # to see if there are any breaking changes in unstable that should be vendored as well.
+  doCheck = true;
+  checkPhase = ''
+    ../test/regression
+  '';
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    $out/bin/openroad -version
+    $out/bin/sta -version
+  '';
+
+  meta = with lib; {
+    description = "OpenROAD's unified application implementing an RTL-to-GDS flow";
+    homepage = "https://theopenroadproject.org";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ trepetti ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/pcb/default.nix b/nixpkgs/pkgs/applications/science/electronics/pcb/default.nix
new file mode 100644
index 000000000000..f8623d9a7bf7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/pcb/default.nix
@@ -0,0 +1,68 @@
+{ lib, stdenv
+, fetchurl
+, pkg-config
+, gtk2
+, bison
+, intltool
+, flex
+, netpbm
+, imagemagick
+, dbus
+, freetype
+, fontconfig
+, libGLU
+, libGL
+, shared-mime-info
+, tcl
+, tk
+, gnome2
+, gd
+, xorg
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pcb";
+  version = "4.3.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/pcb/${pname}-${version}.tar.gz";
+    sha256 = "sha256-roUvRq+Eq6f1HYE/uRb8f82+6kP3E08VBQcCThdD+14=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    bison
+    intltool
+    flex
+    netpbm
+    imagemagick
+  ];
+
+  buildInputs = [
+    gtk2
+    dbus
+    xorg.libXrender
+    freetype
+    fontconfig
+    libGLU
+    libGL
+    tcl
+    shared-mime-info
+    tk
+    gnome2.gtkglext
+    gd
+    xorg.libXmu
+  ];
+
+  configureFlags = [
+    "--disable-update-desktop-database"
+  ];
+
+  meta = with lib; {
+    description = "Printed Circuit Board editor";
+    homepage = "http://pcb.geda-project.org/";
+    maintainers = with maintainers; [ mog ];
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/picoscope/default.nix b/nixpkgs/pkgs/applications/science/electronics/picoscope/default.nix
new file mode 100644
index 000000000000..c7242117b68c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/picoscope/default.nix
@@ -0,0 +1,139 @@
+{ stdenv, lib, fetchurl, dpkg, makeWrapper , mono, gtk-sharp-3_0
+, glib, libusb1 , zlib, gtk3-x11, callPackage, writeTextDir
+, scopes ? [
+  "picocv"
+  "ps2000"
+  "ps2000a"
+  "ps3000"
+  "ps3000a"
+  "ps4000"
+  "ps4000a"
+  "ps5000"
+  "ps5000a"
+  "ps6000"
+  "ps6000a"
+] }:
+
+let
+  shared_meta = lib:
+    with lib; {
+      homepage = "https://www.picotech.com/downloads/linux";
+      maintainers = with maintainers; [ expipiplus1 wirew0rm ] ++ teams.lumiguide.members;
+      platforms = [ "x86_64-linux" ];
+      license = licenses.unfree;
+    };
+
+  libpicoipp = callPackage ({ stdenv, lib, fetchurl, autoPatchelfHook, dpkg }:
+    stdenv.mkDerivation rec {
+      pname = "libpicoipp";
+      inherit (sources.libpicoipp) version;
+      src = fetchurl { inherit (sources.libpicoipp) url sha256; };
+      nativeBuildInputs = [ dpkg autoPatchelfHook ];
+      buildInputs = [ stdenv.cc.cc.lib ];
+      sourceRoot = ".";
+      unpackCmd = "dpkg-deb -x $src .";
+      installPhase = ''
+        runHook preInstall
+        mkdir -p $out/lib
+        cp -d opt/picoscope/lib/* $out/lib
+        install -Dt $out/usr/share/doc/libpicoipp usr/share/doc/libpicoipp/copyright
+        runHook postInstall
+      '';
+      meta = with lib;
+        shared_meta lib // {
+          sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+          description = "library for picotech oscilloscope software";
+        };
+    }) { };
+
+  # If we don't have a platform available, put a dummy version here, so at
+  # least evaluation succeeds.
+  sources =
+    (lib.importJSON ./sources.json).${stdenv.system} or { picoscope.version = "unknown"; };
+
+  scopePkg = name:
+    { url, version, sha256 }:
+    stdenv.mkDerivation rec {
+      pname = "lib${name}";
+      inherit version;
+      src = fetchurl { inherit url sha256; };
+      # picoscope does a signature check, so we can't patchelf these
+      nativeBuildInputs = [ dpkg ];
+      sourceRoot = ".";
+      unpackCmd = "dpkg-deb -x $src .";
+      installPhase = ''
+        runHook preInstall
+        mkdir -p $out/lib
+        cp -d opt/picoscope/lib/* $out/lib
+         runHook postInstall
+      '';
+      meta = with lib;
+        shared_meta lib // {
+          description = "library for picotech oscilloscope ${name} series";
+        };
+    };
+
+  scopePkgs = lib.mapAttrs scopePkg sources;
+
+in stdenv.mkDerivation rec {
+  pname = "picoscope";
+  inherit (sources.picoscope) version;
+
+  src = fetchurl { inherit (sources.picoscope) url sha256; };
+
+  nativeBuildInputs = [ dpkg makeWrapper ];
+  buildInputs = [ gtk-sharp-3_0 mono glib libusb1 zlib ];
+
+  unpackCmd = "dpkg-deb -x $src .";
+  sourceRoot = ".";
+  scopeLibs = lib.attrVals (map (x: "lib${x}") scopes) scopePkgs;
+  MONO_PATH = "${gtk-sharp-3_0}/lib/mono/gtk-sharp-3.0:" + (lib.makeLibraryPath
+    ([
+      glib
+      gtk3-x11
+      gtk-sharp-3_0
+      libusb1
+      zlib
+      libpicoipp
+    ] ++ scopeLibs));
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/
+    cp -dr usr/share $out/share
+    cp -dr opt/picoscope/* $out/
+    makeWrapper "$(command -v mono)" $out/bin/picoscope \
+      --add-flags $out/lib/PicoScope.GTK.exe \
+      --prefix MONO_PATH : "$MONO_PATH" \
+      --prefix LD_LIBRARY_PATH : "$MONO_PATH" \
+      --set LANG C
+    runHook postInstall
+  '';
+
+  # usage:
+  # services.udev.packages = [ pkgs.picoscope.rules ];
+  # users.groups.pico = {};
+  # users.users.you.extraGroups = [ "pico" ];
+  passthru.rules = writeTextDir "lib/udev/rules.d/95-pico.rules" ''
+    SUBSYSTEMS=="usb", ATTRS{idVendor}=="0ce9", MODE="664",GROUP="pico"
+  '';
+
+  meta = with lib;
+    shared_meta lib // {
+      description =
+        "Oscilloscope application that works with all PicoScope models";
+      longDescription = ''
+        PicoScope for Linux is a powerful oscilloscope application that works
+        with all PicoScope models. The most important features from PicoScope
+        for Windows are included—scope, spectrum analyzer, advanced triggers,
+        automated measurements, interactive zoom, persistence modes and signal
+        generator control. More features are being added all the time.
+
+        Waveform captures can be saved for off-line analysis, and shared with
+        PicoScope for Linux, PicoScope for macOS and PicoScope for Windows
+        users, or exported in text, CSV and MathWorks MATLAB 4 formats.
+      '';
+      sourceProvenance = with sourceTypes; [ binaryBytecode ];
+    };
+}
+
diff --git a/nixpkgs/pkgs/applications/science/electronics/picoscope/sources.json b/nixpkgs/pkgs/applications/science/electronics/picoscope/sources.json
new file mode 100644
index 000000000000..6b1d81978b9d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/picoscope/sources.json
@@ -0,0 +1,69 @@
+{
+  "x86_64-linux": {
+    "libpicocv": {
+      "sha256": "c0c5bec33c2c7fdd0f26b035ed942175f87012e33d6764c3abf1da31b5626037",
+      "url": "https://labs.picotech.com/rc/picoscope7/debian/pool/main/libp/libpicocv/libpicocv_1.1.34-beta2r172_amd64.deb",
+      "version": "1.1.34-beta2r172"
+    },
+    "libpicoipp": {
+      "sha256": "4a84f0af7f4e8cba91fad620eac0cd23c36b2fdda4637904be564286b10ffe1d",
+      "url": "https://labs.picotech.com/rc/picoscope7/debian/pool/main/libp/libpicoipp/libpicoipp_1.4.0-4r161_amd64.deb",
+      "version": "1.4.0-4r161"
+    },
+    "libps2000": {
+      "sha256": "473b065e79a7414c1e2b8c8468c8d2654333ac28f3a8c33b535626b33c60d2ca",
+      "url": "https://labs.picotech.com/rc/picoscope7/debian/pool/main/libp/libps2000/libps2000_3.0.127-3r5552_amd64.deb",
+      "version": "3.0.127-3r5552"
+    },
+    "libps2000a": {
+      "sha256": "8eba0052f9c7ef327710f2fba5aa11bec0c20225b39d77bb7b69cf80055c039c",
+      "url": "https://labs.picotech.com/rc/picoscope7/debian/pool/main/libp/libps2000a/libps2000a_2.1.127-5r5552_amd64.deb",
+      "version": "2.1.127-5r5552"
+    },
+    "libps3000": {
+      "sha256": "4e786036b8de0dd0f922aed947f30a53d31bed46b2df5132e8c9480c8a5d93e9",
+      "url": "https://labs.picotech.com/rc/picoscope7/debian/pool/main/libp/libps3000/libps3000_4.0.127-3r5552_amd64.deb",
+      "version": "4.0.127-3r5552"
+    },
+    "libps3000a": {
+      "sha256": "d2bb1e5bb151b0953ed30ca5421bb93d05dab898c33cdc89927e943ea991867a",
+      "url": "https://labs.picotech.com/rc/picoscope7/debian/pool/main/libp/libps3000a/libps3000a_2.1.127-6r5552_amd64.deb",
+      "version": "2.1.127-6r5552"
+    },
+    "libps4000": {
+      "sha256": "4c127e67949835b5ab5c5c8caa55f73c69df354d761aa53d6df99c8f8ac39009",
+      "url": "https://labs.picotech.com/rc/picoscope7/debian/pool/main/libp/libps4000/libps4000_2.1.127-2r5552_amd64.deb",
+      "version": "2.1.127-2r5552"
+    },
+    "libps4000a": {
+      "sha256": "26df82bc946e5bb30d599c4c365247bdbaa01e830d4d00630b46a6abcc1eef04",
+      "url": "https://labs.picotech.com/rc/picoscope7/debian/pool/main/libp/libps4000a/libps4000a_2.1.127-2r5552_amd64.deb",
+      "version": "2.1.127-2r5552"
+    },
+    "libps5000": {
+      "sha256": "106ef17862e98c3621f95c377f271c843664f481f84ef918d9eadd013561cd1b",
+      "url": "https://labs.picotech.com/rc/picoscope7/debian/pool/main/libp/libps5000/libps5000_2.1.127-3r5552_amd64.deb",
+      "version": "2.1.127-3r5552"
+    },
+    "libps5000a": {
+      "sha256": "fe9def134ef9df6654485911f14ece7b2ee3d79113aeee7826dd6e36bb5de3b4",
+      "url": "https://labs.picotech.com/rc/picoscope7/debian/pool/main/libp/libps5000a/libps5000a_2.1.127-5r5552_amd64.deb",
+      "version": "2.1.127-5r5552"
+    },
+    "libps6000": {
+      "sha256": "9b08c5b7fb2d34b0e2e98f2e0452a59105f612cd445a9e45d3cac14d931d18f2",
+      "url": "https://labs.picotech.com/rc/picoscope7/debian/pool/main/libp/libps6000/libps6000_2.1.127-6r5552_amd64.deb",
+      "version": "2.1.127-6r5552"
+    },
+    "libps6000a": {
+      "sha256": "2a23ccad72b9be83b87d449b6bb8ded23fd29c85ec9f78a45b6d45b38ccf335b",
+      "url": "https://labs.picotech.com/rc/picoscope7/debian/pool/main/libp/libps6000a/libps6000a_1.0.127-0r5552_amd64.deb",
+      "version": "1.0.127-0r5552"
+    },
+    "picoscope": {
+      "sha256": "d95f269171da7273b596dae95452789e889f12ef0f15c3baea26dd1b3a8117fc",
+      "url": "https://labs.picotech.com/rc/picoscope7/debian/pool/main/p/picoscope/picoscope_7.1.17-1r17318_amd64.deb",
+      "version": "7.1.17-1r17318"
+    }
+  }
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/picoscope/update.py b/nixpkgs/pkgs/applications/science/electronics/picoscope/update.py
new file mode 100755
index 000000000000..ecbd2292030d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/picoscope/update.py
@@ -0,0 +1,44 @@
+#!/usr/bin/env nix-shell
+#!nix-shell --pure -i python3 -p "python3.withPackages (ps: with ps; [ requests ])"
+import json
+import os
+import requests
+import sys
+
+def parse_packages(text):
+    res = []
+    for package in resp.text.split("\n\n"):
+        if not package: continue
+        pkg = {}
+        for field in package.split("\n"):
+            if field.startswith(" "): # multiline string
+                pkg[k] += "\n" + field[1:]
+            else:
+                [k, v] = field.split(": ", 1)
+                pkg[k] = v
+        res.append(pkg)
+    return res
+
+def generate_sources(packages):
+    sources_spec = {}
+    for pkg in pkgs:
+        sources_spec[pkg['Package']] = {
+            "url": "https://labs.picotech.com/rc/picoscope7/debian/" + pkg["Filename"],
+            "sha256": pkg["SHA256"],
+            "version": pkg["Version"]
+        }
+    return sources_spec
+
+out = {}
+for nix_system, release in {"x86_64-linux": "amd64"}.items():
+    resp = requests.get("https://labs.picotech.com/rc/picoscope7/debian//dists/picoscope/main/binary-"+release+"/Packages")
+    if resp.status_code != 200:
+        print("error: could not fetch data for release {} (code {})".format(release, resp.code), file=sys.stderr)
+        sys.exit(1)
+    pkgs = parse_packages(resp.text)
+    out[nix_system] = generate_sources(pkgs)
+
+with open(os.path.dirname(__file__) + "/sources.json", "w") as f:
+    json.dump(out, f, indent=2, sort_keys=True)
+    f.write('\n')
+
diff --git a/nixpkgs/pkgs/applications/science/electronics/pulseview/default.nix b/nixpkgs/pkgs/applications/science/electronics/pulseview/default.nix
new file mode 100644
index 000000000000..52685f1df254
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/pulseview/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchgit, pkg-config, cmake, glib, boost, libsigrok
+, libsigrokdecode, libserialport, libzip, libftdi1, hidapi, glibmm
+, pcre, python3, qtsvg, qttools, bluez
+, wrapQtAppsHook, desktopToDarwinBundle
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pulseview";
+  version = "0.4.2-unstable-2024-01-26";
+
+  src = fetchgit {
+    url = "git://sigrok.org/pulseview";
+    rev = "9b8b7342725491d626609017292fa9259f7d5e0e";
+    hash = "sha256-UEJunADzc1WRRfchO/n8qqxnyrSo4id1p7gLkD3CKaM=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config qttools wrapQtAppsHook ]
+    ++ lib.optional stdenv.isDarwin desktopToDarwinBundle;
+
+  buildInputs = [
+    glib boost libsigrok libsigrokdecode libserialport libzip libftdi1 hidapi glibmm
+    pcre python3
+    qtsvg
+  ] ++ lib.optionals stdenv.isLinux [ bluez ];
+
+  meta = with lib; {
+    description = "Qt-based LA/scope/MSO GUI for sigrok (a signal analysis software suite)";
+    mainProgram = "pulseview";
+    homepage = "https://sigrok.org/";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ bjornfor vifino ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/qucs-s/default.nix b/nixpkgs/pkgs/applications/science/electronics/qucs-s/default.nix
new file mode 100644
index 000000000000..4117638a1fda
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/qucs-s/default.nix
@@ -0,0 +1,54 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, flex
+, bison
+, qtbase
+, qttools
+, qtsvg
+, qtwayland
+, wrapQtAppsHook
+, libX11
+, cmake
+, gperf
+, adms
+, ngspice
+, kernels ? [ ngspice ]
+}:
+
+stdenv.mkDerivation rec {
+  pname = "qucs-s";
+  version = "24.1.0";
+
+  src = fetchFromGitHub {
+    owner = "ra3xdh";
+    repo = "qucs_s";
+    rev = version;
+    sha256 = "sha256-ei9CPlJg+Kfjh7vu5VnT6DNLmmnA8wZ2A1jXnm//Fgo=";
+  };
+
+  nativeBuildInputs = [ flex bison wrapQtAppsHook cmake ];
+  buildInputs = [ qtbase qttools qtsvg qtwayland libX11 gperf adms ] ++ kernels;
+
+  # Make custom kernels avaible from qucs-s
+  qtWrapperArgs = [ "--prefix" "PATH" ":" (lib.makeBinPath kernels) ];
+
+  QTDIR = qtbase.dev;
+
+  doInstallCheck = true;
+  installCheck = ''
+    $out/bin/qucs-s --version
+  '';
+
+  meta = with lib; {
+    description = "Spin-off of Qucs that allows custom simulation kernels";
+    longDescription = ''
+      Spin-off of Qucs that allows custom simulation kernels.
+      Default version is installed with ngspice.
+    '';
+    homepage = "https://ra3xdh.github.io/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ mazurel kashw2 ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/simulide/default.nix b/nixpkgs/pkgs/applications/science/electronics/simulide/default.nix
new file mode 100644
index 000000000000..fbd76a0e0ffc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/simulide/default.nix
@@ -0,0 +1,129 @@
+{ lib
+, fetchbzr
+, mkDerivation
+, qmake
+, qtserialport
+, qtmultimedia
+, qttools
+, qtscript
+}:
+
+let
+  generic =
+    { version
+    , release
+    , branch
+    , rev
+    , sha256
+    , extraPostPatch ? ""
+    , extraBuildInputs ? [ ]
+    , iconPath ? "resources/icons/simulide.png"
+    , installFiles ? ''
+        cp -r data examples $out/share/simulide
+        cp simulide $out/bin/simulide
+      ''
+    }:
+    mkDerivation {
+      pname = "simulide";
+      version = "${version}-${release}";
+
+      src = fetchbzr {
+        url = "https://code.launchpad.net/~arcachofo/simulide/${branch}";
+        inherit rev sha256;
+      };
+
+      postPatch = ''
+        sed -i resources/simulide.desktop \
+          -e "s|^Exec=.*$|Exec=simulide|" \
+          -e "s|^Icon=.*$|Icon=simulide|"
+
+        # Note: older versions don't have REV_NO
+        sed -i SimulIDE.pro \
+          -e "s|^VERSION = .*$|VERSION = ${version}|" \
+          -e "s|^RELEASE = .*$|RELEASE = -${release}|" \
+          -e "s|^REV_NO = .*$|REV_NO = ${rev}|" \
+          -e "s|^BUILD_DATE = .*$|BUILD_DATE = ??-??-??|"
+
+        ${extraPostPatch}
+      '';
+
+      preConfigure = ''
+        cd build_XX
+      '';
+
+      nativeBuildInputs = [
+        qmake
+      ];
+
+      buildInputs = [
+        qtserialport
+        qtmultimedia
+        qttools
+      ] ++ extraBuildInputs;
+
+      installPhase = ''
+        runHook preInstall
+
+        install -Dm644 ../resources/simulide.desktop $out/share/applications/simulide.desktop
+        install -Dm644 ../${iconPath} $out/share/icons/hicolor/256x256/apps/simulide.png
+
+        mkdir -p $out/share/simulide $out/bin
+        pushd executables/SimulIDE_*
+        ${installFiles}
+        popd
+
+        runHook postInstall
+      '';
+
+      meta = {
+        description = "A simple real time electronic circuit simulator";
+        longDescription = ''
+          SimulIDE is a simple real time electronic circuit simulator, intended for hobbyist or students
+          to learn and experiment with analog and digital electronic circuits and microcontrollers.
+          It supports PIC, AVR, Arduino and other MCUs and MPUs.
+        '';
+        homepage = "https://simulide.com/";
+        license = lib.licenses.gpl3Only;
+        mainProgram = "simulide";
+        maintainers = with lib.maintainers; [ carloscraveiro tomasajt ];
+        platforms = [ "x86_64-linux" ];
+      };
+    };
+in
+{
+  simulide_0_4_15 = generic {
+    version = "0.4.15";
+    release = "SR10";
+    branch = "simulide_0.4.14"; # the branch name does not mach the version for some reason
+    rev = "291";
+    sha256 = "sha256-BBoZr/S2pif0Jft5wrem8y00dXl08jq3kFiIUtOr3LM=";
+    extraPostPatch = ''
+      # GCC 13 needs the <cstdint> header explicitly included
+      sed -i src/gpsim/value.h -e '1i #include <cstdint>'
+      sed -i src/gpsim/modules/watchdog.h -e '1i #include <cstdint>'
+    '';
+    extraBuildInputs = [ qtscript ];
+    iconPath = "resources/icons/hicolor/256x256/simulide.png"; # upstream had a messed up icon path in this release
+    installFiles = ''
+      cp -r share/simulide/* $out/share/simulide
+      cp bin/simulide $out/bin/simulide
+    '';
+  };
+
+  simulide_1_0_0 = generic {
+    version = "1.0.0";
+    release = "SR2";
+    branch = "1.0.0";
+    rev = "1449";
+    sha256 = "sha256-rJWZvnjVzaKXU2ktbde1w8LSNvu0jWkDIk4dq2l7t5g=";
+    extraBuildInputs = [ qtscript ];
+  };
+
+  simulide_1_1_0 = generic {
+    version = "1.1.0";
+    release = "RC1";
+    branch = "1.1.0";
+    rev = "1912";
+    sha256 = "sha256-bgRAqt7h2LtU2Ze6Jiz8APhyPcV15v4ofxIilIeZV9E=";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/sv-lang/default.nix b/nixpkgs/pkgs/applications/science/electronics/sv-lang/default.nix
new file mode 100644
index 000000000000..58ecf986cf7a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/sv-lang/default.nix
@@ -0,0 +1,75 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, boost182
+, catch2_3
+, cmake
+, ninja
+, fmt_9
+, python3
+}:
+
+let
+  # dependency for this library has been removed in master (i.e. next release)
+  unordered_dense = stdenv.mkDerivation rec {
+    version = "2.0.1";
+    pname = "unordered_dense";
+    src = fetchFromGitHub {
+      owner = "martinus";
+      repo = pname;
+      rev = "v${version}";
+      sha256 = "sha256-9zlWYAY4lOQsL9+MYukqavBi5k96FvglRgznLIwwRyw=";
+    };
+    nativeBuildInputs = [
+      cmake
+    ];
+  };
+
+in
+stdenv.mkDerivation rec {
+  pname = "sv-lang";
+  version = "3.0";
+
+  src = fetchFromGitHub {
+    owner = "MikePopoloski";
+    repo = "slang";
+    rev = "v${version}";
+    sha256 = "sha256-v2sStvukLFMRXGeATxvizmnwEPDE4kwnS06n+37OrJA=";
+  };
+
+  cmakeFlags = [
+    # fix for https://github.com/NixOS/nixpkgs/issues/144170
+    "-DCMAKE_INSTALL_INCLUDEDIR=include"
+    "-DCMAKE_INSTALL_LIBDIR=lib"
+
+    "-DSLANG_INCLUDE_TESTS=${if doCheck then "ON" else "OFF"}"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    python3
+    ninja
+
+    # though only used in tests, cmake will complain its absence when configuring
+    catch2_3
+  ];
+
+  buildInputs = [
+    unordered_dense
+    boost182
+    fmt_9
+  ];
+
+  # TODO: a mysterious linker error occurs when building the unittests on darwin.
+  # The error occurs when using catch2_3 in nixpkgs, not when fetching catch2_3 using CMake
+  doCheck = !stdenv.isDarwin;
+
+  meta = with lib; {
+    description = "SystemVerilog compiler and language services";
+    homepage = "https://github.com/MikePopoloski/slang";
+    license = licenses.mit;
+    maintainers = with maintainers; [ sharzy ];
+    mainProgram = "slang";
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/systemc/default.nix b/nixpkgs/pkgs/applications/science/electronics/systemc/default.nix
new file mode 100644
index 000000000000..4e14d08e63bf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/systemc/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "systemc";
+  version = "2.3.4";
+
+  src = fetchFromGitHub {
+    owner = "accellera-official";
+    repo = pname;
+    rev = version;
+    sha256 = "0sj8wlkp68cjhmkd9c9lvm3lk3sckczpz7w9vby64inc1f9fnf0b";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    # Undefined reference to the sc_core::sc_api_version_2_3_4_XXX
+    # https://github.com/accellera-official/systemc/issues/21
+    "-DCMAKE_CXX_STANDARD=17"
+  ];
+
+  doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
+
+  meta = with lib; {
+    description = "The language for System-level design, modeling and verification";
+    homepage    = "https://systemc.org/";
+    license     = licenses.asl20;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ victormignot amiloradovsky ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/tkgate/1.x.nix b/nixpkgs/pkgs/applications/science/electronics/tkgate/1.x.nix
new file mode 100644
index 000000000000..f20ce5e0acd0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/tkgate/1.x.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchurl, tcl, tk, libX11, glibc, which, bison, flex, imake, xorgproto, gccmakedep }:
+
+let
+  libiconvInc = lib.optionalString stdenv.isLinux "${glibc.dev}/include";
+  libiconvLib = lib.optionalString stdenv.isLinux "${glibc.out}/lib";
+in
+stdenv.mkDerivation rec {
+  pname = "tkgate";
+  version = "1.8.7";
+
+  src = fetchurl {
+    url = "http://www.tkgate.org/downloads/tkgate-${version}.tgz";
+    sha256 = "1pqywkidfpdbj18i03h97f4cimld4fb3mqfy8jjsxs12kihm18fs";
+  };
+
+  nativeBuildInputs = [ which bison flex imake gccmakedep ];
+  buildInputs = [ tcl tk libX11 xorgproto ];
+  dontUseImakeConfigure = true;
+
+  patchPhase = ''
+    sed -i config.h \
+      -e 's|.*#define.*TKGATE_TCLTK_VERSIONS.*|#define TKGATE_TCLTK_VERSIONS "${tcl.release}"|' \
+      -e 's|.*#define.*TKGATE_INCDIRS.*|#define TKGATE_INCDIRS "${tcl}/include ${tk}/include ${libiconvInc} ${libX11.dev}/include"|' \
+      -e 's|.*#define.*TKGATE_LIBDIRS.*|#define TKGATE_LIBDIRS "${tcl}/lib ${tk}/lib ${libiconvLib} ${libX11.out}/lib"|' \
+      \
+      -e '20 i #define TCL_LIBRARY "${tcl}/lib"' \
+      -e '20 i #define TK_LIBRARY "${tk}/lib/${tk.libPrefix}"' \
+      -e '20 i #define USE_ICONV 1' \
+      \
+      -e "s|.*#define.*TKGATE_HOMEDIRBASE.*|#define TKGATE_HOMEDIRBASE \\\"$out/lib\\\"|" \
+      -e "s|.*#define.*TKGATE_BINDIR.*|#define TKGATE_BINDIR \\\"$out/bin\\\"|" \
+      -e "s|.*#define.*TKGATE_MANDIR.*|#define TKGATE_MANDIR \\\"$out/share/man/man1\\\"|" \
+      -e "s|file:/usr/X11R6/lib/tkgate-|file://$out/lib/tkgate-|"
+  '';
+
+  meta = {
+    description = "Event driven digital circuit simulator with a TCL/TK-based graphical editor";
+    mainProgram = "gmac";
+    homepage = "http://www.tkgate.org/";
+    license = lib.licenses.gpl2Plus;
+    hydraPlatforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/verilator/default.nix b/nixpkgs/pkgs/applications/science/electronics/verilator/default.nix
new file mode 100644
index 000000000000..92f8fa52b91f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/verilator/default.nix
@@ -0,0 +1,61 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, perl, flex, bison, python3, autoconf,
+  which, cmake, ccache, help2man, makeWrapper, glibcLocales,
+  systemc, git, numactl }:
+
+stdenv.mkDerivation rec {
+  pname = "verilator";
+  version = "5.022";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-Ya3lqK8BfvMVLZUrD2Et6OmptteWXp5VmZb2x2G/V/E=";
+  };
+
+  patches = [
+    (fetchpatch {
+      # Fix try-lock spuriously fail in V3ThreadPool destructor
+      # https://github.com/verilator/verilator/pull/4938
+      url = "https://github.com/verilator/verilator/commit/4b9cce4369c78423779238e585ed693c456d464e.patch";
+      hash = "sha256-sGrk/pxqZqUcmJdzQoPlzXMmYqHCOmd9Y2n6ieVNg1U=";
+    })
+  ];
+
+  enableParallelBuilding = true;
+  buildInputs = [ perl python3 systemc ];  # ccache
+  nativeBuildInputs = [ makeWrapper flex bison autoconf help2man git ];
+  nativeCheckInputs = [ which numactl ];  # cmake
+
+  doCheck = stdenv.isLinux; # darwin tests are broken for now...
+  checkTarget = "test";
+
+  preConfigure = "autoconf";
+
+  postPatch = ''
+    patchShebangs bin/* src/* nodist/* docs/bin/* examples/xml_py/* \
+    test_regress/{driver.pl,t/*.{pl,pf}} \
+    ci/* ci/docker/run/* ci/docker/run/hooks/* ci/docker/buildenv/build.sh
+  '';
+  # grep '^#!/' -R . | grep -v /nix/store | less
+  # (in nix-shell after patchPhase)
+
+  postInstall = lib.optionalString stdenv.isLinux ''
+    for x in $(ls $out/bin/verilator*); do
+      wrapProgram "$x" --set LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive"
+    done
+  '';
+
+  env = {
+    SYSTEMC_INCLUDE = "${lib.getDev systemc}/include";
+    SYSTEMC_LIBDIR = "${lib.getLib systemc}/lib";
+  };
+
+  meta = with lib; {
+    description = "Fast and robust (System)Verilog simulator/compiler and linter";
+    homepage    = "https://www.veripool.org/verilator";
+    license     = with licenses; [ lgpl3Only artistic2 ];
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ thoughtpolice amiloradovsky ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/verilog/default.nix b/nixpkgs/pkgs/applications/science/electronics/verilog/default.nix
new file mode 100644
index 000000000000..06e8a94a4c53
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/verilog/default.nix
@@ -0,0 +1,80 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, autoconf
+, bison
+, bzip2
+, flex
+, gperf
+, ncurses
+, perl
+, python3
+, readline
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname   = "iverilog";
+  version = "12.0";
+
+  src = fetchFromGitHub {
+    owner  = "steveicarus";
+    repo   = pname;
+    rev    = "v${lib.replaceStrings ["."] ["_"] version}";
+    hash   = "sha256-J9hedSmC6mFVcoDnXBtaTXigxrSCFa2AhhFd77ueo7I=";
+  };
+
+  nativeBuildInputs = [ autoconf bison flex gperf ];
+
+  CC_FOR_BUILD="${stdenv.cc}/bin/cc";
+  CXX_FOR_BUILD="${stdenv.cc}/bin/c++";
+
+  patches = [
+    # NOTE(jleightcap): `-Werror=format-security` warning patched shortly after release, backport the upstream fix
+    (fetchpatch {
+      name = "format-security";
+      url = "https://github.com/steveicarus/iverilog/commit/23e51ef7a8e8e4ba42208936e0a6a25901f58c65.patch";
+      hash = "sha256-fMWfBsCl2fuXe+6AR10ytb8QpC84bXlP5RSdrqsWzEk=";
+    })
+  ];
+
+  buildInputs = [ bzip2 ncurses readline zlib ];
+
+  preConfigure = "sh autoconf.sh";
+
+  enableParallelBuilding = true;
+
+  env = lib.optionalAttrs stdenv.isDarwin {
+    NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
+  };
+
+  # NOTE(jleightcap): the `make check` target only runs a "Hello, World"-esque sanity check.
+  # the tests in the doInstallCheck phase run a full regression test suite.
+  # however, these tests currently fail upstream on aarch64
+  # (see https://github.com/steveicarus/iverilog/issues/917)
+  # so disable the full suite for now.
+  doCheck = true;
+  doInstallCheck = !stdenv.isAarch64;
+
+  nativeInstallCheckInputs = [
+    perl
+    (python3.withPackages (pp: with pp; [
+      docopt
+    ]))
+  ];
+
+  installCheckPhase = ''
+    runHook preInstallCheck
+    export PATH="$PATH:$out/bin"
+    sh .github/test.sh
+    runHook postInstallCheck
+  '';
+
+  meta = with lib; {
+    description = "Icarus Verilog compiler";
+    homepage    = "http://iverilog.icarus.com/";  # https does not work
+    license     = with licenses; [ gpl2Plus lgpl21Plus ];
+    maintainers = with maintainers; [ thoughtpolice ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/vhd2vl/default.nix b/nixpkgs/pkgs/applications/science/electronics/vhd2vl/default.nix
new file mode 100644
index 000000000000..d56a8aa6ce84
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/vhd2vl/default.nix
@@ -0,0 +1,52 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, bison
+, flex
+, verilog
+, which
+}:
+
+stdenv.mkDerivation rec {
+  pname = "vhd2vl";
+  version = "unstable-2022-12-26";
+
+  src = fetchFromGitHub {
+    owner = "ldoolitt";
+    repo = pname;
+    rev = "869d442987dff6b9730bc90563ede89c1abfd28f";
+    sha256 = "sha256-Hz2XkT5m4ri5wVR2ciL9Gx73zr+RdW5snjWnUg300c8=";
+  };
+
+  nativeBuildInputs = [
+    bison
+    flex
+    which
+  ];
+
+  buildInputs = [
+    verilog
+  ];
+
+  # the "translate" target both (a) builds the software and (b) runs
+  # the tests (without validating the results)
+  buildTargets = [ "translate" ];
+
+  # the "diff" target examines the test results
+  checkTarget = "diff";
+
+  installPhase = ''
+    runHook preInstall
+    install -D -m755 src/vhd2vl $out/bin/vhd2vl
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "VHDL to Verilog converter";
+    mainProgram = "vhd2vl";
+    homepage = "https://github.com/ldoolitt/vhd2vl";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ matthuszagh ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/xcircuit/default.nix b/nixpkgs/pkgs/applications/science/electronics/xcircuit/default.nix
new file mode 100644
index 000000000000..c51156d2c1ab
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/xcircuit/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, automake, pkg-config
+, cairo, ghostscript, ngspice, tcl, tk, xorg, zlib }:
+
+stdenv.mkDerivation rec {
+  version = "3.10.37";
+  pname = "xcircuit";
+
+  src = fetchFromGitHub {
+    owner = "RTimothyEdwards";
+    repo = "XCircuit";
+    rev = "0056213308c92bec909e8469a0fa1515b72fc3d2";
+    sha256 = "sha256-LXU5VEkLF1aKYz9ynI1qQjJUwt/zKFMPYj153OgJOOI=";
+  };
+
+  nativeBuildInputs = [ autoreconfHook automake pkg-config ];
+  hardeningDisable = [ "format" ];
+
+  configureFlags = [
+    "--with-tcl=${tcl}/lib"
+    "--with-tk=${tk}/lib"
+    "--with-ngspice=${lib.getBin ngspice}/bin/ngspice"
+  ];
+
+  buildInputs = with xorg; [ cairo ghostscript libSM libXt libICE libX11 libXpm tcl tk zlib ];
+
+  meta = with lib; {
+    description = "Generic drawing program tailored to circuit diagrams";
+    mainProgram = "xcircuit";
+    homepage = "http://opencircuitdesign.com/xcircuit";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ john-shaffer spacefrogg thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/xoscope/default.nix b/nixpkgs/pkgs/applications/science/electronics/xoscope/default.nix
new file mode 100644
index 000000000000..0fa0c1bc79bf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/xoscope/default.nix
@@ -0,0 +1,33 @@
+{ lib
+, stdenv
+, fetchurl
+, gtk3
+, gtkdatabox
+, fftw
+, gnum4
+, comedilib
+, alsa-lib
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "xoscope";
+  version = "2.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xoscope/${pname}-${version}.tar.gz";
+    sha256 = "0a5ycfc1qdmibvagc82r2mhv2i99m6pndy5i6ixas3j2297g6pgq";
+  };
+
+  nativeBuildInputs = [ pkg-config gnum4 ];
+  buildInputs = [ gtk3 gtkdatabox fftw comedilib alsa-lib ];
+
+  meta = {
+    description = "Oscilloscope through the sound card";
+    mainProgram = "xoscope";
+    homepage = "https://xoscope.sourceforge.net";
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [viric];
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/xschem/default.nix b/nixpkgs/pkgs/applications/science/electronics/xschem/default.nix
new file mode 100644
index 000000000000..826181139c19
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/xschem/default.nix
@@ -0,0 +1,47 @@
+{ stdenv
+, fetchFromGitHub
+, lib
+, bison
+, cairo
+, flex
+, libX11
+, libXpm
+, pkg-config
+, tcl
+, tk
+}:
+
+stdenv.mkDerivation rec {
+  pname = "xschem";
+  version = "3.4.4";
+
+  src = fetchFromGitHub {
+    owner = "StefanSchippers";
+    repo = "xschem";
+    rev = version;
+    sha256 = "sha256-1jP1SJeq23XNkOQgcl2X+rBrlka4a04irmfhoKRM1j4=";
+  };
+
+  nativeBuildInputs = [ bison flex pkg-config ];
+
+  buildInputs = [ cairo libX11 libXpm tcl tk ];
+
+  hardeningDisable = [ "format" ];
+
+  meta = with lib; {
+    broken = stdenv.isDarwin;
+    description = "Schematic capture and netlisting EDA tool";
+    longDescription = ''
+      Xschem is a schematic capture program, it allows creation of
+      hierarchical representation of circuits with a top down approach.
+      By focusing on interfaces, hierarchy and instance properties a
+      complex system can be described in terms of simpler building
+      blocks. A VHDL or Verilog or Spice netlist can be generated from
+      the drawn schematic, allowing the simulation of the circuit.
+    '';
+    homepage = "https://xschem.sourceforge.io/stefan/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ fbeffa ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/xyce/default.nix b/nixpkgs/pkgs/applications/science/electronics/xyce/default.nix
new file mode 100644
index 000000000000..93c155038a22
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/xyce/default.nix
@@ -0,0 +1,190 @@
+{ stdenv
+, fetchFromGitHub
+, fetchgit
+, lib
+, autoconf
+, automake
+, bison
+, blas
+, flex
+, fftw
+, gfortran
+, lapack
+, libtool_2
+, mpi
+, suitesparse
+, trilinos
+, withMPI ? false
+  # for doc
+, texliveMedium
+, pandoc
+, enableDocs ? true
+  # for tests
+, bash
+, bc
+, openssh # required by MPI
+, perl
+, perlPackages
+, python3
+, enableTests ? true
+}:
+
+assert withMPI -> trilinos.withMPI;
+
+let
+  version = "7.8.0";
+
+  # useing fetchurl or fetchFromGitHub doesn't include the manuals
+  # due to .gitattributes files
+  xyce_src = fetchgit {
+    url = "https://github.com/Xyce/Xyce.git";
+    rev = "Release-${version}";
+    sha256 = "sha256-+aNy2bGuFQ517FZUvU0YqN0gmChRpVuFEmFGTCx9AgY=";
+  };
+
+  regression_src = fetchFromGitHub {
+    owner = "Xyce";
+    repo = "Xyce_Regression";
+    rev = "Release-${version}";
+    sha256 = "sha256-Fxi/NpXXIw/bseWaLi2iQ4sg4S9Z+othGgSvQoxyJ9c=";
+  };
+in
+
+stdenv.mkDerivation rec {
+  pname = "xyce";
+  inherit version;
+
+  srcs = [ xyce_src regression_src ];
+
+  sourceRoot = xyce_src.name;
+
+  preConfigure = "./bootstrap";
+
+  configureFlags = [
+    "CXXFLAGS=-O3"
+    "--enable-xyce-shareable"
+    "--enable-shared"
+    "--enable-stokhos"
+    "--enable-amesos2"
+  ] ++ lib.optionals withMPI [
+    "--enable-mpi"
+    "CXX=mpicxx"
+    "CC=mpicc"
+    "F77=mpif77"
+  ];
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    gfortran
+    libtool_2
+  ] ++ lib.optionals enableDocs [
+    (texliveMedium.withPackages (ps: with ps; [
+        enumitem
+        koma-script
+        optional
+        framed
+        enumitem
+        multirow
+        newtx
+        preprint
+      ]))
+  ];
+
+  buildInputs = [
+    bison
+    blas
+    flex
+    fftw
+    lapack
+    suitesparse
+    trilinos
+  ] ++ lib.optionals withMPI [ mpi ];
+
+  doCheck = enableTests;
+
+  postPatch = ''
+    pushd ../${regression_src.name}
+    find Netlists -type f -regex ".*\.sh\|.*\.pl" -exec chmod ugo+x {} \;
+    # some tests generate new files, some overwrite netlists
+    find . -type d -exec chmod u+w {} \;
+    find . -type f -name "*.cir" -exec chmod u+w {} \;
+    patchShebangs Netlists/ TestScripts/
+    # patch script generating functions
+    sed -i -E 's|/usr/bin/env perl|${lib.escapeRegex perl.outPath}/bin/perl|'  \
+      TestScripts/XyceRegression/Testing/Netlists/RunOptions/runOptions.cir.sh
+    sed -i -E 's|/bin/sh|${lib.escapeRegex bash.outPath}/bin/sh|' \
+      TestScripts/XyceRegression/Testing/Netlists/RunOptions/runOptions.cir.sh
+    popd
+  '';
+
+  nativeCheckInputs = [
+    bc
+    perl
+    (python3.withPackages (ps: with ps; [ numpy scipy ]))
+  ] ++ lib.optionals withMPI [ mpi openssh ];
+
+  checkPhase = ''
+    XYCE_BINARY="$(pwd)/src/Xyce"
+    EXECSTRING="${lib.optionalString withMPI "mpirun -np 2 "}$XYCE_BINARY"
+    TEST_ROOT="$(pwd)/../${regression_src.name}"
+
+    # Honor the TMP variable
+    sed -i -E 's|/tmp|\$TMP|' $TEST_ROOT/TestScripts/suggestXyceTagList.sh
+
+    EXLUDE_TESTS_FILE=$TMP/exclude_tests.$$
+    # Gold standard has additional ":R" suffix in result column label
+    echo "Output/HB/hb-step-tecplot.cir" >> $EXLUDE_TESTS_FILE
+    # This test makes Xyce access /sys/class/net when run with MPI
+    ${lib.optionalString withMPI "echo \"CommandLine/command_line.cir\" >> $EXLUDE_TESTS_FILE"}
+
+    $TEST_ROOT/TestScripts/run_xyce_regression \
+      --output="$(pwd)/Xyce_Test" \
+      --xyce_test="''${TEST_ROOT}" \
+      --taglist="$($TEST_ROOT/TestScripts/suggestXyceTagList.sh "$XYCE_BINARY" | sed -E -e 's/TAGLIST=([^ ]+).*/\1/' -e '2,$d')" \
+      --resultfile="$(pwd)/test_results" \
+      --excludelist="$EXLUDE_TESTS_FILE" \
+      "''${EXECSTRING}"
+  '';
+
+  outputs = [ "out" "doc" ];
+
+  postInstall = lib.optionalString enableDocs ''
+    local docFiles=("doc/Users_Guide/Xyce_UG"
+      "doc/Reference_Guide/Xyce_RG"
+      "doc/Release_Notes/Release_Notes_${lib.versions.majorMinor version}/Release_Notes_${lib.versions.majorMinor version}")
+
+    # SANDIA LaTeX class and some organization logos are not publicly available see
+    # https://groups.google.com/g/xyce-users/c/MxeViRo8CT4/m/ppCY7ePLEAAJ
+    for img in "snllineblubrd" "snllineblk" "DOEbwlogo" "NNSA_logo"; do
+      sed -i -E "s/\\includegraphics\[height=(0.[1-9]in)\]\{$img\}/\\mbox\{\\rule\{0mm\}\{\1\}\}/" ''${docFiles[2]}.tex
+    done
+
+    install -d $doc/share/doc/${pname}-${version}/
+    for d in ''${docFiles[@]}; do
+      # Use a public document class
+      sed -i -E 's/\\documentclass\[11pt,report\]\{SANDreport\}/\\documentclass\[11pt,letterpaper\]\{scrreprt\}/' $d.tex
+      sed -i -E 's/\\usepackage\[sand\]\{optional\}/\\usepackage\[report\]\{optional\}/' $d.tex
+      pushd $(dirname $d)
+      make
+      install -t $doc/share/doc/${pname}-${version}/ $(basename $d.pdf)
+      popd
+    done
+  '';
+
+  meta = with lib; {
+    broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
+    description = "High-performance analog circuit simulator";
+    longDescription = ''
+      Xyce is a SPICE-compatible, high-performance analog circuit simulator,
+      capable of solving extremely large circuit problems by supporting
+      large-scale parallel computing platforms.
+    '';
+    homepage = "https://xyce.sandia.gov";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ fbeffa ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/engineering/brmodelo/default.nix b/nixpkgs/pkgs/applications/science/engineering/brmodelo/default.nix
new file mode 100644
index 000000000000..c484260d25f3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/engineering/brmodelo/default.nix
@@ -0,0 +1,110 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, openjdk8
+, ant
+, makeWrapper
+, makeDesktopItem
+, copyDesktopItems
+}:
+
+stdenv.mkDerivation rec {
+  pname = "brmodelo";
+  version = "3.31";
+
+  src = fetchFromGitHub {
+    owner = "chcandido";
+    repo = pname;
+    rev = version;
+    sha256 = "09qrhqhv264x8phnf3pnb0cwq75l7xdsj9xkwlvhry81nxz0d5v0";
+  };
+
+  nativeBuildInputs = [ ant makeWrapper copyDesktopItems ];
+
+  buildInputs = [ openjdk8 ];
+
+  patches = [
+    # Fixes for building with Ant.
+    # https://github.com/chcandido/brModelo/pull/22
+    (fetchpatch {
+      name = "fix-self-closing-element-not-allowed.patch";
+      url = "https://github.com/yuuyins/brModelo/commit/0d712b74fd5d29d67be07480ed196da28a77893b.patch";
+      sha256 = "sha256-yy03arE6xetotzyvpToi9o9crg3KnMRn1J70jDUvSXE=";
+    })
+    (fetchpatch {
+      name = "fix-tag-closing.patch";
+      url = "https://github.com/yuuyins/brModelo/commit/e8530ff75f024cf6effe0408ed69985405e9709c.patch";
+      sha256 = "sha256-MNuh/ORbaAkB5qDSlA/nPrXN+tqzz4oOglVyEtSangI=";
+    })
+    (fetchpatch {
+      name = "fix-bad-use-greater-than.patch";
+      url = "https://github.com/yuuyins/brModelo/commit/498a6ef8129daff5a472b318f93c8f7f2897fc7f.patch";
+      sha256 = "sha256-MmAwYUmx38DGRsiSxCWCObtpqxk0ykUQiDSC76bCpFc=";
+    })
+    (fetchpatch {
+      name = "fix-param-errors.patch";
+      url = "https://github.com/yuuyins/brModelo/commit/8a508aaba0bcffe13a3f95cff495230beea36bc4.patch";
+      sha256 = "sha256-qME9gZChSMzu1vs9HaosD+snb+jlOrQLY97meNoA8oU=";
+    })
+
+    # Add SVG icons.
+    # https://github.com/chcandido/brModelo/pull/23
+    (fetchpatch {
+      name = "add-brmodelo-logo-icons-svg.patch";
+      url = "https://github.com/yuuyins/brModelo/commit/f260b82b664fad3325bbf3ebd7a15488d496946b.patch";
+      sha256 = "sha256-UhgcWxsHkNFS1GgaRnmlZohjDR8JwHof2cIb3SBetYs=";
+    })
+  ];
+
+  buildPhase = ''
+    ant
+  '';
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = "brmodelo";
+      desktopName = "brModelo";
+      genericName = "Entity-relationship diagramming tool";
+      exec = "brmodelo";
+      icon = "brmodelo";
+      comment = meta.description;
+      categories = [ "Development" "Education" "Database" "2DGraphics" "ComputerScience" "DataVisualization" "Engineering" "Java" ];
+    })
+  ];
+
+  installPhase = ''
+    install -d $out/bin $out/share/doc/${pname} $out/share/java
+
+    cp -rv ./dist/javadoc $out/share/doc/${pname}/
+
+    install -Dm755 ./dist/brModelo.jar -t $out/share/java/
+    # NOTE: The standard Java GUI toolkit has a
+    # hard-coded list of "non-reparenting" window managers,
+    # which cause issues while running brModelo
+    # in WMs that are not in that list (e.g. XMonad).
+    # Solution/Workaround: set the environment variable
+    # _JAVA_AWT_WM_NONREPARENTING=1.
+    makeWrapper ${openjdk8}/bin/java $out/bin/brmodelo \
+       --prefix _JAVA_AWT_WM_NONREPARENTING : 1 \
+       --prefix _JAVA_OPTIONS : "-Dawt.useSystemAAFontSettings=on" \
+       --add-flags "-jar $out/share/java/brModelo.jar"
+
+    runHook postInstall
+  '';
+
+  postInstall = ''
+    for size in 16 24 32 48 64 128 256; do
+      install -Dm644 ./src/imagens/icone_"$size"x"$size".svg \
+        $out/share/icons/hicolor/"$size"x"$size"/apps/brmodelo.svg
+    done
+  '';
+
+  meta = with lib; {
+    description = "Entity-relationship diagram tool for making conceptual and logical database models";
+    mainProgram = "brmodelo";
+    homepage = "https://github.com/chcandido/brModelo";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ yuu ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/engineering/jflap/default.nix b/nixpkgs/pkgs/applications/science/engineering/jflap/default.nix
new file mode 100644
index 000000000000..0559f8922787
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/engineering/jflap/default.nix
@@ -0,0 +1,70 @@
+{ lib
+, stdenvNoCC
+, fetchurl
+, jre8
+, makeWrapper
+, makeDesktopItem
+, copyDesktopItems
+}:
+
+stdenvNoCC.mkDerivation rec {
+  pname = "jflap";
+  version = "7.1";
+
+  src = fetchurl {
+    url = "https://www.jflap.org/jflaptmp/july27-18/JFLAP${version}.jar";
+    sha256 = "oiwJXdxWsYFj6Ovu7xZbOgTLVw8160a5YQUWbgbJlAY=";
+  };
+
+  nativeBuildInputs = [
+    makeWrapper
+    copyDesktopItems
+  ];
+
+  buildInputs = [
+    jre8
+  ];
+
+  dontUnpack = true;
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = "jflap";
+      desktopName = "jflap";
+      genericName = "Formal language application";
+      exec = "jflap";
+      icon = fetchurl {
+        url = "https://www.jflap.org/jflapLogo2.jpg";
+        sha256 = "sha256-IiworHI+GT6Fm6B0E+FXnKe+hN8nZYPrxHGZFAcsWDw=";
+      };
+      comment = meta.description;
+      categories = [
+        "Development"
+        "Education"
+        "ComputerScience"
+        "DataVisualization"
+        "Engineering"
+        "Java"
+      ];
+    })
+  ];
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/share/java
+    cp -s $src $out/share/java/jflap.jar
+    makeWrapper ${jre8}/bin/java $out/bin/jflap \
+      --prefix _JAVA_OPTIONS : "-Dawt.useSystemAAFontSettings=on" \
+      --add-flags "-jar $out/share/java/jflap.jar"
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "GUI tool for experimenting with formal languages topics";
+    homepage = "https://www.jflap.org/";
+    license = licenses.unfree;
+    sourceProvenance = with sourceTypes; [ binaryBytecode ];
+    maintainers = with maintainers; [ grnnja yuu ];
+    platforms = jre8.meta.platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/geometry/antiprism/default.nix b/nixpkgs/pkgs/applications/science/geometry/antiprism/default.nix
new file mode 100644
index 000000000000..79688e05fb80
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/geometry/antiprism/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, libX11
+, libGL
+, libGLU
+, freeglut }:
+
+stdenv.mkDerivation rec {
+  pname = "antiprism";
+  version = "0.30";
+
+  src = fetchFromGitHub {
+    owner = "antiprism";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-dD3MH+KectuuKOYF7bqWtGsBo5zz+UMyY/io1tgXbgU=";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ libX11 libGLU libGL.dev freeglut.dev ];
+
+  meta = with lib; {
+    homepage = "https://www.antiprism.com";
+    description = "A collection of programs for generating, manipulating, transforming and viewing polyhedra";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ AndersonTorres ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/geometry/gama/default.nix b/nixpkgs/pkgs/applications/science/geometry/gama/default.nix
new file mode 100644
index 000000000000..a27978052a09
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/geometry/gama/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, fetchurl, lib, expat, octave, libxml2, texinfo, zip }:
+stdenv.mkDerivation rec {
+  pname = "gama";
+  version = "2.28";
+
+  src = fetchurl {
+    url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "sha256-Xcc/4JB7hyM+KHeO32+JlQWUBfH8RXuOL3Z2P0imaxo=";
+  };
+
+  buildInputs = [ expat ];
+
+  nativeBuildInputs = [ texinfo zip ];
+
+  env.CXXFLAGS = lib.optionalString stdenv.cc.isClang "-include sstream";
+
+  nativeCheckInputs = [ octave libxml2 ];
+  doCheck = true;
+
+  meta = with lib ; {
+    description = "Tools for adjustment of geodetic networks";
+    homepage = "https://www.gnu.org/software/gama/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/geometry/tetgen/1.4.nix b/nixpkgs/pkgs/applications/science/geometry/tetgen/1.4.nix
new file mode 100644
index 000000000000..f67bf198443a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/geometry/tetgen/1.4.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "tetgen";
+  version = "1.4.3";
+
+  src = fetchurl {
+    url = "${meta.homepage}/files/tetgen${version}.tar.gz";
+    sha256 = "0d70vjqdapmy1ghlsxjlvl5z9yp310zw697bapc4zxmp0sxi29wm";
+  };
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp tetgen $out/bin
+  '';
+
+  meta = {
+    description = "Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator";
+    mainProgram = "tetgen";
+    homepage = "http://tetgen.org/";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/geometry/tetgen/default.nix b/nixpkgs/pkgs/applications/science/geometry/tetgen/default.nix
new file mode 100644
index 000000000000..dce56dc4e17d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/geometry/tetgen/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "tetgen";
+  version = "1.6.0";
+
+  src = fetchurl {
+    url = "http://wias-berlin.de/software/tetgen/1.5/src/tetgen${version}.tar.gz";
+    sha256 = "sha256-h7XmHr06Rx/E8s3XEkwrEd1mOfT+sflBpdL1EQ0Fzjk=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/{bin,lib,include}
+    cp tetgen $out/bin
+    cp libtet.a $out/lib
+    cp ../tetgen.{cxx,h} $out/include
+
+    runHook postInstall
+  '';
+
+  meta = {
+    description = "Quality Tetrahedral Mesh Generator and 3D Delaunay Triangulator";
+    mainProgram = "tetgen";
+    homepage = "http://tetgen.org/";
+    license = lib.licenses.agpl3Plus;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/abc/default.nix b/nixpkgs/pkgs/applications/science/logic/abc/default.nix
new file mode 100644
index 000000000000..1685bb7aba33
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/abc/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, readline
+, cmake
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname   = "abc-verifier";
+  version = "unstable-2023-10-13";
+
+  src = fetchFromGitHub {
+    owner = "yosyshq";
+    repo  = "abc";
+    rev   = "896e5e7dedf9b9b1459fa019f1fa8aa8101fdf43";
+    hash  = "sha256-ou+E2lvDEOxXRXNygE/TyVi7quqk+CJHRI+HDI0xljE=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ readline ];
+
+  installPhase = ''
+    runHook preInstall
+    install -Dm755 'abc' "$out/bin/abc"
+    runHook postInstall
+  '';
+
+  # needed by yosys
+  passthru.rev = finalAttrs.src.rev;
+
+  meta = with lib; {
+    description = "A tool for squential logic synthesis and formal verification";
+    homepage    = "https://people.eecs.berkeley.edu/~alanmi/abc";
+    license     = licenses.mit;
+    maintainers = with maintainers; [ thoughtpolice Luflosi ];
+    mainProgram = "abc";
+    platforms   = platforms.unix;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/logic/abella/default.nix b/nixpkgs/pkgs/applications/science/logic/abella/default.nix
new file mode 100644
index 000000000000..7878626d6e9a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/abella/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchurl, rsync, ocamlPackages }:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "abella";
+  version = "2.0.8";
+
+  src = fetchurl {
+    url = "http://abella-prover.org/distributions/abella-${finalAttrs.version}.tar.gz";
+    sha256 = "sha256-80b/RUpE3KRY0Qu8eeTxAbk6mwGG6jVTPOP0qFjyj2M=";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ rsync ] ++ (with ocamlPackages; [ ocaml dune_3 menhir findlib ]);
+  buildInputs = with ocamlPackages; [ cmdliner yojson ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    rsync -av _build/default/src/abella.exe    $out/bin/abella
+
+    mkdir -p $out/share/emacs/site-lisp/abella/
+    rsync -av emacs/    $out/share/emacs/site-lisp/abella/
+
+    mkdir -p $out/share/abella/examples
+    rsync -av examples/ $out/share/abella/examples/
+  '';
+
+  meta = {
+    description = "Interactive theorem prover";
+    mainProgram = "abella";
+    longDescription = ''
+      Abella is an interactive theorem prover based on lambda-tree syntax.
+      This means that Abella is well-suited for reasoning about the meta-theory
+      of programming languages and other logical systems which manipulate
+      objects with binding.
+    '';
+    homepage = "https://abella-prover.org";
+    license = lib.licenses.gpl3;
+    maintainers = with lib.maintainers; [ bcdarwin ciil ];
+    platforms = lib.platforms.unix;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/logic/acgtk/default.nix b/nixpkgs/pkgs/applications/science/logic/acgtk/default.nix
new file mode 100644
index 000000000000..3fa4111668eb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/acgtk/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitLab, dune_3, ocamlPackages }:
+
+stdenv.mkDerivation {
+
+  pname = "acgtk";
+  version = "2.0.0";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.inria.fr";
+    owner = "acg";
+    repo = "dev/acgtk";
+    rev = "release-2.0.0-20231009";
+    hash = "sha256-ZymSQkBMBePPw7pJkfLkmqbIkQyIqB+7Pyrih2WAO50=";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = with ocamlPackages; [ menhir ocaml findlib dune_3 ];
+
+  buildInputs = with ocamlPackages; [
+    ansiterminal cairo2 cmdliner fmt logs menhirLib mtime ocamlgraph readline sedlex yojson
+  ];
+
+  buildPhase = ''
+    runHook preBuild
+    dune build --profile=release ''${enableParallelBuilding:+-j $NIX_BUILD_CORES}
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    dune install --prefix $out --libdir $OCAMLFIND_DESTDIR
+  '';
+
+  meta = with lib; {
+    homepage = "https://acg.loria.fr/";
+    description = "A toolkit for developing ACG signatures and lexicon";
+    license = licenses.cecill20;
+    inherit (ocamlPackages.ocaml.meta) platforms;
+    maintainers = [ maintainers.jirkamarsik ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/aiger/default.nix b/nixpkgs/pkgs/applications/science/logic/aiger/default.nix
new file mode 100644
index 000000000000..5b9e8f62aa01
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/aiger/default.nix
@@ -0,0 +1,60 @@
+{ lib, stdenv, fetchurl, picosat }:
+
+stdenv.mkDerivation rec {
+  pname = "aiger";
+  version = "1.9.9";
+
+  src = fetchurl {
+    url    = "https://fmv.jku.at/aiger/${pname}-${version}.tar.gz";
+    sha256 = "1ish0dw0nf9gyghxsdhpy1jjiy5wp54c993swp85xp7m6vdx6l0y";
+  };
+
+  patches = [
+    # Fix implicit declaration of `isatty`, which is an error with newer versions of clang.
+    ./fix-missing-header.patch
+  ];
+
+  enableParallelBuilding = true;
+
+  configurePhase = ''
+    # Set up picosat, so we can build 'aigbmc'
+    mkdir ../picosat
+    ln -s ${picosat}/include/picosat/picosat.h ../picosat/picosat.h
+    ln -s ${picosat}/lib/picosat.o             ../picosat/picosat.o
+    ln -s ${picosat}/share/picosat.version     ../picosat/VERSION
+    ./configure.sh
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $dev/include $lib/lib
+
+    # Do the installation manually, as the Makefile has odd
+    # cyrillic characters, and this is easier than adding
+    # a whole .patch file.
+    BINS=( \
+      aigand aigdd aigflip aigfuzz aiginfo aigjoin   \
+      aigmiter aigmove aignm aigor aigreset aigsim   \
+      aigsplit aigstrip aigtoaig aigtoblif aigtocnf  \
+      aigtodot aigtosmv aigunconstraint aigunroll    \
+      andtoaig bliftoaig smvtoaig soltostim wrapstim \
+      aigbmc aigdep
+    )
+
+    for x in ''${BINS[*]}; do
+      install -m 755 -s $x $out/bin/$x
+    done
+
+    cp -v aiger.o $lib/lib
+    cp -v aiger.h $dev/include
+  '';
+
+  outputs = [ "out" "dev" "lib" ];
+
+  meta = {
+    description = "And-Inverter Graph (AIG) utilities";
+    homepage    = "https://fmv.jku.at/aiger/";
+    license     = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ thoughtpolice ];
+    platforms   = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/aiger/fix-missing-header.patch b/nixpkgs/pkgs/applications/science/logic/aiger/fix-missing-header.patch
new file mode 100644
index 000000000000..5f0101bd7a03
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/aiger/fix-missing-header.patch
@@ -0,0 +1,11 @@
+diff -ur a/aigunconstraint.c b/aigunconstraint.c
+--- a/aigunconstraint.c	2013-10-06 09:08:03.000000000 -0400
++++ b/aigunconstraint.c	2023-10-27 08:55:01.678566389 -0400
+@@ -26,6 +26,7 @@
+ #include <stdarg.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <unistd.h>
+ 
+ static const char * USAGE =
+ "usage: aigunconstraint [-h][-v] [<input> [<output>]]\n"
diff --git a/nixpkgs/pkgs/applications/science/logic/alt-ergo/default.nix b/nixpkgs/pkgs/applications/science/logic/alt-ergo/default.nix
new file mode 100644
index 000000000000..d84aa5b6918a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/alt-ergo/default.nix
@@ -0,0 +1,40 @@
+{ darwin, fetchurl, lib, ocamlPackages, stdenv }:
+
+let
+  pname = "alt-ergo";
+  version = "2.5.2";
+
+  src = fetchurl {
+    url = "https://github.com/OCamlPro/alt-ergo/releases/download/v${version}/alt-ergo-${version}.tbz";
+    hash = "sha256-9GDBcBH49sheO5AjmDsznMEbw0JSrnSOcIIRN40/aJU=";
+  };
+in
+
+let alt-ergo-lib = ocamlPackages.buildDunePackage rec {
+  pname = "alt-ergo-lib";
+  inherit version src;
+  buildInputs = with ocamlPackages; [ ppx_blob ];
+  propagatedBuildInputs = with ocamlPackages; [ camlzip dolmen_loop dune-build-info fmt ocplib-simplex seq stdlib-shims zarith ];
+}; in
+
+let alt-ergo-parsers = ocamlPackages.buildDunePackage rec {
+  pname = "alt-ergo-parsers";
+  inherit version src;
+  nativeBuildInputs = [ ocamlPackages.menhir ];
+  propagatedBuildInputs = [ alt-ergo-lib ] ++ (with ocamlPackages; [ psmt2-frontend ]);
+}; in
+
+ocamlPackages.buildDunePackage {
+
+  inherit pname version src;
+
+  nativeBuildInputs = [ ocamlPackages.menhir ] ++ lib.optionals stdenv.isDarwin [ darwin.sigtool ];
+  buildInputs = [ alt-ergo-parsers ] ++ (with ocamlPackages; [ cmdliner dune-site ]);
+
+  meta = {
+    description = "High-performance theorem prover and SMT solver";
+    homepage    = "https://alt-ergo.ocamlpro.com/";
+    license     = lib.licenses.ocamlpro_nc;
+    maintainers = [ lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/anders/default.nix b/nixpkgs/pkgs/applications/science/logic/anders/default.nix
new file mode 100644
index 000000000000..dff6c86703d4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/anders/default.nix
@@ -0,0 +1,28 @@
+{ lib, fetchFromGitHub, ocamlPackages }:
+
+ocamlPackages.buildDunePackage rec {
+  pname = "anders";
+  version = "1.1.1";
+
+  duneVersion = "3";
+
+  src = fetchFromGitHub {
+    owner = "groupoid";
+    repo = "anders";
+    rev = version;
+    sha256 = "sha256-JUiZoo2rNLfgs94TlJqUNzul/7ODisCjSFAzhgSp1z4=";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocamlPackages.menhir ];
+  buildInputs = [ ocamlPackages.zarith ];
+
+  meta = with lib; {
+    description = "Modal Homotopy Type System";
+    mainProgram = "anders";
+    homepage = "https://homotopy.dev/";
+    license = licenses.isc;
+    maintainers = [ maintainers.suhr ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/aspino/default.nix b/nixpkgs/pkgs/applications/science/logic/aspino/default.nix
new file mode 100644
index 000000000000..6b0e75de8066
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/aspino/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchurl, fetchFromGitHub, zlib, boost }:
+
+let
+  glucose' = fetchurl {
+    url = "http://www.labri.fr/perso/lsimon/downloads/softwares/glucose-syrup.tgz";
+    sha256 = "0bq5l2jabhdfhng002qfk0mcj4pfi1v5853x3c7igwfrgx0jmfld";
+  };
+in
+
+stdenv.mkDerivation {
+  pname = "aspino";
+  version = "unstable-2018-03-24";
+
+  src = fetchFromGitHub {
+    owner = "alviano";
+    repo = "aspino";
+    rev = "4d7483e328bdf9a00ef1eb7f2868e7b0f2a82d56";
+    hash = "sha256-R1TpBDGdq+NQQzmzqk0wYaz2Hns3qru0AkAyFPQasPA=";
+  };
+
+  buildInputs = [ zlib boost ];
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace "GCC = g++" "GCC = c++"
+    substituteInPlace src/main.cc \
+      --replace "defined(__linux__)" "defined(__linux__) && defined(__x86_64__)"
+    substituteInPlace src/MaxSatSolver.cc \
+      --replace "occ[i][sign(softLiterals[j])] > 0" "occ[i][sign(softLiterals[j])] != 0"
+  '';
+
+  preBuild = ''
+    cp ${glucose'} patches/glucose-syrup.tgz
+    ./bootstrap.sh
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/bin
+    install -m0755 build/release/{aspino,fairino-{bs,ls,ps},maxino-2015-{k16,kdyn}} $out/bin
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "SAT/PseudoBoolean/MaxSat/ASP solver using glucose";
+    maintainers = with maintainers; [ gebner ];
+    platforms = platforms.unix;
+    license = licenses.asl20;
+    homepage = "https://alviano.net/software/maxino/";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/avy/default.nix b/nixpkgs/pkgs/applications/science/logic/avy/default.nix
new file mode 100644
index 000000000000..38fef51c56e6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/avy/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchgit, cmake, zlib, boost }:
+
+stdenv.mkDerivation rec {
+  pname = "avy";
+  version = "2019.05.01"; # date of cav19 tag
+
+  src = fetchgit {
+    url    = "https://bitbucket.org/arieg/extavy";
+    rev    = "cav19";
+    sha256 = "0qdzy9srxp5f38x4dbb3prnr9il6cy0kz80avrvd7fxqzy7wdlwy";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib boost.out boost.dev ];
+  env.NIX_CFLAGS_COMPILE = toString ([ "-Wno-narrowing" ]
+    # Squelch endless stream of warnings on same few things
+    ++ lib.optionals stdenv.cc.isClang [
+      "-Wno-empty-body"
+      "-Wno-tautological-compare"
+      "-Wc++11-compat-deprecated-writable-strings"
+      "-Wno-deprecated"
+    ]);
+
+  prePatch = ''
+    sed -i -e '1i#include <stdint.h>' abc/src/bdd/dsd/dsd.h
+    substituteInPlace abc/src/bdd/dsd/dsd.h --replace \
+               '((Child = Dsd_NodeReadDec(Node,Index))>=0);' \
+               '((intptr_t)(Child = Dsd_NodeReadDec(Node,Index))>=0);'
+
+    patch -p1 -d minisat -i ${./minisat-fenv.patch}
+    patch -p1 -d glucose -i ${./glucose-fenv.patch}
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp avy/src/{avy,avybmc} $out/bin/
+  '';
+
+  meta = {
+    description = "AIGER model checking for Property Directed Reachability";
+    homepage    = "https://arieg.bitbucket.io/avy/";
+    license     = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ thoughtpolice ];
+    platforms   = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/avy/glucose-fenv.patch b/nixpkgs/pkgs/applications/science/logic/avy/glucose-fenv.patch
new file mode 100644
index 000000000000..eb0b196966b8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/avy/glucose-fenv.patch
@@ -0,0 +1,57 @@
+diff --git a/core/Main.cc b/core/Main.cc
+index fd8fca1..37d2ed5 100644
+--- a/core/Main.cc
++++ b/core/Main.cc
+@@ -95,9 +95,13 @@ int main(int argc, char** argv)
+         setUsageHelp("c USAGE: %s [options] <input-file> <result-output-file>\n\n  where input may be either in plain or gzipped DIMACS.\n");
+         // printf("This is MiniSat 2.0 beta\n");
+ 
+-#if defined(__linux__)
+-        fpu_control_t oldcw, newcw;
+-        _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
++#if defined(__linux__) && defined(__x86_64__)
++        fenv_t fenv;
++
++        fegetenv(&fenv);
++        fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
++        fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
++        fesetenv(&fenv);
+         printf("c WARNING: for repeatability, setting FPU to use double precision\n");
+ #endif
+         // Extra options:
+diff --git a/simp/Main.cc b/simp/Main.cc
+index 4f4772d..c605f6e 100644
+--- a/simp/Main.cc
++++ b/simp/Main.cc
+@@ -96,9 +96,13 @@ int main(int argc, char** argv)
+       setUsageHelp("c USAGE: %s [options] <input-file> <result-output-file>\n\n  where input may be either in plain or gzipped DIMACS.\n");
+         
+         
+-#if defined(__linux__)
+-        fpu_control_t oldcw, newcw;
+-        _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
++#if defined(__linux__) && defined(__x86_64__)
++        fenv_t fenv;
++
++        fegetenv(&fenv);
++        fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
++        fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
++        fesetenv(&fenv);
+         printf("WARNING: for repeatability, setting FPU to use double precision\n");
+ #endif
+         // Extra options:
+diff --git a/utils/System.h b/utils/System.h
+index 004d498..2f6d922 100644
+--- a/utils/System.h
++++ b/utils/System.h
+@@ -21,8 +21,8 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
+ #ifndef Glucose_System_h
+ #define Glucose_System_h
+ 
+-#if defined(__linux__)
+-#include <fpu_control.h>
++#if defined(__linux__) && defined(__x86_64__)
++#include <fenv.h>
+ #endif
+ 
+ #include "glucose/mtl/IntTypes.h"
diff --git a/nixpkgs/pkgs/applications/science/logic/avy/minisat-fenv.patch b/nixpkgs/pkgs/applications/science/logic/avy/minisat-fenv.patch
new file mode 100644
index 000000000000..31e481bd6696
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/avy/minisat-fenv.patch
@@ -0,0 +1,57 @@
+diff --git a/core/Main.cc b/core/Main.cc
+index 2b0d97b..9ba985d 100644
+--- a/core/Main.cc
++++ b/core/Main.cc
+@@ -77,9 +77,13 @@ int main(int argc, char** argv)
+         setUsageHelp("USAGE: %s [options] <input-file> <result-output-file>\n\n  where input may be either in plain or gzipped DIMACS.\n");
+         // printf("This is MiniSat 2.0 beta\n");
+         
+-#if defined(__linux__)
+-        fpu_control_t oldcw, newcw;
+-        _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
++#if defined(__linux__) && defined(__x86_64__)
++        fenv_t fenv;
++
++        fegetenv(&fenv);
++        fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
++        fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
++        fesetenv(&fenv);
+         printf("WARNING: for repeatability, setting FPU to use double precision\n");
+ #endif
+         // Extra options:
+diff --git a/simp/Main.cc b/simp/Main.cc
+index 2804d7f..7fbdb33 100644
+--- a/simp/Main.cc
++++ b/simp/Main.cc
+@@ -78,9 +78,13 @@ int main(int argc, char** argv)
+         setUsageHelp("USAGE: %s [options] <input-file> <result-output-file>\n\n  where input may be either in plain or gzipped DIMACS.\n");
+         // printf("This is MiniSat 2.0 beta\n");
+         
+-#if defined(__linux__)
+-        fpu_control_t oldcw, newcw;
+-        _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
++#if defined(__linux__) && defined(__x86_64__)
++        fenv_t fenv;
++
++        fegetenv(&fenv);
++        fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
++        fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
++        fesetenv(&fenv);
+         printf("WARNING: for repeatability, setting FPU to use double precision\n");
+ #endif
+         // Extra options:
+diff --git a/utils/System.h b/utils/System.h
+index 1758192..840bee5 100644
+--- a/utils/System.h
++++ b/utils/System.h
+@@ -21,8 +21,8 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
+ #ifndef Minisat_System_h
+ #define Minisat_System_h
+ 
+-#if defined(__linux__)
+-#include <fpu_control.h>
++#if defined(__linux__) && defined(__x86_64__)
++#include <fenv.h>
+ #endif
+ 
+ #include "mtl/IntTypes.h"
diff --git a/nixpkgs/pkgs/applications/science/logic/beluga/default.nix b/nixpkgs/pkgs/applications/science/logic/beluga/default.nix
new file mode 100644
index 000000000000..693be7f33886
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/beluga/default.nix
@@ -0,0 +1,43 @@
+{ lib, fetchFromGitHub, ocamlPackages }:
+
+ocamlPackages.buildDunePackage rec {
+  pname = "beluga";
+  version = "1.1.1";
+
+  src = fetchFromGitHub {
+    owner = "Beluga-lang";
+    repo = "Beluga";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-l/C77czLtlLnpadVx4d9ve9jv/e11jsOgzrbXt+Zo5s=";
+  };
+
+  duneVersion = "3";
+
+  buildInputs = with ocamlPackages; [
+    gen
+    sedlex
+    extlib
+    dune-build-info
+    linenoise
+    omd
+    uri
+    ounit2
+    yojson
+  ];
+
+  doCheck = true;
+
+  postInstall = ''
+    mkdir -p $out/share/emacs/site-lisp/beluga/
+    cp -r tools/beluga-mode.el $out/share/emacs/site-lisp/beluga
+  '';
+
+  meta = with lib; {
+    description = "A functional language for reasoning about formal systems";
+    homepage = "https://complogic.cs.mcgill.ca/beluga";
+    changelog = "https://github.com/Beluga-lang/Beluga/releases/tag/v${version}";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.bcdarwin ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/bitwuzla/default.nix b/nixpkgs/pkgs/applications/science/logic/bitwuzla/default.nix
new file mode 100644
index 000000000000..bacf8620e5fd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/bitwuzla/default.nix
@@ -0,0 +1,70 @@
+{ stdenv
+, fetchFromGitHub
+, lib
+, python3
+, cmake
+, lingeling
+, btor2tools
+, symfpu
+, gtest
+, gmp
+, cadical
+, minisat
+, picosat
+, cryptominisat
+, zlib
+, pkg-config
+  # "*** internal error in 'lglib.c': watcher stack overflow" on aarch64-linux
+, withLingeling ? !stdenv.hostPlatform.isAarch64
+}:
+
+stdenv.mkDerivation rec {
+  pname = "bitwuzla";
+  version = "unstable-2022-10-03";
+
+  src = fetchFromGitHub {
+    owner = "bitwuzla";
+    repo = "bitwuzla";
+    rev = "3bc0f9f1aca04afabe1aff53dd0937924618b2ad";
+    hash = "sha256-UXZERl7Nedwex/oUrcf6/GkDSgOQ537WDYm117RfvWo=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [
+    cadical
+    cryptominisat
+    picosat
+    minisat
+    btor2tools
+    symfpu
+    gmp
+    zlib
+  ] ++ lib.optional withLingeling lingeling;
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DPicoSAT_INCLUDE_DIR=${lib.getDev picosat}/include/picosat"
+    "-DBtor2Tools_INCLUDE_DIR=${lib.getDev btor2tools}/include/btor2parser"
+    "-DBtor2Tools_LIBRARIES=${lib.getLib btor2tools}/lib/libbtor2parser${stdenv.hostPlatform.extensions.sharedLibrary}"
+  ] ++ lib.optional doCheck "-DTESTING=YES";
+
+  nativeCheckInputs = [ python3 gtest ];
+  # two tests fail on darwin and 3 on aarch64-linux
+  doCheck = stdenv.hostPlatform.isLinux && (!stdenv.hostPlatform.isAarch64);
+  preCheck = let
+    var = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
+  in
+    ''
+      export ${var}=$(readlink -f lib)
+      patchShebangs ..
+    '';
+
+  meta = with lib; {
+    description = "A SMT solver for fixed-size bit-vectors, floating-point arithmetic, arrays, and uninterpreted functions";
+    mainProgram = "bitwuzla";
+    homepage = "https://bitwuzla.github.io";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ symphorien ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/boolector/default.nix b/nixpkgs/pkgs/applications/science/logic/boolector/default.nix
new file mode 100644
index 000000000000..d23db163aeb6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/boolector/default.nix
@@ -0,0 +1,67 @@
+{ stdenv, fetchFromGitHub, lib, python3, fetchpatch
+, cmake, lingeling, btor2tools, gtest, gmp
+}:
+
+stdenv.mkDerivation rec {
+  pname = "boolector";
+  version = "3.2.3";
+
+  src = fetchFromGitHub {
+    owner  = "boolector";
+    repo   = "boolector";
+    rev    = version;
+    hash   = "sha256-CdfpXUbU1+yEmrNyl+hvHlJfpzzzx356naim6vRafDg=";
+  };
+
+  patches = [
+    # present in master - remove after 3.2.3
+    (fetchpatch {
+      name = "update-unit-tests-to-cpp-14.patch";
+      url = "https://github.com/Boolector/boolector/commit/cc13f371c0c5093d98638ddd213dc835ef3aadf3.patch";
+      hash = "sha256-h8DBhAvUu+wXBwmvwRhHnJv3XrbEpBpvX9D1FI/+avc=";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake gtest ];
+  buildInputs = [ lingeling btor2tools gmp ];
+
+  cmakeFlags =
+    [ "-DBUILD_SHARED_LIBS=ON"
+      "-DUSE_LINGELING=YES"
+      "-DBtor2Tools_INCLUDE_DIR=${btor2tools.dev}/include/btor2parser"
+    ] ++ (lib.optional (gmp != null) "-DUSE_GMP=YES");
+
+  nativeCheckInputs = [ python3 ];
+  doCheck = true;
+  preCheck =
+    let var = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
+    in
+      # tests modelgen and modelgensmt2 spawn boolector in another processes and
+      # macOS strips DYLD_LIBRARY_PATH, hardcode it for testing
+      lib.optionalString stdenv.isDarwin ''
+        cp -r bin bin.back
+        install_name_tool -change libboolector.dylib $(pwd)/lib/libboolector.dylib bin/boolector
+      '' + ''
+        export ${var}=$(readlink -f lib)
+        patchShebangs ..
+      '';
+
+  postCheck = lib.optionalString stdenv.isDarwin ''
+    rm -rf bin
+    mv bin.back bin
+  '';
+
+  # this is what haskellPackages.boolector expects
+  postInstall = ''
+    cp $out/include/boolector/boolector.h $out/include/boolector.h
+    cp $out/include/boolector/btortypes.h $out/include/btortypes.h
+  '';
+
+  meta = with lib; {
+    description = "An extremely fast SMT solver for bit-vectors and arrays";
+    homepage    = "https://boolector.github.io";
+    license     = licenses.mit;
+    platforms   = with platforms; linux ++ darwin;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/btor2tools/default.nix b/nixpkgs/pkgs/applications/science/logic/btor2tools/default.nix
new file mode 100644
index 000000000000..ce73ea636f29
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/btor2tools/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, cmake, fetchFromGitHub, fetchpatch, fixDarwinDylibNames }:
+
+stdenv.mkDerivation rec {
+  pname = "btor2tools";
+  version = "1.0.0-pre_${src.rev}";
+
+  src = fetchFromGitHub {
+    owner  = "boolector";
+    repo   = "btor2tools";
+    rev    = "9831f9909fb283752a3d6d60d43613173bd8af42";
+    sha256 = "0mfqmkgvyw8fa2c09kww107dmk180ch1hp98r5kv41vnc04iqb0s";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "gcc-13.patch";
+      url = "https://github.com/Boolector/btor2tools/commit/037f1fa88fb439dca6f648ad48a3463256d69d8b.patch";
+      hash = "sha256-FX1yy9XdUs1tAReOxhEzNHu48DrISzNNMSYoIrhHoFY=";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
+
+  installPhase = ''
+    mkdir -p $out $dev/include/btor2parser/ $lib/lib
+
+    cp -vr bin $out
+    cp -v  ../src/btor2parser/btor2parser.h $dev/include/btor2parser
+    cp -v  lib/libbtor2parser.* $lib/lib
+  '';
+
+  outputs = [ "out" "dev" "lib" ];
+
+  cmakeFlags = [
+    # RPATH of binary /nix/store/.../bin/btorsim contains a forbidden reference to /build/
+    "-DCMAKE_SKIP_BUILD_RPATH=ON"
+  ];
+
+  meta = with lib; {
+    description = "A generic parser and tool package for the BTOR2 format";
+    homepage    = "https://github.com/Boolector/btor2tools";
+    license     = licenses.mit;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/cadical/default.nix b/nixpkgs/pkgs/applications/science/logic/cadical/default.nix
new file mode 100644
index 000000000000..873b3836b73e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/cadical/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "cadical";
+  version = "1.9.5";
+
+  src = fetchFromGitHub {
+    owner = "arminbiere";
+    repo = "cadical";
+    rev = "rel-${version}";
+    sha256 = "sha256-mAKuz8WjX+ywQ7Sw5hRMPftsbbilTlmQ9qZVowXxs28=";
+  };
+
+  outputs = [ "out" "dev" "lib" ];
+  doCheck = true;
+
+  # the configure script is not generated by autotools and does not accept the
+  # arguments that the default configurePhase passes like --prefix and --libdir
+  configurePhase = ''
+    runHook preConfigure
+
+    ./configure
+
+    runHook postConfigure
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm0755 build/cadical "$out/bin/cadical"
+    install -Dm0755 build/mobical "$out/bin/mobical"
+    install -Dm0644 src/ccadical.h "$dev/include/ccadical.h"
+    install -Dm0644 src/cadical.hpp "$dev/include/cadical.hpp"
+    install -Dm0644 build/libcadical.a "$lib/lib/libcadical.a"
+    mkdir -p "$out/share/doc/${pname}/"
+    install -Dm0755 {LICEN?E,README*,VERSION} "$out/share/doc/${pname}/"
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Simplified Satisfiability Solver";
+    maintainers = with maintainers; [ shnarazk ];
+    platforms = platforms.unix;
+    license = licenses.mit;
+    homepage = "https://fmv.jku.at/cadical/";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/cbmc/0001-Do-not-download-sources-in-cmake.patch b/nixpkgs/pkgs/applications/science/logic/cbmc/0001-Do-not-download-sources-in-cmake.patch
new file mode 100644
index 000000000000..181214093ef8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/cbmc/0001-Do-not-download-sources-in-cmake.patch
@@ -0,0 +1,41 @@
+From 206084d2e08198b0b5b67733c407bd3fb74affb1 Mon Sep 17 00:00:00 2001
+From: Jiajie Chen <c@jia.je>
+Date: Sun, 2 Jul 2023 22:43:27 +0800
+Subject: [PATCH] Do not download sources in cmake
+
+---
+ src/solvers/CMakeLists.txt | 11 +----------
+ 1 file changed, 1 insertion(+), 10 deletions(-)
+
+diff --git a/src/solvers/CMakeLists.txt b/src/solvers/CMakeLists.txt
+index 8bfcf4d13c..6ba858a461 100644
+--- a/src/solvers/CMakeLists.txt
++++ b/src/solvers/CMakeLists.txt
+@@ -123,16 +123,6 @@ foreach(SOLVER ${sat_impl})
+     elseif("${SOLVER}" STREQUAL "cadical")
+         message(STATUS "Building solvers with cadical")
+ 
+-        download_project(PROJ cadical
+-            URL https://github.com/arminbiere/cadical/archive/rel-1.5.3.tar.gz
+-            PATCH_COMMAND patch -p1 -i ${CBMC_SOURCE_DIR}/../scripts/cadical-1.5.3-patch
+-            COMMAND cmake -E copy ${CBMC_SOURCE_DIR}/../scripts/cadical_CMakeLists.txt CMakeLists.txt
+-            COMMAND ./configure
+-            URL_MD5 265b1a715000ed3c5b6de36ddd1278a0
+-        )
+-
+-        add_subdirectory(${cadical_SOURCE_DIR} ${cadical_BINARY_DIR})
+-
+         target_compile_definitions(solvers PUBLIC
+             SATCHECK_CADICAL HAVE_CADICAL
+         )
+@@ -140,6 +130,7 @@ foreach(SOLVER ${sat_impl})
+         target_include_directories(solvers
+             PUBLIC
+             ${cadical_SOURCE_DIR}/src
++	    ${cadical_INCLUDE_DIR}
+         )
+ 
+         target_link_libraries(solvers cadical)
+-- 
+2.40.1
+
diff --git a/nixpkgs/pkgs/applications/science/logic/cbmc/default.nix b/nixpkgs/pkgs/applications/science/logic/cbmc/default.nix
new file mode 100644
index 000000000000..6a878735bb3d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/cbmc/default.nix
@@ -0,0 +1,88 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, testers
+, bison
+, cadical
+, cbmc
+, cmake
+, flex
+, makeWrapper
+, perl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cbmc";
+  version = "5.91.0";
+
+  src = fetchFromGitHub {
+    owner = "diffblue";
+    repo = pname;
+    rev = "${pname}-${version}";
+    sha256 = "sha256-7DzhGEDS9T6WIjGoxOw9Gf/q+tYNFJDPbQUBV3tbn/I=";
+  };
+
+  nativeBuildInputs = [
+    bison
+    cmake
+    flex
+    perl
+    makeWrapper
+  ];
+
+  buildInputs = [ cadical ];
+
+  # do not download sources
+  # link existing cadical instead
+  patches = [
+    ./0001-Do-not-download-sources-in-cmake.patch
+  ];
+
+  postPatch = ''
+    # do not hardcode gcc
+    substituteInPlace "scripts/bash-autocomplete/extract_switches.sh" \
+      --replace "gcc" "$CC" \
+      --replace "g++" "$CXX"
+    # fix library_check.sh interpreter error
+    patchShebangs .
+  '' + lib.optionalString (!stdenv.cc.isGNU) ''
+    # goto-gcc rely on gcc
+    substituteInPlace "regression/CMakeLists.txt" \
+      --replace "add_subdirectory(goto-gcc)" ""
+  '';
+
+  postInstall = ''
+    # goto-cc expects ls_parse.py in PATH
+    mkdir -p $out/share/cbmc
+    mv $out/bin/ls_parse.py $out/share/cbmc/ls_parse.py
+    chmod +x $out/share/cbmc/ls_parse.py
+    wrapProgram $out/bin/goto-cc \
+      --prefix PATH : "$out/share/cbmc" \
+  '';
+
+  env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
+    # Needed with GCC 12 but breaks on darwin (with clang)
+    "-Wno-error=maybe-uninitialized"
+  ] ++ lib.optionals stdenv.cc.isClang [
+    # fix "argument unused during compilation"
+    "-Wno-unused-command-line-argument"
+  ]);
+
+  # TODO: add jbmc support
+  cmakeFlags = [ "-DWITH_JBMC=OFF" "-Dsat_impl=cadical" "-Dcadical_INCLUDE_DIR=${cadical.dev}/include" ];
+
+  passthru.tests.version = testers.testVersion {
+    package = cbmc;
+    command = "cbmc --version";
+  };
+
+  meta = with lib; {
+    description = "CBMC is a Bounded Model Checker for C and C++ programs";
+    homepage = "http://www.cprover.org/cbmc/";
+    license = licenses.bsdOriginal;
+    maintainers = with maintainers; [ jiegec ];
+    platforms = platforms.unix;
+    # https://github.com/diffblue/cbmc/issues/7423
+    broken = stdenv.isLinux && stdenv.isAarch64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/cedille/Fix-to-string.agda-to-compile-with-Agda-2.6.1.patch b/nixpkgs/pkgs/applications/science/logic/cedille/Fix-to-string.agda-to-compile-with-Agda-2.6.1.patch
new file mode 100644
index 000000000000..51f1478987eb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/cedille/Fix-to-string.agda-to-compile-with-Agda-2.6.1.patch
@@ -0,0 +1,31 @@
+From 563f023aba1034f4f433f412302b825b059ef5a5 Mon Sep 17 00:00:00 2001
+From: Mark Barbone <mark.l.barbone@gmail.com>
+Date: Sun, 19 Jul 2020 17:24:30 -0400
+Subject: [PATCH] Fix to-string.agda to compile with Agda 2.6.1
+
+---
+Adapted from https://github.com/cedille/cedille/pull/156.
+
+ src/to-string.agda | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/src/to-string.agda b/src/to-string.agda
+index 2505942..051a2da 100644
+--- a/src/to-string.agda
++++ b/src/to-string.agda
+@@ -100,9 +100,9 @@ no-parens {TK} _ _ _ = tt
+ no-parens {QUALIF} _ _ _ = tt
+ no-parens {ARG} _ _ _ = tt
+ 
+-pattern ced-ops-drop-spine = cedille-options.options.mk-options _ _ _ _ ff _ _ _ ff _
+-pattern ced-ops-conv-arr = cedille-options.options.mk-options _ _ _ _ _ _ _ _ ff _
+-pattern ced-ops-conv-abs = cedille-options.options.mk-options _ _ _ _ _ _ _ _ tt _
++pattern ced-ops-drop-spine = cedille-options.mk-options _ _ _ _ ff _ _ _ ff _
++pattern ced-ops-conv-arr = cedille-options.mk-options _ _ _ _ _ _ _ _ ff _
++pattern ced-ops-conv-abs = cedille-options.mk-options _ _ _ _ _ _ _ _ tt _
+ 
+ drop-spine : cedille-options.options → {ed : exprd} → ctxt → ⟦ ed ⟧ → ⟦ ed ⟧
+ drop-spine ops @ ced-ops-drop-spine = h
+-- 
+2.27.0
+
diff --git a/nixpkgs/pkgs/applications/science/logic/cedille/default.nix b/nixpkgs/pkgs/applications/science/logic/cedille/default.nix
new file mode 100644
index 000000000000..4d026a2d9c7a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/cedille/default.nix
@@ -0,0 +1,60 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, alex
+, happy
+, Agda
+, buildPackages
+, ghcWithPackages
+}:
+
+stdenv.mkDerivation rec {
+  version = "1.1.2";
+  pname = "cedille";
+
+  src = fetchFromGitHub {
+    owner = "cedille";
+    repo = "cedille";
+    rev = "v${version}";
+    sha256 = "1j745q9sd32fhcb96wjq6xvyqq1k6imppjnya6x0n99fyfnqzvg9";
+    fetchSubmodules = true;
+  };
+
+  patches = [
+    ./Fix-to-string.agda-to-compile-with-Agda-2.6.1.patch
+  ];
+
+  nativeBuildInputs = [ alex happy ];
+  buildInputs = [ Agda (ghcWithPackages (ps: [ps.ieee])) ];
+
+  LANG = "en_US.UTF-8";
+  LOCALE_ARCHIVE =
+    lib.optionalString (stdenv.buildPlatform.libc == "glibc")
+      "${buildPackages.glibcLocales}/lib/locale/locale-archive";
+
+  postPatch = ''
+    patchShebangs create-libraries.sh
+  '';
+
+  installPhase = ''
+    install -Dm755 -t $out/bin/ cedille
+    install -Dm755 -t $out/bin/ core/cedille-core
+    install -Dm644 -t $out/share/info docs/info/cedille-info-main.info
+
+    mkdir -p $out/lib/
+    cp -r lib/ $out/lib/cedille/
+  '';
+
+  meta = with lib; {
+    description = "An interactive theorem-prover and dependently typed programming language, based on extrinsic (aka Curry-style) type theory";
+    homepage = "https://cedille.github.io/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ marsam mpickering ];
+    platforms = platforms.unix;
+
+    # Broken due to Agda update.  See
+    # https://github.com/NixOS/nixpkgs/pull/129606#issuecomment-881107449.
+    broken = true;
+    hydraPlatforms = platforms.none;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/celf/default.nix b/nixpkgs/pkgs/applications/science/logic/celf/default.nix
new file mode 100644
index 000000000000..e1f0c237f673
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/celf/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, smlnj }:
+
+stdenv.mkDerivation rec {
+  pname = "celf";
+  pversion = "2013-07-25";
+  name = "${pname}-${pversion}";
+
+  src = fetchFromGitHub {
+    owner  = "clf";
+    repo   = pname;
+    rev    = "d61d95900ab316468ae850fa34a2fe9488bc5b59";
+    sha256 = "0slrwcxglp0sdbp6wr65cdkl5wcap2i0fqxbwqfi1q3cpb6ph6hq";
+  };
+
+  buildInputs = [ smlnj ];
+
+  # (can also build with MLton)
+  buildPhase = ''
+    export SMLNJ_HOME=${smlnj}
+    sml < main-export.sml
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp .heap* $out/bin/
+    ./.mkexec ${smlnj}/bin/sml $out/bin celf
+  '';
+
+  meta = with lib; {
+    description = "Linear logic programming system";
+    mainProgram = "celf";
+    homepage = "https://github.com/clf/celf";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/clprover/clprover.nix b/nixpkgs/pkgs/applications/science/logic/clprover/clprover.nix
new file mode 100644
index 000000000000..543c6cb4310b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/clprover/clprover.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchzip }:
+
+stdenv.mkDerivation {
+  pname = "clprover";
+  version = "1.0.3";
+
+  src = fetchzip {
+    url = "https://cgi.csc.liv.ac.uk/~ullrich/CLProver++/CLProver++-v1.0.3-18-04-2015.zip";
+    sha256 = "10kmlg4m572qwfzi6hkyb0ypb643xw8sfb55xx7866lyh37w1q3s";
+    stripRoot = false;
+  };
+
+  installPhase = ''
+    mkdir $out
+    cp -r bin $out/bin
+    mkdir -p $out/share/clprover
+    cp -r examples $out/share/clprover/examples
+  '';
+
+  meta = with lib; {
+    description = "Resolution-based theorem prover for Coalition Logic implemented in C++";
+    mainProgram = "CLProver++";
+    homepage = "https://cgi.csc.liv.ac.uk/~ullrich/CLProver++/";
+    license = licenses.gpl3; # Note that while the website states that it is GPLv2 but the file in the zip as well as the comments in the source state it is GPLv3
+    maintainers = with maintainers; [ mgttlinger ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/coq/default.nix b/nixpkgs/pkgs/applications/science/logic/coq/default.nix
new file mode 100644
index 000000000000..37a8aba7d8c7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/coq/default.nix
@@ -0,0 +1,242 @@
+# - coqide compilation can be disabled by setting buildIde to false
+# - The csdp program used for the Micromega tactic is statically referenced.
+#   However, coq can build without csdp by setting it to null.
+#   In this case some Micromega tactics will search the user's path for the csdp program and will fail if it is not found.
+# - The exact version can be specified through the `version` argument to
+#   the derivation; it defaults to the latest stable version.
+
+{ lib, stdenv, fetchzip, writeText, pkg-config, gnumake42
+, customOCamlPackages ? null
+, ocamlPackages_4_05, ocamlPackages_4_09, ocamlPackages_4_10, ocamlPackages_4_12
+, ocamlPackages_4_14
+, ncurses
+, buildIde ? null # default is true for Coq < 8.14 and false for Coq >= 8.14
+, glib, gnome, wrapGAppsHook, makeDesktopItem, copyDesktopItems
+, csdp ? null
+, version, coq-version ? null
+}@args:
+let lib' = lib; in
+let lib = import ../../../../build-support/coq/extra-lib.nix {lib = lib';}; in
+with builtins; with lib;
+let
+  release = {
+   "8.5pl1".sha256     = "1976ki5xjg2r907xj9p7gs0kpdinywbwcqlgxqw75dgp0hkgi00n";
+   "8.5pl2".sha256     = "109rrcrx7mz0fj7725kjjghfg5ydwb24hjsa5hspa27b4caah7rh";
+   "8.5pl3".sha256     = "15c3rdk59nifzihsp97z4vjxis5xmsnrvpb86qiazj143z2fmdgw";
+   "8.6.0".sha256      = "148mb48zpdax56c0blfi7v67lx014lnmrvxxasi28hsibyz2lvg4";
+   "8.6.0".rev         = "V8.6";
+   "8.6.1".sha256      = "0llrxcxwy5j87vbbjnisw42rfw1n1pm5602ssx64xaxx3k176g6l";
+   "8.7.0".sha256      = "1h18b7xpnx3ix9vsi5fx4zdcbxy7bhra7gd5c5yzxmk53cgf1p9m";
+   "8.7.1".sha256      = "0gjn59jkbxwrihk8fx9d823wjyjh5m9gvj9l31nv6z6bcqhgdqi8";
+   "8.7.2".sha256      = "0a0657xby8wdq4aqb2xsxp3n7pmc2w4yxjmrb2l4kccs1aqvaj4w";
+   "8.8.0".sha256      = "13a4fka22hdxsjk11mgjb9ffzplfxyxp1sg5v1c8nk1grxlscgw8";
+   "8.8.1".sha256      = "1hlf58gwazywbmfa48219amid38vqdl94yz21i11b4map6jfwhbk";
+   "8.8.2".sha256      = "1lip3xja924dm6qblisk1bk0x8ai24s5xxqxphbdxj6djglj68fd";
+   "8.9.0".sha256      = "1dkgdjc4n1m15m1p724hhi5cyxpqbjw6rxc5na6fl3v4qjjfnizh";
+   "8.9.1".sha256      = "1xrq6mkhpq994bncmnijf8jwmwn961kkpl4mwwlv7j3dgnysrcv2";
+   "8.10.0".sha256     = "138jw94wp4mg5dgjc2asn8ng09ayz1mxdznq342n0m469j803gzg";
+   "8.10.1".sha256     = "072v2zkjzf7gj48137wpr3c9j0hg9pdhlr5l8jrgrwynld8fp7i4";
+   "8.10.2".sha256     = "0znxmpy71bfw0p6x47i82jf5k7v41zbz9bdpn901ysn3ir8l3wrz";
+   "8.11.0".sha256     = "1rfdic6mp7acx2zfwz7ziqk12g95bl9nyj68z4n20a5bcjv2pxpn";
+   "8.11.1".sha256     = "0qriy9dy36dajsv5qmli8gd6v55mah02ya334nw49ky19v7518m0";
+   "8.11.2".sha256     = "0f77ccyxdgbf1nrj5fa8qvrk1cyfy06fv8gj9kzfvlcgn0cf48sa";
+   "8.12.0".sha256     = "18dc7k0piv6v064zgdadpw6mkkxk7j663hb3svgj5236fihjr0cz";
+   "8.12.1".sha256     = "1rkcyjjrzcqw9xk93hsq0vvji4f8r5iq0f739mghk60bghkpnb7q";
+   "8.12.2".sha256     = "18gscfm039pqhq4msq01nraig5dm9ab98bjca94zldf8jvdv0x2n";
+   "8.13.0".sha256     = "1l2c63vskp8kiyxiyi5rpgbmnv67ysn3y4lybd6nj0li5llibifi";
+   "8.13.1".sha256     = "15drjcqhsgwqnv02bbidyhk316ypyhz1pxfz2gwsalci9svhkz0v";
+   "8.13.2".sha256     = "14d4alp35hngvga9m7cfp5d1nl62xdj0nm4811f2jjblk86gxxk4";
+   "8.14.0".sha256     = "0yxjx9kq9bfpk31dc1c6a0pz0827fz7jmrcwwd4n7dc07yi0arq8";
+   "8.14.1".sha256     = "0xdqiabgm4lrm6d7lw544zd8xwb1cdcavsxvwwlqq6yid2rl2yli";
+   "8.15.0".sha256     = "sha256:0q7jl3bn0d1v9cwdkxykw4frccww6wbh1p8hdrfqw489mkxmh5jh";
+   "8.15.1".sha256     = "sha256:1janvmnk3czimp0j5qmnfwx6509vhpjc2q7lcza1bc6dm6kn8n42";
+   "8.15.2".sha256     = "sha256:0qibbvzrhsvs6w3zpkhyclndp29jnr6bs9i5skjlpp431jdjjfqd";
+   "8.16.0".sha256   = "sha256-3V6kL9j2rn5FHBxq1mtmWWTZS9X5cAyvtUsS6DaM+is=";
+   "8.16.1".sha256   = "sha256-n7830+zfZeyYHEOGdUo57bH6bb2/SZs8zv8xJhV+iAc=";
+   "8.17.0".sha256   = "sha256-TGwm7S6+vkeZ8cidvp8pkiAd9tk008jvvPvYgfEOXhM=";
+   "8.17.1".sha256   = "sha256-x+RwkbxMg9aR0L3WSCtpIz8jwA5cJA4tXAtHMZb20y4=";
+   "8.18.0".sha256   = "sha256-WhiBs4nzPHQ0R24xAdM49kmxSCPOxiOVMA1iiMYunz4=";
+   "8.19.0".sha256   = "sha256-ixsYCvCXpBHqJ71hLQklphlwoOO3i/6w2PJjllKqf9k=";
+   "8.19.1".sha256   = "sha256-kmZ8Uk8jpzjOd67aAPp3C+vU2oNaBw9pr7+Uixcgg94=";
+  };
+  releaseRev = v: "V${v}";
+  fetched = import ../../../../build-support/coq/meta-fetch/default.nix
+    { inherit lib stdenv fetchzip; }
+    { inherit release releaseRev; location = { owner = "coq"; repo = "coq";}; }
+    args.version;
+  version = fetched.version;
+  coq-version = args.coq-version or (if version != "dev" then versions.majorMinor version else "dev");
+  coqAtLeast = v: coq-version == "dev" || versionAtLeast coq-version v;
+  buildIde = args.buildIde or (!coqAtLeast "8.14");
+  ideFlags = optionalString (buildIde && !coqAtLeast "8.10")
+    "-lablgtkdir ${ocamlPackages.lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -coqide opt";
+  csdpPatch = lib.optionalString (csdp != null) ''
+    substituteInPlace plugins/micromega/sos.ml --replace "; csdp" "; ${csdp}/bin/csdp"
+    substituteInPlace plugins/micromega/coq_micromega.ml --replace "System.is_in_system_path \"csdp\"" "true"
+  '';
+  ocamlPackages = if customOCamlPackages != null then customOCamlPackages
+    else with versions; switch coq-version [
+      { case = range "8.16" "8.18"; out = ocamlPackages_4_14; }
+      { case = range "8.14" "8.15"; out = ocamlPackages_4_12; }
+      { case = range "8.11" "8.13"; out = ocamlPackages_4_10; }
+      { case = range "8.7" "8.10";  out = ocamlPackages_4_09; }
+      { case = range "8.5" "8.6";   out = ocamlPackages_4_05; }
+    ] ocamlPackages_4_14;
+  ocamlNativeBuildInputs = with ocamlPackages; [ ocaml findlib ]
+    ++ optional (coqAtLeast "8.14") dune_3;
+  ocamlPropagatedBuildInputs = [ ]
+    ++ optional (!coqAtLeast "8.10") ocamlPackages.camlp5
+    ++ optional (!coqAtLeast "8.13") ocamlPackages.num
+    ++ optional (coqAtLeast "8.13") ocamlPackages.zarith;
+self = stdenv.mkDerivation {
+  pname = "coq";
+  inherit (fetched) version src;
+
+  passthru = {
+    inherit coq-version;
+    inherit ocamlPackages ocamlNativeBuildInputs;
+    inherit ocamlPropagatedBuildInputs;
+    # For compatibility
+    inherit (ocamlPackages) ocaml camlp5 findlib num ;
+    emacsBufferSetup = pkgs: ''
+      ; Propagate coq paths to children
+      (inherit-local-permanent coq-prog-name "${self}/bin/coqtop")
+      (inherit-local-permanent coq-dependency-analyzer "${self}/bin/coqdep")
+      (inherit-local-permanent coq-compiler "${self}/bin/coqc")
+      ; If the coq-library path was already set, re-set it based on our current coq
+      (when (fboundp 'get-coq-library-directory)
+        (inherit-local-permanent coq-library-directory (get-coq-library-directory))
+        (coq-prog-args))
+      (mapc (lambda (arg)
+        (when (file-directory-p (concat arg "/lib/coq/${coq-version}/user-contrib"))
+          (setenv "COQPATH" (concat (getenv "COQPATH") ":" arg "/lib/coq/${coq-version}/user-contrib")))) '(${concatStringsSep " " (map (pkg: "\"${pkg}\"") pkgs)}))
+      ; TODO Abstract this pattern from here and nixBufferBuilders.withPackages!
+      (defvar nixpkgs--coq-buffer-count 0)
+      (when (eq nixpkgs--coq-buffer-count 0)
+        (make-variable-buffer-local 'nixpkgs--is-nixpkgs-coq-buffer)
+        (defun nixpkgs--coq-inherit (buf)
+          (inherit-local-inherit-child buf)
+          (with-current-buffer buf
+            (setq nixpkgs--coq-buffer-count (1+ nixpkgs--coq-buffer-count))
+            (add-hook 'kill-buffer-hook 'nixpkgs--decrement-coq-buffer-count nil t))
+          buf)
+        ; When generating a scomint buffer, do inherit-local inheritance and make it a nixpkgs-coq buffer
+        (defun nixpkgs--around-scomint-make (orig &rest r)
+          (if nixpkgs--is-nixpkgs-coq-buffer
+              (progn
+                (advice-add 'get-buffer-create :filter-return #'nixpkgs--coq-inherit)
+                (apply orig r)
+                (advice-remove 'get-buffer-create #'nixpkgs--coq-inherit))
+            (apply orig r)))
+        (advice-add 'scomint-make :around #'nixpkgs--around-scomint-make)
+        ; When we have no more coq buffers, tear down the buffer handling
+        (defun nixpkgs--decrement-coq-buffer-count ()
+          (setq nixpkgs--coq-buffer-count (1- nixpkgs--coq-buffer-count))
+          (when (eq nixpkgs--coq-buffer-count 0)
+            (advice-remove 'scomint-make #'nixpkgs--around-scomint-make)
+            (fmakunbound 'nixpkgs--around-scomint-make)
+            (fmakunbound 'nixpkgs--coq-inherit)
+            (fmakunbound 'nixpkgs--decrement-coq-buffer-count))))
+      (setq nixpkgs--coq-buffer-count (1+ nixpkgs--coq-buffer-count))
+      (add-hook 'kill-buffer-hook 'nixpkgs--decrement-coq-buffer-count nil t)
+      (setq nixpkgs--is-nixpkgs-coq-buffer t)
+      (inherit-local 'nixpkgs--is-nixpkgs-coq-buffer)
+    '';
+  };
+
+  nativeBuildInputs = [ pkg-config ]
+    ++ ocamlNativeBuildInputs
+    ++ optional buildIde copyDesktopItems
+    ++ optional (buildIde && coqAtLeast "8.10") wrapGAppsHook
+    ++ optional (!coqAtLeast "8.6") gnumake42;
+  buildInputs = [ ncurses ]
+    ++ optionals buildIde
+      (if coqAtLeast "8.10"
+       then [ ocamlPackages.lablgtk3-sourceview3 glib gnome.adwaita-icon-theme ]
+       else [ ocamlPackages.lablgtk ])
+  ;
+
+  propagatedBuildInputs = ocamlPropagatedBuildInputs;
+
+  postPatch = ''
+    UNAME=$(type -tp uname)
+    RM=$(type -tp rm)
+    substituteInPlace tools/beautify-archive --replace "/bin/rm" "$RM"
+    ${lib.optionalString (!coqAtLeast "8.7") "substituteInPlace configure.ml --replace \"md5 -q\" \"md5sum\""}
+    ${csdpPatch}
+  '';
+
+  setupHook = writeText "setupHook.sh" ''
+    addCoqPath () {
+      if test -d "''$1/lib/coq/${coq-version}/user-contrib"; then
+        export COQPATH="''${COQPATH-}''${COQPATH:+:}''$1/lib/coq/${coq-version}/user-contrib/"
+      fi
+    }
+
+    addEnvHooks "$targetOffset" addCoqPath
+  '';
+
+  preConfigure = if coqAtLeast "8.10" then ''
+    patchShebangs dev/tools/
+  '' else ''
+    configureFlagsArray=(
+      ${ideFlags}
+    )
+  '';
+
+  prefixKey = "-prefix ";
+
+  buildFlags = [ "revision" "coq" ] ++ optional buildIde "coqide" ++ optional (!coqAtLeast "8.14") "bin/votour";
+  enableParallelBuilding = true;
+
+  createFindlibDestdir = true;
+
+  desktopItems = optional buildIde (makeDesktopItem {
+    name = "coqide";
+    exec = "coqide";
+    icon = "coq";
+    desktopName = "CoqIDE";
+    comment = "Graphical interface for the Coq proof assistant";
+    categories = [ "Development" "Science" "Math" "IDE" "GTK" ];
+  });
+
+  postInstall = let suffix = optionalString (coqAtLeast "8.14") "-core"; in optionalString (!coqAtLeast "8.17") ''
+    cp bin/votour $out/bin/
+  '' + ''
+    ln -s $out/lib/coq${suffix} $OCAMLFIND_DESTDIR/coq${suffix}
+  '' + optionalString (coqAtLeast "8.14") ''
+    ln -s $out/lib/coqide-server $OCAMLFIND_DESTDIR/coqide-server
+  '' + optionalString buildIde ''
+    mkdir -p "$out/share/pixmaps"
+    ln -s "$out/share/coq/coq.png" "$out/share/pixmaps/"
+  '';
+
+  meta = {
+    description = "Coq proof assistant";
+    longDescription = ''
+      Coq is a formal proof management system.  It provides a formal language
+      to write mathematical definitions, executable algorithms and theorems
+      together with an environment for semi-interactive development of
+      machine-checked proofs.
+    '';
+    homepage = "https://coq.inria.fr";
+    license = licenses.lgpl21;
+    branch = coq-version;
+    maintainers = with maintainers; [ roconnor thoughtpolice vbgl Zimmi48 ];
+    platforms = platforms.unix;
+    mainProgram = "coqide";
+  };
+}; in
+if coqAtLeast "8.17" then self.overrideAttrs(_: {
+  buildPhase = ''
+    runHook preBuild
+    make dunestrap
+    dune build -p coq-core,coq-stdlib,coq,coqide-server${lib.optionalString buildIde ",coqide"} -j $NIX_BUILD_CORES
+    runHook postBuild
+  '';
+  installPhase = ''
+    runHook preInstall
+    dune install --prefix $out coq-core coq-stdlib coq coqide-server${lib.optionalString buildIde " coqide"}
+    runHook postInstall
+  '';
+}) else self
diff --git a/nixpkgs/pkgs/applications/science/logic/cryptominisat/default.nix b/nixpkgs/pkgs/applications/science/logic/cryptominisat/default.nix
new file mode 100644
index 000000000000..4be57a194635
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/cryptominisat/default.nix
@@ -0,0 +1,31 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, python3
+, boost
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cryptominisat";
+  version = "5.11.21";
+
+  src = fetchFromGitHub {
+    owner = "msoos";
+    repo = "cryptominisat";
+    rev = version;
+    hash = "sha256-8oH9moMjQEWnQXKmKcqmXuXcYkEyvr4hwC1bC4l26mo=";
+  };
+
+  buildInputs = [ python3 boost ];
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "An advanced SAT Solver";
+    mainProgram = "cryptominisat5";
+    homepage = "https://github.com/msoos/cryptominisat";
+    license = licenses.mit;
+    maintainers = with maintainers; [ mic92 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/cryptoverif/default.nix b/nixpkgs/pkgs/applications/science/logic/cryptoverif/default.nix
new file mode 100644
index 000000000000..4b74cdd518ca
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/cryptoverif/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchurl, ocaml }:
+
+stdenv.mkDerivation rec {
+  pname = "cryptoverif";
+  version = "2.08pl1";
+
+  src = fetchurl {
+    url    = "http://prosecco.gforge.inria.fr/personal/bblanche/cryptoverif/cryptoverif${version}.tar.gz";
+    hash = "sha256-rmORSZuhds9W2WpNgYf4AJM2jgEUPoJit4G64qLqj5w=";
+  };
+
+  /* Fix up the frontend to load the 'default' cryptoverif library
+  ** from under $out/libexec. By default, it expects to find the files
+  ** in $CWD which doesn't work. */
+  postPatch = ''
+    substituteInPlace ./src/syntax.ml \
+      --replace \"default\" \"$out/libexec/default\"
+  '';
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml ];
+
+  buildPhase = ''
+    runHook preBuild
+
+    ./build
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin $out/libexec
+    cp ./cryptoverif   $out/bin
+    cp ./default.cvl   $out/libexec
+    cp ./default.ocvl  $out/libexec
+
+    runHook postInstall
+  '';
+
+  meta = {
+    description = "Cryptographic protocol verifier in the computational model";
+    mainProgram = "cryptoverif";
+    homepage    = "https://prosecco.gforge.inria.fr/personal/bblanche/cryptoverif/";
+    license     = lib.licenses.cecill-b;
+    platforms   = lib.platforms.unix;
+    maintainers = [ lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/cubicle/default.nix b/nixpkgs/pkgs/applications/science/logic/cubicle/default.nix
new file mode 100644
index 000000000000..03409e68ea33
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/cubicle/default.nix
@@ -0,0 +1,46 @@
+{ lib
+, stdenv
+, fetchurl
+, autoreconfHook
+, which
+, ocamlPackages
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cubicle";
+  version = "1.2.0";
+  src = fetchurl {
+    url = "https://github.com/cubicle-model-checker/cubicle/archive/refs/tags/${version}.tar.gz";
+    hash = "sha256-/EtbXpyXqRm0jGcMfGLAEwdr92061edjFys1V7/w6/Y=";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [
+    autoreconfHook
+    which
+  ] ++ (with ocamlPackages; [
+    findlib
+    ocaml
+  ]);
+
+  buildInputs = with ocamlPackages; [
+    functory
+    num
+  ];
+
+  # https://github.com/cubicle-model-checker/cubicle/issues/1
+  env = {
+    OCAMLC = "ocamlfind ocamlc -package num";
+    OCAMLOPT = "ocamlfind ocamlopt -package num";
+  };
+
+  meta = with lib; {
+    description = "An open source model checker for verifying safety properties of array-based systems";
+    mainProgram = "cubicle";
+    homepage = "https://cubicle.lri.fr/";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ dwarfmaster ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/cvc3/cvc3-2.4.1-gccv6-fix.patch b/nixpkgs/pkgs/applications/science/logic/cvc3/cvc3-2.4.1-gccv6-fix.patch
new file mode 100644
index 000000000000..1fb3516b8c27
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/cvc3/cvc3-2.4.1-gccv6-fix.patch
@@ -0,0 +1,76 @@
+commit 4eb28b907e89be05d92eb704115f821b9b848e60
+Author: Matthew Dawson <matthew@mjdsystems.ca>
+Date:   Sun Oct 16 22:06:03 2016 -0400
+
+    Fix gcc v6 compile failures.
+    
+     * Use std::hash<const char*> over std::hash<char *>, as throwing away the const is not allowed.
+     * Use Hash::hash by default in CDMap over std::hash, to get Hash::hash<CVC3::expr>
+
+diff --git a/src/expr/expr_value.cpp b/src/expr/expr_value.cpp
+index 0c85ff6..e4dd251 100644
+--- a/src/expr/expr_value.cpp
++++ b/src/expr/expr_value.cpp
+@@ -29,7 +29,7 @@ namespace CVC3 {
+ // Class ExprValue static members
+ ////////////////////////////////////////////////////////////////////////
+ 
+-std::hash<char*> ExprValue::s_charHash;
++std::hash<const char*> ExprValue::s_charHash;
+ std::hash<long int> ExprValue::s_intHash;
+ 
+ ////////////////////////////////////////////////////////////////////////
+diff --git a/src/include/cdmap.h b/src/include/cdmap.h
+index faf682a..c3b094c 100644
+--- a/src/include/cdmap.h
++++ b/src/include/cdmap.h
+@@ -43,9 +43,9 @@ namespace CVC3 {
+ // Auxiliary class: almost the same as CDO (see cdo.h), but on
+ // setNull() call it erases itself from the map.
+ 
+-template <class Key, class Data, class HashFcn = std::hash<Key> > class CDMap;
++template <class Key, class Data, class HashFcn = Hash::hash<Key> > class CDMap;
+ 
+-template <class Key, class Data, class HashFcn = std::hash<Key> >
++template <class Key, class Data, class HashFcn = Hash::hash<Key> >
+ class CDOmap :public ContextObj {
+   Key d_key;
+   Data d_data;
+diff --git a/src/include/expr_hash.h b/src/include/expr_hash.h
+index b2107d7..baa2eab 100644
+--- a/src/include/expr_hash.h
++++ b/src/include/expr_hash.h
+@@ -20,7 +20,6 @@
+  * hash_set over Expr class.
+  */
+ /*****************************************************************************/
+-
+ #ifndef _cvc3__expr_h_
+ #include "expr.h"
+ #endif
+diff --git a/src/include/expr_value.h b/src/include/expr_value.h
+index 95102b2..f53aa4d 100644
+--- a/src/include/expr_value.h
++++ b/src/include/expr_value.h
+@@ -179,7 +179,7 @@ protected:
+   // Static hash functions.  They don't depend on the context
+   // (ExprManager and such), so it is still thread-safe to have them
+   // static.
+-  static std::hash<char*> s_charHash;
++  static std::hash<const char*> s_charHash;
+   static std::hash<long int> s_intHash;
+ 
+   static size_t pointerHash(void* p) { return s_intHash((long int)p); }
+diff --git a/src/theory_core/theory_core.cpp b/src/theory_core/theory_core.cpp
+index df5289f..37ccab9 100644
+--- a/src/theory_core/theory_core.cpp
++++ b/src/theory_core/theory_core.cpp
+@@ -710,7 +710,7 @@ TheoryCore::TheoryCore(ContextManager* cm,
+     //    d_termTheorems(cm->getCurrentContext()),
+     d_predicates(cm->getCurrentContext()),
+     d_solver(NULL),
+-    d_simplifyInPlace(false),
++    d_simplifyInPlace(NULL),
+     d_currentRecursiveSimplifier(NULL),
+     d_resourceLimit(0),
+     d_timeBase(0),
diff --git a/nixpkgs/pkgs/applications/science/logic/cvc3/default.nix b/nixpkgs/pkgs/applications/science/logic/cvc3/default.nix
new file mode 100644
index 000000000000..bec5a89cc691
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/cvc3/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchurl, flex, bison, gmp, perl }:
+
+stdenv.mkDerivation rec {
+    pname = "cvc3";
+    version = "2.4.1";
+
+    src = fetchurl {
+      url = "https://cs.nyu.edu/acsys/cvc3/releases/${version}/${pname}-${version}.tar.gz";
+      sha256 = "1xxcwhz3y6djrycw8sm6xz83wb4hb12rd1n0skvc7fng0rh1snym";
+    };
+
+  buildInputs = [ gmp flex bison perl ];
+
+  patches = [ ./cvc3-2.4.1-gccv6-fix.patch ];
+
+  # fails to configure on darwin due to gmp not found
+  configureFlags = [ "LIBS=-L${gmp}/lib" "CXXFLAGS=-I${gmp.dev}/include" ];
+
+  postPatch = ''
+    sed -e "s@ /bin/bash@bash@g" -i Makefile.std
+    find . -exec sed -e "s@/usr/bin/perl@${perl}/bin/perl@g" -i '{}' ';'
+
+    # bison 3.7 workaround
+    for f in parsePL parseLisp parsesmtlib parsesmtlib2 ; do
+      ln -s ../parser/''${f}_defs.h src/include/''${f}.hpp
+    done
+  '';
+
+  meta = with lib; {
+    description = "A prover for satisfiability modulo theory (SMT)";
+    mainProgram = "cvc3";
+    maintainers = with maintainers;
+      [ raskin ];
+    platforms = platforms.unix;
+    license = licenses.free;
+    homepage = "https://cs.nyu.edu/acsys/cvc3/index.html";
+  };
+  passthru = {
+    updateInfo = {
+      downloadPage = "https://cs.nyu.edu/acsys/cvc3/download.html";
+    };
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/cvc4/cvc4-bash-patsub-replacement.patch b/nixpkgs/pkgs/applications/science/logic/cvc4/cvc4-bash-patsub-replacement.patch
new file mode 100644
index 000000000000..a97665c2f86c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/cvc4/cvc4-bash-patsub-replacement.patch
@@ -0,0 +1,39 @@
+Per https://bodhi.fedoraproject.org/updates/FEDORA-2022-dc47174c36:
+
+This update fixes a failure to build with source with bash 5.2. Bash's
+`patsub_replacement` feature makes ampersand a special character when doing
+variable substitution, which was not previously the case. This update instructs
+bash to turn off the new behavior.
+
+The patch itself is adapted from
+https://src.fedoraproject.org/rpms/cvc4/blob/f7c24c6ad72a8812d244313f13032fa23d393315/f/cvc4-bash-patsub-replacement.patch.
+--- a/src/expr/mkexpr	2020-06-19 10:59:27.000000000 -0600
++++ b/src/expr/mkexpr	2022-10-11 14:28:31.120453409 -0600
+@@ -16,6 +16,7 @@
+ #
+ 
+ copyright=2010-2014
++shopt -u patsub_replacement
+ 
+ filename=`basename "$1" | sed 's,_template,,'`
+ 
+--- a/src/expr/mkkind	2020-06-19 10:59:27.000000000 -0600
++++ b/src/expr/mkkind	2022-10-11 14:34:17.008996126 -0600
+@@ -15,6 +15,7 @@
+ #
+ 
+ copyright=2010-2014
++shopt -u patsub_replacement
+ 
+ filename=`basename "$1" | sed 's,_template,,'`
+ 
+--- a/src/expr/mkmetakind	2020-06-19 10:59:27.000000000 -0600
++++ b/src/expr/mkmetakind	2022-10-11 14:34:32.248020036 -0600
+@@ -18,6 +18,7 @@
+ #
+ 
+ copyright=2010-2014
++shopt -u patsub_replacement
+ 
+ cat <<EOF
+ /*********************                                                        */
diff --git a/nixpkgs/pkgs/applications/science/logic/cvc4/default.nix b/nixpkgs/pkgs/applications/science/logic/cvc4/default.nix
new file mode 100644
index 000000000000..ac45db8cb312
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/cvc4/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchFromGitHub, cmake, cln, gmp, git, swig, pkg-config
+, readline, libantlr3c, boost, jdk, python3, antlr3_4
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cvc4";
+  version = "1.8";
+
+  src = fetchFromGitHub {
+    owner  = "cvc4";
+    repo   = "cvc4";
+    rev    = version;
+    sha256 = "1rhs4pvzaa1wk00czrczp58b2cxfghpsnq534m0l3snnya2958jp";
+  };
+
+  nativeBuildInputs = [ pkg-config cmake ];
+  buildInputs = [ gmp git python3.pkgs.toml readline swig libantlr3c antlr3_4 boost jdk python3 ]
+    ++ lib.optionals (!stdenv.isDarwin) [ cln ];
+  configureFlags = [
+    "--enable-language-bindings=c,c++,java"
+    "--enable-gpl"
+    "--with-readline"
+    "--with-boost=${boost.dev}"
+  ] ++ lib.optionals (!stdenv.isDarwin) [ "--with-cln" ];
+
+  prePatch = ''
+    patch -p1 -i ${./minisat-fenv.patch} -d src/prop/minisat
+    patch -p1 -i ${./minisat-fenv.patch} -d src/prop/bvminisat
+  '';
+
+  patches = [
+    ./cvc4-bash-patsub-replacement.patch
+  ];
+
+  preConfigure = ''
+    patchShebangs ./src/
+  '';
+
+  cmakeBuildType = "Production";
+
+  meta = with lib; {
+    description = "A high-performance theorem prover and SMT solver";
+    mainProgram = "cvc4";
+    homepage    = "http://cvc4.cs.stanford.edu/web/";
+    license     = licenses.gpl3;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ vbgl thoughtpolice gebner ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/cvc4/minisat-fenv.patch b/nixpkgs/pkgs/applications/science/logic/cvc4/minisat-fenv.patch
new file mode 100644
index 000000000000..686d5a1c5b49
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/cvc4/minisat-fenv.patch
@@ -0,0 +1,65 @@
+From 7f1016ceab9b0f57a935bd51ca6df3d18439b472 Mon Sep 17 00:00:00 2001
+From: Will Dietz <w@wdtz.org>
+Date: Tue, 17 Oct 2017 22:57:02 -0500
+Subject: [PATCH] use fenv instead of non-standard fpu_control
+
+---
+ core/Main.cc   | 8 ++++++--
+ simp/Main.cc   | 8 ++++++--
+ utils/System.h | 2 +-
+ 3 files changed, 13 insertions(+), 5 deletions(-)
+
+diff --git a/core/Main.cc b/core/Main.cc
+index 2b0d97b..8ad95fb 100644
+--- a/core/Main.cc
++++ b/core/Main.cc
+@@ -78,8 +78,12 @@ int main(int argc, char** argv)
+         // printf("This is MiniSat 2.0 beta\n");
+         
+ #if defined(__linux__)
+-        fpu_control_t oldcw, newcw;
+-        _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
++        fenv_t fenv;
++
++        fegetenv(&fenv);
++        fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
++        fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
++        fesetenv(&fenv);
+         printf("WARNING: for repeatability, setting FPU to use double precision\n");
+ #endif
+         // Extra options:
+diff --git a/simp/Main.cc b/simp/Main.cc
+index 2804d7f..39bfb71 100644
+--- a/simp/Main.cc
++++ b/simp/Main.cc
+@@ -79,8 +79,12 @@ int main(int argc, char** argv)
+         // printf("This is MiniSat 2.0 beta\n");
+         
+ #if defined(__linux__)
+-        fpu_control_t oldcw, newcw;
+-        _FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) | _FPU_DOUBLE; _FPU_SETCW(newcw);
++        fenv_t fenv;
++
++        fegetenv(&fenv);
++        fenv.__control_word &= ~0x300; /* _FPU_EXTENDED */
++        fenv.__control_word |= 0x200; /* _FPU_DOUBLE */
++        fesetenv(&fenv);
+         printf("WARNING: for repeatability, setting FPU to use double precision\n");
+ #endif
+         // Extra options:
+diff --git a/utils/System.h b/utils/System.h
+index 1758192..c0ad13a 100644
+--- a/utils/System.h
++++ b/utils/System.h
+@@ -22,7 +22,7 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWA
+ #define Minisat_System_h
+ 
+ #if defined(__linux__)
+-#include <fpu_control.h>
++#include <fenv.h>
+ #endif
+ 
+ #include "mtl/IntTypes.h"
+-- 
+2.14.2
+
diff --git a/nixpkgs/pkgs/applications/science/logic/cvc5/default.nix b/nixpkgs/pkgs/applications/science/logic/cvc5/default.nix
new file mode 100644
index 000000000000..d34b29337296
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/cvc5/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, cmake, flex, cadical, symfpu, gmp, python3, gtest, libantlr3c, antlr3_4, boost, jdk }:
+
+stdenv.mkDerivation rec {
+  pname = "cvc5";
+  version = "1.1.2";
+
+  src = fetchFromGitHub {
+    owner  = "cvc5";
+    repo   = "cvc5";
+    rev    = "cvc5-${version}";
+    hash  = "sha256-v+3/2IUslQOySxFDYgTBWJIDnyjbU2RPdpfLcIkEtgQ=";
+  };
+
+  nativeBuildInputs = [ pkg-config cmake flex ];
+  buildInputs = [
+    cadical.dev symfpu gmp gtest libantlr3c antlr3_4 boost jdk
+    (python3.withPackages (ps: with ps; [ pyparsing tomli ]))
+  ];
+
+  preConfigure = ''
+    patchShebangs ./src/
+  '';
+
+  cmakeBuildType = "Production";
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=1"
+    "-DANTLR3_JAR=${antlr3_4}/lib/antlr/antlr-3.4-complete.jar"
+  ];
+
+  meta = with lib; {
+    description = "A high-performance theorem prover and SMT solver";
+    mainProgram = "cvc5";
+    homepage    = "https://cvc5.github.io";
+    license     = licenses.gpl3Only;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ shadaj ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/dafny/default.nix b/nixpkgs/pkgs/applications/science/logic/dafny/default.nix
new file mode 100644
index 000000000000..83d472c1abb1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/dafny/default.nix
@@ -0,0 +1,65 @@
+{ lib
+, buildDotnetModule
+, fetchFromGitHub
+, writeScript
+, jdk11
+, z3
+}:
+
+buildDotnetModule rec {
+  pname = "Dafny";
+  version = "4.5.0";
+
+  src = fetchFromGitHub {
+    owner = "dafny-lang";
+    repo = "dafny";
+    rev = "v${version}";
+    hash = "sha256-NsQhJY++IaLyFc5jqo7TyZBcz0P8VUizGLxdIe9KEO4=";
+  };
+
+  postPatch = ''
+    cp ${
+      writeScript "fake-gradlew-for-dafny" ''
+        mkdir -p build/libs/
+        javac $(find -name "*.java" | grep "^./src/main") -d classes
+        jar cf build/libs/DafnyRuntime-${version}.jar -C classes dafny
+      ''} Source/DafnyRuntime/DafnyRuntimeJava/gradlew
+
+    # Needed to fix
+    # "error NETSDK1129: The 'Publish' target is not supported without
+    # specifying a target framework. The current project targets multiple
+    # frameworks, you must specify the framework for the published
+    # application."
+    substituteInPlace Source/DafnyRuntime/DafnyRuntime.csproj \
+      --replace TargetFrameworks TargetFramework \
+      --replace "netstandard2.0;net452" net6.0
+  '';
+
+  buildInputs = [ jdk11 ];
+  nugetDeps = ./deps.nix;
+
+  # Build just these projects. Building Source/Dafny.sln includes a bunch of
+  # unnecessary components like tests.
+  projectFile = [
+    "Source/Dafny/Dafny.csproj"
+    "Source/DafnyRuntime/DafnyRuntime.csproj"
+    "Source/DafnyLanguageServer/DafnyLanguageServer.csproj"
+  ];
+
+  executables = [ "Dafny" ];
+
+  # Help Dafny find z3
+  makeWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ z3 ]}" ];
+
+  postFixup = ''
+    ln -s "$out/bin/Dafny" "$out/bin/dafny" || true
+  '';
+
+  meta = with lib; {
+    description = "A programming language with built-in specification constructs";
+    homepage = "https://research.microsoft.com/dafny";
+    maintainers = with maintainers; [ layus ];
+    license = licenses.mit;
+    platforms = with platforms; (linux ++ darwin);
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/dafny/deps.nix b/nixpkgs/pkgs/applications/science/logic/dafny/deps.nix
new file mode 100644
index 000000000000..91fe5624ac7f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/dafny/deps.nix
@@ -0,0 +1,181 @@
+# This file was automatically generated by passthru.fetch-deps.
+# Please dont edit it manually, your changes might get overwritten!
+
+{ fetchNuGet }: [
+  (fetchNuGet { pname = "Boogie"; version = "3.1.3"; sha256 = "0xzc7s0rjb8dhdkdf71g6pdsnyhbl534xpwd8gbx6g16a87iqx6i"; })
+  (fetchNuGet { pname = "Boogie.AbstractInterpretation"; version = "3.1.3"; sha256 = "0a7v2jkkbh59pyc5nz4avszm3dbmp4amkmr6lvn0gyc3hxgn8d3k"; })
+  (fetchNuGet { pname = "Boogie.BaseTypes"; version = "3.1.3"; sha256 = "1h94yl4ymhd2g14i5w8lnnh2zw7gx65qydzvv8cm8d5yn64gch63"; })
+  (fetchNuGet { pname = "Boogie.CodeContractsExtender"; version = "3.1.3"; sha256 = "0b1h1lz997lgyq34bx3ngnhgcrw8j4qvsa6iygb6bydxz7rirrf4"; })
+  (fetchNuGet { pname = "Boogie.Concurrency"; version = "3.1.3"; sha256 = "1aq0gdz1xkmp82c67vrmyvkncfbbj5zxrsg78lsmmi22h9qbkzm3"; })
+  (fetchNuGet { pname = "Boogie.Core"; version = "3.1.3"; sha256 = "0yhl272lv9lncjval2z7zl9wavlxx8bivj467zl2zzbrxw2k5wz8"; })
+  (fetchNuGet { pname = "Boogie.ExecutionEngine"; version = "3.1.3"; sha256 = "0p0zp329h6mddbswm3pdcyvy03y69vyznv11ph6bkpya21lsxqy7"; })
+  (fetchNuGet { pname = "Boogie.Graph"; version = "3.1.3"; sha256 = "1p8vb4x4iy7f0ycwb8f71j9a2ci8irwg3rvad2hg3rgbihbwp1qj"; })
+  (fetchNuGet { pname = "Boogie.Houdini"; version = "3.1.3"; sha256 = "06qlgi9f70r2w7w6h9qw3lx9dd4pbddpdplqjxi090rpry6dhrbz"; })
+  (fetchNuGet { pname = "Boogie.Model"; version = "3.1.3"; sha256 = "0fbvnrghaq17fdpjx12axxrrjp1mh99skaznmvxd1ylsqqnn4cbk"; })
+  (fetchNuGet { pname = "Boogie.Provers.SMTLib"; version = "3.1.3"; sha256 = "0x7gpc7m04in2gzdn4jgjphd2xjqrdfmh84wzwnwpvi5wyn869jc"; })
+  (fetchNuGet { pname = "Boogie.VCExpr"; version = "3.1.3"; sha256 = "0dyndhqz1yf9qnq9mw73g53rnz0xfbdbi3yk6pg7fdm1m3363h5p"; })
+  (fetchNuGet { pname = "Boogie.VCGeneration"; version = "3.1.3"; sha256 = "1bl83727zc1rhskx548p5pa27804n3f5i9n233jvcz6n6bfjn74k"; })
+  (fetchNuGet { pname = "CocoR"; version = "2014.12.24"; sha256 = "0ps8h7aawkcc1910qnh13llzb01pvgsjmg862pxp0p4wca2dn7a2"; })
+  (fetchNuGet { pname = "JetBrains.Annotations"; version = "2021.1.0"; sha256 = "07pnhxxlgx8spmwmakz37nmbvgyb6yjrbrhad5rrn6y767z5r1gb"; })
+  (fetchNuGet { pname = "MediatR"; version = "8.1.0"; sha256 = "0cqx7yfh998xhsfk5pr6229lcjcs1jxxyqz7dwskc9jddl6a2akp"; })
+  (fetchNuGet { pname = "Microsoft.Bcl.AsyncInterfaces"; version = "1.1.1"; sha256 = "0a1ahssqds2ympr7s4xcxv5y8jgxs7ahd6ah6fbgglj4rki1f1vw"; })
+  (fetchNuGet { pname = "Microsoft.Bcl.AsyncInterfaces"; version = "6.0.0"; sha256 = "15gqy2m14fdlvy1g59207h5kisznm355kbw010gy19vh47z8gpz3"; })
+  (fetchNuGet { pname = "Microsoft.CodeAnalysis.Analyzers"; version = "3.0.0"; sha256 = "0bbl0jpqywqmzz2gagld1p2gvdfldjfjmm25hil9wj2nq1zc4di8"; })
+  (fetchNuGet { pname = "Microsoft.CodeAnalysis.Common"; version = "3.7.0"; sha256 = "0882492nx6x68b0pkh3q5xaawz0b2l5x35r40722ignyjnvjydph"; })
+  (fetchNuGet { pname = "Microsoft.CodeAnalysis.CSharp"; version = "3.7.0"; sha256 = "0adw6rcag8wxydzyiyhls2mxaqkay5qlz25z1fxrlv5qnchqn0n5"; })
+  (fetchNuGet { pname = "Microsoft.DotNet.PlatformAbstractions"; version = "2.0.4"; sha256 = "1fdzln4im9hb55agzwchbfgm3vmngigmbpci5j89b0gqcxixmv8j"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Configuration"; version = "2.0.0"; sha256 = "0yssxq9di5h6xw2cayp5hj3l9b2p0jw9wcjz73rwk4586spac9s9"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Configuration"; version = "5.0.0"; sha256 = "01m9vzlq0vg0lhckj2dimwq42niwny8g3lm13c9a401hlyg90z1p"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.Abstractions"; version = "2.0.0"; sha256 = "1ilz2yrgg9rbjyhn6a5zh9pr51nmh11z7sixb4p7vivgydj9gxwf"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.Abstractions"; version = "5.0.0"; sha256 = "0fqxkc9pjxkqylsdf26s9q21ciyk56h1w33pz3v1v4wcv8yv1v6k"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.Binder"; version = "2.0.0"; sha256 = "1prvdbma6r18n5agbhhabv6g357p1j70gq4m9g0vs859kf44nrgc"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.CommandLine"; version = "5.0.0"; sha256 = "084hnz5l0vr15ay23rksqipslqnz3pp30w9hsirpx1iqdm5688mc"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.FileExtensions"; version = "5.0.0"; sha256 = "1wq229r3xcmm9wh9sqdpvmfv4qpbp2zms9x6xk7g7sbb8h32hnz3"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.Json"; version = "5.0.0"; sha256 = "0hq5i483bjbvprp1la9l3si82x1ydxbvkpfc7r3s7zgxg957fyp9"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection"; version = "2.0.0"; sha256 = "018izzgykaqcliwarijapgki9kp2c560qv8qsxdjywr7byws5apq"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection"; version = "5.0.0"; sha256 = "15sdwcyzz0qlybwbdq854bn3jk6kx7awx28gs864c4shhbqkppj4"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection.Abstractions"; version = "2.0.0"; sha256 = "1pwrfh9b72k9rq6mb2jab5qhhi225d5rjalzkapiayggmygc8nhz"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection.Abstractions"; version = "5.0.0"; sha256 = "17cz6s80va0ch0a6nqa1wbbbp3p8sqxb96lj4qcw67ivkp2yxiyj"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.DependencyModel"; version = "2.0.4"; sha256 = "041i1vlcibpzgalxxzdk81g5pgmqvmz2g61k0rqa2sky0wpvijx9"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.FileProviders.Abstractions"; version = "5.0.0"; sha256 = "01ahgd0b2z2zycrr2lcsq2cl59fn04bh51hdwdp9dcsdkpvnasj1"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.FileProviders.Physical"; version = "5.0.0"; sha256 = "00vii8148a6pk12l9jl0rhjp7apil5q5qcy7v1smnv17lj4p8szd"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.FileSystemGlobbing"; version = "5.0.0"; sha256 = "0lm6n9vbyjh0l17qcc2y9qwn1cns3dyjmkvbxjp0g9sll32kjpmb"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Logging"; version = "2.0.0"; sha256 = "1jkwjcq1ld9znz1haazk8ili2g4pzfdp6i7r7rki4hg3jcadn386"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Logging"; version = "5.0.0"; sha256 = "1qa1l18q2jh9azya8gv1p8anzcdirjzd9dxxisb4911i9m1648i3"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Logging.Abstractions"; version = "5.0.0"; sha256 = "1yza38675dbv1qqnnhqm23alv2bbaqxp0pb7zinjmw8j2mr5r6wc"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Options"; version = "2.0.0"; sha256 = "0g4zadlg73f507krilhaaa7h0jdga216syrzjlyf5fdk25gxmjqh"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Options"; version = "5.0.0"; sha256 = "1rdmgpg770x8qwaaa6ryc27zh93p697fcyvn5vkxp0wimlhqkbay"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Options.ConfigurationExtensions"; version = "2.0.0"; sha256 = "1isc3rjbzz60f7wbmgcwslx5d10hm5hisnk7v54vfi2bz7132gll"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Primitives"; version = "2.0.0"; sha256 = "1xppr5jbny04slyjgngxjdm0maxdh47vq481ps944d7jrfs0p3mb"; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Primitives"; version = "5.0.0"; sha256 = "0swqcknyh87ns82w539z1mvy804pfwhgzs97cr3nwqk6g5s42gd6"; })
+  (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "1.0.1"; sha256 = "01al6cfxp68dscl15z7rxfw9zvhm64dncsw09a1vmdkacsa2v6lr"; })
+  (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "1.1.0"; sha256 = "08vh1r12g6ykjygq5d3vq09zylgb84l63k49jc4v8faw9g93iqqm"; })
+  (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "2.1.2"; sha256 = "1507hnpr9my3z4w1r6xk5n0s1j3y6a2c2cnynj76za7cphxi1141"; })
+  (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "3.0.0"; sha256 = "1bk8r4r3ihmi6322jmcag14jmw11mjqys202azqjzglcx59pxh51"; })
+  (fetchNuGet { pname = "Microsoft.NETCore.Targets"; version = "1.0.1"; sha256 = "0ppdkwy6s9p7x9jix3v4402wb171cdiibq7js7i13nxpdky7074p"; })
+  (fetchNuGet { pname = "Microsoft.NETCore.Targets"; version = "1.1.0"; sha256 = "193xwf33fbm0ni3idxzbr5fdq3i2dlfgihsac9jj7whj0gd902nh"; })
+  (fetchNuGet { pname = "Microsoft.TestPlatform.Extensions.TrxLogger"; version = "17.9.0"; sha256 = "0wn38vj9i4gjw5zsl4wcivpqrmp1h5n6m1zxcfwj7yjn9hf45rz9"; })
+  (fetchNuGet { pname = "Microsoft.TestPlatform.ObjectModel"; version = "17.9.0"; sha256 = "1kgsl9w9fganbm9wvlkqgk0ag9hfi58z88rkfybc6kvg78bx89ca"; })
+  (fetchNuGet { pname = "Microsoft.TestPlatform.TestHost"; version = "17.9.0"; sha256 = "19ffh31a1jxzn8j69m1vnk5hyfz3dbxmflq77b8x82zybiilh5nl"; })
+  (fetchNuGet { pname = "Microsoft.VisualStudio.Threading"; version = "16.7.56"; sha256 = "13x0xrsjxd86clf9cjjwmpzlyp8pkrf13riya7igs8zy93zw2qap"; })
+  (fetchNuGet { pname = "Microsoft.VisualStudio.Threading.Analyzers"; version = "16.7.56"; sha256 = "04v9df0k7bsc0rzgkw4mnvi43pdrh42vk6xdcwn9m6im33m0nnz2"; })
+  (fetchNuGet { pname = "Microsoft.VisualStudio.Validation"; version = "15.5.31"; sha256 = "1ah99rn922qa0sd2k3h64m324f2r32pw8cn4cfihgvwx4qdrpmgw"; })
+  (fetchNuGet { pname = "Microsoft.Win32.Primitives"; version = "4.3.0"; sha256 = "0j0c1wj4ndj21zsgivsc24whiya605603kxrbiw6wkfdync464wq"; })
+  (fetchNuGet { pname = "Microsoft.Win32.Registry"; version = "4.6.0"; sha256 = "0i4y782yrqqyx85pg597m20gm0v126w0j9ddk5z7xb3crx4z9f2s"; })
+  (fetchNuGet { pname = "Microsoft.Win32.SystemEvents"; version = "6.0.0"; sha256 = "0c6pcj088g1yd1vs529q3ybgsd2vjlk5y1ic6dkmbhvrp5jibl9p"; })
+  (fetchNuGet { pname = "Nerdbank.Streams"; version = "2.6.81"; sha256 = "06wihcaga8537ibh0mkj28m720m6vzkqk562zkynhca85nd236yi"; })
+  (fetchNuGet { pname = "Newtonsoft.Json"; version = "11.0.2"; sha256 = "1784xi44f4k8v1fr696hsccmwpy94bz7kixxqlri98zhcxn406b2"; })
+  (fetchNuGet { pname = "Newtonsoft.Json"; version = "13.0.1"; sha256 = "0fijg0w6iwap8gvzyjnndds0q4b8anwxxvik7y8vgq97dram4srb"; })
+  (fetchNuGet { pname = "OmniSharp.Extensions.JsonRpc"; version = "0.19.5"; sha256 = "0ilcv3cxcvjkd8ngiydi69pzll07rhqdv5nq9yjnhyj142ynw2cb"; })
+  (fetchNuGet { pname = "OmniSharp.Extensions.JsonRpc.Generators"; version = "0.19.5"; sha256 = "1mac4yx29ld8fyirg7n0vqn81hzdvcrl8w0l9w5xhnnm6bcd42v8"; })
+  (fetchNuGet { pname = "OmniSharp.Extensions.LanguageProtocol"; version = "0.19.5"; sha256 = "1clgrbw6dlh46iiiqhavwh15xqar41az352mb5r4ln8ql3wnmk1i"; })
+  (fetchNuGet { pname = "OmniSharp.Extensions.LanguageServer"; version = "0.19.5"; sha256 = "0cvxmc0r4ajnaah7lsppik61qickq7i0df4jwqaj6c6axiizhqlm"; })
+  (fetchNuGet { pname = "OmniSharp.Extensions.LanguageServer.Shared"; version = "0.19.5"; sha256 = "0cczmmsmn3pj74wpasgfhjay1a817sd0zgzgqvvnckxxzq3n463h"; })
+  (fetchNuGet { pname = "RangeTree"; version = "3.0.1"; sha256 = "19si88v2r0rc7kai1avwhigcvh3x3c916vrvqlyb59sn4f27pbm2"; })
+  (fetchNuGet { pname = "runtime.any.System.Collections"; version = "4.3.0"; sha256 = "0bv5qgm6vr47ynxqbnkc7i797fdi8gbjjxii173syrx14nmrkwg0"; })
+  (fetchNuGet { pname = "runtime.any.System.Diagnostics.Tracing"; version = "4.3.0"; sha256 = "00j6nv2xgmd3bi347k00m7wr542wjlig53rmj28pmw7ddcn97jbn"; })
+  (fetchNuGet { pname = "runtime.any.System.Globalization"; version = "4.3.0"; sha256 = "1daqf33hssad94lamzg01y49xwndy2q97i2lrb7mgn28656qia1x"; })
+  (fetchNuGet { pname = "runtime.any.System.IO"; version = "4.3.0"; sha256 = "0l8xz8zn46w4d10bcn3l4yyn4vhb3lrj2zw8llvz7jk14k4zps5x"; })
+  (fetchNuGet { pname = "runtime.any.System.Reflection"; version = "4.3.0"; sha256 = "02c9h3y35pylc0zfq3wcsvc5nqci95nrkq0mszifc0sjx7xrzkly"; })
+  (fetchNuGet { pname = "runtime.any.System.Reflection.Extensions"; version = "4.3.0"; sha256 = "0zyri97dfc5vyaz9ba65hjj1zbcrzaffhsdlpxc9bh09wy22fq33"; })
+  (fetchNuGet { pname = "runtime.any.System.Reflection.Primitives"; version = "4.3.0"; sha256 = "0x1mm8c6iy8rlxm8w9vqw7gb7s1ljadrn049fmf70cyh42vdfhrf"; })
+  (fetchNuGet { pname = "runtime.any.System.Resources.ResourceManager"; version = "4.3.0"; sha256 = "03kickal0iiby82wa5flar18kyv82s9s6d4xhk5h4bi5kfcyfjzl"; })
+  (fetchNuGet { pname = "runtime.any.System.Runtime"; version = "4.3.0"; sha256 = "1cqh1sv3h5j7ixyb7axxbdkqx6cxy00p4np4j91kpm492rf4s25b"; })
+  (fetchNuGet { pname = "runtime.any.System.Runtime.Handles"; version = "4.3.0"; sha256 = "0bh5bi25nk9w9xi8z23ws45q5yia6k7dg3i4axhfqlnj145l011x"; })
+  (fetchNuGet { pname = "runtime.any.System.Runtime.InteropServices"; version = "4.3.0"; sha256 = "0c3g3g3jmhlhw4klrc86ka9fjbl7i59ds1fadsb2l8nqf8z3kb19"; })
+  (fetchNuGet { pname = "runtime.any.System.Text.Encoding"; version = "4.3.0"; sha256 = "0aqqi1v4wx51h51mk956y783wzags13wa7mgqyclacmsmpv02ps3"; })
+  (fetchNuGet { pname = "runtime.any.System.Text.Encoding.Extensions"; version = "4.3.0"; sha256 = "0lqhgqi0i8194ryqq6v2gqx0fb86db2gqknbm0aq31wb378j7ip8"; })
+  (fetchNuGet { pname = "runtime.any.System.Threading.Tasks"; version = "4.3.0"; sha256 = "03mnvkhskbzxddz4hm113zsch1jyzh2cs450dk3rgfjp8crlw1va"; })
+  (fetchNuGet { pname = "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "16rnxzpk5dpbbl1x354yrlsbvwylrq456xzpsha1n9y3glnhyx9d"; })
+  (fetchNuGet { pname = "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0hkg03sgm2wyq8nqk6dbm9jh5vcq57ry42lkqdmfklrw89lsmr59"; })
+  (fetchNuGet { pname = "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0c2p354hjx58xhhz7wv6div8xpi90sc6ibdm40qin21bvi7ymcaa"; })
+  (fetchNuGet { pname = "runtime.native.System"; version = "4.0.0"; sha256 = "1ppk69xk59ggacj9n7g6fyxvzmk1g5p4fkijm0d7xqfkig98qrkf"; })
+  (fetchNuGet { pname = "runtime.native.System"; version = "4.3.0"; sha256 = "15hgf6zaq9b8br2wi1i3x0zvmk410nlmsmva9p0bbg73v6hml5k4"; })
+  (fetchNuGet { pname = "runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "18pzfdlwsg2nb1jjjjzyb5qlgy6xjxzmhnfaijq5s2jw3cm3ab97"; })
+  (fetchNuGet { pname = "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0qyynf9nz5i7pc26cwhgi8j62ps27sqmf78ijcfgzab50z9g8ay3"; })
+  (fetchNuGet { pname = "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "1klrs545awhayryma6l7g2pvnp9xy4z0r1i40r80zb45q3i9nbyf"; })
+  (fetchNuGet { pname = "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0zcxjv5pckplvkg0r6mw3asggm7aqzbdjimhvsasb0cgm59x09l3"; })
+  (fetchNuGet { pname = "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0vhynn79ih7hw7cwjazn87rm9z9fj0rvxgzlab36jybgcpcgphsn"; })
+  (fetchNuGet { pname = "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "160p68l2c7cqmyqjwxydcvgw7lvl1cr0znkw8fp24d1by9mqc8p3"; })
+  (fetchNuGet { pname = "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "15zrc8fgd8zx28hdghcj5f5i34wf3l6bq5177075m2bc2j34jrqy"; })
+  (fetchNuGet { pname = "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "1p4dgxax6p7rlgj4q73k73rslcnz4wdcv8q2flg1s8ygwcm58ld5"; })
+  (fetchNuGet { pname = "runtime.unix.Microsoft.Win32.Primitives"; version = "4.3.0"; sha256 = "0y61k9zbxhdi0glg154v30kkq7f8646nif8lnnxbvkjpakggd5id"; })
+  (fetchNuGet { pname = "runtime.unix.System.Diagnostics.Debug"; version = "4.3.0"; sha256 = "1lps7fbnw34bnh3lm31gs5c0g0dh7548wfmb8zz62v0zqz71msj5"; })
+  (fetchNuGet { pname = "runtime.unix.System.IO.FileSystem"; version = "4.3.0"; sha256 = "14nbkhvs7sji5r1saj2x8daz82rnf9kx28d3v2qss34qbr32dzix"; })
+  (fetchNuGet { pname = "runtime.unix.System.Private.Uri"; version = "4.3.0"; sha256 = "1jx02q6kiwlvfksq1q9qr17fj78y5v6mwsszav4qcz9z25d5g6vk"; })
+  (fetchNuGet { pname = "runtime.unix.System.Runtime.Extensions"; version = "4.3.0"; sha256 = "0pnxxmm8whx38dp6yvwgmh22smknxmqs5n513fc7m4wxvs1bvi4p"; })
+  (fetchNuGet { pname = "Serilog"; version = "2.12.0"; sha256 = "0lqxpc96qcjkv9pr1rln7mi4y7n7jdi4vb36c2fv3845w1vswgr4"; })
+  (fetchNuGet { pname = "Serilog.Extensions.Logging"; version = "3.0.1"; sha256 = "069qy7dm5nxb372ij112ppa6m99b4iaimj3sji74m659fwrcrl9a"; })
+  (fetchNuGet { pname = "Serilog.Settings.Configuration"; version = "3.1.0"; sha256 = "1cj5am4n073331gbfm2ylqb9cadl4q3ppzgwmm5c8m1drxpiwkb5"; })
+  (fetchNuGet { pname = "Serilog.Sinks.Debug"; version = "2.0.0"; sha256 = "1i7j870l47gan3gpnnlzkccn5lbm7518cnkp25a3g5gp9l0dbwpw"; })
+  (fetchNuGet { pname = "Serilog.Sinks.File"; version = "5.0.0"; sha256 = "097rngmgcrdfy7jy8j7dq3xaq2qky8ijwg0ws6bfv5lx0f3vvb0q"; })
+  (fetchNuGet { pname = "System.AppContext"; version = "4.1.0"; sha256 = "0fv3cma1jp4vgj7a8hqc9n7hr1f1kjp541s6z0q1r6nazb4iz9mz"; })
+  (fetchNuGet { pname = "System.Buffers"; version = "4.3.0"; sha256 = "0fgns20ispwrfqll4q1zc1waqcmylb3zc50ys9x8zlwxh9pmd9jy"; })
+  (fetchNuGet { pname = "System.Collections"; version = "4.3.0"; sha256 = "19r4y64dqyrq6k4706dnyhhw7fs24kpp3awak7whzss39dakpxk9"; })
+  (fetchNuGet { pname = "System.Collections.Immutable"; version = "1.7.0"; sha256 = "1gik4sn9jsi1wcy1pyyp0r4sn2g17cwrsh24b2d52vif8p2h24zx"; })
+  (fetchNuGet { pname = "System.Collections.Immutable"; version = "1.7.1"; sha256 = "1nh4nlxfc7lbnbl86wwk1a3jwl6myz5j6hvgh5sp4krim9901hsq"; })
+  (fetchNuGet { pname = "System.CommandLine"; version = "2.0.0-beta4.22272.1"; sha256 = "1iy5hwwgvx911g3yq65p4zsgpy08w4qz9j3h0igcf7yci44vw8yd"; })
+  (fetchNuGet { pname = "System.Configuration.ConfigurationManager"; version = "6.0.0"; sha256 = "0sqapr697jbb4ljkq46msg0xx1qpmc31ivva6llyz2wzq3mpmxbw"; })
+  (fetchNuGet { pname = "System.Diagnostics.Debug"; version = "4.3.0"; sha256 = "00yjlf19wjydyr6cfviaph3vsjzg3d5nvnya26i2fvfg53sknh3y"; })
+  (fetchNuGet { pname = "System.Diagnostics.Tracing"; version = "4.3.0"; sha256 = "1m3bx6c2s958qligl67q7grkwfz3w53hpy7nc97mh6f7j5k168c4"; })
+  (fetchNuGet { pname = "System.Drawing.Common"; version = "6.0.0"; sha256 = "02n8rzm58dac2np8b3xw8ychbvylja4nh6938l5k2fhyn40imlgz"; })
+  (fetchNuGet { pname = "System.Dynamic.Runtime"; version = "4.0.11"; sha256 = "1pla2dx8gkidf7xkciig6nifdsb494axjvzvann8g2lp3dbqasm9"; })
+  (fetchNuGet { pname = "System.Globalization"; version = "4.0.11"; sha256 = "070c5jbas2v7smm660zaf1gh0489xanjqymkvafcs4f8cdrs1d5d"; })
+  (fetchNuGet { pname = "System.Globalization"; version = "4.3.0"; sha256 = "1cp68vv683n6ic2zqh2s1fn4c2sd87g5hpp6l4d4nj4536jz98ki"; })
+  (fetchNuGet { pname = "System.IO"; version = "4.1.0"; sha256 = "1g0yb8p11vfd0kbkyzlfsbsp5z44lwsvyc0h3dpw6vqnbi035ajp"; })
+  (fetchNuGet { pname = "System.IO"; version = "4.3.0"; sha256 = "05l9qdrzhm4s5dixmx68kxwif4l99ll5gqmh7rqgw554fx0agv5f"; })
+  (fetchNuGet { pname = "System.IO.FileSystem"; version = "4.0.1"; sha256 = "0kgfpw6w4djqra3w5crrg8xivbanh1w9dh3qapb28q060wb9flp1"; })
+  (fetchNuGet { pname = "System.IO.FileSystem.Primitives"; version = "4.3.0"; sha256 = "0j6ndgglcf4brg2lz4wzsh1av1gh8xrzdsn9f0yznskhqn1xzj9c"; })
+  (fetchNuGet { pname = "System.IO.Pipelines"; version = "4.7.3"; sha256 = "0djp59x56klidi04xx8p5jc1nchv5zvd1d59diphqxwvgny3aawy"; })
+  (fetchNuGet { pname = "System.Linq"; version = "4.1.0"; sha256 = "1ppg83svb39hj4hpp5k7kcryzrf3sfnm08vxd5sm2drrijsla2k5"; })
+  (fetchNuGet { pname = "System.Linq.Async"; version = "6.0.1"; sha256 = "10ira8hmv0i54yp9ggrrdm1c06j538sijfjpn1kmnh9j2xk5yzmq"; })
+  (fetchNuGet { pname = "System.Linq.Expressions"; version = "4.1.0"; sha256 = "1gpdxl6ip06cnab7n3zlcg6mqp7kknf73s8wjinzi4p0apw82fpg"; })
+  (fetchNuGet { pname = "System.Memory"; version = "4.5.4"; sha256 = "14gbbs22mcxwggn0fcfs1b062521azb9fbb7c113x0mq6dzq9h6y"; })
+  (fetchNuGet { pname = "System.Net.WebSockets"; version = "4.3.0"; sha256 = "1gfj800078kggcgl0xyl00a6y5k4wwh2k2qm69rjy22wbmq7fy4p"; })
+  (fetchNuGet { pname = "System.ObjectModel"; version = "4.0.12"; sha256 = "1sybkfi60a4588xn34nd9a58png36i0xr4y4v4kqpg8wlvy5krrj"; })
+  (fetchNuGet { pname = "System.Private.Uri"; version = "4.3.0"; sha256 = "04r1lkdnsznin0fj4ya1zikxiqr0h6r6a1ww2dsm60gqhdrf0mvx"; })
+  (fetchNuGet { pname = "System.Reactive"; version = "4.4.1"; sha256 = "0gx8jh3hny2y5kijz5k9pxiqw481d013787c04zlhps21ygklw4a"; })
+  (fetchNuGet { pname = "System.Reflection"; version = "4.1.0"; sha256 = "1js89429pfw79mxvbzp8p3q93il6rdff332hddhzi5wqglc4gml9"; })
+  (fetchNuGet { pname = "System.Reflection"; version = "4.3.0"; sha256 = "0xl55k0mw8cd8ra6dxzh974nxif58s3k1rjv1vbd7gjbjr39j11m"; })
+  (fetchNuGet { pname = "System.Reflection.Emit"; version = "4.0.1"; sha256 = "0ydqcsvh6smi41gyaakglnv252625hf29f7kywy2c70nhii2ylqp"; })
+  (fetchNuGet { pname = "System.Reflection.Emit.ILGeneration"; version = "4.0.1"; sha256 = "1pcd2ig6bg144y10w7yxgc9d22r7c7ww7qn1frdfwgxr24j9wvv0"; })
+  (fetchNuGet { pname = "System.Reflection.Emit.Lightweight"; version = "4.0.1"; sha256 = "1s4b043zdbx9k39lfhvsk68msv1nxbidhkq6nbm27q7sf8xcsnxr"; })
+  (fetchNuGet { pname = "System.Reflection.Extensions"; version = "4.0.1"; sha256 = "0m7wqwq0zqq9gbpiqvgk3sr92cbrw7cp3xn53xvw7zj6rz6fdirn"; })
+  (fetchNuGet { pname = "System.Reflection.Metadata"; version = "1.6.0"; sha256 = "1wdbavrrkajy7qbdblpbpbalbdl48q3h34cchz24gvdgyrlf15r4"; })
+  (fetchNuGet { pname = "System.Reflection.Primitives"; version = "4.0.1"; sha256 = "1bangaabhsl4k9fg8khn83wm6yial8ik1sza7401621jc6jrym28"; })
+  (fetchNuGet { pname = "System.Reflection.Primitives"; version = "4.3.0"; sha256 = "04xqa33bld78yv5r93a8n76shvc8wwcdgr1qvvjh959g3rc31276"; })
+  (fetchNuGet { pname = "System.Reflection.TypeExtensions"; version = "4.1.0"; sha256 = "1bjli8a7sc7jlxqgcagl9nh8axzfl11f4ld3rjqsyxc516iijij7"; })
+  (fetchNuGet { pname = "System.Resources.ResourceManager"; version = "4.0.1"; sha256 = "0b4i7mncaf8cnai85jv3wnw6hps140cxz8vylv2bik6wyzgvz7bi"; })
+  (fetchNuGet { pname = "System.Resources.ResourceManager"; version = "4.3.0"; sha256 = "0sjqlzsryb0mg4y4xzf35xi523s4is4hz9q4qgdvlvgivl7qxn49"; })
+  (fetchNuGet { pname = "System.Runtime"; version = "4.1.0"; sha256 = "02hdkgk13rvsd6r9yafbwzss8kr55wnj8d5c7xjnp8gqrwc8sn0m"; })
+  (fetchNuGet { pname = "System.Runtime"; version = "4.3.0"; sha256 = "066ixvgbf2c929kgknshcxqj6539ax7b9m570cp8n179cpfkapz7"; })
+  (fetchNuGet { pname = "System.Runtime.Caching"; version = "6.0.0"; sha256 = "0wh98a77cby4i3h2mar241k01105x661kh03vlyd399shxkfk60a"; })
+  (fetchNuGet { pname = "System.Runtime.CompilerServices.Unsafe"; version = "4.4.0"; sha256 = "0a6ahgi5b148sl5qyfpyw383p3cb4yrkm802k29fsi4mxkiwir29"; })
+  (fetchNuGet { pname = "System.Runtime.CompilerServices.Unsafe"; version = "4.7.0"; sha256 = "16r6sn4czfjk8qhnz7bnqlyiaaszr0ihinb7mq9zzr1wba257r54"; })
+  (fetchNuGet { pname = "System.Runtime.CompilerServices.Unsafe"; version = "4.7.1"; sha256 = "119br3pd85lq8zcgh4f60jzmv1g976q1kdgi3hvqdlhfbw6siz2j"; })
+  (fetchNuGet { pname = "System.Runtime.Extensions"; version = "4.1.0"; sha256 = "0rw4rm4vsm3h3szxp9iijc3ksyviwsv6f63dng3vhqyg4vjdkc2z"; })
+  (fetchNuGet { pname = "System.Runtime.Extensions"; version = "4.3.0"; sha256 = "1ykp3dnhwvm48nap8q23893hagf665k0kn3cbgsqpwzbijdcgc60"; })
+  (fetchNuGet { pname = "System.Runtime.Handles"; version = "4.0.1"; sha256 = "1g0zrdi5508v49pfm3iii2hn6nm00bgvfpjq1zxknfjrxxa20r4g"; })
+  (fetchNuGet { pname = "System.Runtime.Handles"; version = "4.3.0"; sha256 = "0sw2gfj2xr7sw9qjn0j3l9yw07x73lcs97p8xfc9w1x9h5g5m7i8"; })
+  (fetchNuGet { pname = "System.Runtime.InteropServices"; version = "4.1.0"; sha256 = "01kxqppx3dr3b6b286xafqilv4s2n0gqvfgzfd4z943ga9i81is1"; })
+  (fetchNuGet { pname = "System.Runtime.InteropServices"; version = "4.3.0"; sha256 = "00hywrn4g7hva1b2qri2s6rabzwgxnbpw9zfxmz28z09cpwwgh7j"; })
+  (fetchNuGet { pname = "System.Runtime.InteropServices.RuntimeInformation"; version = "4.0.0"; sha256 = "0glmvarf3jz5xh22iy3w9v3wyragcm4hfdr17v90vs7vcrm7fgp6"; })
+  (fetchNuGet { pname = "System.Runtime.Numerics"; version = "4.3.0"; sha256 = "19rav39sr5dky7afygh309qamqqmi9kcwvz3i0c5700v0c5cg61z"; })
+  (fetchNuGet { pname = "System.Security.AccessControl"; version = "4.6.0"; sha256 = "1wl1dyghi0qhpap1vgfhg2ybdyyhy9vc2a7dpm1xb30vfgmlkjmf"; })
+  (fetchNuGet { pname = "System.Security.AccessControl"; version = "6.0.0"; sha256 = "0a678bzj8yxxiffyzy60z2w1nczzpi8v97igr4ip3byd2q89dv58"; })
+  (fetchNuGet { pname = "System.Security.Cryptography.ProtectedData"; version = "6.0.0"; sha256 = "05kd3a8w7658hjxq9vvszxip30a479fjmfq4bq1r95nrsvs4hbss"; })
+  (fetchNuGet { pname = "System.Security.Permissions"; version = "6.0.0"; sha256 = "0jsl4xdrkqi11iwmisi1r2f2qn5pbvl79mzq877gndw6ans2zhzw"; })
+  (fetchNuGet { pname = "System.Security.Principal.Windows"; version = "4.6.0"; sha256 = "1jmfzfz1n8hp63s5lja5xxpzkinbp6g59l3km9h8avjiisdrg5wm"; })
+  (fetchNuGet { pname = "System.Text.Encoding"; version = "4.0.11"; sha256 = "1dyqv0hijg265dwxg6l7aiv74102d6xjiwplh2ar1ly6xfaa4iiw"; })
+  (fetchNuGet { pname = "System.Text.Encoding"; version = "4.3.0"; sha256 = "1f04lkir4iladpp51sdgmis9dj4y8v08cka0mbmsy0frc9a4gjqr"; })
+  (fetchNuGet { pname = "System.Text.Encoding.CodePages"; version = "4.5.1"; sha256 = "1z21qyfs6sg76rp68qdx0c9iy57naan89pg7p6i3qpj8kyzn921w"; })
+  (fetchNuGet { pname = "System.Text.Encoding.Extensions"; version = "4.3.0"; sha256 = "11q1y8hh5hrp5a3kw25cb6l00v5l5dvirkz8jr3sq00h1xgcgrxy"; })
+  (fetchNuGet { pname = "System.Threading"; version = "4.0.11"; sha256 = "19x946h926bzvbsgj28csn46gak2crv2skpwsx80hbgazmkgb1ls"; })
+  (fetchNuGet { pname = "System.Threading"; version = "4.3.0"; sha256 = "0rw9wfamvhayp5zh3j7p1yfmx9b5khbf4q50d8k5rk993rskfd34"; })
+  (fetchNuGet { pname = "System.Threading.Channels"; version = "4.7.1"; sha256 = "038fyrriypwzsj5fwgnkw79hm5ya0x63r724yizgahbxf512chr2"; })
+  (fetchNuGet { pname = "System.Threading.Tasks"; version = "4.0.11"; sha256 = "0nr1r41rak82qfa5m0lhk9mp0k93bvfd7bbd9sdzwx9mb36g28p5"; })
+  (fetchNuGet { pname = "System.Threading.Tasks"; version = "4.3.0"; sha256 = "134z3v9abw3a6jsw17xl3f6hqjpak5l682k2vz39spj4kmydg6k7"; })
+  (fetchNuGet { pname = "System.Threading.Tasks.Extensions"; version = "4.5.3"; sha256 = "0g7r6hm572ax8v28axrdxz1gnsblg6kszq17g51pj14a5rn2af7i"; })
+  (fetchNuGet { pname = "System.Windows.Extensions"; version = "6.0.0"; sha256 = "1wy9pq9vn1bqg5qnv53iqrbx04yzdmjw4x5yyi09y3459vaa1sip"; })
+  (fetchNuGet { pname = "Tomlyn"; version = "0.16.2"; sha256 = "1i928q6a7l65mk7wj2vvfclyvxamdjxg4dbj3g6g95inrfgvidah"; })
+]
diff --git a/nixpkgs/pkgs/applications/science/logic/drat-trim/default.nix b/nixpkgs/pkgs/applications/science/logic/drat-trim/default.nix
new file mode 100644
index 000000000000..78d810e19be2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/drat-trim/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation {
+  pname = "drat-trim";
+  version = "2023-05-22";
+
+  src = fetchFromGitHub {
+    owner = "marijnheule";
+    repo = "drat-trim";
+    rev = "refs/tags/v05.22.2023";
+    hash = "sha256-sV3A0f1TLSaTIdAtT6y8rU3ZS2UqEePJYSf3UySOlSA=";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile --replace gcc cc
+  '';
+
+  installPhase = ''
+    install -Dt $out/bin drat-trim lrat-check
+  '';
+
+  meta = with lib; {
+    description = "A proof checker for unSAT proofs";
+    longDescription = ''
+      DRAT-trim is a satisfiability proof checking and trimming
+      utility designed to validate proofs for all known satisfiability
+      solving and preprocessing techniques.  DRAT-trim can also emit
+      trimmed formulas, optimized proofs, and TraceCheck+ dependency
+      graphs.
+
+      DRAT-trim has been used as part of the judging process in the
+      annual SAT Competition in recent years, in order to check
+      competing SAT solvers' work when they claim that a SAT instance
+      is unsatisfiable.
+
+      This package also contains the related tool LRAT-check, which checks a
+      proof format called LRAT which extends DRAT with hint statements to speed
+      up the checking process.
+    '';
+    homepage = "https://www.cs.utexas.edu/~marijn/drat-trim/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ kini ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/easycrypt/default.nix b/nixpkgs/pkgs/applications/science/logic/easycrypt/default.nix
new file mode 100644
index 000000000000..782d15d61559
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/easycrypt/default.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv, fetchFromGitHub, ocamlPackages, why3, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "easycrypt";
+  version = "2024.01";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "r${version}";
+    hash = "sha256-UYDoVMi5TtYxgPq5nkp/oRtcMcHl2p7KAG8ptvuOL5U=";
+  };
+
+  nativeBuildInputs = with ocamlPackages; [
+    dune_3
+    findlib
+    menhir
+    ocaml
+    python3.pkgs.wrapPython
+  ];
+  buildInputs = with ocamlPackages; [
+    batteries
+    dune-build-info
+    inifiles
+    why3
+    yojson
+    zarith
+  ];
+
+  propagatedBuildInputs = [ why3.out ];
+
+  strictDeps = true;
+
+  postPatch = ''
+    substituteInPlace dune-project --replace '(name easycrypt)' '(name easycrypt)(version ${version})'
+  '';
+
+  pythonPath = with python3.pkgs; [ pyyaml ];
+
+  installPhase = ''
+    runHook preInstall
+    dune install --prefix $out ${pname}
+    rm $out/bin/ec-runtest
+    wrapPythonProgramsIn "$out/lib/easycrypt/commands" "$pythonPath"
+    runHook postInstall
+  '';
+
+  meta = {
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
+    platforms = lib.platforms.all;
+    homepage = "https://easycrypt.info/";
+    description = "Computer-Aided Cryptographic Proofs";
+    mainProgram = "easycrypt";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/easycrypt/runtest.nix b/nixpkgs/pkgs/applications/science/logic/easycrypt/runtest.nix
new file mode 100644
index 000000000000..b714dc14991b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/easycrypt/runtest.nix
@@ -0,0 +1,26 @@
+{ python3Packages, easycrypt }:
+
+python3Packages.buildPythonApplication rec {
+  inherit (easycrypt) src version;
+  format = "other";
+
+  pname = "easycrypt-runtest";
+
+  dontConfigure = true;
+  dontBuild = true;
+  doCheck = false;
+
+  pythonPath = with python3Packages; [ pyyaml ];
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/bin
+    cp scripts/testing/runtest $out/bin/ec-runtest
+    runHook postInstall
+  '';
+
+  meta = easycrypt.meta // {
+    description = "Testing program for EasyCrypt formalizations";
+    mainProgram = "ec-runtest";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/egglog/Cargo.lock b/nixpkgs/pkgs/applications/science/logic/egglog/Cargo.lock
new file mode 100644
index 000000000000..0d2fbadc10bc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/egglog/Cargo.lock
@@ -0,0 +1,1415 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "ahash"
+version = "0.7.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd"
+dependencies = [
+ "getrandom",
+ "once_cell",
+ "version_check",
+]
+
+[[package]]
+name = "ahash"
+version = "0.8.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a"
+dependencies = [
+ "cfg-if 1.0.0",
+ "once_cell",
+ "version_check",
+ "zerocopy",
+]
+
+[[package]]
+name = "aho-corasick"
+version = "1.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
+name = "allocator-api2"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5"
+
+[[package]]
+name = "anstream"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44"
+dependencies = [
+ "anstyle",
+ "anstyle-parse",
+ "anstyle-query",
+ "anstyle-wincon",
+ "colorchoice",
+ "utf8parse",
+]
+
+[[package]]
+name = "anstyle"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87"
+
+[[package]]
+name = "anstyle-parse"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140"
+dependencies = [
+ "utf8parse",
+]
+
+[[package]]
+name = "anstyle-query"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b"
+dependencies = [
+ "windows-sys",
+]
+
+[[package]]
+name = "anstyle-wincon"
+version = "3.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628"
+dependencies = [
+ "anstyle",
+ "windows-sys",
+]
+
+[[package]]
+name = "ascii-canvas"
+version = "3.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6"
+dependencies = [
+ "term",
+]
+
+[[package]]
+name = "autocfg"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
+
+[[package]]
+name = "bit-set"
+version = "0.5.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1"
+dependencies = [
+ "bit-vec",
+]
+
+[[package]]
+name = "bit-vec"
+version = "0.6.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
+
+[[package]]
+name = "bitflags"
+version = "1.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
+
+[[package]]
+name = "bitflags"
+version = "2.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07"
+
+[[package]]
+name = "block-buffer"
+version = "0.10.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71"
+dependencies = [
+ "generic-array",
+]
+
+[[package]]
+name = "bumpalo"
+version = "3.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec"
+
+[[package]]
+name = "cfg-if"
+version = "0.1.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
+
+[[package]]
+name = "cfg-if"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
+
+[[package]]
+name = "clap"
+version = "4.4.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b"
+dependencies = [
+ "clap_builder",
+ "clap_derive",
+]
+
+[[package]]
+name = "clap_builder"
+version = "4.4.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663"
+dependencies = [
+ "anstream",
+ "anstyle",
+ "clap_lex",
+ "strsim",
+]
+
+[[package]]
+name = "clap_derive"
+version = "4.4.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442"
+dependencies = [
+ "heck",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.38",
+]
+
+[[package]]
+name = "clap_lex"
+version = "0.6.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1"
+
+[[package]]
+name = "colorchoice"
+version = "1.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7"
+
+[[package]]
+name = "console_error_panic_hook"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc"
+dependencies = [
+ "cfg-if 1.0.0",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "cpufeatures"
+version = "0.2.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0"
+dependencies = [
+ "libc",
+]
+
+[[package]]
+name = "crunchy"
+version = "0.2.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7"
+
+[[package]]
+name = "crypto-common"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3"
+dependencies = [
+ "generic-array",
+ "typenum",
+]
+
+[[package]]
+name = "diff"
+version = "0.1.13"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
+
+[[package]]
+name = "digest"
+version = "0.10.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292"
+dependencies = [
+ "block-buffer",
+ "crypto-common",
+]
+
+[[package]]
+name = "dirs-next"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
+dependencies = [
+ "cfg-if 1.0.0",
+ "dirs-sys-next",
+]
+
+[[package]]
+name = "dirs-sys-next"
+version = "0.1.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
+dependencies = [
+ "libc",
+ "redox_users",
+ "winapi",
+]
+
+[[package]]
+name = "dot-generator"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0aaac7ada45f71873ebce336491d1c1bc4a7c8042c7cea978168ad59e805b871"
+dependencies = [
+ "dot-structures",
+]
+
+[[package]]
+name = "dot-structures"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "675e35c02a51bb4d4618cb4885b3839ce6d1787c97b664474d9208d074742e20"
+
+[[package]]
+name = "egglog"
+version = "0.1.0"
+dependencies = [
+ "clap",
+ "egraph-serialize",
+ "env_logger",
+ "generic_symbolic_expressions",
+ "getrandom",
+ "glob",
+ "hashbrown 0.14.2",
+ "indexmap",
+ "instant",
+ "lalrpop",
+ "lalrpop-util",
+ "lazy_static",
+ "libtest-mimic",
+ "log",
+ "num-integer",
+ "num-rational",
+ "num-traits",
+ "ordered-float",
+ "regex",
+ "rustc-hash",
+ "serde_json",
+ "smallvec",
+ "symbol_table",
+ "thiserror",
+]
+
+[[package]]
+name = "egraph-serialize"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a41150f383849cfc16ae6230f592112b3c0a2c0e3ec43eb0b09db037bfcce703"
+dependencies = [
+ "graphviz-rust",
+ "indexmap",
+ "once_cell",
+ "ordered-float",
+ "serde",
+ "serde_json",
+]
+
+[[package]]
+name = "either"
+version = "1.9.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07"
+
+[[package]]
+name = "ena"
+version = "0.14.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1"
+dependencies = [
+ "log",
+]
+
+[[package]]
+name = "env_logger"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0"
+dependencies = [
+ "humantime",
+ "is-terminal",
+ "log",
+ "regex",
+ "termcolor",
+]
+
+[[package]]
+name = "equivalent"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
+
+[[package]]
+name = "errno"
+version = "0.3.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860"
+dependencies = [
+ "libc",
+ "windows-sys",
+]
+
+[[package]]
+name = "fastrand"
+version = "2.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5"
+
+[[package]]
+name = "fixedbitset"
+version = "0.4.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80"
+
+[[package]]
+name = "generic-array"
+version = "0.14.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a"
+dependencies = [
+ "typenum",
+ "version_check",
+]
+
+[[package]]
+name = "generic_symbolic_expressions"
+version = "5.0.3"
+source = "git+https://github.com/oflatt/symbolic-expressions?rev=655b6a4c06b4b3d3b2300e17779860b4abe440f0#655b6a4c06b4b3d3b2300e17779860b4abe440f0"
+
+[[package]]
+name = "getrandom"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427"
+dependencies = [
+ "cfg-if 1.0.0",
+ "js-sys",
+ "libc",
+ "wasi",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "glob"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
+
+[[package]]
+name = "graphviz-rust"
+version = "0.6.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "27dafd1ac303e0dfb347a3861d9ac440859bab26ec2f534bbceb262ea492a1e0"
+dependencies = [
+ "dot-generator",
+ "dot-structures",
+ "into-attr",
+ "into-attr-derive",
+ "pest",
+ "pest_derive",
+ "rand",
+ "tempfile",
+]
+
+[[package]]
+name = "hashbrown"
+version = "0.12.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
+dependencies = [
+ "ahash 0.7.7",
+]
+
+[[package]]
+name = "hashbrown"
+version = "0.14.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156"
+dependencies = [
+ "ahash 0.8.6",
+ "allocator-api2",
+]
+
+[[package]]
+name = "heck"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
+
+[[package]]
+name = "hermit-abi"
+version = "0.3.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7"
+
+[[package]]
+name = "humantime"
+version = "2.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4"
+
+[[package]]
+name = "indexmap"
+version = "2.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897"
+dependencies = [
+ "equivalent",
+ "hashbrown 0.14.2",
+ "serde",
+]
+
+[[package]]
+name = "instant"
+version = "0.1.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
+dependencies = [
+ "cfg-if 1.0.0",
+ "js-sys",
+ "wasm-bindgen",
+ "web-sys",
+]
+
+[[package]]
+name = "into-attr"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "18b48c537e49a709e678caec3753a7dba6854661a1eaa27675024283b3f8b376"
+dependencies = [
+ "dot-structures",
+]
+
+[[package]]
+name = "into-attr-derive"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ecac7c1ae6cd2c6a3a64d1061a8bdc7f52ff62c26a831a2301e54c1b5d70d5b1"
+dependencies = [
+ "dot-generator",
+ "dot-structures",
+ "into-attr",
+ "quote",
+ "syn 1.0.109",
+]
+
+[[package]]
+name = "is-terminal"
+version = "0.4.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b"
+dependencies = [
+ "hermit-abi",
+ "rustix",
+ "windows-sys",
+]
+
+[[package]]
+name = "itertools"
+version = "0.10.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473"
+dependencies = [
+ "either",
+]
+
+[[package]]
+name = "itoa"
+version = "1.0.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38"
+
+[[package]]
+name = "js-sys"
+version = "0.3.64"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a"
+dependencies = [
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "lalrpop"
+version = "0.20.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da4081d44f4611b66c6dd725e6de3169f9f63905421e8626fcb86b6a898998b8"
+dependencies = [
+ "ascii-canvas",
+ "bit-set",
+ "diff",
+ "ena",
+ "is-terminal",
+ "itertools",
+ "lalrpop-util",
+ "petgraph",
+ "pico-args",
+ "regex",
+ "regex-syntax 0.7.5",
+ "string_cache",
+ "term",
+ "tiny-keccak",
+ "unicode-xid",
+]
+
+[[package]]
+name = "lalrpop-util"
+version = "0.20.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3f35c735096c0293d313e8f2a641627472b83d01b937177fe76e5e2708d31e0d"
+dependencies = [
+ "regex",
+]
+
+[[package]]
+name = "lazy_static"
+version = "1.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
+
+[[package]]
+name = "libc"
+version = "0.2.149"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
+
+[[package]]
+name = "libtest-mimic"
+version = "0.6.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6d8de370f98a6cb8a4606618e53e802f93b094ddec0f96988eaec2c27e6e9ce7"
+dependencies = [
+ "clap",
+ "termcolor",
+ "threadpool",
+]
+
+[[package]]
+name = "linux-raw-sys"
+version = "0.4.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f"
+
+[[package]]
+name = "lock_api"
+version = "0.4.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45"
+dependencies = [
+ "autocfg",
+ "scopeguard",
+]
+
+[[package]]
+name = "log"
+version = "0.4.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f"
+
+[[package]]
+name = "memchr"
+version = "2.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
+
+[[package]]
+name = "memory_units"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3"
+
+[[package]]
+name = "new_debug_unreachable"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"
+
+[[package]]
+name = "num-bigint"
+version = "0.4.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0"
+dependencies = [
+ "autocfg",
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-integer"
+version = "0.1.45"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9"
+dependencies = [
+ "autocfg",
+ "num-traits",
+]
+
+[[package]]
+name = "num-rational"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0"
+dependencies = [
+ "autocfg",
+ "num-bigint",
+ "num-integer",
+ "num-traits",
+]
+
+[[package]]
+name = "num-traits"
+version = "0.2.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
+dependencies = [
+ "autocfg",
+]
+
+[[package]]
+name = "num_cpus"
+version = "1.16.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
+dependencies = [
+ "hermit-abi",
+ "libc",
+]
+
+[[package]]
+name = "once_cell"
+version = "1.18.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d"
+
+[[package]]
+name = "ordered-float"
+version = "3.9.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f1e1c390732d15f1d48471625cd92d154e66db2c56645e29a9cd26f4699f72dc"
+dependencies = [
+ "num-traits",
+ "rand",
+ "serde",
+]
+
+[[package]]
+name = "parking_lot"
+version = "0.12.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
+dependencies = [
+ "lock_api",
+ "parking_lot_core",
+]
+
+[[package]]
+name = "parking_lot_core"
+version = "0.9.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e"
+dependencies = [
+ "cfg-if 1.0.0",
+ "libc",
+ "redox_syscall 0.4.1",
+ "smallvec",
+ "windows-targets",
+]
+
+[[package]]
+name = "pest"
+version = "2.7.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ae9cee2a55a544be8b89dc6848072af97a20f2422603c10865be2a42b580fff5"
+dependencies = [
+ "memchr",
+ "thiserror",
+ "ucd-trie",
+]
+
+[[package]]
+name = "pest_derive"
+version = "2.7.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "81d78524685f5ef2a3b3bd1cafbc9fcabb036253d9b1463e726a91cd16e2dfc2"
+dependencies = [
+ "pest",
+ "pest_generator",
+]
+
+[[package]]
+name = "pest_generator"
+version = "2.7.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "68bd1206e71118b5356dae5ddc61c8b11e28b09ef6a31acbd15ea48a28e0c227"
+dependencies = [
+ "pest",
+ "pest_meta",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.38",
+]
+
+[[package]]
+name = "pest_meta"
+version = "2.7.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7c747191d4ad9e4a4ab9c8798f1e82a39affe7ef9648390b7e5548d18e099de6"
+dependencies = [
+ "once_cell",
+ "pest",
+ "sha2",
+]
+
+[[package]]
+name = "petgraph"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9"
+dependencies = [
+ "fixedbitset",
+ "indexmap",
+]
+
+[[package]]
+name = "phf_shared"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
+dependencies = [
+ "siphasher",
+]
+
+[[package]]
+name = "pico-args"
+version = "0.5.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5be167a7af36ee22fe3115051bc51f6e6c7054c9348e28deb4f49bd6f705a315"
+
+[[package]]
+name = "ppv-lite86"
+version = "0.2.17"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
+
+[[package]]
+name = "precomputed-hash"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c"
+
+[[package]]
+name = "proc-macro2"
+version = "1.0.69"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
+dependencies = [
+ "unicode-ident",
+]
+
+[[package]]
+name = "quote"
+version = "1.0.33"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
+dependencies = [
+ "proc-macro2",
+]
+
+[[package]]
+name = "rand"
+version = "0.8.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
+dependencies = [
+ "libc",
+ "rand_chacha",
+ "rand_core",
+ "serde",
+]
+
+[[package]]
+name = "rand_chacha"
+version = "0.3.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
+dependencies = [
+ "ppv-lite86",
+ "rand_core",
+]
+
+[[package]]
+name = "rand_core"
+version = "0.6.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
+dependencies = [
+ "getrandom",
+ "serde",
+]
+
+[[package]]
+name = "redox_syscall"
+version = "0.2.16"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
+dependencies = [
+ "bitflags 1.3.2",
+]
+
+[[package]]
+name = "redox_syscall"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
+dependencies = [
+ "bitflags 1.3.2",
+]
+
+[[package]]
+name = "redox_users"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b"
+dependencies = [
+ "getrandom",
+ "redox_syscall 0.2.16",
+ "thiserror",
+]
+
+[[package]]
+name = "regex"
+version = "1.10.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-automata",
+ "regex-syntax 0.8.2",
+]
+
+[[package]]
+name = "regex-automata"
+version = "0.4.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
+dependencies = [
+ "aho-corasick",
+ "memchr",
+ "regex-syntax 0.8.2",
+]
+
+[[package]]
+name = "regex-syntax"
+version = "0.7.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da"
+
+[[package]]
+name = "regex-syntax"
+version = "0.8.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
+
+[[package]]
+name = "rustc-hash"
+version = "1.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
+
+[[package]]
+name = "rustix"
+version = "0.38.21"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3"
+dependencies = [
+ "bitflags 2.4.1",
+ "errno",
+ "libc",
+ "linux-raw-sys",
+ "windows-sys",
+]
+
+[[package]]
+name = "rustversion"
+version = "1.0.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4"
+
+[[package]]
+name = "ryu"
+version = "1.0.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741"
+
+[[package]]
+name = "scopeguard"
+version = "1.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
+
+[[package]]
+name = "serde"
+version = "1.0.190"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.190"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.38",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.108"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b"
+dependencies = [
+ "indexmap",
+ "itoa",
+ "ryu",
+ "serde",
+]
+
+[[package]]
+name = "sha2"
+version = "0.10.8"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8"
+dependencies = [
+ "cfg-if 1.0.0",
+ "cpufeatures",
+ "digest",
+]
+
+[[package]]
+name = "siphasher"
+version = "0.3.11"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d"
+
+[[package]]
+name = "smallvec"
+version = "1.11.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a"
+
+[[package]]
+name = "string_cache"
+version = "0.8.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b"
+dependencies = [
+ "new_debug_unreachable",
+ "once_cell",
+ "parking_lot",
+ "phf_shared",
+ "precomputed-hash",
+]
+
+[[package]]
+name = "strsim"
+version = "0.10.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623"
+
+[[package]]
+name = "symbol_table"
+version = "0.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "828f672b631c220bf6ea8a1d3b82c7d0fc998e5ba8373383d8604bc1e2a6245a"
+dependencies = [
+ "ahash 0.7.7",
+ "hashbrown 0.12.3",
+]
+
+[[package]]
+name = "syn"
+version = "1.0.109"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "syn"
+version = "2.0.38"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "unicode-ident",
+]
+
+[[package]]
+name = "tempfile"
+version = "3.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5"
+dependencies = [
+ "cfg-if 1.0.0",
+ "fastrand",
+ "redox_syscall 0.4.1",
+ "rustix",
+ "windows-sys",
+]
+
+[[package]]
+name = "term"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f"
+dependencies = [
+ "dirs-next",
+ "rustversion",
+ "winapi",
+]
+
+[[package]]
+name = "termcolor"
+version = "1.3.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64"
+dependencies = [
+ "winapi-util",
+]
+
+[[package]]
+name = "thiserror"
+version = "1.0.50"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2"
+dependencies = [
+ "thiserror-impl",
+]
+
+[[package]]
+name = "thiserror-impl"
+version = "1.0.50"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.38",
+]
+
+[[package]]
+name = "threadpool"
+version = "1.8.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa"
+dependencies = [
+ "num_cpus",
+]
+
+[[package]]
+name = "tiny-keccak"
+version = "2.0.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237"
+dependencies = [
+ "crunchy",
+]
+
+[[package]]
+name = "typenum"
+version = "1.17.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825"
+
+[[package]]
+name = "ucd-trie"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9"
+
+[[package]]
+name = "unicode-ident"
+version = "1.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
+
+[[package]]
+name = "unicode-xid"
+version = "0.2.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c"
+
+[[package]]
+name = "utf8parse"
+version = "0.2.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a"
+
+[[package]]
+name = "version_check"
+version = "0.9.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
+
+[[package]]
+name = "wasi"
+version = "0.11.0+wasi-snapshot-preview1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
+
+[[package]]
+name = "wasm-bindgen"
+version = "0.2.87"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342"
+dependencies = [
+ "cfg-if 1.0.0",
+ "wasm-bindgen-macro",
+]
+
+[[package]]
+name = "wasm-bindgen-backend"
+version = "0.2.87"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd"
+dependencies = [
+ "bumpalo",
+ "log",
+ "once_cell",
+ "proc-macro2",
+ "quote",
+ "syn 2.0.38",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-macro"
+version = "0.2.87"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d"
+dependencies = [
+ "quote",
+ "wasm-bindgen-macro-support",
+]
+
+[[package]]
+name = "wasm-bindgen-macro-support"
+version = "0.2.87"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.38",
+ "wasm-bindgen-backend",
+ "wasm-bindgen-shared",
+]
+
+[[package]]
+name = "wasm-bindgen-shared"
+version = "0.2.87"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1"
+
+[[package]]
+name = "wasm-logger"
+version = "0.2.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "074649a66bb306c8f2068c9016395fa65d8e08d2affcbf95acf3c24c3ab19718"
+dependencies = [
+ "log",
+ "wasm-bindgen",
+ "web-sys",
+]
+
+[[package]]
+name = "web-demo"
+version = "0.1.0"
+dependencies = [
+ "console_error_panic_hook",
+ "egglog",
+ "js-sys",
+ "log",
+ "wasm-bindgen",
+ "wasm-logger",
+ "web-sys",
+ "wee_alloc",
+]
+
+[[package]]
+name = "web-sys"
+version = "0.3.64"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b"
+dependencies = [
+ "js-sys",
+ "wasm-bindgen",
+]
+
+[[package]]
+name = "wee_alloc"
+version = "0.4.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e"
+dependencies = [
+ "cfg-if 0.1.10",
+ "libc",
+ "memory_units",
+ "winapi",
+]
+
+[[package]]
+name = "winapi"
+version = "0.3.9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
+dependencies = [
+ "winapi-i686-pc-windows-gnu",
+ "winapi-x86_64-pc-windows-gnu",
+]
+
+[[package]]
+name = "winapi-i686-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
+
+[[package]]
+name = "winapi-util"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596"
+dependencies = [
+ "winapi",
+]
+
+[[package]]
+name = "winapi-x86_64-pc-windows-gnu"
+version = "0.4.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
+
+[[package]]
+name = "windows-sys"
+version = "0.48.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
+dependencies = [
+ "windows-targets",
+]
+
+[[package]]
+name = "windows-targets"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
+dependencies = [
+ "windows_aarch64_gnullvm",
+ "windows_aarch64_msvc",
+ "windows_i686_gnu",
+ "windows_i686_msvc",
+ "windows_x86_64_gnu",
+ "windows_x86_64_gnullvm",
+ "windows_x86_64_msvc",
+]
+
+[[package]]
+name = "windows_aarch64_gnullvm"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
+
+[[package]]
+name = "windows_aarch64_msvc"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
+
+[[package]]
+name = "windows_i686_gnu"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
+
+[[package]]
+name = "windows_i686_msvc"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
+
+[[package]]
+name = "windows_x86_64_gnu"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
+
+[[package]]
+name = "windows_x86_64_gnullvm"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
+
+[[package]]
+name = "windows_x86_64_msvc"
+version = "0.48.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
+
+[[package]]
+name = "zerocopy"
+version = "0.7.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "dd66a62464e3ffd4e37bd09950c2b9dd6c4f8767380fabba0d523f9a775bc85a"
+dependencies = [
+ "zerocopy-derive",
+]
+
+[[package]]
+name = "zerocopy-derive"
+version = "0.7.20"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "255c4596d41e6916ced49cfafea18727b24d67878fa180ddfd69b9df34fd1726"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn 2.0.38",
+]
diff --git a/nixpkgs/pkgs/applications/science/logic/egglog/default.nix b/nixpkgs/pkgs/applications/science/logic/egglog/default.nix
new file mode 100644
index 000000000000..8b94c449c6be
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/egglog/default.nix
@@ -0,0 +1,33 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+}:
+
+rustPlatform.buildRustPackage {
+  pname = "egglog";
+  version = "0-unstable-2024-01-26";
+
+  src = fetchFromGitHub {
+    owner = "egraphs-good";
+    repo = "egglog";
+    rev = "b78f69ca1f7187c363bb31271c8e8958f477f15d";
+    hash = "sha256-/1ktyz8wU1yLTdAFPnupK6jUFjiK6nQfotGRNOWiOsA=";
+  };
+
+  useNextest = true;
+
+  cargoLock = {
+    lockFile = ./Cargo.lock;
+    outputHashes = {
+      "generic_symbolic_expressions-5.0.3" = "sha256-UX6fS470YJMdNnn0GR3earMGQK3p/YvaFia7IEvGGKg=";
+    };
+  };
+
+  meta = with lib; {
+    description = "A fixpoint reasoning system that unifies Datalog and equality saturation";
+    mainProgram = "egglog";
+    homepage = "https://github.com/egraphs-good/egglog";
+    license = licenses.mit;
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/ekrhyper/default.nix b/nixpkgs/pkgs/applications/science/logic/ekrhyper/default.nix
new file mode 100644
index 000000000000..4a5124b23582
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/ekrhyper/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, ocaml, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "ekrhyper";
+  version = "1_4_21022014";
+
+  src = fetchurl {
+    url = "http://userpages.uni-koblenz.de/~bpelzer/ekrhyper/ekrh_${version}.tar.gz";
+    sha256 = "sha256-fEe0DIMGj7wO+79/BZf45kykgyTXpbZJsyFSt31XqpM=";
+  };
+
+  strictDeps = true;
+  nativeBuildInputs = [ ocaml perl ];
+  setSourceRoot = "export sourceRoot=$(echo */ekrh/src)";
+  preInstall = "export INSTALLDIR=$out";
+  postInstall = ''for i in "$out/casc"/*; do ln -s "$i" "$out/bin/ekrh-casc-$(basename $i)"; done '';
+
+  meta = with lib; {
+    description = "Automated first-order theorem prover";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ raskin ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/elan/0001-dynamically-patchelf-binaries.patch b/nixpkgs/pkgs/applications/science/logic/elan/0001-dynamically-patchelf-binaries.patch
new file mode 100644
index 000000000000..0b33d4242eb7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/elan/0001-dynamically-patchelf-binaries.patch
@@ -0,0 +1,42 @@
+diff --git a/src/elan-dist/src/component/package.rs b/src/elan-dist/src/component/package.rs
+index c51e76d..ae8159e 100644
+--- a/src/elan-dist/src/component/package.rs
++++ b/src/elan-dist/src/component/package.rs
+@@ -56,6 +56,37 @@ fn unpack_without_first_dir<R: Read>(archive: &mut tar::Archive<R>, path: &Path)
+         entry
+             .unpack(&full_path)
+             .chain_err(|| ErrorKind::ExtractingPackage)?;
++        nix_patch_if_needed(&full_path)?;
++    }
++
++    Ok(())
++}
++
++fn nix_patch_if_needed(dest_path: &Path) -> Result<()> {
++    let is_bin = matches!(dest_path.parent(), Some(p) if p.ends_with("bin"));
++    if is_bin {
++        let _ = ::std::process::Command::new("@patchelf@/bin/patchelf")
++            .arg("--set-interpreter")
++            .arg("@dynamicLinker@")
++            .arg(dest_path)
++            .output();
++    }
++
++    if dest_path.file_name() == Some(::std::ffi::OsStr::new("leanc")) {
++        use std::os::unix::fs::PermissionsExt;
++        let new_path = dest_path.with_extension("orig");
++        ::std::fs::rename(dest_path, &new_path)?;
++        ::std::fs::write(dest_path, r#"#! @shell@
++dir="$(dirname "${BASH_SOURCE[0]}")"
++# use bundled libraries, but not bundled compiler that doesn't know about NIX_LDFLAGS
++LEAN_CC="${LEAN_CC:-@cc@}" exec -a "$0" "$dir/leanc.orig" "$@" -L"$dir/../lib"
++"#)?;
++        ::std::fs::set_permissions(dest_path, ::std::fs::Permissions::from_mode(0o755))?;
++    }
++
++    if dest_path.file_name() == Some(::std::ffi::OsStr::new("llvm-ar")) {
++        ::std::fs::remove_file(dest_path)?;
++        ::std::os::unix::fs::symlink("@ar@", dest_path)?;
+     }
+ 
+     Ok(())
diff --git a/nixpkgs/pkgs/applications/science/logic/elan/default.nix b/nixpkgs/pkgs/applications/science/logic/elan/default.nix
new file mode 100644
index 000000000000..245f8db13ce6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/elan/default.nix
@@ -0,0 +1,69 @@
+{ stdenv, lib, runCommand, patchelf, makeWrapper, pkg-config, curl, runtimeShell
+, openssl, zlib, fetchFromGitHub, rustPlatform, libiconv }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "elan";
+  version = "3.1.1";
+
+  src = fetchFromGitHub {
+    owner = "leanprover";
+    repo = "elan";
+    rev = "v${version}";
+    hash = "sha256-/g5bO3UQcg0XYm62KdoWcVQqOV3SIedWUYLufEcblmE=";
+  };
+
+  cargoHash = "sha256-f8YVUTxHX1FY2p73DlnLDtCJaG/0JImUtJFraV6ErNM=";
+
+  nativeBuildInputs = [ pkg-config makeWrapper ];
+
+  OPENSSL_NO_VENDOR = 1;
+  buildInputs = [ curl zlib openssl ]
+    ++ lib.optional stdenv.isDarwin libiconv;
+
+  buildFeatures = [ "no-self-update" ];
+
+  patches = lib.optionals stdenv.isLinux [
+    # Run patchelf on the downloaded binaries.
+    # This is necessary because Lean 4 is now dynamically linked.
+    (runCommand "0001-dynamically-patchelf-binaries.patch" {
+        CC = stdenv.cc;
+        cc = "${stdenv.cc}/bin/cc";
+        ar = "${stdenv.cc}/bin/ar";
+        patchelf = patchelf;
+        shell = runtimeShell;
+      } ''
+     export dynamicLinker=$(cat $CC/nix-support/dynamic-linker)
+     substitute ${./0001-dynamically-patchelf-binaries.patch} $out \
+       --subst-var patchelf \
+       --subst-var dynamicLinker \
+       --subst-var cc \
+       --subst-var ar \
+       --subst-var shell
+    '')
+  ];
+
+  postInstall = ''
+    pushd $out/bin
+    mv elan-init elan
+    for link in lean leanpkg leanchecker leanc leanmake lake; do
+      ln -s elan $link
+    done
+    popd
+
+    # tries to create .elan
+    export HOME=$(mktemp -d)
+    mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
+    $out/bin/elan completions bash > "$out/share/bash-completion/completions/elan"
+    $out/bin/elan completions fish > "$out/share/fish/vendor_completions.d/elan.fish"
+    $out/bin/elan completions zsh >  "$out/share/zsh/site-functions/_elan"
+  '';
+
+  meta = with lib; {
+    description = "Small tool to manage your installations of the Lean theorem prover";
+    homepage = "https://github.com/leanprover/elan";
+    changelog = "https://github.com/leanprover/elan/blob/v${version}/CHANGELOG.md";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ gebner ];
+    mainProgram = "elan";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/eprover/default.nix b/nixpkgs/pkgs/applications/science/logic/eprover/default.nix
new file mode 100644
index 000000000000..d4a8b7a6b2e8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/eprover/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, which, enableHO ? false }:
+
+stdenv.mkDerivation rec {
+  pname = "eprover";
+  version = "3.0.03";
+
+  src = fetchurl {
+    url = "https://wwwlehre.dhbw-stuttgart.de/~sschulz/WORK/E_DOWNLOAD/V_${version}/E.tgz";
+    hash = "sha256-cS5zUe2N9Kd9uzbNpeBtvLbgUN0c3N3tGcYczK3KsdQ=";
+  };
+
+  buildInputs = [ which ];
+
+  preConfigure = ''
+    sed -e 's/ *CC *= *gcc$//' -i Makefile.vars
+  '';
+  configureFlags = [
+    "--exec-prefix=$(out)"
+    "--man-prefix=$(out)/share/man"
+  ] ++ lib.optionals enableHO [
+    "--enable-ho"
+  ];
+
+  meta = with lib; {
+    description = "Automated theorem prover for full first-order logic with equality";
+    homepage = "http://www.eprover.org/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ raskin gebner ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/fast-downward/default.nix b/nixpkgs/pkgs/applications/science/logic/fast-downward/default.nix
new file mode 100644
index 000000000000..77b538d1cbd8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/fast-downward/default.nix
@@ -0,0 +1,68 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, cmake
+, python3
+, osi
+, cplex
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fast-downward";
+  version = "23.06.0";
+
+  src = fetchFromGitHub {
+    owner = "aibasel";
+    repo = "downward";
+    rev = "release-${version}";
+    sha256 = "sha256-yNaMyS47yxc/p5Rs/kHwD/pgjGXnHBdybYdo1GIEmA4=";
+  };
+
+  nativeBuildInputs = [ cmake python3.pkgs.wrapPython ];
+  buildInputs = [ python3 osi ];
+
+  cmakeFlags = lib.optionals osi.withCplex [ "-DDOWNWARD_CPLEX_ROOT=${cplex}/cplex" ];
+
+  configurePhase = ''
+    python build.py release
+  '';
+
+  postPatch = ''
+    # Needed because the package tries to be too smart.
+    export CC="$(which $CC)"
+    export CXX="$(which $CXX)"
+  '';
+
+  installPhase = ''
+    install -Dm755 builds/release/bin/downward $out/libexec/fast-downward/downward
+    cp -r builds/release/bin/translate $out/libexec/fast-downward/
+    install -Dm755 fast-downward.py $out/bin/fast-downward
+    mkdir -p $out/${python3.sitePackages}
+    cp -r driver $out/${python3.sitePackages}
+
+    wrapPythonProgramsIn $out/bin "$out $pythonPath"
+    wrapPythonProgramsIn $out/libexec/fast-downward/translate "$out $pythonPath"
+    # Because fast-downward calls `python translate.py` we need to return wrapped scripts back.
+    for i in $out/libexec/fast-downward/translate/.*-wrapped; do
+      name="$(basename "$i")"
+      name1="''${name#.}"
+      name2="''${name1%-wrapped}"
+      dir="$(dirname "$i")"
+      dest="$dir/$name2"
+      echo "Moving $i to $dest"
+      mv "$i" "$dest"
+    done
+
+    substituteInPlace $out/${python3.sitePackages}/driver/arguments.py \
+      --replace 'args.build = "release"' "args.build = \"$out/libexec/fast-downward\""
+  '';
+
+  meta = with lib; {
+    description = "A domain-independent planning system";
+    mainProgram = "fast-downward";
+    homepage = "https://www.fast-downward.org/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/formula/default.nix b/nixpkgs/pkgs/applications/science/logic/formula/default.nix
new file mode 100644
index 000000000000..20267e6071c5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/formula/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, buildDotnetModule, dotnetCorePackages, unstableGitUpdater }:
+
+buildDotnetModule rec {
+  pname = "formula-dotnet";
+  version = "2.0";
+
+  src = fetchFromGitHub {
+    owner = "VUISIS";
+    repo = "formula-dotnet";
+    rev = "8ee2e6abfd4ce038e1d9cb9c8602dec1ed6c0163";
+    sha256 = "sha256-2ulv//YV3OqrfFltgUCeDe4rOPC0qqJ+80/D2lIoih8=";
+  };
+
+  nugetDeps = ./nuget.nix;
+  projectFile = "Src/CommandLine/CommandLine.csproj";
+
+  postFixup = if stdenv.isLinux then ''
+    mv $out/bin/CommandLine $out/bin/formula
+  '' else lib.optionalString stdenv.isDarwin ''
+    makeWrapper ${dotnetCorePackages.runtime_6_0}/bin/dotnet $out/bin/formula \
+      --add-flags "$out/lib/formula-dotnet/CommandLine.dll" \
+      --prefix DYLD_LIBRARY_PATH : $out/lib/formula-dotnet/runtimes/macos/native
+  '';
+
+  passthru.updateScript = unstableGitUpdater { url = meta.homepage; };
+
+  meta = with lib; {
+    description = "Formal Specifications for Verification and Synthesis";
+    homepage = "https://github.com/VUISIS/formula-dotnet";
+    license = licenses.mspl;
+    maintainers = with maintainers; [ siraben ];
+    platforms = platforms.unix;
+    mainProgram = "formula";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/formula/nuget.nix b/nixpkgs/pkgs/applications/science/logic/formula/nuget.nix
new file mode 100644
index 000000000000..e3b0fe67446b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/formula/nuget.nix
@@ -0,0 +1,111 @@
+# This file was automatically generated by passthru.fetch-deps.
+# Please dont edit it manually, your changes might get overwritten!
+
+{ fetchNuGet }: [
+  (fetchNuGet { pname = "Antlr4.Runtime.Standard"; version = "4.7.2"; sha256 = "1pmrpsgqjfj0nzr1zqzk1m2fm0ynd4nklwq3dhvww08yjg5s0586"; })
+  (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "1.1.0"; sha256 = "08vh1r12g6ykjygq5d3vq09zylgb84l63k49jc4v8faw9g93iqqm"; })
+  (fetchNuGet { pname = "Microsoft.NETCore.Targets"; version = "1.1.0"; sha256 = "193xwf33fbm0ni3idxzbr5fdq3i2dlfgihsac9jj7whj0gd902nh"; })
+  (fetchNuGet { pname = "Microsoft.Win32.Primitives"; version = "4.3.0"; sha256 = "0j0c1wj4ndj21zsgivsc24whiya605603kxrbiw6wkfdync464wq"; })
+  (fetchNuGet { pname = "Microsoft.Z3.x64"; version = "4.8.7"; sha256 = "1wxlw29xm5x8vwji2s7gwk39wb88dkbpg76l9s9gq0hqpghwlmdz"; })
+  (fetchNuGet { pname = "NETStandard.Library"; version = "1.6.1"; sha256 = "1z70wvsx2d847a2cjfii7b83pjfs34q05gb037fdjikv5kbagml8"; })
+  (fetchNuGet { pname = "runtime.any.System.Collections"; version = "4.3.0"; sha256 = "0bv5qgm6vr47ynxqbnkc7i797fdi8gbjjxii173syrx14nmrkwg0"; })
+  (fetchNuGet { pname = "runtime.any.System.Diagnostics.Tools"; version = "4.3.0"; sha256 = "1wl76vk12zhdh66vmagni66h5xbhgqq7zkdpgw21jhxhvlbcl8pk"; })
+  (fetchNuGet { pname = "runtime.any.System.Diagnostics.Tracing"; version = "4.3.0"; sha256 = "00j6nv2xgmd3bi347k00m7wr542wjlig53rmj28pmw7ddcn97jbn"; })
+  (fetchNuGet { pname = "runtime.any.System.Globalization"; version = "4.3.0"; sha256 = "1daqf33hssad94lamzg01y49xwndy2q97i2lrb7mgn28656qia1x"; })
+  (fetchNuGet { pname = "runtime.any.System.Globalization.Calendars"; version = "4.3.0"; sha256 = "1ghhhk5psqxcg6w88sxkqrc35bxcz27zbqm2y5p5298pv3v7g201"; })
+  (fetchNuGet { pname = "runtime.any.System.IO"; version = "4.3.0"; sha256 = "0l8xz8zn46w4d10bcn3l4yyn4vhb3lrj2zw8llvz7jk14k4zps5x"; })
+  (fetchNuGet { pname = "runtime.any.System.Reflection"; version = "4.3.0"; sha256 = "02c9h3y35pylc0zfq3wcsvc5nqci95nrkq0mszifc0sjx7xrzkly"; })
+  (fetchNuGet { pname = "runtime.any.System.Reflection.Extensions"; version = "4.3.0"; sha256 = "0zyri97dfc5vyaz9ba65hjj1zbcrzaffhsdlpxc9bh09wy22fq33"; })
+  (fetchNuGet { pname = "runtime.any.System.Reflection.Primitives"; version = "4.3.0"; sha256 = "0x1mm8c6iy8rlxm8w9vqw7gb7s1ljadrn049fmf70cyh42vdfhrf"; })
+  (fetchNuGet { pname = "runtime.any.System.Resources.ResourceManager"; version = "4.3.0"; sha256 = "03kickal0iiby82wa5flar18kyv82s9s6d4xhk5h4bi5kfcyfjzl"; })
+  (fetchNuGet { pname = "runtime.any.System.Runtime"; version = "4.3.0"; sha256 = "1cqh1sv3h5j7ixyb7axxbdkqx6cxy00p4np4j91kpm492rf4s25b"; })
+  (fetchNuGet { pname = "runtime.any.System.Runtime.Handles"; version = "4.3.0"; sha256 = "0bh5bi25nk9w9xi8z23ws45q5yia6k7dg3i4axhfqlnj145l011x"; })
+  (fetchNuGet { pname = "runtime.any.System.Runtime.InteropServices"; version = "4.3.0"; sha256 = "0c3g3g3jmhlhw4klrc86ka9fjbl7i59ds1fadsb2l8nqf8z3kb19"; })
+  (fetchNuGet { pname = "runtime.any.System.Text.Encoding"; version = "4.3.0"; sha256 = "0aqqi1v4wx51h51mk956y783wzags13wa7mgqyclacmsmpv02ps3"; })
+  (fetchNuGet { pname = "runtime.any.System.Text.Encoding.Extensions"; version = "4.3.0"; sha256 = "0lqhgqi0i8194ryqq6v2gqx0fb86db2gqknbm0aq31wb378j7ip8"; })
+  (fetchNuGet { pname = "runtime.any.System.Threading.Tasks"; version = "4.3.0"; sha256 = "03mnvkhskbzxddz4hm113zsch1jyzh2cs450dk3rgfjp8crlw1va"; })
+  (fetchNuGet { pname = "runtime.any.System.Threading.Timer"; version = "4.3.0"; sha256 = "0aw4phrhwqz9m61r79vyfl5la64bjxj8l34qnrcwb28v49fg2086"; })
+  (fetchNuGet { pname = "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "16rnxzpk5dpbbl1x354yrlsbvwylrq456xzpsha1n9y3glnhyx9d"; })
+  (fetchNuGet { pname = "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0hkg03sgm2wyq8nqk6dbm9jh5vcq57ry42lkqdmfklrw89lsmr59"; })
+  (fetchNuGet { pname = "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0c2p354hjx58xhhz7wv6div8xpi90sc6ibdm40qin21bvi7ymcaa"; })
+  (fetchNuGet { pname = "runtime.native.System"; version = "4.3.0"; sha256 = "15hgf6zaq9b8br2wi1i3x0zvmk410nlmsmva9p0bbg73v6hml5k4"; })
+  (fetchNuGet { pname = "runtime.native.System.IO.Compression"; version = "4.3.0"; sha256 = "1vvivbqsk6y4hzcid27pqpm5bsi6sc50hvqwbcx8aap5ifrxfs8d"; })
+  (fetchNuGet { pname = "runtime.native.System.Net.Http"; version = "4.3.0"; sha256 = "1n6rgz5132lcibbch1qlf0g9jk60r0kqv087hxc0lisy50zpm7kk"; })
+  (fetchNuGet { pname = "runtime.native.System.Security.Cryptography.Apple"; version = "4.3.0"; sha256 = "1b61p6gw1m02cc1ry996fl49liiwky6181dzr873g9ds92zl326q"; })
+  (fetchNuGet { pname = "runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "18pzfdlwsg2nb1jjjjzyb5qlgy6xjxzmhnfaijq5s2jw3cm3ab97"; })
+  (fetchNuGet { pname = "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0qyynf9nz5i7pc26cwhgi8j62ps27sqmf78ijcfgzab50z9g8ay3"; })
+  (fetchNuGet { pname = "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "1klrs545awhayryma6l7g2pvnp9xy4z0r1i40r80zb45q3i9nbyf"; })
+  (fetchNuGet { pname = "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple"; version = "4.3.0"; sha256 = "10yc8jdrwgcl44b4g93f1ds76b176bajd3zqi2faf5rvh1vy9smi"; })
+  (fetchNuGet { pname = "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0zcxjv5pckplvkg0r6mw3asggm7aqzbdjimhvsasb0cgm59x09l3"; })
+  (fetchNuGet { pname = "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0vhynn79ih7hw7cwjazn87rm9z9fj0rvxgzlab36jybgcpcgphsn"; })
+  (fetchNuGet { pname = "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "160p68l2c7cqmyqjwxydcvgw7lvl1cr0znkw8fp24d1by9mqc8p3"; })
+  (fetchNuGet { pname = "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "15zrc8fgd8zx28hdghcj5f5i34wf3l6bq5177075m2bc2j34jrqy"; })
+  (fetchNuGet { pname = "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "1p4dgxax6p7rlgj4q73k73rslcnz4wdcv8q2flg1s8ygwcm58ld5"; })
+  (fetchNuGet { pname = "runtime.unix.Microsoft.Win32.Primitives"; version = "4.3.0"; sha256 = "0y61k9zbxhdi0glg154v30kkq7f8646nif8lnnxbvkjpakggd5id"; })
+  (fetchNuGet { pname = "runtime.unix.System.Console"; version = "4.3.0"; sha256 = "1pfpkvc6x2if8zbdzg9rnc5fx51yllprl8zkm5npni2k50lisy80"; })
+  (fetchNuGet { pname = "runtime.unix.System.Diagnostics.Debug"; version = "4.3.0"; sha256 = "1lps7fbnw34bnh3lm31gs5c0g0dh7548wfmb8zz62v0zqz71msj5"; })
+  (fetchNuGet { pname = "runtime.unix.System.IO.FileSystem"; version = "4.3.0"; sha256 = "14nbkhvs7sji5r1saj2x8daz82rnf9kx28d3v2qss34qbr32dzix"; })
+  (fetchNuGet { pname = "runtime.unix.System.Net.Primitives"; version = "4.3.0"; sha256 = "0bdnglg59pzx9394sy4ic66kmxhqp8q8bvmykdxcbs5mm0ipwwm4"; })
+  (fetchNuGet { pname = "runtime.unix.System.Net.Sockets"; version = "4.3.0"; sha256 = "03npdxzy8gfv035bv1b9rz7c7hv0rxl5904wjz51if491mw0xy12"; })
+  (fetchNuGet { pname = "runtime.unix.System.Private.Uri"; version = "4.3.0"; sha256 = "1jx02q6kiwlvfksq1q9qr17fj78y5v6mwsszav4qcz9z25d5g6vk"; })
+  (fetchNuGet { pname = "runtime.unix.System.Runtime.Extensions"; version = "4.3.0"; sha256 = "0pnxxmm8whx38dp6yvwgmh22smknxmqs5n513fc7m4wxvs1bvi4p"; })
+  (fetchNuGet { pname = "System.AppContext"; version = "4.3.0"; sha256 = "1649qvy3dar900z3g817h17nl8jp4ka5vcfmsr05kh0fshn7j3ya"; })
+  (fetchNuGet { pname = "System.Buffers"; version = "4.3.0"; sha256 = "0fgns20ispwrfqll4q1zc1waqcmylb3zc50ys9x8zlwxh9pmd9jy"; })
+  (fetchNuGet { pname = "System.Collections"; version = "4.3.0"; sha256 = "19r4y64dqyrq6k4706dnyhhw7fs24kpp3awak7whzss39dakpxk9"; })
+  (fetchNuGet { pname = "System.Collections.Concurrent"; version = "4.3.0"; sha256 = "0wi10md9aq33jrkh2c24wr2n9hrpyamsdhsxdcnf43b7y86kkii8"; })
+  (fetchNuGet { pname = "System.Console"; version = "4.3.0"; sha256 = "1flr7a9x920mr5cjsqmsy9wgnv3lvd0h1g521pdr1lkb2qycy7ay"; })
+  (fetchNuGet { pname = "System.Diagnostics.Debug"; version = "4.3.0"; sha256 = "00yjlf19wjydyr6cfviaph3vsjzg3d5nvnya26i2fvfg53sknh3y"; })
+  (fetchNuGet { pname = "System.Diagnostics.DiagnosticSource"; version = "4.3.0"; sha256 = "0z6m3pbiy0qw6rn3n209rrzf9x1k4002zh90vwcrsym09ipm2liq"; })
+  (fetchNuGet { pname = "System.Diagnostics.Tools"; version = "4.3.0"; sha256 = "0in3pic3s2ddyibi8cvgl102zmvp9r9mchh82ns9f0ms4basylw1"; })
+  (fetchNuGet { pname = "System.Diagnostics.Tracing"; version = "4.3.0"; sha256 = "1m3bx6c2s958qligl67q7grkwfz3w53hpy7nc97mh6f7j5k168c4"; })
+  (fetchNuGet { pname = "System.Globalization"; version = "4.3.0"; sha256 = "1cp68vv683n6ic2zqh2s1fn4c2sd87g5hpp6l4d4nj4536jz98ki"; })
+  (fetchNuGet { pname = "System.Globalization.Calendars"; version = "4.3.0"; sha256 = "1xwl230bkakzzkrggy1l1lxmm3xlhk4bq2pkv790j5lm8g887lxq"; })
+  (fetchNuGet { pname = "System.Globalization.Extensions"; version = "4.3.0"; sha256 = "02a5zfxavhv3jd437bsncbhd2fp1zv4gxzakp1an9l6kdq1mcqls"; })
+  (fetchNuGet { pname = "System.IO"; version = "4.3.0"; sha256 = "05l9qdrzhm4s5dixmx68kxwif4l99ll5gqmh7rqgw554fx0agv5f"; })
+  (fetchNuGet { pname = "System.IO.Compression"; version = "4.3.0"; sha256 = "084zc82yi6yllgda0zkgl2ys48sypiswbiwrv7irb3r0ai1fp4vz"; })
+  (fetchNuGet { pname = "System.IO.Compression.ZipFile"; version = "4.3.0"; sha256 = "1yxy5pq4dnsm9hlkg9ysh5f6bf3fahqqb6p8668ndy5c0lk7w2ar"; })
+  (fetchNuGet { pname = "System.IO.FileSystem"; version = "4.3.0"; sha256 = "0z2dfrbra9i6y16mm9v1v6k47f0fm617vlb7s5iybjjsz6g1ilmw"; })
+  (fetchNuGet { pname = "System.IO.FileSystem.Primitives"; version = "4.3.0"; sha256 = "0j6ndgglcf4brg2lz4wzsh1av1gh8xrzdsn9f0yznskhqn1xzj9c"; })
+  (fetchNuGet { pname = "System.Linq"; version = "4.3.0"; sha256 = "1w0gmba695rbr80l1k2h4mrwzbzsyfl2z4klmpbsvsg5pm4a56s7"; })
+  (fetchNuGet { pname = "System.Linq.Expressions"; version = "4.3.0"; sha256 = "0ky2nrcvh70rqq88m9a5yqabsl4fyd17bpr63iy2mbivjs2nyypv"; })
+  (fetchNuGet { pname = "System.Net.Http"; version = "4.3.0"; sha256 = "1i4gc757xqrzflbk7kc5ksn20kwwfjhw9w7pgdkn19y3cgnl302j"; })
+  (fetchNuGet { pname = "System.Net.NameResolution"; version = "4.3.0"; sha256 = "15r75pwc0rm3vvwsn8rvm2krf929mjfwliv0mpicjnii24470rkq"; })
+  (fetchNuGet { pname = "System.Net.Primitives"; version = "4.3.0"; sha256 = "0c87k50rmdgmxx7df2khd9qj7q35j9rzdmm2572cc55dygmdk3ii"; })
+  (fetchNuGet { pname = "System.Net.Sockets"; version = "4.3.0"; sha256 = "1ssa65k6chcgi6mfmzrznvqaxk8jp0gvl77xhf1hbzakjnpxspla"; })
+  (fetchNuGet { pname = "System.ObjectModel"; version = "4.3.0"; sha256 = "191p63zy5rpqx7dnrb3h7prvgixmk168fhvvkkvhlazncf8r3nc2"; })
+  (fetchNuGet { pname = "System.Private.Uri"; version = "4.3.0"; sha256 = "04r1lkdnsznin0fj4ya1zikxiqr0h6r6a1ww2dsm60gqhdrf0mvx"; })
+  (fetchNuGet { pname = "System.Reflection"; version = "4.3.0"; sha256 = "0xl55k0mw8cd8ra6dxzh974nxif58s3k1rjv1vbd7gjbjr39j11m"; })
+  (fetchNuGet { pname = "System.Reflection.Emit"; version = "4.3.0"; sha256 = "11f8y3qfysfcrscjpjym9msk7lsfxkk4fmz9qq95kn3jd0769f74"; })
+  (fetchNuGet { pname = "System.Reflection.Emit.ILGeneration"; version = "4.3.0"; sha256 = "0w1n67glpv8241vnpz1kl14sy7zlnw414aqwj4hcx5nd86f6994q"; })
+  (fetchNuGet { pname = "System.Reflection.Emit.Lightweight"; version = "4.3.0"; sha256 = "0ql7lcakycrvzgi9kxz1b3lljd990az1x6c4jsiwcacrvimpib5c"; })
+  (fetchNuGet { pname = "System.Reflection.Extensions"; version = "4.3.0"; sha256 = "02bly8bdc98gs22lqsfx9xicblszr2yan7v2mmw3g7hy6miq5hwq"; })
+  (fetchNuGet { pname = "System.Reflection.Primitives"; version = "4.3.0"; sha256 = "04xqa33bld78yv5r93a8n76shvc8wwcdgr1qvvjh959g3rc31276"; })
+  (fetchNuGet { pname = "System.Reflection.TypeExtensions"; version = "4.3.0"; sha256 = "0y2ssg08d817p0vdag98vn238gyrrynjdj4181hdg780sif3ykp1"; })
+  (fetchNuGet { pname = "System.Resources.ResourceManager"; version = "4.3.0"; sha256 = "0sjqlzsryb0mg4y4xzf35xi523s4is4hz9q4qgdvlvgivl7qxn49"; })
+  (fetchNuGet { pname = "System.Runtime"; version = "4.3.0"; sha256 = "066ixvgbf2c929kgknshcxqj6539ax7b9m570cp8n179cpfkapz7"; })
+  (fetchNuGet { pname = "System.Runtime.Extensions"; version = "4.3.0"; sha256 = "1ykp3dnhwvm48nap8q23893hagf665k0kn3cbgsqpwzbijdcgc60"; })
+  (fetchNuGet { pname = "System.Runtime.Handles"; version = "4.3.0"; sha256 = "0sw2gfj2xr7sw9qjn0j3l9yw07x73lcs97p8xfc9w1x9h5g5m7i8"; })
+  (fetchNuGet { pname = "System.Runtime.InteropServices"; version = "4.3.0"; sha256 = "00hywrn4g7hva1b2qri2s6rabzwgxnbpw9zfxmz28z09cpwwgh7j"; })
+  (fetchNuGet { pname = "System.Runtime.InteropServices.RuntimeInformation"; version = "4.3.0"; sha256 = "0q18r1sh4vn7bvqgd6dmqlw5v28flbpj349mkdish2vjyvmnb2ii"; })
+  (fetchNuGet { pname = "System.Runtime.Numerics"; version = "4.3.0"; sha256 = "19rav39sr5dky7afygh309qamqqmi9kcwvz3i0c5700v0c5cg61z"; })
+  (fetchNuGet { pname = "System.Security.Claims"; version = "4.3.0"; sha256 = "0jvfn7j22l3mm28qjy3rcw287y9h65ha4m940waaxah07jnbzrhn"; })
+  (fetchNuGet { pname = "System.Security.Cryptography.Algorithms"; version = "4.3.0"; sha256 = "03sq183pfl5kp7gkvq77myv7kbpdnq3y0xj7vi4q1kaw54sny0ml"; })
+  (fetchNuGet { pname = "System.Security.Cryptography.Cng"; version = "4.3.0"; sha256 = "1k468aswafdgf56ab6yrn7649kfqx2wm9aslywjam1hdmk5yypmv"; })
+  (fetchNuGet { pname = "System.Security.Cryptography.Csp"; version = "4.3.0"; sha256 = "1x5wcrddf2s3hb8j78cry7yalca4lb5vfnkrysagbn6r9x6xvrx1"; })
+  (fetchNuGet { pname = "System.Security.Cryptography.Encoding"; version = "4.3.0"; sha256 = "1jr6w70igqn07k5zs1ph6xja97hxnb3mqbspdrff6cvssgrixs32"; })
+  (fetchNuGet { pname = "System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0givpvvj8yc7gv4lhb6s1prq6p2c4147204a0wib89inqzd87gqc"; })
+  (fetchNuGet { pname = "System.Security.Cryptography.Primitives"; version = "4.3.0"; sha256 = "0pyzncsv48zwly3lw4f2dayqswcfvdwq2nz0dgwmi7fj3pn64wby"; })
+  (fetchNuGet { pname = "System.Security.Cryptography.X509Certificates"; version = "4.3.0"; sha256 = "0valjcz5wksbvijylxijjxb1mp38mdhv03r533vnx1q3ikzdav9h"; })
+  (fetchNuGet { pname = "System.Security.Principal"; version = "4.3.0"; sha256 = "12cm2zws06z4lfc4dn31iqv7072zyi4m910d4r6wm8yx85arsfxf"; })
+  (fetchNuGet { pname = "System.Security.Principal.Windows"; version = "4.3.0"; sha256 = "00a0a7c40i3v4cb20s2cmh9csb5jv2l0frvnlzyfxh848xalpdwr"; })
+  (fetchNuGet { pname = "System.Text.Encoding"; version = "4.3.0"; sha256 = "1f04lkir4iladpp51sdgmis9dj4y8v08cka0mbmsy0frc9a4gjqr"; })
+  (fetchNuGet { pname = "System.Text.Encoding.Extensions"; version = "4.3.0"; sha256 = "11q1y8hh5hrp5a3kw25cb6l00v5l5dvirkz8jr3sq00h1xgcgrxy"; })
+  (fetchNuGet { pname = "System.Text.RegularExpressions"; version = "4.3.0"; sha256 = "1bgq51k7fwld0njylfn7qc5fmwrk2137gdq7djqdsw347paa9c2l"; })
+  (fetchNuGet { pname = "System.Threading"; version = "4.3.0"; sha256 = "0rw9wfamvhayp5zh3j7p1yfmx9b5khbf4q50d8k5rk993rskfd34"; })
+  (fetchNuGet { pname = "System.Threading.Tasks"; version = "4.3.0"; sha256 = "134z3v9abw3a6jsw17xl3f6hqjpak5l682k2vz39spj4kmydg6k7"; })
+  (fetchNuGet { pname = "System.Threading.Tasks.Extensions"; version = "4.3.0"; sha256 = "1xxcx2xh8jin360yjwm4x4cf5y3a2bwpn2ygkfkwkicz7zk50s2z"; })
+  (fetchNuGet { pname = "System.Threading.ThreadPool"; version = "4.3.0"; sha256 = "027s1f4sbx0y1xqw2irqn6x161lzj8qwvnh2gn78ciiczdv10vf1"; })
+  (fetchNuGet { pname = "System.Threading.Timer"; version = "4.3.0"; sha256 = "1nx773nsx6z5whv8kaa1wjh037id2f1cxhb69pvgv12hd2b6qs56"; })
+  (fetchNuGet { pname = "System.Xml.ReaderWriter"; version = "4.3.0"; sha256 = "0c47yllxifzmh8gq6rq6l36zzvw4kjvlszkqa9wq3fr59n0hl3s1"; })
+  (fetchNuGet { pname = "System.Xml.XDocument"; version = "4.3.0"; sha256 = "08h8fm4l77n0nd4i4fk2386y809bfbwqb7ih9d7564ifcxr5ssxd"; })
+]
diff --git a/nixpkgs/pkgs/applications/science/logic/gappa/default.nix b/nixpkgs/pkgs/applications/science/logic/gappa/default.nix
new file mode 100644
index 000000000000..2eb8567aaa4c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/gappa/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, gmp, mpfr, boost }:
+
+stdenv.mkDerivation rec {
+  pname = "gappa";
+  version = "1.4.0";
+
+  src = fetchurl {
+    url = "https://gforge.inria.fr/frs/download.php/file/38436/gappa-${version}.tar.gz";
+    sha256 = "12x42z901pr05ldmparqdi8sq9s7fxbavhzk2dbq3l6hy247dwbb";
+  };
+
+  buildInputs = [ gmp mpfr boost.dev ];
+
+  buildPhase = "./remake";
+  installPhase = "./remake install";
+
+  meta = {
+    homepage = "http://gappa.gforge.inria.fr/";
+    description = "Verifying and formally proving properties on numerical programs dealing with floating-point or fixed-point arithmetic";
+    mainProgram = "gappa";
+    license = with lib.licenses; [ cecill20 gpl2 ];
+    maintainers = with lib.maintainers; [ vbgl ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/glucose/default.nix b/nixpkgs/pkgs/applications/science/logic/glucose/default.nix
new file mode 100644
index 000000000000..a2392ef39861
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/glucose/default.nix
@@ -0,0 +1,49 @@
+{ lib
+, stdenv
+, fetchurl
+, unzip
+, zlib
+, enableUnfree ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "glucose" + lib.optionalString enableUnfree "-syrup";
+  version = "4.2.1";
+
+  src = fetchurl {
+    url = "https://www.labri.fr/perso/lsimon/downloads/softwares/glucose-${version}.zip";
+    hash = "sha256-J0J9EKC/4cCiZr/y4lz+Hm7OcmJmMIIWzQ+4c+KhqXg=";
+  };
+
+  sourceRoot = "glucose-${version}/sources/${if enableUnfree then "parallel" else "simp"}";
+
+  postPatch = ''
+    substituteInPlace Main.cc \
+      --replace "defined(__linux__)" "defined(__linux__) && defined(__x86_64__)"
+  '';
+
+  nativeBuildInputs = [ unzip ];
+
+  buildInputs = [ zlib ];
+
+  makeFlags = [ "r" ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm0755 ${pname}_release $out/bin/${pname}
+    mkdir -p "$out/share/doc/${pname}-${version}/"
+    install -Dm0755 ../{LICEN?E,README*,Changelog*} "$out/share/doc/${pname}-${version}/"
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Modern, parallel SAT solver (${if enableUnfree then "parallel" else "sequential"} version)";
+    mainProgram = "glucose";
+    homepage = "https://www.labri.fr/perso/lsimon/research/glucose/";
+    license = if enableUnfree then licenses.unfreeRedistributable else licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ gebner ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/hol/default.nix b/nixpkgs/pkgs/applications/science/logic/hol/default.nix
new file mode 100644
index 000000000000..de47df098da1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/hol/default.nix
@@ -0,0 +1,88 @@
+{lib, stdenv, pkgs, fetchurl, graphviz, fontconfig, liberation_ttf,
+ experimentalKernel ? true}:
+
+let
+  pname = "hol4";
+  vnum = "14";
+in
+
+let
+  version = "k.${vnum}";
+  longVersion = "kananaskis-${vnum}";
+  holsubdir = "hol-${longVersion}";
+  kernelFlag = if experimentalKernel then "--expk" else "--stdknl";
+in
+
+let
+  polymlEnableShared = with pkgs; lib.overrideDerivation polyml (attrs: {
+    configureFlags = [ "--enable-shared" ];
+  });
+in
+
+stdenv.mkDerivation {
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/hol/hol/${longVersion}/${holsubdir}.tar.gz";
+    sha256 = "6Mc/qsEjzxGqzt6yP6x/1Tmqpwc1UDGlwV1Gl+4pMsY=";
+  };
+
+  buildInputs = [polymlEnableShared graphviz fontconfig liberation_ttf];
+
+  buildCommand = ''
+
+    mkdir chroot-fontconfig
+    cat ${fontconfig.out}/etc/fonts/fonts.conf > chroot-fontconfig/fonts.conf
+    sed -e 's@</fontconfig>@@' -i chroot-fontconfig/fonts.conf
+    echo "<dir>${liberation_ttf}</dir>" >> chroot-fontconfig/fonts.conf
+    echo "</fontconfig>" >> chroot-fontconfig/fonts.conf
+
+    export FONTCONFIG_FILE=$(pwd)/chroot-fontconfig/fonts.conf
+
+    mkdir -p "$out/src"
+    cd  "$out/src"
+
+    tar -xzf "$src"
+    cd ${holsubdir}
+
+    substituteInPlace tools/Holmake/Holmake_types.sml \
+      --replace "\"/bin/" "\"" \
+
+
+    for f in tools/buildutils.sml help/src-sml/DOT;
+    do
+      substituteInPlace $f --replace "\"/usr/bin/dot\"" "\"${graphviz}/bin/dot\""
+    done
+
+    #sed -ie "/compute/,999 d" tools/build-sequence # for testing
+
+    poly < tools/smart-configure.sml
+
+    bin/build ${kernelFlag}
+
+    mkdir -p "$out/bin"
+    ln -st $out/bin  $out/src/${holsubdir}/bin/*
+    # ln -s $out/src/hol4.${version}/bin $out/bin
+  '';
+
+  meta = with lib; {
+    broken = (stdenv.isLinux && stdenv.isAarch64);
+    description = "Interactive theorem prover based on Higher-Order Logic";
+    longDescription = ''
+      HOL4 is the latest version of the HOL interactive proof
+      assistant for higher order logic: a programming environment in
+      which theorems can be proved and proof tools
+      implemented. Built-in decision procedures and theorem provers
+      can automatically establish many simple theorems (users may have
+      to prove the hard theorems themselves!) An oracle mechanism
+      gives access to external programs such as SMT and BDD
+      engines. HOL4 is particularly suitable as a platform for
+      implementing combinations of deduction, execution and property
+      checking.
+    '';
+    homepage = "http://hol.sourceforge.net/";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ mudri ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/hol_light/default.nix b/nixpkgs/pkgs/applications/science/logic/hol_light/default.nix
new file mode 100644
index 000000000000..813397ba01f9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/hol_light/default.nix
@@ -0,0 +1,65 @@
+{ lib, stdenv, runtimeShell, fetchFromGitHub, fetchpatch, ocaml, findlib, num, camlp5, camlp-streams }:
+
+let
+  load_num =
+    lib.optionalString (num != null) ''
+      -I ${num}/lib/ocaml/${ocaml.version}/site-lib/num \
+      -I ${num}/lib/ocaml/${ocaml.version}/site-lib/top-num \
+      -I ${num}/lib/ocaml/${ocaml.version}/site-lib/stublibs \
+    '';
+
+  start_script =
+    ''
+      #!${runtimeShell}
+      cd $out/lib/hol_light
+      export OCAMLPATH="''${OCAMLPATH-}''${OCAMLPATH:+:}${camlp5}/lib/ocaml/${ocaml.version}/site-lib/"
+      exec ${ocaml}/bin/ocaml \
+        -I \`${camlp5}/bin/camlp5 -where\` \
+        ${load_num} \
+        -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/ \
+        -I ${camlp-streams}/lib/ocaml/${ocaml.version}/site-lib/camlp-streams camlp_streams.cma \
+        -init make.ml
+    '';
+in
+
+lib.throwIf (lib.versionAtLeast ocaml.version "5.0")
+  "hol_light is not available for OCaml ${ocaml.version}"
+
+stdenv.mkDerivation {
+  pname = "hol_light";
+  version = "unstable-2023-11-03";
+
+  src = fetchFromGitHub {
+    owner = "jrh13";
+    repo = "hol-light";
+    rev = "dcd765c6032f52a0c0bf21fce5da4794a823e880";
+    hash = "sha256-k2RBNDo4tc3eobKB84Y2xr0UQJvef0hv6jyFCaDCQFM=";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://salsa.debian.org/ocaml-team/hol-light/-/raw/master/debian/patches/0004-Fix-compilation-with-camlp5-7.11.patch";
+      sha256 = "180qmxbrk3vb1ix7j77hcs8vsar91rs11s5mm8ir5352rz7ylicr";
+    })
+  ];
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml findlib camlp5 ];
+  propagatedBuildInputs = [ camlp-streams num ];
+
+  installPhase = ''
+    mkdir -p "$out/lib/hol_light" "$out/bin"
+    cp -a  . $out/lib/hol_light
+    echo "${start_script}" > "$out/bin/hol_light"
+    chmod a+x "$out/bin/hol_light"
+  '';
+
+  meta = with lib; {
+    description = "Interactive theorem prover based on Higher-Order Logic";
+    homepage = "http://www.cl.cam.ac.uk/~jrh13/hol-light/";
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ thoughtpolice maggesi vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/iprover/default.nix b/nixpkgs/pkgs/applications/science/logic/iprover/default.nix
new file mode 100644
index 000000000000..77e5919c0eee
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/iprover/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchFromGitLab, ocamlPackages, eprover, z3, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "iprover";
+  version = "3.8.1";
+
+  src = fetchFromGitLab {
+    owner = "korovin";
+    repo = pname;
+    rev = "f61edb113b705606c7314dc4dce0687832c3169f";
+    hash = "sha256-XXqbEoYKjoktE3ZBEIEFjLhA1B75zhnfPszhe8SvbI8=";
+  };
+
+  postPatch = ''
+    substituteInPlace configure --replace Linux Debian
+  '';
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ eprover ] ++ (with ocamlPackages; [
+    ocaml findlib
+  ]);
+  buildInputs = [ zlib ocamlPackages.z3 z3 ] ++ (with ocamlPackages; [
+    ocamlgraph yojson zarith
+  ]);
+
+  preConfigure = "patchShebangs .";
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p "$out/bin"
+    cp iproveropt "$out/bin"
+
+    echo -e "#! ${stdenv.shell}\\n$out/bin/iproveropt --clausifier \"${eprover}/bin/eprover\" --clausifier_options \" --tstp-format --silent --cnf \" \"\$@\"" > "$out"/bin/iprover
+    chmod a+x  "$out"/bin/iprover
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "An automated first-order logic theorem prover";
+    homepage = "http://www.cs.man.ac.uk/~korovink/iprover/";
+    maintainers = with maintainers; [ raskin gebner ];
+    platforms = platforms.linux;
+    license = licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/isabelle/components/default.nix b/nixpkgs/pkgs/applications/science/logic/isabelle/components/default.nix
new file mode 100644
index 000000000000..dd7b605f56af
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/isabelle/components/default.nix
@@ -0,0 +1,5 @@
+{ callPackage }:
+
+{
+  isabelle-linter = callPackage ./isabelle-linter.nix {};
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/isabelle/components/isabelle-linter.nix b/nixpkgs/pkgs/applications/science/logic/isabelle/components/isabelle-linter.nix
new file mode 100644
index 000000000000..d9b8dd5cf28f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/isabelle/components/isabelle-linter.nix
@@ -0,0 +1,35 @@
+{ stdenv, lib, fetchFromGitHub, isabelle }:
+
+stdenv.mkDerivation rec {
+  pname = "isabelle-linter";
+  version = "2023-1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "isabelle-prover";
+    repo = "isabelle-linter";
+    rev = "Isabelle2023-v1.0.0";
+    sha256 = "sha256-q9+qN94NaTzvhbcNQj7yH/VVfs1QgCH8OU8HW+5+s9U=";
+  };
+
+  nativeBuildInputs = [ isabelle ];
+
+  buildPhase = ''
+    export HOME=$TMP
+    isabelle components -u $(pwd)
+    isabelle scala_build
+  '';
+
+  installPhase = ''
+    dir=$out/Isabelle${isabelle.version}/contrib/${pname}-${version}
+    mkdir -p $dir
+    cp -r * $dir/
+  '';
+
+  meta = with lib; {
+    description = "Linter component for Isabelle.";
+    homepage = "https://github.com/isabelle-prover/isabelle-linter";
+    maintainers = with maintainers; [ jvanbruegge ];
+    license = licenses.mit;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/isabelle/default.nix b/nixpkgs/pkgs/applications/science/logic/isabelle/default.nix
new file mode 100644
index 000000000000..edc4483bcfa9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/isabelle/default.nix
@@ -0,0 +1,251 @@
+{ lib
+, stdenv
+, fetchurl
+, coreutils
+, nettools
+, java
+, scala_3
+, polyml
+, veriT
+, vampire
+, eprover-ho
+, naproche
+, rlwrap
+, perl
+, makeDesktopItem
+, isabelle-components
+, symlinkJoin
+, fetchhg
+}:
+
+let
+  sha1 = stdenv.mkDerivation {
+    pname = "isabelle-sha1";
+    version = "2021-1";
+
+    src = fetchhg {
+      url = "https://isabelle.sketis.net/repos/sha1";
+      rev = "e0239faa6f42";
+      sha256 = "sha256-4sxHzU/ixMAkSo67FiE6/ZqWJq9Nb9OMNhMoXH2bEy4=";
+    };
+
+    buildPhase = (if stdenv.isDarwin then ''
+      LDFLAGS="-dynamic -undefined dynamic_lookup -lSystem"
+    '' else ''
+      LDFLAGS="-fPIC -shared"
+    '') + ''
+      CFLAGS="-fPIC -I."
+      $CC $CFLAGS -c sha1.c -o sha1.o
+      $LD $LDFLAGS sha1.o -o libsha1.so
+    '';
+
+    installPhase = ''
+      mkdir -p $out/lib
+      cp libsha1.so $out/lib/
+    '';
+  };
+in stdenv.mkDerivation (finalAttrs: rec {
+  pname = "isabelle";
+  version = "2023";
+
+  dirname = "Isabelle${version}";
+
+  src =
+    if stdenv.isDarwin
+    then
+      fetchurl
+        {
+          url = "https://isabelle.in.tum.de/website-${dirname}/dist/${dirname}_macos.tar.gz";
+          sha256 = "sha256-0VSW2SrHNI3/k4cCCZ724ruXaq7W1NCPsLrXFZ9l1/Q=";
+        }
+    else if stdenv.hostPlatform.isx86
+    then
+      fetchurl {
+        url = "https://isabelle.in.tum.de/website-${dirname}/dist/${dirname}_linux.tar.gz";
+        sha256 = "sha256-Go4ZCsDz5gJ7uWG5VLrNJOddMPX18G99FAadpX53Rqg=";
+      }
+    else
+      fetchurl {
+        url = "https://isabelle.in.tum.de/website-${dirname}/dist/${dirname}_linux_arm.tar.gz";
+        hash = "sha256-Tzxxs0gKw6vymbaXIzH8tK5VgUrpOIp9vcWQ/zxnRCc=";
+      };
+
+  nativeBuildInputs = [ java ];
+
+  buildInputs = [ polyml veriT vampire eprover-ho nettools ]
+    ++ lib.optionals (!stdenv.isDarwin) [ java ];
+
+  sourceRoot = "${dirname}${lib.optionalString stdenv.isDarwin ".app"}";
+
+  doCheck = stdenv.hostPlatform.system != "aarch64-linux";
+  checkPhase = "bin/isabelle build -v HOL-SMT_Examples";
+
+  postUnpack = lib.optionalString stdenv.isDarwin ''
+    mv $sourceRoot ${dirname}
+    sourceRoot=${dirname}
+  '';
+
+  postPatch = ''
+    patchShebangs lib/Tools/ bin/
+
+    cat >contrib/verit-*/etc/settings <<EOF
+      ISABELLE_VERIT=${veriT}/bin/veriT
+    EOF
+
+    cat >contrib/e-*/etc/settings <<EOF
+      E_HOME=${eprover-ho}/bin
+      E_VERSION=${eprover-ho.version}
+    EOF
+
+    cat >contrib/vampire-*/etc/settings <<EOF
+      VAMPIRE_HOME=${vampire}/bin
+      VAMPIRE_VERSION=${vampire.version}
+      VAMPIRE_EXTRA_OPTIONS="--mode casc"
+    EOF
+
+    cat >contrib/polyml-*/etc/settings <<EOF
+      ML_SYSTEM_64=true
+      ML_SYSTEM=${polyml.name}
+      ML_PLATFORM=${stdenv.system}
+      ML_HOME=${polyml}/bin
+      ML_OPTIONS="--minheap 1000"
+      POLYML_HOME="\$COMPONENT"
+      ML_SOURCES="\$POLYML_HOME/src"
+    EOF
+
+    cat >contrib/jdk*/etc/settings <<EOF
+      ISABELLE_JAVA_PLATFORM=${stdenv.system}
+      ISABELLE_JDK_HOME=${java}
+    EOF
+
+  '' + lib.optionalString stdenv.hostPlatform.isx86 ''
+    rm contrib/naproche-*/x86*/Naproche-SAD
+    ln -s ${naproche}/bin/Naproche-SAD contrib/naproche-*/x86*/
+  '' + ''
+
+    echo ISABELLE_LINE_EDITOR=${rlwrap}/bin/rlwrap >>etc/settings
+
+    for comp in contrib/jdk* contrib/polyml-* contrib/verit-* contrib/vampire-* contrib/e-*; do
+      rm -rf $comp/${if stdenv.hostPlatform.isx86 then "x86" else "arm"}*
+    done
+
+    substituteInPlace lib/Tools/env \
+      --replace /usr/bin/env ${coreutils}/bin/env
+
+    substituteInPlace src/Tools/Setup/src/Environment.java \
+      --replace 'cmd.add("/usr/bin/env");' "" \
+      --replace 'cmd.add("bash");' "cmd.add(\"$SHELL\");"
+
+    substituteInPlace src/Pure/General/sha1.ML \
+      --replace '"$ML_HOME/" ^ (if ML_System.platform_is_windows then "sha1.dll" else "libsha1.so")' '"${sha1}/lib/libsha1.so"'
+
+    rm -r heaps
+  '' + lib.optionalString (stdenv.hostPlatform.system == "x86_64-darwin") ''
+    substituteInPlace lib/scripts/isabelle-platform \
+      --replace 'ISABELLE_APPLE_PLATFORM64=arm64-darwin' ""
+  '' + lib.optionalString stdenv.isLinux ''
+    arch=${if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64-linux"
+           else if stdenv.hostPlatform.isx86 then "x86-linux"
+           else "arm64-linux"}
+    for f in contrib/*/$arch/{z3,epclextract,nunchaku,SPASS,zipperposition}; do
+      patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f"${lib.optionalString stdenv.isAarch64 " || true"}
+    done
+    patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) contrib/bash_process-*/platform_$arch/bash_process
+    for d in contrib/kodkodi-*/jni/$arch; do
+      patchelf --set-rpath "${lib.concatStringsSep ":" [ "${java}/lib/openjdk/lib/server" "${stdenv.cc.cc.lib}/lib" ]}" $d/*.so
+    done
+    patchelf --set-rpath "${stdenv.cc.cc.lib}/lib" contrib/z3-*/$arch/z3
+  '';
+
+  buildPhase = ''
+    export HOME=$TMP # The build fails if home is not set
+    setup_name=$(basename contrib/isabelle_setup*)
+
+    #The following is adapted from https://isabelle.sketis.net/repos/isabelle/file/Isabelle2021-1/Admin/lib/Tools/build_setup
+    TARGET_DIR="contrib/$setup_name/lib"
+    rm -rf "$TARGET_DIR"
+    mkdir -p "$TARGET_DIR/isabelle/setup"
+    declare -a ARGS=("-Xlint:unchecked")
+
+    SOURCES="$(${perl}/bin/perl -e 'while (<>) { if (m/(\S+\.java)/)  { print "$1 "; } }' "src/Tools/Setup/etc/build.props")"
+    for SRC in $SOURCES
+    do
+      ARGS["''${#ARGS[@]}"]="src/Tools/Setup/$SRC"
+    done
+    echo "Building isabelle setup"
+    javac -d "$TARGET_DIR" -classpath "${scala_3.bare}/lib/scala3-interfaces-${scala_3.version}.jar:${scala_3.bare}/lib/scala3-compiler_3-${scala_3.version}.jar" "''${ARGS[@]}"
+    jar -c -f "$TARGET_DIR/isabelle_setup.jar" -e "isabelle.setup.Setup" -C "$TARGET_DIR" isabelle
+    rm -rf "$TARGET_DIR/isabelle"
+
+    echo "Building HOL heap"
+    bin/isabelle build -v -o system_heaps -b HOL
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mv $TMP/$dirname $out
+    cd $out/$dirname
+    bin/isabelle install $out/bin
+
+    # icon
+    mkdir -p "$out/share/icons/hicolor/isabelle/apps"
+    cp "$out/Isabelle${version}/lib/icons/isabelle.xpm" "$out/share/icons/hicolor/isabelle/apps/"
+
+    # desktop item
+    mkdir -p "$out/share"
+    cp -r "${desktopItem}/share/applications" "$out/share/applications"
+  '';
+
+  desktopItem = makeDesktopItem {
+    name = "isabelle";
+    exec = "isabelle jedit";
+    icon = "isabelle";
+    desktopName = "Isabelle";
+    comment = meta.description;
+    categories = [ "Education" "Science" "Math" ];
+  };
+
+  meta = with lib; {
+    description = "A generic proof assistant";
+
+    longDescription = ''
+      Isabelle is a generic proof assistant.  It allows mathematical formulas
+      to be expressed in a formal language and provides tools for proving those
+      formulas in a logical calculus.
+    '';
+    homepage = "https://isabelle.in.tum.de/";
+    sourceProvenance = with sourceTypes; [
+      fromSource
+      binaryNativeCode  # source bundles binary dependencies
+    ];
+    license = licenses.bsd3;
+    maintainers = [ maintainers.jwiegley maintainers.jvanbruegge ];
+    platforms = platforms.unix;
+  };
+
+  passthru.withComponents = f:
+    let
+      isabelle = finalAttrs.finalPackage;
+      base = "$out/${isabelle.dirname}";
+      components = f isabelle-components;
+    in symlinkJoin {
+      name = "isabelle-with-components-${isabelle.version}";
+      paths = [ isabelle ] ++ (builtins.map (c: c.override { inherit isabelle; }) components);
+
+      postBuild = ''
+        rm $out/bin/*
+
+        cd ${base}
+        rm bin/*
+        cp ${isabelle}/${isabelle.dirname}/bin/* bin/
+        rm etc/components
+        cat ${isabelle}/${isabelle.dirname}/etc/components > etc/components
+
+        export HOME=$TMP
+        bin/isabelle install $out/bin
+        patchShebangs $out/bin
+      '' + lib.concatMapStringsSep "\n" (c: ''
+        echo contrib/${c.pname}-${c.version} >> ${base}/etc/components
+      '') components;
+    };
+})
diff --git a/nixpkgs/pkgs/applications/science/logic/key/default.nix b/nixpkgs/pkgs/applications/science/logic/key/default.nix
new file mode 100644
index 000000000000..5a48abfc4aa4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/key/default.nix
@@ -0,0 +1,121 @@
+{ lib, stdenv
+, fetchurl
+, jdk
+, gradle_7
+, perl
+, jre
+, makeWrapper
+, makeDesktopItem
+, copyDesktopItems
+, testers
+, key
+}:
+
+let
+  pname = "key";
+  version = "2.10.0";
+  src = fetchurl {
+    url = "https://www.key-project.org/dist/${version}/key-${version}-sources.tgz";
+    sha256 = "1f201cbcflqd1z6ysrkh3mff5agspw3v74ybdc3s2lfdyz3b858w";
+  };
+  sourceRoot = "key-${version}/key";
+
+  # fake build to pre-download deps into fixed-output derivation
+  deps = stdenv.mkDerivation {
+    pname = "${pname}-deps";
+    inherit version src sourceRoot;
+    nativeBuildInputs = [ gradle_7 perl ];
+    buildPhase = ''
+      export GRADLE_USER_HOME=$(mktemp -d)
+      # https://github.com/gradle/gradle/issues/4426
+      ${lib.optionalString stdenv.isDarwin "export TERM=dumb"}
+      gradle --no-daemon classes testClasses
+    '';
+    # perl code mavenizes pathes (com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar -> com/squareup/okio/okio/1.13.0/okio-1.13.0.jar)
+    installPhase = ''
+      find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \
+        | perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \
+        | sh
+    '';
+    outputHashMode = "recursive";
+    outputHashAlgo = "sha256";
+    outputHash = "sha256-GjBUwJxeyJA6vGrPQVtNpcHb4CJlNlY4kHt1PT21xjo=";
+  };
+in stdenv.mkDerivation rec {
+  inherit pname version src sourceRoot;
+
+  nativeBuildInputs = [
+    jdk
+    gradle_7
+    makeWrapper
+    copyDesktopItems
+  ];
+
+  executable-name = "KeY";
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = "KeY";
+      exec = executable-name;
+      icon = "key";
+      comment = meta.description;
+      desktopName = "KeY";
+      genericName = "KeY";
+      categories = [ "Science" ];
+    })
+  ];
+
+  # disable tests (broken on darwin)
+  gradleAction = if stdenv.isDarwin then "assemble" else "build";
+
+  buildPhase = ''
+    runHook preBuild
+
+    export GRADLE_USER_HOME=$(mktemp -d)
+    # https://github.com/gradle/gradle/issues/4426
+    ${lib.optionalString stdenv.isDarwin "export TERM=dumb"}
+    # point to offline repo
+    sed -ie "s#repositories {#repositories { maven { url '${deps}' }#g" build.gradle
+    cat <(echo "pluginManagement { repositories { maven { url '${deps}' } } }") settings.gradle > settings_new.gradle
+    mv settings_new.gradle settings.gradle
+    gradle --offline --no-daemon ${gradleAction}
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/share/java
+    cp key.ui/build/libs/key-*-exe.jar $out/share/java/KeY.jar
+    mkdir -p $out/bin
+    mkdir -p $out/share/icons/hicolor/256x256/apps
+    cp key.ui/src/main/resources/de/uka/ilkd/key/gui/images/key-color-icon-square.png $out/share/icons/hicolor/256x256/apps/key.png
+    makeWrapper ${jre}/bin/java $out/bin/KeY \
+      --add-flags "-cp $out/share/java/KeY.jar de.uka.ilkd.key.core.Main"
+
+    runHook postInstall
+  '';
+
+  passthru.tests.version =
+    testers.testVersion {
+      package = key;
+      command = "KeY --help";
+    };
+
+  meta = with lib; {
+    description = "Java formal verification tool";
+    homepage = "https://www.key-project.org"; # also https://formal.iti.kit.edu/key/
+    longDescription = ''
+      The KeY System is a formal software development tool that aims to
+      integrate design, implementation, formal specification, and formal
+      verification of object-oriented software as seamlessly as possible.
+      At the core of the system is a novel theorem prover for the first-order
+      Dynamic Logic for Java with a user-friendly graphical interface.
+    '';
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ fgaz ];
+    mainProgram = executable-name;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/kissat/default.nix b/nixpkgs/pkgs/applications/science/logic/kissat/default.nix
new file mode 100644
index 000000000000..65bcebdc6b1a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/kissat/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv, fetchFromGitHub
+, drat-trim, p7zip
+}:
+
+stdenv.mkDerivation rec {
+  pname = "kissat";
+  version = "3.1.1";
+
+  src = fetchFromGitHub {
+    owner = "arminbiere";
+    repo = "kissat";
+    rev = "rel-${version}";
+    sha256 = "sha256-zK20/vhbVihrxmd52DjByDUO99pBAr8SlJtQpX5fmwY=";
+  };
+
+  outputs = [ "out" "dev" "lib" ];
+
+  nativeCheckInputs = [ drat-trim p7zip ];
+  doCheck = true;
+
+  # 'make test' assumes that /etc/passwd is not writable.
+  patches = [ ./writable-passwd-is-ok.patch ];
+
+  # the configure script is not generated by autotools and does not accept the
+  # arguments that the default configurePhase passes like --prefix and --libdir
+  dontAddPrefix = true;
+  setOutputFlags = false;
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm0755 build/kissat "$out/bin/kissat"
+    install -Dm0644 src/kissat.h "$dev/include/kissat.h"
+    install -Dm0644 build/libkissat.a "$lib/lib/libkissat.a"
+    mkdir -p "$out/share/doc/kissat/"
+    install -Dm0644 {LICEN?E,README*,VERSION} "$out/share/doc/kissat/"
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "A 'keep it simple and clean bare metal SAT solver' written in C";
+    mainProgram = "kissat";
+    longDescription = ''
+      Kissat is a "keep it simple and clean bare metal SAT solver" written in C.
+      It is a port of CaDiCaL back to C with improved data structures,
+      better scheduling of inprocessing and optimized algorithms and implementation.
+    '';
+    maintainers = with maintainers; [ shnarazk ];
+    platforms = platforms.unix;
+    license = licenses.mit;
+    homepage = "https://fmv.jku.at/kissat";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/kissat/writable-passwd-is-ok.patch b/nixpkgs/pkgs/applications/science/logic/kissat/writable-passwd-is-ok.patch
new file mode 100644
index 000000000000..f2cca54e1d36
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/kissat/writable-passwd-is-ok.patch
@@ -0,0 +1,13 @@
+diff --git a/test/testfile.c b/test/testfile.c
+index cb311d5..0726244 100644
+--- a/test/testfile.c
++++ b/test/testfile.c
+@@ -92,8 +92,6 @@ do { \
+   WRITABLE (true, "../test/file/non-existing");
+   WRITABLE (false, "/kissat-test-file-writable");
+   WRITABLE (false, "non-existing-directory/file-in-non-existing-directory");
+-  if (kissat_file_exists ("/etc/passwd"))
+-    WRITABLE (false, "/etc/passwd");
+ #undef WRITABLE
+ }
+ 
diff --git a/nixpkgs/pkgs/applications/science/logic/klee/default.nix b/nixpkgs/pkgs/applications/science/logic/klee/default.nix
new file mode 100644
index 000000000000..68f68355f816
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/klee/default.nix
@@ -0,0 +1,134 @@
+{ lib
+, stdenv
+, callPackage
+, fetchFromGitHub
+, cmake
+, clang
+, llvm
+, python3
+, zlib
+, z3
+, stp
+, cryptominisat
+, gperftools
+, sqlite
+, gtest
+, lit
+
+# Build KLEE in debug mode. Defaults to false.
+, debug ? false
+
+# Include debug info in the build. Defaults to true.
+, includeDebugInfo ? true
+
+# Enable KLEE asserts. Defaults to true, since LLVM is built with them.
+, asserts ? true
+
+# Build the KLEE runtime in debug mode. Defaults to true, as this improves
+# stack traces of the software under test.
+, debugRuntime ? true
+
+# Enable runtime asserts. Default false.
+, runtimeAsserts ? false
+
+# Extra klee-uclibc config.
+, extraKleeuClibcConfig ? {}
+}:
+
+let
+  # Python used for KLEE tests.
+  kleePython = python3.withPackages (ps: with ps; [ tabulate ]);
+
+  # The klee-uclibc derivation.
+  kleeuClibc = callPackage ./klee-uclibc.nix {
+    inherit stdenv clang llvm extraKleeuClibcConfig debugRuntime runtimeAsserts;
+  };
+in stdenv.mkDerivation rec {
+  pname = "klee";
+  version = "3.0";
+
+  src = fetchFromGitHub {
+    owner = "klee";
+    repo = "klee";
+    rev = "v${version}";
+    hash = "sha256-y5lWmtIcLAthQ0oHYQNd+ir75YaxHZR9Jgiz+ZUFQjY=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [
+    cryptominisat
+    gperftools
+    llvm
+    sqlite
+    stp
+    z3
+  ];
+  nativeCheckInputs = [
+    gtest
+
+    # Should appear BEFORE lit, since lit passes through python rather
+    # than the python environment we make.
+    kleePython
+    (lit.override { python = kleePython; })
+  ];
+
+  cmakeBuildType = if debug then "Debug" else if !debug && includeDebugInfo then "RelWithDebInfo" else "MinSizeRel";
+
+  cmakeFlags = let
+    onOff = val: if val then "ON" else "OFF";
+  in [
+    "-DKLEE_RUNTIME_BUILD_TYPE=${if debugRuntime then "Debug" else "Release"}"
+    "-DLLVMCC=${clang}/bin/clang"
+    "-DLLVMCXX=${clang}/bin/clang++"
+    "-DKLEE_ENABLE_TIMESTAMP=${onOff false}"
+    "-DKLEE_UCLIBC_PATH=${kleeuClibc}"
+    "-DENABLE_KLEE_ASSERTS=${onOff asserts}"
+    "-DENABLE_POSIX_RUNTIME=${onOff true}"
+    "-DENABLE_UNIT_TESTS=${onOff true}"
+    "-DENABLE_SYSTEM_TESTS=${onOff true}"
+    "-DGTEST_SRC_DIR=${gtest.src}"
+    "-DGTEST_INCLUDE_DIR=${gtest.src}/googletest/include"
+    "-Wno-dev"
+  ];
+
+  # Silence various warnings during the compilation of fortified bitcode.
+  env.NIX_CFLAGS_COMPILE = toString ["-Wno-macro-redefined"];
+
+  prePatch = ''
+    patchShebangs .
+  '';
+
+  doCheck = true;
+
+  passthru = {
+    # Let the user depend on `klee.uclibc` for klee-uclibc
+    uclibc = kleeuClibc;
+  };
+
+  meta = with lib; {
+    description = "A symbolic virtual machine built on top of LLVM";
+    longDescription = ''
+      KLEE is a symbolic virtual machine built on top of the LLVM compiler
+      infrastructure. Currently, there are two primary components:
+
+      1. The core symbolic virtual machine engine; this is responsible for
+         executing LLVM bitcode modules with support for symbolic values. This
+         is comprised of the code in lib/.
+
+      2. A POSIX/Linux emulation layer oriented towards supporting uClibc, with
+         additional support for making parts of the operating system environment
+         symbolic.
+
+      Additionally, there is a simple library for replaying computed inputs on
+      native code (for closed programs). There is also a more complicated
+      infrastructure for replaying the inputs generated for the POSIX/Linux
+      emulation layer, which handles running native programs in an environment
+      that matches a computed test input, including setting up files, pipes,
+      environment variables, and passing command line arguments.
+    '';
+    homepage = "https://klee.github.io/";
+    license = licenses.ncsa;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ numinit ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/klee/klee-uclibc.nix b/nixpkgs/pkgs/applications/science/logic/klee/klee-uclibc.nix
new file mode 100644
index 000000000000..91086ae84627
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/klee/klee-uclibc.nix
@@ -0,0 +1,101 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchFromGitHub
+, which
+, linuxHeaders
+, clang
+, llvm
+, python3
+, curl
+, debugRuntime ? true
+, runtimeAsserts ? false
+, extraKleeuClibcConfig ? {}
+}:
+
+let
+  localeSrcBase = "uClibc-locale-030818.tgz";
+  localeSrc = fetchurl {
+    url = "http://www.uclibc.org/downloads/${localeSrcBase}";
+    sha256 = "xDYr4xijjxjZjcz0YtItlbq5LwVUi7k/ZSmP6a+uvVc=";
+  };
+  resolvedExtraKleeuClibcConfig = lib.mapAttrsToList (name: value: "${name}=${value}") (extraKleeuClibcConfig // {
+    "UCLIBC_DOWNLOAD_PREGENERATED_LOCALE_DATA" = "n";
+    "RUNTIME_PREFIX" = "/";
+    "DEVEL_PREFIX" = "/";
+  });
+in stdenv.mkDerivation rec {
+  pname = "klee-uclibc";
+  version = "1.3";
+  src = fetchFromGitHub {
+    owner = "klee";
+    repo = "klee-uclibc";
+    rev = "klee_uclibc_v${version}";
+    sha256 = "sha256-xQ8GWa0Gmd3lbwKodJhrsZeuR4j7NT4zIUh+kNhVY/w=";
+  };
+
+  nativeBuildInputs = [
+    clang
+    curl
+    llvm
+    python3
+    which
+  ];
+
+  # Some uClibc sources depend on Linux headers.
+  UCLIBC_KERNEL_HEADERS = "${linuxHeaders}/include";
+
+  # HACK: needed for cross-compile.
+  # See https://www.mail-archive.com/klee-dev@imperial.ac.uk/msg03141.html
+  KLEE_CFLAGS = "-idirafter ${clang}/resource-root/include";
+
+  prePatch = ''
+    patchShebangs ./configure
+    patchShebangs ./extra
+  '';
+
+  # klee-uclibc configure does not support --prefix, so we override configurePhase entirely
+  configurePhase = ''
+    ./configure ${lib.escapeShellArgs (
+      ["--make-llvm-lib"]
+      ++ lib.optional (!debugRuntime) "--enable-release"
+      ++ lib.optional runtimeAsserts "--enable-assertions"
+    )}
+
+    # Set all the configs we care about.
+    configs=(
+      PREFIX=$out
+    )
+    for value in ${lib.escapeShellArgs resolvedExtraKleeuClibcConfig}; do
+      configs+=("$value")
+    done
+
+    for configFile in .config .config.cmd; do
+      for config in "''${configs[@]}"; do
+        prefix="''${config%%=*}="
+        if grep -q "$prefix" "$configFile"; then
+          sed -i "s"'\001'"''${prefix}"'\001'"#''${prefix}"'\001'"g" "$configFile"
+        fi
+        echo "$config" >> "$configFile"
+      done
+    done
+  '';
+
+  # Link the locale source into the correct place
+  preBuild = ''
+    ln -sf ${localeSrc} extra/locale/${localeSrcBase}
+  '';
+
+  makeFlags = ["HAVE_DOT_CONFIG=y"];
+
+  meta = with lib; {
+    description = "A modified version of uClibc for KLEE.";
+    longDescription = ''
+      klee-uclibc is a bitcode build of uClibc meant for compatibility with the
+      KLEE symbolic virtual machine.
+    '';
+    homepage = "https://klee.github.io/";
+    license = licenses.lgpl3;
+    maintainers = with maintainers; [ numinit ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/lci/default.nix b/nixpkgs/pkgs/applications/science/logic/lci/default.nix
new file mode 100644
index 000000000000..659855c23fb2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/lci/default.nix
@@ -0,0 +1,17 @@
+{lib, stdenv, fetchurl, readline}:
+stdenv.mkDerivation rec {
+  version = "0.6";
+  pname = "lci";
+  src = fetchurl {
+    url = "mirror://sourceforge/lci/${pname}-${version}.tar.gz";
+    sha256="204f1ca5e2f56247d71ab320246811c220ed511bf08c9cb7f305cf180a93948e";
+  };
+  buildInputs = [readline];
+  meta = {
+    description = "Lambda calculus interpreter";
+    mainProgram = "lci";
+    maintainers = with lib.maintainers; [raskin];
+    platforms = with lib.platforms; linux;
+    license = lib.licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/lean/default.nix b/nixpkgs/pkgs/applications/science/logic/lean/default.nix
new file mode 100644
index 000000000000..f0bd2ba777db
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/lean/default.nix
@@ -0,0 +1,59 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, gmp, coreutils }:
+
+stdenv.mkDerivation rec {
+  pname = "lean";
+  version = "3.51.0";
+
+  src = fetchFromGitHub {
+    owner  = "leanprover-community";
+    repo   = "lean";
+    # lean's version string contains the commit sha1 it was built
+    # from. this is then used to check whether an olean file should be
+    # rebuilt. don't use a tag as rev because this will get replaced into
+    # src/githash.h.in in preConfigure.
+    rev    = "9fc1dee97a72a3e34d658aefb4b8a95ecd3d477c";
+    hash   = "sha256-Vcsph4dTNLafeaTtVwJS8tWoWCgcP6pxF0ssZDE/YfM=";
+  };
+
+  patches = [
+    # Fix gcc-13 build failure
+    (fetchpatch {
+      name = "gcc-13.patch";
+      url = "https://github.com/leanprover-community/lean/commit/21d264a66d53b0a910178ae7d9529cb5886a39b6.patch";
+      hash = "sha256-hBm2QNFS1jdoR6LUQHLReKxMKv7kbkrkrTGJ43YnvfA=";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ gmp ];
+
+  cmakeDir = "../src";
+
+  # Running the tests is required to build the *.olean files for the core
+  # library.
+  doCheck = true;
+
+  preConfigure = assert builtins.stringLength src.rev == 40; ''
+     substituteInPlace src/githash.h.in \
+       --subst-var-by GIT_SHA1 "${src.rev}"
+     substituteInPlace library/init/version.lean.in \
+       --subst-var-by GIT_SHA1 "${src.rev}"
+  '';
+
+  postPatch = "patchShebangs .";
+
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace $out/bin/leanpkg \
+      --replace "greadlink" "${coreutils}/bin/readlink"
+  '';
+
+  meta = with lib; {
+    description = "Automatic and interactive theorem prover";
+    homepage    = "https://leanprover.github.io/";
+    changelog   = "https://github.com/leanprover-community/lean/blob/v${version}/doc/changes.md";
+    license     = licenses.asl20;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ thoughtpolice gebner ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/science/logic/lean2/default.nix b/nixpkgs/pkgs/applications/science/logic/lean2/default.nix
new file mode 100644
index 000000000000..e30b8af04735
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/lean2/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchpatch, fetchFromGitHub, cmake, gmp, mpfr, python3
+, jemalloc, ninja, makeWrapper }:
+
+stdenv.mkDerivation {
+  pname = "lean2";
+  version = "2018-10-01";
+
+  src = fetchFromGitHub {
+    owner  = "leanprover";
+    repo   = "lean2";
+    rev    = "8072fdf9a0b31abb9d43ab894d7a858639e20ed7";
+    sha256 = "12bscgihdgvaq5xi0hqf5r4w386zxm3nkx1n150lv5smhg8ga3gg";
+  };
+
+  patches = [
+    # https://github.com/leanprover/lean2/pull/13
+    (fetchpatch {
+      name = "lean2-fix-compilation-error.patch";
+      url = "https://github.com/collares/lean2/commit/09b316ce75fd330b3b140d138bcdae2b0e909234.patch";
+      sha256 = "060mvqn9y8lsn4l20q9rhamkymzsgh0r1vzkjw78gnj8kjw67jl5";
+    })
+  ];
+  nativeBuildInputs = [ cmake makeWrapper ninja ];
+  buildInputs = [ gmp mpfr python3 jemalloc ];
+
+  preConfigure = ''
+    patchShebangs bin/leantags
+    cd src
+  '';
+
+  cmakeFlags = [ "-GNinja" ];
+
+  postInstall = ''
+    wrapProgram $out/bin/linja --prefix PATH : $out/bin:${ninja}/bin
+  '';
+
+  meta = with lib; {
+    description = "Automatic and interactive theorem prover (version with HoTT support)";
+    homepage    = "http://leanprover.github.io";
+    license     = licenses.asl20;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ thoughtpolice gebner ];
+    broken      = stdenv.isAarch64;
+    mainProgram = "lean";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/lean4/default.nix b/nixpkgs/pkgs/applications/science/logic/lean4/default.nix
new file mode 100644
index 000000000000..dca55d969db4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/lean4/default.nix
@@ -0,0 +1,68 @@
+{ lib
+, stdenv
+, cmake
+, fetchFromGitHub
+, git
+, gmp
+, perl
+, testers
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "lean4";
+  version = "4.6.1";
+
+  src = fetchFromGitHub {
+    owner = "leanprover";
+    repo = "lean4";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-wUqGADwSocg2ciycCxg9qp+vJLJ2otA/5JpTrkFrDoQ=";
+  };
+
+  postPatch = ''
+    substituteInPlace src/CMakeLists.txt \
+      --replace 'set(GIT_SHA1 "")' 'set(GIT_SHA1 "${finalAttrs.src.rev}")'
+
+    # Remove tests that fails in sandbox.
+    # It expects `sourceRoot` to be a git repository.
+    rm -rf src/lake/examples/git/
+  '';
+
+  preConfigure = ''
+    patchShebangs stage0/src/bin/ src/bin/
+  '';
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = [
+    gmp
+  ];
+
+  nativeCheckInputs = [
+    git
+    perl
+  ];
+
+  cmakeFlags = [
+    "-DUSE_GITHASH=OFF"
+    "-DINSTALL_LICENSE=OFF"
+  ];
+
+  passthru.tests = {
+    version = testers.testVersion {
+      package = finalAttrs.finalPackage;
+    };
+  };
+
+  meta = with lib; {
+    description = "Automatic and interactive theorem prover";
+    homepage = "https://leanprover.github.io/";
+    changelog = "https://github.com/leanprover/lean4/blob/${finalAttrs.src.rev}/RELEASES.md";
+    license = licenses.asl20;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ marsam ];
+    mainProgram = "lean";
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/logic/leo2/default.nix b/nixpkgs/pkgs/applications/science/logic/leo2/default.nix
new file mode 100644
index 000000000000..dcf2d5b7c33c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/leo2/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv, fetchurl, fetchpatch, makeWrapper, eprover, ocaml, camlp4, perl, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "leo2";
+  version = "1.7.0";
+
+  src = fetchurl {
+    url = "https://page.mi.fu-berlin.de/cbenzmueller/leo/leo2_v${version}.tgz";
+    sha256 = "sha256:1b2q7vsz6s9ighypsigqjm1mzjiq3xgnz5id5ssb4rh9zm190r82";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ makeWrapper eprover ocaml camlp4 perl ];
+  buildInputs = [ zlib ];
+
+  patches = [ (fetchpatch {
+      url = "https://github.com/niklasso/minisat/commit/7eb6015313561a2586032574788fcb133eeaa19f.patch";
+      stripLen = 1;
+      extraPrefix = "lib/";
+      sha256 = "sha256:01ln7hi6nvvkqkhn9hciqizizz5qspvqffgksvgmzn9x7kdd9pnh";
+    })
+  ];
+
+  preConfigure = ''
+    cd src
+    patchShebangs configure
+    substituteInPlace Makefile.pre \
+      --replace '+camlp4' "${camlp4}/lib/ocaml/${ocaml.version}/site-lib/camlp4"
+  '';
+
+  buildFlags = [ "opt" ];
+
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-reserved-user-defined-literal";
+
+  preInstall = "mkdir -p $out/bin";
+
+  postInstall = ''
+    mkdir -p "$out/etc"
+    echo -e "e = ${eprover}/bin/eprover\\nepclextract = ${eprover}/bin/epclextract" > "$out/etc/leoatprc"
+
+    wrapProgram $out/bin/leo \
+      --add-flags "--atprc $out/etc/leoatprc"
+  '';
+
+  meta = with lib; {
+    description = "A high-performance typed higher order prover";
+    mainProgram = "leo";
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.unix;
+    license = licenses.bsd3;
+    homepage = "http://www.leoprover.org/";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/leo3/binary.nix b/nixpkgs/pkgs/applications/science/logic/leo3/binary.nix
new file mode 100644
index 000000000000..0cdf8a4dc210
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/leo3/binary.nix
@@ -0,0 +1,30 @@
+{lib, stdenv, fetchurl, openjdk, runtimeShell}:
+stdenv.mkDerivation rec {
+  pname = "leo3";
+  version = "1.2";
+
+  src = fetchurl {
+    url = "https://github.com/leoprover/Leo-III/releases/download/v${version}/leo3.jar";
+    sha256 = "1lgwxbr1rnk72rnvc8raq5i1q71ckhn998pwd9xk6zf27wlzijk7";
+  };
+
+  dontUnpack = true;
+
+  installPhase = ''
+    mkdir -p "$out"/{bin,lib/java/leo3}
+    cp "${src}" "$out/lib/java/leo3/leo3.jar"
+    echo "#!${runtimeShell}" > "$out/bin/leo3"
+    echo "'${openjdk}/bin/java' -jar '$out/lib/java/leo3/leo3.jar' \"\$@\""  >> "$out/bin/leo3"
+    chmod a+x "$out/bin/leo3"
+  '';
+
+  meta = with lib; {
+    description = "An automated theorem prover for classical higher-order logic with choice";
+    mainProgram = "leo3";
+    sourceProvenance = with sourceTypes; [ binaryBytecode ];
+    license = licenses.bsd3;
+    maintainers = [maintainers.raskin];
+    platforms = platforms.linux;
+    homepage = "https://page.mi.fu-berlin.de/lex/leo3/";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/lingeling/default.nix b/nixpkgs/pkgs/applications/science/logic/lingeling/default.nix
new file mode 100644
index 000000000000..1abf38b49cf8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/lingeling/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchFromGitHub
+, aiger
+}:
+
+stdenv.mkDerivation {
+  pname = "lingeling";
+  # This is the version used in satcomp2020
+  version = "pre1_708beb26";
+
+  src = fetchFromGitHub {
+    owner  = "arminbiere";
+    repo   = "lingeling";
+    rev    = "708beb26a7d5b5d5e7abd88d6f552fb1946b07c1";
+    sha256 = "1lb2g37nd8qq5hw5g6l691nx5095336yb2zlbaw43mg56hkj8357";
+  };
+
+  configurePhase = ''
+    ./configure.sh
+
+    # Rather than patch ./configure, just sneak in use of aiger here, since it
+    # doesn't handle real build products very well (it works on a build-time
+    # dir, not installed copy)... This is so we can build 'blimc'
+    substituteInPlace ./makefile \
+      --replace 'targets: liblgl.a' 'targets: liblgl.a blimc'      \
+      --replace '$(AIGER)/aiger.o'  '${aiger.lib}/lib/aiger.o'     \
+      --replace '$(AIGER)/aiger.h'  '${aiger.dev}/include/aiger.h' \
+      --replace '-I$(AIGER)'        '-I${aiger.dev}/include'
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $lib/lib $dev/include
+
+    cp lglib.h  $dev/include
+    cp liblgl.a $lib/lib
+
+    cp lingeling plingeling treengeling ilingeling blimc $out/bin
+  '';
+
+  outputs = [ "out" "dev" "lib" ];
+
+  meta = with lib; {
+    description = "Fast SAT solver";
+    homepage    = "http://fmv.jku.at/lingeling/";
+    license     = licenses.mit;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/logisim-evolution/default.nix b/nixpkgs/pkgs/applications/science/logic/logisim-evolution/default.nix
new file mode 100644
index 000000000000..3d86c8cafdbc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/logisim-evolution/default.nix
@@ -0,0 +1,67 @@
+{ lib
+, stdenv
+, fetchurl
+, jre
+, makeBinaryWrapper
+, copyDesktopItems
+, makeDesktopItem
+, desktopToDarwinBundle
+, unzip
+}:
+
+let
+  icon = fetchurl {
+    url = "https://github.com/logisim-evolution/logisim-evolution/raw/9e0afa3cd6a8bfa75dab61830822cde83c70bb4b/artwork/logisim-evolution-icon.svg";
+    hash = "sha256-DNRimhNFt6jLdjqv7o2cNz38K6XnevxD0rGymym3xBs=";
+  };
+in
+stdenv.mkDerivation (finalAttrs: {
+  pname = "logisim-evolution";
+  version = "3.8.0";
+
+  src = fetchurl {
+    url = "https://github.com/logisim-evolution/logisim-evolution/releases/download/v${finalAttrs.version}/logisim-evolution-${finalAttrs.version}-all.jar";
+    hash = "sha256-TFm+fa3CMp0OMhnKBc6cLIWGQbIG/OpOOCG7ea7wbCw=";
+  };
+  dontUnpack = true;
+
+  nativeBuildInputs = [
+    makeBinaryWrapper
+    copyDesktopItems
+    unzip
+  ] ++ lib.optionals stdenv.isDarwin [
+    desktopToDarwinBundle
+  ];
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = "logisim-evolution";
+      desktopName = "Logisim-evolution";
+      exec = "logisim-evolution";
+      icon = "logisim-evolution";
+      comment = finalAttrs.meta.description;
+      categories = [ "Education" ];
+    })
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin
+    makeWrapper ${jre}/bin/java $out/bin/logisim-evolution --add-flags "-jar $src"
+    install -Dm444 ${icon} $out/share/icons/hicolor/scalable/apps/logisim-evolution.svg
+
+    runHook postInstall
+  '';
+
+  meta = {
+    changelog = "https://github.com/logisim-evolution/logisim-evolution/releases/tag/v${finalAttrs.version}";
+    homepage = "https://github.com/logisim-evolution/logisim-evolution";
+    description = "Digital logic designer and simulator";
+    mainProgram = "logisim-evolution";
+    maintainers = with lib.maintainers; [ emilytrau ];
+    sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
+    license = lib.licenses.gpl3Only;
+    platforms = lib.platforms.unix;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/logic/logisim/default.nix b/nixpkgs/pkgs/applications/science/logic/logisim/default.nix
new file mode 100644
index 000000000000..d278f1e78468
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/logisim/default.nix
@@ -0,0 +1,66 @@
+{ lib
+, stdenv
+, fetchurl
+, jre
+, makeBinaryWrapper
+, copyDesktopItems
+, makeDesktopItem
+, desktopToDarwinBundle
+, unzip
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "logisim";
+  version = "2.7.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/circuit/${lib.versions.majorMinor finalAttrs.version}.x/${finalAttrs.version}/logisim-generic-${finalAttrs.version}.jar";
+    hash = "sha256-Nip4wSrRjCA/7YaIcsSgHNnBIUE3nZLokrviw35ie8I=";
+  };
+  dontUnpack = true;
+
+  nativeBuildInputs = [
+    makeBinaryWrapper
+    copyDesktopItems
+    unzip
+  ] ++ lib.optionals stdenv.isDarwin [
+    desktopToDarwinBundle
+  ];
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = "logisim";
+      desktopName = "Logisim";
+      exec = "logisim";
+      icon = "logisim";
+      comment = finalAttrs.meta.description;
+      categories = [ "Education" ];
+    })
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin
+    makeWrapper ${jre}/bin/java $out/bin/logisim --add-flags "-jar $src"
+
+    # Create icons
+    unzip $src "resources/logisim/img/*"
+    for size in 16 20 24 48 64 128
+    do
+      install -Dm444 "./resources/logisim/img/logisim-icon-$size.png" "$out/share/icons/hicolor/''${size}x''${size}/apps/logisim.png"
+    done
+
+    runHook postInstall
+  '';
+
+  meta = {
+    homepage = "http://www.cburch.com/logisim/";
+    description = "Educational tool for designing and simulating digital logic circuits";
+    mainProgram = "logisim";
+    maintainers = with lib.maintainers; [ emilytrau ];
+    sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
+    license = lib.licenses.gpl2Only;
+    platforms = lib.platforms.unix;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/logic/ltl2ba/default.nix b/nixpkgs/pkgs/applications/science/logic/ltl2ba/default.nix
new file mode 100644
index 000000000000..19ade58fbfaa
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/ltl2ba/default.nix
@@ -0,0 +1,32 @@
+{ fetchurl, lib, stdenv }:
+
+stdenv.mkDerivation rec {
+  pname = "ltl2ba";
+  version = "1.3";
+
+  src = fetchurl {
+    url    = "http://www.lsv.ens-cachan.fr/~gastin/ltl2ba/${pname}-${version}.tar.gz";
+    sha256 = "1bz9gjpvby4mnvny0nmxgd81rim26mqlcnjlznnxxk99575pfa4i";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  preConfigure = ''
+    substituteInPlace Makefile \
+    --replace "CC=gcc" ""
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mv ltl2ba $out/bin
+  '';
+
+  meta = {
+    description = "Fast translation from LTL formulae to Buchi automata";
+    mainProgram = "ltl2ba";
+    homepage    = "http://www.lsv.ens-cachan.fr/~gastin/ltl2ba";
+    license     = lib.licenses.gpl2Plus;
+    platforms   = lib.platforms.darwin ++ lib.platforms.linux;
+    maintainers = [ lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/mcrl2/default.nix b/nixpkgs/pkgs/applications/science/logic/mcrl2/default.nix
new file mode 100644
index 000000000000..854c2c16f5ac
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/mcrl2/default.nix
@@ -0,0 +1,31 @@
+{lib, stdenv, fetchurl, cmake, libGLU, libGL, qt5, boost}:
+
+stdenv.mkDerivation rec {
+  version = "202307";
+  build_nr = "1";
+  pname = "mcrl2";
+
+  src = fetchurl {
+    url = "https://www.mcrl2.org/download/release/mcrl2-${version}.${build_nr}.tar.gz";
+    hash = "sha256-zCHCO8tGyOxqUc0x3t/N3dUh4eG7slemlgK/QZsA4JA=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libGLU libGL qt5.qtbase boost ];
+
+  dontWrapQtApps = true;
+
+  meta = with lib; {
+    broken = stdenv.isDarwin;
+    description = "A toolset for model-checking concurrent systems and protocols";
+    longDescription = ''
+      A formal specification language with an associated toolset,
+      that can be used for modelling, validation and verification of
+      concurrent systems and protocols
+    '';
+    homepage = "https://www.mcrl2.org/";
+    license = licenses.boost;
+    maintainers = with maintainers; [ moretea ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/mcy/default.nix b/nixpkgs/pkgs/applications/science/logic/mcy/default.nix
new file mode 100644
index 000000000000..343b50dfd7ef
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/mcy/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchFromGitHub
+, yosys, python3
+}:
+
+let
+  python = python3.withPackages (p: with p; [ flask ]);
+in
+stdenv.mkDerivation {
+  pname = "mcy";
+  version = "2020.08.03";
+
+  src = fetchFromGitHub {
+    owner  = "YosysHQ";
+    repo   = "mcy";
+    rev    = "62048e69df13f8e03670424626755ae8ef4c36ff";
+    sha256 = "15xxgzx1zxzx5kshqyrxnfx33cz6cjzxcdcn6z98jhs9bwyvf96f";
+  };
+
+  buildInputs = [ python ];
+  patchPhase = ''
+    chmod +x scripts/create_mutated.sh
+    patchShebangs .
+
+    substituteInPlace mcy.py \
+      --replace yosys '${yosys}/bin/yosys' \
+      --replace 'os.execvp("mcy-dash"' "os.execvp(\"$out/bin/mcy-dash\""
+    substituteInPlace mcy-dash.py \
+      --replace 'app.run(debug=True)' 'app.run(host="0.0.0.0",debug=True)' \
+      --replace 'subprocess.Popen(["mcy"' "subprocess.Popen([\"$out/bin/mcy\""
+    substituteInPlace scripts/create_mutated.sh \
+      --replace yosys '${yosys}/bin/yosys'
+  '';
+
+  # the build needs a bit of work...
+  buildPhase = "true";
+  installPhase = ''
+    mkdir -p $out/bin $out/share/mcy/{dash,scripts}
+    install mcy.py      $out/bin/mcy      && chmod +x $out/bin/mcy
+    install mcy-dash.py $out/bin/mcy-dash && chmod +x $out/bin/mcy-dash
+    cp -r dash/.    $out/share/mcy/dash/.
+    cp -r scripts/. $out/share/mcy/scripts/.
+  '';
+
+  meta = {
+    description = "Mutation-based coverage testing for hardware designs, with Yosys";
+    homepage    = "https://github.com/YosysHQ/mcy";
+    license     = lib.licenses.isc;
+    maintainers = with lib.maintainers; [ thoughtpolice ];
+    platforms   = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/metis-prover/default.nix b/nixpkgs/pkgs/applications/science/logic/metis-prover/default.nix
new file mode 100644
index 000000000000..bd6f71860bdb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/metis-prover/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, perl, mlton }:
+
+stdenv.mkDerivation {
+  pname = "metis-prover";
+  version = "2.4.20200713";
+
+  src = fetchFromGitHub {
+    owner = "gilith";
+    repo = "metis";
+    rev = "d17c3a8cf6537212c5c4bfdadcf865bd25723132";
+    sha256 = "phu1x0yahK/B2bSOCvlze7UJw8smX9zw6dJTpDD9chM=";
+  };
+
+  nativeBuildInputs = [ perl ];
+  buildInputs = [ mlton ];
+
+  patchPhase = "patchShebangs .";
+
+  buildPhase = "make mlton";
+
+  installPhase = ''
+    install -Dm0755 bin/mlton/metis $out/bin/metis
+  '';
+
+  meta = with lib; {
+    description = "Automatic theorem prover for first-order logic with equality";
+    mainProgram = "metis";
+    homepage = "https://www.gilith.com/research/metis/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ gebner ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/minisat/default.nix b/nixpkgs/pkgs/applications/science/logic/minisat/default.nix
new file mode 100644
index 000000000000..10d380882744
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/minisat/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, cmake, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "minisat";
+  version = "2.2.1";
+
+  src = fetchFromGitHub {
+    owner = "stp";
+    repo = pname;
+    rev = "releases/${version}";
+    sha256 = "14vcbjnlia00lpyv2fhbmw3wbc9bk9h7bln9zpyc3nwiz5cbjz4a";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib ];
+
+  meta = with lib; {
+    description = "Compact and readable SAT solver";
+    maintainers = with maintainers; [ gebner raskin ];
+    platforms = platforms.unix;
+    license = licenses.mit;
+    homepage = "http://minisat.se/";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/monosat/default.nix b/nixpkgs/pkgs/applications/science/logic/monosat/default.nix
new file mode 100644
index 000000000000..067ba8ceb1b3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/monosat/default.nix
@@ -0,0 +1,100 @@
+{ lib, stdenv, fetchpatch, fetchFromGitHub, cmake, zlib, gmp, jdk8,
+  # The JDK we use on Darwin currently makes extensive use of rpaths which are
+  # annoying and break the python library, so let's not bother for now
+  includeJava ? !stdenv.hostPlatform.isDarwin, includeGplCode ? true }:
+
+with lib;
+
+let
+  boolToCmake = x: if x then "ON" else "OFF";
+
+  rev    = "1.8.0";
+  sha256 = "0q3a8x3iih25xkp2bm842sm2hxlb8hxlls4qmvj7vzwrh4lvsl7b";
+
+  pname   = "monosat";
+  version = rev;
+
+  src = fetchFromGitHub {
+    owner = "sambayless";
+    repo  = pname;
+    inherit rev sha256;
+  };
+
+  patches = [
+    # Python 3.8 compatibility
+    (fetchpatch {
+      url = "https://github.com/sambayless/monosat/commit/a5079711d0df0451f9840f3a41248e56dbb03967.patch";
+      sha256 = "1p2y0jw8hb9c90nbffhn86k1dxd6f6hk5v70dfmpzka3y6g1ksal";
+    })
+  ];
+
+  # source behind __linux__ check assumes system is also x86 and
+  # tries to disable x86/x87-specific extended precision mode
+  # https://github.com/sambayless/monosat/issues/33
+  commonPostPatch = lib.optionalString (!stdenv.hostPlatform.isx86) ''
+    substituteInPlace src/monosat/Main.cc \
+      --replace 'defined(__linux__)' '0'
+  '';
+
+  core = stdenv.mkDerivation {
+    name = "${pname}-${version}";
+    inherit src patches;
+    postPatch = commonPostPatch;
+    nativeBuildInputs = [ cmake ];
+    buildInputs = [ zlib gmp jdk8 ];
+
+    cmakeFlags = [
+      "-DBUILD_STATIC=OFF"
+      "-DJAVA=${boolToCmake includeJava}"
+      "-DGPL=${boolToCmake includeGplCode}"
+
+      # file RPATH_CHANGE could not write new RPATH
+      "-DCMAKE_SKIP_BUILD_RPATH=ON"
+    ];
+
+    postInstall = optionalString includeJava ''
+      mkdir -p $out/share/java
+      cp monosat.jar $out/share/java
+    '';
+
+    passthru = { inherit python; };
+
+    meta = {
+      description = "SMT solver for Monotonic Theories";
+      mainProgram = "monosat";
+      platforms   = platforms.unix;
+      license     = if includeGplCode then licenses.gpl2 else licenses.mit;
+      homepage    = "https://github.com/sambayless/monosat";
+      maintainers = [ maintainers.acairncross ];
+    };
+  };
+
+  python = { buildPythonPackage, cython, pytestCheckHook }: buildPythonPackage {
+    inherit pname version src patches;
+
+    propagatedBuildInputs = [ core cython ];
+
+    # This tells setup.py to use cython, which should produce faster bindings
+    MONOSAT_CYTHON = true;
+
+    # After patching src, move to where the actually relevant source is. This could just be made
+    # the sourceRoot if it weren't for the patch.
+    postPatch = commonPostPatch + ''
+      cd src/monosat/api/python
+    '' +
+    # The relative paths here don't make sense for our Nix build
+    # TODO: do we want to just reference the core monosat library rather than copying the
+    # shared lib? The current setup.py copies the .dylib/.so...
+    ''
+      substituteInPlace setup.py \
+        --replace 'library_dir = "../../../../"' 'library_dir = "${core}/lib/"'
+    '';
+
+    nativeCheckInputs = [ pytestCheckHook ];
+
+    disabledTests = [
+      "test_assertAtMostOne"
+      "test_assertEqual"
+    ];
+  };
+in core
diff --git a/nixpkgs/pkgs/applications/science/logic/msat/default.nix b/nixpkgs/pkgs/applications/science/logic/msat/default.nix
new file mode 100644
index 000000000000..299fe95224eb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/msat/default.nix
@@ -0,0 +1,14 @@
+{ lib, ocamlPackages }:
+
+with ocamlPackages; buildDunePackage {
+  pname = "msat-bin";
+
+  inherit (msat) version src;
+
+  buildInputs = [ camlzip containers msat ];
+
+  meta = msat.meta // {
+    description = "SAT solver binary based on the msat library";
+    mainProgram = "msat";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/naproche/default.nix b/nixpkgs/pkgs/applications/science/logic/naproche/default.nix
new file mode 100644
index 000000000000..d2070ba8240f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/naproche/default.nix
@@ -0,0 +1,35 @@
+{ lib, fetchFromGitHub, haskellPackages, makeWrapper, eprover }:
+
+with haskellPackages; mkDerivation {
+  pname = "Naproche-SAD";
+  version = "unstable-2024-01-18";
+
+  src = fetchFromGitHub {
+    owner = "naproche";
+    repo = "naproche";
+    rev = "bb3dbcbd2173e3334bc5bdcd04c07c6836a11387";
+    hash = "sha256-DWcowUjy8/VBuhqvDYlVINHssF4KhuzT0L+m1YwUxoE=";
+  };
+
+  isExecutable = true;
+
+  buildTools = [ hpack makeWrapper ];
+  executableHaskellDepends = [
+    base array bytestring containers ghc-prim megaparsec mtl network process
+    split temporary text threads time transformers uuid
+  ];
+
+  prePatch = "hpack";
+  doCheck = false; # Tests are broken in upstream
+
+  postInstall = ''
+    wrapProgram $out/bin/Naproche-SAD \
+      --set-default NAPROCHE_EPROVER ${eprover}/bin/eprover
+  '';
+
+  homepage = "https://github.com/naproche/naproche#readme";
+  description = "Write formal proofs in natural language and LaTeX";
+  maintainers = with lib.maintainers; [ jvanbruegge ];
+  license = lib.licenses.gpl3Only;
+  mainProgram = "Naproche-SAD";
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/netlistsvg/default.nix b/nixpkgs/pkgs/applications/science/logic/netlistsvg/default.nix
new file mode 100644
index 000000000000..8458d63f03bb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/netlistsvg/default.nix
@@ -0,0 +1,54 @@
+{ lib
+, buildNpmPackage
+, fetchFromGitHub
+, runCommandLocal
+, netlistsvg
+, yosys
+}:
+
+buildNpmPackage rec {
+  pname = "netlistsvg";
+  version = "1.0.2";
+
+  src = fetchFromGitHub {
+    owner = "nturley";
+    repo = "netlistsvg";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-H37zhjfv7c/TV+pAk70eDiE6ZQ9JjZq1TFvac6OOKBk=";
+  };
+
+  postPatch = ''
+    cp ${./package-lock.json} ./package-lock.json
+  '';
+
+  npmDepsHash = "sha256-nKxskNW8YFDloA9Nxs/Rfjew8nX+l9xKB8/8313KoYo=";
+
+  dontNpmBuild = true;
+
+  doCheck = true;
+
+  checkPhase = ''
+    runHook preCheck
+
+    node --trace-warnings test/test-all.js
+
+    runHook postCheck
+  '';
+
+  # An integration test: Synthesize a circuit from hdl and generate a diagram
+  passthru.tests.netlistsvg-yosys-integration-test = runCommandLocal "netlistsvg-yosys-integration-test" {
+    nativeBuildInputs = [ netlistsvg yosys ];
+  } ''
+    yosys -p "prep -top helloworld -flatten; aigmap; write_json circuit.json" ${./test.v}
+    netlistsvg circuit.json -o circuit.svg
+    test -s circuit.svg
+    touch $out
+  '';
+
+  meta = {
+    description = "Draw SVG digital circuits schematics from yosys JSON netlists";
+    homepage = "https://github.com/nturley/netlistsvg";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ pbsds ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/netlistsvg/package-lock.json b/nixpkgs/pkgs/applications/science/logic/netlistsvg/package-lock.json
new file mode 100644
index 000000000000..cbf3309f6d3b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/netlistsvg/package-lock.json
@@ -0,0 +1,9761 @@
+{
+  "name": "netlistsvg",
+  "version": "1.0.2",
+  "lockfileVersion": 3,
+  "requires": true,
+  "packages": {
+    "": {
+      "name": "netlistsvg",
+      "version": "1.0.2",
+      "license": "MIT",
+      "dependencies": {
+        "@types/clone": "^0.1.30",
+        "@types/json5": "0.0.30",
+        "@types/lodash": "^4.14.116",
+        "ajv": "^6.10.0",
+        "ajv-errors": "^1.0.1",
+        "clone": "^2.1.0",
+        "elkjs": "^0.3.0",
+        "fs-extra": "^1.0.0",
+        "json5": "^0.5.1",
+        "lodash": "^4.17.11",
+        "onml": "^0.3.1",
+        "yargs": "^6.5.0"
+      },
+      "bin": {
+        "netlistsvg": "bin/netlistsvg.js",
+        "netlistsvg-dumplayout": "bin/exportLayout.js"
+      },
+      "devDependencies": {
+        "@types/jest": "^24.0.11",
+        "@types/node": "^11.13.0",
+        "brfs": "^2.0.2",
+        "browserify": "^16.2.3",
+        "browserify-shim": "^3.8.14",
+        "eslint": "^5.15.3",
+        "jest": "^24.5.0",
+        "superagent": "^3.8.2",
+        "ts-jest": "^24.0.0",
+        "tslint": "^5.14.0",
+        "typescript": "^3.3.4000"
+      }
+    },
+    "node_modules/@ampproject/remapping": {
+      "version": "2.2.1",
+      "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz",
+      "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==",
+      "dev": true,
+      "dependencies": {
+        "@jridgewell/gen-mapping": "^0.3.0",
+        "@jridgewell/trace-mapping": "^0.3.9"
+      },
+      "engines": {
+        "node": ">=6.0.0"
+      }
+    },
+    "node_modules/@babel/code-frame": {
+      "version": "7.22.5",
+      "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz",
+      "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==",
+      "dev": true,
+      "dependencies": {
+        "@babel/highlight": "^7.22.5"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/compat-data": {
+      "version": "7.22.9",
+      "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.9.tgz",
+      "integrity": "sha512-5UamI7xkUcJ3i9qVDS+KFDEK8/7oJ55/sJMB1Ge7IEapr7KfdfV/HErR+koZwOfd+SgtFKOKRhRakdg++DcJpQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/core": {
+      "version": "7.22.9",
+      "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.22.9.tgz",
+      "integrity": "sha512-G2EgeufBcYw27U4hhoIwFcgc1XU7TlXJ3mv04oOv1WCuo900U/anZSPzEqNjwdjgffkk2Gs0AN0dW1CKVLcG7w==",
+      "dev": true,
+      "dependencies": {
+        "@ampproject/remapping": "^2.2.0",
+        "@babel/code-frame": "^7.22.5",
+        "@babel/generator": "^7.22.9",
+        "@babel/helper-compilation-targets": "^7.22.9",
+        "@babel/helper-module-transforms": "^7.22.9",
+        "@babel/helpers": "^7.22.6",
+        "@babel/parser": "^7.22.7",
+        "@babel/template": "^7.22.5",
+        "@babel/traverse": "^7.22.8",
+        "@babel/types": "^7.22.5",
+        "convert-source-map": "^1.7.0",
+        "debug": "^4.1.0",
+        "gensync": "^1.0.0-beta.2",
+        "json5": "^2.2.2",
+        "semver": "^6.3.1"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      },
+      "funding": {
+        "type": "opencollective",
+        "url": "https://opencollective.com/babel"
+      }
+    },
+    "node_modules/@babel/core/node_modules/convert-source-map": {
+      "version": "1.9.0",
+      "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz",
+      "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==",
+      "dev": true
+    },
+    "node_modules/@babel/core/node_modules/json5": {
+      "version": "2.2.3",
+      "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
+      "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
+      "dev": true,
+      "bin": {
+        "json5": "lib/cli.js"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/@babel/core/node_modules/semver": {
+      "version": "6.3.1",
+      "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+      "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+      "dev": true,
+      "bin": {
+        "semver": "bin/semver.js"
+      }
+    },
+    "node_modules/@babel/generator": {
+      "version": "7.22.9",
+      "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.9.tgz",
+      "integrity": "sha512-KtLMbmicyuK2Ak/FTCJVbDnkN1SlT8/kceFTiuDiiRUUSMnHMidxSCdG4ndkTOHHpoomWe/4xkvHkEOncwjYIw==",
+      "dev": true,
+      "dependencies": {
+        "@babel/types": "^7.22.5",
+        "@jridgewell/gen-mapping": "^0.3.2",
+        "@jridgewell/trace-mapping": "^0.3.17",
+        "jsesc": "^2.5.1"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/helper-compilation-targets": {
+      "version": "7.22.9",
+      "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.9.tgz",
+      "integrity": "sha512-7qYrNM6HjpnPHJbopxmb8hSPoZ0gsX8IvUS32JGVoy+pU9e5N0nLr1VjJoR6kA4d9dmGLxNYOjeB8sUDal2WMw==",
+      "dev": true,
+      "dependencies": {
+        "@babel/compat-data": "^7.22.9",
+        "@babel/helper-validator-option": "^7.22.5",
+        "browserslist": "^4.21.9",
+        "lru-cache": "^5.1.1",
+        "semver": "^6.3.1"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      },
+      "peerDependencies": {
+        "@babel/core": "^7.0.0"
+      }
+    },
+    "node_modules/@babel/helper-compilation-targets/node_modules/semver": {
+      "version": "6.3.1",
+      "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+      "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+      "dev": true,
+      "bin": {
+        "semver": "bin/semver.js"
+      }
+    },
+    "node_modules/@babel/helper-environment-visitor": {
+      "version": "7.22.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.5.tgz",
+      "integrity": "sha512-XGmhECfVA/5sAt+H+xpSg0mfrHq6FzNr9Oxh7PSEBBRUb/mL7Kz3NICXb194rCqAEdxkhPT1a88teizAFyvk8Q==",
+      "dev": true,
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/helper-function-name": {
+      "version": "7.22.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.22.5.tgz",
+      "integrity": "sha512-wtHSq6jMRE3uF2otvfuD3DIvVhOsSNshQl0Qrd7qC9oQJzHvOL4qQXlQn2916+CXGywIjpGuIkoyZRRxHPiNQQ==",
+      "dev": true,
+      "dependencies": {
+        "@babel/template": "^7.22.5",
+        "@babel/types": "^7.22.5"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/helper-hoist-variables": {
+      "version": "7.22.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz",
+      "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==",
+      "dev": true,
+      "dependencies": {
+        "@babel/types": "^7.22.5"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/helper-module-imports": {
+      "version": "7.22.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.5.tgz",
+      "integrity": "sha512-8Dl6+HD/cKifutF5qGd/8ZJi84QeAKh+CEe1sBzz8UayBBGg1dAIJrdHOcOM5b2MpzWL2yuotJTtGjETq0qjXg==",
+      "dev": true,
+      "dependencies": {
+        "@babel/types": "^7.22.5"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/helper-module-transforms": {
+      "version": "7.22.9",
+      "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.22.9.tgz",
+      "integrity": "sha512-t+WA2Xn5K+rTeGtC8jCsdAH52bjggG5TKRuRrAGNM/mjIbO4GxvlLMFOEz9wXY5I2XQ60PMFsAG2WIcG82dQMQ==",
+      "dev": true,
+      "dependencies": {
+        "@babel/helper-environment-visitor": "^7.22.5",
+        "@babel/helper-module-imports": "^7.22.5",
+        "@babel/helper-simple-access": "^7.22.5",
+        "@babel/helper-split-export-declaration": "^7.22.6",
+        "@babel/helper-validator-identifier": "^7.22.5"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      },
+      "peerDependencies": {
+        "@babel/core": "^7.0.0"
+      }
+    },
+    "node_modules/@babel/helper-plugin-utils": {
+      "version": "7.22.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.22.5.tgz",
+      "integrity": "sha512-uLls06UVKgFG9QD4OeFYLEGteMIAa5kpTPcFL28yuCIIzsf6ZyKZMllKVOCZFhiZ5ptnwX4mtKdWCBE/uT4amg==",
+      "dev": true,
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/helper-simple-access": {
+      "version": "7.22.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz",
+      "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==",
+      "dev": true,
+      "dependencies": {
+        "@babel/types": "^7.22.5"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/helper-split-export-declaration": {
+      "version": "7.22.6",
+      "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz",
+      "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==",
+      "dev": true,
+      "dependencies": {
+        "@babel/types": "^7.22.5"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/helper-string-parser": {
+      "version": "7.22.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz",
+      "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==",
+      "dev": true,
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/helper-validator-identifier": {
+      "version": "7.22.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz",
+      "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/helper-validator-option": {
+      "version": "7.22.5",
+      "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz",
+      "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==",
+      "dev": true,
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/helpers": {
+      "version": "7.22.6",
+      "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.22.6.tgz",
+      "integrity": "sha512-YjDs6y/fVOYFV8hAf1rxd1QvR9wJe1pDBZ2AREKq/SDayfPzgk0PBnVuTCE5X1acEpMMNOVUqoe+OwiZGJ+OaA==",
+      "dev": true,
+      "dependencies": {
+        "@babel/template": "^7.22.5",
+        "@babel/traverse": "^7.22.6",
+        "@babel/types": "^7.22.5"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/highlight": {
+      "version": "7.22.5",
+      "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz",
+      "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==",
+      "dev": true,
+      "dependencies": {
+        "@babel/helper-validator-identifier": "^7.22.5",
+        "chalk": "^2.0.0",
+        "js-tokens": "^4.0.0"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/parser": {
+      "version": "7.22.7",
+      "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.22.7.tgz",
+      "integrity": "sha512-7NF8pOkHP5o2vpmGgNGcfAeCvOYhGLyA3Z4eBQkT1RJlWu47n63bCs93QfJ2hIAFCil7L5P2IWhs1oToVgrL0Q==",
+      "dev": true,
+      "bin": {
+        "parser": "bin/babel-parser.js"
+      },
+      "engines": {
+        "node": ">=6.0.0"
+      }
+    },
+    "node_modules/@babel/plugin-syntax-object-rest-spread": {
+      "version": "7.8.3",
+      "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz",
+      "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==",
+      "dev": true,
+      "dependencies": {
+        "@babel/helper-plugin-utils": "^7.8.0"
+      },
+      "peerDependencies": {
+        "@babel/core": "^7.0.0-0"
+      }
+    },
+    "node_modules/@babel/template": {
+      "version": "7.22.5",
+      "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz",
+      "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==",
+      "dev": true,
+      "dependencies": {
+        "@babel/code-frame": "^7.22.5",
+        "@babel/parser": "^7.22.5",
+        "@babel/types": "^7.22.5"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/traverse": {
+      "version": "7.22.8",
+      "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.22.8.tgz",
+      "integrity": "sha512-y6LPR+wpM2I3qJrsheCTwhIinzkETbplIgPBbwvqPKc+uljeA5gP+3nP8irdYt1mjQaDnlIcG+dw8OjAco4GXw==",
+      "dev": true,
+      "dependencies": {
+        "@babel/code-frame": "^7.22.5",
+        "@babel/generator": "^7.22.7",
+        "@babel/helper-environment-visitor": "^7.22.5",
+        "@babel/helper-function-name": "^7.22.5",
+        "@babel/helper-hoist-variables": "^7.22.5",
+        "@babel/helper-split-export-declaration": "^7.22.6",
+        "@babel/parser": "^7.22.7",
+        "@babel/types": "^7.22.5",
+        "debug": "^4.1.0",
+        "globals": "^11.1.0"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@babel/types": {
+      "version": "7.22.5",
+      "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.22.5.tgz",
+      "integrity": "sha512-zo3MIHGOkPOfoRXitsgHLjEXmlDaD/5KU1Uzuc9GNiZPhSqVxVRtxuPaSBZDsYZ9qV88AjtMtWW7ww98loJ9KA==",
+      "dev": true,
+      "dependencies": {
+        "@babel/helper-string-parser": "^7.22.5",
+        "@babel/helper-validator-identifier": "^7.22.5",
+        "to-fast-properties": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/@cnakazawa/watch": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz",
+      "integrity": "sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ==",
+      "dev": true,
+      "dependencies": {
+        "exec-sh": "^0.3.2",
+        "minimist": "^1.2.0"
+      },
+      "bin": {
+        "watch": "cli.js"
+      },
+      "engines": {
+        "node": ">=0.1.95"
+      }
+    },
+    "node_modules/@jest/console": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.9.0.tgz",
+      "integrity": "sha512-Zuj6b8TnKXi3q4ymac8EQfc3ea/uhLeCGThFqXeC8H9/raaH8ARPUTdId+XyGd03Z4In0/VjD2OYFcBF09fNLQ==",
+      "dev": true,
+      "dependencies": {
+        "@jest/source-map": "^24.9.0",
+        "chalk": "^2.0.1",
+        "slash": "^2.0.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/@jest/core": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/@jest/core/-/core-24.9.0.tgz",
+      "integrity": "sha512-Fogg3s4wlAr1VX7q+rhV9RVnUv5tD7VuWfYy1+whMiWUrvl7U3QJSJyWcDio9Lq2prqYsZaeTv2Rz24pWGkJ2A==",
+      "dev": true,
+      "dependencies": {
+        "@jest/console": "^24.7.1",
+        "@jest/reporters": "^24.9.0",
+        "@jest/test-result": "^24.9.0",
+        "@jest/transform": "^24.9.0",
+        "@jest/types": "^24.9.0",
+        "ansi-escapes": "^3.0.0",
+        "chalk": "^2.0.1",
+        "exit": "^0.1.2",
+        "graceful-fs": "^4.1.15",
+        "jest-changed-files": "^24.9.0",
+        "jest-config": "^24.9.0",
+        "jest-haste-map": "^24.9.0",
+        "jest-message-util": "^24.9.0",
+        "jest-regex-util": "^24.3.0",
+        "jest-resolve": "^24.9.0",
+        "jest-resolve-dependencies": "^24.9.0",
+        "jest-runner": "^24.9.0",
+        "jest-runtime": "^24.9.0",
+        "jest-snapshot": "^24.9.0",
+        "jest-util": "^24.9.0",
+        "jest-validate": "^24.9.0",
+        "jest-watcher": "^24.9.0",
+        "micromatch": "^3.1.10",
+        "p-each-series": "^1.0.0",
+        "realpath-native": "^1.1.0",
+        "rimraf": "^2.5.4",
+        "slash": "^2.0.0",
+        "strip-ansi": "^5.0.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/@jest/core/node_modules/strip-ansi": {
+      "version": "5.2.0",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+      "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
+      "dev": true,
+      "dependencies": {
+        "ansi-regex": "^4.1.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/@jest/environment": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-24.9.0.tgz",
+      "integrity": "sha512-5A1QluTPhvdIPFYnO3sZC3smkNeXPVELz7ikPbhUj0bQjB07EoE9qtLrem14ZUYWdVayYbsjVwIiL4WBIMV4aQ==",
+      "dev": true,
+      "dependencies": {
+        "@jest/fake-timers": "^24.9.0",
+        "@jest/transform": "^24.9.0",
+        "@jest/types": "^24.9.0",
+        "jest-mock": "^24.9.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/@jest/fake-timers": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-24.9.0.tgz",
+      "integrity": "sha512-eWQcNa2YSwzXWIMC5KufBh3oWRIijrQFROsIqt6v/NS9Io/gknw1jsAC9c+ih/RQX4A3O7SeWAhQeN0goKhT9A==",
+      "dev": true,
+      "dependencies": {
+        "@jest/types": "^24.9.0",
+        "jest-message-util": "^24.9.0",
+        "jest-mock": "^24.9.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/@jest/reporters": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-24.9.0.tgz",
+      "integrity": "sha512-mu4X0yjaHrffOsWmVLzitKmmmWSQ3GGuefgNscUSWNiUNcEOSEQk9k3pERKEQVBb0Cnn88+UESIsZEMH3o88Gw==",
+      "dev": true,
+      "dependencies": {
+        "@jest/environment": "^24.9.0",
+        "@jest/test-result": "^24.9.0",
+        "@jest/transform": "^24.9.0",
+        "@jest/types": "^24.9.0",
+        "chalk": "^2.0.1",
+        "exit": "^0.1.2",
+        "glob": "^7.1.2",
+        "istanbul-lib-coverage": "^2.0.2",
+        "istanbul-lib-instrument": "^3.0.1",
+        "istanbul-lib-report": "^2.0.4",
+        "istanbul-lib-source-maps": "^3.0.1",
+        "istanbul-reports": "^2.2.6",
+        "jest-haste-map": "^24.9.0",
+        "jest-resolve": "^24.9.0",
+        "jest-runtime": "^24.9.0",
+        "jest-util": "^24.9.0",
+        "jest-worker": "^24.6.0",
+        "node-notifier": "^5.4.2",
+        "slash": "^2.0.0",
+        "source-map": "^0.6.0",
+        "string-length": "^2.0.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/@jest/reporters/node_modules/source-map": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/@jest/source-map": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-24.9.0.tgz",
+      "integrity": "sha512-/Xw7xGlsZb4MJzNDgB7PW5crou5JqWiBQaz6xyPd3ArOg2nfn/PunV8+olXbbEZzNl591o5rWKE9BRDaFAuIBg==",
+      "dev": true,
+      "dependencies": {
+        "callsites": "^3.0.0",
+        "graceful-fs": "^4.1.15",
+        "source-map": "^0.6.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/@jest/source-map/node_modules/source-map": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/@jest/test-result": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-24.9.0.tgz",
+      "integrity": "sha512-XEFrHbBonBJ8dGp2JmF8kP/nQI/ImPpygKHwQ/SY+es59Z3L5PI4Qb9TQQMAEeYsThG1xF0k6tmG0tIKATNiiA==",
+      "dev": true,
+      "dependencies": {
+        "@jest/console": "^24.9.0",
+        "@jest/types": "^24.9.0",
+        "@types/istanbul-lib-coverage": "^2.0.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/@jest/test-sequencer": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-24.9.0.tgz",
+      "integrity": "sha512-6qqsU4o0kW1dvA95qfNog8v8gkRN9ph6Lz7r96IvZpHdNipP2cBcb07J1Z45mz/VIS01OHJ3pY8T5fUY38tg4A==",
+      "dev": true,
+      "dependencies": {
+        "@jest/test-result": "^24.9.0",
+        "jest-haste-map": "^24.9.0",
+        "jest-runner": "^24.9.0",
+        "jest-runtime": "^24.9.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/@jest/transform": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-24.9.0.tgz",
+      "integrity": "sha512-TcQUmyNRxV94S0QpMOnZl0++6RMiqpbH/ZMccFB/amku6Uwvyb1cjYX7xkp5nGNkbX4QPH/FcB6q1HBTHynLmQ==",
+      "dev": true,
+      "dependencies": {
+        "@babel/core": "^7.1.0",
+        "@jest/types": "^24.9.0",
+        "babel-plugin-istanbul": "^5.1.0",
+        "chalk": "^2.0.1",
+        "convert-source-map": "^1.4.0",
+        "fast-json-stable-stringify": "^2.0.0",
+        "graceful-fs": "^4.1.15",
+        "jest-haste-map": "^24.9.0",
+        "jest-regex-util": "^24.9.0",
+        "jest-util": "^24.9.0",
+        "micromatch": "^3.1.10",
+        "pirates": "^4.0.1",
+        "realpath-native": "^1.1.0",
+        "slash": "^2.0.0",
+        "source-map": "^0.6.1",
+        "write-file-atomic": "2.4.1"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/@jest/transform/node_modules/convert-source-map": {
+      "version": "1.9.0",
+      "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz",
+      "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==",
+      "dev": true
+    },
+    "node_modules/@jest/transform/node_modules/source-map": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/@jest/types": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.9.0.tgz",
+      "integrity": "sha512-XKK7ze1apu5JWQ5eZjHITP66AX+QsLlbaJRBGYr8pNzwcAE2JVkwnf0yqjHTsDRcjR0mujy/NmZMXw5kl+kGBw==",
+      "dev": true,
+      "dependencies": {
+        "@types/istanbul-lib-coverage": "^2.0.0",
+        "@types/istanbul-reports": "^1.1.1",
+        "@types/yargs": "^13.0.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/@jridgewell/gen-mapping": {
+      "version": "0.3.3",
+      "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz",
+      "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==",
+      "dev": true,
+      "dependencies": {
+        "@jridgewell/set-array": "^1.0.1",
+        "@jridgewell/sourcemap-codec": "^1.4.10",
+        "@jridgewell/trace-mapping": "^0.3.9"
+      },
+      "engines": {
+        "node": ">=6.0.0"
+      }
+    },
+    "node_modules/@jridgewell/resolve-uri": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz",
+      "integrity": "sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w==",
+      "dev": true,
+      "engines": {
+        "node": ">=6.0.0"
+      }
+    },
+    "node_modules/@jridgewell/set-array": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz",
+      "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==",
+      "dev": true,
+      "engines": {
+        "node": ">=6.0.0"
+      }
+    },
+    "node_modules/@jridgewell/sourcemap-codec": {
+      "version": "1.4.15",
+      "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz",
+      "integrity": "sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==",
+      "dev": true
+    },
+    "node_modules/@jridgewell/trace-mapping": {
+      "version": "0.3.18",
+      "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz",
+      "integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==",
+      "dev": true,
+      "dependencies": {
+        "@jridgewell/resolve-uri": "3.1.0",
+        "@jridgewell/sourcemap-codec": "1.4.14"
+      }
+    },
+    "node_modules/@jridgewell/trace-mapping/node_modules/@jridgewell/sourcemap-codec": {
+      "version": "1.4.14",
+      "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz",
+      "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==",
+      "dev": true
+    },
+    "node_modules/@types/babel__core": {
+      "version": "7.20.1",
+      "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.1.tgz",
+      "integrity": "sha512-aACu/U/omhdk15O4Nfb+fHgH/z3QsfQzpnvRZhYhThms83ZnAOZz7zZAWO7mn2yyNQaA4xTO8GLK3uqFU4bYYw==",
+      "dev": true,
+      "dependencies": {
+        "@babel/parser": "^7.20.7",
+        "@babel/types": "^7.20.7",
+        "@types/babel__generator": "*",
+        "@types/babel__template": "*",
+        "@types/babel__traverse": "*"
+      }
+    },
+    "node_modules/@types/babel__generator": {
+      "version": "7.6.4",
+      "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.4.tgz",
+      "integrity": "sha512-tFkciB9j2K755yrTALxD44McOrk+gfpIpvC3sxHjRawj6PfnQxrse4Clq5y/Rq+G3mrBurMax/lG8Qn2t9mSsg==",
+      "dev": true,
+      "dependencies": {
+        "@babel/types": "^7.0.0"
+      }
+    },
+    "node_modules/@types/babel__template": {
+      "version": "7.4.1",
+      "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.1.tgz",
+      "integrity": "sha512-azBFKemX6kMg5Io+/rdGT0dkGreboUVR0Cdm3fz9QJWpaQGJRQXl7C+6hOTCZcMll7KFyEQpgbYI2lHdsS4U7g==",
+      "dev": true,
+      "dependencies": {
+        "@babel/parser": "^7.1.0",
+        "@babel/types": "^7.0.0"
+      }
+    },
+    "node_modules/@types/babel__traverse": {
+      "version": "7.20.1",
+      "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.1.tgz",
+      "integrity": "sha512-MitHFXnhtgwsGZWtT68URpOvLN4EREih1u3QtQiN4VdAxWKRVvGCSvw/Qth0M0Qq3pJpnGOu5JaM/ydK7OGbqg==",
+      "dev": true,
+      "dependencies": {
+        "@babel/types": "^7.20.7"
+      }
+    },
+    "node_modules/@types/clone": {
+      "version": "0.1.30",
+      "resolved": "https://registry.npmjs.org/@types/clone/-/clone-0.1.30.tgz",
+      "integrity": "sha512-vcxBr+ybljeSiasmdke1cQ9ICxoEwaBgM1OQ/P5h4MPj/kRyLcDl5L8PrftlbyV1kBbJIs3M3x1A1+rcWd4mEA=="
+    },
+    "node_modules/@types/istanbul-lib-coverage": {
+      "version": "2.0.4",
+      "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz",
+      "integrity": "sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g==",
+      "dev": true
+    },
+    "node_modules/@types/istanbul-lib-report": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz",
+      "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==",
+      "dev": true,
+      "dependencies": {
+        "@types/istanbul-lib-coverage": "*"
+      }
+    },
+    "node_modules/@types/istanbul-reports": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz",
+      "integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==",
+      "dev": true,
+      "dependencies": {
+        "@types/istanbul-lib-coverage": "*",
+        "@types/istanbul-lib-report": "*"
+      }
+    },
+    "node_modules/@types/jest": {
+      "version": "24.9.1",
+      "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.9.1.tgz",
+      "integrity": "sha512-Fb38HkXSVA4L8fGKEZ6le5bB8r6MRWlOCZbVuWZcmOMSCd2wCYOwN1ibj8daIoV9naq7aaOZjrLCoCMptKU/4Q==",
+      "dev": true,
+      "dependencies": {
+        "jest-diff": "^24.3.0"
+      }
+    },
+    "node_modules/@types/json5": {
+      "version": "0.0.30",
+      "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.30.tgz",
+      "integrity": "sha512-sqm9g7mHlPY/43fcSNrCYfOeX9zkTTK+euO5E6+CVijSMm5tTjkVdwdqRkY3ljjIAf8679vps5jKUoJBCLsMDA=="
+    },
+    "node_modules/@types/lodash": {
+      "version": "4.14.196",
+      "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.196.tgz",
+      "integrity": "sha512-22y3o88f4a94mKljsZcanlNWPzO0uBsBdzLAngf2tp533LzZcQzb6+eZPJ+vCTt+bqF2XnvT9gejTLsAcJAJyQ=="
+    },
+    "node_modules/@types/node": {
+      "version": "11.15.54",
+      "resolved": "https://registry.npmjs.org/@types/node/-/node-11.15.54.tgz",
+      "integrity": "sha512-1RWYiq+5UfozGsU6MwJyFX6BtktcT10XRjvcAQmskCtMcW3tPske88lM/nHv7BQG1w9KBXI1zPGuu5PnNCX14g==",
+      "dev": true
+    },
+    "node_modules/@types/stack-utils": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz",
+      "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==",
+      "dev": true
+    },
+    "node_modules/@types/yargs": {
+      "version": "13.0.12",
+      "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-13.0.12.tgz",
+      "integrity": "sha512-qCxJE1qgz2y0hA4pIxjBR+PelCH0U5CK1XJXFwCNqfmliatKp47UCXXE9Dyk1OXBDLvsCF57TqQEJaeLfDYEOQ==",
+      "dev": true,
+      "dependencies": {
+        "@types/yargs-parser": "*"
+      }
+    },
+    "node_modules/@types/yargs-parser": {
+      "version": "21.0.0",
+      "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.0.tgz",
+      "integrity": "sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA==",
+      "dev": true
+    },
+    "node_modules/abab": {
+      "version": "2.0.6",
+      "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.6.tgz",
+      "integrity": "sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==",
+      "dev": true
+    },
+    "node_modules/accessory": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/accessory/-/accessory-1.1.0.tgz",
+      "integrity": "sha512-DlgiZ+jTuCIZLURquQhOfclRvPu6gQKgOzr9wAiZtjWYjd1lMK8Hr6XXEDWuEAxpTWEccgn6YVREJ6C7fhvrww==",
+      "dev": true,
+      "dependencies": {
+        "ap": "~0.2.0",
+        "balanced-match": "~0.2.0",
+        "dot-parts": "~1.0.0"
+      }
+    },
+    "node_modules/acorn": {
+      "version": "6.4.2",
+      "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.4.2.tgz",
+      "integrity": "sha512-XtGIhXwF8YM8bJhGxG5kXgjkEuNGLTkoYqVE+KMR+aspr4KGYmKYg7yUe3KghyQ9yheNwLnjmzh/7+gfDBmHCQ==",
+      "dev": true,
+      "bin": {
+        "acorn": "bin/acorn"
+      },
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
+    "node_modules/acorn-globals": {
+      "version": "4.3.4",
+      "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.4.tgz",
+      "integrity": "sha512-clfQEh21R+D0leSbUdWf3OcfqyaCSAQ8Ryq00bofSekfr9W8u1jyYZo6ir0xu9Gtcf7BjcHJpnbZH7JOCpP60A==",
+      "dev": true,
+      "dependencies": {
+        "acorn": "^6.0.1",
+        "acorn-walk": "^6.0.1"
+      }
+    },
+    "node_modules/acorn-globals/node_modules/acorn-walk": {
+      "version": "6.2.0",
+      "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-6.2.0.tgz",
+      "integrity": "sha512-7evsyfH1cLOCdAzZAd43Cic04yKydNx0cF+7tiA19p1XnLLPU4dpCQOqpjqwokFe//vS0QqfqqjCS2JkiIs0cA==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
+    "node_modules/acorn-jsx": {
+      "version": "5.3.2",
+      "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
+      "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
+      "dev": true,
+      "peerDependencies": {
+        "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
+      }
+    },
+    "node_modules/acorn-node": {
+      "version": "1.8.2",
+      "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.8.2.tgz",
+      "integrity": "sha512-8mt+fslDufLYntIoPAaIMUe/lrbrehIiwmR3t2k9LljIzoigEPF27eLk2hy8zSGzmR/ogr7zbRKINMo1u0yh5A==",
+      "dev": true,
+      "dependencies": {
+        "acorn": "^7.0.0",
+        "acorn-walk": "^7.0.0",
+        "xtend": "^4.0.2"
+      }
+    },
+    "node_modules/acorn-node/node_modules/acorn": {
+      "version": "7.4.1",
+      "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
+      "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==",
+      "dev": true,
+      "bin": {
+        "acorn": "bin/acorn"
+      },
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
+    "node_modules/acorn-walk": {
+      "version": "7.2.0",
+      "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz",
+      "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
+    "node_modules/ajv": {
+      "version": "6.12.6",
+      "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz",
+      "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==",
+      "dependencies": {
+        "fast-deep-equal": "^3.1.1",
+        "fast-json-stable-stringify": "^2.0.0",
+        "json-schema-traverse": "^0.4.1",
+        "uri-js": "^4.2.2"
+      },
+      "funding": {
+        "type": "github",
+        "url": "https://github.com/sponsors/epoberezkin"
+      }
+    },
+    "node_modules/ajv-errors": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz",
+      "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==",
+      "peerDependencies": {
+        "ajv": ">=5.0.0"
+      }
+    },
+    "node_modules/amdefine": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
+      "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==",
+      "dev": true,
+      "optional": true,
+      "engines": {
+        "node": ">=0.4.2"
+      }
+    },
+    "node_modules/ansi-escapes": {
+      "version": "3.2.0",
+      "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz",
+      "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/ansi-regex": {
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.1.tgz",
+      "integrity": "sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g==",
+      "dev": true,
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/ansi-styles": {
+      "version": "3.2.1",
+      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
+      "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
+      "dev": true,
+      "dependencies": {
+        "color-convert": "^1.9.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/anymatch": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz",
+      "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==",
+      "dev": true,
+      "dependencies": {
+        "micromatch": "^3.1.4",
+        "normalize-path": "^2.1.1"
+      }
+    },
+    "node_modules/ap": {
+      "version": "0.2.0",
+      "resolved": "https://registry.npmjs.org/ap/-/ap-0.2.0.tgz",
+      "integrity": "sha512-ImdvquIuBSVpWRWhB441UjvTcZqic1RL+lTQaUKGdGEp1aiTvt/phAvY8Vvs32qya5FJBI8U+tzNBYzFDQY/lQ==",
+      "dev": true
+    },
+    "node_modules/argparse": {
+      "version": "1.0.10",
+      "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
+      "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
+      "dev": true,
+      "dependencies": {
+        "sprintf-js": "~1.0.2"
+      }
+    },
+    "node_modules/arr-diff": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz",
+      "integrity": "sha512-YVIQ82gZPGBebQV/a8dar4AitzCQs0jjXwMPZllpXMaGjXPYVUawSxQrRsjhjupyVxEvbHgUmIhKVlND+j02kA==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/arr-flatten": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz",
+      "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/arr-union": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz",
+      "integrity": "sha512-sKpyeERZ02v1FeCZT8lrfJq5u6goHCtpTAzPwJYe7c8SPFOboNjNg1vz2L4VTn9T4PQxEx13TbXLmYUcS6Ug7Q==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/array-buffer-byte-length": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz",
+      "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "is-array-buffer": "^3.0.1"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/array-equal": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/array-equal/-/array-equal-1.0.0.tgz",
+      "integrity": "sha512-H3LU5RLiSsGXPhN+Nipar0iR0IofH+8r89G2y1tBKxQ/agagKyAjhkAFDRBfodP2caPrNKHpAWNIM/c9yeL7uA==",
+      "dev": true
+    },
+    "node_modules/array-from": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz",
+      "integrity": "sha512-GQTc6Uupx1FCavi5mPzBvVT7nEOeWMmUA9P95wpfpW1XwMSKs+KaymD5C2Up7KAUKg/mYwbsUYzdZWcoajlNZg==",
+      "dev": true
+    },
+    "node_modules/array-unique": {
+      "version": "0.3.2",
+      "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz",
+      "integrity": "sha512-SleRWjh9JUud2wH1hPs9rZBZ33H6T9HOiL0uwGnGx9FpE6wKGyfWugmbkEOIs6qWrZhg0LWeLziLrEwQJhs5mQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/array.prototype.reduce": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/array.prototype.reduce/-/array.prototype.reduce-1.0.5.tgz",
+      "integrity": "sha512-kDdugMl7id9COE8R7MHF5jWk7Dqt/fs4Pv+JXoICnYwqpjjjbUurz6w5fT5IG6brLdJhv6/VoHB0H7oyIBXd+Q==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "define-properties": "^1.1.4",
+        "es-abstract": "^1.20.4",
+        "es-array-method-boxes-properly": "^1.0.0",
+        "is-string": "^1.0.7"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/arraybuffer.prototype.slice": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.1.tgz",
+      "integrity": "sha512-09x0ZWFEjj4WD8PDbykUwo3t9arLn8NIzmmYEJFpYekOAQjpkGSyrQhNoRTcwwcFRu+ycWF78QZ63oWTqSjBcw==",
+      "dev": true,
+      "dependencies": {
+        "array-buffer-byte-length": "^1.0.0",
+        "call-bind": "^1.0.2",
+        "define-properties": "^1.2.0",
+        "get-intrinsic": "^1.2.1",
+        "is-array-buffer": "^3.0.2",
+        "is-shared-array-buffer": "^1.0.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/asn1": {
+      "version": "0.2.6",
+      "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz",
+      "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==",
+      "dev": true,
+      "dependencies": {
+        "safer-buffer": "~2.1.0"
+      }
+    },
+    "node_modules/asn1.js": {
+      "version": "5.4.1",
+      "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-5.4.1.tgz",
+      "integrity": "sha512-+I//4cYPccV8LdmBLiX8CYvf9Sp3vQsrqu2QNXRcrbiWvcx/UdlFiqUJJzxRQxgsZmvhXhn4cSKeSmoFjVdupA==",
+      "dev": true,
+      "dependencies": {
+        "bn.js": "^4.0.0",
+        "inherits": "^2.0.1",
+        "minimalistic-assert": "^1.0.0",
+        "safer-buffer": "^2.1.0"
+      }
+    },
+    "node_modules/asn1.js/node_modules/bn.js": {
+      "version": "4.12.0",
+      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
+      "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
+      "dev": true
+    },
+    "node_modules/assert": {
+      "version": "1.5.0",
+      "resolved": "https://registry.npmjs.org/assert/-/assert-1.5.0.tgz",
+      "integrity": "sha512-EDsgawzwoun2CZkCgtxJbv392v4nbk9XDD06zI+kQYoBM/3RBWLlEyJARDOmhAAosBjWACEkKL6S+lIZtcAubA==",
+      "dev": true,
+      "dependencies": {
+        "object-assign": "^4.1.1",
+        "util": "0.10.3"
+      }
+    },
+    "node_modules/assert-plus": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz",
+      "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/assert/node_modules/inherits": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz",
+      "integrity": "sha512-8nWq2nLTAwd02jTqJExUYFSD/fKq6VH9Y/oG2accc/kdI0V98Bag8d5a4gi3XHz73rDWa2PvTtvcWYquKqSENA==",
+      "dev": true
+    },
+    "node_modules/assert/node_modules/util": {
+      "version": "0.10.3",
+      "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz",
+      "integrity": "sha512-5KiHfsmkqacuKjkRkdV7SsfDJ2EGiPsK92s2MhNSY0craxjTdKTtqKsJaCWp4LW33ZZ0OPUv1WO/TFvNQRiQxQ==",
+      "dev": true,
+      "dependencies": {
+        "inherits": "2.0.1"
+      }
+    },
+    "node_modules/assign-symbols": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz",
+      "integrity": "sha512-Q+JC7Whu8HhmTdBph/Tq59IoRtoy6KAm5zzPv00WdujX82lbAL8K7WVjne7vdCsAmbF4AYaDOPyO3k0kl8qIrw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/astral-regex": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz",
+      "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/async-limiter": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz",
+      "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==",
+      "dev": true
+    },
+    "node_modules/asynckit": {
+      "version": "0.4.0",
+      "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
+      "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
+      "dev": true
+    },
+    "node_modules/atob": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz",
+      "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==",
+      "dev": true,
+      "bin": {
+        "atob": "bin/atob.js"
+      },
+      "engines": {
+        "node": ">= 4.5.0"
+      }
+    },
+    "node_modules/available-typed-arrays": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz",
+      "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/aws-sign2": {
+      "version": "0.7.0",
+      "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz",
+      "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==",
+      "dev": true,
+      "engines": {
+        "node": "*"
+      }
+    },
+    "node_modules/aws4": {
+      "version": "1.12.0",
+      "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.12.0.tgz",
+      "integrity": "sha512-NmWvPnx0F1SfrQbYwOi7OeaNGokp9XhzNioJ/CSBs8Qa4vxug81mhJEAVZwxXuBmYB5KDRfMq/F3RR0BIU7sWg==",
+      "dev": true
+    },
+    "node_modules/babel-jest": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.9.0.tgz",
+      "integrity": "sha512-ntuddfyiN+EhMw58PTNL1ph4C9rECiQXjI4nMMBKBaNjXvqLdkXpPRcMSr4iyBrJg/+wz9brFUD6RhOAT6r4Iw==",
+      "dev": true,
+      "dependencies": {
+        "@jest/transform": "^24.9.0",
+        "@jest/types": "^24.9.0",
+        "@types/babel__core": "^7.1.0",
+        "babel-plugin-istanbul": "^5.1.0",
+        "babel-preset-jest": "^24.9.0",
+        "chalk": "^2.4.2",
+        "slash": "^2.0.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      },
+      "peerDependencies": {
+        "@babel/core": "^7.0.0"
+      }
+    },
+    "node_modules/babel-plugin-istanbul": {
+      "version": "5.2.0",
+      "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.2.0.tgz",
+      "integrity": "sha512-5LphC0USA8t4i1zCtjbbNb6jJj/9+X6P37Qfirc/70EQ34xKlMW+a1RHGwxGI+SwWpNwZ27HqvzAobeqaXwiZw==",
+      "dev": true,
+      "dependencies": {
+        "@babel/helper-plugin-utils": "^7.0.0",
+        "find-up": "^3.0.0",
+        "istanbul-lib-instrument": "^3.3.0",
+        "test-exclude": "^5.2.3"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/babel-plugin-jest-hoist": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.9.0.tgz",
+      "integrity": "sha512-2EMA2P8Vp7lG0RAzr4HXqtYwacfMErOuv1U3wrvxHX6rD1sV6xS3WXG3r8TRQ2r6w8OhvSdWt+z41hQNwNm3Xw==",
+      "dev": true,
+      "dependencies": {
+        "@types/babel__traverse": "^7.0.6"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/babel-preset-jest": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.9.0.tgz",
+      "integrity": "sha512-izTUuhE4TMfTRPF92fFwD2QfdXaZW08qvWTFCI51V8rW5x00UuPgc3ajRoWofXOuxjfcOM5zzSYsQS3H8KGCAg==",
+      "dev": true,
+      "dependencies": {
+        "@babel/plugin-syntax-object-rest-spread": "^7.0.0",
+        "babel-plugin-jest-hoist": "^24.9.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      },
+      "peerDependencies": {
+        "@babel/core": "^7.0.0"
+      }
+    },
+    "node_modules/balanced-match": {
+      "version": "0.2.1",
+      "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.1.tgz",
+      "integrity": "sha512-euSOvfze1jPOf85KQOmZ2UcWDJ/dUJukTJdj4o9ZZLyjl7IjdIyE4fAQRSuGrxAjB9nvvvrl4N3bPtRq+W+SyQ==",
+      "dev": true
+    },
+    "node_modules/base": {
+      "version": "0.11.2",
+      "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz",
+      "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==",
+      "dev": true,
+      "dependencies": {
+        "cache-base": "^1.0.1",
+        "class-utils": "^0.3.5",
+        "component-emitter": "^1.2.1",
+        "define-property": "^1.0.0",
+        "isobject": "^3.0.1",
+        "mixin-deep": "^1.2.0",
+        "pascalcase": "^0.1.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/base/node_modules/define-property": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+      "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==",
+      "dev": true,
+      "dependencies": {
+        "is-descriptor": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/base64-js": {
+      "version": "1.5.1",
+      "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
+      "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
+      "dev": true,
+      "funding": [
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/feross"
+        },
+        {
+          "type": "patreon",
+          "url": "https://www.patreon.com/feross"
+        },
+        {
+          "type": "consulting",
+          "url": "https://feross.org/support"
+        }
+      ]
+    },
+    "node_modules/bcrypt-pbkdf": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz",
+      "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==",
+      "dev": true,
+      "dependencies": {
+        "tweetnacl": "^0.14.3"
+      }
+    },
+    "node_modules/bindings": {
+      "version": "1.5.0",
+      "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz",
+      "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==",
+      "dev": true,
+      "optional": true,
+      "dependencies": {
+        "file-uri-to-path": "1.0.0"
+      }
+    },
+    "node_modules/bn.js": {
+      "version": "5.2.1",
+      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz",
+      "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==",
+      "dev": true
+    },
+    "node_modules/brace-expansion": {
+      "version": "1.1.11",
+      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
+      "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
+      "dev": true,
+      "dependencies": {
+        "balanced-match": "^1.0.0",
+        "concat-map": "0.0.1"
+      }
+    },
+    "node_modules/brace-expansion/node_modules/balanced-match": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz",
+      "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
+      "dev": true
+    },
+    "node_modules/braces": {
+      "version": "2.3.2",
+      "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz",
+      "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==",
+      "dev": true,
+      "dependencies": {
+        "arr-flatten": "^1.1.0",
+        "array-unique": "^0.3.2",
+        "extend-shallow": "^2.0.1",
+        "fill-range": "^4.0.0",
+        "isobject": "^3.0.1",
+        "repeat-element": "^1.1.2",
+        "snapdragon": "^0.8.1",
+        "snapdragon-node": "^2.0.1",
+        "split-string": "^3.0.2",
+        "to-regex": "^3.0.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/braces/node_modules/extend-shallow": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+      "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
+      "dev": true,
+      "dependencies": {
+        "is-extendable": "^0.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/braces/node_modules/is-extendable": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+      "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/brfs": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/brfs/-/brfs-2.0.2.tgz",
+      "integrity": "sha512-IrFjVtwu4eTJZyu8w/V2gxU7iLTtcHih67sgEdzrhjLBMHp2uYefUBfdM4k2UvcuWMgV7PQDZHSLeNWnLFKWVQ==",
+      "dev": true,
+      "dependencies": {
+        "quote-stream": "^1.0.1",
+        "resolve": "^1.1.5",
+        "static-module": "^3.0.2",
+        "through2": "^2.0.0"
+      },
+      "bin": {
+        "brfs": "bin/cmd.js"
+      }
+    },
+    "node_modules/brorand": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
+      "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==",
+      "dev": true
+    },
+    "node_modules/browser-pack": {
+      "version": "6.1.0",
+      "resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-6.1.0.tgz",
+      "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==",
+      "dev": true,
+      "dependencies": {
+        "combine-source-map": "~0.8.0",
+        "defined": "^1.0.0",
+        "JSONStream": "^1.0.3",
+        "safe-buffer": "^5.1.1",
+        "through2": "^2.0.0",
+        "umd": "^3.0.0"
+      },
+      "bin": {
+        "browser-pack": "bin/cmd.js"
+      }
+    },
+    "node_modules/browser-process-hrtime": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz",
+      "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==",
+      "dev": true
+    },
+    "node_modules/browser-resolve": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-2.0.0.tgz",
+      "integrity": "sha512-7sWsQlYL2rGLy2IWm8WL8DCTJvYLc/qlOnsakDac87SOoCd16WLsaAMdCiAqsTNHIe+SXfaqyxyo6THoWqs8WQ==",
+      "dev": true,
+      "dependencies": {
+        "resolve": "^1.17.0"
+      }
+    },
+    "node_modules/browserify": {
+      "version": "16.5.2",
+      "resolved": "https://registry.npmjs.org/browserify/-/browserify-16.5.2.tgz",
+      "integrity": "sha512-TkOR1cQGdmXU9zW4YukWzWVSJwrxmNdADFbqbE3HFgQWe5wqZmOawqZ7J/8MPCwk/W8yY7Y0h+7mOtcZxLP23g==",
+      "dev": true,
+      "dependencies": {
+        "assert": "^1.4.0",
+        "browser-pack": "^6.0.1",
+        "browser-resolve": "^2.0.0",
+        "browserify-zlib": "~0.2.0",
+        "buffer": "~5.2.1",
+        "cached-path-relative": "^1.0.0",
+        "concat-stream": "^1.6.0",
+        "console-browserify": "^1.1.0",
+        "constants-browserify": "~1.0.0",
+        "crypto-browserify": "^3.0.0",
+        "defined": "^1.0.0",
+        "deps-sort": "^2.0.0",
+        "domain-browser": "^1.2.0",
+        "duplexer2": "~0.1.2",
+        "events": "^2.0.0",
+        "glob": "^7.1.0",
+        "has": "^1.0.0",
+        "htmlescape": "^1.1.0",
+        "https-browserify": "^1.0.0",
+        "inherits": "~2.0.1",
+        "insert-module-globals": "^7.0.0",
+        "JSONStream": "^1.0.3",
+        "labeled-stream-splicer": "^2.0.0",
+        "mkdirp-classic": "^0.5.2",
+        "module-deps": "^6.2.3",
+        "os-browserify": "~0.3.0",
+        "parents": "^1.0.1",
+        "path-browserify": "~0.0.0",
+        "process": "~0.11.0",
+        "punycode": "^1.3.2",
+        "querystring-es3": "~0.2.0",
+        "read-only-stream": "^2.0.0",
+        "readable-stream": "^2.0.2",
+        "resolve": "^1.1.4",
+        "shasum": "^1.0.0",
+        "shell-quote": "^1.6.1",
+        "stream-browserify": "^2.0.0",
+        "stream-http": "^3.0.0",
+        "string_decoder": "^1.1.1",
+        "subarg": "^1.0.0",
+        "syntax-error": "^1.1.1",
+        "through2": "^2.0.0",
+        "timers-browserify": "^1.0.1",
+        "tty-browserify": "0.0.1",
+        "url": "~0.11.0",
+        "util": "~0.10.1",
+        "vm-browserify": "^1.0.0",
+        "xtend": "^4.0.0"
+      },
+      "bin": {
+        "browserify": "bin/cmd.js"
+      },
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
+    "node_modules/browserify-aes": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz",
+      "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==",
+      "dev": true,
+      "dependencies": {
+        "buffer-xor": "^1.0.3",
+        "cipher-base": "^1.0.0",
+        "create-hash": "^1.1.0",
+        "evp_bytestokey": "^1.0.3",
+        "inherits": "^2.0.1",
+        "safe-buffer": "^5.0.1"
+      }
+    },
+    "node_modules/browserify-cipher": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz",
+      "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==",
+      "dev": true,
+      "dependencies": {
+        "browserify-aes": "^1.0.4",
+        "browserify-des": "^1.0.0",
+        "evp_bytestokey": "^1.0.0"
+      }
+    },
+    "node_modules/browserify-des": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz",
+      "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==",
+      "dev": true,
+      "dependencies": {
+        "cipher-base": "^1.0.1",
+        "des.js": "^1.0.0",
+        "inherits": "^2.0.1",
+        "safe-buffer": "^5.1.2"
+      }
+    },
+    "node_modules/browserify-rsa": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.1.0.tgz",
+      "integrity": "sha512-AdEER0Hkspgno2aR97SAf6vi0y0k8NuOpGnVH3O99rcA5Q6sh8QxcngtHuJ6uXwnfAXNM4Gn1Gb7/MV1+Ymbog==",
+      "dev": true,
+      "dependencies": {
+        "bn.js": "^5.0.0",
+        "randombytes": "^2.0.1"
+      }
+    },
+    "node_modules/browserify-shim": {
+      "version": "3.8.16",
+      "resolved": "https://registry.npmjs.org/browserify-shim/-/browserify-shim-3.8.16.tgz",
+      "integrity": "sha512-+Ap0xOKUC5Hz8sdUROxCJHgzA5IeU7pgUquCdlbBxyxkexzU4kpU6u1TsIvnFJcdx1bxO902J08AEjbMqDbA3g==",
+      "dev": true,
+      "dependencies": {
+        "exposify": "~0.5.0",
+        "mothership": "~0.3.0",
+        "rename-function-calls": "~0.1.0",
+        "resolve": "~0.6.1",
+        "through": "~2.3.4"
+      },
+      "peerDependencies": {
+        "browserify": ">= 2.3"
+      }
+    },
+    "node_modules/browserify-shim/node_modules/resolve": {
+      "version": "0.6.3",
+      "resolved": "https://registry.npmjs.org/resolve/-/resolve-0.6.3.tgz",
+      "integrity": "sha512-UHBY3viPlJKf85YijDUcikKX6tmF4SokIDp518ZDVT92JNDcG5uKIthaT/owt3Sar0lwtOafsQuwrg22/v2Dwg==",
+      "dev": true
+    },
+    "node_modules/browserify-sign": {
+      "version": "4.2.1",
+      "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.2.1.tgz",
+      "integrity": "sha512-/vrA5fguVAKKAVTNJjgSm1tRQDHUU6DbwO9IROu/0WAzC8PKhucDSh18J0RMvVeHAn5puMd+QHC2erPRNf8lmg==",
+      "dev": true,
+      "dependencies": {
+        "bn.js": "^5.1.1",
+        "browserify-rsa": "^4.0.1",
+        "create-hash": "^1.2.0",
+        "create-hmac": "^1.1.7",
+        "elliptic": "^6.5.3",
+        "inherits": "^2.0.4",
+        "parse-asn1": "^5.1.5",
+        "readable-stream": "^3.6.0",
+        "safe-buffer": "^5.2.0"
+      }
+    },
+    "node_modules/browserify-sign/node_modules/readable-stream": {
+      "version": "3.6.2",
+      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
+      "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
+      "dev": true,
+      "dependencies": {
+        "inherits": "^2.0.3",
+        "string_decoder": "^1.1.1",
+        "util-deprecate": "^1.0.1"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/browserify-zlib": {
+      "version": "0.2.0",
+      "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz",
+      "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==",
+      "dev": true,
+      "dependencies": {
+        "pako": "~1.0.5"
+      }
+    },
+    "node_modules/browserslist": {
+      "version": "4.21.10",
+      "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.10.tgz",
+      "integrity": "sha512-bipEBdZfVH5/pwrvqc+Ub0kUPVfGUhlKxbvfD+z1BDnPEO/X98ruXGA1WP5ASpAFKan7Qr6j736IacbZQuAlKQ==",
+      "dev": true,
+      "funding": [
+        {
+          "type": "opencollective",
+          "url": "https://opencollective.com/browserslist"
+        },
+        {
+          "type": "tidelift",
+          "url": "https://tidelift.com/funding/github/npm/browserslist"
+        },
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/ai"
+        }
+      ],
+      "dependencies": {
+        "caniuse-lite": "^1.0.30001517",
+        "electron-to-chromium": "^1.4.477",
+        "node-releases": "^2.0.13",
+        "update-browserslist-db": "^1.0.11"
+      },
+      "bin": {
+        "browserslist": "cli.js"
+      },
+      "engines": {
+        "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
+      }
+    },
+    "node_modules/bs-logger": {
+      "version": "0.2.6",
+      "resolved": "https://registry.npmjs.org/bs-logger/-/bs-logger-0.2.6.tgz",
+      "integrity": "sha512-pd8DCoxmbgc7hyPKOvxtqNcjYoOsABPQdcCUjGp3d42VR2CX1ORhk2A87oqqu5R1kk+76nsxZupkmyd+MVtCog==",
+      "dev": true,
+      "dependencies": {
+        "fast-json-stable-stringify": "2.x"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/bser": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz",
+      "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==",
+      "dev": true,
+      "dependencies": {
+        "node-int64": "^0.4.0"
+      }
+    },
+    "node_modules/buffer": {
+      "version": "5.2.1",
+      "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.2.1.tgz",
+      "integrity": "sha512-c+Ko0loDaFfuPWiL02ls9Xd3GO3cPVmUobQ6t3rXNUk304u6hGq+8N/kFi+QEIKhzK3uwolVhLzszmfLmMLnqg==",
+      "dev": true,
+      "dependencies": {
+        "base64-js": "^1.0.2",
+        "ieee754": "^1.1.4"
+      }
+    },
+    "node_modules/buffer-equal": {
+      "version": "0.0.1",
+      "resolved": "https://registry.npmjs.org/buffer-equal/-/buffer-equal-0.0.1.tgz",
+      "integrity": "sha512-RgSV6InVQ9ODPdLWJ5UAqBqJBOg370Nz6ZQtRzpt6nUjc8v0St97uJ4PYC6NztqIScrAXafKM3mZPMygSe1ggA==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
+    "node_modules/buffer-from": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz",
+      "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==",
+      "dev": true
+    },
+    "node_modules/buffer-xor": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz",
+      "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==",
+      "dev": true
+    },
+    "node_modules/builtin-modules": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz",
+      "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/builtin-status-codes": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz",
+      "integrity": "sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==",
+      "dev": true
+    },
+    "node_modules/cache-base": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz",
+      "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==",
+      "dev": true,
+      "dependencies": {
+        "collection-visit": "^1.0.0",
+        "component-emitter": "^1.2.1",
+        "get-value": "^2.0.6",
+        "has-value": "^1.0.0",
+        "isobject": "^3.0.1",
+        "set-value": "^2.0.0",
+        "to-object-path": "^0.3.0",
+        "union-value": "^1.0.0",
+        "unset-value": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/cached-path-relative": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/cached-path-relative/-/cached-path-relative-1.1.0.tgz",
+      "integrity": "sha512-WF0LihfemtesFcJgO7xfOoOcnWzY/QHR4qeDqV44jPU3HTI54+LnfXK3SA27AVVGCdZFgjjFFaqUA9Jx7dMJZA==",
+      "dev": true
+    },
+    "node_modules/call-bind": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz",
+      "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==",
+      "dev": true,
+      "dependencies": {
+        "function-bind": "^1.1.1",
+        "get-intrinsic": "^1.0.2"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/callsites": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
+      "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/camelcase": {
+      "version": "5.3.1",
+      "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
+      "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
+      "dev": true,
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/caniuse-lite": {
+      "version": "1.0.30001519",
+      "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001519.tgz",
+      "integrity": "sha512-0QHgqR+Jv4bxHMp8kZ1Kn8CH55OikjKJ6JmKkZYP1F3D7w+lnFXF70nG5eNfsZS89jadi5Ywy5UCSKLAglIRkg==",
+      "dev": true,
+      "funding": [
+        {
+          "type": "opencollective",
+          "url": "https://opencollective.com/browserslist"
+        },
+        {
+          "type": "tidelift",
+          "url": "https://tidelift.com/funding/github/npm/caniuse-lite"
+        },
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/ai"
+        }
+      ]
+    },
+    "node_modules/capture-exit": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz",
+      "integrity": "sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==",
+      "dev": true,
+      "dependencies": {
+        "rsvp": "^4.8.4"
+      },
+      "engines": {
+        "node": "6.* || 8.* || >= 10.*"
+      }
+    },
+    "node_modules/caseless": {
+      "version": "0.12.0",
+      "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz",
+      "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==",
+      "dev": true
+    },
+    "node_modules/chalk": {
+      "version": "2.4.2",
+      "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
+      "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
+      "dev": true,
+      "dependencies": {
+        "ansi-styles": "^3.2.1",
+        "escape-string-regexp": "^1.0.5",
+        "supports-color": "^5.3.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/chardet": {
+      "version": "0.7.0",
+      "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz",
+      "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==",
+      "dev": true
+    },
+    "node_modules/ci-info": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz",
+      "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==",
+      "dev": true
+    },
+    "node_modules/cipher-base": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz",
+      "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==",
+      "dev": true,
+      "dependencies": {
+        "inherits": "^2.0.1",
+        "safe-buffer": "^5.0.1"
+      }
+    },
+    "node_modules/class-utils": {
+      "version": "0.3.6",
+      "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz",
+      "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==",
+      "dev": true,
+      "dependencies": {
+        "arr-union": "^3.1.0",
+        "define-property": "^0.2.5",
+        "isobject": "^3.0.0",
+        "static-extend": "^0.1.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/class-utils/node_modules/define-property": {
+      "version": "0.2.5",
+      "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+      "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==",
+      "dev": true,
+      "dependencies": {
+        "is-descriptor": "^0.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/class-utils/node_modules/is-accessor-descriptor": {
+      "version": "0.1.6",
+      "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+      "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==",
+      "dev": true,
+      "dependencies": {
+        "kind-of": "^3.0.2"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/class-utils/node_modules/is-accessor-descriptor/node_modules/kind-of": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+      "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+      "dev": true,
+      "dependencies": {
+        "is-buffer": "^1.1.5"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/class-utils/node_modules/is-data-descriptor": {
+      "version": "0.1.4",
+      "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+      "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==",
+      "dev": true,
+      "dependencies": {
+        "kind-of": "^3.0.2"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/class-utils/node_modules/is-data-descriptor/node_modules/kind-of": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+      "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+      "dev": true,
+      "dependencies": {
+        "is-buffer": "^1.1.5"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/class-utils/node_modules/is-descriptor": {
+      "version": "0.1.6",
+      "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
+      "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
+      "dev": true,
+      "dependencies": {
+        "is-accessor-descriptor": "^0.1.6",
+        "is-data-descriptor": "^0.1.4",
+        "kind-of": "^5.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/class-utils/node_modules/kind-of": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
+      "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/cli-cursor": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
+      "integrity": "sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw==",
+      "dev": true,
+      "dependencies": {
+        "restore-cursor": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/cli-width": {
+      "version": "2.2.1",
+      "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz",
+      "integrity": "sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==",
+      "dev": true
+    },
+    "node_modules/cliui": {
+      "version": "3.2.0",
+      "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
+      "integrity": "sha512-0yayqDxWQbqk3ojkYqUKqaAQ6AfNKeKWRNA8kR0WXzAsdHpP4BIaOmMAG87JGuO6qcobyW4GjxHd9PmhEd+T9w==",
+      "dependencies": {
+        "string-width": "^1.0.1",
+        "strip-ansi": "^3.0.1",
+        "wrap-ansi": "^2.0.0"
+      }
+    },
+    "node_modules/cliui/node_modules/ansi-regex": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+      "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/cliui/node_modules/is-fullwidth-code-point": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
+      "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==",
+      "dependencies": {
+        "number-is-nan": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/cliui/node_modules/string-width": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
+      "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==",
+      "dependencies": {
+        "code-point-at": "^1.0.0",
+        "is-fullwidth-code-point": "^1.0.0",
+        "strip-ansi": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/cliui/node_modules/strip-ansi": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+      "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==",
+      "dependencies": {
+        "ansi-regex": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/clone": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz",
+      "integrity": "sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w==",
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/co": {
+      "version": "4.6.0",
+      "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz",
+      "integrity": "sha512-QVb0dM5HvG+uaxitm8wONl7jltx8dqhfU33DcqtOZcLSVIKSDDLDi7+0LbAKiyI8hD9u42m2YxXSkMGWThaecQ==",
+      "dev": true,
+      "engines": {
+        "iojs": ">= 1.0.0",
+        "node": ">= 0.12.0"
+      }
+    },
+    "node_modules/code-point-at": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
+      "integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/collection-visit": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
+      "integrity": "sha512-lNkKvzEeMBBjUGHZ+q6z9pSJla0KWAQPvtzhEV9+iGyQYG+pBpl7xKDhxoNSOZH2hhv0v5k0y2yAM4o4SjoSkw==",
+      "dev": true,
+      "dependencies": {
+        "map-visit": "^1.0.0",
+        "object-visit": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/color-convert": {
+      "version": "1.9.3",
+      "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
+      "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
+      "dev": true,
+      "dependencies": {
+        "color-name": "1.1.3"
+      }
+    },
+    "node_modules/color-name": {
+      "version": "1.1.3",
+      "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
+      "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
+      "dev": true
+    },
+    "node_modules/combine-source-map": {
+      "version": "0.8.0",
+      "resolved": "https://registry.npmjs.org/combine-source-map/-/combine-source-map-0.8.0.tgz",
+      "integrity": "sha512-UlxQ9Vw0b/Bt/KYwCFqdEwsQ1eL8d1gibiFb7lxQJFdvTgc2hIZi6ugsg+kyhzhPV+QEpUiEIwInIAIrgoEkrg==",
+      "dev": true,
+      "dependencies": {
+        "convert-source-map": "~1.1.0",
+        "inline-source-map": "~0.6.0",
+        "lodash.memoize": "~3.0.3",
+        "source-map": "~0.5.3"
+      }
+    },
+    "node_modules/combined-stream": {
+      "version": "1.0.8",
+      "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
+      "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
+      "dev": true,
+      "dependencies": {
+        "delayed-stream": "~1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
+    "node_modules/commander": {
+      "version": "2.20.3",
+      "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
+      "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==",
+      "dev": true
+    },
+    "node_modules/component-emitter": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz",
+      "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==",
+      "dev": true
+    },
+    "node_modules/concat-map": {
+      "version": "0.0.1",
+      "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
+      "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",
+      "dev": true
+    },
+    "node_modules/concat-stream": {
+      "version": "1.6.2",
+      "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
+      "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
+      "dev": true,
+      "engines": [
+        "node >= 0.8"
+      ],
+      "dependencies": {
+        "buffer-from": "^1.0.0",
+        "inherits": "^2.0.3",
+        "readable-stream": "^2.2.2",
+        "typedarray": "^0.0.6"
+      }
+    },
+    "node_modules/console-browserify": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz",
+      "integrity": "sha512-ZMkYO/LkF17QvCPqM0gxw8yUzigAOZOSWSHg91FH6orS7vcEj5dVZTidN2fQ14yBSdg97RqhSNwLUXInd52OTA==",
+      "dev": true
+    },
+    "node_modules/constants-browserify": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz",
+      "integrity": "sha512-xFxOwqIzR/e1k1gLiWEophSCMqXcwVHIH7akf7b/vxcUeGunlj3hvZaaqxwHsTgn+IndtkQJgSztIDWeumWJDQ==",
+      "dev": true
+    },
+    "node_modules/convert-source-map": {
+      "version": "1.1.3",
+      "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.1.3.tgz",
+      "integrity": "sha512-Y8L5rp6jo+g9VEPgvqNfEopjTR4OTYct8lXlS8iVQdmnjDvbdbzYe9rjtFCB9egC86JoNCU61WRY+ScjkZpnIg==",
+      "dev": true
+    },
+    "node_modules/cookiejar": {
+      "version": "2.1.4",
+      "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz",
+      "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==",
+      "dev": true
+    },
+    "node_modules/copy-descriptor": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz",
+      "integrity": "sha512-XgZ0pFcakEUlbwQEVNg3+QAis1FyTL3Qel9FYy8pSkQqoG3PNoT0bOCQtOXcOkur21r2Eq2kI+IE+gsmAEVlYw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/core-util-is": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz",
+      "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==",
+      "dev": true
+    },
+    "node_modules/create-ecdh": {
+      "version": "4.0.4",
+      "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz",
+      "integrity": "sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==",
+      "dev": true,
+      "dependencies": {
+        "bn.js": "^4.1.0",
+        "elliptic": "^6.5.3"
+      }
+    },
+    "node_modules/create-ecdh/node_modules/bn.js": {
+      "version": "4.12.0",
+      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
+      "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
+      "dev": true
+    },
+    "node_modules/create-hash": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz",
+      "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==",
+      "dev": true,
+      "dependencies": {
+        "cipher-base": "^1.0.1",
+        "inherits": "^2.0.1",
+        "md5.js": "^1.3.4",
+        "ripemd160": "^2.0.1",
+        "sha.js": "^2.4.0"
+      }
+    },
+    "node_modules/create-hmac": {
+      "version": "1.1.7",
+      "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz",
+      "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==",
+      "dev": true,
+      "dependencies": {
+        "cipher-base": "^1.0.3",
+        "create-hash": "^1.1.0",
+        "inherits": "^2.0.1",
+        "ripemd160": "^2.0.0",
+        "safe-buffer": "^5.0.1",
+        "sha.js": "^2.4.8"
+      }
+    },
+    "node_modules/cross-spawn": {
+      "version": "6.0.5",
+      "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
+      "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
+      "dev": true,
+      "dependencies": {
+        "nice-try": "^1.0.4",
+        "path-key": "^2.0.1",
+        "semver": "^5.5.0",
+        "shebang-command": "^1.2.0",
+        "which": "^1.2.9"
+      },
+      "engines": {
+        "node": ">=4.8"
+      }
+    },
+    "node_modules/crypto-browserify": {
+      "version": "3.12.0",
+      "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz",
+      "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==",
+      "dev": true,
+      "dependencies": {
+        "browserify-cipher": "^1.0.0",
+        "browserify-sign": "^4.0.0",
+        "create-ecdh": "^4.0.0",
+        "create-hash": "^1.1.0",
+        "create-hmac": "^1.1.0",
+        "diffie-hellman": "^5.0.0",
+        "inherits": "^2.0.1",
+        "pbkdf2": "^3.0.3",
+        "public-encrypt": "^4.0.0",
+        "randombytes": "^2.0.0",
+        "randomfill": "^1.0.3"
+      },
+      "engines": {
+        "node": "*"
+      }
+    },
+    "node_modules/cssom": {
+      "version": "0.3.8",
+      "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz",
+      "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==",
+      "dev": true
+    },
+    "node_modules/cssstyle": {
+      "version": "1.4.0",
+      "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.4.0.tgz",
+      "integrity": "sha512-GBrLZYZ4X4x6/QEoBnIrqb8B/f5l4+8me2dkom/j1Gtbxy0kBv6OGzKuAsGM75bkGwGAFkt56Iwg28S3XTZgSA==",
+      "dev": true,
+      "dependencies": {
+        "cssom": "0.3.x"
+      }
+    },
+    "node_modules/d": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz",
+      "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==",
+      "dev": true,
+      "dependencies": {
+        "es5-ext": "^0.10.50",
+        "type": "^1.0.1"
+      }
+    },
+    "node_modules/dash-ast": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-2.0.1.tgz",
+      "integrity": "sha512-5TXltWJGc+RdnabUGzhRae1TRq6m4gr+3K2wQX0is5/F2yS6MJXJvLyI3ErAnsAXuJoGqvfVD5icRgim07DrxQ==",
+      "dev": true
+    },
+    "node_modules/dashdash": {
+      "version": "1.14.1",
+      "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz",
+      "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==",
+      "dev": true,
+      "dependencies": {
+        "assert-plus": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10"
+      }
+    },
+    "node_modules/data-urls": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-1.1.0.tgz",
+      "integrity": "sha512-YTWYI9se1P55u58gL5GkQHW4P6VJBJ5iBT+B5a7i2Tjadhv52paJG0qHX4A0OR6/t52odI64KP2YvFpkDOi3eQ==",
+      "dev": true,
+      "dependencies": {
+        "abab": "^2.0.0",
+        "whatwg-mimetype": "^2.2.0",
+        "whatwg-url": "^7.0.0"
+      }
+    },
+    "node_modules/data-urls/node_modules/whatwg-url": {
+      "version": "7.1.0",
+      "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-7.1.0.tgz",
+      "integrity": "sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg==",
+      "dev": true,
+      "dependencies": {
+        "lodash.sortby": "^4.7.0",
+        "tr46": "^1.0.1",
+        "webidl-conversions": "^4.0.2"
+      }
+    },
+    "node_modules/debug": {
+      "version": "4.3.4",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz",
+      "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==",
+      "dev": true,
+      "dependencies": {
+        "ms": "2.1.2"
+      },
+      "engines": {
+        "node": ">=6.0"
+      },
+      "peerDependenciesMeta": {
+        "supports-color": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/decamelize": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
+      "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/decode-uri-component": {
+      "version": "0.2.2",
+      "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz",
+      "integrity": "sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10"
+      }
+    },
+    "node_modules/deep-is": {
+      "version": "0.1.4",
+      "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
+      "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
+      "dev": true
+    },
+    "node_modules/define-properties": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz",
+      "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==",
+      "dev": true,
+      "dependencies": {
+        "has-property-descriptors": "^1.0.0",
+        "object-keys": "^1.1.1"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/define-property": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz",
+      "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==",
+      "dev": true,
+      "dependencies": {
+        "is-descriptor": "^1.0.2",
+        "isobject": "^3.0.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/defined": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.1.tgz",
+      "integrity": "sha512-hsBd2qSVCRE+5PmNdHt1uzyrFu5d3RwmFDKzyNZMFq/EwDNJF7Ee5+D5oEKF0hU6LhtoUF1macFvOe4AskQC1Q==",
+      "dev": true,
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/delayed-stream": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
+      "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
+    "node_modules/deps-sort": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/deps-sort/-/deps-sort-2.0.1.tgz",
+      "integrity": "sha512-1orqXQr5po+3KI6kQb9A4jnXT1PBwggGl2d7Sq2xsnOeI9GPcE/tGcF9UiSZtZBM7MukY4cAh7MemS6tZYipfw==",
+      "dev": true,
+      "dependencies": {
+        "JSONStream": "^1.0.3",
+        "shasum-object": "^1.0.0",
+        "subarg": "^1.0.0",
+        "through2": "^2.0.0"
+      },
+      "bin": {
+        "deps-sort": "bin/cmd.js"
+      }
+    },
+    "node_modules/des.js": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.1.0.tgz",
+      "integrity": "sha512-r17GxjhUCjSRy8aiJpr8/UadFIzMzJGexI3Nmz4ADi9LYSFx4gTBp80+NaX/YsXWWLhpZ7v/v/ubEc/bCNfKwg==",
+      "dev": true,
+      "dependencies": {
+        "inherits": "^2.0.1",
+        "minimalistic-assert": "^1.0.0"
+      }
+    },
+    "node_modules/detect-newline": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-2.1.0.tgz",
+      "integrity": "sha512-CwffZFvlJffUg9zZA0uqrjQayUTC8ob94pnr5sFwaVv3IOmkfUHcWH+jXaQK3askE51Cqe8/9Ql/0uXNwqZ8Zg==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/detective": {
+      "version": "5.2.1",
+      "resolved": "https://registry.npmjs.org/detective/-/detective-5.2.1.tgz",
+      "integrity": "sha512-v9XE1zRnz1wRtgurGu0Bs8uHKFSTdteYZNbIPFVhUZ39L/S79ppMpdmVOZAnoz1jfEFodc48n6MX483Xo3t1yw==",
+      "dev": true,
+      "dependencies": {
+        "acorn-node": "^1.8.2",
+        "defined": "^1.0.0",
+        "minimist": "^1.2.6"
+      },
+      "bin": {
+        "detective": "bin/detective.js"
+      },
+      "engines": {
+        "node": ">=0.8.0"
+      }
+    },
+    "node_modules/diff": {
+      "version": "4.0.2",
+      "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
+      "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.3.1"
+      }
+    },
+    "node_modules/diff-sequences": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.9.0.tgz",
+      "integrity": "sha512-Dj6Wk3tWyTE+Fo1rW8v0Xhwk80um6yFYKbuAxc9c3EZxIHFDYwbi34Uk42u1CdnIiVorvt4RmlSDjIPyzGC2ew==",
+      "dev": true,
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/diffie-hellman": {
+      "version": "5.0.3",
+      "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz",
+      "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==",
+      "dev": true,
+      "dependencies": {
+        "bn.js": "^4.1.0",
+        "miller-rabin": "^4.0.0",
+        "randombytes": "^2.0.0"
+      }
+    },
+    "node_modules/diffie-hellman/node_modules/bn.js": {
+      "version": "4.12.0",
+      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
+      "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
+      "dev": true
+    },
+    "node_modules/doctrine": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz",
+      "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
+      "dev": true,
+      "dependencies": {
+        "esutils": "^2.0.2"
+      },
+      "engines": {
+        "node": ">=6.0.0"
+      }
+    },
+    "node_modules/domain-browser": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz",
+      "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.4",
+        "npm": ">=1.2"
+      }
+    },
+    "node_modules/domexception": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz",
+      "integrity": "sha512-raigMkn7CJNNo6Ihro1fzG7wr3fHuYVytzquZKX5n0yizGsTcYgzdIUwj1X9pK0VvjeihV+XiclP+DjwbsSKug==",
+      "dev": true,
+      "dependencies": {
+        "webidl-conversions": "^4.0.2"
+      }
+    },
+    "node_modules/dot-parts": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/dot-parts/-/dot-parts-1.0.1.tgz",
+      "integrity": "sha512-DcAuaZ2hguFLkxrAwOlvYNFb4IE6xg1Ldzqpma4/UeiT0utd8/E17z1h9mH8s+9Hwh7SeLn83LpIykh/oBBxSw==",
+      "dev": true
+    },
+    "node_modules/duplexer2": {
+      "version": "0.1.4",
+      "resolved": "https://registry.npmjs.org/duplexer2/-/duplexer2-0.1.4.tgz",
+      "integrity": "sha512-asLFVfWWtJ90ZyOUHMqk7/S2w2guQKxUI2itj3d92ADHhxUSbCMGi1f1cBcJ7xM1To+pE/Khbwo1yuNbMEPKeA==",
+      "dev": true,
+      "dependencies": {
+        "readable-stream": "^2.0.2"
+      }
+    },
+    "node_modules/ecc-jsbn": {
+      "version": "0.1.2",
+      "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz",
+      "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==",
+      "dev": true,
+      "dependencies": {
+        "jsbn": "~0.1.0",
+        "safer-buffer": "^2.1.0"
+      }
+    },
+    "node_modules/electron-to-chromium": {
+      "version": "1.4.485",
+      "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.485.tgz",
+      "integrity": "sha512-1ndQ5IBNEnFirPwvyud69GHL+31FkE09gH/CJ6m3KCbkx3i0EVOrjwz4UNxRmN9H8OVHbC6vMRZGN1yCvjSs9w==",
+      "dev": true
+    },
+    "node_modules/elkjs": {
+      "version": "0.3.0",
+      "resolved": "https://registry.npmjs.org/elkjs/-/elkjs-0.3.0.tgz",
+      "integrity": "sha512-bcO8RCIssdly316ou76QLsiuu1NCLbhhZwK/iuOdKTyQzKdCeX7sdIJOUdSsjlIDB203TN4NBpTiq4ugmLjR+Q=="
+    },
+    "node_modules/elliptic": {
+      "version": "6.5.4",
+      "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz",
+      "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==",
+      "dev": true,
+      "dependencies": {
+        "bn.js": "^4.11.9",
+        "brorand": "^1.1.0",
+        "hash.js": "^1.0.0",
+        "hmac-drbg": "^1.0.1",
+        "inherits": "^2.0.4",
+        "minimalistic-assert": "^1.0.1",
+        "minimalistic-crypto-utils": "^1.0.1"
+      }
+    },
+    "node_modules/elliptic/node_modules/bn.js": {
+      "version": "4.12.0",
+      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
+      "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
+      "dev": true
+    },
+    "node_modules/emoji-regex": {
+      "version": "7.0.3",
+      "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
+      "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
+      "dev": true
+    },
+    "node_modules/end-of-stream": {
+      "version": "1.4.4",
+      "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz",
+      "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==",
+      "dev": true,
+      "dependencies": {
+        "once": "^1.4.0"
+      }
+    },
+    "node_modules/error-ex": {
+      "version": "1.3.2",
+      "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz",
+      "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==",
+      "dependencies": {
+        "is-arrayish": "^0.2.1"
+      }
+    },
+    "node_modules/es-abstract": {
+      "version": "1.22.1",
+      "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.22.1.tgz",
+      "integrity": "sha512-ioRRcXMO6OFyRpyzV3kE1IIBd4WG5/kltnzdxSCqoP8CMGs/Li+M1uF5o7lOkZVFjDs+NLesthnF66Pg/0q0Lw==",
+      "dev": true,
+      "dependencies": {
+        "array-buffer-byte-length": "^1.0.0",
+        "arraybuffer.prototype.slice": "^1.0.1",
+        "available-typed-arrays": "^1.0.5",
+        "call-bind": "^1.0.2",
+        "es-set-tostringtag": "^2.0.1",
+        "es-to-primitive": "^1.2.1",
+        "function.prototype.name": "^1.1.5",
+        "get-intrinsic": "^1.2.1",
+        "get-symbol-description": "^1.0.0",
+        "globalthis": "^1.0.3",
+        "gopd": "^1.0.1",
+        "has": "^1.0.3",
+        "has-property-descriptors": "^1.0.0",
+        "has-proto": "^1.0.1",
+        "has-symbols": "^1.0.3",
+        "internal-slot": "^1.0.5",
+        "is-array-buffer": "^3.0.2",
+        "is-callable": "^1.2.7",
+        "is-negative-zero": "^2.0.2",
+        "is-regex": "^1.1.4",
+        "is-shared-array-buffer": "^1.0.2",
+        "is-string": "^1.0.7",
+        "is-typed-array": "^1.1.10",
+        "is-weakref": "^1.0.2",
+        "object-inspect": "^1.12.3",
+        "object-keys": "^1.1.1",
+        "object.assign": "^4.1.4",
+        "regexp.prototype.flags": "^1.5.0",
+        "safe-array-concat": "^1.0.0",
+        "safe-regex-test": "^1.0.0",
+        "string.prototype.trim": "^1.2.7",
+        "string.prototype.trimend": "^1.0.6",
+        "string.prototype.trimstart": "^1.0.6",
+        "typed-array-buffer": "^1.0.0",
+        "typed-array-byte-length": "^1.0.0",
+        "typed-array-byte-offset": "^1.0.0",
+        "typed-array-length": "^1.0.4",
+        "unbox-primitive": "^1.0.2",
+        "which-typed-array": "^1.1.10"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/es-array-method-boxes-properly": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/es-array-method-boxes-properly/-/es-array-method-boxes-properly-1.0.0.tgz",
+      "integrity": "sha512-wd6JXUmyHmt8T5a2xreUwKcGPq6f1f+WwIJkijUqiGcJz1qqnZgP6XIK+QyIWU5lT7imeNxUll48bziG+TSYcA==",
+      "dev": true
+    },
+    "node_modules/es-set-tostringtag": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz",
+      "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==",
+      "dev": true,
+      "dependencies": {
+        "get-intrinsic": "^1.1.3",
+        "has": "^1.0.3",
+        "has-tostringtag": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/es-to-primitive": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
+      "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==",
+      "dev": true,
+      "dependencies": {
+        "is-callable": "^1.1.4",
+        "is-date-object": "^1.0.1",
+        "is-symbol": "^1.0.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/es5-ext": {
+      "version": "0.10.62",
+      "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.62.tgz",
+      "integrity": "sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA==",
+      "dev": true,
+      "hasInstallScript": true,
+      "dependencies": {
+        "es6-iterator": "^2.0.3",
+        "es6-symbol": "^3.1.3",
+        "next-tick": "^1.1.0"
+      },
+      "engines": {
+        "node": ">=0.10"
+      }
+    },
+    "node_modules/es6-iterator": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz",
+      "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==",
+      "dev": true,
+      "dependencies": {
+        "d": "1",
+        "es5-ext": "^0.10.35",
+        "es6-symbol": "^3.1.1"
+      }
+    },
+    "node_modules/es6-map": {
+      "version": "0.1.5",
+      "resolved": "https://registry.npmjs.org/es6-map/-/es6-map-0.1.5.tgz",
+      "integrity": "sha512-mz3UqCh0uPCIqsw1SSAkB/p0rOzF/M0V++vyN7JqlPtSW/VsYgQBvVvqMLmfBuyMzTpLnNqi6JmcSizs4jy19A==",
+      "dev": true,
+      "dependencies": {
+        "d": "1",
+        "es5-ext": "~0.10.14",
+        "es6-iterator": "~2.0.1",
+        "es6-set": "~0.1.5",
+        "es6-symbol": "~3.1.1",
+        "event-emitter": "~0.3.5"
+      }
+    },
+    "node_modules/es6-set": {
+      "version": "0.1.6",
+      "resolved": "https://registry.npmjs.org/es6-set/-/es6-set-0.1.6.tgz",
+      "integrity": "sha512-TE3LgGLDIBX332jq3ypv6bcOpkLO0AslAQo7p2VqX/1N46YNsvIWgvjojjSEnWEGWMhr1qUbYeTSir5J6mFHOw==",
+      "dev": true,
+      "dependencies": {
+        "d": "^1.0.1",
+        "es5-ext": "^0.10.62",
+        "es6-iterator": "~2.0.3",
+        "es6-symbol": "^3.1.3",
+        "event-emitter": "^0.3.5",
+        "type": "^2.7.2"
+      },
+      "engines": {
+        "node": ">=0.12"
+      }
+    },
+    "node_modules/es6-set/node_modules/type": {
+      "version": "2.7.2",
+      "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz",
+      "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==",
+      "dev": true
+    },
+    "node_modules/es6-symbol": {
+      "version": "3.1.3",
+      "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz",
+      "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==",
+      "dev": true,
+      "dependencies": {
+        "d": "^1.0.1",
+        "ext": "^1.1.2"
+      }
+    },
+    "node_modules/escalade": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz",
+      "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==",
+      "dev": true,
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/escape-string-regexp": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
+      "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.8.0"
+      }
+    },
+    "node_modules/escodegen": {
+      "version": "1.14.3",
+      "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz",
+      "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==",
+      "dev": true,
+      "dependencies": {
+        "esprima": "^4.0.1",
+        "estraverse": "^4.2.0",
+        "esutils": "^2.0.2",
+        "optionator": "^0.8.1"
+      },
+      "bin": {
+        "escodegen": "bin/escodegen.js",
+        "esgenerate": "bin/esgenerate.js"
+      },
+      "engines": {
+        "node": ">=4.0"
+      },
+      "optionalDependencies": {
+        "source-map": "~0.6.1"
+      }
+    },
+    "node_modules/escodegen/node_modules/source-map": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+      "dev": true,
+      "optional": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/eslint": {
+      "version": "5.16.0",
+      "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.16.0.tgz",
+      "integrity": "sha512-S3Rz11i7c8AA5JPv7xAH+dOyq/Cu/VXHiHXBPOU1k/JAM5dXqQPt3qcrhpHSorXmrpu2g0gkIBVXAqCpzfoZIg==",
+      "dev": true,
+      "dependencies": {
+        "@babel/code-frame": "^7.0.0",
+        "ajv": "^6.9.1",
+        "chalk": "^2.1.0",
+        "cross-spawn": "^6.0.5",
+        "debug": "^4.0.1",
+        "doctrine": "^3.0.0",
+        "eslint-scope": "^4.0.3",
+        "eslint-utils": "^1.3.1",
+        "eslint-visitor-keys": "^1.0.0",
+        "espree": "^5.0.1",
+        "esquery": "^1.0.1",
+        "esutils": "^2.0.2",
+        "file-entry-cache": "^5.0.1",
+        "functional-red-black-tree": "^1.0.1",
+        "glob": "^7.1.2",
+        "globals": "^11.7.0",
+        "ignore": "^4.0.6",
+        "import-fresh": "^3.0.0",
+        "imurmurhash": "^0.1.4",
+        "inquirer": "^6.2.2",
+        "js-yaml": "^3.13.0",
+        "json-stable-stringify-without-jsonify": "^1.0.1",
+        "levn": "^0.3.0",
+        "lodash": "^4.17.11",
+        "minimatch": "^3.0.4",
+        "mkdirp": "^0.5.1",
+        "natural-compare": "^1.4.0",
+        "optionator": "^0.8.2",
+        "path-is-inside": "^1.0.2",
+        "progress": "^2.0.0",
+        "regexpp": "^2.0.1",
+        "semver": "^5.5.1",
+        "strip-ansi": "^4.0.0",
+        "strip-json-comments": "^2.0.1",
+        "table": "^5.2.3",
+        "text-table": "^0.2.0"
+      },
+      "bin": {
+        "eslint": "bin/eslint.js"
+      },
+      "engines": {
+        "node": "^6.14.0 || ^8.10.0 || >=9.10.0"
+      }
+    },
+    "node_modules/eslint-scope": {
+      "version": "4.0.3",
+      "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.3.tgz",
+      "integrity": "sha512-p7VutNr1O/QrxysMo3E45FjYDTeXBy0iTltPFNSqKAIfjDSXC+4dj+qfyuD8bfAXrW/y6lW3O76VaYNPKfpKrg==",
+      "dev": true,
+      "dependencies": {
+        "esrecurse": "^4.1.0",
+        "estraverse": "^4.1.1"
+      },
+      "engines": {
+        "node": ">=4.0.0"
+      }
+    },
+    "node_modules/eslint-utils": {
+      "version": "1.4.3",
+      "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.4.3.tgz",
+      "integrity": "sha512-fbBN5W2xdY45KulGXmLHZ3c3FHfVYmKg0IrAKGOkT/464PQsx2UeIzfz1RmEci+KLm1bBaAzZAh8+/E+XAeZ8Q==",
+      "dev": true,
+      "dependencies": {
+        "eslint-visitor-keys": "^1.1.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/eslint-visitor-keys": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz",
+      "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/espree": {
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz",
+      "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==",
+      "dev": true,
+      "dependencies": {
+        "acorn": "^6.0.7",
+        "acorn-jsx": "^5.0.0",
+        "eslint-visitor-keys": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=6.0.0"
+      }
+    },
+    "node_modules/esprima": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
+      "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
+      "dev": true,
+      "bin": {
+        "esparse": "bin/esparse.js",
+        "esvalidate": "bin/esvalidate.js"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/esprima-fb": {
+      "version": "3001.1.0-dev-harmony-fb",
+      "resolved": "https://registry.npmjs.org/esprima-fb/-/esprima-fb-3001.0001.0000-dev-harmony-fb.tgz",
+      "integrity": "sha512-a3RFiCVBiy8KdO6q/C+8BQiP/sRk8XshBU3QHHDP8tNzjYwR3FKBOImu+PXfVhPoZL0JKtJLBAOWlDMCCFY8SQ==",
+      "dev": true,
+      "bin": {
+        "esparse": "bin/esparse.js",
+        "esvalidate": "bin/esvalidate.js"
+      },
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
+    "node_modules/esquery": {
+      "version": "1.5.0",
+      "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz",
+      "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==",
+      "dev": true,
+      "dependencies": {
+        "estraverse": "^5.1.0"
+      },
+      "engines": {
+        "node": ">=0.10"
+      }
+    },
+    "node_modules/esquery/node_modules/estraverse": {
+      "version": "5.3.0",
+      "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
+      "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+      "dev": true,
+      "engines": {
+        "node": ">=4.0"
+      }
+    },
+    "node_modules/esrecurse": {
+      "version": "4.3.0",
+      "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
+      "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
+      "dev": true,
+      "dependencies": {
+        "estraverse": "^5.2.0"
+      },
+      "engines": {
+        "node": ">=4.0"
+      }
+    },
+    "node_modules/esrecurse/node_modules/estraverse": {
+      "version": "5.3.0",
+      "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
+      "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
+      "dev": true,
+      "engines": {
+        "node": ">=4.0"
+      }
+    },
+    "node_modules/estraverse": {
+      "version": "4.3.0",
+      "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz",
+      "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==",
+      "dev": true,
+      "engines": {
+        "node": ">=4.0"
+      }
+    },
+    "node_modules/estree-is-function": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/estree-is-function/-/estree-is-function-1.0.0.tgz",
+      "integrity": "sha512-nSCWn1jkSq2QAtkaVLJZY2ezwcFO161HVc174zL1KPW3RJ+O6C3eJb8Nx7OXzvhoEv+nLgSR1g71oWUHUDTrJA==",
+      "dev": true
+    },
+    "node_modules/esutils": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
+      "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/event-emitter": {
+      "version": "0.3.5",
+      "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz",
+      "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==",
+      "dev": true,
+      "dependencies": {
+        "d": "1",
+        "es5-ext": "~0.10.14"
+      }
+    },
+    "node_modules/events": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/events/-/events-2.1.0.tgz",
+      "integrity": "sha512-3Zmiobend8P9DjmKAty0Era4jV8oJ0yGYe2nJJAxgymF9+N8F2m0hhZiMoWtcfepExzNKZumFU3ksdQbInGWCg==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.4.x"
+      }
+    },
+    "node_modules/evp_bytestokey": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz",
+      "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==",
+      "dev": true,
+      "dependencies": {
+        "md5.js": "^1.3.4",
+        "safe-buffer": "^5.1.1"
+      }
+    },
+    "node_modules/exec-sh": {
+      "version": "0.3.6",
+      "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.6.tgz",
+      "integrity": "sha512-nQn+hI3yp+oD0huYhKwvYI32+JFeq+XkNcD1GAo3Y/MjxsfVGmrrzrnzjWiNY6f+pUCP440fThsFh5gZrRAU/w==",
+      "dev": true
+    },
+    "node_modules/execa": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz",
+      "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==",
+      "dev": true,
+      "dependencies": {
+        "cross-spawn": "^6.0.0",
+        "get-stream": "^4.0.0",
+        "is-stream": "^1.1.0",
+        "npm-run-path": "^2.0.0",
+        "p-finally": "^1.0.0",
+        "signal-exit": "^3.0.0",
+        "strip-eof": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/exit": {
+      "version": "0.1.2",
+      "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz",
+      "integrity": "sha512-Zk/eNKV2zbjpKzrsQ+n1G6poVbErQxJ0LBOJXaKZ1EViLzH+hrLu9cdXI4zw9dBQJslwBEpbQ2P1oS7nDxs6jQ==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.8.0"
+      }
+    },
+    "node_modules/expand-brackets": {
+      "version": "2.1.4",
+      "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz",
+      "integrity": "sha512-w/ozOKR9Obk3qoWeY/WDi6MFta9AoMR+zud60mdnbniMcBxRuFJyDt2LdX/14A1UABeqk+Uk+LDfUpvoGKppZA==",
+      "dev": true,
+      "dependencies": {
+        "debug": "^2.3.3",
+        "define-property": "^0.2.5",
+        "extend-shallow": "^2.0.1",
+        "posix-character-classes": "^0.1.0",
+        "regex-not": "^1.0.0",
+        "snapdragon": "^0.8.1",
+        "to-regex": "^3.0.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/expand-brackets/node_modules/debug": {
+      "version": "2.6.9",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+      "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+      "dev": true,
+      "dependencies": {
+        "ms": "2.0.0"
+      }
+    },
+    "node_modules/expand-brackets/node_modules/define-property": {
+      "version": "0.2.5",
+      "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+      "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==",
+      "dev": true,
+      "dependencies": {
+        "is-descriptor": "^0.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/expand-brackets/node_modules/extend-shallow": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+      "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
+      "dev": true,
+      "dependencies": {
+        "is-extendable": "^0.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/expand-brackets/node_modules/is-accessor-descriptor": {
+      "version": "0.1.6",
+      "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+      "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==",
+      "dev": true,
+      "dependencies": {
+        "kind-of": "^3.0.2"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/expand-brackets/node_modules/is-accessor-descriptor/node_modules/kind-of": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+      "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+      "dev": true,
+      "dependencies": {
+        "is-buffer": "^1.1.5"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/expand-brackets/node_modules/is-data-descriptor": {
+      "version": "0.1.4",
+      "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+      "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==",
+      "dev": true,
+      "dependencies": {
+        "kind-of": "^3.0.2"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/expand-brackets/node_modules/is-data-descriptor/node_modules/kind-of": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+      "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+      "dev": true,
+      "dependencies": {
+        "is-buffer": "^1.1.5"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/expand-brackets/node_modules/is-descriptor": {
+      "version": "0.1.6",
+      "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
+      "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
+      "dev": true,
+      "dependencies": {
+        "is-accessor-descriptor": "^0.1.6",
+        "is-data-descriptor": "^0.1.4",
+        "kind-of": "^5.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/expand-brackets/node_modules/is-extendable": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+      "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/expand-brackets/node_modules/kind-of": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
+      "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/expand-brackets/node_modules/ms": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+      "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
+      "dev": true
+    },
+    "node_modules/expect": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/expect/-/expect-24.9.0.tgz",
+      "integrity": "sha512-wvVAx8XIol3Z5m9zvZXiyZOQ+sRJqNTIm6sGjdWlaZIeupQGO3WbYI+15D/AmEwZywL6wtJkbAbJtzkOfBuR0Q==",
+      "dev": true,
+      "dependencies": {
+        "@jest/types": "^24.9.0",
+        "ansi-styles": "^3.2.0",
+        "jest-get-type": "^24.9.0",
+        "jest-matcher-utils": "^24.9.0",
+        "jest-message-util": "^24.9.0",
+        "jest-regex-util": "^24.9.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/exposify": {
+      "version": "0.5.0",
+      "resolved": "https://registry.npmjs.org/exposify/-/exposify-0.5.0.tgz",
+      "integrity": "sha512-SXS1oEW6VXYinz7RbTPUj+RhO3ZXuj2cmUTWTaO8KcWMcxLZF3wzjqSuaOW0EZYBoKooUM8DIkvfWWOMXTMQFQ==",
+      "dev": true,
+      "dependencies": {
+        "globo": "~1.1.0",
+        "map-obj": "~1.0.1",
+        "replace-requires": "~1.0.3",
+        "through2": "~0.4.0",
+        "transformify": "~0.1.1"
+      }
+    },
+    "node_modules/exposify/node_modules/isarray": {
+      "version": "0.0.1",
+      "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
+      "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==",
+      "dev": true
+    },
+    "node_modules/exposify/node_modules/object-keys": {
+      "version": "0.4.0",
+      "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz",
+      "integrity": "sha512-ncrLw+X55z7bkl5PnUvHwFK9FcGuFYo9gtjws2XtSzL+aZ8tm830P60WJ0dSmFVaSalWieW5MD7kEdnXda9yJw==",
+      "dev": true
+    },
+    "node_modules/exposify/node_modules/readable-stream": {
+      "version": "1.0.34",
+      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz",
+      "integrity": "sha512-ok1qVCJuRkNmvebYikljxJA/UEsKwLl2nI1OmaqAu4/UE+h0wKCHok4XkL/gvi39OacXvw59RJUOFUkDib2rHg==",
+      "dev": true,
+      "dependencies": {
+        "core-util-is": "~1.0.0",
+        "inherits": "~2.0.1",
+        "isarray": "0.0.1",
+        "string_decoder": "~0.10.x"
+      }
+    },
+    "node_modules/exposify/node_modules/string_decoder": {
+      "version": "0.10.31",
+      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
+      "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==",
+      "dev": true
+    },
+    "node_modules/exposify/node_modules/through2": {
+      "version": "0.4.2",
+      "resolved": "https://registry.npmjs.org/through2/-/through2-0.4.2.tgz",
+      "integrity": "sha512-45Llu+EwHKtAZYTPPVn3XZHBgakWMN3rokhEv5hu596XP+cNgplMg+Gj+1nmAvj+L0K7+N49zBKx5rah5u0QIQ==",
+      "dev": true,
+      "dependencies": {
+        "readable-stream": "~1.0.17",
+        "xtend": "~2.1.1"
+      }
+    },
+    "node_modules/exposify/node_modules/xtend": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz",
+      "integrity": "sha512-vMNKzr2rHP9Dp/e1NQFnLQlwlhp9L/LfvnsVdHxN1f+uggyVI3i08uD14GPvCToPkdsRfyPqIyYGmIk58V98ZQ==",
+      "dev": true,
+      "dependencies": {
+        "object-keys": "~0.4.0"
+      },
+      "engines": {
+        "node": ">=0.4"
+      }
+    },
+    "node_modules/ext": {
+      "version": "1.7.0",
+      "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz",
+      "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==",
+      "dev": true,
+      "dependencies": {
+        "type": "^2.7.2"
+      }
+    },
+    "node_modules/ext/node_modules/type": {
+      "version": "2.7.2",
+      "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz",
+      "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==",
+      "dev": true
+    },
+    "node_modules/extend": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz",
+      "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==",
+      "dev": true
+    },
+    "node_modules/extend-shallow": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz",
+      "integrity": "sha512-BwY5b5Ql4+qZoefgMj2NUmx+tehVTH/Kf4k1ZEtOHNFcm2wSxMRo992l6X3TIgni2eZVTZ85xMOjF31fwZAj6Q==",
+      "dev": true,
+      "dependencies": {
+        "assign-symbols": "^1.0.0",
+        "is-extendable": "^1.0.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/external-editor": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz",
+      "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==",
+      "dev": true,
+      "dependencies": {
+        "chardet": "^0.7.0",
+        "iconv-lite": "^0.4.24",
+        "tmp": "^0.0.33"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/extglob": {
+      "version": "2.0.4",
+      "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz",
+      "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==",
+      "dev": true,
+      "dependencies": {
+        "array-unique": "^0.3.2",
+        "define-property": "^1.0.0",
+        "expand-brackets": "^2.1.4",
+        "extend-shallow": "^2.0.1",
+        "fragment-cache": "^0.2.1",
+        "regex-not": "^1.0.0",
+        "snapdragon": "^0.8.1",
+        "to-regex": "^3.0.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/extglob/node_modules/define-property": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+      "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==",
+      "dev": true,
+      "dependencies": {
+        "is-descriptor": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/extglob/node_modules/extend-shallow": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+      "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
+      "dev": true,
+      "dependencies": {
+        "is-extendable": "^0.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/extglob/node_modules/is-extendable": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+      "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/extsprintf": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz",
+      "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==",
+      "dev": true,
+      "engines": [
+        "node >=0.6.0"
+      ]
+    },
+    "node_modules/fast-deep-equal": {
+      "version": "3.1.3",
+      "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
+      "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q=="
+    },
+    "node_modules/fast-json-stable-stringify": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
+      "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw=="
+    },
+    "node_modules/fast-levenshtein": {
+      "version": "2.0.6",
+      "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
+      "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
+      "dev": true
+    },
+    "node_modules/fast-safe-stringify": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz",
+      "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==",
+      "dev": true
+    },
+    "node_modules/fb-watchman": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.2.tgz",
+      "integrity": "sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA==",
+      "dev": true,
+      "dependencies": {
+        "bser": "2.1.1"
+      }
+    },
+    "node_modules/figures": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
+      "integrity": "sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA==",
+      "dev": true,
+      "dependencies": {
+        "escape-string-regexp": "^1.0.5"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/file-entry-cache": {
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz",
+      "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==",
+      "dev": true,
+      "dependencies": {
+        "flat-cache": "^2.0.1"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/file-uri-to-path": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
+      "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==",
+      "dev": true,
+      "optional": true
+    },
+    "node_modules/fill-range": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz",
+      "integrity": "sha512-VcpLTWqWDiTerugjj8e3+esbg+skS3M9e54UuR3iCeIDMXCLTsAH8hTSzDQU/X6/6t3eYkOKoZSef2PlU6U1XQ==",
+      "dev": true,
+      "dependencies": {
+        "extend-shallow": "^2.0.1",
+        "is-number": "^3.0.0",
+        "repeat-string": "^1.6.1",
+        "to-regex-range": "^2.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/fill-range/node_modules/extend-shallow": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+      "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
+      "dev": true,
+      "dependencies": {
+        "is-extendable": "^0.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/fill-range/node_modules/is-extendable": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+      "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/find-parent-dir": {
+      "version": "0.3.1",
+      "resolved": "https://registry.npmjs.org/find-parent-dir/-/find-parent-dir-0.3.1.tgz",
+      "integrity": "sha512-o4UcykWV/XN9wm+jMEtWLPlV8RXCZnMhQI6F6OdHeSez7iiJWePw8ijOlskJZMsaQoGR/b7dH6lO02HhaTN7+A==",
+      "dev": true
+    },
+    "node_modules/find-up": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz",
+      "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==",
+      "dev": true,
+      "dependencies": {
+        "locate-path": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/flat-cache": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz",
+      "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==",
+      "dev": true,
+      "dependencies": {
+        "flatted": "^2.0.0",
+        "rimraf": "2.6.3",
+        "write": "1.0.3"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/flatted": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz",
+      "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==",
+      "dev": true
+    },
+    "node_modules/for-each": {
+      "version": "0.3.3",
+      "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
+      "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==",
+      "dev": true,
+      "dependencies": {
+        "is-callable": "^1.1.3"
+      }
+    },
+    "node_modules/for-in": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz",
+      "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/forever-agent": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
+      "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==",
+      "dev": true,
+      "engines": {
+        "node": "*"
+      }
+    },
+    "node_modules/form-data": {
+      "version": "2.3.3",
+      "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz",
+      "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==",
+      "dev": true,
+      "dependencies": {
+        "asynckit": "^0.4.0",
+        "combined-stream": "^1.0.6",
+        "mime-types": "^2.1.12"
+      },
+      "engines": {
+        "node": ">= 0.12"
+      }
+    },
+    "node_modules/formidable": {
+      "version": "1.2.6",
+      "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.6.tgz",
+      "integrity": "sha512-KcpbcpuLNOwrEjnbpMC0gS+X8ciDoZE1kkqzat4a8vrprf+s9pKNQ/QIwWfbfs4ltgmFl3MD177SNTkve3BwGQ==",
+      "deprecated": "Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau",
+      "dev": true,
+      "funding": {
+        "url": "https://ko-fi.com/tunnckoCore/commissions"
+      }
+    },
+    "node_modules/fragment-cache": {
+      "version": "0.2.1",
+      "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz",
+      "integrity": "sha512-GMBAbW9antB8iZRHLoGw0b3HANt57diZYFO/HL1JGIC1MjKrdmhxvrJbupnVvpys0zsz7yBApXdQyfepKly2kA==",
+      "dev": true,
+      "dependencies": {
+        "map-cache": "^0.2.2"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/fs-extra": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-1.0.0.tgz",
+      "integrity": "sha512-VerQV6vEKuhDWD2HGOybV6v5I73syoc/cXAbKlgTC7M/oFVEtklWlp9QH2Ijw3IaWDOQcMkldSPa7zXy79Z/UQ==",
+      "dependencies": {
+        "graceful-fs": "^4.1.2",
+        "jsonfile": "^2.1.0",
+        "klaw": "^1.0.0"
+      }
+    },
+    "node_modules/fs.realpath": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
+      "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==",
+      "dev": true
+    },
+    "node_modules/fsevents": {
+      "version": "1.2.13",
+      "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz",
+      "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==",
+      "deprecated": "The v1 package contains DANGEROUS / INSECURE binaries. Upgrade to safe fsevents v2",
+      "dev": true,
+      "hasInstallScript": true,
+      "optional": true,
+      "os": [
+        "darwin"
+      ],
+      "dependencies": {
+        "bindings": "^1.5.0",
+        "nan": "^2.12.1"
+      },
+      "engines": {
+        "node": ">= 4.0"
+      }
+    },
+    "node_modules/function-bind": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
+      "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A=="
+    },
+    "node_modules/function.prototype.name": {
+      "version": "1.1.5",
+      "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz",
+      "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "define-properties": "^1.1.3",
+        "es-abstract": "^1.19.0",
+        "functions-have-names": "^1.2.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/functional-red-black-tree": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
+      "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==",
+      "dev": true
+    },
+    "node_modules/functions-have-names": {
+      "version": "1.2.3",
+      "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz",
+      "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==",
+      "dev": true,
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/gensync": {
+      "version": "1.0.0-beta.2",
+      "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
+      "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==",
+      "dev": true,
+      "engines": {
+        "node": ">=6.9.0"
+      }
+    },
+    "node_modules/get-assigned-identifiers": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz",
+      "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==",
+      "dev": true
+    },
+    "node_modules/get-caller-file": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz",
+      "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w=="
+    },
+    "node_modules/get-intrinsic": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz",
+      "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==",
+      "dev": true,
+      "dependencies": {
+        "function-bind": "^1.1.1",
+        "has": "^1.0.3",
+        "has-proto": "^1.0.1",
+        "has-symbols": "^1.0.3"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/get-stream": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz",
+      "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==",
+      "dev": true,
+      "dependencies": {
+        "pump": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/get-symbol-description": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz",
+      "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "get-intrinsic": "^1.1.1"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/get-value": {
+      "version": "2.0.6",
+      "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
+      "integrity": "sha512-Ln0UQDlxH1BapMu3GPtf7CuYNwRZf2gwCuPqbyG6pB8WfmFpzqcy4xtAaAMUhnNqjMKTiCPZG2oMT3YSx8U2NA==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/getpass": {
+      "version": "0.1.7",
+      "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz",
+      "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==",
+      "dev": true,
+      "dependencies": {
+        "assert-plus": "^1.0.0"
+      }
+    },
+    "node_modules/glob": {
+      "version": "7.2.3",
+      "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz",
+      "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==",
+      "dev": true,
+      "dependencies": {
+        "fs.realpath": "^1.0.0",
+        "inflight": "^1.0.4",
+        "inherits": "2",
+        "minimatch": "^3.1.1",
+        "once": "^1.3.0",
+        "path-is-absolute": "^1.0.0"
+      },
+      "engines": {
+        "node": "*"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/isaacs"
+      }
+    },
+    "node_modules/globals": {
+      "version": "11.12.0",
+      "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
+      "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/globalthis": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz",
+      "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==",
+      "dev": true,
+      "dependencies": {
+        "define-properties": "^1.1.3"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/globo": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/globo/-/globo-1.1.0.tgz",
+      "integrity": "sha512-9kacJpRuOo2IPxzYdogGZKnREZXMLs7P2/gaeHxynuL7kmxdB9o4EVtpd69f81CeUFWmZSxj1heZFEXQDTkaLQ==",
+      "dev": true,
+      "dependencies": {
+        "accessory": "~1.1.0",
+        "is-defined": "~1.0.0",
+        "ternary": "~1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/gopd": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz",
+      "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==",
+      "dev": true,
+      "dependencies": {
+        "get-intrinsic": "^1.1.3"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/graceful-fs": {
+      "version": "4.2.11",
+      "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
+      "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
+    },
+    "node_modules/growly": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz",
+      "integrity": "sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw==",
+      "dev": true
+    },
+    "node_modules/har-schema": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
+      "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/har-validator": {
+      "version": "5.1.5",
+      "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz",
+      "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==",
+      "deprecated": "this library is no longer supported",
+      "dev": true,
+      "dependencies": {
+        "ajv": "^6.12.3",
+        "har-schema": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/has": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
+      "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
+      "dependencies": {
+        "function-bind": "^1.1.1"
+      },
+      "engines": {
+        "node": ">= 0.4.0"
+      }
+    },
+    "node_modules/has-bigints": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz",
+      "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==",
+      "dev": true,
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/has-flag": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
+      "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/has-property-descriptors": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz",
+      "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==",
+      "dev": true,
+      "dependencies": {
+        "get-intrinsic": "^1.1.1"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/has-proto": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz",
+      "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/has-require": {
+      "version": "1.2.2",
+      "resolved": "https://registry.npmjs.org/has-require/-/has-require-1.2.2.tgz",
+      "integrity": "sha512-JHMVoV2TG3LEFw/8UjxXJzCRGdOHJzzAXft7BafERh2rdPYZcS5N6Twv7Q8yLy9mciKsVBkXmpWSuLp5GUXNng==",
+      "dev": true,
+      "dependencies": {
+        "escape-string-regexp": "^1.0.3"
+      }
+    },
+    "node_modules/has-symbols": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz",
+      "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/has-tostringtag": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz",
+      "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==",
+      "dev": true,
+      "dependencies": {
+        "has-symbols": "^1.0.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/has-value": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz",
+      "integrity": "sha512-IBXk4GTsLYdQ7Rvt+GRBrFSVEkmuOUy4re0Xjd9kJSUQpnTrWR4/y9RpfexN9vkAPMFuQoeWKwqzPozRTlasGw==",
+      "dev": true,
+      "dependencies": {
+        "get-value": "^2.0.6",
+        "has-values": "^1.0.0",
+        "isobject": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/has-values": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz",
+      "integrity": "sha512-ODYZC64uqzmtfGMEAX/FvZiRyWLpAC3vYnNunURUnkGVTS+mI0smVsWaPydRBsE3g+ok7h960jChO8mFcWlHaQ==",
+      "dev": true,
+      "dependencies": {
+        "is-number": "^3.0.0",
+        "kind-of": "^4.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/has-values/node_modules/kind-of": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz",
+      "integrity": "sha512-24XsCxmEbRwEDbz/qz3stgin8TTzZ1ESR56OMCN0ujYg+vRutNSiOj9bHH9u85DKgXguraugV5sFuvbD4FW/hw==",
+      "dev": true,
+      "dependencies": {
+        "is-buffer": "^1.1.5"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/hash-base": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz",
+      "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==",
+      "dev": true,
+      "dependencies": {
+        "inherits": "^2.0.4",
+        "readable-stream": "^3.6.0",
+        "safe-buffer": "^5.2.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/hash-base/node_modules/readable-stream": {
+      "version": "3.6.2",
+      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
+      "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
+      "dev": true,
+      "dependencies": {
+        "inherits": "^2.0.3",
+        "string_decoder": "^1.1.1",
+        "util-deprecate": "^1.0.1"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/hash.js": {
+      "version": "1.1.7",
+      "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz",
+      "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==",
+      "dev": true,
+      "dependencies": {
+        "inherits": "^2.0.3",
+        "minimalistic-assert": "^1.0.1"
+      }
+    },
+    "node_modules/hmac-drbg": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
+      "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==",
+      "dev": true,
+      "dependencies": {
+        "hash.js": "^1.0.3",
+        "minimalistic-assert": "^1.0.0",
+        "minimalistic-crypto-utils": "^1.0.1"
+      }
+    },
+    "node_modules/hosted-git-info": {
+      "version": "2.8.9",
+      "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",
+      "integrity": "sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw=="
+    },
+    "node_modules/html-encoding-sniffer": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-1.0.2.tgz",
+      "integrity": "sha512-71lZziiDnsuabfdYiUeWdCVyKuqwWi23L8YeIgV9jSSZHCtb6wB1BKWooH7L3tn4/FuZJMVWyNaIDr4RGmaSYw==",
+      "dev": true,
+      "dependencies": {
+        "whatwg-encoding": "^1.0.1"
+      }
+    },
+    "node_modules/html-escaper": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
+      "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==",
+      "dev": true
+    },
+    "node_modules/htmlescape": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/htmlescape/-/htmlescape-1.1.1.tgz",
+      "integrity": "sha512-eVcrzgbR4tim7c7soKQKtxa/kQM4TzjnlU83rcZ9bHU6t31ehfV7SktN6McWgwPWg+JYMA/O3qpGxBvFq1z2Jg==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10"
+      }
+    },
+    "node_modules/http-signature": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz",
+      "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==",
+      "dev": true,
+      "dependencies": {
+        "assert-plus": "^1.0.0",
+        "jsprim": "^1.2.2",
+        "sshpk": "^1.7.0"
+      },
+      "engines": {
+        "node": ">=0.8",
+        "npm": ">=1.3.7"
+      }
+    },
+    "node_modules/https-browserify": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz",
+      "integrity": "sha512-J+FkSdyD+0mA0N+81tMotaRMfSL9SGi+xpD3T6YApKsc3bGSXJlfXri3VyFOeYkfLRQisDk1W+jIFFKBeUBbBg==",
+      "dev": true
+    },
+    "node_modules/iconv-lite": {
+      "version": "0.4.24",
+      "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
+      "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
+      "dev": true,
+      "dependencies": {
+        "safer-buffer": ">= 2.1.2 < 3"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/ieee754": {
+      "version": "1.2.1",
+      "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
+      "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
+      "dev": true,
+      "funding": [
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/feross"
+        },
+        {
+          "type": "patreon",
+          "url": "https://www.patreon.com/feross"
+        },
+        {
+          "type": "consulting",
+          "url": "https://feross.org/support"
+        }
+      ]
+    },
+    "node_modules/ignore": {
+      "version": "4.0.6",
+      "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz",
+      "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==",
+      "dev": true,
+      "engines": {
+        "node": ">= 4"
+      }
+    },
+    "node_modules/import-fresh": {
+      "version": "3.3.0",
+      "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz",
+      "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==",
+      "dev": true,
+      "dependencies": {
+        "parent-module": "^1.0.0",
+        "resolve-from": "^4.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/import-local": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/import-local/-/import-local-2.0.0.tgz",
+      "integrity": "sha512-b6s04m3O+s3CGSbqDIyP4R6aAwAeYlVq9+WUWep6iHa8ETRf9yei1U48C5MmfJmV9AiLYYBKPMq/W+/WRpQmCQ==",
+      "dev": true,
+      "dependencies": {
+        "pkg-dir": "^3.0.0",
+        "resolve-cwd": "^2.0.0"
+      },
+      "bin": {
+        "import-local-fixture": "fixtures/cli.js"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/imurmurhash": {
+      "version": "0.1.4",
+      "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
+      "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.8.19"
+      }
+    },
+    "node_modules/inflight": {
+      "version": "1.0.6",
+      "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
+      "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==",
+      "dev": true,
+      "dependencies": {
+        "once": "^1.3.0",
+        "wrappy": "1"
+      }
+    },
+    "node_modules/inherits": {
+      "version": "2.0.4",
+      "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
+      "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
+      "dev": true
+    },
+    "node_modules/inline-source-map": {
+      "version": "0.6.2",
+      "resolved": "https://registry.npmjs.org/inline-source-map/-/inline-source-map-0.6.2.tgz",
+      "integrity": "sha512-0mVWSSbNDvedDWIN4wxLsdPM4a7cIPcpyMxj3QZ406QRwQ6ePGB1YIHxVPjqpcUGbWQ5C+nHTwGNWAGvt7ggVA==",
+      "dev": true,
+      "dependencies": {
+        "source-map": "~0.5.3"
+      }
+    },
+    "node_modules/inquirer": {
+      "version": "6.5.2",
+      "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz",
+      "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==",
+      "dev": true,
+      "dependencies": {
+        "ansi-escapes": "^3.2.0",
+        "chalk": "^2.4.2",
+        "cli-cursor": "^2.1.0",
+        "cli-width": "^2.0.0",
+        "external-editor": "^3.0.3",
+        "figures": "^2.0.0",
+        "lodash": "^4.17.12",
+        "mute-stream": "0.0.7",
+        "run-async": "^2.2.0",
+        "rxjs": "^6.4.0",
+        "string-width": "^2.1.0",
+        "strip-ansi": "^5.1.0",
+        "through": "^2.3.6"
+      },
+      "engines": {
+        "node": ">=6.0.0"
+      }
+    },
+    "node_modules/inquirer/node_modules/strip-ansi": {
+      "version": "5.2.0",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+      "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
+      "dev": true,
+      "dependencies": {
+        "ansi-regex": "^4.1.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/insert-module-globals": {
+      "version": "7.2.1",
+      "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.1.tgz",
+      "integrity": "sha512-ufS5Qq9RZN+Bu899eA9QCAYThY+gGW7oRkmb0vC93Vlyu/CFGcH0OYPEjVkDXA5FEbTt1+VWzdoOD3Ny9N+8tg==",
+      "dev": true,
+      "dependencies": {
+        "acorn-node": "^1.5.2",
+        "combine-source-map": "^0.8.0",
+        "concat-stream": "^1.6.1",
+        "is-buffer": "^1.1.0",
+        "JSONStream": "^1.0.3",
+        "path-is-absolute": "^1.0.1",
+        "process": "~0.11.0",
+        "through2": "^2.0.0",
+        "undeclared-identifiers": "^1.1.2",
+        "xtend": "^4.0.0"
+      },
+      "bin": {
+        "insert-module-globals": "bin/cmd.js"
+      }
+    },
+    "node_modules/internal-slot": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz",
+      "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==",
+      "dev": true,
+      "dependencies": {
+        "get-intrinsic": "^1.2.0",
+        "has": "^1.0.3",
+        "side-channel": "^1.0.4"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/invariant": {
+      "version": "2.2.4",
+      "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
+      "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==",
+      "dev": true,
+      "dependencies": {
+        "loose-envify": "^1.0.0"
+      }
+    },
+    "node_modules/invert-kv": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz",
+      "integrity": "sha512-xgs2NH9AE66ucSq4cNG1nhSFghr5l6tdL15Pk+jl46bmmBapgoaY/AacXyaDznAqmGL99TiLSQgO/XazFSKYeQ==",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/is-accessor-descriptor": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz",
+      "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==",
+      "dev": true,
+      "dependencies": {
+        "kind-of": "^6.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/is-array-buffer": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz",
+      "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "get-intrinsic": "^1.2.0",
+        "is-typed-array": "^1.1.10"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-arrayish": {
+      "version": "0.2.1",
+      "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz",
+      "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg=="
+    },
+    "node_modules/is-bigint": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz",
+      "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==",
+      "dev": true,
+      "dependencies": {
+        "has-bigints": "^1.0.1"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-boolean-object": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz",
+      "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "has-tostringtag": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-buffer": {
+      "version": "1.1.6",
+      "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
+      "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==",
+      "dev": true
+    },
+    "node_modules/is-callable": {
+      "version": "1.2.7",
+      "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz",
+      "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-ci": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz",
+      "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==",
+      "dev": true,
+      "dependencies": {
+        "ci-info": "^2.0.0"
+      },
+      "bin": {
+        "is-ci": "bin.js"
+      }
+    },
+    "node_modules/is-core-module": {
+      "version": "2.13.0",
+      "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.13.0.tgz",
+      "integrity": "sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==",
+      "dependencies": {
+        "has": "^1.0.3"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-data-descriptor": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz",
+      "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==",
+      "dev": true,
+      "dependencies": {
+        "kind-of": "^6.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/is-date-object": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz",
+      "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==",
+      "dev": true,
+      "dependencies": {
+        "has-tostringtag": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-defined": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/is-defined/-/is-defined-1.0.0.tgz",
+      "integrity": "sha512-/drGiPCBGsJDhtnLkdcNl8QtEo9ddV10m0Y7wzkopIQM4u91wXhe84pZSH6RLukO2uJDtQoaAr1XoP0ilwsYzg==",
+      "dev": true
+    },
+    "node_modules/is-descriptor": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz",
+      "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==",
+      "dev": true,
+      "dependencies": {
+        "is-accessor-descriptor": "^1.0.0",
+        "is-data-descriptor": "^1.0.0",
+        "kind-of": "^6.0.2"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/is-extendable": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz",
+      "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==",
+      "dev": true,
+      "dependencies": {
+        "is-plain-object": "^2.0.4"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/is-fullwidth-code-point": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
+      "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/is-generator-fn": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz",
+      "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/is-negative-zero": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz",
+      "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-number": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz",
+      "integrity": "sha512-4cboCqIpliH+mAvFNegjZQ4kgKc3ZUhQVr3HvWbSh5q3WH2v82ct+T2Y1hdU5Gdtorx/cLifQjqCbL7bpznLTg==",
+      "dev": true,
+      "dependencies": {
+        "kind-of": "^3.0.2"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/is-number-object": {
+      "version": "1.0.7",
+      "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz",
+      "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==",
+      "dev": true,
+      "dependencies": {
+        "has-tostringtag": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-number/node_modules/kind-of": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+      "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+      "dev": true,
+      "dependencies": {
+        "is-buffer": "^1.1.5"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/is-plain-object": {
+      "version": "2.0.4",
+      "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz",
+      "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==",
+      "dev": true,
+      "dependencies": {
+        "isobject": "^3.0.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/is-regex": {
+      "version": "1.1.4",
+      "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
+      "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "has-tostringtag": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-shared-array-buffer": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz",
+      "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-stream": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz",
+      "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/is-string": {
+      "version": "1.0.7",
+      "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz",
+      "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==",
+      "dev": true,
+      "dependencies": {
+        "has-tostringtag": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-symbol": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz",
+      "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==",
+      "dev": true,
+      "dependencies": {
+        "has-symbols": "^1.0.2"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-typed-array": {
+      "version": "1.1.12",
+      "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.12.tgz",
+      "integrity": "sha512-Z14TF2JNG8Lss5/HMqt0//T9JeHXttXy5pH/DBU4vi98ozO2btxzq9MwYDZYnKwU8nRsz/+GVFVRDq3DkVuSPg==",
+      "dev": true,
+      "dependencies": {
+        "which-typed-array": "^1.1.11"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-typedarray": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
+      "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==",
+      "dev": true
+    },
+    "node_modules/is-utf8": {
+      "version": "0.2.1",
+      "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz",
+      "integrity": "sha512-rMYPYvCzsXywIsldgLaSoPlw5PfoB/ssr7hY4pLfcodrA5M/eArza1a9VmTiNIBNMjOGr1Ow9mTyU2o69U6U9Q=="
+    },
+    "node_modules/is-weakref": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz",
+      "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/is-windows": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz",
+      "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/is-wsl": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-1.1.0.tgz",
+      "integrity": "sha512-gfygJYZ2gLTDlmbWMI0CE2MwnFzSN/2SZfkMlItC4K/JBlsWVDB0bO6XhqcY13YXE7iMcAJnzTCJjPiTeJJ0Mw==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/isarray": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",
+      "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==",
+      "dev": true
+    },
+    "node_modules/isexe": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
+      "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
+      "dev": true
+    },
+    "node_modules/isobject": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz",
+      "integrity": "sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/isstream": {
+      "version": "0.1.2",
+      "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
+      "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==",
+      "dev": true
+    },
+    "node_modules/istanbul-lib-coverage": {
+      "version": "2.0.5",
+      "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz",
+      "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==",
+      "dev": true,
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/istanbul-lib-instrument": {
+      "version": "3.3.0",
+      "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz",
+      "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==",
+      "dev": true,
+      "dependencies": {
+        "@babel/generator": "^7.4.0",
+        "@babel/parser": "^7.4.3",
+        "@babel/template": "^7.4.0",
+        "@babel/traverse": "^7.4.3",
+        "@babel/types": "^7.4.0",
+        "istanbul-lib-coverage": "^2.0.5",
+        "semver": "^6.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/istanbul-lib-instrument/node_modules/semver": {
+      "version": "6.3.1",
+      "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+      "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+      "dev": true,
+      "bin": {
+        "semver": "bin/semver.js"
+      }
+    },
+    "node_modules/istanbul-lib-report": {
+      "version": "2.0.8",
+      "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz",
+      "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==",
+      "dev": true,
+      "dependencies": {
+        "istanbul-lib-coverage": "^2.0.5",
+        "make-dir": "^2.1.0",
+        "supports-color": "^6.1.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/istanbul-lib-report/node_modules/supports-color": {
+      "version": "6.1.0",
+      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
+      "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
+      "dev": true,
+      "dependencies": {
+        "has-flag": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/istanbul-lib-source-maps": {
+      "version": "3.0.6",
+      "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz",
+      "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==",
+      "dev": true,
+      "dependencies": {
+        "debug": "^4.1.1",
+        "istanbul-lib-coverage": "^2.0.5",
+        "make-dir": "^2.1.0",
+        "rimraf": "^2.6.3",
+        "source-map": "^0.6.1"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/istanbul-lib-source-maps/node_modules/source-map": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/istanbul-reports": {
+      "version": "2.2.7",
+      "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.7.tgz",
+      "integrity": "sha512-uu1F/L1o5Y6LzPVSVZXNOoD/KXpJue9aeLRd0sM9uMXfZvzomB0WxVamWb5ue8kA2vVWEmW7EG+A5n3f1kqHKg==",
+      "dev": true,
+      "dependencies": {
+        "html-escaper": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/jest": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest/-/jest-24.9.0.tgz",
+      "integrity": "sha512-YvkBL1Zm7d2B1+h5fHEOdyjCG+sGMz4f8D86/0HiqJ6MB4MnDc8FgP5vdWsGnemOQro7lnYo8UakZ3+5A0jxGw==",
+      "dev": true,
+      "dependencies": {
+        "import-local": "^2.0.0",
+        "jest-cli": "^24.9.0"
+      },
+      "bin": {
+        "jest": "bin/jest.js"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-changed-files": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.9.0.tgz",
+      "integrity": "sha512-6aTWpe2mHF0DhL28WjdkO8LyGjs3zItPET4bMSeXU6T3ub4FPMw+mcOcbdGXQOAfmLcxofD23/5Bl9Z4AkFwqg==",
+      "dev": true,
+      "dependencies": {
+        "@jest/types": "^24.9.0",
+        "execa": "^1.0.0",
+        "throat": "^4.0.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-cli": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.9.0.tgz",
+      "integrity": "sha512-+VLRKyitT3BWoMeSUIHRxV/2g8y9gw91Jh5z2UmXZzkZKpbC08CSehVxgHUwTpy+HwGcns/tqafQDJW7imYvGg==",
+      "dev": true,
+      "dependencies": {
+        "@jest/core": "^24.9.0",
+        "@jest/test-result": "^24.9.0",
+        "@jest/types": "^24.9.0",
+        "chalk": "^2.0.1",
+        "exit": "^0.1.2",
+        "import-local": "^2.0.0",
+        "is-ci": "^2.0.0",
+        "jest-config": "^24.9.0",
+        "jest-util": "^24.9.0",
+        "jest-validate": "^24.9.0",
+        "prompts": "^2.0.1",
+        "realpath-native": "^1.1.0",
+        "yargs": "^13.3.0"
+      },
+      "bin": {
+        "jest": "bin/jest.js"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-cli/node_modules/cliui": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
+      "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
+      "dev": true,
+      "dependencies": {
+        "string-width": "^3.1.0",
+        "strip-ansi": "^5.2.0",
+        "wrap-ansi": "^5.1.0"
+      }
+    },
+    "node_modules/jest-cli/node_modules/get-caller-file": {
+      "version": "2.0.5",
+      "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+      "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+      "dev": true,
+      "engines": {
+        "node": "6.* || 8.* || >= 10.*"
+      }
+    },
+    "node_modules/jest-cli/node_modules/string-width": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
+      "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
+      "dev": true,
+      "dependencies": {
+        "emoji-regex": "^7.0.1",
+        "is-fullwidth-code-point": "^2.0.0",
+        "strip-ansi": "^5.1.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/jest-cli/node_modules/strip-ansi": {
+      "version": "5.2.0",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+      "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
+      "dev": true,
+      "dependencies": {
+        "ansi-regex": "^4.1.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/jest-cli/node_modules/which-module": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz",
+      "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
+      "dev": true
+    },
+    "node_modules/jest-cli/node_modules/wrap-ansi": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
+      "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
+      "dev": true,
+      "dependencies": {
+        "ansi-styles": "^3.2.0",
+        "string-width": "^3.0.0",
+        "strip-ansi": "^5.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/jest-cli/node_modules/y18n": {
+      "version": "4.0.3",
+      "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
+      "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
+      "dev": true
+    },
+    "node_modules/jest-cli/node_modules/yargs": {
+      "version": "13.3.2",
+      "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz",
+      "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==",
+      "dev": true,
+      "dependencies": {
+        "cliui": "^5.0.0",
+        "find-up": "^3.0.0",
+        "get-caller-file": "^2.0.1",
+        "require-directory": "^2.1.1",
+        "require-main-filename": "^2.0.0",
+        "set-blocking": "^2.0.0",
+        "string-width": "^3.0.0",
+        "which-module": "^2.0.0",
+        "y18n": "^4.0.0",
+        "yargs-parser": "^13.1.2"
+      }
+    },
+    "node_modules/jest-cli/node_modules/yargs-parser": {
+      "version": "13.1.2",
+      "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz",
+      "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==",
+      "dev": true,
+      "dependencies": {
+        "camelcase": "^5.0.0",
+        "decamelize": "^1.2.0"
+      }
+    },
+    "node_modules/jest-config": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.9.0.tgz",
+      "integrity": "sha512-RATtQJtVYQrp7fvWg6f5y3pEFj9I+H8sWw4aKxnDZ96mob5i5SD6ZEGWgMLXQ4LE8UurrjbdlLWdUeo+28QpfQ==",
+      "dev": true,
+      "dependencies": {
+        "@babel/core": "^7.1.0",
+        "@jest/test-sequencer": "^24.9.0",
+        "@jest/types": "^24.9.0",
+        "babel-jest": "^24.9.0",
+        "chalk": "^2.0.1",
+        "glob": "^7.1.1",
+        "jest-environment-jsdom": "^24.9.0",
+        "jest-environment-node": "^24.9.0",
+        "jest-get-type": "^24.9.0",
+        "jest-jasmine2": "^24.9.0",
+        "jest-regex-util": "^24.3.0",
+        "jest-resolve": "^24.9.0",
+        "jest-util": "^24.9.0",
+        "jest-validate": "^24.9.0",
+        "micromatch": "^3.1.10",
+        "pretty-format": "^24.9.0",
+        "realpath-native": "^1.1.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-diff": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.9.0.tgz",
+      "integrity": "sha512-qMfrTs8AdJE2iqrTp0hzh7kTd2PQWrsFyj9tORoKmu32xjPjeE4NyjVRDz8ybYwqS2ik8N4hsIpiVTyFeo2lBQ==",
+      "dev": true,
+      "dependencies": {
+        "chalk": "^2.0.1",
+        "diff-sequences": "^24.9.0",
+        "jest-get-type": "^24.9.0",
+        "pretty-format": "^24.9.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-docblock": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-24.9.0.tgz",
+      "integrity": "sha512-F1DjdpDMJMA1cN6He0FNYNZlo3yYmOtRUnktrT9Q37njYzC5WEaDdmbynIgy0L/IvXvvgsG8OsqhLPXTpfmZAA==",
+      "dev": true,
+      "dependencies": {
+        "detect-newline": "^2.1.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-each": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-24.9.0.tgz",
+      "integrity": "sha512-ONi0R4BvW45cw8s2Lrx8YgbeXL1oCQ/wIDwmsM3CqM/nlblNCPmnC3IPQlMbRFZu3wKdQ2U8BqM6lh3LJ5Bsog==",
+      "dev": true,
+      "dependencies": {
+        "@jest/types": "^24.9.0",
+        "chalk": "^2.0.1",
+        "jest-get-type": "^24.9.0",
+        "jest-util": "^24.9.0",
+        "pretty-format": "^24.9.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-environment-jsdom": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.9.0.tgz",
+      "integrity": "sha512-Zv9FV9NBRzLuALXjvRijO2351DRQeLYXtpD4xNvfoVFw21IOKNhZAEUKcbiEtjTkm2GsJ3boMVgkaR7rN8qetA==",
+      "dev": true,
+      "dependencies": {
+        "@jest/environment": "^24.9.0",
+        "@jest/fake-timers": "^24.9.0",
+        "@jest/types": "^24.9.0",
+        "jest-mock": "^24.9.0",
+        "jest-util": "^24.9.0",
+        "jsdom": "^11.5.1"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-environment-node": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.9.0.tgz",
+      "integrity": "sha512-6d4V2f4nxzIzwendo27Tr0aFm+IXWa0XEUnaH6nU0FMaozxovt+sfRvh4J47wL1OvF83I3SSTu0XK+i4Bqe7uA==",
+      "dev": true,
+      "dependencies": {
+        "@jest/environment": "^24.9.0",
+        "@jest/fake-timers": "^24.9.0",
+        "@jest/types": "^24.9.0",
+        "jest-mock": "^24.9.0",
+        "jest-util": "^24.9.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-get-type": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.9.0.tgz",
+      "integrity": "sha512-lUseMzAley4LhIcpSP9Jf+fTrQ4a1yHQwLNeeVa2cEmbCGeoZAtYPOIv8JaxLD/sUpKxetKGP+gsHl8f8TSj8Q==",
+      "dev": true,
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-haste-map": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.9.0.tgz",
+      "integrity": "sha512-kfVFmsuWui2Sj1Rp1AJ4D9HqJwE4uwTlS/vO+eRUaMmd54BFpli2XhMQnPC2k4cHFVbB2Q2C+jtI1AGLgEnCjQ==",
+      "dev": true,
+      "dependencies": {
+        "@jest/types": "^24.9.0",
+        "anymatch": "^2.0.0",
+        "fb-watchman": "^2.0.0",
+        "graceful-fs": "^4.1.15",
+        "invariant": "^2.2.4",
+        "jest-serializer": "^24.9.0",
+        "jest-util": "^24.9.0",
+        "jest-worker": "^24.9.0",
+        "micromatch": "^3.1.10",
+        "sane": "^4.0.3",
+        "walker": "^1.0.7"
+      },
+      "engines": {
+        "node": ">= 6"
+      },
+      "optionalDependencies": {
+        "fsevents": "^1.2.7"
+      }
+    },
+    "node_modules/jest-jasmine2": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.9.0.tgz",
+      "integrity": "sha512-Cq7vkAgaYKp+PsX+2/JbTarrk0DmNhsEtqBXNwUHkdlbrTBLtMJINADf2mf5FkowNsq8evbPc07/qFO0AdKTzw==",
+      "dev": true,
+      "dependencies": {
+        "@babel/traverse": "^7.1.0",
+        "@jest/environment": "^24.9.0",
+        "@jest/test-result": "^24.9.0",
+        "@jest/types": "^24.9.0",
+        "chalk": "^2.0.1",
+        "co": "^4.6.0",
+        "expect": "^24.9.0",
+        "is-generator-fn": "^2.0.0",
+        "jest-each": "^24.9.0",
+        "jest-matcher-utils": "^24.9.0",
+        "jest-message-util": "^24.9.0",
+        "jest-runtime": "^24.9.0",
+        "jest-snapshot": "^24.9.0",
+        "jest-util": "^24.9.0",
+        "pretty-format": "^24.9.0",
+        "throat": "^4.0.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-leak-detector": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.9.0.tgz",
+      "integrity": "sha512-tYkFIDsiKTGwb2FG1w8hX9V0aUb2ot8zY/2nFg087dUageonw1zrLMP4W6zsRO59dPkTSKie+D4rhMuP9nRmrA==",
+      "dev": true,
+      "dependencies": {
+        "jest-get-type": "^24.9.0",
+        "pretty-format": "^24.9.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-matcher-utils": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.9.0.tgz",
+      "integrity": "sha512-OZz2IXsu6eaiMAwe67c1T+5tUAtQyQx27/EMEkbFAGiw52tB9em+uGbzpcgYVpA8wl0hlxKPZxrly4CXU/GjHA==",
+      "dev": true,
+      "dependencies": {
+        "chalk": "^2.0.1",
+        "jest-diff": "^24.9.0",
+        "jest-get-type": "^24.9.0",
+        "pretty-format": "^24.9.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-message-util": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.9.0.tgz",
+      "integrity": "sha512-oCj8FiZ3U0hTP4aSui87P4L4jC37BtQwUMqk+zk/b11FR19BJDeZsZAvIHutWnmtw7r85UmR3CEWZ0HWU2mAlw==",
+      "dev": true,
+      "dependencies": {
+        "@babel/code-frame": "^7.0.0",
+        "@jest/test-result": "^24.9.0",
+        "@jest/types": "^24.9.0",
+        "@types/stack-utils": "^1.0.1",
+        "chalk": "^2.0.1",
+        "micromatch": "^3.1.10",
+        "slash": "^2.0.0",
+        "stack-utils": "^1.0.1"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-mock": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-24.9.0.tgz",
+      "integrity": "sha512-3BEYN5WbSq9wd+SyLDES7AHnjH9A/ROBwmz7l2y+ol+NtSFO8DYiEBzoO1CeFc9a8DYy10EO4dDFVv/wN3zl1w==",
+      "dev": true,
+      "dependencies": {
+        "@jest/types": "^24.9.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-pnp-resolver": {
+      "version": "1.2.3",
+      "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.3.tgz",
+      "integrity": "sha512-+3NpwQEnRoIBtx4fyhblQDPgJI0H1IEIkX7ShLUjPGA7TtUTvI1oiKi3SR4oBR0hQhQR80l4WAe5RrXBwWMA8w==",
+      "dev": true,
+      "engines": {
+        "node": ">=6"
+      },
+      "peerDependencies": {
+        "jest-resolve": "*"
+      },
+      "peerDependenciesMeta": {
+        "jest-resolve": {
+          "optional": true
+        }
+      }
+    },
+    "node_modules/jest-regex-util": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-24.9.0.tgz",
+      "integrity": "sha512-05Cmb6CuxaA+Ys6fjr3PhvV3bGQmO+2p2La4hFbU+W5uOc479f7FdLXUWXw4pYMAhhSZIuKHwSXSu6CsSBAXQA==",
+      "dev": true,
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-resolve": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.9.0.tgz",
+      "integrity": "sha512-TaLeLVL1l08YFZAt3zaPtjiVvyy4oSA6CRe+0AFPPVX3Q/VI0giIWWoAvoS5L96vj9Dqxj4fB5p2qrHCmTU/MQ==",
+      "dev": true,
+      "dependencies": {
+        "@jest/types": "^24.9.0",
+        "browser-resolve": "^1.11.3",
+        "chalk": "^2.0.1",
+        "jest-pnp-resolver": "^1.2.1",
+        "realpath-native": "^1.1.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-resolve-dependencies": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.9.0.tgz",
+      "integrity": "sha512-Fm7b6AlWnYhT0BXy4hXpactHIqER7erNgIsIozDXWl5dVm+k8XdGVe1oTg1JyaFnOxarMEbax3wyRJqGP2Pq+g==",
+      "dev": true,
+      "dependencies": {
+        "@jest/types": "^24.9.0",
+        "jest-regex-util": "^24.3.0",
+        "jest-snapshot": "^24.9.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-resolve/node_modules/browser-resolve": {
+      "version": "1.11.3",
+      "resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.3.tgz",
+      "integrity": "sha512-exDi1BYWB/6raKHmDTCicQfTkqwN5fioMFV4j8BsfMU4R2DK/QfZfK7kOVkmWCNANf0snkBzqGqAJBao9gZMdQ==",
+      "dev": true,
+      "dependencies": {
+        "resolve": "1.1.7"
+      }
+    },
+    "node_modules/jest-resolve/node_modules/resolve": {
+      "version": "1.1.7",
+      "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz",
+      "integrity": "sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==",
+      "dev": true
+    },
+    "node_modules/jest-runner": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.9.0.tgz",
+      "integrity": "sha512-KksJQyI3/0mhcfspnxxEOBueGrd5E4vV7ADQLT9ESaCzz02WnbdbKWIf5Mkaucoaj7obQckYPVX6JJhgUcoWWg==",
+      "dev": true,
+      "dependencies": {
+        "@jest/console": "^24.7.1",
+        "@jest/environment": "^24.9.0",
+        "@jest/test-result": "^24.9.0",
+        "@jest/types": "^24.9.0",
+        "chalk": "^2.4.2",
+        "exit": "^0.1.2",
+        "graceful-fs": "^4.1.15",
+        "jest-config": "^24.9.0",
+        "jest-docblock": "^24.3.0",
+        "jest-haste-map": "^24.9.0",
+        "jest-jasmine2": "^24.9.0",
+        "jest-leak-detector": "^24.9.0",
+        "jest-message-util": "^24.9.0",
+        "jest-resolve": "^24.9.0",
+        "jest-runtime": "^24.9.0",
+        "jest-util": "^24.9.0",
+        "jest-worker": "^24.6.0",
+        "source-map-support": "^0.5.6",
+        "throat": "^4.0.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-runtime": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.9.0.tgz",
+      "integrity": "sha512-8oNqgnmF3v2J6PVRM2Jfuj8oX3syKmaynlDMMKQ4iyzbQzIG6th5ub/lM2bCMTmoTKM3ykcUYI2Pw9xwNtjMnw==",
+      "dev": true,
+      "dependencies": {
+        "@jest/console": "^24.7.1",
+        "@jest/environment": "^24.9.0",
+        "@jest/source-map": "^24.3.0",
+        "@jest/transform": "^24.9.0",
+        "@jest/types": "^24.9.0",
+        "@types/yargs": "^13.0.0",
+        "chalk": "^2.0.1",
+        "exit": "^0.1.2",
+        "glob": "^7.1.3",
+        "graceful-fs": "^4.1.15",
+        "jest-config": "^24.9.0",
+        "jest-haste-map": "^24.9.0",
+        "jest-message-util": "^24.9.0",
+        "jest-mock": "^24.9.0",
+        "jest-regex-util": "^24.3.0",
+        "jest-resolve": "^24.9.0",
+        "jest-snapshot": "^24.9.0",
+        "jest-util": "^24.9.0",
+        "jest-validate": "^24.9.0",
+        "realpath-native": "^1.1.0",
+        "slash": "^2.0.0",
+        "strip-bom": "^3.0.0",
+        "yargs": "^13.3.0"
+      },
+      "bin": {
+        "jest-runtime": "bin/jest-runtime.js"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-runtime/node_modules/cliui": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz",
+      "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==",
+      "dev": true,
+      "dependencies": {
+        "string-width": "^3.1.0",
+        "strip-ansi": "^5.2.0",
+        "wrap-ansi": "^5.1.0"
+      }
+    },
+    "node_modules/jest-runtime/node_modules/get-caller-file": {
+      "version": "2.0.5",
+      "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
+      "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
+      "dev": true,
+      "engines": {
+        "node": "6.* || 8.* || >= 10.*"
+      }
+    },
+    "node_modules/jest-runtime/node_modules/string-width": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
+      "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
+      "dev": true,
+      "dependencies": {
+        "emoji-regex": "^7.0.1",
+        "is-fullwidth-code-point": "^2.0.0",
+        "strip-ansi": "^5.1.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/jest-runtime/node_modules/strip-ansi": {
+      "version": "5.2.0",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+      "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
+      "dev": true,
+      "dependencies": {
+        "ansi-regex": "^4.1.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/jest-runtime/node_modules/which-module": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz",
+      "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==",
+      "dev": true
+    },
+    "node_modules/jest-runtime/node_modules/wrap-ansi": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz",
+      "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==",
+      "dev": true,
+      "dependencies": {
+        "ansi-styles": "^3.2.0",
+        "string-width": "^3.0.0",
+        "strip-ansi": "^5.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/jest-runtime/node_modules/y18n": {
+      "version": "4.0.3",
+      "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz",
+      "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==",
+      "dev": true
+    },
+    "node_modules/jest-runtime/node_modules/yargs": {
+      "version": "13.3.2",
+      "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz",
+      "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==",
+      "dev": true,
+      "dependencies": {
+        "cliui": "^5.0.0",
+        "find-up": "^3.0.0",
+        "get-caller-file": "^2.0.1",
+        "require-directory": "^2.1.1",
+        "require-main-filename": "^2.0.0",
+        "set-blocking": "^2.0.0",
+        "string-width": "^3.0.0",
+        "which-module": "^2.0.0",
+        "y18n": "^4.0.0",
+        "yargs-parser": "^13.1.2"
+      }
+    },
+    "node_modules/jest-runtime/node_modules/yargs-parser": {
+      "version": "13.1.2",
+      "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz",
+      "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==",
+      "dev": true,
+      "dependencies": {
+        "camelcase": "^5.0.0",
+        "decamelize": "^1.2.0"
+      }
+    },
+    "node_modules/jest-serializer": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-24.9.0.tgz",
+      "integrity": "sha512-DxYipDr8OvfrKH3Kel6NdED3OXxjvxXZ1uIY2I9OFbGg+vUkkg7AGvi65qbhbWNPvDckXmzMPbK3u3HaDO49bQ==",
+      "dev": true,
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-snapshot": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.9.0.tgz",
+      "integrity": "sha512-uI/rszGSs73xCM0l+up7O7a40o90cnrk429LOiK3aeTvfC0HHmldbd81/B7Ix81KSFe1lwkbl7GnBGG4UfuDew==",
+      "dev": true,
+      "dependencies": {
+        "@babel/types": "^7.0.0",
+        "@jest/types": "^24.9.0",
+        "chalk": "^2.0.1",
+        "expect": "^24.9.0",
+        "jest-diff": "^24.9.0",
+        "jest-get-type": "^24.9.0",
+        "jest-matcher-utils": "^24.9.0",
+        "jest-message-util": "^24.9.0",
+        "jest-resolve": "^24.9.0",
+        "mkdirp": "^0.5.1",
+        "natural-compare": "^1.4.0",
+        "pretty-format": "^24.9.0",
+        "semver": "^6.2.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-snapshot/node_modules/semver": {
+      "version": "6.3.1",
+      "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
+      "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==",
+      "dev": true,
+      "bin": {
+        "semver": "bin/semver.js"
+      }
+    },
+    "node_modules/jest-util": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.9.0.tgz",
+      "integrity": "sha512-x+cZU8VRmOJxbA1K5oDBdxQmdq0OIdADarLxk0Mq+3XS4jgvhG/oKGWcIDCtPG0HgjxOYvF+ilPJQsAyXfbNOg==",
+      "dev": true,
+      "dependencies": {
+        "@jest/console": "^24.9.0",
+        "@jest/fake-timers": "^24.9.0",
+        "@jest/source-map": "^24.9.0",
+        "@jest/test-result": "^24.9.0",
+        "@jest/types": "^24.9.0",
+        "callsites": "^3.0.0",
+        "chalk": "^2.0.1",
+        "graceful-fs": "^4.1.15",
+        "is-ci": "^2.0.0",
+        "mkdirp": "^0.5.1",
+        "slash": "^2.0.0",
+        "source-map": "^0.6.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-util/node_modules/source-map": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/jest-validate": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.9.0.tgz",
+      "integrity": "sha512-HPIt6C5ACwiqSiwi+OfSSHbK8sG7akG8eATl+IPKaeIjtPOeBUd/g3J7DghugzxrGjI93qS/+RPKe1H6PqvhRQ==",
+      "dev": true,
+      "dependencies": {
+        "@jest/types": "^24.9.0",
+        "camelcase": "^5.3.1",
+        "chalk": "^2.0.1",
+        "jest-get-type": "^24.9.0",
+        "leven": "^3.1.0",
+        "pretty-format": "^24.9.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-watcher": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.9.0.tgz",
+      "integrity": "sha512-+/fLOfKPXXYJDYlks62/4R4GoT+GU1tYZed99JSCOsmzkkF7727RqKrjNAxtfO4YpGv11wybgRvCjR73lK2GZw==",
+      "dev": true,
+      "dependencies": {
+        "@jest/test-result": "^24.9.0",
+        "@jest/types": "^24.9.0",
+        "@types/yargs": "^13.0.0",
+        "ansi-escapes": "^3.0.0",
+        "chalk": "^2.0.1",
+        "jest-util": "^24.9.0",
+        "string-length": "^2.0.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-worker": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.9.0.tgz",
+      "integrity": "sha512-51PE4haMSXcHohnSMdM42anbvZANYTqMrr52tVKPqqsPJMzoP6FYYDVqahX/HrAoKEKz3uUPzSvKs9A3qR4iVw==",
+      "dev": true,
+      "dependencies": {
+        "merge-stream": "^2.0.0",
+        "supports-color": "^6.1.0"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/jest-worker/node_modules/supports-color": {
+      "version": "6.1.0",
+      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz",
+      "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==",
+      "dev": true,
+      "dependencies": {
+        "has-flag": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/js-tokens": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
+      "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==",
+      "dev": true
+    },
+    "node_modules/js-yaml": {
+      "version": "3.14.1",
+      "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz",
+      "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
+      "dev": true,
+      "dependencies": {
+        "argparse": "^1.0.7",
+        "esprima": "^4.0.0"
+      },
+      "bin": {
+        "js-yaml": "bin/js-yaml.js"
+      }
+    },
+    "node_modules/jsbn": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz",
+      "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==",
+      "dev": true
+    },
+    "node_modules/jsdom": {
+      "version": "11.12.0",
+      "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-11.12.0.tgz",
+      "integrity": "sha512-y8Px43oyiBM13Zc1z780FrfNLJCXTL40EWlty/LXUtcjykRBNgLlCjWXpfSPBl2iv+N7koQN+dvqszHZgT/Fjw==",
+      "dev": true,
+      "dependencies": {
+        "abab": "^2.0.0",
+        "acorn": "^5.5.3",
+        "acorn-globals": "^4.1.0",
+        "array-equal": "^1.0.0",
+        "cssom": ">= 0.3.2 < 0.4.0",
+        "cssstyle": "^1.0.0",
+        "data-urls": "^1.0.0",
+        "domexception": "^1.0.1",
+        "escodegen": "^1.9.1",
+        "html-encoding-sniffer": "^1.0.2",
+        "left-pad": "^1.3.0",
+        "nwsapi": "^2.0.7",
+        "parse5": "4.0.0",
+        "pn": "^1.1.0",
+        "request": "^2.87.0",
+        "request-promise-native": "^1.0.5",
+        "sax": "^1.2.4",
+        "symbol-tree": "^3.2.2",
+        "tough-cookie": "^2.3.4",
+        "w3c-hr-time": "^1.0.1",
+        "webidl-conversions": "^4.0.2",
+        "whatwg-encoding": "^1.0.3",
+        "whatwg-mimetype": "^2.1.0",
+        "whatwg-url": "^6.4.1",
+        "ws": "^5.2.0",
+        "xml-name-validator": "^3.0.0"
+      }
+    },
+    "node_modules/jsdom/node_modules/acorn": {
+      "version": "5.7.4",
+      "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz",
+      "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==",
+      "dev": true,
+      "bin": {
+        "acorn": "bin/acorn"
+      },
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
+    "node_modules/jsesc": {
+      "version": "2.5.2",
+      "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz",
+      "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==",
+      "dev": true,
+      "bin": {
+        "jsesc": "bin/jsesc"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/json-parse-better-errors": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz",
+      "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==",
+      "dev": true
+    },
+    "node_modules/json-schema": {
+      "version": "0.4.0",
+      "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz",
+      "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==",
+      "dev": true
+    },
+    "node_modules/json-schema-traverse": {
+      "version": "0.4.1",
+      "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
+      "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg=="
+    },
+    "node_modules/json-stable-stringify": {
+      "version": "0.0.1",
+      "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-0.0.1.tgz",
+      "integrity": "sha512-nKtD/Qxm7tWdZqJoldEC7fF0S41v0mWbeaXG3637stOWfyGxTgWTYE2wtfKmjzpvxv2MA2xzxsXOIiwUpkX6Qw==",
+      "dev": true,
+      "dependencies": {
+        "jsonify": "~0.0.0"
+      }
+    },
+    "node_modules/json-stable-stringify-without-jsonify": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
+      "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
+      "dev": true
+    },
+    "node_modules/json-stringify-safe": {
+      "version": "5.0.1",
+      "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
+      "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==",
+      "dev": true
+    },
+    "node_modules/json5": {
+      "version": "0.5.1",
+      "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz",
+      "integrity": "sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==",
+      "bin": {
+        "json5": "lib/cli.js"
+      }
+    },
+    "node_modules/jsonfile": {
+      "version": "2.4.0",
+      "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-2.4.0.tgz",
+      "integrity": "sha512-PKllAqbgLgxHaj8TElYymKCAgrASebJrWpTnEkOaTowt23VKXXN0sUeriJ+eh7y6ufb/CC5ap11pz71/cM0hUw==",
+      "optionalDependencies": {
+        "graceful-fs": "^4.1.6"
+      }
+    },
+    "node_modules/jsonify": {
+      "version": "0.0.1",
+      "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.1.tgz",
+      "integrity": "sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==",
+      "dev": true,
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/jsonparse": {
+      "version": "1.3.1",
+      "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz",
+      "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==",
+      "dev": true,
+      "engines": [
+        "node >= 0.2.0"
+      ]
+    },
+    "node_modules/JSONStream": {
+      "version": "1.3.5",
+      "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz",
+      "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==",
+      "dev": true,
+      "dependencies": {
+        "jsonparse": "^1.2.0",
+        "through": ">=2.2.7 <3"
+      },
+      "bin": {
+        "JSONStream": "bin.js"
+      },
+      "engines": {
+        "node": "*"
+      }
+    },
+    "node_modules/jsprim": {
+      "version": "1.4.2",
+      "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz",
+      "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==",
+      "dev": true,
+      "dependencies": {
+        "assert-plus": "1.0.0",
+        "extsprintf": "1.3.0",
+        "json-schema": "0.4.0",
+        "verror": "1.10.0"
+      },
+      "engines": {
+        "node": ">=0.6.0"
+      }
+    },
+    "node_modules/kind-of": {
+      "version": "6.0.3",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz",
+      "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/klaw": {
+      "version": "1.3.1",
+      "resolved": "https://registry.npmjs.org/klaw/-/klaw-1.3.1.tgz",
+      "integrity": "sha512-TED5xi9gGQjGpNnvRWknrwAB1eL5GciPfVFOt3Vk1OJCVDQbzuSfrF3hkUQKlsgKrG1F+0t5W0m+Fje1jIt8rw==",
+      "optionalDependencies": {
+        "graceful-fs": "^4.1.9"
+      }
+    },
+    "node_modules/kleur": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz",
+      "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==",
+      "dev": true,
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/labeled-stream-splicer": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/labeled-stream-splicer/-/labeled-stream-splicer-2.0.2.tgz",
+      "integrity": "sha512-Ca4LSXFFZUjPScRaqOcFxneA0VpKZr4MMYCljyQr4LIewTLb3Y0IUTIsnBBsVubIeEfxeSZpSjSsRM8APEQaAw==",
+      "dev": true,
+      "dependencies": {
+        "inherits": "^2.0.1",
+        "stream-splicer": "^2.0.0"
+      }
+    },
+    "node_modules/lcid": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz",
+      "integrity": "sha512-YiGkH6EnGrDGqLMITnGjXtGmNtjoXw9SVUzcaos8RBi7Ps0VBylkq+vOcY9QE5poLasPCR849ucFUkl0UzUyOw==",
+      "dependencies": {
+        "invert-kv": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/left-pad": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmjs.org/left-pad/-/left-pad-1.3.0.tgz",
+      "integrity": "sha512-XI5MPzVNApjAyhQzphX8BkmKsKUxD4LdyK24iZeQGinBN9yTQT3bFlCBy/aVx2HrNcqQGsdot8ghrjyrvMCoEA==",
+      "deprecated": "use String.prototype.padStart()",
+      "dev": true
+    },
+    "node_modules/leven": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz",
+      "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==",
+      "dev": true,
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/levn": {
+      "version": "0.3.0",
+      "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
+      "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==",
+      "dev": true,
+      "dependencies": {
+        "prelude-ls": "~1.1.2",
+        "type-check": "~0.3.2"
+      },
+      "engines": {
+        "node": ">= 0.8.0"
+      }
+    },
+    "node_modules/load-json-file": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz",
+      "integrity": "sha512-Kx8hMakjX03tiGTLAIdJ+lL0htKnXjEZN6hk/tozf/WOuYGdZBJrZ+rCJRbVCugsjB3jMLn9746NsQIf5VjBMw==",
+      "dev": true,
+      "dependencies": {
+        "graceful-fs": "^4.1.2",
+        "parse-json": "^4.0.0",
+        "pify": "^3.0.0",
+        "strip-bom": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/load-json-file/node_modules/pify": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+      "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/locate-path": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz",
+      "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==",
+      "dev": true,
+      "dependencies": {
+        "p-locate": "^3.0.0",
+        "path-exists": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/lodash": {
+      "version": "4.17.21",
+      "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
+      "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
+    },
+    "node_modules/lodash.memoize": {
+      "version": "3.0.4",
+      "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-3.0.4.tgz",
+      "integrity": "sha512-eDn9kqrAmVUC1wmZvlQ6Uhde44n+tXpqPrN8olQJbttgh0oKclk+SF54P47VEGE9CEiMeRwAP8BaM7UHvBkz2A==",
+      "dev": true
+    },
+    "node_modules/lodash.sortby": {
+      "version": "4.7.0",
+      "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz",
+      "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==",
+      "dev": true
+    },
+    "node_modules/loose-envify": {
+      "version": "1.4.0",
+      "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
+      "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
+      "dev": true,
+      "dependencies": {
+        "js-tokens": "^3.0.0 || ^4.0.0"
+      },
+      "bin": {
+        "loose-envify": "cli.js"
+      }
+    },
+    "node_modules/lru-cache": {
+      "version": "5.1.1",
+      "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz",
+      "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==",
+      "dev": true,
+      "dependencies": {
+        "yallist": "^3.0.2"
+      }
+    },
+    "node_modules/magic-string": {
+      "version": "0.25.1",
+      "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.1.tgz",
+      "integrity": "sha512-sCuTz6pYom8Rlt4ISPFn6wuFodbKMIHUMv4Qko9P17dpxb7s52KJTmRuZZqHdGmLCK9AOcDare039nRIcfdkEg==",
+      "dev": true,
+      "dependencies": {
+        "sourcemap-codec": "^1.4.1"
+      }
+    },
+    "node_modules/make-dir": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
+      "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==",
+      "dev": true,
+      "dependencies": {
+        "pify": "^4.0.1",
+        "semver": "^5.6.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/make-error": {
+      "version": "1.3.6",
+      "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz",
+      "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==",
+      "dev": true
+    },
+    "node_modules/makeerror": {
+      "version": "1.0.12",
+      "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.12.tgz",
+      "integrity": "sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg==",
+      "dev": true,
+      "dependencies": {
+        "tmpl": "1.0.5"
+      }
+    },
+    "node_modules/map-cache": {
+      "version": "0.2.2",
+      "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
+      "integrity": "sha512-8y/eV9QQZCiyn1SprXSrCmqJN0yNRATe+PO8ztwqrvrbdRLA3eYJF0yaR0YayLWkMbsQSKWS9N2gPcGEc4UsZg==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/map-obj": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz",
+      "integrity": "sha512-7N/q3lyZ+LVCp7PzuxrJr4KMbBE2hW7BT7YNia330OFxIf4d3r5zVpicP2650l7CPN6RM9zOJRl3NGpqSiw3Eg==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/map-visit": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz",
+      "integrity": "sha512-4y7uGv8bd2WdM9vpQsiQNo41Ln1NvhvDRuVt0k2JZQ+ezN2uaQes7lZeZ+QQUHOLQAtDaBJ+7wCbi+ab/KFs+w==",
+      "dev": true,
+      "dependencies": {
+        "object-visit": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/md5.js": {
+      "version": "1.3.5",
+      "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz",
+      "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==",
+      "dev": true,
+      "dependencies": {
+        "hash-base": "^3.0.0",
+        "inherits": "^2.0.1",
+        "safe-buffer": "^5.1.2"
+      }
+    },
+    "node_modules/merge-source-map": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.0.4.tgz",
+      "integrity": "sha512-PGSmS0kfnTnMJCzJ16BLLCEe6oeYCamKFFdQKshi4BmM6FUwipjVOcBFGxqtQtirtAG4iZvHlqST9CpZKqlRjA==",
+      "dev": true,
+      "dependencies": {
+        "source-map": "^0.5.6"
+      }
+    },
+    "node_modules/merge-stream": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz",
+      "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==",
+      "dev": true
+    },
+    "node_modules/methods": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
+      "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/micromatch": {
+      "version": "3.1.10",
+      "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz",
+      "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==",
+      "dev": true,
+      "dependencies": {
+        "arr-diff": "^4.0.0",
+        "array-unique": "^0.3.2",
+        "braces": "^2.3.1",
+        "define-property": "^2.0.2",
+        "extend-shallow": "^3.0.2",
+        "extglob": "^2.0.4",
+        "fragment-cache": "^0.2.1",
+        "kind-of": "^6.0.2",
+        "nanomatch": "^1.2.9",
+        "object.pick": "^1.3.0",
+        "regex-not": "^1.0.0",
+        "snapdragon": "^0.8.1",
+        "to-regex": "^3.0.2"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/miller-rabin": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz",
+      "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==",
+      "dev": true,
+      "dependencies": {
+        "bn.js": "^4.0.0",
+        "brorand": "^1.0.1"
+      },
+      "bin": {
+        "miller-rabin": "bin/miller-rabin"
+      }
+    },
+    "node_modules/miller-rabin/node_modules/bn.js": {
+      "version": "4.12.0",
+      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
+      "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
+      "dev": true
+    },
+    "node_modules/mime": {
+      "version": "1.6.0",
+      "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",
+      "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==",
+      "dev": true,
+      "bin": {
+        "mime": "cli.js"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/mime-db": {
+      "version": "1.52.0",
+      "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
+      "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/mime-types": {
+      "version": "2.1.35",
+      "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
+      "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
+      "dev": true,
+      "dependencies": {
+        "mime-db": "1.52.0"
+      },
+      "engines": {
+        "node": ">= 0.6"
+      }
+    },
+    "node_modules/mimic-fn": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
+      "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/minimalistic-assert": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz",
+      "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==",
+      "dev": true
+    },
+    "node_modules/minimalistic-crypto-utils": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz",
+      "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==",
+      "dev": true
+    },
+    "node_modules/minimatch": {
+      "version": "3.1.2",
+      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
+      "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
+      "dev": true,
+      "dependencies": {
+        "brace-expansion": "^1.1.7"
+      },
+      "engines": {
+        "node": "*"
+      }
+    },
+    "node_modules/minimist": {
+      "version": "1.2.8",
+      "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
+      "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
+      "dev": true,
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/mixin-deep": {
+      "version": "1.3.2",
+      "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
+      "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==",
+      "dev": true,
+      "dependencies": {
+        "for-in": "^1.0.2",
+        "is-extendable": "^1.0.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/mkdirp": {
+      "version": "0.5.6",
+      "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz",
+      "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==",
+      "dev": true,
+      "dependencies": {
+        "minimist": "^1.2.6"
+      },
+      "bin": {
+        "mkdirp": "bin/cmd.js"
+      }
+    },
+    "node_modules/mkdirp-classic": {
+      "version": "0.5.3",
+      "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz",
+      "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==",
+      "dev": true
+    },
+    "node_modules/module-deps": {
+      "version": "6.2.3",
+      "resolved": "https://registry.npmjs.org/module-deps/-/module-deps-6.2.3.tgz",
+      "integrity": "sha512-fg7OZaQBcL4/L+AK5f4iVqf9OMbCclXfy/znXRxTVhJSeW5AIlS9AwheYwDaXM3lVW7OBeaeUEY3gbaC6cLlSA==",
+      "dev": true,
+      "dependencies": {
+        "browser-resolve": "^2.0.0",
+        "cached-path-relative": "^1.0.2",
+        "concat-stream": "~1.6.0",
+        "defined": "^1.0.0",
+        "detective": "^5.2.0",
+        "duplexer2": "^0.1.2",
+        "inherits": "^2.0.1",
+        "JSONStream": "^1.0.3",
+        "parents": "^1.0.0",
+        "readable-stream": "^2.0.2",
+        "resolve": "^1.4.0",
+        "stream-combiner2": "^1.1.1",
+        "subarg": "^1.0.0",
+        "through2": "^2.0.0",
+        "xtend": "^4.0.0"
+      },
+      "bin": {
+        "module-deps": "bin/cmd.js"
+      },
+      "engines": {
+        "node": ">= 0.8.0"
+      }
+    },
+    "node_modules/mothership": {
+      "version": "0.3.0",
+      "resolved": "https://registry.npmjs.org/mothership/-/mothership-0.3.0.tgz",
+      "integrity": "sha512-/ORGXVhkG5Qal0ZD3BnxG/JtMcCJKOn7FkbbTA8N9HwJyXGsBYq9EXH7WbsRCpGUwmwrpQqN6ENLUL+ebmNTCQ==",
+      "dev": true,
+      "dependencies": {
+        "find-parent-dir": "~0.3.0"
+      }
+    },
+    "node_modules/ms": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
+      "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==",
+      "dev": true
+    },
+    "node_modules/mute-stream": {
+      "version": "0.0.7",
+      "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
+      "integrity": "sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ==",
+      "dev": true
+    },
+    "node_modules/nan": {
+      "version": "2.17.0",
+      "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz",
+      "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==",
+      "dev": true,
+      "optional": true
+    },
+    "node_modules/nanomatch": {
+      "version": "1.2.13",
+      "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz",
+      "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==",
+      "dev": true,
+      "dependencies": {
+        "arr-diff": "^4.0.0",
+        "array-unique": "^0.3.2",
+        "define-property": "^2.0.2",
+        "extend-shallow": "^3.0.2",
+        "fragment-cache": "^0.2.1",
+        "is-windows": "^1.0.2",
+        "kind-of": "^6.0.2",
+        "object.pick": "^1.3.0",
+        "regex-not": "^1.0.0",
+        "snapdragon": "^0.8.1",
+        "to-regex": "^3.0.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/natural-compare": {
+      "version": "1.4.0",
+      "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
+      "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
+      "dev": true
+    },
+    "node_modules/next-tick": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz",
+      "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==",
+      "dev": true
+    },
+    "node_modules/nice-try": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz",
+      "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
+      "dev": true
+    },
+    "node_modules/node-int64": {
+      "version": "0.4.0",
+      "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz",
+      "integrity": "sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw==",
+      "dev": true
+    },
+    "node_modules/node-notifier": {
+      "version": "5.4.5",
+      "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-5.4.5.tgz",
+      "integrity": "sha512-tVbHs7DyTLtzOiN78izLA85zRqB9NvEXkAf014Vx3jtSvn/xBl6bR8ZYifj+dFcFrKI21huSQgJZ6ZtL3B4HfQ==",
+      "dev": true,
+      "dependencies": {
+        "growly": "^1.3.0",
+        "is-wsl": "^1.1.0",
+        "semver": "^5.5.0",
+        "shellwords": "^0.1.1",
+        "which": "^1.3.0"
+      }
+    },
+    "node_modules/node-releases": {
+      "version": "2.0.13",
+      "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz",
+      "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==",
+      "dev": true
+    },
+    "node_modules/normalize-package-data": {
+      "version": "2.5.0",
+      "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz",
+      "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==",
+      "dependencies": {
+        "hosted-git-info": "^2.1.4",
+        "resolve": "^1.10.0",
+        "semver": "2 || 3 || 4 || 5",
+        "validate-npm-package-license": "^3.0.1"
+      }
+    },
+    "node_modules/normalize-path": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz",
+      "integrity": "sha512-3pKJwH184Xo/lnH6oyP1q2pMd7HcypqqmRs91/6/i2CGtWwIKGCkOOMTm/zXbgTEWHw1uNpNi/igc3ePOYHb6w==",
+      "dev": true,
+      "dependencies": {
+        "remove-trailing-separator": "^1.0.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/npm-run-path": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz",
+      "integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==",
+      "dev": true,
+      "dependencies": {
+        "path-key": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/number-is-nan": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
+      "integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/nwsapi": {
+      "version": "2.2.7",
+      "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz",
+      "integrity": "sha512-ub5E4+FBPKwAZx0UwIQOjYWGHTEq5sPqHQNRN8Z9e4A7u3Tj1weLJsL59yH9vmvqEtBHaOmT6cYQKIZOxp35FQ==",
+      "dev": true
+    },
+    "node_modules/oauth-sign": {
+      "version": "0.9.0",
+      "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz",
+      "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==",
+      "dev": true,
+      "engines": {
+        "node": "*"
+      }
+    },
+    "node_modules/object-assign": {
+      "version": "4.1.1",
+      "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
+      "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/object-copy": {
+      "version": "0.1.0",
+      "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz",
+      "integrity": "sha512-79LYn6VAb63zgtmAteVOWo9Vdj71ZVBy3Pbse+VqxDpEP83XuujMrGqHIwAXJ5I/aM0zU7dIyIAhifVTPrNItQ==",
+      "dev": true,
+      "dependencies": {
+        "copy-descriptor": "^0.1.0",
+        "define-property": "^0.2.5",
+        "kind-of": "^3.0.3"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/object-copy/node_modules/define-property": {
+      "version": "0.2.5",
+      "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+      "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==",
+      "dev": true,
+      "dependencies": {
+        "is-descriptor": "^0.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/object-copy/node_modules/is-accessor-descriptor": {
+      "version": "0.1.6",
+      "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+      "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==",
+      "dev": true,
+      "dependencies": {
+        "kind-of": "^3.0.2"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/object-copy/node_modules/is-data-descriptor": {
+      "version": "0.1.4",
+      "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+      "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==",
+      "dev": true,
+      "dependencies": {
+        "kind-of": "^3.0.2"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/object-copy/node_modules/is-descriptor": {
+      "version": "0.1.6",
+      "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
+      "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
+      "dev": true,
+      "dependencies": {
+        "is-accessor-descriptor": "^0.1.6",
+        "is-data-descriptor": "^0.1.4",
+        "kind-of": "^5.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/object-copy/node_modules/is-descriptor/node_modules/kind-of": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
+      "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/object-copy/node_modules/kind-of": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+      "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+      "dev": true,
+      "dependencies": {
+        "is-buffer": "^1.1.5"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/object-inspect": {
+      "version": "1.12.3",
+      "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz",
+      "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==",
+      "dev": true,
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/object-keys": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
+      "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/object-visit": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz",
+      "integrity": "sha512-GBaMwwAVK9qbQN3Scdo0OyvgPW7l3lnaVMj84uTOZlswkX0KpF6fyDBJhtTthf7pymztoN36/KEr1DyhF96zEA==",
+      "dev": true,
+      "dependencies": {
+        "isobject": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/object.assign": {
+      "version": "4.1.4",
+      "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz",
+      "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "define-properties": "^1.1.4",
+        "has-symbols": "^1.0.3",
+        "object-keys": "^1.1.1"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/object.getownpropertydescriptors": {
+      "version": "2.1.6",
+      "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.6.tgz",
+      "integrity": "sha512-lq+61g26E/BgHv0ZTFgRvi7NMEPuAxLkFU7rukXjc/AlwH4Am5xXVnIXy3un1bg/JPbXHrixRkK1itUzzPiIjQ==",
+      "dev": true,
+      "dependencies": {
+        "array.prototype.reduce": "^1.0.5",
+        "call-bind": "^1.0.2",
+        "define-properties": "^1.2.0",
+        "es-abstract": "^1.21.2",
+        "safe-array-concat": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.8"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/object.pick": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz",
+      "integrity": "sha512-tqa/UMy/CCoYmj+H5qc07qvSL9dqcs/WZENZ1JbtWBlATP+iVOe778gE6MSijnyCnORzDuX6hU+LA4SZ09YjFQ==",
+      "dev": true,
+      "dependencies": {
+        "isobject": "^3.0.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/once": {
+      "version": "1.4.0",
+      "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
+      "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==",
+      "dev": true,
+      "dependencies": {
+        "wrappy": "1"
+      }
+    },
+    "node_modules/onetime": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
+      "integrity": "sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ==",
+      "dev": true,
+      "dependencies": {
+        "mimic-fn": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/onml": {
+      "version": "0.3.1",
+      "resolved": "https://registry.npmjs.org/onml/-/onml-0.3.1.tgz",
+      "integrity": "sha512-+OhJ42QBJnjCUPtt7NabMtC+e9F+/NqDHsj9DT/uZj3nw91Dwbj11/VIIZl1/l8bLmM8wPAF3NN8KHnogA4iOA==",
+      "dependencies": {
+        "sax": "^1.1.4"
+      }
+    },
+    "node_modules/optionator": {
+      "version": "0.8.3",
+      "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
+      "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
+      "dev": true,
+      "dependencies": {
+        "deep-is": "~0.1.3",
+        "fast-levenshtein": "~2.0.6",
+        "levn": "~0.3.0",
+        "prelude-ls": "~1.1.2",
+        "type-check": "~0.3.2",
+        "word-wrap": "~1.2.3"
+      },
+      "engines": {
+        "node": ">= 0.8.0"
+      }
+    },
+    "node_modules/os-browserify": {
+      "version": "0.3.0",
+      "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz",
+      "integrity": "sha512-gjcpUc3clBf9+210TRaDWbf+rZZZEshZ+DlXMRCeAjp0xhTrnQsKHypIy1J3d5hKdUzj69t708EHtU8P6bUn0A==",
+      "dev": true
+    },
+    "node_modules/os-locale": {
+      "version": "1.4.0",
+      "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz",
+      "integrity": "sha512-PRT7ZORmwu2MEFt4/fv3Q+mEfN4zetKxufQrkShY2oGvUms9r8otu5HfdyIFHkYXjO7laNsoVGmM2MANfuTA8g==",
+      "dependencies": {
+        "lcid": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/os-tmpdir": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz",
+      "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/p-each-series": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-1.0.0.tgz",
+      "integrity": "sha512-J/e9xiZZQNrt+958FFzJ+auItsBGq+UrQ7nE89AUP7UOTtjHnkISANXLdayhVzh538UnLMCSlf13lFfRIAKQOA==",
+      "dev": true,
+      "dependencies": {
+        "p-reduce": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/p-finally": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz",
+      "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/p-limit": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
+      "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
+      "dev": true,
+      "dependencies": {
+        "p-try": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/p-locate": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz",
+      "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==",
+      "dev": true,
+      "dependencies": {
+        "p-limit": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/p-reduce": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/p-reduce/-/p-reduce-1.0.0.tgz",
+      "integrity": "sha512-3Tx1T3oM1xO/Y8Gj0sWyE78EIJZ+t+aEmXUdvQgvGmSMri7aPTHoovbXEreWKkL5j21Er60XAWLTzKbAKYOujQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/p-try": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
+      "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/pako": {
+      "version": "1.0.11",
+      "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz",
+      "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==",
+      "dev": true
+    },
+    "node_modules/parent-module": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz",
+      "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==",
+      "dev": true,
+      "dependencies": {
+        "callsites": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/parents": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz",
+      "integrity": "sha512-mXKF3xkoUt5td2DoxpLmtOmZvko9VfFpwRwkKDHSNvgmpLAeBo18YDhcPbBzJq+QLCHMbGOfzia2cX4U+0v9Mg==",
+      "dev": true,
+      "dependencies": {
+        "path-platform": "~0.11.15"
+      }
+    },
+    "node_modules/parse-asn1": {
+      "version": "5.1.6",
+      "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.6.tgz",
+      "integrity": "sha512-RnZRo1EPU6JBnra2vGHj0yhp6ebyjBZpmUCLHWiFhxlzvBCCpAuZ7elsBp1PVAbQN0/04VD/19rfzlBSwLstMw==",
+      "dev": true,
+      "dependencies": {
+        "asn1.js": "^5.2.0",
+        "browserify-aes": "^1.0.0",
+        "evp_bytestokey": "^1.0.0",
+        "pbkdf2": "^3.0.3",
+        "safe-buffer": "^5.1.1"
+      }
+    },
+    "node_modules/parse-json": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz",
+      "integrity": "sha512-aOIos8bujGN93/8Ox/jPLh7RwVnPEysynVFE+fQZyg6jKELEHwzgKdLRFHUgXJL6kylijVSBC4BvN9OmsB48Rw==",
+      "dev": true,
+      "dependencies": {
+        "error-ex": "^1.3.1",
+        "json-parse-better-errors": "^1.0.1"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/parse5": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/parse5/-/parse5-4.0.0.tgz",
+      "integrity": "sha512-VrZ7eOd3T1Fk4XWNXMgiGBK/z0MG48BWG2uQNU4I72fkQuKUTZpl+u9k+CxEG0twMVzSmXEEz12z5Fnw1jIQFA==",
+      "dev": true
+    },
+    "node_modules/pascalcase": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz",
+      "integrity": "sha512-XHXfu/yOQRy9vYOtUDVMN60OEJjW013GoObG1o+xwQTpB9eYJX/BjXMsdW13ZDPruFhYYn0AG22w0xgQMwl3Nw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/patch-text": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/patch-text/-/patch-text-1.0.2.tgz",
+      "integrity": "sha512-r1P+pfiTgWrsMOk/aW64RGv0oLjdyP0LeaLv2dF+iUfaVLqicXRi2dkjGYDgQ/kHVYm4z4GEHnx36Q6uqiFNlA==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/path-browserify": {
+      "version": "0.0.1",
+      "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz",
+      "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==",
+      "dev": true
+    },
+    "node_modules/path-exists": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
+      "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/path-is-absolute": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
+      "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/path-is-inside": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz",
+      "integrity": "sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==",
+      "dev": true
+    },
+    "node_modules/path-key": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz",
+      "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/path-parse": {
+      "version": "1.0.7",
+      "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz",
+      "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw=="
+    },
+    "node_modules/path-platform": {
+      "version": "0.11.15",
+      "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz",
+      "integrity": "sha512-Y30dB6rab1A/nfEKsZxmr01nUotHX0c/ZiIAsCTatEe1CmS5Pm5He7fZ195bPT7RdquoaL8lLxFCMQi/bS7IJg==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.8.0"
+      }
+    },
+    "node_modules/path-type": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz",
+      "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==",
+      "dev": true,
+      "dependencies": {
+        "pify": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/path-type/node_modules/pify": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz",
+      "integrity": "sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/pbkdf2": {
+      "version": "3.1.2",
+      "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz",
+      "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==",
+      "dev": true,
+      "dependencies": {
+        "create-hash": "^1.1.2",
+        "create-hmac": "^1.1.4",
+        "ripemd160": "^2.0.1",
+        "safe-buffer": "^5.0.1",
+        "sha.js": "^2.4.8"
+      },
+      "engines": {
+        "node": ">=0.12"
+      }
+    },
+    "node_modules/performance-now": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz",
+      "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==",
+      "dev": true
+    },
+    "node_modules/picocolors": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz",
+      "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==",
+      "dev": true
+    },
+    "node_modules/pify": {
+      "version": "4.0.1",
+      "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz",
+      "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==",
+      "dev": true,
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/pinkie": {
+      "version": "2.0.4",
+      "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
+      "integrity": "sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/pinkie-promise": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz",
+      "integrity": "sha512-0Gni6D4UcLTbv9c57DfxDGdr41XfgUjqWZu492f0cIGr16zDU06BWP/RAEvOuo7CQ0CNjHaLlM59YJJFm3NWlw==",
+      "dependencies": {
+        "pinkie": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/pirates": {
+      "version": "4.0.6",
+      "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.6.tgz",
+      "integrity": "sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg==",
+      "dev": true,
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/pkg-dir": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz",
+      "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==",
+      "dev": true,
+      "dependencies": {
+        "find-up": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/pn": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/pn/-/pn-1.1.0.tgz",
+      "integrity": "sha512-2qHaIQr2VLRFoxe2nASzsV6ef4yOOH+Fi9FBOVH6cqeSgUnoyySPZkxzLuzd+RYOQTRpROA0ztTMqxROKSb/nA==",
+      "dev": true
+    },
+    "node_modules/posix-character-classes": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz",
+      "integrity": "sha512-xTgYBc3fuo7Yt7JbiuFxSYGToMoz8fLoE6TC9Wx1P/u+LfeThMOAqmuyECnlBaaJb+u1m9hHiXUEtwW4OzfUJg==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/prelude-ls": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
+      "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.8.0"
+      }
+    },
+    "node_modules/pretty-format": {
+      "version": "24.9.0",
+      "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.9.0.tgz",
+      "integrity": "sha512-00ZMZUiHaJrNfk33guavqgvfJS30sLYf0f8+Srklv0AMPodGGHcoHgksZ3OThYnIvOd+8yMCn0YiEOogjlgsnA==",
+      "dev": true,
+      "dependencies": {
+        "@jest/types": "^24.9.0",
+        "ansi-regex": "^4.0.0",
+        "ansi-styles": "^3.2.0",
+        "react-is": "^16.8.4"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/process": {
+      "version": "0.11.10",
+      "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz",
+      "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==",
+      "dev": true,
+      "engines": {
+        "node": ">= 0.6.0"
+      }
+    },
+    "node_modules/process-nextick-args": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz",
+      "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==",
+      "dev": true
+    },
+    "node_modules/progress": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
+      "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
+    "node_modules/prompts": {
+      "version": "2.4.2",
+      "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz",
+      "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==",
+      "dev": true,
+      "dependencies": {
+        "kleur": "^3.0.3",
+        "sisteransi": "^1.0.5"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/psl": {
+      "version": "1.9.0",
+      "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz",
+      "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==",
+      "dev": true
+    },
+    "node_modules/public-encrypt": {
+      "version": "4.0.3",
+      "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.3.tgz",
+      "integrity": "sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==",
+      "dev": true,
+      "dependencies": {
+        "bn.js": "^4.1.0",
+        "browserify-rsa": "^4.0.0",
+        "create-hash": "^1.1.0",
+        "parse-asn1": "^5.0.0",
+        "randombytes": "^2.0.1",
+        "safe-buffer": "^5.1.2"
+      }
+    },
+    "node_modules/public-encrypt/node_modules/bn.js": {
+      "version": "4.12.0",
+      "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
+      "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==",
+      "dev": true
+    },
+    "node_modules/pump": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz",
+      "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
+      "dev": true,
+      "dependencies": {
+        "end-of-stream": "^1.1.0",
+        "once": "^1.3.1"
+      }
+    },
+    "node_modules/punycode": {
+      "version": "1.4.1",
+      "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz",
+      "integrity": "sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==",
+      "dev": true
+    },
+    "node_modules/qs": {
+      "version": "6.5.3",
+      "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz",
+      "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.6"
+      }
+    },
+    "node_modules/querystring-es3": {
+      "version": "0.2.1",
+      "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz",
+      "integrity": "sha512-773xhDQnZBMFobEiztv8LIl70ch5MSF/jUQVlhwFyBILqq96anmoctVIYz+ZRp0qbCKATTn6ev02M3r7Ga5vqA==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.4.x"
+      }
+    },
+    "node_modules/quote-stream": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/quote-stream/-/quote-stream-1.0.2.tgz",
+      "integrity": "sha512-kKr2uQ2AokadPjvTyKJQad9xELbZwYzWlNfI3Uz2j/ib5u6H9lDP7fUUR//rMycd0gv4Z5P1qXMfXR8YpIxrjQ==",
+      "dev": true,
+      "dependencies": {
+        "buffer-equal": "0.0.1",
+        "minimist": "^1.1.3",
+        "through2": "^2.0.0"
+      },
+      "bin": {
+        "quote-stream": "bin/cmd.js"
+      }
+    },
+    "node_modules/randombytes": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
+      "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
+      "dev": true,
+      "dependencies": {
+        "safe-buffer": "^5.1.0"
+      }
+    },
+    "node_modules/randomfill": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz",
+      "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==",
+      "dev": true,
+      "dependencies": {
+        "randombytes": "^2.0.5",
+        "safe-buffer": "^5.1.0"
+      }
+    },
+    "node_modules/react-is": {
+      "version": "16.13.1",
+      "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz",
+      "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==",
+      "dev": true
+    },
+    "node_modules/read-only-stream": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/read-only-stream/-/read-only-stream-2.0.0.tgz",
+      "integrity": "sha512-3ALe0bjBVZtkdWKIcThYpQCLbBMd/+Tbh2CDSrAIDO3UsZ4Xs+tnyjv2MjCOMMgBG+AsUOeuP1cgtY1INISc8w==",
+      "dev": true,
+      "dependencies": {
+        "readable-stream": "^2.0.2"
+      }
+    },
+    "node_modules/read-pkg": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
+      "integrity": "sha512-BLq/cCO9two+lBgiTYNqD6GdtK8s4NpaWrl6/rCO9w0TUS8oJl7cmToOZfRYllKTISY6nt1U7jQ53brmKqY6BA==",
+      "dev": true,
+      "dependencies": {
+        "load-json-file": "^4.0.0",
+        "normalize-package-data": "^2.3.2",
+        "path-type": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/read-pkg-up": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz",
+      "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==",
+      "dev": true,
+      "dependencies": {
+        "find-up": "^3.0.0",
+        "read-pkg": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/readable-stream": {
+      "version": "2.3.8",
+      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz",
+      "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==",
+      "dev": true,
+      "dependencies": {
+        "core-util-is": "~1.0.0",
+        "inherits": "~2.0.3",
+        "isarray": "~1.0.0",
+        "process-nextick-args": "~2.0.0",
+        "safe-buffer": "~5.1.1",
+        "string_decoder": "~1.1.1",
+        "util-deprecate": "~1.0.1"
+      }
+    },
+    "node_modules/readable-stream/node_modules/safe-buffer": {
+      "version": "5.1.2",
+      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
+      "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
+      "dev": true
+    },
+    "node_modules/readable-stream/node_modules/string_decoder": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
+      "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
+      "dev": true,
+      "dependencies": {
+        "safe-buffer": "~5.1.0"
+      }
+    },
+    "node_modules/realpath-native": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.1.0.tgz",
+      "integrity": "sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA==",
+      "dev": true,
+      "dependencies": {
+        "util.promisify": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/regex-not": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz",
+      "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==",
+      "dev": true,
+      "dependencies": {
+        "extend-shallow": "^3.0.2",
+        "safe-regex": "^1.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/regexp.prototype.flags": {
+      "version": "1.5.0",
+      "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz",
+      "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "define-properties": "^1.2.0",
+        "functions-have-names": "^1.2.3"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/regexpp": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz",
+      "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==",
+      "dev": true,
+      "engines": {
+        "node": ">=6.5.0"
+      }
+    },
+    "node_modules/remove-trailing-separator": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
+      "integrity": "sha512-/hS+Y0u3aOfIETiaiirUFwDBDzmXPvO+jAfKTitUngIPzdKc6Z0LoFjM/CK5PL4C+eKwHohlHAb6H0VFfmmUsw==",
+      "dev": true
+    },
+    "node_modules/rename-function-calls": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npmjs.org/rename-function-calls/-/rename-function-calls-0.1.1.tgz",
+      "integrity": "sha512-F+z4csKBo6gw4y5vhIbOhG+UcZVWNh42fW35dagdFP74YrY4ET932NTZZEimMdJz8Efha73caz/OFGxt1vReOA==",
+      "dev": true,
+      "dependencies": {
+        "detective": "~3.1.0"
+      }
+    },
+    "node_modules/rename-function-calls/node_modules/detective": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/detective/-/detective-3.1.0.tgz",
+      "integrity": "sha512-BIvQHuiVSRMufK1OnlpeAzVqF2yXD75ZzYIx8XV4VQiJ48chF/MMYAdsz/NkulhZznwb4fAX8vyi5CUc24I2BA==",
+      "dev": true,
+      "dependencies": {
+        "escodegen": "~1.1.0",
+        "esprima-fb": "3001.1.0-dev-harmony-fb"
+      }
+    },
+    "node_modules/rename-function-calls/node_modules/escodegen": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.1.0.tgz",
+      "integrity": "sha512-md+WjA8K+DJELEYe0n4XAOE0XbUYfw2rzb8T+nhZ19OnQxlh+0jMLS6d+z2oqWugIh3uYKu1+KJh6QKeoogLzg==",
+      "dev": true,
+      "dependencies": {
+        "esprima": "~1.0.4",
+        "estraverse": "~1.5.0",
+        "esutils": "~1.0.0"
+      },
+      "bin": {
+        "escodegen": "bin/escodegen.js",
+        "esgenerate": "bin/esgenerate.js"
+      },
+      "engines": {
+        "node": ">=0.4.0"
+      },
+      "optionalDependencies": {
+        "source-map": "~0.1.30"
+      }
+    },
+    "node_modules/rename-function-calls/node_modules/esprima": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.0.4.tgz",
+      "integrity": "sha512-rp5dMKN8zEs9dfi9g0X1ClLmV//WRyk/R15mppFNICIFRG5P92VP7Z04p8pk++gABo9W2tY+kHyu6P1mEHgmTA==",
+      "dev": true,
+      "bin": {
+        "esparse": "bin/esparse.js",
+        "esvalidate": "bin/esvalidate.js"
+      },
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
+    "node_modules/rename-function-calls/node_modules/estraverse": {
+      "version": "1.5.1",
+      "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.5.1.tgz",
+      "integrity": "sha512-FpCjJDfmo3vsc/1zKSeqR5k42tcIhxFIlvq+h9j0fO2q/h2uLKyweq7rYJ+0CoVvrGQOxIS5wyBrW/+vF58BUQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
+    "node_modules/rename-function-calls/node_modules/esutils": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.0.0.tgz",
+      "integrity": "sha512-x/iYH53X3quDwfHRz4y8rn4XcEwwCJeWsul9pF1zldMbGtgOtMNBEOuYWwB1EQlK2LRa1fev3YAgym/RElp5Cg==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/rename-function-calls/node_modules/source-map": {
+      "version": "0.1.43",
+      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz",
+      "integrity": "sha512-VtCvB9SIQhk3aF6h+N85EaqIaBFIAfZ9Cu+NJHHVvc8BbEcnvDcFw6sqQ2dQrT6SlOrZq3tIvyD9+EGq/lJryQ==",
+      "dev": true,
+      "optional": true,
+      "dependencies": {
+        "amdefine": ">=0.0.4"
+      },
+      "engines": {
+        "node": ">=0.8.0"
+      }
+    },
+    "node_modules/repeat-element": {
+      "version": "1.1.4",
+      "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz",
+      "integrity": "sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/repeat-string": {
+      "version": "1.6.1",
+      "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
+      "integrity": "sha512-PV0dzCYDNfRi1jCDbJzpW7jNNDRuCOG/jI5ctQcGKt/clZD+YcPS3yIlWuTJMmESC8aevCFmWJy5wjAFgNqN6w==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10"
+      }
+    },
+    "node_modules/replace-requires": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/replace-requires/-/replace-requires-1.0.4.tgz",
+      "integrity": "sha512-9PpQ4IWrhJ+waLnakqT26sOIFW8SPTWZ/aEmz35Pq1V1k1A352nYDTkbhznTGUmYS2MsC0ULJ+2vChstBTxKRw==",
+      "dev": true,
+      "dependencies": {
+        "detective": "^4.5.0",
+        "has-require": "~1.2.1",
+        "patch-text": "~1.0.2",
+        "xtend": "~4.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/replace-requires/node_modules/acorn": {
+      "version": "5.7.4",
+      "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz",
+      "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==",
+      "dev": true,
+      "bin": {
+        "acorn": "bin/acorn"
+      },
+      "engines": {
+        "node": ">=0.4.0"
+      }
+    },
+    "node_modules/replace-requires/node_modules/detective": {
+      "version": "4.7.1",
+      "resolved": "https://registry.npmjs.org/detective/-/detective-4.7.1.tgz",
+      "integrity": "sha512-H6PmeeUcZloWtdt4DAkFyzFL94arpHr3NOwwmVILFiy+9Qd4JTxxXrzfyGk/lmct2qVGBwTSwSXagqu2BxmWig==",
+      "dev": true,
+      "dependencies": {
+        "acorn": "^5.2.1",
+        "defined": "^1.0.0"
+      }
+    },
+    "node_modules/request": {
+      "version": "2.88.2",
+      "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz",
+      "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==",
+      "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142",
+      "dev": true,
+      "dependencies": {
+        "aws-sign2": "~0.7.0",
+        "aws4": "^1.8.0",
+        "caseless": "~0.12.0",
+        "combined-stream": "~1.0.6",
+        "extend": "~3.0.2",
+        "forever-agent": "~0.6.1",
+        "form-data": "~2.3.2",
+        "har-validator": "~5.1.3",
+        "http-signature": "~1.2.0",
+        "is-typedarray": "~1.0.0",
+        "isstream": "~0.1.2",
+        "json-stringify-safe": "~5.0.1",
+        "mime-types": "~2.1.19",
+        "oauth-sign": "~0.9.0",
+        "performance-now": "^2.1.0",
+        "qs": "~6.5.2",
+        "safe-buffer": "^5.1.2",
+        "tough-cookie": "~2.5.0",
+        "tunnel-agent": "^0.6.0",
+        "uuid": "^3.3.2"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/request-promise-core": {
+      "version": "1.1.4",
+      "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz",
+      "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==",
+      "dev": true,
+      "dependencies": {
+        "lodash": "^4.17.19"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      },
+      "peerDependencies": {
+        "request": "^2.34"
+      }
+    },
+    "node_modules/request-promise-native": {
+      "version": "1.0.9",
+      "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz",
+      "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==",
+      "deprecated": "request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142",
+      "dev": true,
+      "dependencies": {
+        "request-promise-core": "1.1.4",
+        "stealthy-require": "^1.1.1",
+        "tough-cookie": "^2.3.3"
+      },
+      "engines": {
+        "node": ">=0.12.0"
+      },
+      "peerDependencies": {
+        "request": "^2.34"
+      }
+    },
+    "node_modules/require-directory": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
+      "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/require-main-filename": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
+      "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
+      "dev": true
+    },
+    "node_modules/resolve": {
+      "version": "1.22.4",
+      "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.4.tgz",
+      "integrity": "sha512-PXNdCiPqDqeUou+w1C2eTQbNfxKSuMxqTCuvlmmMsk1NWHL5fRrhY6Pl0qEYYc6+QqGClco1Qj8XnjPego4wfg==",
+      "dependencies": {
+        "is-core-module": "^2.13.0",
+        "path-parse": "^1.0.7",
+        "supports-preserve-symlinks-flag": "^1.0.0"
+      },
+      "bin": {
+        "resolve": "bin/resolve"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/resolve-cwd": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz",
+      "integrity": "sha512-ccu8zQTrzVr954472aUVPLEcB3YpKSYR3cg/3lo1okzobPBM+1INXBbBZlDbnI/hbEocnf8j0QVo43hQKrbchg==",
+      "dev": true,
+      "dependencies": {
+        "resolve-from": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/resolve-cwd/node_modules/resolve-from": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz",
+      "integrity": "sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/resolve-from": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
+      "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/resolve-url": {
+      "version": "0.2.1",
+      "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
+      "integrity": "sha512-ZuF55hVUQaaczgOIwqWzkEcEidmlD/xl44x1UZnhOXcYuFN2S6+rcxpG+C1N3So0wvNI3DmJICUFfu2SxhBmvg==",
+      "deprecated": "https://github.com/lydell/resolve-url#deprecated",
+      "dev": true
+    },
+    "node_modules/restore-cursor": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
+      "integrity": "sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q==",
+      "dev": true,
+      "dependencies": {
+        "onetime": "^2.0.0",
+        "signal-exit": "^3.0.2"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/ret": {
+      "version": "0.1.15",
+      "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz",
+      "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.12"
+      }
+    },
+    "node_modules/rimraf": {
+      "version": "2.6.3",
+      "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
+      "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
+      "dev": true,
+      "dependencies": {
+        "glob": "^7.1.3"
+      },
+      "bin": {
+        "rimraf": "bin.js"
+      }
+    },
+    "node_modules/ripemd160": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz",
+      "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==",
+      "dev": true,
+      "dependencies": {
+        "hash-base": "^3.0.0",
+        "inherits": "^2.0.1"
+      }
+    },
+    "node_modules/rsvp": {
+      "version": "4.8.5",
+      "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz",
+      "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==",
+      "dev": true,
+      "engines": {
+        "node": "6.* || >= 7.*"
+      }
+    },
+    "node_modules/run-async": {
+      "version": "2.4.1",
+      "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz",
+      "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.12.0"
+      }
+    },
+    "node_modules/rxjs": {
+      "version": "6.6.7",
+      "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz",
+      "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==",
+      "dev": true,
+      "dependencies": {
+        "tslib": "^1.9.0"
+      },
+      "engines": {
+        "npm": ">=2.0.0"
+      }
+    },
+    "node_modules/safe-array-concat": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/safe-array-concat/-/safe-array-concat-1.0.0.tgz",
+      "integrity": "sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "get-intrinsic": "^1.2.0",
+        "has-symbols": "^1.0.3",
+        "isarray": "^2.0.5"
+      },
+      "engines": {
+        "node": ">=0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/safe-array-concat/node_modules/isarray": {
+      "version": "2.0.5",
+      "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.5.tgz",
+      "integrity": "sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==",
+      "dev": true
+    },
+    "node_modules/safe-buffer": {
+      "version": "5.2.1",
+      "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
+      "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
+      "dev": true,
+      "funding": [
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/feross"
+        },
+        {
+          "type": "patreon",
+          "url": "https://www.patreon.com/feross"
+        },
+        {
+          "type": "consulting",
+          "url": "https://feross.org/support"
+        }
+      ]
+    },
+    "node_modules/safe-regex": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz",
+      "integrity": "sha512-aJXcif4xnaNUzvUuC5gcb46oTS7zvg4jpMTnuqtrEPlR3vFr4pxtdTwaF1Qs3Enjn9HK+ZlwQui+a7z0SywIzg==",
+      "dev": true,
+      "dependencies": {
+        "ret": "~0.1.10"
+      }
+    },
+    "node_modules/safe-regex-test": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz",
+      "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "get-intrinsic": "^1.1.3",
+        "is-regex": "^1.1.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/safer-buffer": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
+      "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
+      "dev": true
+    },
+    "node_modules/sane": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/sane/-/sane-4.1.0.tgz",
+      "integrity": "sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==",
+      "deprecated": "some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added",
+      "dev": true,
+      "dependencies": {
+        "@cnakazawa/watch": "^1.0.3",
+        "anymatch": "^2.0.0",
+        "capture-exit": "^2.0.0",
+        "exec-sh": "^0.3.2",
+        "execa": "^1.0.0",
+        "fb-watchman": "^2.0.0",
+        "micromatch": "^3.1.4",
+        "minimist": "^1.1.1",
+        "walker": "~1.0.5"
+      },
+      "bin": {
+        "sane": "src/cli.js"
+      },
+      "engines": {
+        "node": "6.* || 8.* || >= 10.*"
+      }
+    },
+    "node_modules/sax": {
+      "version": "1.2.4",
+      "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
+      "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
+    },
+    "node_modules/scope-analyzer": {
+      "version": "2.1.2",
+      "resolved": "https://registry.npmjs.org/scope-analyzer/-/scope-analyzer-2.1.2.tgz",
+      "integrity": "sha512-5cfCmsTYV/wPaRIItNxatw02ua/MThdIUNnUOCYp+3LSEJvnG804ANw2VLaavNILIfWXF1D1G2KNANkBBvInwQ==",
+      "dev": true,
+      "dependencies": {
+        "array-from": "^2.1.1",
+        "dash-ast": "^2.0.1",
+        "es6-map": "^0.1.5",
+        "es6-set": "^0.1.5",
+        "es6-symbol": "^3.1.1",
+        "estree-is-function": "^1.0.0",
+        "get-assigned-identifiers": "^1.1.0"
+      }
+    },
+    "node_modules/semver": {
+      "version": "5.7.2",
+      "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz",
+      "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==",
+      "bin": {
+        "semver": "bin/semver"
+      }
+    },
+    "node_modules/set-blocking": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
+      "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw=="
+    },
+    "node_modules/set-value": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz",
+      "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==",
+      "dev": true,
+      "dependencies": {
+        "extend-shallow": "^2.0.1",
+        "is-extendable": "^0.1.1",
+        "is-plain-object": "^2.0.3",
+        "split-string": "^3.0.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/set-value/node_modules/extend-shallow": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+      "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
+      "dev": true,
+      "dependencies": {
+        "is-extendable": "^0.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/set-value/node_modules/is-extendable": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+      "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/sha.js": {
+      "version": "2.4.11",
+      "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
+      "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
+      "dev": true,
+      "dependencies": {
+        "inherits": "^2.0.1",
+        "safe-buffer": "^5.0.1"
+      },
+      "bin": {
+        "sha.js": "bin.js"
+      }
+    },
+    "node_modules/shallow-copy": {
+      "version": "0.0.1",
+      "resolved": "https://registry.npmjs.org/shallow-copy/-/shallow-copy-0.0.1.tgz",
+      "integrity": "sha512-b6i4ZpVuUxB9h5gfCxPiusKYkqTMOjEbBs4wMaFbkfia4yFv92UKZ6Df8WXcKbn08JNL/abvg3FnMAOfakDvUw==",
+      "dev": true
+    },
+    "node_modules/shasum": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/shasum/-/shasum-1.0.2.tgz",
+      "integrity": "sha512-UTzHm/+AzKfO9RgPgRpDIuMSNie1ubXRaljjlhFMNGYoG7z+rm9AHLPMf70R7887xboDH9Q+5YQbWKObFHEAtw==",
+      "dev": true,
+      "dependencies": {
+        "json-stable-stringify": "~0.0.0",
+        "sha.js": "~2.4.4"
+      }
+    },
+    "node_modules/shasum-object": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/shasum-object/-/shasum-object-1.0.0.tgz",
+      "integrity": "sha512-Iqo5rp/3xVi6M4YheapzZhhGPVs0yZwHj7wvwQ1B9z8H6zk+FEnI7y3Teq7qwnekfEhu8WmG2z0z4iWZaxLWVg==",
+      "dev": true,
+      "dependencies": {
+        "fast-safe-stringify": "^2.0.7"
+      }
+    },
+    "node_modules/shebang-command": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
+      "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==",
+      "dev": true,
+      "dependencies": {
+        "shebang-regex": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/shebang-regex": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz",
+      "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/shell-quote": {
+      "version": "1.8.1",
+      "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.1.tgz",
+      "integrity": "sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==",
+      "dev": true,
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/shellwords": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz",
+      "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==",
+      "dev": true
+    },
+    "node_modules/side-channel": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz",
+      "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.0",
+        "get-intrinsic": "^1.0.2",
+        "object-inspect": "^1.9.0"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/signal-exit": {
+      "version": "3.0.7",
+      "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz",
+      "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==",
+      "dev": true
+    },
+    "node_modules/simple-concat": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz",
+      "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==",
+      "dev": true,
+      "funding": [
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/feross"
+        },
+        {
+          "type": "patreon",
+          "url": "https://www.patreon.com/feross"
+        },
+        {
+          "type": "consulting",
+          "url": "https://feross.org/support"
+        }
+      ]
+    },
+    "node_modules/sisteransi": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz",
+      "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==",
+      "dev": true
+    },
+    "node_modules/slash": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz",
+      "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==",
+      "dev": true,
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/slice-ansi": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz",
+      "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==",
+      "dev": true,
+      "dependencies": {
+        "ansi-styles": "^3.2.0",
+        "astral-regex": "^1.0.0",
+        "is-fullwidth-code-point": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/snapdragon": {
+      "version": "0.8.2",
+      "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz",
+      "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==",
+      "dev": true,
+      "dependencies": {
+        "base": "^0.11.1",
+        "debug": "^2.2.0",
+        "define-property": "^0.2.5",
+        "extend-shallow": "^2.0.1",
+        "map-cache": "^0.2.2",
+        "source-map": "^0.5.6",
+        "source-map-resolve": "^0.5.0",
+        "use": "^3.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/snapdragon-node": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz",
+      "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==",
+      "dev": true,
+      "dependencies": {
+        "define-property": "^1.0.0",
+        "isobject": "^3.0.0",
+        "snapdragon-util": "^3.0.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/snapdragon-node/node_modules/define-property": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz",
+      "integrity": "sha512-cZTYKFWspt9jZsMscWo8sc/5lbPC9Q0N5nBLgb+Yd915iL3udB1uFgS3B8YCx66UVHq018DAVFoee7x+gxggeA==",
+      "dev": true,
+      "dependencies": {
+        "is-descriptor": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/snapdragon-util": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz",
+      "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==",
+      "dev": true,
+      "dependencies": {
+        "kind-of": "^3.2.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/snapdragon-util/node_modules/kind-of": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+      "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+      "dev": true,
+      "dependencies": {
+        "is-buffer": "^1.1.5"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/snapdragon/node_modules/debug": {
+      "version": "2.6.9",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
+      "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
+      "dev": true,
+      "dependencies": {
+        "ms": "2.0.0"
+      }
+    },
+    "node_modules/snapdragon/node_modules/define-property": {
+      "version": "0.2.5",
+      "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+      "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==",
+      "dev": true,
+      "dependencies": {
+        "is-descriptor": "^0.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/snapdragon/node_modules/extend-shallow": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz",
+      "integrity": "sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==",
+      "dev": true,
+      "dependencies": {
+        "is-extendable": "^0.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/snapdragon/node_modules/is-accessor-descriptor": {
+      "version": "0.1.6",
+      "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+      "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==",
+      "dev": true,
+      "dependencies": {
+        "kind-of": "^3.0.2"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/snapdragon/node_modules/is-accessor-descriptor/node_modules/kind-of": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+      "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+      "dev": true,
+      "dependencies": {
+        "is-buffer": "^1.1.5"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/snapdragon/node_modules/is-data-descriptor": {
+      "version": "0.1.4",
+      "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+      "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==",
+      "dev": true,
+      "dependencies": {
+        "kind-of": "^3.0.2"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/snapdragon/node_modules/is-data-descriptor/node_modules/kind-of": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+      "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+      "dev": true,
+      "dependencies": {
+        "is-buffer": "^1.1.5"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/snapdragon/node_modules/is-descriptor": {
+      "version": "0.1.6",
+      "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
+      "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
+      "dev": true,
+      "dependencies": {
+        "is-accessor-descriptor": "^0.1.6",
+        "is-data-descriptor": "^0.1.4",
+        "kind-of": "^5.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/snapdragon/node_modules/is-extendable": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+      "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/snapdragon/node_modules/kind-of": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
+      "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/snapdragon/node_modules/ms": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
+      "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==",
+      "dev": true
+    },
+    "node_modules/source-map": {
+      "version": "0.5.7",
+      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
+      "integrity": "sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/source-map-resolve": {
+      "version": "0.5.3",
+      "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz",
+      "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==",
+      "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated",
+      "dev": true,
+      "dependencies": {
+        "atob": "^2.1.2",
+        "decode-uri-component": "^0.2.0",
+        "resolve-url": "^0.2.1",
+        "source-map-url": "^0.4.0",
+        "urix": "^0.1.0"
+      }
+    },
+    "node_modules/source-map-support": {
+      "version": "0.5.21",
+      "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz",
+      "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==",
+      "dev": true,
+      "dependencies": {
+        "buffer-from": "^1.0.0",
+        "source-map": "^0.6.0"
+      }
+    },
+    "node_modules/source-map-support/node_modules/source-map": {
+      "version": "0.6.1",
+      "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
+      "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/source-map-url": {
+      "version": "0.4.1",
+      "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz",
+      "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==",
+      "deprecated": "See https://github.com/lydell/source-map-url#deprecated",
+      "dev": true
+    },
+    "node_modules/sourcemap-codec": {
+      "version": "1.4.8",
+      "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz",
+      "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==",
+      "deprecated": "Please use @jridgewell/sourcemap-codec instead",
+      "dev": true
+    },
+    "node_modules/spdx-correct": {
+      "version": "3.2.0",
+      "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.2.0.tgz",
+      "integrity": "sha512-kN9dJbvnySHULIluDHy32WHRUu3Og7B9sbY7tsFLctQkIqnMh3hErYgdMjTYuqmcXX+lK5T1lnUt3G7zNswmZA==",
+      "dependencies": {
+        "spdx-expression-parse": "^3.0.0",
+        "spdx-license-ids": "^3.0.0"
+      }
+    },
+    "node_modules/spdx-exceptions": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz",
+      "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A=="
+    },
+    "node_modules/spdx-expression-parse": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz",
+      "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==",
+      "dependencies": {
+        "spdx-exceptions": "^2.1.0",
+        "spdx-license-ids": "^3.0.0"
+      }
+    },
+    "node_modules/spdx-license-ids": {
+      "version": "3.0.13",
+      "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.13.tgz",
+      "integrity": "sha512-XkD+zwiqXHikFZm4AX/7JSCXA98U5Db4AFd5XUg/+9UNtnH75+Z9KxtpYiJZx36mUDVOwH83pl7yvCer6ewM3w=="
+    },
+    "node_modules/split-string": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz",
+      "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==",
+      "dev": true,
+      "dependencies": {
+        "extend-shallow": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/sprintf-js": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
+      "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==",
+      "dev": true
+    },
+    "node_modules/sshpk": {
+      "version": "1.17.0",
+      "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz",
+      "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==",
+      "dev": true,
+      "dependencies": {
+        "asn1": "~0.2.3",
+        "assert-plus": "^1.0.0",
+        "bcrypt-pbkdf": "^1.0.0",
+        "dashdash": "^1.12.0",
+        "ecc-jsbn": "~0.1.1",
+        "getpass": "^0.1.1",
+        "jsbn": "~0.1.0",
+        "safer-buffer": "^2.0.2",
+        "tweetnacl": "~0.14.0"
+      },
+      "bin": {
+        "sshpk-conv": "bin/sshpk-conv",
+        "sshpk-sign": "bin/sshpk-sign",
+        "sshpk-verify": "bin/sshpk-verify"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/stack-utils": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.5.tgz",
+      "integrity": "sha512-KZiTzuV3CnSnSvgMRrARVCj+Ht7rMbauGDK0LdVFRGyenwdylpajAp4Q0i6SX8rEmbTpMMf6ryq2gb8pPq2WgQ==",
+      "dev": true,
+      "dependencies": {
+        "escape-string-regexp": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/stack-utils/node_modules/escape-string-regexp": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz",
+      "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==",
+      "dev": true,
+      "engines": {
+        "node": ">=8"
+      }
+    },
+    "node_modules/static-eval": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.1.0.tgz",
+      "integrity": "sha512-agtxZ/kWSsCkI5E4QifRwsaPs0P0JmZV6dkLz6ILYfFYQGn+5plctanRN+IC8dJRiFkyXHrwEE3W9Wmx67uDbw==",
+      "dev": true,
+      "dependencies": {
+        "escodegen": "^1.11.1"
+      }
+    },
+    "node_modules/static-extend": {
+      "version": "0.1.2",
+      "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz",
+      "integrity": "sha512-72E9+uLc27Mt718pMHt9VMNiAL4LMsmDbBva8mxWUCkT07fSzEGMYUCk0XWY6lp0j6RBAG4cJ3mWuZv2OE3s0g==",
+      "dev": true,
+      "dependencies": {
+        "define-property": "^0.2.5",
+        "object-copy": "^0.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/static-extend/node_modules/define-property": {
+      "version": "0.2.5",
+      "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz",
+      "integrity": "sha512-Rr7ADjQZenceVOAKop6ALkkRAmH1A4Gx9hV/7ZujPUN2rkATqFO0JZLZInbAjpZYoJ1gUx8MRMQVkYemcbMSTA==",
+      "dev": true,
+      "dependencies": {
+        "is-descriptor": "^0.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/static-extend/node_modules/is-accessor-descriptor": {
+      "version": "0.1.6",
+      "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz",
+      "integrity": "sha512-e1BM1qnDbMRG3ll2U9dSK0UMHuWOs3pY3AtcFsmvwPtKL3MML/Q86i+GilLfvqEs4GW+ExB91tQ3Ig9noDIZ+A==",
+      "dev": true,
+      "dependencies": {
+        "kind-of": "^3.0.2"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/static-extend/node_modules/is-accessor-descriptor/node_modules/kind-of": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+      "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+      "dev": true,
+      "dependencies": {
+        "is-buffer": "^1.1.5"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/static-extend/node_modules/is-data-descriptor": {
+      "version": "0.1.4",
+      "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz",
+      "integrity": "sha512-+w9D5ulSoBNlmw9OHn3U2v51SyoCd0he+bB3xMl62oijhrspxowjU+AIcDY0N3iEJbUEkB15IlMASQsxYigvXg==",
+      "dev": true,
+      "dependencies": {
+        "kind-of": "^3.0.2"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/static-extend/node_modules/is-data-descriptor/node_modules/kind-of": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+      "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+      "dev": true,
+      "dependencies": {
+        "is-buffer": "^1.1.5"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/static-extend/node_modules/is-descriptor": {
+      "version": "0.1.6",
+      "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz",
+      "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==",
+      "dev": true,
+      "dependencies": {
+        "is-accessor-descriptor": "^0.1.6",
+        "is-data-descriptor": "^0.1.4",
+        "kind-of": "^5.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/static-extend/node_modules/kind-of": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz",
+      "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/static-module": {
+      "version": "3.0.4",
+      "resolved": "https://registry.npmjs.org/static-module/-/static-module-3.0.4.tgz",
+      "integrity": "sha512-gb0v0rrgpBkifXCa3yZXxqVmXDVE+ETXj6YlC/jt5VzOnGXR2C15+++eXuMDUYsePnbhf+lwW0pE1UXyOLtGCw==",
+      "dev": true,
+      "dependencies": {
+        "acorn-node": "^1.3.0",
+        "concat-stream": "~1.6.0",
+        "convert-source-map": "^1.5.1",
+        "duplexer2": "~0.1.4",
+        "escodegen": "^1.11.1",
+        "has": "^1.0.1",
+        "magic-string": "0.25.1",
+        "merge-source-map": "1.0.4",
+        "object-inspect": "^1.6.0",
+        "readable-stream": "~2.3.3",
+        "scope-analyzer": "^2.0.1",
+        "shallow-copy": "~0.0.1",
+        "static-eval": "^2.0.5",
+        "through2": "~2.0.3"
+      }
+    },
+    "node_modules/static-module/node_modules/convert-source-map": {
+      "version": "1.9.0",
+      "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz",
+      "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==",
+      "dev": true
+    },
+    "node_modules/stealthy-require": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz",
+      "integrity": "sha512-ZnWpYnYugiOVEY5GkcuJK1io5V8QmNYChG62gSit9pQVGErXtrKuPC55ITaVSukmMta5qpMU7vqLt2Lnni4f/g==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/stream-browserify": {
+      "version": "2.0.2",
+      "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz",
+      "integrity": "sha512-nX6hmklHs/gr2FuxYDltq8fJA1GDlxKQCz8O/IM4atRqBH8OORmBNgfvW5gG10GT/qQ9u0CzIvr2X5Pkt6ntqg==",
+      "dev": true,
+      "dependencies": {
+        "inherits": "~2.0.1",
+        "readable-stream": "^2.0.2"
+      }
+    },
+    "node_modules/stream-combiner2": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/stream-combiner2/-/stream-combiner2-1.1.1.tgz",
+      "integrity": "sha512-3PnJbYgS56AeWgtKF5jtJRT6uFJe56Z0Hc5Ngg/6sI6rIt8iiMBTa9cvdyFfpMQjaVHr8dusbNeFGIIonxOvKw==",
+      "dev": true,
+      "dependencies": {
+        "duplexer2": "~0.1.0",
+        "readable-stream": "^2.0.2"
+      }
+    },
+    "node_modules/stream-http": {
+      "version": "3.2.0",
+      "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-3.2.0.tgz",
+      "integrity": "sha512-Oq1bLqisTyK3TSCXpPbT4sdeYNdmyZJv1LxpEm2vu1ZhK89kSE5YXwZc3cWk0MagGaKriBh9mCFbVGtO+vY29A==",
+      "dev": true,
+      "dependencies": {
+        "builtin-status-codes": "^3.0.0",
+        "inherits": "^2.0.4",
+        "readable-stream": "^3.6.0",
+        "xtend": "^4.0.2"
+      }
+    },
+    "node_modules/stream-http/node_modules/readable-stream": {
+      "version": "3.6.2",
+      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz",
+      "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==",
+      "dev": true,
+      "dependencies": {
+        "inherits": "^2.0.3",
+        "string_decoder": "^1.1.1",
+        "util-deprecate": "^1.0.1"
+      },
+      "engines": {
+        "node": ">= 6"
+      }
+    },
+    "node_modules/stream-splicer": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/stream-splicer/-/stream-splicer-2.0.1.tgz",
+      "integrity": "sha512-Xizh4/NPuYSyAXyT7g8IvdJ9HJpxIGL9PjyhtywCZvvP0OPIdqyrr4dMikeuvY8xahpdKEBlBTySe583totajg==",
+      "dev": true,
+      "dependencies": {
+        "inherits": "^2.0.1",
+        "readable-stream": "^2.0.2"
+      }
+    },
+    "node_modules/string_decoder": {
+      "version": "1.3.0",
+      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz",
+      "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==",
+      "dev": true,
+      "dependencies": {
+        "safe-buffer": "~5.2.0"
+      }
+    },
+    "node_modules/string-length": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/string-length/-/string-length-2.0.0.tgz",
+      "integrity": "sha512-Qka42GGrS8Mm3SZ+7cH8UXiIWI867/b/Z/feQSpQx/rbfB8UGknGEZVaUQMOUVj+soY6NpWAxily63HI1OckVQ==",
+      "dev": true,
+      "dependencies": {
+        "astral-regex": "^1.0.0",
+        "strip-ansi": "^4.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/string-width": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
+      "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
+      "dev": true,
+      "dependencies": {
+        "is-fullwidth-code-point": "^2.0.0",
+        "strip-ansi": "^4.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/string.prototype.trim": {
+      "version": "1.2.7",
+      "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz",
+      "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "define-properties": "^1.1.4",
+        "es-abstract": "^1.20.4"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/string.prototype.trimend": {
+      "version": "1.0.6",
+      "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz",
+      "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "define-properties": "^1.1.4",
+        "es-abstract": "^1.20.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/string.prototype.trimstart": {
+      "version": "1.0.6",
+      "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz",
+      "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "define-properties": "^1.1.4",
+        "es-abstract": "^1.20.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/strip-ansi": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
+      "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==",
+      "dev": true,
+      "dependencies": {
+        "ansi-regex": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/strip-ansi/node_modules/ansi-regex": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz",
+      "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/strip-bom": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz",
+      "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/strip-eof": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz",
+      "integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/strip-json-comments": {
+      "version": "2.0.1",
+      "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz",
+      "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/subarg": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/subarg/-/subarg-1.0.0.tgz",
+      "integrity": "sha512-RIrIdRY0X1xojthNcVtgT9sjpOGagEUKpZdgBUi054OEPFo282yg+zE+t1Rj3+RqKq2xStL7uUHhY+AjbC4BXg==",
+      "dev": true,
+      "dependencies": {
+        "minimist": "^1.1.0"
+      }
+    },
+    "node_modules/superagent": {
+      "version": "3.8.3",
+      "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz",
+      "integrity": "sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==",
+      "deprecated": "Please upgrade to v7.0.2+ of superagent.  We have fixed numerous issues with streams, form-data, attach(), filesystem errors not bubbling up (ENOENT on attach()), and all tests are now passing.  See the releases tab for more information at <https://github.com/visionmedia/superagent/releases>.",
+      "dev": true,
+      "dependencies": {
+        "component-emitter": "^1.2.0",
+        "cookiejar": "^2.1.0",
+        "debug": "^3.1.0",
+        "extend": "^3.0.0",
+        "form-data": "^2.3.1",
+        "formidable": "^1.2.0",
+        "methods": "^1.1.1",
+        "mime": "^1.4.1",
+        "qs": "^6.5.1",
+        "readable-stream": "^2.3.5"
+      },
+      "engines": {
+        "node": ">= 4.0"
+      }
+    },
+    "node_modules/superagent/node_modules/debug": {
+      "version": "3.2.7",
+      "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz",
+      "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==",
+      "dev": true,
+      "dependencies": {
+        "ms": "^2.1.1"
+      }
+    },
+    "node_modules/supports-color": {
+      "version": "5.5.0",
+      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
+      "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
+      "dev": true,
+      "dependencies": {
+        "has-flag": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/supports-preserve-symlinks-flag": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz",
+      "integrity": "sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==",
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/symbol-tree": {
+      "version": "3.2.4",
+      "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
+      "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==",
+      "dev": true
+    },
+    "node_modules/syntax-error": {
+      "version": "1.4.0",
+      "resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz",
+      "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==",
+      "dev": true,
+      "dependencies": {
+        "acorn-node": "^1.2.0"
+      }
+    },
+    "node_modules/table": {
+      "version": "5.4.6",
+      "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz",
+      "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==",
+      "dev": true,
+      "dependencies": {
+        "ajv": "^6.10.2",
+        "lodash": "^4.17.14",
+        "slice-ansi": "^2.1.0",
+        "string-width": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=6.0.0"
+      }
+    },
+    "node_modules/table/node_modules/string-width": {
+      "version": "3.1.0",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
+      "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==",
+      "dev": true,
+      "dependencies": {
+        "emoji-regex": "^7.0.1",
+        "is-fullwidth-code-point": "^2.0.0",
+        "strip-ansi": "^5.1.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/table/node_modules/strip-ansi": {
+      "version": "5.2.0",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
+      "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==",
+      "dev": true,
+      "dependencies": {
+        "ansi-regex": "^4.1.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/ternary": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/ternary/-/ternary-1.0.0.tgz",
+      "integrity": "sha512-/e+OUAGiEqytNLXnDfFkuel0N0y9IGkmvuGIPkirI+zv0dx/jPvUZ2l8qV6KYk8lmmLrAqk4iLJtRduUA6AUKw==",
+      "dev": true
+    },
+    "node_modules/test-exclude": {
+      "version": "5.2.3",
+      "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz",
+      "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==",
+      "dev": true,
+      "dependencies": {
+        "glob": "^7.1.3",
+        "minimatch": "^3.0.4",
+        "read-pkg-up": "^4.0.0",
+        "require-main-filename": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/text-table": {
+      "version": "0.2.0",
+      "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
+      "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==",
+      "dev": true
+    },
+    "node_modules/throat": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/throat/-/throat-4.1.0.tgz",
+      "integrity": "sha512-wCVxLDcFxw7ujDxaeJC6nfl2XfHJNYs8yUYJnvMgtPEFlttP9tHSfRUv2vBe6C4hkVFPWoP1P6ZccbYjmSEkKA==",
+      "dev": true
+    },
+    "node_modules/through": {
+      "version": "2.3.8",
+      "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz",
+      "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==",
+      "dev": true
+    },
+    "node_modules/through2": {
+      "version": "2.0.5",
+      "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz",
+      "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==",
+      "dev": true,
+      "dependencies": {
+        "readable-stream": "~2.3.6",
+        "xtend": "~4.0.1"
+      }
+    },
+    "node_modules/timers-browserify": {
+      "version": "1.4.2",
+      "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-1.4.2.tgz",
+      "integrity": "sha512-PIxwAupJZiYU4JmVZYwXp9FKsHMXb5h0ZEFyuXTAn8WLHOlcij+FEcbrvDsom1o5dr1YggEtFbECvGCW2sT53Q==",
+      "dev": true,
+      "dependencies": {
+        "process": "~0.11.0"
+      },
+      "engines": {
+        "node": ">=0.6.0"
+      }
+    },
+    "node_modules/tmp": {
+      "version": "0.0.33",
+      "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
+      "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==",
+      "dev": true,
+      "dependencies": {
+        "os-tmpdir": "~1.0.2"
+      },
+      "engines": {
+        "node": ">=0.6.0"
+      }
+    },
+    "node_modules/tmpl": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
+      "integrity": "sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw==",
+      "dev": true
+    },
+    "node_modules/to-fast-properties": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
+      "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/to-object-path": {
+      "version": "0.3.0",
+      "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz",
+      "integrity": "sha512-9mWHdnGRuh3onocaHzukyvCZhzvr6tiflAy/JRFXcJX0TjgfWA9pk9t8CMbzmBE4Jfw58pXbkngtBtqYxzNEyg==",
+      "dev": true,
+      "dependencies": {
+        "kind-of": "^3.0.2"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/to-object-path/node_modules/kind-of": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
+      "integrity": "sha512-NOW9QQXMoZGg/oqnVNoNTTIFEIid1627WCffUBJEdMxYApq7mNE7CpzucIPc+ZQg25Phej7IJSmX3hO+oblOtQ==",
+      "dev": true,
+      "dependencies": {
+        "is-buffer": "^1.1.5"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/to-regex": {
+      "version": "3.0.2",
+      "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz",
+      "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==",
+      "dev": true,
+      "dependencies": {
+        "define-property": "^2.0.2",
+        "extend-shallow": "^3.0.2",
+        "regex-not": "^1.0.2",
+        "safe-regex": "^1.1.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/to-regex-range": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz",
+      "integrity": "sha512-ZZWNfCjUokXXDGXFpZehJIkZqq91BcULFq/Pi7M5i4JnxXdhMKAK682z8bCW3o8Hj1wuuzoKcW3DfVzaP6VuNg==",
+      "dev": true,
+      "dependencies": {
+        "is-number": "^3.0.0",
+        "repeat-string": "^1.6.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/tough-cookie": {
+      "version": "2.5.0",
+      "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz",
+      "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==",
+      "dev": true,
+      "dependencies": {
+        "psl": "^1.1.28",
+        "punycode": "^2.1.1"
+      },
+      "engines": {
+        "node": ">=0.8"
+      }
+    },
+    "node_modules/tough-cookie/node_modules/punycode": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
+      "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",
+      "dev": true,
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/tr46": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/tr46/-/tr46-1.0.1.tgz",
+      "integrity": "sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA==",
+      "dev": true,
+      "dependencies": {
+        "punycode": "^2.1.0"
+      }
+    },
+    "node_modules/tr46/node_modules/punycode": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
+      "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",
+      "dev": true,
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/transformify": {
+      "version": "0.1.2",
+      "resolved": "https://registry.npmjs.org/transformify/-/transformify-0.1.2.tgz",
+      "integrity": "sha512-BUZAqCslm5pVXExA8PfXcvp7exsUNqRcNzx+KXj3Bv0oMROqnAt4bvs9U8Z2wVPa40NvLWJ/oswN0kreNFxBUg==",
+      "dev": true,
+      "dependencies": {
+        "readable-stream": "~1.1.9"
+      }
+    },
+    "node_modules/transformify/node_modules/isarray": {
+      "version": "0.0.1",
+      "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
+      "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==",
+      "dev": true
+    },
+    "node_modules/transformify/node_modules/readable-stream": {
+      "version": "1.1.14",
+      "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz",
+      "integrity": "sha512-+MeVjFf4L44XUkhM1eYbD8fyEsxcV81pqMSR5gblfcLCHfZvbrqy4/qYHE+/R5HoBUT11WV5O08Cr1n3YXkWVQ==",
+      "dev": true,
+      "dependencies": {
+        "core-util-is": "~1.0.0",
+        "inherits": "~2.0.1",
+        "isarray": "0.0.1",
+        "string_decoder": "~0.10.x"
+      }
+    },
+    "node_modules/transformify/node_modules/string_decoder": {
+      "version": "0.10.31",
+      "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
+      "integrity": "sha512-ev2QzSzWPYmy9GuqfIVildA4OdcGLeFZQrq5ys6RtiuF+RQQiZWr8TZNyAcuVXyQRYfEO+MsoB/1BuQVhOJuoQ==",
+      "dev": true
+    },
+    "node_modules/ts-jest": {
+      "version": "24.3.0",
+      "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.3.0.tgz",
+      "integrity": "sha512-Hb94C/+QRIgjVZlJyiWwouYUF+siNJHJHknyspaOcZ+OQAIdFG/UrdQVXw/0B8Z3No34xkUXZJpOTy9alOWdVQ==",
+      "dev": true,
+      "dependencies": {
+        "bs-logger": "0.x",
+        "buffer-from": "1.x",
+        "fast-json-stable-stringify": "2.x",
+        "json5": "2.x",
+        "lodash.memoize": "4.x",
+        "make-error": "1.x",
+        "mkdirp": "0.x",
+        "resolve": "1.x",
+        "semver": "^5.5",
+        "yargs-parser": "10.x"
+      },
+      "bin": {
+        "ts-jest": "cli.js"
+      },
+      "engines": {
+        "node": ">= 6"
+      },
+      "peerDependencies": {
+        "jest": ">=24 <25"
+      }
+    },
+    "node_modules/ts-jest/node_modules/json5": {
+      "version": "2.2.3",
+      "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz",
+      "integrity": "sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==",
+      "dev": true,
+      "bin": {
+        "json5": "lib/cli.js"
+      },
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/ts-jest/node_modules/lodash.memoize": {
+      "version": "4.1.2",
+      "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz",
+      "integrity": "sha512-t7j+NzmgnQzTAYXcsHYLgimltOV1MXHtlOWf6GjL9Kj8GK5FInw5JotxvbOs+IvV1/Dzo04/fCGfLVs7aXb4Ag==",
+      "dev": true
+    },
+    "node_modules/tslib": {
+      "version": "1.14.1",
+      "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
+      "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
+      "dev": true
+    },
+    "node_modules/tslint": {
+      "version": "5.20.1",
+      "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz",
+      "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==",
+      "dev": true,
+      "dependencies": {
+        "@babel/code-frame": "^7.0.0",
+        "builtin-modules": "^1.1.1",
+        "chalk": "^2.3.0",
+        "commander": "^2.12.1",
+        "diff": "^4.0.1",
+        "glob": "^7.1.1",
+        "js-yaml": "^3.13.1",
+        "minimatch": "^3.0.4",
+        "mkdirp": "^0.5.1",
+        "resolve": "^1.3.2",
+        "semver": "^5.3.0",
+        "tslib": "^1.8.0",
+        "tsutils": "^2.29.0"
+      },
+      "bin": {
+        "tslint": "bin/tslint"
+      },
+      "engines": {
+        "node": ">=4.8.0"
+      },
+      "peerDependencies": {
+        "typescript": ">=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev"
+      }
+    },
+    "node_modules/tsutils": {
+      "version": "2.29.0",
+      "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz",
+      "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==",
+      "dev": true,
+      "dependencies": {
+        "tslib": "^1.8.1"
+      },
+      "peerDependencies": {
+        "typescript": ">=2.1.0 || >=2.1.0-dev || >=2.2.0-dev || >=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >= 3.0.0-dev || >= 3.1.0-dev"
+      }
+    },
+    "node_modules/tty-browserify": {
+      "version": "0.0.1",
+      "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.1.tgz",
+      "integrity": "sha512-C3TaO7K81YvjCgQH9Q1S3R3P3BtN3RIM8n+OvX4il1K1zgE8ZhI0op7kClgkxtutIE8hQrcrHBXvIheqKUUCxw==",
+      "dev": true
+    },
+    "node_modules/tunnel-agent": {
+      "version": "0.6.0",
+      "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz",
+      "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==",
+      "dev": true,
+      "dependencies": {
+        "safe-buffer": "^5.0.1"
+      },
+      "engines": {
+        "node": "*"
+      }
+    },
+    "node_modules/tweetnacl": {
+      "version": "0.14.5",
+      "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz",
+      "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==",
+      "dev": true
+    },
+    "node_modules/type": {
+      "version": "1.2.0",
+      "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz",
+      "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==",
+      "dev": true
+    },
+    "node_modules/type-check": {
+      "version": "0.3.2",
+      "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
+      "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==",
+      "dev": true,
+      "dependencies": {
+        "prelude-ls": "~1.1.2"
+      },
+      "engines": {
+        "node": ">= 0.8.0"
+      }
+    },
+    "node_modules/typed-array-buffer": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/typed-array-buffer/-/typed-array-buffer-1.0.0.tgz",
+      "integrity": "sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "get-intrinsic": "^1.2.1",
+        "is-typed-array": "^1.1.10"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      }
+    },
+    "node_modules/typed-array-byte-length": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/typed-array-byte-length/-/typed-array-byte-length-1.0.0.tgz",
+      "integrity": "sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "for-each": "^0.3.3",
+        "has-proto": "^1.0.1",
+        "is-typed-array": "^1.1.10"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/typed-array-byte-offset": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz",
+      "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==",
+      "dev": true,
+      "dependencies": {
+        "available-typed-arrays": "^1.0.5",
+        "call-bind": "^1.0.2",
+        "for-each": "^0.3.3",
+        "has-proto": "^1.0.1",
+        "is-typed-array": "^1.1.10"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/typed-array-length": {
+      "version": "1.0.4",
+      "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz",
+      "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "for-each": "^0.3.3",
+        "is-typed-array": "^1.1.9"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/typedarray": {
+      "version": "0.0.6",
+      "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz",
+      "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==",
+      "dev": true
+    },
+    "node_modules/typescript": {
+      "version": "3.9.10",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.10.tgz",
+      "integrity": "sha512-w6fIxVE/H1PkLKcCPsFqKE7Kv7QUwhU8qQY2MueZXWx5cPZdwFupLgKK3vntcK98BtNHZtAF4LA/yl2a7k8R6Q==",
+      "dev": true,
+      "bin": {
+        "tsc": "bin/tsc",
+        "tsserver": "bin/tsserver"
+      },
+      "engines": {
+        "node": ">=4.2.0"
+      }
+    },
+    "node_modules/umd": {
+      "version": "3.0.3",
+      "resolved": "https://registry.npmjs.org/umd/-/umd-3.0.3.tgz",
+      "integrity": "sha512-4IcGSufhFshvLNcMCV80UnQVlZ5pMOC8mvNPForqwA4+lzYQuetTESLDQkeLmihq8bRcnpbQa48Wb8Lh16/xow==",
+      "dev": true,
+      "bin": {
+        "umd": "bin/cli.js"
+      }
+    },
+    "node_modules/unbox-primitive": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz",
+      "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "has-bigints": "^1.0.2",
+        "has-symbols": "^1.0.3",
+        "which-boxed-primitive": "^1.0.2"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/undeclared-identifiers": {
+      "version": "1.1.3",
+      "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz",
+      "integrity": "sha512-pJOW4nxjlmfwKApE4zvxLScM/njmwj/DiUBv7EabwE4O8kRUy+HIwxQtZLBPll/jx1LJyBcqNfB3/cpv9EZwOw==",
+      "dev": true,
+      "dependencies": {
+        "acorn-node": "^1.3.0",
+        "dash-ast": "^1.0.0",
+        "get-assigned-identifiers": "^1.2.0",
+        "simple-concat": "^1.0.0",
+        "xtend": "^4.0.1"
+      },
+      "bin": {
+        "undeclared-identifiers": "bin.js"
+      }
+    },
+    "node_modules/undeclared-identifiers/node_modules/dash-ast": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz",
+      "integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==",
+      "dev": true
+    },
+    "node_modules/union-value": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz",
+      "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==",
+      "dev": true,
+      "dependencies": {
+        "arr-union": "^3.1.0",
+        "get-value": "^2.0.6",
+        "is-extendable": "^0.1.1",
+        "set-value": "^2.0.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/union-value/node_modules/is-extendable": {
+      "version": "0.1.1",
+      "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz",
+      "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/unset-value": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz",
+      "integrity": "sha512-PcA2tsuGSF9cnySLHTLSh2qrQiJ70mn+r+Glzxv2TWZblxsxCC52BDlZoPCsz7STd9pN7EZetkWZBAvk4cgZdQ==",
+      "dev": true,
+      "dependencies": {
+        "has-value": "^0.3.1",
+        "isobject": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/unset-value/node_modules/has-value": {
+      "version": "0.3.1",
+      "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz",
+      "integrity": "sha512-gpG936j8/MzaeID5Yif+577c17TxaDmhuyVgSwtnL/q8UUTySg8Mecb+8Cf1otgLoD7DDH75axp86ER7LFsf3Q==",
+      "dev": true,
+      "dependencies": {
+        "get-value": "^2.0.3",
+        "has-values": "^0.1.4",
+        "isobject": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/unset-value/node_modules/has-value/node_modules/isobject": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz",
+      "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==",
+      "dev": true,
+      "dependencies": {
+        "isarray": "1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/unset-value/node_modules/has-values": {
+      "version": "0.1.4",
+      "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz",
+      "integrity": "sha512-J8S0cEdWuQbqD9//tlZxiMuMNmxB8PlEwvYwuxsTmR1G5RXUePEX/SJn7aD0GMLieuZYSwNH0cQuJGwnYunXRQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/update-browserslist-db": {
+      "version": "1.0.11",
+      "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz",
+      "integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==",
+      "dev": true,
+      "funding": [
+        {
+          "type": "opencollective",
+          "url": "https://opencollective.com/browserslist"
+        },
+        {
+          "type": "tidelift",
+          "url": "https://tidelift.com/funding/github/npm/browserslist"
+        },
+        {
+          "type": "github",
+          "url": "https://github.com/sponsors/ai"
+        }
+      ],
+      "dependencies": {
+        "escalade": "^3.1.1",
+        "picocolors": "^1.0.0"
+      },
+      "bin": {
+        "update-browserslist-db": "cli.js"
+      },
+      "peerDependencies": {
+        "browserslist": ">= 4.21.0"
+      }
+    },
+    "node_modules/uri-js": {
+      "version": "4.4.1",
+      "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
+      "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
+      "dependencies": {
+        "punycode": "^2.1.0"
+      }
+    },
+    "node_modules/uri-js/node_modules/punycode": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz",
+      "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==",
+      "engines": {
+        "node": ">=6"
+      }
+    },
+    "node_modules/urix": {
+      "version": "0.1.0",
+      "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",
+      "integrity": "sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg==",
+      "deprecated": "Please see https://github.com/lydell/urix#deprecated",
+      "dev": true
+    },
+    "node_modules/url": {
+      "version": "0.11.1",
+      "resolved": "https://registry.npmjs.org/url/-/url-0.11.1.tgz",
+      "integrity": "sha512-rWS3H04/+mzzJkv0eZ7vEDGiQbgquI1fGfOad6zKvgYQi1SzMmhl7c/DdRGxhaWrVH6z0qWITo8rpnxK/RfEhA==",
+      "dev": true,
+      "dependencies": {
+        "punycode": "^1.4.1",
+        "qs": "^6.11.0"
+      }
+    },
+    "node_modules/url/node_modules/qs": {
+      "version": "6.11.2",
+      "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz",
+      "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==",
+      "dev": true,
+      "dependencies": {
+        "side-channel": "^1.0.4"
+      },
+      "engines": {
+        "node": ">=0.6"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/use": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz",
+      "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/util": {
+      "version": "0.10.4",
+      "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz",
+      "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==",
+      "dev": true,
+      "dependencies": {
+        "inherits": "2.0.3"
+      }
+    },
+    "node_modules/util-deprecate": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
+      "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
+      "dev": true
+    },
+    "node_modules/util.promisify": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.1.2.tgz",
+      "integrity": "sha512-PBdZ03m1kBnQ5cjjO0ZvJMJS+QsbyIcFwi4hY4U76OQsCO9JrOYjbCFgIF76ccFg9xnJo7ZHPkqyj1GqmdS7MA==",
+      "dev": true,
+      "dependencies": {
+        "call-bind": "^1.0.2",
+        "define-properties": "^1.2.0",
+        "for-each": "^0.3.3",
+        "has-proto": "^1.0.1",
+        "has-symbols": "^1.0.3",
+        "object.getownpropertydescriptors": "^2.1.6",
+        "safe-array-concat": "^1.0.0"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/util/node_modules/inherits": {
+      "version": "2.0.3",
+      "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
+      "integrity": "sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==",
+      "dev": true
+    },
+    "node_modules/uuid": {
+      "version": "3.4.0",
+      "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
+      "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
+      "deprecated": "Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.",
+      "dev": true,
+      "bin": {
+        "uuid": "bin/uuid"
+      }
+    },
+    "node_modules/validate-npm-package-license": {
+      "version": "3.0.4",
+      "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz",
+      "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==",
+      "dependencies": {
+        "spdx-correct": "^3.0.0",
+        "spdx-expression-parse": "^3.0.0"
+      }
+    },
+    "node_modules/verror": {
+      "version": "1.10.0",
+      "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
+      "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==",
+      "dev": true,
+      "engines": [
+        "node >=0.6.0"
+      ],
+      "dependencies": {
+        "assert-plus": "^1.0.0",
+        "core-util-is": "1.0.2",
+        "extsprintf": "^1.2.0"
+      }
+    },
+    "node_modules/verror/node_modules/core-util-is": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
+      "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==",
+      "dev": true
+    },
+    "node_modules/vm-browserify": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.2.tgz",
+      "integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==",
+      "dev": true
+    },
+    "node_modules/w3c-hr-time": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz",
+      "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==",
+      "deprecated": "Use your platform's native performance.now() and performance.timeOrigin.",
+      "dev": true,
+      "dependencies": {
+        "browser-process-hrtime": "^1.0.0"
+      }
+    },
+    "node_modules/walker": {
+      "version": "1.0.8",
+      "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz",
+      "integrity": "sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ==",
+      "dev": true,
+      "dependencies": {
+        "makeerror": "1.0.12"
+      }
+    },
+    "node_modules/webidl-conversions": {
+      "version": "4.0.2",
+      "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
+      "integrity": "sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg==",
+      "dev": true
+    },
+    "node_modules/whatwg-encoding": {
+      "version": "1.0.5",
+      "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz",
+      "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==",
+      "dev": true,
+      "dependencies": {
+        "iconv-lite": "0.4.24"
+      }
+    },
+    "node_modules/whatwg-mimetype": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz",
+      "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==",
+      "dev": true
+    },
+    "node_modules/whatwg-url": {
+      "version": "6.5.0",
+      "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-6.5.0.tgz",
+      "integrity": "sha512-rhRZRqx/TLJQWUpQ6bmrt2UV4f0HCQ463yQuONJqC6fO2VoEb1pTYddbe59SkYq87aoM5A3bdhMZiUiVws+fzQ==",
+      "dev": true,
+      "dependencies": {
+        "lodash.sortby": "^4.7.0",
+        "tr46": "^1.0.1",
+        "webidl-conversions": "^4.0.2"
+      }
+    },
+    "node_modules/which": {
+      "version": "1.3.1",
+      "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz",
+      "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==",
+      "dev": true,
+      "dependencies": {
+        "isexe": "^2.0.0"
+      },
+      "bin": {
+        "which": "bin/which"
+      }
+    },
+    "node_modules/which-boxed-primitive": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz",
+      "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==",
+      "dev": true,
+      "dependencies": {
+        "is-bigint": "^1.0.1",
+        "is-boolean-object": "^1.1.0",
+        "is-number-object": "^1.0.4",
+        "is-string": "^1.0.5",
+        "is-symbol": "^1.0.3"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/which-module": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz",
+      "integrity": "sha512-F6+WgncZi/mJDrammbTuHe1q0R5hOXv/mBaiNA2TCNT/LTHusX0V+CJnj9XT8ki5ln2UZyyddDgHfCzyrOH7MQ=="
+    },
+    "node_modules/which-typed-array": {
+      "version": "1.1.11",
+      "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz",
+      "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==",
+      "dev": true,
+      "dependencies": {
+        "available-typed-arrays": "^1.0.5",
+        "call-bind": "^1.0.2",
+        "for-each": "^0.3.3",
+        "gopd": "^1.0.1",
+        "has-tostringtag": "^1.0.0"
+      },
+      "engines": {
+        "node": ">= 0.4"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/ljharb"
+      }
+    },
+    "node_modules/word-wrap": {
+      "version": "1.2.5",
+      "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
+      "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/wrap-ansi": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz",
+      "integrity": "sha512-vAaEaDM946gbNpH5pLVNR+vX2ht6n0Bt3GXwVB1AuAqZosOvHNF3P7wDnh8KLkSqgUh0uh77le7Owgoz+Z9XBw==",
+      "dependencies": {
+        "string-width": "^1.0.1",
+        "strip-ansi": "^3.0.1"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/wrap-ansi/node_modules/ansi-regex": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+      "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
+      "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==",
+      "dependencies": {
+        "number-is-nan": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/wrap-ansi/node_modules/string-width": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
+      "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==",
+      "dependencies": {
+        "code-point-at": "^1.0.0",
+        "is-fullwidth-code-point": "^1.0.0",
+        "strip-ansi": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/wrap-ansi/node_modules/strip-ansi": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+      "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==",
+      "dependencies": {
+        "ansi-regex": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/wrappy": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
+      "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==",
+      "dev": true
+    },
+    "node_modules/write": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz",
+      "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==",
+      "dev": true,
+      "dependencies": {
+        "mkdirp": "^0.5.1"
+      },
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/write-file-atomic": {
+      "version": "2.4.1",
+      "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.1.tgz",
+      "integrity": "sha512-TGHFeZEZMnv+gBFRfjAcxL5bPHrsGKtnb4qsFAws7/vlh+QfwAaySIw4AXP9ZskTTh5GWu3FLuJhsWVdiJPGvg==",
+      "dev": true,
+      "dependencies": {
+        "graceful-fs": "^4.1.11",
+        "imurmurhash": "^0.1.4",
+        "signal-exit": "^3.0.2"
+      }
+    },
+    "node_modules/ws": {
+      "version": "5.2.3",
+      "resolved": "https://registry.npmjs.org/ws/-/ws-5.2.3.tgz",
+      "integrity": "sha512-jZArVERrMsKUatIdnLzqvcfydI85dvd/Fp1u/VOpfdDWQ4c9qWXe+VIeAbQ5FrDwciAkr+lzofXLz3Kuf26AOA==",
+      "dev": true,
+      "dependencies": {
+        "async-limiter": "~1.0.0"
+      }
+    },
+    "node_modules/xml-name-validator": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz",
+      "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==",
+      "dev": true
+    },
+    "node_modules/xtend": {
+      "version": "4.0.2",
+      "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
+      "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==",
+      "dev": true,
+      "engines": {
+        "node": ">=0.4"
+      }
+    },
+    "node_modules/y18n": {
+      "version": "3.2.2",
+      "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.2.tgz",
+      "integrity": "sha512-uGZHXkHnhF0XeeAPgnKfPv1bgKAYyVvmNL1xlKsPYZPaIHxGti2hHqvOCQv71XMsLxu1QjergkqogUnms5D3YQ=="
+    },
+    "node_modules/yallist": {
+      "version": "3.1.1",
+      "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
+      "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
+      "dev": true
+    },
+    "node_modules/yargs": {
+      "version": "6.6.0",
+      "resolved": "https://registry.npmjs.org/yargs/-/yargs-6.6.0.tgz",
+      "integrity": "sha512-6/QWTdisjnu5UHUzQGst+UOEuEVwIzFVGBjq3jMTFNs5WJQsH/X6nMURSaScIdF5txylr1Ao9bvbWiKi2yXbwA==",
+      "dependencies": {
+        "camelcase": "^3.0.0",
+        "cliui": "^3.2.0",
+        "decamelize": "^1.1.1",
+        "get-caller-file": "^1.0.1",
+        "os-locale": "^1.4.0",
+        "read-pkg-up": "^1.0.1",
+        "require-directory": "^2.1.1",
+        "require-main-filename": "^1.0.1",
+        "set-blocking": "^2.0.0",
+        "string-width": "^1.0.2",
+        "which-module": "^1.0.0",
+        "y18n": "^3.2.1",
+        "yargs-parser": "^4.2.0"
+      }
+    },
+    "node_modules/yargs-parser": {
+      "version": "10.1.0",
+      "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz",
+      "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==",
+      "dev": true,
+      "dependencies": {
+        "camelcase": "^4.1.0"
+      }
+    },
+    "node_modules/yargs-parser/node_modules/camelcase": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz",
+      "integrity": "sha512-FxAv7HpHrXbh3aPo4o2qxHay2lkLY3x5Mw3KeE4KQE8ysVfziWeRZDwcjauvwBSGEC/nXUPzZy8zeh4HokqOnw==",
+      "dev": true,
+      "engines": {
+        "node": ">=4"
+      }
+    },
+    "node_modules/yargs/node_modules/ansi-regex": {
+      "version": "2.1.1",
+      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
+      "integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/yargs/node_modules/camelcase": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz",
+      "integrity": "sha512-4nhGqUkc4BqbBBB4Q6zLuD7lzzrHYrjKGeYaEji/3tFR5VdJu9v+LilhGIVe8wxEJPPOeWo7eg8dwY13TZ1BNg==",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/yargs/node_modules/find-up": {
+      "version": "1.1.2",
+      "resolved": "https://registry.npmjs.org/find-up/-/find-up-1.1.2.tgz",
+      "integrity": "sha512-jvElSjyuo4EMQGoTwo1uJU5pQMwTW5lS1x05zzfJuTIyLR3zwO27LYrxNg+dlvKpGOuGy/MzBdXh80g0ve5+HA==",
+      "dependencies": {
+        "path-exists": "^2.0.0",
+        "pinkie-promise": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/yargs/node_modules/is-fullwidth-code-point": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
+      "integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==",
+      "dependencies": {
+        "number-is-nan": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/yargs/node_modules/load-json-file": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-1.1.0.tgz",
+      "integrity": "sha512-cy7ZdNRXdablkXYNI049pthVeXFurRyb9+hA/dZzerZ0pGTx42z+y+ssxBaVV2l70t1muq5IdKhn4UtcoGUY9A==",
+      "dependencies": {
+        "graceful-fs": "^4.1.2",
+        "parse-json": "^2.2.0",
+        "pify": "^2.0.0",
+        "pinkie-promise": "^2.0.0",
+        "strip-bom": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/yargs/node_modules/parse-json": {
+      "version": "2.2.0",
+      "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz",
+      "integrity": "sha512-QR/GGaKCkhwk1ePQNYDRKYZ3mwU9ypsKhB0XyFnLQdomyEqk3e8wpW3V5Jp88zbxK4n5ST1nqo+g9juTpownhQ==",
+      "dependencies": {
+        "error-ex": "^1.2.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/yargs/node_modules/path-exists": {
+      "version": "2.1.0",
+      "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-2.1.0.tgz",
+      "integrity": "sha512-yTltuKuhtNeFJKa1PiRzfLAU5182q1y4Eb4XCJ3PBqyzEDkAZRzBrKKBct682ls9reBVHf9udYLN5Nd+K1B9BQ==",
+      "dependencies": {
+        "pinkie-promise": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/yargs/node_modules/path-type": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/path-type/-/path-type-1.1.0.tgz",
+      "integrity": "sha512-S4eENJz1pkiQn9Znv33Q+deTOKmbl+jj1Fl+qiP/vYezj+S8x+J3Uo0ISrx/QoEvIlOaDWJhPaRd1flJ9HXZqg==",
+      "dependencies": {
+        "graceful-fs": "^4.1.2",
+        "pify": "^2.0.0",
+        "pinkie-promise": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/yargs/node_modules/pify": {
+      "version": "2.3.0",
+      "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz",
+      "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==",
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/yargs/node_modules/read-pkg": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz",
+      "integrity": "sha512-7BGwRHqt4s/uVbuyoeejRn4YmFnYZiFl4AuaeXHlgZf3sONF0SOGlxs2Pw8g6hCKupo08RafIO5YXFNOKTfwsQ==",
+      "dependencies": {
+        "load-json-file": "^1.0.0",
+        "normalize-package-data": "^2.3.2",
+        "path-type": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/yargs/node_modules/read-pkg-up": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz",
+      "integrity": "sha512-WD9MTlNtI55IwYUS27iHh9tK3YoIVhxis8yKhLpTqWtml739uXc9NWTpxoHkfZf3+DkCCsXox94/VWZniuZm6A==",
+      "dependencies": {
+        "find-up": "^1.0.0",
+        "read-pkg": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/yargs/node_modules/require-main-filename": {
+      "version": "1.0.1",
+      "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz",
+      "integrity": "sha512-IqSUtOVP4ksd1C/ej5zeEh/BIP2ajqpn8c5x+q99gvcIG/Qf0cud5raVnE/Dwd0ua9TXYDoDc0RE5hBSdz22Ug=="
+    },
+    "node_modules/yargs/node_modules/string-width": {
+      "version": "1.0.2",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
+      "integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==",
+      "dependencies": {
+        "code-point-at": "^1.0.0",
+        "is-fullwidth-code-point": "^1.0.0",
+        "strip-ansi": "^3.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/yargs/node_modules/strip-ansi": {
+      "version": "3.0.1",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
+      "integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==",
+      "dependencies": {
+        "ansi-regex": "^2.0.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/yargs/node_modules/strip-bom": {
+      "version": "2.0.0",
+      "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-2.0.0.tgz",
+      "integrity": "sha512-kwrX1y7czp1E69n2ajbG65mIo9dqvJ+8aBQXOGVxqwvNbsXdFM6Lq37dLAY3mknUwru8CfcCbfOLL/gMo+fi3g==",
+      "dependencies": {
+        "is-utf8": "^0.2.0"
+      },
+      "engines": {
+        "node": ">=0.10.0"
+      }
+    },
+    "node_modules/yargs/node_modules/yargs-parser": {
+      "version": "4.2.1",
+      "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-4.2.1.tgz",
+      "integrity": "sha512-+QQWqC2xeL0N5/TE+TY6OGEqyNRM+g2/r712PDNYgiCdXYCApXf1vzfmDSLBxfGRwV+moTq/V8FnMI24JCm2Yg==",
+      "dependencies": {
+        "camelcase": "^3.0.0"
+      }
+    }
+  }
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/netlistsvg/test.v b/nixpkgs/pkgs/applications/science/logic/netlistsvg/test.v
new file mode 100644
index 000000000000..940543ae0e67
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/netlistsvg/test.v
@@ -0,0 +1,7 @@
+module helloworld (
+    input wire[7:0] a,
+    input wire[7:0] b,
+    output wire[7:0] c,
+);
+    assign c = a + b;
+endmodule
diff --git a/nixpkgs/pkgs/applications/science/logic/nuXmv/default.nix b/nixpkgs/pkgs/applications/science/logic/nuXmv/default.nix
new file mode 100644
index 000000000000..ad40902e9280
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/nuXmv/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, gmp, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "nuXmv";
+  version = "2.0.0";
+
+  src = fetchurl {
+    url = "https://es-static.fbk.eu/tools/nuxmv/downloads/nuXmv-${version}-${if stdenv.isDarwin then "macosx64" else "linux64"}.tar.gz";
+    sha256 = if stdenv.isDarwin
+             then "sha256-48I+FhJUUam1nMCMMM47CwGO82BYsNz0eHDHXBfqO2E="
+             else "sha256-Gf+QgAjTrysZj7qTtt1wcQPganDtO0YtRY4ykhLPzVo=";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = lib.optionals stdenv.isDarwin [ gmp ];
+  installPhase= ''
+    runHook preInstall
+    install -Dm755 -t $out/bin ./bin/nuXmv
+    runHook postInstall
+  '';
+
+  postFixup = lib.optionalString stdenv.isDarwin ''
+    wrapProgram $out/bin/nuXmv --prefix DYLD_LIBRARY_PATH : ${gmp}/lib
+  '';
+
+  meta = with lib; {
+    description = "Symbolic model checker for analysis of finite and infinite state systems";
+    homepage = "https://nuxmv.fbk.eu/pmwiki.php";
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    license = licenses.unfree;
+    maintainers = with maintainers; [ siraben ];
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/nusmv/default.nix b/nixpkgs/pkgs/applications/science/logic/nusmv/default.nix
new file mode 100644
index 000000000000..d3e3dc998cc0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/nusmv/default.nix
@@ -0,0 +1,37 @@
+{ stdenv
+, lib
+, fetchurl
+, autoPatchelfHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "NuSMV";
+  version = "2.6.0";
+
+  src = with stdenv; fetchurl (
+    if isx86_64 && isLinux then {
+      url = "https://nusmv.fbk.eu/distrib/NuSMV-${version}-linux64.tar.gz";
+      sha256 = "1370x2vwjndv9ham5q399nn84hvhm1gj1k7pq576qmh4pi12xc8i";
+    } else if isx86_32 && isLinux then {
+      url = "https://nusmv.fbk.eu/distrib/NuSMV-${version}-linux32.tar.gz";
+      sha256 = "1qf41czwbqxlrmv0rv2daxgz2hljza5xks85sx3dhwpjy2iav9jb";
+    } else throw "only linux x86_64 and x86_32 are currently supported") ;
+
+
+  nativeBuildInputs = [ autoPatchelfHook ];
+
+  installPhase = ''
+    install -m755 -D bin/NuSMV $out/bin/NuSMV
+    install -m755 -D bin/ltl2smv $out/bin/ltl2smv
+    cp -r include $out/include
+    cp -r share $out/share
+  '';
+
+  meta = with lib; {
+    description = "A new symbolic model checker for the analysis of synchronous finite-state and infinite-state systems";
+    homepage = "https://nuxmv.fbk.eu/pmwiki.php";
+    maintainers = with maintainers; [ mgttlinger ];
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/open-wbo/default.nix b/nixpkgs/pkgs/applications/science/logic/open-wbo/default.nix
new file mode 100644
index 000000000000..2290ff29224b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/open-wbo/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, zlib, gmp }:
+
+stdenv.mkDerivation {
+  pname = "open-wbo";
+  version = "2.0";
+
+  src = fetchFromGitHub {
+    owner = "sat-group";
+    repo = "open-wbo";
+    rev = "f193a3bd802551b13d6424bc1baba6ad35ec6ba6";
+    sha256 = "1742i15qfsbf49c4r837wz35c1p7yafvz7ar6vmgcj6cmfwr8jb4";
+  };
+
+  buildInputs = [ zlib gmp ];
+
+  makeFlags = [ "r" ];
+  installPhase = ''
+    install -Dm0755 open-wbo_release $out/bin/open-wbo
+  '';
+
+  meta = with lib; {
+    broken = (stdenv.isLinux && stdenv.isAarch64);
+    description = "State-of-the-art MaxSAT and Pseudo-Boolean solver";
+    mainProgram = "open-wbo";
+    maintainers = with maintainers; [ gebner ];
+    platforms = platforms.unix;
+    license = licenses.mit;
+    homepage = "http://sat.inesc-id.pt/open-wbo/";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/opensmt/default.nix b/nixpkgs/pkgs/applications/science/logic/opensmt/default.nix
new file mode 100644
index 000000000000..4a5f453f3547
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/opensmt/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, lib, fetchFromGitHub
+, cmake, libedit, gmpxx, bison, flex
+, enableReadline ? false, readline
+, gtest
+}:
+
+stdenv.mkDerivation rec {
+  pname = "opensmt";
+  version = "2.6.0";
+
+  src = fetchFromGitHub {
+    owner = "usi-verification-and-security";
+    repo = "opensmt";
+    rev = "v${version}";
+    sha256 = "sha256-glIiyPSkLG7sGYw5ujfl47GuDuPIPdP+UybA1vSn0Uw=";
+  };
+
+  nativeBuildInputs = [ cmake bison flex ];
+  buildInputs = [ libedit gmpxx ]
+    ++ lib.optional enableReadline readline;
+
+  preConfigure = ''
+    substituteInPlace test/CMakeLists.txt \
+      --replace 'FetchContent_Populate' '#FetchContent_Populate'
+  '';
+  cmakeFlags = [
+    "-Dgoogletest_SOURCE_DIR=${gtest.src}"
+    "-Dgoogletest_BINARY_DIR=./gtest-build"
+  ];
+
+  meta = with lib; {
+    broken = (stdenv.isLinux && stdenv.isAarch64);
+    description = "A satisfiability modulo theory (SMT) solver";
+    mainProgram = "opensmt";
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.linux;
+    license = if enableReadline then licenses.gpl2Plus else licenses.mit;
+    homepage = "https://github.com/usi-verification-and-security/opensmt";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/ott/default.nix b/nixpkgs/pkgs/applications/science/logic/ott/default.nix
new file mode 100644
index 000000000000..b8197aaa4123
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/ott/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, ocamlPackages, opaline }:
+
+stdenv.mkDerivation rec {
+  pname = "ott";
+  version = "0.33";
+
+  src = fetchFromGitHub {
+    owner = "ott-lang";
+    repo = "ott";
+    rev = version;
+    hash = "sha256-GzeEiok5kigcmfqf/K/UxvlKkl55zy0vOyiRZ2HyMiE=";
+  };
+
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ pkg-config opaline ] ++ (with ocamlPackages; [ findlib ocaml ]);
+  buildInputs = with ocamlPackages; [ ocamlgraph ];
+
+  installTargets = "ott.install";
+
+  postInstall = ''
+    opaline -prefix $out
+  ''
+  # There is `emacsPackages.ott-mode` for this now.
+  + ''
+    rm -r $out/share/emacs
+  '';
+
+  meta = {
+    description = "A tool for the working semanticist";
+    mainProgram = "ott";
+    longDescription = ''
+      Ott is a tool for writing definitions of programming languages and
+      calculi. It takes as input a definition of a language syntax and
+      semantics, in a concise and readable ASCII notation that is close to
+      what one would write in informal mathematics. It generates LaTeX to
+      build a typeset version of the definition, and Coq, HOL, and Isabelle
+      versions of the definition. Additionally, it can be run as a filter,
+      taking a LaTeX/Coq/Isabelle/HOL source file with embedded (symbolic)
+      terms of the defined language, parsing them and replacing them by
+      target-system terms.
+    '';
+    homepage = "http://www.cl.cam.ac.uk/~pes20/ott";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ jwiegley ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/petrinizer/default.nix b/nixpkgs/pkgs/applications/science/logic/petrinizer/default.nix
new file mode 100644
index 000000000000..9fd20e3ed4af
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/petrinizer/default.nix
@@ -0,0 +1,31 @@
+{ mkDerivation
+, async, base, bytestring, containers, fetchFromGitLab, mtl
+, parallel-io, parsec, lib, stm, transformers, sbv_7_13}:
+
+mkDerivation rec {
+  pname = "petrinizer";
+  version = "0.9.1.1";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.lrz.de";
+    owner = "i7";
+    repo = pname;
+    rev = version;
+    sha256 = "1n7fzm96gq5rxm2f8w8sr1yzm1zcxpf0b473c6xnhsgqsis5j4xw";
+  };
+
+  isLibrary = false;
+  isExecutable = true;
+  executableHaskellDepends = [
+    async base bytestring containers mtl parallel-io parsec sbv_7_13 stm
+    transformers
+  ];
+  description = "Safety and Liveness Analysis of Petri Nets with SMT solvers";
+  license = lib.licenses.gpl3;
+  maintainers = with lib.maintainers; [ raskin ];
+  inherit (sbv_7_13.meta) platforms;
+
+  # dependency sbv no longer builds
+  hydraPlatforms = lib.platforms.none;
+  broken = true;
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/picosat/default.nix b/nixpkgs/pkgs/applications/science/logic/picosat/default.nix
new file mode 100644
index 000000000000..1fef05069a69
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/picosat/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "picosat";
+  version = "965";
+
+  src = fetchurl {
+    url = "https://fmv.jku.at/picosat/${pname}-${version}.tar.gz";
+    sha256 = "0m578rpa5rdn08d10kr4lbsdwp4402hpavrz6n7n53xs517rn5hm";
+  };
+
+  prePatch = ''
+    substituteInPlace picosat.c --replace "sys/unistd.h" "unistd.h"
+
+    substituteInPlace makefile.in \
+      --replace 'ar rc' '$(AR) rc' \
+      --replace 'ranlib' '$(RANLIB)'
+  '';
+
+  configurePhase = "./configure.sh --shared --trace";
+
+  makeFlags = lib.optional stdenv.isDarwin
+    "SONAME=-Wl,-install_name,$(out)/lib/libpicosat.so";
+
+  installPhase = ''
+   mkdir -p $out/bin $out/lib $out/share $out/include/picosat
+   cp picomus picomcs picosat picogcnf "$out"/bin
+
+   cp VERSION      "$out"/share/picosat.version
+   cp picosat.o    "$out"/lib
+   cp libpicosat.a "$out"/lib
+   cp libpicosat.so "$out"/lib
+
+   cp picosat.h "$out"/include/picosat
+  '';
+
+  meta = {
+    description = "SAT solver with proof and core support";
+    homepage    = "https://fmv.jku.at/picosat/";
+    license     = lib.licenses.mit;
+    platforms   = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ roconnor thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/poly/default.nix b/nixpkgs/pkgs/applications/science/logic/poly/default.nix
new file mode 100644
index 000000000000..e54f822921ca
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/poly/default.nix
@@ -0,0 +1,27 @@
+{lib, stdenv, fetchFromGitHub, gmp, cmake, python3}:
+
+stdenv.mkDerivation rec {
+  pname = "libpoly";
+  version = "0.1.13";
+
+  src = fetchFromGitHub {
+    owner = "SRI-CSL";
+    repo = "libpoly";
+    # they've pushed to the release branch, use explicit tag
+    rev = "refs/tags/v${version}";
+    sha256 = "sha256-7aFz+6XJOVEA/Fmi0ywd6rZdTW8sHq8MoHqXR0Hc2o4=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ gmp python3 ];
+
+  strictDeps = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/SRI-CSL/libpoly";
+    description = "C library for manipulating polynomials";
+    license = licenses.lgpl3;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/potassco/clingcon.nix b/nixpkgs/pkgs/applications/science/logic/potassco/clingcon.nix
new file mode 100644
index 000000000000..957ebfd3ec43
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/potassco/clingcon.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, clingo
+, catch2
+}:
+
+stdenv.mkDerivation rec {
+  pname = "clingcon";
+  version = "5.2.1";
+
+  src = fetchFromGitHub {
+    owner = "potassco";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-R2kgcw8VUwhOdvPXnsahT5gnoUd5DXLqfdH++8rFoAA=";
+   };
+
+  postPatch = ''
+    cp ${catch2}/include/catch2/catch.hpp libclingcon/tests/catch.hpp
+  '';
+
+  nativeBuildInputs = [ cmake clingo ];
+
+  cmakeFlags = [
+    "-DCLINGCON_MANAGE_RPATH=ON"
+    "-DPYCLINGCON_ENABLE=OFF"
+    "-DCLINGCON_BUILD_TESTS=ON"
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Extension of clingo to handle constraints over integers";
+    mainProgram = "clingcon";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
+    homepage = "https://potassco.org/";
+    downloadPage = "https://github.com/potassco/clingcon/releases/";
+    changelog = "https://github.com/potassco/clingcon/releases/tag/v${version}";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/potassco/clingo.nix b/nixpkgs/pkgs/applications/science/logic/potassco/clingo.nix
new file mode 100644
index 000000000000..ad3af12429a2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/potassco/clingo.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "clingo";
+  version = "5.7.1";
+
+  src = fetchFromGitHub {
+    owner = "potassco";
+    repo = "clingo";
+    rev = "v${version}";
+    sha256 = "sha256-S0JAfMwg49aryKABbC/2oLCEkndVpMVcFE6X0vkbtNc=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [ "-DCLINGO_BUILD_WITH_PYTHON=OFF" ];
+
+  meta = {
+    description = "ASP system to ground and solve logic programs";
+    license = lib.licenses.mit;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
+    homepage = "https://potassco.org/";
+    downloadPage = "https://github.com/potassco/clingo/releases/";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/prooftree/default.nix b/nixpkgs/pkgs/applications/science/logic/prooftree/default.nix
new file mode 100644
index 000000000000..adb64f02c14f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/prooftree/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchurl, pkg-config, ncurses, ocamlPackages }:
+
+stdenv.mkDerivation rec {
+  pname = "prooftree";
+  version = "0.13";
+
+  src = fetchurl {
+    url = "https://askra.de/software/prooftree/releases/prooftree-${version}.tar.gz";
+    sha256 = "0z1z4wqbqwgppkh2bm89fgy07a0y2m6g4lvcyzs09sm1ysklk2dh";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ pkg-config ] ++ (with ocamlPackages; [ ocaml findlib camlp5 ]);
+  buildInputs = [ ncurses ] ++ (with ocamlPackages; [ lablgtk ]);
+
+  dontAddPrefix = true;
+  configureFlags = [ "--prefix" "$(out)" ];
+
+  meta = with lib; {
+    description = "A program for proof-tree visualization";
+    mainProgram = "prooftree";
+    longDescription = ''
+      Prooftree is a program for proof-tree visualization during interactive
+      proof development in a theorem prover. It is currently being developed
+      for Coq and Proof General. Prooftree helps against getting lost between
+      different subgoals in interactive proof development. It clearly shows
+      where the current subgoal comes from and thus helps in developing the
+      right plan for solving it.
+
+      Prooftree uses different colors for the already proven subgoals, the
+      current branch in the proof and the still open subgoals. Sequent texts
+      are not displayed in the proof tree itself, but they are shown as a
+      tool-tip when the mouse rests over a sequent symbol. Long proof commands
+      are abbreviated in the tree display, but show up in full length as
+      tool-tip. Both, sequents and proof commands, can be shown in the display
+      below the tree (on single click) or in a separate window (on double or
+      shift-click).
+    '';
+    homepage = "http://askra.de/software/prooftree";
+    platforms = platforms.unix;
+    maintainers = [ maintainers.jwiegley ];
+    license = licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/prover9/default.nix b/nixpkgs/pkgs/applications/science/logic/prover9/default.nix
new file mode 100644
index 000000000000..5c476be06e4e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/prover9/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  pname = "prover9";
+  version = "2009-11a";
+
+  src = fetchurl {
+    url = "https://www.cs.unm.edu/~mccune/mace4/download/LADR-2009-11A.tar.gz";
+    sha256 = "1l2i3d3h5z7nnbzilb6z92r0rbx0kh6yaxn2c5qhn3000xcfsay3";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  postPatch = ''
+    RM=$(type -tp rm)
+    MV=$(type -tp mv)
+    CP=$(type -tp cp)
+    for f in Makefile */Makefile; do
+      substituteInPlace $f --replace "/bin/rm" "$RM" \
+        --replace "/bin/mv" "$MV" \
+        --replace "/bin/cp" "$CP";
+    done
+  '';
+
+  buildFlags = [ "all" ];
+
+  checkPhase = "make test1";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp bin/* $out/bin
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.cs.unm.edu/~mccune/mace4/";
+    license = licenses.gpl2Only;
+    description = "Automated theorem prover for first-order and equational logic";
+    longDescription = ''
+      Prover9 is a resolution/paramodulation automated theorem prover
+      for first-order and equational logic. Prover9 is a successor of
+      the Otter Prover. This is the LADR command-line version.
+    '';
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/proverif/default.nix b/nixpkgs/pkgs/applications/science/logic/proverif/default.nix
new file mode 100644
index 000000000000..5cd0e5ff9e39
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/proverif/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, ocamlPackages }:
+
+stdenv.mkDerivation rec {
+  pname = "proverif";
+  version = "2.05";
+
+  src = fetchurl {
+    url    = "https://bblanche.gitlabpages.inria.fr/proverif/proverif${version}.tar.gz";
+    hash = "sha256-SHH1PDKrSgRmmgYMSIa6XZCASWlj+5gKmmLSxCnOq8Q=";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = with ocamlPackages; [ ocaml findlib ];
+
+  buildPhase = "./build -nointeract";
+  installPhase = ''
+    runHook preInstall
+    install -D -t $out/bin proverif proveriftotex
+    install -D -t $out/share/emacs/site-lisp/ emacs/proverif.el
+    runHook postInstall
+  '';
+
+  meta = {
+    description = "Cryptographic protocol verifier in the formal model";
+    homepage    = "https://bblanche.gitlabpages.inria.fr/proverif/";
+    license     = lib.licenses.gpl2;
+    platforms   = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ thoughtpolice vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/redprl/default.nix b/nixpkgs/pkgs/applications/science/logic/redprl/default.nix
new file mode 100644
index 000000000000..2749730f9d66
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/redprl/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, mlton }:
+
+stdenv.mkDerivation {
+  pname = "redprl";
+  version = "unstable-2019-11-04";
+
+  src = fetchFromGitHub {
+    owner = "RedPRL";
+    repo = "sml-redprl";
+    rev = "c72190de76f7ed1cfbe1d2046c96e99ac5022b0c";
+    fetchSubmodules = true;
+    sha256 = "sha256-xrQT5o0bsIN+mCYUOz9iY4+j3HGROb1I6R2ADcLy8n4=";
+  };
+
+  buildInputs = [ mlton ];
+
+  postPatch = ''
+    patchShebangs ./script/
+  '';
+
+  buildPhase = ''
+    ./script/mlton.sh
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mv ./bin/redprl $out/bin
+  '';
+
+  meta = with lib; {
+    description = "A proof assistant for Nominal Computational Type Theory";
+    mainProgram = "redprl";
+    homepage = "http://www.redprl.org/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ acowley ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/satallax/default.nix b/nixpkgs/pkgs/applications/science/logic/satallax/default.nix
new file mode 100644
index 000000000000..bd3e9d3e8351
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/satallax/default.nix
@@ -0,0 +1,90 @@
+{ lib, stdenv, fetchurl, ocaml, zlib, which, eprover, makeWrapper, coq }:
+stdenv.mkDerivation rec {
+  pname = "satallax";
+  version = "2.7";
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ makeWrapper ocaml which eprover coq ];
+  buildInputs = [ zlib ];
+
+  src = fetchurl {
+    url = "https://www.ps.uni-saarland.de/~cebrown/satallax/downloads/${pname}-${version}.tar.gz";
+    sha256 = "1kvxn8mc35igk4vigi5cp7w3wpxk2z3bgwllfm4n3h2jfs0vkpib";
+  };
+
+  patches = [
+    # GCC9 doesn't allow default value in friend declaration.
+    ./fix-declaration-gcc9.patch
+  ];
+
+  prePatch = ''
+    patch -p1 -i ${../avy/minisat-fenv.patch} -d minisat
+  '';
+
+  preConfigure = ''
+    mkdir fake-tools
+    echo "echo 'Nix-build-host.localdomain'" > fake-tools/hostname
+    chmod a+x fake-tools/hostname
+    export PATH="$PATH:$PWD/fake-tools"
+
+    (
+      cd picosat-*
+      ./configure
+      make
+    )
+    export PATH="$PATH:$PWD/libexec/satallax"
+
+    mkdir -p "$out/libexec/satallax"
+    cp picosat-*/picosat picosat-*/picomus "$out/libexec/satallax"
+
+    (
+      cd minisat
+      export MROOT=$PWD
+      cd core
+      make
+      cd ../simp
+      make
+    )
+  '';
+
+  # error: invalid suffix on literal; C++11 requires a space between literal and identifier
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-reserved-user-defined-literal";
+
+  installPhase = ''
+    mkdir -p "$out/share/doc/satallax" "$out/bin" "$out/lib" "$out/lib/satallax"
+    cp bin/satallax.opt "$out/bin/satallax"
+    wrapProgram "$out/bin/satallax" \
+      --suffix PATH : "${lib.makeBinPath [ coq eprover ]}:$out/libexec/satallax" \
+      --add-flags "-M" --add-flags "$out/lib/satallax/modes"
+
+    cp LICENSE README "$out/share/doc/satallax"
+
+    cp bin/*.so "$out/lib"
+
+    cp -r modes "$out/lib/satallax/"
+    cp -r problems "$out/lib/satallax/"
+    cp -r coq* "$out/lib/satallax/"
+  '';
+
+  doCheck = stdenv.isLinux;
+
+  checkPhase = ''
+    runHook preCheck
+    if bash ./test | grep ERROR; then
+      echo "Tests failed"
+      exit 1
+    fi
+    runHook postCheck
+  '';
+
+  meta = {
+    description = "Automated theorem prover for higher-order logic";
+    mainProgram = "satallax";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.raskin ];
+    platforms = lib.platforms.unix;
+    downloadPage = "http://www.ps.uni-saarland.de/~cebrown/satallax/downloads.php";
+    homepage = "http://www.ps.uni-saarland.de/~cebrown/satallax/index.php";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/satallax/fix-declaration-gcc9.patch b/nixpkgs/pkgs/applications/science/logic/satallax/fix-declaration-gcc9.patch
new file mode 100644
index 000000000000..1933fc25c4da
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/satallax/fix-declaration-gcc9.patch
@@ -0,0 +1,21 @@
+diff --git i/minisat/core/SolverTypes.h w/minisat/core/SolverTypes.h
+--- i/minisat/core/SolverTypes.h
++++ w/minisat/core/SolverTypes.h
+@@ -47,7 +47,7 @@ struct Lit {
+     int     x;
+ 
+     // Use this as a constructor:
+-    friend Lit mkLit(Var var, bool sign = false);
++    friend Lit mkLit(Var var, bool sign);
+ 
+     bool operator == (Lit p) const { return x == p.x; }
+     bool operator != (Lit p) const { return x != p.x; }
+@@ -55,7 +55,7 @@ struct Lit {
+ };
+ 
+ 
+-inline  Lit  mkLit     (Var var, bool sign) { Lit p; p.x = var + var + (int)sign; return p; }
++inline  Lit  mkLit     (Var var, bool sign = false) { Lit p; p.x = var + var + (int)sign; return p; }
+ inline  Lit  operator ~(Lit p)              { Lit q; q.x = p.x ^ 1; return q; }
+ inline  Lit  operator ^(Lit p, bool b)      { Lit q; q.x = p.x ^ (unsigned int)b; return q; }
+ inline  bool sign      (Lit p)              { return p.x & 1; }
diff --git a/nixpkgs/pkgs/applications/science/logic/saw-tools/default.nix b/nixpkgs/pkgs/applications/science/logic/saw-tools/default.nix
new file mode 100644
index 000000000000..b6291bfae369
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/saw-tools/default.nix
@@ -0,0 +1,59 @@
+{ lib, stdenv, fetchurl, gmp4, ncurses, zlib, clang }:
+
+let
+  libPath = lib.makeLibraryPath
+    [ stdenv.cc.libc
+      stdenv.cc.cc
+      gmp4
+      ncurses
+      zlib
+    ] + ":${stdenv.cc.cc.lib}/lib64";
+
+  url = "https://github.com/GaloisInc/saw-script/releases/download";
+
+  saw-bin =
+    if stdenv.hostPlatform.system == "i686-linux"
+    then fetchurl {
+      url    = url + "/v0.1.1-dev/saw-0.1.1-dev-2015-07-31-CentOS6-32.tar.gz";
+      sha256 = "126iag5nnvndi78c921z7vjrjfwcspn1hlxwwhzmqm4rvbhhr9v9";
+    }
+    else fetchurl {
+      url    = url + "/v0.1.1-dev/saw-0.1.1-dev-2015-07-31-CentOS6-64.tar.gz";
+      sha256 = "07gyf319v6ama6n1aj96403as04bixi8mbisfy7f7va689zklflr";
+    };
+in
+stdenv.mkDerivation {
+  pname = "saw-tools";
+  version = "0.1.1-20150731";
+
+  src = saw-bin;
+
+  installPhase = ''
+    mkdir -p $out/lib $out/share
+
+    mv bin $out/bin
+    mv doc $out/share
+
+    ln -s ${ncurses.out}/lib/libtinfo.so.5       $out/lib/libtinfo.so.5
+    ln -s ${stdenv.cc.libc}/lib/libpthread.so.0 $out/lib/libpthread.so.0
+
+    # Add a clang symlink for easy building with a suitable compiler.
+    ln -s ${clang}/bin/clang $out/bin/saw-clang
+  '';
+
+  fixupPhase = ''
+    for x in bin/bcdump bin/extcore-info bin/jss bin/llvm-disasm bin/lss bin/saw; do
+      patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+        --set-rpath "$out/lib:${libPath}" $out/$x;
+    done
+  '';
+
+  meta = {
+    description = "Tools for software verification and analysis";
+    homepage    = "https://saw.galois.com";
+    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
+    license     = lib.licenses.bsd3;
+    platforms   = lib.platforms.linux;
+    maintainers = [ lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/sharpsat-td/default.nix b/nixpkgs/pkgs/applications/science/logic/sharpsat-td/default.nix
new file mode 100644
index 000000000000..2f2128d542f1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/sharpsat-td/default.nix
@@ -0,0 +1,83 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchzip
+, cmake
+, gmp
+, mpfr
+}:
+
+let
+  satlib-bmc = fetchzip {
+    url = "https://www.cs.ubc.ca/~hoos/SATLIB/Benchmarks/SAT/BMC/bmc.tar.gz";
+    stripRoot = false;
+    sha256 = "sha256-F1Jfrj4iMMf/3LFCShIDMs4JfLkJ51Z4wkL1FDT9b/A=";
+  };
+
+  # needed for mpfr 4.2.0+ support
+  mpreal = fetchFromGitHub {
+    owner = "advanpix";
+    repo = "mpreal";
+    rev = "mpfrc++-3.6.9";
+    sha256 = "sha256-l61SKEx4pBocADrEGPVacQ6F2ep9IuvNZ8W08dKeZKg=";
+  };
+
+in stdenv.mkDerivation rec {
+  pname = "sharpsat-td";
+  version = "unstable-2021-09-05";
+
+  src = fetchFromGitHub {
+    owner = "Laakeri";
+    repo = pname;
+    rev = "b9bb015305ea5d4e1ac7141691d0fe55ca983d31";
+    sha256 = "sha256-FE+DUd58eRr5w9RFw0fMHfjIiNDWIcG7XbyWJ/pI28U=";
+  };
+
+  postPatch = ''
+    # just say no to bundled binaries
+    rm bin/*
+
+    # ensure resultant build calls its own binaries
+    substituteInPlace src/decomposition.cpp \
+      --replace '"../../../flow-cutter-pace17/flow_cutter_pace17"' '"'"$out"'/bin/flow_cutter_pace17"'
+    substituteInPlace src/preprocessor/treewidth.cpp \
+      --replace '"./flow_cutter_pace17"' '"'"$out"'/bin/flow_cutter_pace17"'
+
+    # replace bundled version of mpreal/mpfrc++
+    rm -r src/mpfr
+    cp -r ${mpreal} src/mpfr
+  '';
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ gmp mpfr ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin
+    install -Dm755 sharpSAT $out/bin/sharpSAT-td
+    install -Dm755 flow_cutter_pace17 $out/bin/flow_cutter_pace17
+
+    runHook postInstall
+  '';
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    runHook preInstallCheck
+
+    # "correct" answer from https://sites.google.com/site/marcthurley/sharpsat/benchmarks/collected-model-counts
+    $out/bin/sharpSAT-td -decot 1 -decow 100 -cs 3500 -tmpdir "$TMPDIR" \
+      ${satlib-bmc}/bmc-ibm-1.cnf | grep -F 'c s exact arb int 7333984412904350856728851870196181665291102236046537207120878033973328441091390427157620940515935993557837912658856672133150412904529478729364681871717139154252602322050981277183916105207406949425074710972297902317183503443350157267211568852295978718386711142950559533715161449971311118966214098944000'
+
+    runHook postInstallCheck
+  '';
+
+  meta = {
+    description = "A fast solver for the #SAT model counting problem";
+    homepage = "https://github.com/Laakeri/sharpsat-td";
+    license = with lib.licenses; [ mit asl20 ];
+    maintainers = with lib.maintainers; [ ris ];
+    # uses clhash, which is non-portable
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/spass/default.nix b/nixpkgs/pkgs/applications/science/logic/spass/default.nix
new file mode 100644
index 000000000000..77b297b4fbbb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/spass/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchurl, bison, flex }:
+
+let
+  baseVersion="3";
+  minorVersion="9";
+
+  extraTools = "FLOTTER prolog2dfg dfg2otter dfg2dimacs dfg2tptp"
+    + " dfg2ascii dfg2dfg tptp2dfg dimacs2dfg pgen rescmp";
+in
+
+stdenv.mkDerivation {
+  pname = "spass";
+  version = "${baseVersion}.${minorVersion}";
+
+  src = fetchurl {
+    url = "http://www.spass-prover.org/download/sources/spass${baseVersion}${minorVersion}.tgz";
+    sha256 = "11cyn3kcff4r79rsw2s0xm6rdb8bi0kpkazv2b48jhcms7xw75qp";
+  };
+
+  sourceRoot = ".";
+
+  nativeBuildInputs = [ bison flex ];
+
+  buildPhase = ''
+    make RM="rm -f" proparser.c ${extraTools} opt
+  '';
+  installPhase = ''
+    mkdir -p $out/bin
+    install -m0755 SPASS ${extraTools} $out/bin/
+  '';
+
+  meta = with lib; {
+    description = "Automated theorem prover for first-order logic";
+    maintainers = with maintainers;
+    [
+      raskin
+    ];
+    platforms = platforms.unix;
+    license = licenses.bsd2;
+    downloadPage = "http://www.spass-prover.org/download/index.html";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/statverif/default.nix b/nixpkgs/pkgs/applications/science/logic/statverif/default.nix
new file mode 100644
index 000000000000..1f6238977551
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/statverif/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, ocaml }:
+
+stdenv.mkDerivation rec {
+  pname = "statverif";
+  version = "1.86pl4";
+
+  src = fetchurl {
+    url    = "http://prosecco.gforge.inria.fr/personal/bblanche/proverif/proverif${version}.tar.gz";
+    sha256 = "163vdcixs764jj8xa08w80qm4kcijf7xj911yp8jvz6pi1q5g13i";
+  };
+
+  pf-patch = fetchurl {
+    url    = "http://markryan.eu/research/statverif/files/proverif-${version}-statverif-2657ab4.patch";
+    sha256 = "113jjhi1qkcggbsmbw8fa9ln8vs7vy2r288szks7rn0jjn0wxmbw";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml ];
+
+  patchPhase = "patch -p1 < ${pf-patch}";
+  buildPhase = "./build";
+  installPhase = ''
+    mkdir -p $out/bin
+    cp ./proverif      $out/bin/statverif
+    cp ./proveriftotex $out/bin/statveriftotex
+  '';
+
+  meta = {
+    description = "Verification of stateful processes (via Proverif)";
+    homepage    = "https://markryan.eu/research/statverif/";
+    license     = lib.licenses.gpl2;
+    platforms   = lib.platforms.unix;
+    maintainers = [ lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/stp/default.nix b/nixpkgs/pkgs/applications/science/logic/stp/default.nix
new file mode 100644
index 000000000000..fb41ea07f5a1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/stp/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, cmake, boost, bison, flex, fetchFromGitHub, perl
+, python3, python3Packages, zlib, minisat, cryptominisat }:
+
+stdenv.mkDerivation rec {
+  pname = "stp";
+  version = "2.3.3";
+
+  src = fetchFromGitHub {
+    owner = "stp";
+    repo = "stp";
+    rev    = version;
+    sha256 = "1yg2v4wmswh1sigk47drwsxyayr472mf4i47lqmlcgn9hhbx1q87";
+  };
+  patches = [
+    # Fix missing type declaration
+    # due to undeterminisitic compilation
+    # of circularly dependent headers
+    ./stdint.patch
+  ];
+
+  postPatch = ''
+    # Upstream fix for gcc-13 support:
+    #   https://github.com/stp/stp/pull/462
+    # Can't apply it as is as patch context changed in ither patches.
+    # TODO: remove me on 2.4 release
+    sed -e '1i #include <cstdint>' -i include/stp/AST/ASTNode.h
+  '';
+
+  buildInputs = [ boost zlib minisat cryptominisat python3 ];
+  nativeBuildInputs = [ cmake bison flex perl ];
+  preConfigure = ''
+    python_install_dir=$out/${python3Packages.python.sitePackages}
+    mkdir -p $python_install_dir
+    cmakeFlagsArray=(
+      $cmakeFlagsArray
+      "-DBUILD_SHARED_LIBS=ON"
+      "-DPYTHON_LIB_INSTALL_DIR=$python_install_dir"
+    )
+  '';
+
+  meta = with lib; {
+    description = "Simple Theorem Prover";
+    maintainers = with maintainers; [ McSinyx ];
+    platforms = platforms.linux;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/stp/stdint.patch b/nixpkgs/pkgs/applications/science/logic/stp/stdint.patch
new file mode 100644
index 000000000000..6595d5561731
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/stp/stdint.patch
@@ -0,0 +1,16 @@
+diff --git a/include/stp/AST/ASTNode.h b/include/stp/AST/ASTNode.h
+index 91acd726182c..0a17db23ffbf 100644
+--- a/include/stp/AST/ASTNode.h
++++ b/include/stp/AST/ASTNode.h
+@@ -24,9 +24,10 @@ THE SOFTWARE.
+ #ifndef ASTNODE_H
+ #define ASTNODE_H
+ 
++#include "stp/AST/ASTInternal.h"
+ #include "stp/AST/NodeFactory/HashingNodeFactory.h"
++#include "stp/AST/UsefulDefs.h"
+ #include "stp/Util/Attributes.h"
+-#include "ASTInternal.h"
+ #include "stp/Globals/Globals.h"
+ 
+ namespace stp
diff --git a/nixpkgs/pkgs/applications/science/logic/surelog/default.nix b/nixpkgs/pkgs/applications/science/logic/surelog/default.nix
new file mode 100644
index 000000000000..3b58331562a2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/surelog/default.nix
@@ -0,0 +1,75 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, python3
+, pkg-config
+, libuuid
+, openjdk
+, gperftools
+, gtest
+, uhdm
+, antlr4
+, capnproto
+, nlohmann_json
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "surelog";
+  version = "1.80";
+
+  src = fetchFromGitHub {
+    owner = "chipsalliance";
+    repo = finalAttrs.pname;
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-jpt/5h0HnkiJowyVDoMSyiuL6/dokB4xg1sdyctHrDs=";
+    fetchSubmodules = false;  # we use all dependencies from nix
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    openjdk
+    (python3.withPackages (p: with p; [
+      psutil
+      orderedmultidict
+    ]))
+    gtest
+    antlr4
+  ];
+
+  buildInputs = [
+    libuuid
+    gperftools
+    uhdm
+    capnproto
+    antlr4.runtime.cpp
+    nlohmann_json
+  ];
+
+  cmakeFlags = [
+    "-DSURELOG_USE_HOST_CAPNP=On"
+    "-DSURELOG_USE_HOST_UHDM=On"
+    "-DSURELOG_USE_HOST_GTEST=On"
+    "-DSURELOG_USE_HOST_ANTLR=On"
+    "-DSURELOG_USE_HOST_JSON=On"
+    "-DANTLR_JAR_LOCATION=${antlr4.jarLocation}"
+  ];
+
+  doCheck = true;
+  checkPhase = ''
+    runHook preCheck
+    make -j $NIX_BUILD_CORES UnitTests
+    ctest --output-on-failure
+    runHook postCheck
+  '';
+
+  meta = {
+    description = "SystemVerilog 2017 Pre-processor, Parser, Elaborator, UHDM Compiler";
+    homepage = "https://github.com/chipsalliance/Surelog";
+    license = lib.licenses.asl20;
+    mainProgram = "surelog";
+    maintainers = with lib.maintainers; [ matthuszagh ];
+    platforms = lib.platforms.all;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/logic/symbiyosys/default.nix b/nixpkgs/pkgs/applications/science/logic/symbiyosys/default.nix
new file mode 100644
index 000000000000..19c021684b3f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/symbiyosys/default.nix
@@ -0,0 +1,62 @@
+{ lib, stdenv, fetchFromGitHub
+, bash, python3, yosys
+, yices, boolector, z3, aiger
+}:
+
+stdenv.mkDerivation {
+  pname = "symbiyosys";
+  version = "2021.11.30";
+
+  src = fetchFromGitHub {
+    owner = "YosysHQ";
+    repo  = "SymbiYosys";
+    rev   = "b409b1179e36d2a3fff66c85b7d4e271769a2d9e";
+    hash  = "sha256-S7of2upntiMkSdh4kf1RsrjriS31Eh8iEcVvG36isQg=";
+  };
+
+  buildInputs = [ ];
+  patchPhase = ''
+    patchShebangs .
+
+    # Fix up Yosys imports
+    substituteInPlace sbysrc/sby.py \
+      --replace "##yosys-sys-path##" \
+                "sys.path += [p + \"/share/yosys/python3/\" for p in [\"$out\", \"${yosys}\"]]"
+
+    # Fix various executable references
+    substituteInPlace sbysrc/sby_core.py \
+      --replace '"/usr/bin/env", "bash"' '"${bash}/bin/bash"' \
+      --replace ', "btormc"'             ', "${boolector}/bin/btormc"' \
+      --replace ', "aigbmc"'             ', "${aiger}/bin/aigbmc"'
+
+    substituteInPlace sbysrc/sby_core.py \
+      --replace '##yosys-program-prefix##' '"${yosys}/bin/"'
+
+    substituteInPlace sbysrc/sby.py \
+      --replace '/usr/bin/env python3' '${python3}/bin/python'
+  '';
+
+  buildPhase = "true";
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/yosys/python3
+
+    cp sbysrc/sby_*.py $out/share/yosys/python3/
+    cp sbysrc/sby.py $out/bin/sby
+
+    chmod +x $out/bin/sby
+  '';
+
+  doCheck = false; # not all provers are yet packaged...
+  nativeCheckInputs = [ python3 yosys boolector yices z3 aiger ];
+  checkPhase = "make test";
+
+  meta = {
+    description = "Tooling for Yosys-based verification flows";
+    homepage    = "https://symbiyosys.readthedocs.io/";
+    license     = lib.licenses.isc;
+    maintainers = with lib.maintainers; [ thoughtpolice emily ];
+    mainProgram = "sby";
+    platforms   = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/symfpu/default.nix b/nixpkgs/pkgs/applications/science/logic/symfpu/default.nix
new file mode 100644
index 000000000000..af61b7c617c7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/symfpu/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "symfpu";
+  version = "unstable-2019-05-17";
+
+  src = fetchFromGitHub {
+    owner  = "martin-cs";
+    repo   = "symfpu";
+    rev    = "8fbe139bf0071cbe0758d2f6690a546c69ff0053";
+    sha256 = "1jf5lkn67q136ppfacw3lsry369v7mdr1rhidzjpbz18jfy9zl9q";
+  };
+
+  installPhase = ''
+    mkdir -p $out/symfpu
+    cp -r * $out/symfpu/
+  '';
+
+  meta = with lib; {
+    description = "A (concrete or symbolic) implementation of IEEE-754 / SMT-LIB floating-point";
+    homepage    = "https://github.com/martin-cs/symfpu";
+    license     = licenses.gpl3Only;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ shadaj ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/tamarin-prover/default.nix b/nixpkgs/pkgs/applications/science/logic/tamarin-prover/default.nix
new file mode 100644
index 000000000000..09ef2d7d4637
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/tamarin-prover/default.nix
@@ -0,0 +1,133 @@
+{ haskellPackages, mkDerivation, fetchFromGitHub, fetchpatch, lib, stdenv
+# the following are non-haskell dependencies
+, makeWrapper, which, maude, graphviz, glibcLocales
+}:
+
+let
+  version = "1.8.0";
+  src = fetchFromGitHub {
+    owner  = "tamarin-prover";
+    repo   = "tamarin-prover";
+    rev    = version;
+    sha256 = "sha256-ujnaUdbjqajmkphOS4Fs4QBCRGX4JZkQ2p1X2jripww=";
+  };
+
+  # tamarin has its own dependencies, but they're kept inside the repo,
+  # no submodules. this factors out the common metadata among all derivations
+  common = pname: src: {
+    inherit pname version src;
+
+    license     = lib.licenses.gpl3;
+    homepage    = "https://tamarin-prover.github.io";
+    description = "Security protocol verification in the symbolic model";
+    maintainers = [ lib.maintainers.thoughtpolice ];
+    hydraPlatforms = lib.platforms.linux; # maude is broken on darwin
+  };
+
+  # tamarin use symlinks to the LICENSE and Setup.hs files, so for these sublibraries
+  # we set the patchPhase to fix that. otherwise, cabal cries a lot.
+  replaceSymlinks = ''
+    cp --remove-destination ${src}/LICENSE .;
+    cp --remove-destination ${src}/Setup.hs .;
+  '';
+
+  tamarin-prover-utils = mkDerivation (common "tamarin-prover-utils" (src + "/lib/utils") // {
+    postPatch = replaceSymlinks;
+    libraryHaskellDepends = with haskellPackages; [
+      base64-bytestring blaze-builder
+      dlist exceptions fclabels safe SHA syb
+    ];
+  });
+
+  tamarin-prover-term = mkDerivation (common "tamarin-prover-term" (src + "/lib/term") // {
+    postPatch = replaceSymlinks;
+    libraryHaskellDepends = (with haskellPackages; [
+      attoparsec HUnit
+    ]) ++ [ tamarin-prover-utils ];
+  });
+
+  tamarin-prover-theory = mkDerivation (common "tamarin-prover-theory" (src + "/lib/theory") // {
+    postPatch = replaceSymlinks;
+    doHaddock = false; # broken
+    libraryHaskellDepends = (with haskellPackages; [
+      aeson aeson-pretty parallel uniplate
+      regex-pcre-builtin regex-posix split
+    ]) ++ [ tamarin-prover-utils tamarin-prover-term ];
+  });
+
+  tamarin-prover-sapic = mkDerivation (common "tamarin-prover-sapic" (src + "/lib/sapic") // {
+    postPatch = "cp --remove-destination ${src}/LICENSE .";
+    doHaddock = false; # broken
+    libraryHaskellDepends = (with haskellPackages; [
+      raw-strings-qq
+    ]) ++ [ tamarin-prover-theory ];
+  });
+
+  tamarin-prover-accountability = mkDerivation (common "tamarin-prover-accountability" (src + "/lib/accountability") // {
+    postPatch = "cp --remove-destination ${src}/LICENSE .";
+    doHaddock = false; # broken
+    libraryHaskellDepends = (with haskellPackages; [
+      raw-strings-qq
+    ]) ++ [
+      tamarin-prover-utils
+      tamarin-prover-term
+      tamarin-prover-theory
+    ];
+  });
+
+  tamarin-prover-export = mkDerivation (common "tamarin-prover-export" (src + "/lib/export") // {
+    postPatch = "cp --remove-destination ${src}/LICENSE .";
+    doHaddock = false; # broken
+    libraryHaskellDepends = (with haskellPackages; [
+      HStringTemplate
+    ]) ++ [
+      tamarin-prover-utils
+      tamarin-prover-term
+      tamarin-prover-theory
+      tamarin-prover-sapic
+    ];
+  });
+
+in
+mkDerivation (common "tamarin-prover" src // {
+  isLibrary = false;
+  isExecutable = true;
+
+  patches = [ ];
+
+  # strip out unneeded deps manually
+  doHaddock = false;
+  enableSharedExecutables = false;
+  postFixup = "rm -rf $out/lib $out/nix-support $out/share/doc";
+
+  # wrap the prover to be sure it can find maude, sapic, etc
+  executableToolDepends = [ makeWrapper which maude graphviz ];
+  postInstall = ''
+    wrapProgram $out/bin/tamarin-prover \
+  '' + lib.optionalString stdenv.isLinux ''
+      --set LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive" \
+  '' + ''
+      --prefix PATH : ${lib.makeBinPath [ which maude graphviz ]}
+    # so that the package can be used as a vim plugin to install syntax coloration
+    install -Dt $out/share/vim-plugins/tamarin-prover/syntax/ etc/syntax/spthy.vim
+    install etc/filetype.vim -D $out/share/vim-plugins/tamarin-prover/ftdetect/tamarin.vim
+    mkdir -p $out/share/nvim
+    ln -s $out/share/vim-plugins/tamarin-prover $out/share/nvim/site
+    # Emacs SPTHY major mode
+    install -Dt $out/share/emacs/site-lisp etc/spthy-mode.el
+  '';
+
+  checkPhase = "./dist/build/tamarin-prover/tamarin-prover test";
+
+  executableHaskellDepends = (with haskellPackages; [
+    binary-instances binary-orphans blaze-html conduit file-embed
+    gitrev http-types lifted-base monad-control
+    resourcet shakespeare threads wai warp yesod-core yesod-static
+  ]) ++ [ tamarin-prover-utils
+          tamarin-prover-sapic
+          tamarin-prover-accountability
+          tamarin-prover-export
+          tamarin-prover-term
+          tamarin-prover-theory
+        ];
+})
diff --git a/nixpkgs/pkgs/applications/science/logic/tlaplus/default.nix b/nixpkgs/pkgs/applications/science/logic/tlaplus/default.nix
new file mode 100644
index 000000000000..2d2542a607a5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/tlaplus/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, makeWrapper, jre }:
+
+stdenv.mkDerivation rec {
+  pname = "tlaplus";
+  version = "1.7.3";
+
+  src = fetchurl {
+    url = "https://github.com/tlaplus/tlaplus/releases/download/v${version}/tla2tools.jar";
+    sha256 = "sha256-5P8V6oH05voSXAgwBDclSxdxdMalrfaNpElkar4IUZ0=";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  dontUnpack = true;
+  installPhase = ''
+    mkdir -p $out/share/java $out/bin
+    cp $src $out/share/java/tla2tools.jar
+
+    makeWrapper ${jre}/bin/java $out/bin/tlc \
+      --add-flags "-XX:+UseParallelGC -cp $out/share/java/tla2tools.jar tlc2.TLC"
+    makeWrapper ${jre}/bin/java $out/bin/tlasany \
+      --add-flags "-XX:+UseParallelGC -cp $out/share/java/tla2tools.jar tla2sany.SANY"
+    makeWrapper ${jre}/bin/java $out/bin/pcal \
+      --add-flags "-XX:+UseParallelGC -cp $out/share/java/tla2tools.jar pcal.trans"
+    makeWrapper ${jre}/bin/java $out/bin/tlatex \
+      --add-flags "-XX:+UseParallelGC -cp $out/share/java/tla2tools.jar tla2tex.TLA"
+  '';
+
+  meta = {
+    description = "An algorithm specification language with model checking tools";
+    homepage    = "http://lamport.azurewebsites.net/tla/tla.html";
+    sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
+    license     = lib.licenses.mit;
+    platforms   = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ florentc thoughtpolice mgregson ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/tlaplus/tlaplus18.nix b/nixpkgs/pkgs/applications/science/logic/tlaplus/tlaplus18.nix
new file mode 100644
index 000000000000..4f34846a8927
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/tlaplus/tlaplus18.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchurl, makeWrapper, jre }:
+
+stdenv.mkDerivation rec {
+  pname = "tlaplus";
+  version = "1.8.0";
+
+  src = fetchurl {
+    url = "https://github.com/tlaplus/tlaplus/releases/download/v${version}/tla2tools.jar";
+    sha256 = "sha256-OXgpd1xuyvhveunlybBi/N6jnxtp/J8Kmp8PYX3eSZ4=";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  dontUnpack = true;
+  installPhase = ''
+    mkdir -p $out/share/java $out/bin
+    cp $src $out/share/java/tla2tools.jar
+
+    makeWrapper ${jre}/bin/java $out/bin/tlc \
+      --add-flags "-XX:+UseParallelGC -cp $out/share/java/tla2tools.jar tlc2.TLC"
+    makeWrapper ${jre}/bin/java $out/bin/tlasany \
+      --add-flags "-XX:+UseParallelGC -cp $out/share/java/tla2tools.jar tla2sany.SANY"
+    makeWrapper ${jre}/bin/java $out/bin/pcal \
+      --add-flags "-XX:+UseParallelGC -cp $out/share/java/tla2tools.jar pcal.trans"
+    makeWrapper ${jre}/bin/java $out/bin/tlatex \
+      --add-flags "-XX:+UseParallelGC -cp $out/share/java/tla2tools.jar tla2tex.TLA"
+    makeWrapper ${jre}/bin/java $out/bin/tlarepl \
+      --add-flags "-XX:+UseParallelGC -cp $out/share/java/tla2tools.jar tlc2.REPL"
+  '';
+
+  meta = {
+    description = "An algorithm specification language with model checking tools";
+    homepage    = "http://lamport.azurewebsites.net/tla/tla.html";
+    sourceProvenance = with lib.sourceTypes; [ binaryBytecode ];
+    license     = lib.licenses.mit;
+    platforms   = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ florentc thoughtpolice mgregson ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/tlaplus/tlaps.nix b/nixpkgs/pkgs/applications/science/logic/tlaplus/tlaps.nix
new file mode 100644
index 000000000000..59afbc094e40
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/tlaplus/tlaps.nix
@@ -0,0 +1,60 @@
+{ fetchurl
+, lib
+, stdenv
+, ocaml
+, isabelle
+, cvc3
+, perl
+, wget
+, which
+}:
+
+stdenv.mkDerivation rec {
+  pname = "tlaps";
+  version = "1.4.5";
+  src = fetchurl {
+    url = "https://tla.msr-inria.inria.fr/tlaps/dist/${version}/tlaps-${version}.tar.gz";
+    sha256 = "c296998acd14d5b93a8d5be7ee178007ef179957465966576bda26944b1b7fca";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml isabelle cvc3 perl wget which ];
+
+  installPhase = ''
+    mkdir -pv "$out"
+    export HOME="$out"
+    export PATH=$out/bin:$PATH
+
+    pushd zenon
+    ./configure --prefix $out
+    make
+    make install
+    popd
+
+    pushd isabelle
+    isabelle build -b Pure
+    popd
+
+    pushd tlapm
+    ./configure --prefix $out
+    make all
+    make install
+  '';
+
+  meta = {
+    description = "Mechanically check TLA+ proofs";
+    longDescription = ''
+      TLA+ is a general-purpose formal specification language that is
+      particularly useful for describing concurrent and distributed
+      systems. The TLA+ proof language is declarative, hierarchical,
+      and scalable to large system specifications. It provides a
+      consistent abstraction over the various “backend” verifiers.
+    '';
+    homepage = "https://tla.msr-inria.inria.fr/tlaps/content/Home.html";
+    license = lib.licenses.bsd2;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ florentc ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/tlaplus/toolbox.nix b/nixpkgs/pkgs/applications/science/logic/tlaplus/toolbox.nix
new file mode 100644
index 000000000000..288ddc06806a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/tlaplus/toolbox.nix
@@ -0,0 +1,105 @@
+{ lib
+, fetchzip
+, makeShellWrapper
+, makeDesktopItem
+, stdenv
+, gtk3
+, libXtst
+, glib
+, zlib
+, wrapGAppsHook
+}:
+
+let
+  desktopItem = makeDesktopItem rec {
+    name = "TLA+Toolbox";
+    exec = "tla-toolbox";
+    icon = "tla-toolbox";
+    comment = "IDE for TLA+";
+    desktopName = name;
+    genericName = comment;
+    categories = [ "Development" ];
+    startupWMClass = "TLA+ Toolbox";
+  };
+
+
+in
+stdenv.mkDerivation rec {
+  pname = "tla-toolbox";
+  version = "1.7.1";
+  src = fetchzip {
+    url = "https://tla.msr-inria.inria.fr/tlatoolbox/products/TLAToolbox-${version}-linux.gtk.x86_64.zip";
+    sha256 = "02a2y2mkfab5cczw8g604m61h4xr0apir49zbd1aq6mmgcgngw80";
+  };
+
+  buildInputs = [ gtk3 ];
+
+  nativeBuildInputs = [
+    makeShellWrapper
+    wrapGAppsHook
+  ];
+
+  dontWrapGApps = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p "$out/bin"
+    cp -r "$src" "$out/toolbox"
+    chmod -R +w "$out/toolbox"
+
+    fixupPhase
+    gappsWrapperArgsHook
+
+    patchelf \
+      --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
+      "$out/toolbox/toolbox"
+
+    patchelf \
+      --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
+      --set-rpath "${lib.makeLibraryPath [ zlib ]}:$(patchelf --print-rpath $(find "$out/toolbox" -name java))" \
+      "$(find "$out/toolbox" -name java)"
+
+    patchelf \
+      --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
+      "$(find "$out/toolbox" -name jspawnhelper)"
+
+    makeShellWrapper $out/toolbox/toolbox $out/bin/tla-toolbox \
+      --chdir "$out/toolbox" \
+      --add-flags "-data ~/.tla-toolbox" \
+      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ gtk3 libXtst glib zlib ]}"  \
+      "''${gappsWrapperArgs[@]}"
+
+    echo -e "\nCreating TLA Toolbox icons..."
+    pushd "$src"
+    for icon_in in $(find . -path "./plugins/*/icons/full/etool16/tla_launch_check_wiz_*.png")
+    do
+      icon_size=$(echo $icon_in | grep -Po "wiz_\K[0-9]+")
+      icon_out="$out/share/icons/hicolor/$icon_size""x$icon_size/apps/tla-toolbox.png"
+      mkdir -p "$(dirname $icon_out)"
+      cp "$icon_in" "$icon_out"
+    done
+    popd
+
+    echo -e "\nCreating TLA Toolbox desktop entry..."
+    cp -r "${desktopItem}/share/applications"* "$out/share/applications"
+
+    runHook postInstall
+  '';
+
+  meta = {
+    homepage = "http://research.microsoft.com/en-us/um/people/lamport/tla/toolbox.html";
+    description = "IDE for the TLA+ tools";
+    mainProgram = "tla-toolbox";
+    longDescription = ''
+      Integrated development environment for the TLA+ tools, based on Eclipse. You can use it
+      to create and edit your specs, run the PlusCal translator, view the pretty-printed
+      versions of your modules, run the TLC model checker, and run TLAPS, the TLA+ proof system.
+    '';
+    # http://lamport.azurewebsites.net/tla/license.html
+    license = with lib.licenses; [ mit ];
+    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
+    platforms = [ "x86_64-linux" ];
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/tptp/default.nix b/nixpkgs/pkgs/applications/science/logic/tptp/default.nix
new file mode 100644
index 000000000000..5df511ebaa8e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/tptp/default.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchurl, yap, tcsh, perl, patchelf }:
+
+stdenv.mkDerivation rec {
+  pname = "TPTP";
+  version = "7.2.0";
+
+  src = fetchurl {
+    urls = [
+      "http://tptp.cs.miami.edu/TPTP/Distribution/TPTP-v${version}.tgz"
+      "http://tptp.cs.miami.edu/TPTP/Archive/TPTP-v${version}.tgz"
+    ];
+    sha256 = "0yq8452b6mym4yscy46pshg0z2my8xi74b5bp2qlxd5bjwcrg6rl";
+  };
+
+  nativeBuildInputs = [ patchelf ];
+  buildInputs = [ tcsh yap perl ];
+
+  installPhase = ''
+    sharedir=$out/share/tptp
+
+    mkdir -p $sharedir
+    cp -r ./ $sharedir
+
+    export TPTP=$sharedir
+
+    tcsh $sharedir/Scripts/tptp2T_install -default
+
+    substituteInPlace $sharedir/TPTP2X/tptp2X_install --replace /bin/mv mv
+    tcsh $sharedir/TPTP2X/tptp2X_install -default
+
+    patchelf --interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $sharedir/Scripts/tptp4X
+
+    mkdir -p $out/bin
+    ln -s $sharedir/TPTP2X/tptp2X $out/bin
+    ln -s $sharedir/Scripts/tptp2T $out/bin
+    ln -s $sharedir/Scripts/tptp4X $out/bin
+  '';
+
+  meta = with lib; {
+    description = "Thousands of problems for theorem provers and tools";
+    maintainers = with maintainers; [ raskin gebner ];
+    # 6.3 GiB of data. Installation is unpacking and editing a few files.
+    # No sense in letting Hydra build it.
+    # Also, it is unclear what is covered by "verbatim" - we will edit configs
+    hydraPlatforms = [];
+    platforms = platforms.all;
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    license = licenses.unfreeRedistributable;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/twelf/default.nix b/nixpkgs/pkgs/applications/science/logic/twelf/default.nix
new file mode 100644
index 000000000000..67779b2b5722
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/twelf/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchurl, pkg-config, smlnj, rsync }:
+
+stdenv.mkDerivation rec {
+  pname = "twelf";
+  version = "1.7.1";
+
+  src = fetchurl {
+    url = "http://twelf.plparty.org/releases/twelf-src-${version}.tar.gz";
+    sha256 = "0fi1kbs9hrdrm1x4k13angpjasxlyd1gc3ys8ah54i75qbcd9c4i";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ smlnj rsync ];
+
+  buildPhase = ''
+    export SMLNJ_HOME=${smlnj}
+    make smlnj
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    rsync -av bin/{*,.heap} $out/bin/
+    bin/.mkexec ${smlnj}/bin/sml $out/ twelf-server twelf-server
+
+    substituteInPlace emacs/twelf-init.el \
+      --replace '(concat twelf-root "emacs")' '(concat twelf-root "share/emacs/site-lisp/twelf")'
+
+    mkdir -p $out/share/emacs/site-lisp/twelf/
+    rsync -av emacs/ $out/share/emacs/site-lisp/twelf/
+
+    mkdir -p $out/share/twelf/examples
+    rsync -av examples/ $out/share/twelf/examples/
+    mkdir -p $out/share/twelf/vim
+    rsync -av vim/ $out/share/twelf/vim/
+  '';
+
+  meta = {
+    description = "Logic proof assistant";
+    longDescription = ''
+      Twelf is a language used to specify, implement, and prove properties of
+      deductive systems such as programming languages and logics. Large
+      research projects using Twelf include the TALT typed assembly language,
+      a foundational proof-carrying-code system, and a type safety proof for
+      Standard ML.
+    '';
+    homepage = "http://twelf.org/wiki/Main_Page";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ jwiegley ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/uhdm/default.nix b/nixpkgs/pkgs/applications/science/logic/uhdm/default.nix
new file mode 100644
index 000000000000..6698e47844a2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/uhdm/default.nix
@@ -0,0 +1,48 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, python3
+, capnproto
+, gtest
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "UHDM";
+  # When updating this package, also consider updating science/logic/surelog
+  version = "1.80";
+
+  src = fetchFromGitHub {
+    owner = "chipsalliance";
+    repo = finalAttrs.pname;
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-/aWiN+DPlIjI89u5kx6QoyrGD4DOJTHXxIZ0qHJNDls=";
+    fetchSubmodules = false;  # we use all dependencies from nix
+  };
+
+  nativeBuildInputs = [
+    cmake
+    (python3.withPackages (p: with p; [ orderedmultidict ]))
+    gtest
+  ];
+
+  buildInputs = [
+    capnproto
+  ];
+
+  cmakeFlags = [
+    "-DUHDM_USE_HOST_GTEST=On"
+    "-DUHDM_USE_HOST_CAPNP=On"
+  ];
+
+  doCheck = true;
+  checkPhase = "make test";
+
+  meta = {
+    description = "Universal Hardware Data Model";
+    homepage = "https://github.com/chipsalliance/UHDM";
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ matthuszagh ];
+    platforms = lib.platforms.all;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/logic/vampire/default.nix b/nixpkgs/pkgs/applications/science/logic/vampire/default.nix
new file mode 100644
index 000000000000..62427e2ee455
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/vampire/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, z3, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "vampire";
+  version = "4.6.1";
+
+  src = fetchFromGitHub {
+    owner = "vprover";
+    repo = "vampire";
+    rev = "v${version}";
+    sha256 = "0z71nxjak3ibp842r8iv37w1x3cbkrmjs88lpvxqb4sgrbyk38zd";
+  };
+
+  buildInputs = [ z3 zlib ];
+
+  makeFlags = [ "vampire_z3_rel" "CC:=$(CC)" "CXX:=$(CXX)" ];
+
+  patches = [
+    # https://github.com/vprover/vampire/pull/54
+    (fetchpatch {
+      name = "fix-apple-cygwin-defines.patch";
+      url = "https://github.com/vprover/vampire/commit/b4bddd3bcac6a7688742da75c369b7b3213f6d1c.patch";
+      sha256 = "0i6nrc50wlg1dqxq38lkpx4rmfb3lf7s8f95l4jkvqp0nxa20cza";
+    })
+    # https://github.com/vprover/vampire/pull/55
+    (fetchpatch {
+      name = "fix-wait-any.patch";
+      url = "https://github.com/vprover/vampire/commit/6da10eabb333aec54cdf13833ea33cb851159543.patch";
+      sha256 = "1pwfpwpl23bqsgkmmvw6bnniyvp5j9v8l3z9s9pllfabnfcrcz9l";
+    })
+  ];
+
+  postPatch = ''
+    patch -p1 -i ${../avy/minisat-fenv.patch} -d Minisat || true
+  '';
+
+  enableParallelBuilding = true;
+
+  fixupPhase = ''
+    rm -rf z3
+  '';
+
+  installPhase = ''
+    install -m0755 -D vampire_z3_rel* $out/bin/vampire
+  '';
+
+  meta = with lib; {
+    homepage = "https://vprover.github.io/";
+    description = "The Vampire Theorem Prover";
+    mainProgram = "vampire";
+    platforms = platforms.unix;
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ gebner ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/verifast/default.nix b/nixpkgs/pkgs/applications/science/logic/verifast/default.nix
new file mode 100644
index 000000000000..a1f5ec65a3be
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/verifast/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchurl, gtk2, gdk-pixbuf, atk, pango, glib, cairo, freetype
+, fontconfig, libxml2, gnome2 }:
+
+let
+
+  libPath = lib.makeLibraryPath
+    [ stdenv.cc.libc stdenv.cc.cc gtk2 gdk-pixbuf atk pango glib cairo
+      freetype fontconfig libxml2 gnome2.gtksourceview
+    ] + ":${stdenv.cc.cc.lib}/lib64:$out/libexec";
+
+  patchExe = x: ''
+    patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath ${libPath} ${x}
+  '';
+
+  patchLib = x: ''
+    patchelf --set-rpath ${libPath} ${x}
+  '';
+
+in
+stdenv.mkDerivation rec {
+  pname = "verifast";
+  version = "21.04";
+
+  src = fetchurl {
+    url    = "https://github.com/verifast/verifast/releases/download/${version}/${pname}-${version}-linux.tar.gz";
+    sha256 = "sha256-PlRsf4wFXoM+E+60SbeKzs/RZK0HNVirX47AnI6NeYM=";
+  };
+
+  dontConfigure = true;
+  dontStrip = true;
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -R bin $out/libexec
+
+    ${patchExe "$out/libexec/verifast"}
+    ${patchExe "$out/libexec/vfide"}
+    ${patchLib "$out/libexec/libz3.so"}
+    ln -s $out/libexec/verifast $out/bin/verifast
+    ln -s $out/libexec/vfide    $out/bin/vfide
+  '';
+
+  meta = {
+    description = "Verification for C and Java programs via separation logic";
+    homepage    = "https://people.cs.kuleuven.be/~bart.jacobs/verifast/";
+    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
+    license     = lib.licenses.mit;
+    platforms   = [ "x86_64-linux" ];
+    maintainers = [ lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/verit/default.nix b/nixpkgs/pkgs/applications/science/logic/verit/default.nix
new file mode 100644
index 000000000000..6c0d1061dcab
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/verit/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, autoreconfHook, gmp, flex, bison }:
+
+stdenv.mkDerivation {
+  pname = "veriT";
+  version = "2021.06.2";
+
+  src = fetchurl {
+    url = "https://verit.loria.fr/download/2021.06.2/verit-2021.06.2-rmx.tar.gz";
+    sha256 = "1yjvvxnsix0rhilc81ycx1s85dymq366c6zh1hwwd8qxp7k1zca2";
+  };
+
+  nativeBuildInputs = [ autoreconfHook flex bison ];
+  buildInputs = [ gmp ];
+
+  # --disable-static actually enables static linking here...
+  dontDisableStatic = true;
+
+  makeFlags = [ "LEX=${flex}/bin/flex" ];
+
+  preInstall = ''
+    mkdir -p $out/bin
+  '';
+
+  meta = with lib; {
+    description = "An open, trustable and efficient SMT-solver";
+    homepage = "https://verit.loria.fr/";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.gebner ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/why3/default.nix b/nixpkgs/pkgs/applications/science/logic/why3/default.nix
new file mode 100644
index 000000000000..1676ca4c2a4f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/why3/default.nix
@@ -0,0 +1,76 @@
+{ callPackage, fetchurl, lib, stdenv
+, ocamlPackages, coqPackages, rubber, hevea, emacs
+, version ? "1.7.1"
+, ideSupport ? true
+, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "why3";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://why3.gitlabpages.inria.fr/releases/${pname}-${version}.tar.gz";
+    hash = {
+      "1.7.1" = "sha256-rG1hcxFhQ2PlE9RTz9ELliDjCuSzLnJ1togRY637cU4=";
+      "1.6.0" = "sha256-hFvM6kHScaCtcHCc6Vezl9CR7BFbiKPoTEh7kj0ZJxw=";
+    }."${version}";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = lib.optional ideSupport
+    wrapGAppsHook
+  ++ (with ocamlPackages;  [
+    ocaml findlib menhir
+  ]) ++ [
+    # Coq Support
+    coqPackages.coq
+  ];
+
+  buildInputs = with ocamlPackages; [
+    ocamlgraph zarith
+    # Emacs compilation of why3.el
+    emacs
+    # Documentation
+    rubber hevea
+  ] ++ lib.optional ideSupport
+    # GUI
+    lablgtk3-sourceview3
+  ++ [
+    # WebIDE
+    js_of_ocaml js_of_ocaml-ppx
+    # S-expression output for why3pp
+    ppx_deriving ppx_sexp_conv ]
+    ++
+    # Coq Support
+    (with coqPackages; [ coq flocq ])
+  ;
+
+  propagatedBuildInputs = with ocamlPackages; [ camlzip menhirLib num re sexplib ];
+
+  enableParallelBuilding = true;
+
+  configureFlags = [ "--enable-verbose-make"
+    (lib.enableFeature ideSupport "ide")
+  ];
+
+  outputs = [ "out" "dev" ];
+
+  installTargets = [ "install" "install-lib" ];
+
+  postInstall = ''
+    mkdir -p $dev/lib
+    mv $out/lib/ocaml $dev/lib/
+  '';
+
+  passthru.withProvers = callPackage ./with-provers.nix {};
+
+  meta = with lib; {
+    description = "A platform for deductive program verification";
+    homepage    = "https://why3.lri.fr/";
+    license     = licenses.lgpl21;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ thoughtpolice vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/why3/with-provers.nix b/nixpkgs/pkgs/applications/science/logic/why3/with-provers.nix
new file mode 100644
index 000000000000..95d5b95718dd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/why3/with-provers.nix
@@ -0,0 +1,33 @@
+{ stdenv, makeWrapper, runCommand, why3 }:
+provers:
+let configAwkScript = runCommand "why3-conf.awk" { inherit provers; }
+  ''
+    for p in $provers; do
+      for b in $p/bin/*; do
+        BASENAME=$(basename $b)
+        echo "/^command =/{ gsub(\"$BASENAME\", \"$b\") }" >> $out
+      done
+    done
+    echo '{ print }' >> $out
+  '';
+in
+stdenv.mkDerivation {
+  pname = "${why3.pname}-with-provers";
+  version = why3.version;
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ why3 ] ++ provers;
+
+  dontUnpack = true;
+
+  buildPhase = ''
+    mkdir -p $out/share/why3/
+    why3 config detect -C $out/share/why3/why3.conf
+    awk -i inplace -f ${configAwkScript} $out/share/why3/why3.conf
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    makeWrapper ${why3}/bin/why3 $out/bin/why3 --add-flags "--config $out/share/why3/why3.conf"
+  '';
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/workcraft/default.nix b/nixpkgs/pkgs/applications/science/logic/workcraft/default.nix
new file mode 100644
index 000000000000..cc512acad793
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/workcraft/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, jre, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "workcraft";
+  version = "3.4.2";
+
+  src = fetchurl {
+    url = "https://github.com/workcraft/workcraft/releases/download/v${version}/workcraft-v${version}-linux.tar.gz";
+    sha256 = "sha256-+O6fl/+D89L5xrrTaAnBTfw0tFz/CoKLaBa+OHtdnaA=";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  dontConfigure = true;
+
+  installPhase = ''
+  mkdir -p $out/share
+  cp -r * $out/share
+  mkdir $out/bin
+  makeWrapper $out/share/workcraft $out/bin/workcraft \
+    --set JAVA_HOME "${jre}" \
+    --set _JAVA_OPTIONS '-Dawt.useSystemAAFontSettings=gasp';
+  '';
+
+  meta = {
+    homepage = "https://workcraft.org/";
+    description = "Framework for interpreted graph modeling, verification and synthesis";
+    mainProgram = "workcraft";
+    platforms = lib.platforms.linux;
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ timor ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/yices/default.nix b/nixpkgs/pkgs/applications/science/logic/yices/default.nix
new file mode 100644
index 000000000000..b97245cab476
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/yices/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchFromGitHub, cudd, gmp-static, gperf, autoreconfHook, libpoly }:
+
+stdenv.mkDerivation rec {
+  pname = "yices";
+  # We never want X.Y.${odd} versions as they are moving development tags.
+  version = "2.6.4";
+
+  src = fetchFromGitHub {
+    owner  = "SRI-CSL";
+    repo   = "yices2";
+    rev    = "Yices-${version}";
+    sha256 = "sha256-qdxh86CkKdm65oHcRgaafTG9GUOoIgTDjeWmRofIpNE=";
+  };
+
+  patches = [
+    # musl has no ldconfig, create symlinks explicitly
+    ./linux-no-ldconfig.patch
+  ];
+  postPatch = "patchShebangs tests/regress/check.sh";
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ cudd gmp-static gperf libpoly ];
+  configureFlags =
+    [ "--with-static-gmp=${gmp-static.out}/lib/libgmp.a"
+      "--with-static-gmp-include-dir=${gmp-static.dev}/include"
+      "--enable-mcsat"
+    ];
+
+  enableParallelBuilding = true;
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A high-performance theorem prover and SMT solver";
+    homepage    = "https://yices.csl.sri.com";
+    license     = licenses.gpl3;
+    platforms   = with platforms; linux ++ darwin;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/yices/linux-no-ldconfig.patch b/nixpkgs/pkgs/applications/science/logic/yices/linux-no-ldconfig.patch
new file mode 100644
index 000000000000..bad3da6ad4a2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/yices/linux-no-ldconfig.patch
@@ -0,0 +1,13 @@
+--- a/Makefile.build
++++ b/Makefile.build
+@@ -474,8 +474,9 @@ install-darwin: install-default
+ install-solaris: install-default
+ 	$(LDCONFIG) -n $(DESTDIR)$(libdir) && (cd $(DESTDIR)$(libdir) && $(LN_S) -f libyices.so.$(YICES_VERSION) libyices.so)
+ 
++# avoid ldconfig as it's not present on musl
+ install-linux install-unix: install-default
+-	$(LDCONFIG) -n $(DESTDIR)$(libdir) && (cd $(DESTDIR)$(libdir) && $(LN_S) -f libyices.so.$(YICES_VERSION) libyices.so)
++	(cd $(DESTDIR)$(libdir) && $(LN_S) -f libyices.so.$(YICES_VERSION) libyices.so.$(MAJOR).$(MINOR) && $(LN_S) -f libyices.so.$(MAJOR).$(MINOR) libyices.so)
+ 
+ # on FreeBSD: the library file is libyices.so.X.Y and ldconfig does not take -n
+ # TODO: fix this. We must also create a symbolic link: libyices.so.X in libdir
diff --git a/nixpkgs/pkgs/applications/science/logic/z3/default.nix b/nixpkgs/pkgs/applications/science/logic/z3/default.nix
new file mode 100644
index 000000000000..f35da4a732b0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/z3/default.nix
@@ -0,0 +1,109 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, python
+, fixDarwinDylibNames
+, javaBindings ? false
+, ocamlBindings ? false
+, pythonBindings ? true
+, jdk ? null
+, ocaml ? null
+, findlib ? null
+, zarith ? null
+, writeScript
+}:
+
+assert javaBindings -> jdk != null;
+assert ocamlBindings -> ocaml != null && findlib != null && zarith != null;
+
+with lib;
+
+let common = { version, sha256, patches ? [ ], tag ? "z3" }:
+  stdenv.mkDerivation rec {
+    pname = "z3";
+    inherit version sha256 patches;
+    src = fetchFromGitHub {
+      owner = "Z3Prover";
+      repo = "z3";
+      rev = "${tag}-${version}";
+      sha256 = sha256;
+    };
+
+    strictDeps = true;
+
+    nativeBuildInputs = [ python ]
+      ++ optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames
+      ++ optional javaBindings jdk
+      ++ optionals ocamlBindings [ ocaml findlib ]
+    ;
+    propagatedBuildInputs = [ python.pkgs.setuptools ]
+      ++ optionals ocamlBindings [ zarith ];
+    enableParallelBuilding = true;
+
+    postPatch = optionalString ocamlBindings ''
+      export OCAMLFIND_DESTDIR=$ocaml/lib/ocaml/${ocaml.version}/site-lib
+      mkdir -p $OCAMLFIND_DESTDIR/stublibs
+    '';
+
+    configurePhase = concatStringsSep " "
+      (
+        [ "${python.pythonOnBuildForHost.interpreter} scripts/mk_make.py --prefix=$out" ]
+          ++ optional javaBindings "--java"
+          ++ optional ocamlBindings "--ml"
+          ++ optional pythonBindings "--python --pypkgdir=$out/${python.sitePackages}"
+      ) + "\n" + "cd build";
+
+    doCheck = true;
+    checkPhase = ''
+      make test
+      ./test-z3 -a
+    '';
+
+    postInstall = ''
+      mkdir -p $dev $lib
+      mv $out/lib $lib/lib
+      mv $out/include $dev/include
+    '' + optionalString pythonBindings ''
+      mkdir -p $python/lib
+      mv $lib/lib/python* $python/lib/
+      ln -sf $lib/lib/libz3${stdenv.hostPlatform.extensions.sharedLibrary} $python/${python.sitePackages}/z3/lib/libz3${stdenv.hostPlatform.extensions.sharedLibrary}
+    '' + optionalString javaBindings ''
+      mkdir -p $java/share/java
+      mv com.microsoft.z3.jar $java/share/java
+      moveToOutput "lib/libz3java.${stdenv.hostPlatform.extensions.sharedLibrary}" "$java"
+    '';
+
+    outputs = [ "out" "lib" "dev" "python" ]
+      ++ optional javaBindings "java"
+      ++ optional ocamlBindings "ocaml";
+
+    meta = with lib; {
+      description = "A high-performance theorem prover and SMT solver";
+      mainProgram = "z3";
+      homepage = "https://github.com/Z3Prover/z3";
+      changelog = "https://github.com/Z3Prover/z3/releases/tag/z3-${version}";
+      license = licenses.mit;
+      platforms = platforms.unix;
+      maintainers = with maintainers; [ thoughtpolice ttuegel ];
+    };
+  };
+in
+{
+  z3_4_12 = common {
+    version = "4.12.5";
+    sha256 = "sha256-Qj9w5s02OSMQ2qA7HG7xNqQGaUacA1d4zbOHynq5k+A=";
+  };
+  z3_4_11 = common {
+    version = "4.11.2";
+    sha256 = "sha256-OO0wtCvSKwGxnKvu+AfXe4mEzv4nofa7A00BjX+KVjc=";
+  };
+  z3_4_8 = common {
+    version = "4.8.17";
+    sha256 = "sha256-BSwjgOU9EgCcm18Zx0P9mnoPc9ZeYsJwEu0ffnACa+8=";
+  };
+  z3_4_8_5 = common {
+    tag = "Z3";
+    version = "4.8.5";
+    sha256 = "sha256-ytG5O9HczbIVJAiIGZfUXC/MuYH7d7yLApaeTRlKXoc=";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/z3/tptp.nix b/nixpkgs/pkgs/applications/science/logic/z3/tptp.nix
new file mode 100644
index 000000000000..15f6770404ef
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/z3/tptp.nix
@@ -0,0 +1,30 @@
+{lib, stdenv, z3, cmake}:
+stdenv.mkDerivation rec {
+  pname = "z3-tptp";
+  version = z3.version;
+
+  src = z3.src;
+
+  sourceRoot = "${src.name}/examples/tptp";
+
+  nativeBuildInputs = [cmake];
+  buildInputs = [z3];
+
+  preConfigure = ''
+    echo 'set(Z3_LIBRARIES "-lz3")' >> CMakeLists.new
+    cat CMakeLists.txt | grep -E 'add_executable|project|link_libraries' >> CMakeLists.new
+    mv CMakeLists.new CMakeLists.txt
+  '';
+
+  installPhase = ''
+    mkdir -p "$out/bin"
+    cp "z3_tptp5" "$out/bin/"
+    ln -s "z3_tptp5" "$out/bin/z3-tptp"
+  '';
+
+  meta = {
+    inherit (z3.meta) license homepage platforms;
+    description = "TPTP wrapper for Z3 prover";
+    maintainers = [lib.maintainers.raskin];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/zchaff/default.nix b/nixpkgs/pkgs/applications/science/logic/zchaff/default.nix
new file mode 100644
index 000000000000..5e22ff448ed3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/zchaff/default.nix
@@ -0,0 +1,32 @@
+{ lib, clangStdenv, fetchzip }:
+
+clangStdenv.mkDerivation rec {
+  pname = "zchaff";
+  version = "2007.3.12";
+
+  src = fetchzip {
+    url = "https://www.princeton.edu/~chaff/zchaff/zchaff.64bit.${version}.zip";
+    sha256 = "sha256-88fAtJb7o+Qv2GohTdmquxMEq4oCbiKbqLFmS7zs1Ak=";
+  };
+
+  patches = [ ./sat_solver.patch ];
+  postPatch = ''
+    substituteInPlace zchaff_solver.cpp --replace "// #define VERIFY_ON" "#define VERIFY_ON"
+  '';
+
+  makeFlags = [ "CC=${clangStdenv.cc.targetPrefix}c++" ];
+  installPhase= ''
+    runHook preInstall
+    install -Dm755 -t $out/bin zchaff
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.princeton.edu/~chaff/zchaf";
+    description = "Accelerated SAT Solver from Princeton";
+    mainProgram = "zchaff";
+    license = licenses.mit;
+    maintainers = with maintainers; [ siraben ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/zchaff/sat_solver.patch b/nixpkgs/pkgs/applications/science/logic/zchaff/sat_solver.patch
new file mode 100644
index 000000000000..2a84ba18de24
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/zchaff/sat_solver.patch
@@ -0,0 +1,12 @@
+diff --git a/sat_solver.cpp b/sat_solver.cpp
+index e191881..07c0926 100644
+--- a/sat_solver.cpp
++++ b/sat_solver2.cpp
+@@ -43,6 +43,7 @@
+ #include <vector>
+ #include <dirent.h>
+ #include "SAT.h"
++#include <cstring>
+ 
+ using namespace std;
+ 
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/fasttext/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/fasttext/default.nix
new file mode 100644
index 000000000000..b0a36bedc536
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/fasttext/default.nix
@@ -0,0 +1,24 @@
+{lib, stdenv, fetchFromGitHub, cmake}:
+
+stdenv.mkDerivation rec {
+  pname = "fasttext";
+  version = "0.9.2-unstable-2023-11-28";
+
+  src = fetchFromGitHub {
+    owner = "facebookresearch";
+    repo = "fastText";
+    rev = "6c2204ba66776b700095ff73e3e599a908ffd9c3";
+    hash = "sha256-lSIah4T+QqZwCRpeI3mxJ7PZT6pSHBO26rcEFfK8DSk=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Library for text classification and representation learning";
+    mainProgram = "fasttext";
+    homepage = "https://fasttext.cc/";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/finalfrontier/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/finalfrontier/default.nix
new file mode 100644
index 000000000000..1a6e9351d3a7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/finalfrontier/default.nix
@@ -0,0 +1,52 @@
+{ lib
+, stdenv
+, rustPlatform
+, fetchFromGitHub
+, installShellFiles
+, pkg-config
+, libiconv
+, openssl
+, Security
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "finalfrontier";
+  version = "unstable-2022-01-06";
+
+  src = fetchFromGitHub {
+    owner = "finalfusion";
+    repo = pname;
+    rev = "2461fb1dde13b73039926aa66606e470907a1b59";
+    sha256 = "sha256-bnRzXIYairlBjv2JxU16UXYc5BB3VeKZNiJ4+XDzub4=";
+  };
+
+  cargoSha256 = "sha256-C/D9EPfifyajrCyXE8w/qRuzWEoyJJIcj4xii94/9l4=";
+
+  nativeBuildInputs = [
+    installShellFiles
+    pkg-config
+  ];
+
+  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [
+    libiconv
+    Security
+  ];
+
+  postInstall = ''
+    installManPage man/*.1
+
+    # Install shell completions
+    for shell in bash fish zsh; do
+      $out/bin/finalfrontier completions $shell > finalfrontier.$shell
+    done
+    installShellCompletion finalfrontier.{bash,fish,zsh}
+  '';
+
+  meta = with lib; {
+    description = "Utility for training word and subword embeddings";
+    mainProgram = "finalfrontier";
+    homepage = "https://github.com/finalfusion/finalfrontier/";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/finalfusion-utils/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/finalfusion-utils/default.nix
new file mode 100644
index 000000000000..0df8a0525be5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/finalfusion-utils/default.nix
@@ -0,0 +1,55 @@
+{ lib
+, stdenv
+, rustPlatform
+, fetchFromGitHub
+, installShellFiles
+, blas
+, gfortran
+, lapack
+, openssl
+, Security
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "finalfusion-utils";
+  version = "0.14.1";
+
+  src = fetchFromGitHub {
+    owner = "finalfusion";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-suzivynlgk4VvDOC2dQR40n5IJHoJ736+ObdrM9dIqE=";
+  };
+
+  cargoSha256 = "sha256-HekjmctuzOWs5k/ihhsV8vVkm6906jEnFf3yvhkrA5Y=";
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  buildInputs = [
+    blas
+    gfortran.cc.lib
+    lapack
+    openssl
+  ] ++ lib.optionals stdenv.isDarwin [
+    Security
+  ];
+
+  # Enables build against a generic BLAS.
+  buildFeatures = [ "netlib" ];
+
+  postInstall = ''
+    # Install shell completions
+    for shell in bash fish zsh; do
+      $out/bin/finalfusion completions $shell > finalfusion.$shell
+    done
+    installShellCompletion finalfusion.{bash,fish,zsh}
+  '';
+
+  meta = with lib; {
+    description = "Utility for converting, quantizing, and querying word embeddings";
+    homepage = "https://github.com/finalfusion/finalfusion-utils/";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ ];
+    mainProgram = "finalfusion";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/labelimg/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/labelimg/default.nix
new file mode 100644
index 000000000000..244eaa05d695
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/labelimg/default.nix
@@ -0,0 +1,38 @@
+{ lib, python3Packages, fetchFromGitHub, qt5 }:
+  python3Packages.buildPythonApplication rec {
+    pname = "labelImg";
+    version = "1.8.3";
+    src = fetchFromGitHub {
+      owner = "tzutalin";
+      repo = "labelImg";
+      rev = "v${version}";
+      sha256 = "07v106fzlmxrbag4xm06m4mx9m0gckb27vpwsn7sap1bbgc1pap5";
+    };
+    nativeBuildInputs = with python3Packages; [
+      pyqt5
+      qt5.wrapQtAppsHook
+    ];
+    propagatedBuildInputs = with python3Packages; [
+      pyqt5
+      lxml
+      sip4
+    ];
+    preBuild = ''
+      make qt5py3
+    '';
+    postInstall = ''
+      cp libs/resources.py $out/${python3Packages.python.sitePackages}/libs
+    '';
+    dontWrapQtApps = true;
+    preFixup = ''
+      makeWrapperArgs+=("''${qtWrapperArgs[@]}")
+    '';
+    meta = with lib; {
+      description = "A graphical image annotation tool and label object bounding boxes in images";
+      mainProgram = "labelImg";
+      homepage = "https://github.com/tzutalin/labelImg";
+      license = licenses.mit;
+      platforms = platforms.linux;
+      maintainers = [ maintainers.cmcdragonkai ];
+    };
+  }
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/nengo-gui/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/nengo-gui/default.nix
new file mode 100644
index 000000000000..9a100c03293e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/nengo-gui/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchFromGitHub, python3Packages }:
+
+python3Packages.buildPythonPackage rec {
+  pname = "nengo-gui";
+  version = "0.4.9";
+
+  src = fetchFromGitHub {
+    owner = "nengo";
+    repo = "nengo-gui";
+    rev = "refs/tags/v${version}";
+    sha256 = "sha256-aBi4roe9pqPmpbW5zrbDoIvyH5mTKgIzL2O5j1+VBMY=";
+  };
+
+  propagatedBuildInputs = with python3Packages; [ nengo ];
+
+  # checks req missing:
+  #   pyimgur
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Nengo interactive visualizer";
+    homepage    = "https://nengo.ai/";
+    license     = licenses.unfreeRedistributable;
+    maintainers = with maintainers; [ arjix ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/openbugs/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/openbugs/default.nix
new file mode 100644
index 000000000000..8d49534a11f8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/openbugs/default.nix
@@ -0,0 +1,22 @@
+{ lib
+, stdenv
+, fetchurl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "OpenBUGS";
+  version = "3.2.3";
+
+  src = fetchurl {
+    url = "https://www.mrc-bsu.cam.ac.uk/wp-content/uploads/2018/04/${pname}-${version}.tar.gz";
+    sha256 = "sha256-oonE2gxKw3H4ATImyF69Cp4d7F3puFiVDkhUy4FLTtg=";
+  };
+
+  meta = with lib; {
+    description = "Open source program for Bayesian modelling based on MCMC";
+    homepage = "https://www.mrc-bsu.cam.ac.uk/software/bugs/openbugs/";
+    maintainers = with maintainers; [ andresnav ];
+    license = licenses.gpl3Only;
+    platforms = [ "i686-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/sc2-headless/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/sc2-headless/default.nix
new file mode 100644
index 000000000000..d96d71695e75
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/sc2-headless/default.nix
@@ -0,0 +1,62 @@
+{ config, stdenv
+, callPackage
+, lib
+, fetchurl
+, unzip
+, licenseAccepted ? config.sc2-headless.accept_license or false
+}:
+
+if !licenseAccepted then throw ''
+    You must accept the Blizzard® Starcraft® II AI and Machine Learning License at
+    https://blzdistsc2-a.akamaihd.net/AI_AND_MACHINE_LEARNING_LICENSE.html
+    by setting nixpkgs config option 'sc2-headless.accept_license = true;'
+  ''
+else assert licenseAccepted;
+let maps = callPackage ./maps.nix {};
+in stdenv.mkDerivation rec {
+  version = "4.7.1";
+  pname = "sc2-headless";
+
+  src = fetchurl {
+    url = "https://blzdistsc2-a.akamaihd.net/Linux/SC2.${version}.zip";
+    sha256 = "0q1ry9bd3dm8y4hvh57yfq7s05hl2k2sxi2wsl6h0r3w690v1kdd";
+  };
+
+  unpackCmd = ''
+    unzip -P 'iagreetotheeula' $curSrc
+  '';
+
+  nativeBuildInputs = [ unzip ];
+
+  installPhase = ''
+    mkdir -p $out
+    cp -r . "$out"
+    rm -r $out/Libs
+
+    cp -ur "${maps.minigames}"/* "${maps.melee}"/* "${maps.ladder2017season1}"/* "${maps.ladder2017season2}"/* "${maps.ladder2017season3}"/* \
+      "${maps.ladder2017season4}"/* "${maps.ladder2018season1}"/* "${maps.ladder2018season2}"/* \
+      "${maps.ladder2018season3}"/*  "${maps.ladder2018season4}"/* "${maps.ladder2019season1}"/* "$out"/Maps/
+  '';
+
+  preFixup = ''
+    find $out -type f -print0 | while IFS=''' read -d ''' -r file; do
+      isELF "$file" || continue
+      patchelf \
+        --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+        --set-rpath ${lib.makeLibraryPath [stdenv.cc.cc stdenv.cc.libc]} \
+        "$file"
+    done
+  '';
+
+  meta = {
+    platforms = lib.platforms.linux;
+    description = "Starcraft II headless linux client for machine learning research";
+    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
+    license = {
+      fullName = "BLIZZARD® STARCRAFT® II AI AND MACHINE LEARNING LICENSE";
+      url = "https://blzdistsc2-a.akamaihd.net/AI_AND_MACHINE_LEARNING_LICENSE.html";
+      free = false;
+    };
+    maintainers = with lib.maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/sc2-headless/maps.nix b/nixpkgs/pkgs/applications/science/machine-learning/sc2-headless/maps.nix
new file mode 100644
index 000000000000..47e14108e37c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/sc2-headless/maps.nix
@@ -0,0 +1,63 @@
+{ fetchzip
+}:
+let
+  fetchzip' = args: (fetchzip args).overrideAttrs (old: { UNZIP = "-j -P iagreetotheeula"; });
+in
+{
+  minigames = fetchzip {
+    url = "https://github.com/deepmind/pysc2/releases/download/v1.2/mini_games.zip";
+    sha256 = "19f873ilcdsf50g2v0s2zzmxil1bqncsk8nq99bzy87h0i7khkla";
+    stripRoot = false;
+  };
+
+  melee = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Melee.zip";
+    sha256 = "0z44pgy10jklsvgpr0kcn4c2mz3hw7nlcmvsy6a6lzpi3dvzf33i";
+    stripRoot = false;
+  };
+  ladder2017season1 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season1.zip";
+    sha256 = "0ngg4g74s2ryhylny93fm8yq9rlrhphwnjg2s6f3qr85a2b3zdpd";
+    stripRoot = false;
+  };
+  ladder2017season2 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season2.zip";
+    sha256 = "01kycnvqagql9pkjkcgngfcnry2pc4kcygdkk511m0qr34909za5";
+    stripRoot = false;
+  };
+  ladder2017season3 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season3_Updated.zip";
+    sha256 = "0wix3lwmbyxfgh8ldg0n66i21p0dbavk2dxjngz79rx708m8qvld";
+    stripRoot = false;
+  };
+  ladder2017season4 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2017Season4.zip";
+    sha256 = "1sidnmk2rc9j5fd3a4623pvaika1mm1rwhznb2qklsqsq1x2qckp";
+    stripRoot = false;
+  };
+  ladder2018season1 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season1.zip";
+    sha256 = "0mp0ilcq0gmd7ahahc5i8c7bdr3ivk6skx0b2cgb1z89l5d76irq";
+    stripRoot = false;
+  };
+  ladder2018season2 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season2_Updated.zip";
+    sha256 = "176rs848cx5src7qbr6dnn81bv1i86i381fidk3v81q9bxlmc2rv";
+    stripRoot = false;
+  };
+  ladder2018season3 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season3.zip";
+    sha256 = "1r3wv4w53g9zq6073ajgv74prbdsd1x3zfpyhv1kpxbffyr0x0zp";
+    stripRoot = false;
+  };
+  ladder2018season4 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2018Season4.zip";
+    sha256 = "0k47rr6pzxbanlqnhliwywkvf0w04c8hxmbanksbz6aj5wpkcn1s";
+    stripRoot = false;
+  };
+  ladder2019season1 = fetchzip' {
+    url = "http://blzdistsc2-a.akamaihd.net/MapPacks/Ladder2019Season1.zip";
+    sha256 = "1dlk9zza8h70lbjvg2ykc5wr9vsvvdk02szwrkgdw26mkssl2rg9";
+    stripRoot = false;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/shogun/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/shogun/default.nix
new file mode 100644
index 000000000000..d25bc06385ea
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/shogun/default.nix
@@ -0,0 +1,208 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, fetchurl
+  # build
+, cmake
+, ctags
+, python3Packages
+, swig
+  # math
+, eigen
+, blas
+, lapack
+, glpk
+  # data
+, protobuf
+, json_c
+, libxml2
+, hdf5
+, curl
+  # compression
+, libarchive
+, bzip2
+, xz
+, snappy
+, lzo
+  # more math
+, nlopt
+, lp_solve
+, colpack
+  # extra support
+, pythonSupport ? false
+, opencvSupport ? false
+, opencv ? null
+, withSvmLight ? false
+}:
+
+assert pythonSupport -> python3Packages != null;
+assert opencvSupport -> opencv != null;
+
+assert (!blas.isILP64) && (!lapack.isILP64);
+
+let
+  pname = "shogun";
+  version = "6.1.4";
+
+  rxcppVersion = "4.0.0";
+  gtestVersion = "1.8.0";
+
+  srcs = {
+    toolbox = fetchFromGitHub {
+      owner = "shogun-toolbox";
+      repo = "shogun";
+      rev =  "shogun_${version}";
+      sha256 = "sha256-38aULxK50wQ2+/ERosSpRyBmssmYSGv5aaWfWSlrSRc=";
+      fetchSubmodules = true;
+    };
+
+    # The CMake external projects expect the packed archives
+    rxcpp = fetchurl {
+      url = "https://github.com/Reactive-Extensions/RxCpp/archive/v${rxcppVersion}.tar.gz";
+      sha256 = "sha256-UOc5WrG8KgAA3xJsaSCjbdPE7gSnFJay9MEK31DWUXg=";
+    };
+    gtest = fetchurl {
+      url = "https://github.com/google/googletest/archive/release-${gtestVersion}.tar.gz";
+      sha256 = "sha256-WKb0J3yivIVlIis7vVihd2CenEiOinJkk1m6UUUNt9g=";
+    };
+  };
+in
+
+stdenv.mkDerivation rec {
+  inherit pname version;
+
+  outputs = [ "out" "dev" "doc" ];
+
+  src = srcs.toolbox;
+
+  patches = [
+    # Fix compile errors with GCC 9+
+    # https://github.com/shogun-toolbox/shogun/pull/4811
+    (fetchpatch {
+      url = "https://github.com/shogun-toolbox/shogun/commit/c8b670be4790e0f06804b048a6f3d77c17c3ee95.patch";
+      sha256 = "sha256-MxsR3Y2noFQevfqWK3nmX5iK4OVWeKBl5tfeDNgjcXk=";
+    })
+    (fetchpatch {
+      url = "https://github.com/shogun-toolbox/shogun/commit/5aceefd9fb0e2132c354b9a0c0ceb9160cc9b2f7.patch";
+      sha256 = "sha256-AgJJKQA8vc5oKaTQDqMdwBR4hT4sn9+uW0jLe7GteJw=";
+    })
+
+    # Fix virtual destruction
+    (fetchpatch {
+      url = "https://github.com/shogun-toolbox/shogun/commit/ef0e4dc1cc4a33c9e6b17a108fa38a436de2d7ee.patch";
+      sha256 = "sha256-a9Rm0ytqkSAgC3dguv8m3SwOSipb+VByBHHdmV0d63w=";
+    })
+    ./fix-virtual-destruction.patch
+
+    # Fix compile errors with json-c
+    # https://github.com/shogun-toolbox/shogun/pull/4104
+    (fetchpatch {
+      url = "https://github.com/shogun-toolbox/shogun/commit/365ce4c4c700736d2eec8ba6c975327a5ac2cd9b.patch";
+      sha256 = "sha256-OhEWwrHtD/sOcjHmPY/C9zJ8ruww8yXrRcTw38nGEJU=";
+    })
+
+    # Fix compile errors with Eigen 3.4
+    ./eigen-3.4.patch
+
+  ] ++ lib.optional (!withSvmLight) ./svmlight-scrubber.patch;
+
+  nativeBuildInputs = [ cmake swig ctags ]
+    ++ (with python3Packages; [ python jinja2 ply ]);
+
+  buildInputs = [
+    eigen
+    blas
+    lapack
+    glpk
+    protobuf
+    json_c
+    libxml2
+    hdf5
+    curl
+    libarchive
+    bzip2
+    xz
+    snappy
+    lzo
+    nlopt
+    lp_solve
+    colpack
+  ] ++ lib.optionals pythonSupport (with python3Packages; [ python numpy ])
+    ++ lib.optional opencvSupport opencv;
+
+  cmakeFlags = let
+    enableIf = cond: if cond then "ON" else "OFF";
+    excludeTestsRegex = lib.concatStringsSep "|" [
+      # sporadic segfault
+      "TrainedModelSerialization"
+      # broken by openblas 0.3.21
+      "mathematics_lapack"
+      # these take too long on CI
+      "evaluation_cross_validation"
+      "modelselection_combined_kernel"
+      "modelselection_grid_search"
+    ];
+  in [
+    "-DBUILD_META_EXAMPLES=ON"
+    "-DCMAKE_DISABLE_FIND_PACKAGE_ARPACK=ON"
+    "-DCMAKE_DISABLE_FIND_PACKAGE_ARPREC=ON"
+    "-DCMAKE_DISABLE_FIND_PACKAGE_CPLEX=ON"
+    "-DCMAKE_DISABLE_FIND_PACKAGE_Mosek=ON"
+    "-DCMAKE_DISABLE_FIND_PACKAGE_TFLogger=ON"
+    "-DCMAKE_DISABLE_FIND_PACKAGE_ViennaCL=ON"
+    "-DCMAKE_CTEST_ARGUMENTS=--exclude-regex;'${excludeTestsRegex}'"
+    "-DENABLE_TESTING=${enableIf doCheck}"
+    "-DDISABLE_META_INTEGRATION_TESTS=ON"
+    "-DTRAVIS_DISABLE_META_CPP=ON"
+    "-DINTERFACE_PYTHON=${enableIf pythonSupport}"
+    "-DOpenCV=${enableIf opencvSupport}"
+    "-DUSE_SVMLIGHT=${enableIf withSvmLight}"
+  ];
+
+  CXXFLAGS = "-faligned-new";
+
+  doCheck = true;
+
+  postUnpack = ''
+    mkdir -p $sourceRoot/third_party/{rxcpp,GoogleMock}
+    ln -s ${srcs.rxcpp} $sourceRoot/third_party/rxcpp/v${rxcppVersion}.tar.gz
+    ln -s ${srcs.gtest} $sourceRoot/third_party/GoogleMock/release-${gtestVersion}.tar.gz
+  '';
+
+  postPatch = ''
+    # Fix preprocessing SVMlight code
+    sed -i \
+        -e 's@#ifdef SVMLIGHT@#ifdef USE_SVMLIGHT@' \
+        -e '/^#ifdef USE_SVMLIGHT/,/^#endif/ s@#endif@#endif //USE_SVMLIGHT@' \
+        src/shogun/kernel/string/CommUlongStringKernel.cpp
+    sed -i -e 's/#if USE_SVMLIGHT/#ifdef USE_SVMLIGHT/' src/interfaces/swig/Machine.i
+    sed -i -e 's@// USE_SVMLIGHT@//USE_SVMLIGHT@' src/interfaces/swig/Transfer.i
+    sed -i -e 's@/\* USE_SVMLIGHT \*/@//USE_SVMLIGHT@' src/interfaces/swig/Transfer_includes.i
+  '' + lib.optionalString (!withSvmLight) ''
+    # Run SVMlight scrubber
+    patchShebangs scripts/light-scrubber.sh
+    echo "removing SVMlight code"
+    ./scripts/light-scrubber.sh
+  '';
+
+  postInstall = ''
+    mkdir -p $doc/share/doc/shogun/examples
+    mv $out/share/shogun/examples/cpp $doc/share/doc/shogun/examples
+    cp ../examples/undocumented/libshogun/*.cpp $doc/share/doc/shogun/examples/cpp
+    rm -r $out/share
+  '';
+
+  postFixup = ''
+    # CMake incorrectly calculates library path from dev prefix
+    substituteInPlace $dev/lib/cmake/shogun/ShogunTargets-release.cmake \
+      --replace "\''${_IMPORT_PREFIX}/lib/" "$out/lib/"
+  '';
+
+  meta = with lib; {
+    description = "A toolbox which offers a wide range of efficient and unified machine learning methods";
+    homepage = "http://shogun-toolbox.org/";
+    license = if withSvmLight then licenses.unfree else licenses.gpl3Plus;
+    maintainers = with maintainers; [ edwtjo smancill ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/shogun/eigen-3.4.patch b/nixpkgs/pkgs/applications/science/machine-learning/shogun/eigen-3.4.patch
new file mode 100644
index 000000000000..863bd75918b0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/shogun/eigen-3.4.patch
@@ -0,0 +1,74 @@
+From: Sebastián Mancilla <smancill@smancill.dev>
+Subject: [PATCH] Fix compile errors when using Eigen 3.4
+
+---
+ .../machine/gp/MultiLaplaceInferenceMethod.cpp | 18 +++++++++---------
+ 1 file changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp b/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp
+index 2e27678d2..60050afea 100644
+--- a/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp
++++ b/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp
+@@ -84,9 +84,9 @@ class CMultiPsiLine : public func_base
+ 		float64_t result=0;
+ 		for(index_t bl=0; bl<C; bl++)
+ 		{
+-			eigen_f.block(bl*n,0,n,1)=K*alpha->block(bl*n,0,n,1)*CMath::exp(log_scale*2.0);
+-			result+=alpha->block(bl*n,0,n,1).dot(eigen_f.block(bl*n,0,n,1))/2.0;
+-			eigen_f.block(bl*n,0,n,1)+=eigen_m;
++			eigen_f.segment(bl*n,n)=K*alpha->segment(bl*n,n)*CMath::exp(log_scale*2.0);
++			result+=alpha->segment(bl*n,n).dot(eigen_f.segment(bl*n,n))/2.0;
++			eigen_f.segment(bl*n,n)+=eigen_m;
+ 		}
+ 
+ 		// get first and second derivatives of log likelihood
+@@ -272,7 +272,7 @@ void CMultiLaplaceInferenceMethod::update_alpha()
+ 	{
+ 		Map<VectorXd> alpha(m_alpha.vector, m_alpha.vlen);
+ 		for(index_t bl=0; bl<C; bl++)
+-			eigen_mu.block(bl*n,0,n,1)=eigen_ktrtr*CMath::exp(m_log_scale*2.0)*alpha.block(bl*n,0,n,1);
++			eigen_mu.segment(bl*n,n)=eigen_ktrtr*CMath::exp(m_log_scale*2.0)*alpha.segment(bl*n,n);
+ 
+ 		//alpha'*(f-m)/2.0
+ 		Psi_New=alpha.dot(eigen_mu)/2.0;
+@@ -316,7 +316,7 @@ void CMultiLaplaceInferenceMethod::update_alpha()
+ 
+ 		for(index_t bl=0; bl<C; bl++)
+ 		{
+-			VectorXd eigen_sD=eigen_dpi.block(bl*n,0,n,1).cwiseSqrt();
++			VectorXd eigen_sD=eigen_dpi.segment(bl*n,n).cwiseSqrt();
+ 			LLT<MatrixXd> chol_tmp((eigen_sD*eigen_sD.transpose()).cwiseProduct(eigen_ktrtr*CMath::exp(m_log_scale*2.0))+
+ 				MatrixXd::Identity(m_ktrtr.num_rows, m_ktrtr.num_cols));
+ 			MatrixXd eigen_L_tmp=chol_tmp.matrixU();
+@@ -341,11 +341,11 @@ void CMultiLaplaceInferenceMethod::update_alpha()
+ 		VectorXd tmp2=m_tmp.array().rowwise().sum();
+ 
+ 		for(index_t bl=0; bl<C; bl++)
+-			eigen_b.block(bl*n,0,n,1)+=eigen_dpi.block(bl*n,0,n,1).cwiseProduct(eigen_mu.block(bl*n,0,n,1)-eigen_mean_bl-tmp2);
++			eigen_b.segment(bl*n,n)+=eigen_dpi.segment(bl*n,n).cwiseProduct(eigen_mu.segment(bl*n,n)-eigen_mean_bl-tmp2);
+ 
+ 		Map<VectorXd> &eigen_c=eigen_W;
+ 		for(index_t bl=0; bl<C; bl++)
+-			eigen_c.block(bl*n,0,n,1)=eigen_E.block(0,bl*n,n,n)*(eigen_ktrtr*CMath::exp(m_log_scale*2.0)*eigen_b.block(bl*n,0,n,1));
++			eigen_c.segment(bl*n,n)=eigen_E.block(0,bl*n,n,n)*(eigen_ktrtr*CMath::exp(m_log_scale*2.0)*eigen_b.segment(bl*n,n));
+ 
+ 		Map<MatrixXd> c_tmp(eigen_c.data(),n,C);
+ 
+@@ -409,7 +409,7 @@ float64_t CMultiLaplaceInferenceMethod::get_derivative_helper(SGMatrix<float64_t
+ 	{
+ 		result+=((eigen_E.block(0,bl*n,n,n)-eigen_U.block(0,bl*n,n,n).transpose()*eigen_U.block(0,bl*n,n,n)).array()
+ 			*eigen_dK.array()).sum();
+-		result-=(eigen_dK*eigen_alpha.block(bl*n,0,n,1)).dot(eigen_alpha.block(bl*n,0,n,1));
++		result-=(eigen_dK*eigen_alpha.segment(bl*n,n)).dot(eigen_alpha.segment(bl*n,n));
+ 	}
+ 
+ 	return result/2.0;
+@@ -489,7 +489,7 @@ SGVector<float64_t> CMultiLaplaceInferenceMethod::get_derivative_wrt_mean(
+ 		result[i]=0;
+ 		//currently only compute the explicit term
+ 		for(index_t bl=0; bl<C; bl++)
+-			result[i]-=eigen_alpha.block(bl*n,0,n,1).dot(eigen_dmu);
++			result[i]-=eigen_alpha.segment(bl*n,n).dot(eigen_dmu);
+ 	}
+ 
+ 	return result;
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/shogun/fix-virtual-destruction.patch b/nixpkgs/pkgs/applications/science/machine-learning/shogun/fix-virtual-destruction.patch
new file mode 100644
index 000000000000..16a6041748fa
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/shogun/fix-virtual-destruction.patch
@@ -0,0 +1,20 @@
+From: Sebastián Mancilla <smancill@smancill.dev>
+Subject: Fix virtual destruction
+
+---
+ src/shogun/solver/LDASolver.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/shogun/solver/LDASolver.h b/src/shogun/solver/LDASolver.h
+index 9300a85c5..d500eca5d 100644
+--- a/src/shogun/solver/LDASolver.h
++++ b/src/shogun/solver/LDASolver.h
+@@ -87,7 +87,7 @@ namespace shogun
+ 			compute_within_cov();
+ 		}
+ 
+-		~LDASolver()
++		virtual ~LDASolver()
+ 		{
+ 			SG_UNREF(m_features)
+ 			SG_UNREF(m_labels)
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/shogun/svmlight-scrubber.patch b/nixpkgs/pkgs/applications/science/machine-learning/shogun/svmlight-scrubber.patch
new file mode 100644
index 000000000000..2958e6ce5dae
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/shogun/svmlight-scrubber.patch
@@ -0,0 +1,76 @@
+From: Sebastián Mancilla <smancill@smancill.dev>
+Subject: Update SVMlight scrubber script
+
+This requires previously fixing a few wrong preprocessor directives that
+are supposed to fence code using SVMlight.
+
+- The script was too eager and removing *.light files in SVMlight format
+  that are used by other tests. The code reading those files doesn't use
+  any SVMlight code so it should be fine to keep it and run the tests.
+
+- The Python test *domainadaptationsvm.py was not removed because of
+  wrong globbing.
+
+- Remove a couple of examples using SVMlight that were missed.
+
+- The script is actually modifying (and breaking) itself because the
+  grep for the USE_SVMLIGHT macro is too eager again and matches itself
+  (and the version stored in upstream's Debian package control tarball
+  is broken because of it). Just fix it by grepping for preprocessor
+  directives only.
+
+- No need to fix the Transfer_includes.i file in the script with a final
+  %} when its preprocessor directives have been fixed.
+
+- The Swig files were moved to a new directory at some point but the
+  script was not updated accordingly.
+---
+ scripts/light-scrubber.sh | 16 ++++++----------
+ 1 file changed, 6 insertions(+), 10 deletions(-)
+
+diff a/scripts/light-scrubber.sh b/scripts/light-scrubber.sh
+--- a/scripts/light-scrubber.sh
++++ b/scripts/light-scrubber.sh
+@@ -26,14 +26,16 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ #
+-rm -rf	examples/*/*/{*light*,*_domainadaptationsvm_*}				\
++rm -rf	examples/*/*/{*light*.*,*domainadaptationsvm*}				\
+ 	examples/undocumented/matlab_and_octave/tests/*light*			\
++	examples/undocumented/python/serialization_string_kernels.py		\
++	examples/undocumented/python/mkl_binclass.py				\
+ 	src/shogun/classifier/svm/SVMLight.*					\
+ 	src/shogun/classifier/svm/SVMLightOneClass.*				\
+ 	src/shogun/regression/svr/SVRLight.*					\
+ 	doc/md/LICENSE_SVMlight*
+ 
+-for _file in `grep -rl USE_SVMLIGHT .`
++grep -rl '^#ifdef USE_SVMLIGHT' . | while read -r _file
+ do
+   sed -i.orig -e								\
+ 	'/\#ifdef USE_SVMLIGHT/,/\#endif \/\/USE_SVMLIGHT/c \\' ${_file} &&	\
+@@ -41,7 +43,7 @@ do
+   rm -rf ${_file}.orig
+ done
+ 
+-for _file in `find . -depth -name 'CMakeLists.txt'`
++find . -depth -name 'CMakeLists.txt' | while read -r _file
+ do
+   sed -i.orig -e 's!.*_sv[mr]light_.*!!g' ${_file} &&				\
+   touch -r ${_file}.orig ${_file} &&						\
+@@ -56,13 +58,7 @@ do
+   rm -rf ${_file}.orig
+ done
+ 
+-_file="src/interfaces/modular/Transfer_includes.i" &&				\
+-cp -a ${_file} ${_file}.orig &&							\
+-echo '%}' >> ${_file} &&							\
+-touch -r ${_file}.orig ${_file} &&						\
+-rm -rf ${_file}.orig
+-
+-_file="src/interfaces/modular/Machine.i" &&					\
++_file="src/interfaces/swig/Machine.i" &&					\
+ sed -i.orig -e '/.*CSVRLight.*/d' ${_file} &&					\
+ touch -r ${_file}.orig ${_file} &&						\
+ rm -rf ${_file}.orig
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/starspace/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/starspace/default.nix
new file mode 100644
index 000000000000..f4ca74ef5bbf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/starspace/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchFromGitHub, boost, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "starspace";
+  version = "unstable-2019-12-13";
+
+  src = fetchFromGitHub {
+    owner = "facebookresearch";
+    repo = pname;
+    rev = "8aee0a950aa607c023e5c91cff518bec335b5df5";
+    sha256 = "0sc7a37z1skb9377a1qs8ggwrkz0nmpybx7sms38xj05b702kbvj";
+  };
+
+  buildInputs = [ boost zlib ];
+
+  makeFlags = [
+    "CXX=${stdenv.cc.targetPrefix}c++"
+    "BOOST_DIR=${boost.dev}/include"
+  ];
+
+  preBuild = ''
+    cp makefile_compress makefile
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mv starspace $out/bin
+  '';
+
+  meta = with lib; {
+    # Does not build against gcc-13. No development activity upstream
+    # for past few years.
+    broken = true;
+    description = "General-purpose neural model for efficient learning of entity embeddings";
+    homepage = "https://ai.facebook.com/tools/starspace/";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.mausch ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/uarmsolver/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/uarmsolver/default.nix
new file mode 100644
index 000000000000..12bca5531364
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/uarmsolver/default.nix
@@ -0,0 +1,32 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "uarmsolver";
+  version = "0.2.6";
+
+  src = fetchFromGitHub {
+   owner = "firefly-cpp";
+   repo = "uARMSolver";
+   rev = version;
+   sha256 = "sha256-E8hc7qoIDaNERMUhVlh+iBvQX1odzd/szeMSh8TCNFo=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  installPhase = ''
+    install -D -t $out/bin uARMSolver
+  '';
+
+  meta = with lib; {
+    description = "universal Association Rule Mining Solver";
+    mainProgram = "uARMSolver";
+    homepage    = "https://github.com/firefly-cpp/uARMSolver";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ firefly-cpp ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/vowpal-wabbit/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/vowpal-wabbit/default.nix
new file mode 100644
index 000000000000..ed0c6bf679d9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/vowpal-wabbit/default.nix
@@ -0,0 +1,64 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, boost, eigen, rapidjson, spdlog, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "vowpal-wabbit";
+  version = "9.6.0";
+
+  src = fetchFromGitHub {
+    owner = "VowpalWabbit";
+    repo = "vowpal_wabbit";
+    rev = version;
+    sha256 = "sha256-iSsxpeTRZjIhZaYBeoKLHl9j1aBIXWjONmAInmKvU/I=";
+  };
+
+  patches = [
+    # Fix x86_64-linux build by adding missing include
+    # https://github.com/VowpalWabbit/vowpal_wabbit/pull/4275
+    (fetchpatch {
+      url = "https://github.com/VowpalWabbit/vowpal_wabbit/commit/0cb410dfc885ca1ecafd1f8a962b481574fb3b82.patch";
+      sha256 = "sha256-bX3eJ+vMTEMAo3EiESQTDryBP0h2GtnMa/Fz0rTeaNY=";
+    })
+
+    # Fix gcc-13 build:
+    #   https://github.com/VowpalWabbit/vowpal_wabbit/pull/4657
+    (fetchpatch {
+      name = "gcc-13.patch";
+      url = "https://github.com/VowpalWabbit/vowpal_wabbit/commit/a541d85a66088d2b74fa2562d32fecb68af33c58.patch";
+      includes = [ "vowpalwabbit/core/include/vw/core/named_labels.h" ];
+      hash = "sha256-JAuLDe5JtlE7/043RSIKM20Qr77rmuE0rVg/DGc95MY=";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [
+    boost
+    eigen
+    rapidjson
+    spdlog
+    zlib
+  ];
+
+  cmakeFlags = [
+    "-DVW_INSTALL=ON"
+    "-DBUILD_JAVA=OFF"
+    "-DBUILD_PYTHON=OFF"
+    "-DRAPIDJSON_SYS_DEP=ON"
+    "-DFMT_SYS_DEP=ON"
+    "-DSPDLOG_SYS_DEP=ON"
+    "-DVW_BOOST_MATH_SYS_DEP=ON"
+    "-DVW_EIGEN_SYS_DEP=ON"
+  ];
+
+  meta = with lib; {
+    description = "Machine learning system focused on online reinforcement learning";
+    homepage = "https://github.com/VowpalWabbit/vowpal_wabbit/";
+    license = licenses.bsd3;
+    longDescription = ''
+      Machine learning system which pushes the frontier of machine learning with techniques such as online,
+      hashing, allreduce, reductions, learning2search, active, and interactive and reinforcement learning
+    '';
+    maintainers = with maintainers; [ jackgerrits ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/4ti2/default.nix b/nixpkgs/pkgs/applications/science/math/4ti2/default.nix
new file mode 100644
index 000000000000..9424612c7587
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/4ti2/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, glpk
+, gmp
+}:
+
+stdenv.mkDerivation rec{
+  pname = "4ti2";
+  version = "1.6.10";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "Release_${builtins.replaceStrings ["."] ["_"] version}";
+    hash = "sha256-Rz8O1Tf81kzpTGPq7dkZJvv444F1/VqKu7VuRvH59kQ=";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
+  buildInputs = [
+    glpk
+    gmp
+  ];
+
+  installFlags = [ "install-exec" ];
+
+  meta = with lib;{
+    homepage = "https://4ti2.github.io/";
+    description = "A software package for algebraic, geometric and combinatorial problems on linear spaces";
+    license = with licenses; [ gpl2Plus ];
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/LiE/default.nix b/nixpkgs/pkgs/applications/science/math/LiE/default.nix
new file mode 100644
index 000000000000..7eb9edbb3b19
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/LiE/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchurl
+, bison, readline }:
+
+stdenv.mkDerivation {
+  version = "2.2.2";
+     # The current version of LiE is 2.2.2, which is more or less unchanged
+     # since about the year 2000. Minor bugfixes do get applied now and then.
+  pname = "lie";
+
+  meta = {
+    description = "A Computer algebra package for Lie group computations";
+    mainProgram = "lie";
+    homepage = "http://wwwmathlabo.univ-poitiers.fr/~maavl/LiE/";
+    license = lib.licenses.lgpl3; # see the website
+
+    longDescription = ''
+      LiE is a computer algebra system that is specialised in computations
+      involving (reductive) Lie groups and their representations. It is
+      publicly available for free in source code. For a description of its
+      characteristics, we refer to the following sources of information.
+    ''; # take from the website
+
+    platforms = lib.platforms.linux;
+    maintainers = [ ]; # this package is probably not going to change anyway
+  };
+
+  src = fetchurl {
+    url = "http://wwwmathlabo.univ-poitiers.fr/~maavl/LiE/conLiE.tar.gz";
+    sha256 = "07lbj75qqr4pq1j1qz8fyfnmrz1gnk92lnsshxycfavxl5zzdmn4";
+  };
+
+  buildInputs = [ bison readline ];
+
+  patchPhase = ''
+    substituteInPlace make_lie \
+      --replace \`/bin/pwd\` $out
+  '';
+
+  installPhase = ''
+    mkdir -vp $out/bin
+
+    cp -v Lie.exe $out
+    cp -v lie $out/bin
+
+    cp -v LEARN* $out
+    cp -v INFO* $out
+  '';
+}
diff --git a/nixpkgs/pkgs/applications/science/math/R/default.nix b/nixpkgs/pkgs/applications/science/math/R/default.nix
new file mode 100644
index 000000000000..acfc38686ea4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/R/default.nix
@@ -0,0 +1,150 @@
+{ lib, stdenv, fetchurl, bzip2, gfortran, libX11, libXmu, libXt, libjpeg, libpng
+, libtiff, ncurses, pango, pcre2, perl, readline, tcl, texlive, texliveSmall, tk, xz, zlib
+, less, texinfo, graphviz, icu, pkg-config, bison, imake, which, jdk, blas, lapack
+, curl, Cocoa, Foundation, libobjc, libcxx, tzdata
+, withRecommendedPackages ? true
+, enableStrictBarrier ? false
+, enableMemoryProfiling ? false
+# R as of writing does not support outputting both .so and .a files; it outputs:
+#     --enable-R-static-lib conflicts with --enable-R-shlib and will be ignored
+, static ? false
+, testers
+}:
+
+assert (!blas.isILP64) && (!lapack.isILP64);
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "R";
+  version = "4.3.3";
+
+  src = let
+    inherit (finalAttrs) pname version;
+  in fetchurl {
+    url = "https://cran.r-project.org/src/base/R-${lib.versions.major version}/${pname}-${version}.tar.gz";
+    sha256 = "sha256-gIUSMTk7hb84d+6eObKC51Dthkxexgy9aObhOfBSAzA=";
+  };
+
+  outputs = [ "out" "tex" ];
+
+  dontUseImakeConfigure = true;
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    bzip2 gfortran libX11 libXmu libXt libXt libjpeg libpng libtiff ncurses
+    pango pcre2 perl readline (texliveSmall.withPackages (ps: with ps; [ inconsolata helvetic ps.texinfo fancyvrb cm-super rsfs ])) xz zlib less texinfo graphviz icu
+    bison imake which blas lapack curl tcl tk jdk tzdata
+  ] ++ lib.optionals stdenv.isDarwin [ Cocoa Foundation libobjc libcxx ];
+
+  patches = [
+    ./no-usr-local-search-paths.patch
+  ];
+
+  # Test of the examples for package 'tcltk' fails in Darwin sandbox. See:
+  # https://github.com/NixOS/nixpkgs/issues/146131
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace configure \
+      --replace "-install_name libRblas.dylib" "-install_name $out/lib/R/lib/libRblas.dylib" \
+      --replace "-install_name libRlapack.dylib" "-install_name $out/lib/R/lib/libRlapack.dylib" \
+      --replace "-install_name libR.dylib" "-install_name $out/lib/R/lib/libR.dylib"
+    substituteInPlace tests/Examples/Makefile.in \
+      --replace "test-Examples: test-Examples-Base" "test-Examples:" # do not test the examples
+  '';
+
+  dontDisableStatic = static;
+
+  preConfigure = ''
+    configureFlagsArray=(
+      --disable-lto
+      --with${lib.optionalString (!withRecommendedPackages) "out"}-recommended-packages
+      --with-blas="-L${blas}/lib -lblas"
+      --with-lapack="-L${lapack}/lib -llapack"
+      --with-readline
+      --with-tcltk --with-tcl-config="${tcl}/lib/tclConfig.sh" --with-tk-config="${tk}/lib/tkConfig.sh"
+      --with-cairo
+      --with-libpng
+      --with-jpeglib
+      --with-libtiff
+      --with-ICU
+      ${lib.optionalString enableStrictBarrier "--enable-strict-barrier"}
+      ${lib.optionalString enableMemoryProfiling "--enable-memory-profiling"}
+      ${if static then "--enable-R-static-lib" else "--enable-R-shlib"}
+      AR=$(type -p ar)
+      AWK=$(type -p gawk)
+      CC=$(type -p cc)
+      CXX=$(type -p c++)
+      FC="${gfortran}/bin/gfortran" F77="${gfortran}/bin/gfortran"
+      JAVA_HOME="${jdk}"
+      RANLIB=$(type -p ranlib)
+      r_cv_have_curl728=yes
+      R_SHELL="${stdenv.shell}"
+  '' + lib.optionalString stdenv.isDarwin ''
+      --disable-R-framework
+      --without-x
+      OBJC="clang"
+      CPPFLAGS="-isystem ${lib.getDev libcxx}/include/c++/v1"
+      LDFLAGS="-L${lib.getLib libcxx}/lib"
+  '' + ''
+    )
+    echo >>etc/Renviron.in "TCLLIBPATH=${tk}/lib"
+    echo >>etc/Renviron.in "TZDIR=${tzdata}/share/zoneinfo"
+  '';
+
+  installTargets = [ "install" "install-info" "install-pdf" ];
+
+  # move tex files to $tex for use with texlive.combine
+  # add link in $out since ${R_SHARE_DIR}/texmf is hardcoded in several places
+  postInstall = ''
+    mv -T "$out/lib/R/share/texmf" "$tex"
+    ln -s "$tex" "$out/lib/R/share/texmf"
+  '';
+
+  # The store path to "which" is baked into src/library/base/R/unix/system.unix.R,
+  # but Nix cannot detect it as a run-time dependency because the installed file
+  # is compiled and compressed, which hides the store path.
+  postFixup = "echo ${which} > $out/nix-support/undetected-runtime-dependencies";
+
+  doCheck = true;
+  preCheck = "export HOME=$TMPDIR; export TZ=CET; bin/Rscript -e 'sessionInfo()'";
+
+  enableParallelBuilding = true;
+
+  setupHook = ./setup-hook.sh;
+
+  passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
+
+  # make tex output available to texlive.combine
+  passthru.pkgs = [ finalAttrs.finalPackage.tex ];
+  passthru.tlType = "run";
+  # dependencies (based on \RequirePackage in jss.cls, Rd.sty, Sweave.sty)
+  passthru.tlDeps = with texlive; [ amsfonts amsmath fancyvrb graphics hyperref iftex jknapltx latex lm tools upquote url ];
+
+  meta = with lib; {
+    homepage = "http://www.r-project.org/";
+    description = "Free software environment for statistical computing and graphics";
+    license = licenses.gpl2Plus;
+
+    longDescription = ''
+      GNU R is a language and environment for statistical computing and
+      graphics that provides a wide variety of statistical (linear and
+      nonlinear modelling, classical statistical tests, time-series
+      analysis, classification, clustering, ...) and graphical
+      techniques, and is highly extensible. One of R's strengths is the
+      ease with which well-designed publication-quality plots can be
+      produced, including mathematical symbols and formulae where
+      needed. R is an integrated suite of software facilities for data
+      manipulation, calculation and graphical display. It includes an
+      effective data handling and storage facility, a suite of operators
+      for calculations on arrays, in particular matrices, a large,
+      coherent, integrated collection of intermediate tools for data
+      analysis, graphical facilities for data analysis and display
+      either on-screen or on hardcopy, and a well-developed, simple and
+      effective programming language which includes conditionals, loops,
+      user-defined recursive functions and input and output facilities.
+    '';
+
+    pkgConfigModules = [ "libR" ];
+    platforms = platforms.all;
+
+    maintainers = with maintainers; [ jbedo ] ++ teams.sage.members;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/math/R/no-usr-local-search-paths.patch b/nixpkgs/pkgs/applications/science/math/R/no-usr-local-search-paths.patch
new file mode 100644
index 000000000000..6c7f6d4ee02a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/R/no-usr-local-search-paths.patch
@@ -0,0 +1,24 @@
+diff -ubr R-3.0.1-orig/configure R-3.0.1/configure
+--- R-3.0.1-orig/configure	2013-07-04 10:46:42.336133947 +0200
++++ R-3.0.1/configure	2013-07-04 10:46:17.181919960 +0200
+@@ -3800,13 +3800,13 @@
+ : ${LIBnn=$libnn}
+ ## We provide these defaults so that headers and libraries in
+ ## '/usr/local' are found (by the native tools, mostly).
+-if test -f "/sw/etc/fink.conf"; then
+-  : ${CPPFLAGS="-I/sw/include -I/usr/local/include"}
+-  : ${LDFLAGS="-L/sw/lib -L/usr/local/lib"}
+-else
+-  : ${CPPFLAGS="-I/usr/local/include"}
+-  : ${LDFLAGS="-L/usr/local/${LIBnn}"}
+-fi
++# if test -f "/sw/etc/fink.conf"; then
++#   : ${CPPFLAGS="-I/sw/include -I/usr/local/include"}
++#   : ${LDFLAGS="-L/sw/lib -L/usr/local/lib"}
++# else
++#   : ${CPPFLAGS="-I/usr/local/include"}
++#   : ${LDFLAGS="-L/usr/local/${LIBnn}"}
++# fi
+ 
+ ## take care not to  override the command-line setting
+ if test "${libdir}" = '${exec_prefix}/lib'; then
diff --git a/nixpkgs/pkgs/applications/science/math/R/setup-hook.sh b/nixpkgs/pkgs/applications/science/math/R/setup-hook.sh
new file mode 100644
index 000000000000..6951e2a4b61b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/R/setup-hook.sh
@@ -0,0 +1,7 @@
+addRLibPath () {
+    if [[ -d "$1/library" ]]; then
+        addToSearchPath R_LIBS_SITE "$1/library"
+    fi
+}
+
+addEnvHooks "$targetOffset" addRLibPath
diff --git a/nixpkgs/pkgs/applications/science/math/adolc/default.nix b/nixpkgs/pkgs/applications/science/math/adolc/default.nix
new file mode 100644
index 000000000000..636c3ea177a0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/adolc/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "adolc";
+  version = "2.7.2";
+
+  src = fetchFromGitHub {
+    owner = "coin-or";
+    repo = "ADOL-C";
+    sha256 = "1w0x0p32r1amfmh2lyx33j4cb5bpkwjr5z0ll43zi5wf5gsvckd1";
+    rev = "releases/${version}";
+  };
+
+  configureFlags = [ "--with-openmp-flag=-fopenmp" ];
+
+  meta = with lib; {
+    description = "Automatic Differentiation of C/C++";
+    homepage = "https://github.com/coin-or/ADOL-C";
+    maintainers = [ maintainers.bzizou ];
+    license = licenses.gpl2Plus;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/science/math/almonds/default.nix b/nixpkgs/pkgs/applications/science/math/almonds/default.nix
new file mode 100644
index 000000000000..2b05b552253d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/almonds/default.nix
@@ -0,0 +1,27 @@
+{ lib, python3, fetchFromGitHub, ncurses }:
+
+with python3.pkgs; buildPythonApplication rec {
+  pname = "almonds";
+  version = "1.25b";
+
+  src = fetchFromGitHub {
+    owner = "Tenchi2xh";
+    repo = "Almonds";
+    rev = version;
+    sha256 = "0j8d8jizivnfx8lpc4w6sbqj5hq35nfz0vdg7ld80sc5cs7jr3ws";
+  };
+
+  nativeBuildInputs = [ pytest ];
+  buildInputs = [ ncurses ];
+  propagatedBuildInputs = [ pillow ];
+
+  checkPhase = "py.test";
+
+  meta = with lib; {
+    description = "Terminal Mandelbrot fractal viewer";
+    mainProgram = "almonds";
+    homepage = "https://github.com/Tenchi2xh/Almonds";
+    license = licenses.mit;
+    maintainers = with maintainers; [ infinisil ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/bcal/default.nix b/nixpkgs/pkgs/applications/science/math/bcal/default.nix
new file mode 100644
index 000000000000..9ba028d1cb65
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/bcal/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, readline
+, bc
+, python3Packages
+}:
+
+stdenv.mkDerivation rec {
+  pname = "bcal";
+  version = "2.4";
+
+  src = fetchFromGitHub {
+    owner = "jarun";
+    repo = "bcal";
+    rev = "v${version}";
+    sha256 = "sha256-PleWU2yyJzkUAZEvEYoCGdpEXqOgRvZK9zXTYrxRtQU=";
+  };
+
+  buildInputs = [ readline ];
+
+  installFlags = [ "PREFIX=$(out)" ];
+
+  doCheck = true;
+
+  nativeCheckInputs = [ bc python3Packages.pytestCheckHook ];
+
+  pytestFlagsArray = [ "test.py" ];
+
+  meta = with lib; {
+    description = "Storage conversion and expression calculator";
+    mainProgram = "bcal";
+    homepage = "https://github.com/jarun/bcal";
+    license = licenses.gpl3Only;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/bliss/default.nix b/nixpkgs/pkgs/applications/science/math/bliss/default.nix
new file mode 100644
index 000000000000..33969c705d05
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/bliss/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, unzip, doxygen }:
+
+stdenv.mkDerivation rec {
+  pname = "bliss";
+  version = "0.73";
+
+  src = fetchurl {
+    url = "http://www.tcs.hut.fi/Software/bliss/${pname}-${version}.zip";
+    sha256 = "f57bf32804140cad58b1240b804e0dbd68f7e6bf67eba8e0c0fa3a62fd7f0f84";
+  };
+
+  patches = fetchurl {
+    url = "http://scip.zib.de/download/bugfixes/scip-5.0.1/bliss-0.73.patch";
+    sha256 = "815868d6586bcd49ff3c28e14ccb536d38b2661151088fe08187c13909c5dab0";
+  };
+
+  nativeBuildInputs = [ unzip doxygen ];
+
+  preBuild = ''
+    doxygen Doxyfile
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/doc/bliss $out/lib $out/include/bliss
+    mv bliss $out/bin
+    mv html/* COPYING* $out/share/doc/bliss
+    mv *.a $out/lib
+    mv *.h *.hh $out/include/bliss
+  '';
+
+  meta = with lib; {
+    description = "An open source tool for computing automorphism groups and canonical forms of graphs. It has both a command line user interface as well as C++ and C programming language APIs";
+    mainProgram = "bliss";
+    homepage = "http://www.tcs.hut.fi/Software/bliss/";
+    license = licenses.lgpl3;
+    platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/caffe/darwin.patch b/nixpkgs/pkgs/applications/science/math/caffe/darwin.patch
new file mode 100644
index 000000000000..e8fa6a683f73
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/caffe/darwin.patch
@@ -0,0 +1,47 @@
+diff --git a/Makefile b/Makefile
+index c823f66e..65b90c5e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -32,9 +32,9 @@ SRC_DIRS := $(shell find * -type d -exec bash -c "find {} -maxdepth 1 \
+ LIBRARY_NAME := $(PROJECT)
+ LIB_BUILD_DIR := $(BUILD_DIR)/lib
+ STATIC_NAME := $(LIB_BUILD_DIR)/lib$(LIBRARY_NAME).a
+-DYNAMIC_VERSION_MAJOR 		:= 1
+-DYNAMIC_VERSION_MINOR 		:= 0
+-DYNAMIC_VERSION_REVISION 	:= 0
++DYNAMIC_VERSION_MAJOR		:= 1
++DYNAMIC_VERSION_MINOR		:= 0
++DYNAMIC_VERSION_REVISION	:= 0
+ DYNAMIC_NAME_SHORT := lib$(LIBRARY_NAME).so
+ #DYNAMIC_SONAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR)
+ DYNAMIC_VERSIONED_NAME_SHORT := $(DYNAMIC_NAME_SHORT).$(DYNAMIC_VERSION_MAJOR).$(DYNAMIC_VERSION_MINOR).$(DYNAMIC_VERSION_REVISION)
+diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
+index c48255c8..cf4c580e 100644
+--- a/cmake/Dependencies.cmake
++++ b/cmake/Dependencies.cmake
+@@ -105,7 +105,6 @@ if(USE_OPENCV)
+ endif()
+ 
+ # ---[ BLAS
+-if(NOT APPLE)
+   set(BLAS "Atlas" CACHE STRING "Selected BLAS library")
+   set_property(CACHE BLAS PROPERTY STRINGS "Atlas;Open;MKL")
+ 
+@@ -123,17 +122,6 @@ if(NOT APPLE)
+     list(APPEND Caffe_LINKER_LIBS PUBLIC ${MKL_LIBRARIES})
+     list(APPEND Caffe_DEFINITIONS PUBLIC -DUSE_MKL)
+   endif()
+-elseif(APPLE)
+-  find_package(vecLib REQUIRED)
+-  list(APPEND Caffe_INCLUDE_DIRS PUBLIC ${vecLib_INCLUDE_DIR})
+-  list(APPEND Caffe_LINKER_LIBS PUBLIC ${vecLib_LINKER_LIBS})
+-
+-  if(VECLIB_FOUND)
+-    if(NOT vecLib_INCLUDE_DIR MATCHES "^/System/Library/Frameworks/vecLib.framework.*")
+-      list(APPEND Caffe_DEFINITIONS PUBLIC -DUSE_ACCELERATE)
+-    endif()
+-  endif()
+-endif()
+ 
+ # ---[ Python
+ if(BUILD_python)
diff --git a/nixpkgs/pkgs/applications/science/math/caffe/default.nix b/nixpkgs/pkgs/applications/science/math/caffe/default.nix
new file mode 100644
index 000000000000..25f7229a845a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/caffe/default.nix
@@ -0,0 +1,162 @@
+{ config, stdenv, lib
+, fetchFromGitHub
+, fetchurl
+, fetchpatch
+, cmake
+, boost
+, gflags
+, glog
+, hdf5-cpp
+, opencv4
+, protobuf
+, doxygen
+, blas
+, Accelerate, CoreGraphics, CoreVideo
+, lmdbSupport ? true, lmdb
+, leveldbSupport ? true, leveldb, snappy
+, cudaSupport ? config.cudaSupport, cudaPackages ? { }
+, cudnnSupport ? cudaSupport
+, ncclSupport ? false
+, pythonSupport ? false, python ? null, numpy ? null
+, substituteAll
+}:
+
+let
+  inherit (cudaPackages) cudatoolkit nccl;
+  # The default for cudatoolkit 10.1 is CUDNN 8.0.5, the last version to support CUDA 10.1.
+  # However, this caffe does not build with CUDNN 8.x, so we use CUDNN 7.6.5 instead.
+  # Earlier versions of cudatoolkit use pre-8.x CUDNN, so we use the default.
+  hasCudnn =
+    if lib.versionOlder cudatoolkit.version "10.1"
+    then cudaPackages ? cudnn
+    else cudaPackages ? cudnn_7_6;
+
+  toggle = bool: if bool then "ON" else "OFF";
+
+  test_model_weights = fetchurl {
+    url = "http://dl.caffe.berkeleyvision.org/bvlc_reference_caffenet.caffemodel";
+    sha256 = "472d4a06035497b180636d8a82667129960371375bd10fcb6df5c6c7631f25e0";
+  };
+in
+
+stdenv.mkDerivation rec {
+  pname = "caffe";
+  version = "1.0";
+
+  src = fetchFromGitHub {
+    owner = "BVLC";
+    repo = "caffe";
+    rev = version;
+    sha256 = "104jp3cm823i3cdph7hgsnj6l77ygbwsy35mdmzhmsi4jxprd9j3";
+  };
+
+  nativeBuildInputs = [ cmake doxygen ];
+
+  cmakeFlags =
+    # It's important that caffe is passed the major and minor version only because that's what
+    # boost_python expects
+    [ (if pythonSupport then "-Dpython_version=${python.pythonVersion}" else "-DBUILD_python=OFF")
+      "-DBLAS=open"
+    ] ++ (if cudaSupport then [
+           "-DCUDA_ARCH_NAME=All"
+           "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc"
+         ] else [ "-DCPU_ONLY=ON" ])
+      ++ ["-DUSE_NCCL=${toggle ncclSupport}"]
+      ++ ["-DUSE_LEVELDB=${toggle leveldbSupport}"]
+      ++ ["-DUSE_LMDB=${toggle lmdbSupport}"];
+
+  buildInputs = [ boost gflags glog protobuf hdf5-cpp opencv4 blas ]
+                ++ lib.optional cudaSupport cudatoolkit
+                ++ lib.optional (lib.versionOlder cudatoolkit.version "10.1" && hasCudnn) cudaPackages.cudnn
+                ++ lib.optional (lib.versionAtLeast cudatoolkit.version "10.1" && hasCudnn) cudaPackages.cudnn_7_6
+                ++ lib.optional lmdbSupport lmdb
+                ++ lib.optional ncclSupport nccl
+                ++ lib.optionals leveldbSupport [ leveldb snappy ]
+                ++ lib.optionals pythonSupport [ python numpy ]
+                ++ lib.optionals stdenv.isDarwin [ Accelerate CoreGraphics CoreVideo ]
+                ;
+
+  propagatedBuildInputs = lib.optionals pythonSupport (
+    # requirements.txt
+    let pp = python.pkgs; in ([
+      pp.numpy pp.scipy pp.scikit-image pp.h5py
+      pp.matplotlib pp.ipython pp.networkx pp.nose
+      pp.pandas pp.python-dateutil pp.protobuf pp.gflags
+      pp.pyyaml pp.pillow pp.six
+    ] ++ lib.optional leveldbSupport pp.leveldb)
+  );
+
+  outputs = [ "bin" "out" ];
+  propagatedBuildOutputs = []; # otherwise propagates out -> bin cycle
+
+  patches = [
+    ./darwin.patch
+    (fetchpatch {
+       name = "support-opencv4";
+       url = "https://github.com/BVLC/caffe/pull/6638/commits/0a04cc2ccd37ba36843c18fea2d5cbae6e7dd2b5.patch";
+       hash = "sha256-ZegTvp0tTHlopQv+UzHDigs6XLkP2VfqLCWXl6aKJSI=";
+     })
+  ] ++ lib.optional pythonSupport (substituteAll {
+    src = ./python.patch;
+    inherit (python.sourceVersion) major minor;  # Should be changed in case of PyPy
+  });
+
+  postPatch = ''
+    substituteInPlace src/caffe/util/io.cpp --replace \
+      'SetTotalBytesLimit(kProtoReadBytesLimit, 536870912)' \
+      'SetTotalBytesLimit(kProtoReadBytesLimit)'
+  '' + lib.optionalString (cudaSupport && lib.versionAtLeast cudatoolkit.version "9.0") ''
+    # CUDA 9.0 doesn't support sm_20
+    sed -i 's,20 21(20) ,,' cmake/Cuda.cmake
+  '';
+
+  preConfigure = lib.optionalString pythonSupport ''
+    # We need this when building with Python bindings
+    export BOOST_LIBRARYDIR="${boost.out}/lib";
+  '';
+
+  postInstall = ''
+    # Internal static library.
+    rm $out/lib/libproto.a
+
+    # Install models
+    cp -a ../models $out/share/Caffe/models
+
+    moveToOutput "bin" "$bin"
+  '' + lib.optionalString pythonSupport ''
+    mkdir -p $out/${python.sitePackages}
+    mv $out/python/caffe $out/${python.sitePackages}
+    rm -rf $out/python
+  '';
+
+  doInstallCheck = false; # build takes more than 30 min otherwise
+  installCheckPhase = ''
+    model=bvlc_reference_caffenet
+    m_path="$out/share/Caffe/models/$model"
+    $bin/bin/caffe test \
+      -model "$m_path/deploy.prototxt" \
+      -solver "$m_path/solver.prototxt" \
+      -weights "${test_model_weights}"
+  '';
+
+  meta = with lib; {
+    description = "Deep learning framework";
+    longDescription = ''
+      Caffe is a deep learning framework made with expression, speed, and
+      modularity in mind. It is developed by the Berkeley Vision and Learning
+      Center (BVLC) and by community contributors.
+    '';
+    homepage = "http://caffe.berkeleyvision.org/";
+    maintainers = with maintainers; [ ];
+    broken =
+      (pythonSupport && (python.isPy310))
+      || cudaSupport
+      || !(leveldbSupport -> (leveldb != null && snappy != null))
+      || !(cudnnSupport -> (hasCudnn && cudaSupport))
+      || !(ncclSupport -> (cudaSupport && !nccl.meta.unsupported))
+      || !(pythonSupport -> (python != null && numpy != null))
+    ;
+    license = licenses.bsd2;
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/caffe/python.patch b/nixpkgs/pkgs/applications/science/math/caffe/python.patch
new file mode 100644
index 000000000000..dac5071aa08c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/caffe/python.patch
@@ -0,0 +1,70 @@
+commit b14ca23651d390fcae4a929dedc7c33a83453a66
+Author: Frederik Rietdijk <fridh@fridh.nl>
+Date:   Sun Feb 17 08:41:27 2019 +0100
+
+    Find boost_pythonXX
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 08f56a33..0a04592a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -99,10 +99,10 @@ add_subdirectory(docs)
+ add_custom_target(lint COMMAND ${CMAKE_COMMAND} -P ${PROJECT_SOURCE_DIR}/cmake/lint.cmake)
+ 
+ # ---[ pytest target
+-if(BUILD_python)
+-  add_custom_target(pytest COMMAND python${python_version} -m unittest discover -s caffe/test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/python )
+-  add_dependencies(pytest pycaffe)
+-endif()
++# if(BUILD_python)
++#   add_custom_target(pytest COMMAND python${python_version} -m unittest discover -s caffe/test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/python )
++#   add_dependencies(pytest pycaffe)
++# endif()
+ 
+ # ---[ uninstall target
+ configure_file(
+diff --git a/cmake/Dependencies.cmake b/cmake/Dependencies.cmake
+index 4a5bac47..be026d43 100644
+--- a/cmake/Dependencies.cmake
++++ b/cmake/Dependencies.cmake
+@@ -141,37 +141,14 @@ if(BUILD_python)
+     # use python3
+     find_package(PythonInterp 3.0)
+     find_package(PythonLibs 3.0)
+-    find_package(NumPy 1.7.1)
+-    # Find the matching boost python implementation
+-    set(version ${PYTHONLIBS_VERSION_STRING})
+-
+-    STRING( REGEX REPLACE "[^0-9]" "" boost_py_version ${version} )
+-    find_package(Boost 1.46 COMPONENTS "python-py${boost_py_version}")
+-    set(Boost_PYTHON_FOUND ${Boost_PYTHON-PY${boost_py_version}_FOUND})
+-
+-    while(NOT "${version}" STREQUAL "" AND NOT Boost_PYTHON_FOUND)
+-      STRING( REGEX REPLACE "([0-9.]+).[0-9]+" "\\1" version ${version} )
+-
+-      STRING( REGEX REPLACE "[^0-9]" "" boost_py_version ${version} )
+-      find_package(Boost 1.46 COMPONENTS "python-py${boost_py_version}")
+-      set(Boost_PYTHON_FOUND ${Boost_PYTHON-PY${boost_py_version}_FOUND})
+-
+-      STRING( REGEX MATCHALL "([0-9.]+).[0-9]+" has_more_version ${version} )
+-      if("${has_more_version}" STREQUAL "")
+-        break()
+-      endif()
+-    endwhile()
+-    if(NOT Boost_PYTHON_FOUND)
+-      find_package(Boost 1.46 COMPONENTS python)
+-    endif()
+   else()
+     # disable Python 3 search
+     find_package(PythonInterp 2.7)
+     find_package(PythonLibs 2.7)
+-    find_package(NumPy 1.7.1)
+-    find_package(Boost 1.46 COMPONENTS python)
+   endif()
+-  if(PYTHONLIBS_FOUND AND NUMPY_FOUND AND Boost_PYTHON_FOUND)
++  find_package(NumPy 1.7.1)
++  find_package(Boost 1.46 REQUIRED COMPONENTS python@major@@minor@)
++  if(PYTHONLIBS_FOUND AND NUMPY_FOUND AND Boost_PYTHON@major@@minor@_FOUND)
+     set(HAVE_PYTHON TRUE)
+     if(BUILD_python_layer)
+       list(APPEND Caffe_DEFINITIONS PRIVATE -DWITH_PYTHON_LAYER)
diff --git a/nixpkgs/pkgs/applications/science/math/calc/default.nix b/nixpkgs/pkgs/applications/science/math/calc/default.nix
new file mode 100644
index 000000000000..699f3d25caf7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/calc/default.nix
@@ -0,0 +1,69 @@
+{ lib
+, stdenv
+, fetchurl
+, makeWrapper
+, ncurses
+, readline
+, unixtools
+, enableReadline ? true
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "calc";
+  version = "2.15.0.2";
+
+  src = fetchurl {
+    urls = [
+      "https://github.com/lcn2/calc/releases/download/v${finalAttrs.version}/calc-${finalAttrs.version}.tar.bz2"
+      "http://www.isthe.com/chongo/src/calc/calc-${finalAttrs.version}.tar.bz2"
+    ];
+    hash = "sha256-dPEj32SiR7RhI9fBa9ny9+EEuuiXS2WswRcDVuOMJXc=";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile.target \
+      --replace '-install_name ''${LIBDIR}/libcalc''${LIB_EXT_VERSION}' '-install_name ''${T}''${LIBDIR}/libcalc''${LIB_EXT_VERSION}' \
+      --replace '-install_name ''${LIBDIR}/libcustcalc''${LIB_EXT_VERSION}' '-install_name ''${T}''${LIBDIR}/libcustcalc''${LIB_EXT_VERSION}'
+  '';
+
+  nativeBuildInputs = [
+    makeWrapper
+    unixtools.col
+  ];
+
+  buildInputs = lib.optionals enableReadline [
+    ncurses
+    readline
+  ];
+
+  makeFlags = [
+    "T=$(out)"
+    "INCDIR="
+    "BINDIR=/bin"
+    "LIBDIR=/lib"
+    "CALC_SHAREDIR=/share/calc"
+    "CALC_INCDIR=/include"
+    "MANDIR=/share/man/man1"
+
+    # Handle LDFLAGS defaults in calc
+    "DEFAULT_LIB_INSTALL_PATH=$(out)/lib"
+  ]
+  ++ lib.optionals enableReadline [
+    "READLINE_LIB=-lreadline"
+    "USE_READLINE=-DUSE_READLINE"
+  ];
+
+  meta = {
+    homepage = "http://www.isthe.com/chongo/tech/comp/calc/";
+    description = "C-style arbitrary precision calculator";
+    mainProgram = "calc";
+    changelog = "https://github.com/lcn2/calc/blob/v${finalAttrs.version}/CHANGES";
+    # The licensing situation depends on readline (see section 3 of the LGPL)
+    # If linked against readline then GPLv2 otherwise LGPLv2.1
+    license = if enableReadline
+              then lib.licenses.gpl2Only
+              else lib.licenses.lgpl21Only;
+    maintainers = with lib.maintainers; [ matthewbauer ];
+    platforms = lib.platforms.all;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/math/calculix/calculix.patch b/nixpkgs/pkgs/applications/science/math/calculix/calculix.patch
new file mode 100644
index 000000000000..36048546948c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/calculix/calculix.patch
@@ -0,0 +1,23 @@
+diff --git a/ccx_2.19/src/Makefile b/ccx_2.19/src/Makefile
+index c503513..8a69a0c 100755
+--- a/ccx_2.19/src/Makefile
++++ b/ccx_2.19/src/Makefile
+@@ -18,15 +18,10 @@ OCCXF = $(SCCXF:.f=.o)
+ OCCXC = $(SCCXC:.c=.o)
+ OCCXMAIN = $(SCCXMAIN:.c=.o)
+ 
+-DIR=../../../SPOOLES.2.2
++LIBS = -lpthread -lm -lc -lspooles -larpack -lblas -llapack
+ 
+-LIBS = \
+-       $(DIR)/spooles.a \
+-	../../../ARPACK/libarpack_INTEL.a \
+-       -lpthread -lm -lc
+-
+-ccx_2.19: $(OCCXMAIN) ccx_2.19.a  $(LIBS)
+-	./date.pl; $(CC) $(CFLAGS) -c ccx_2.19.c; $(FC)  -Wall -O2 -o $@ $(OCCXMAIN) ccx_2.19.a $(LIBS) -fopenmp
++ccx_2.19: $(OCCXMAIN) ccx_2.19.a
++	$(CC) $(CFLAGS) -c ccx_2.19.c; $(FC)  -Wall -O2 -o $@ $(OCCXMAIN) ccx_2.19.a $(LIBS) -fopenmp
+ 
+ ccx_2.19.a: $(OCCXF) $(OCCXC)
+ 	ar vr $@ $?
diff --git a/nixpkgs/pkgs/applications/science/math/calculix/default.nix b/nixpkgs/pkgs/applications/science/math/calculix/default.nix
new file mode 100644
index 000000000000..8af2ea9f4bce
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/calculix/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchurl, gfortran, arpack, spooles, blas, lapack }:
+
+assert (blas.isILP64 == lapack.isILP64 &&
+        blas.isILP64 == arpack.isILP64 &&
+        !blas.isILP64);
+
+stdenv.mkDerivation rec {
+  pname = "calculix";
+  version = "2.19";
+
+  src = fetchurl {
+    url = "http://www.dhondt.de/ccx_${version}.src.tar.bz2";
+    sha256 = "01vdy9sns58hkm39z6d0r5y7gzqf5z493d18jin9krqib1l6jnn7";
+  };
+
+  nativeBuildInputs = [ gfortran ];
+
+  buildInputs = [ arpack spooles blas lapack ];
+
+  env.NIX_CFLAGS_COMPILE = toString [
+    "-I${spooles}/include/spooles"
+    "-std=legacy"
+  ];
+
+  patches = [
+    ./calculix.patch
+  ];
+
+  postPatch = ''
+    cd ccx*/src
+  '';
+
+  installPhase = ''
+    install -Dm0755 ccx_${version} $out/bin/ccx
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.calculix.de/";
+    description = "Three-dimensional structural finite element program";
+    mainProgram = "ccx";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ gebner ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/cbc/default.nix b/nixpkgs/pkgs/applications/science/math/cbc/default.nix
new file mode 100644
index 000000000000..fb92b1cc98fb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/cbc/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, zlib, bzip2 }:
+
+stdenv.mkDerivation rec {
+  pname = "cbc";
+  version = "2.10.4";
+
+  # Note: Cbc 2.10.5 contains Clp 1.17.5 which hits this bug
+  # that breaks or-tools https://github.com/coin-or/Clp/issues/130
+
+  src = fetchurl {
+    url = "https://www.coin-or.org/download/source/Cbc/Cbc-${version}.tgz";
+    sha256 = "0zq66j1vvpslswhzi9yfgkv6vmg7yry4pdmfgqaqw2vhyqxnsy39";
+  };
+
+  # or-tools has a hard dependency on Cbc static libraries, so we build both
+  configureFlags = [ "-C" "--enable-static" ]
+    ++ lib.optionals stdenv.cc.isClang [ "CXXFLAGS=-std=c++14" ];
+
+  enableParallelBuilding = true;
+
+  hardeningDisable = [ "format" ];
+
+  buildInputs = [ zlib bzip2 ];
+
+  # FIXME: move share/coin/Data to a separate output?
+
+  meta = {
+    homepage = "https://projects.coin-or.org/Cbc";
+    license = lib.licenses.epl10;
+    maintainers = [ lib.maintainers.eelco ];
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
+    description = "A mixed integer programming solver";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/cemu-ti/default.nix b/nixpkgs/pkgs/applications/science/math/cemu-ti/default.nix
new file mode 100644
index 000000000000..c8d5bea6f602
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/cemu-ti/default.nix
@@ -0,0 +1,46 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, qmake
+, pkg-config
+, wrapQtAppsHook
+, libarchive
+, libpng
+}:
+
+stdenv.mkDerivation rec {
+  pname = "CEmu";
+  version = "unstable-2022-06-29";
+  src = fetchFromGitHub {
+    owner = "CE-Programming";
+    repo = "CEmu";
+    rev = "880d391ba9f8b7b2ec36ab9b45a34e9ecbf744e9";
+    hash = "sha256-aFwGZJceh1jEP8cEajY5wYlSaFuNhYvSoZ/E1QDfJEI=";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [
+    qmake
+    wrapQtAppsHook
+    pkg-config
+  ];
+
+  buildInputs = [
+    libarchive
+    libpng
+  ];
+
+  qmakeFlags = [
+    "gui/qt"
+  ];
+
+  meta = with lib; {
+    description = "Third-party TI-84 Plus CE / TI-83 Premium CE emulator, focused on developer features";
+    mainProgram = "CEmu";
+    homepage = "https://ce-programming.github.io/CEmu";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ luc65r ];
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+    broken = stdenv.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/clp/default.nix b/nixpkgs/pkgs/applications/science/math/clp/default.nix
new file mode 100644
index 000000000000..06032b4a3182
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/clp/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, coin-utils, zlib, osi }:
+
+stdenv.mkDerivation rec {
+  version = "1.17.9";
+  pname = "clp";
+  src = fetchFromGitHub {
+    owner = "coin-or";
+    repo = "Clp";
+    rev = "releases/${version}";
+    hash = "sha256-kHCDji+yIf5mCoxKB2b/HaATGmwwIAPEV74tthIMeMY=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  propagatedBuildInputs = [ zlib coin-utils osi ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    license = licenses.epl20;
+    homepage = "https://github.com/coin-or/Clp";
+    description = "An open-source linear programming solver written in C++";
+    mainProgram = "clp";
+    platforms = platforms.darwin ++ platforms.linux;
+    maintainers = [ maintainers.vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/colpack/default.nix b/nixpkgs/pkgs/applications/science/math/colpack/default.nix
new file mode 100644
index 000000000000..d5ab38ff7514
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/colpack/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+
+  pname = "ColPack";
+  version = "1.0.10";
+
+  src = fetchFromGitHub {
+    owner = "CSCsw";
+    repo = pname;
+    rev = "v" + version;
+    sha256 = "1p05vry940mrjp6236c0z83yizmw9pk6ly2lb7d8rpb7j9h03glr";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  configureFlags = [
+    "--enable-openmp=${if stdenv.isLinux then "yes" else "no"}"
+    "--enable-examples=no"
+  ];
+
+  postInstall = ''
+    # Remove libtool archive
+    rm $out/lib/*.la
+
+    # Remove compiled examples (Basic examples get compiled anyway)
+    rm -r $out/examples
+
+    # Copy the example sources (Basic tree contains scripts and object files)
+    mkdir -p $out/share/ColPack/examples/Basic
+    cp SampleDrivers/Basic/*.cpp $out/share/ColPack/examples/Basic
+    cp -r SampleDrivers/Matrix* $out/share/ColPack/examples
+  '';
+
+  meta = with lib; {
+    description = "A package comprising of implementations of algorithms for
+    vertex coloring and derivative computation";
+    homepage = "https://cscapes.cs.purdue.edu/coloringpage/software.htm#functionalities";
+    license = licenses.lgpl3Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ edwtjo ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/cplex/default.nix b/nixpkgs/pkgs/applications/science/math/cplex/default.nix
new file mode 100644
index 000000000000..ddc950b30664
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/cplex/default.nix
@@ -0,0 +1,88 @@
+{ lib, stdenv, makeWrapper, openjdk, gtk2, xorg, glibcLocales, releasePath ? null }:
+
+# To use this package, you need to download your own cplex installer from IBM
+# and override the releasePath attribute to point to the location of the file.
+#
+# Note: cplex creates an individual build for each license which screws
+# somewhat with the use of functions like requireFile as the hash will be
+# different for every user.
+
+stdenv.mkDerivation rec {
+  pname = "cplex";
+  version = "128";
+
+  src =
+    if releasePath == null then
+      throw ''
+        This nix expression requires that the cplex installer is already
+        downloaded to your machine. Get it from IBM:
+        https://developer.ibm.com/docloud/blog/2017/12/20/cplex-optimization-studio-12-8-now-available/
+
+        Set `cplex.releasePath = /path/to/download;` in your
+        ~/.config/nixpkgs/config.nix for `nix-*` commands, or
+        `config.cplex.releasePath = /path/to/download;` in your
+        `configuration.nix` for NixOS.
+      ''
+    else
+      releasePath;
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ openjdk gtk2 xorg.libXtst glibcLocales ];
+
+  unpackPhase = "cp $src $name";
+
+  patchPhase = ''
+    sed -i -e 's|/usr/bin/tr"|tr"         |' $name
+  '';
+
+  buildPhase = ''
+    sh $name -i silent -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR=$out
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    ln -s $out/opl/bin/x86-64_linux/oplrun\
+      $out/opl/bin/x86-64_linux/oplrunjava\
+      $out/opl/oplide/oplide\
+      $out/cplex/bin/x86-64_linux/cplex\
+      $out/cpoptimizer/bin/x86-64_linux/cpoptimizer\
+      $out/bin
+  '';
+
+  fixupPhase =
+  let
+    libraryPath = lib.makeLibraryPath [ stdenv.cc.cc gtk2 xorg.libXtst ];
+  in ''
+    interpreter=${stdenv.cc.libc}/lib/ld-linux-x86-64.so.2
+
+    for pgm in $out/opl/bin/x86-64_linux/oplrun $out/opl/bin/x86-64_linux/oplrunjava $out/opl/oplide/oplide;
+    do
+      patchelf --set-interpreter "$interpreter" $pgm;
+      wrapProgram $pgm \
+        --prefix LD_LIBRARY_PATH : $out/opl/bin/x86-64_linux:${libraryPath} \
+        --set LOCALE_ARCHIVE ${glibcLocales}/lib/locale/locale-archive;
+    done
+
+    for pgm in $out/cplex/bin/x86-64_linux/cplex $out/cpoptimizer/bin/x86-64_linux/cpoptimizer $out/opl/oplide/jre/bin/*;
+    do
+      if grep ELF $pgm > /dev/null;
+      then
+        patchelf --set-interpreter "$interpreter" $pgm;
+      fi
+    done
+  '';
+
+  passthru = {
+    libArch = "x86-64_linux";
+    libSuffix = "${version}0";
+  };
+
+  meta = with lib; {
+    description = "Optimization solver for mathematical programming";
+    homepage = "https://www.ibm.com/be-en/marketplace/ibm-ilog-cplex";
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    license = licenses.unfree;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ bfortz ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/csdp/default.nix b/nixpkgs/pkgs/applications/science/math/csdp/default.nix
new file mode 100644
index 000000000000..6ce03008d3a9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/csdp/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, blas, gfortran, lapack }:
+
+stdenv.mkDerivation rec {
+  pname = "csdp";
+  version = "6.1.1";
+
+  src = fetchurl {
+    url = "https://www.coin-or.org/download/source/Csdp/Csdp-${version}.tgz";
+    sha256 = "1f9ql6cjy2gwiyc51ylfan24v1ca9sjajxkbhszlds1lqmma8n05";
+  };
+
+  buildInputs = [ blas gfortran.cc.lib lapack ];
+
+  postPatch = ''
+    substituteInPlace Makefile --replace /usr/local/bin $out/bin
+  '';
+
+  preInstall = ''
+    rm -f INSTALL
+    mkdir -p $out/bin
+  '';
+
+  meta = {
+    homepage = "https://projects.coin-or.org/Csdp";
+    license = lib.licenses.cpl10;
+    maintainers = [ lib.maintainers.roconnor ];
+    description = "A C Library for Semidefinite Programming";
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/dap/default.nix b/nixpkgs/pkgs/applications/science/math/dap/default.nix
new file mode 100644
index 000000000000..ed3290f6c27d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/dap/default.nix
@@ -0,0 +1,37 @@
+{ lib
+, stdenv
+, fetchurl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dap";
+  version = "3.10";
+
+  src = fetchurl {
+    url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "Bk5sty/438jLb1PpurMQ5OqMbr6JqUuuQjcg2bejh2Y=";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  meta = with lib; {
+    homepage = "https://www.gnu.org/software/dap";
+    description = "A small statistics and graphics package based on C";
+    longDescription = ''
+      Dap is a small statistics and graphics package based on C. Version 3.0 and
+      later of Dap can read SBS programs (based on the utterly famous, industry
+      standard statistics system with similar initials - you know the one I
+      mean)! The user wishing to perform basic statistical analyses is now freed
+      from learning and using C syntax for straightforward tasks, while
+      retaining access to the C-style graphics and statistics features provided
+      by the original implementation. Dap provides core methods of data
+      management, analysis, and graphics that are commonly used in statistical
+      consulting practice (univariate statistics, correlations and regression,
+      ANOVA, categorical data analysis, logistic regression, and nonparametric
+      analyses).
+    '';
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/ecm/default.nix b/nixpkgs/pkgs/applications/science/math/ecm/default.nix
new file mode 100644
index 000000000000..222db0e98e6a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/ecm/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, gmp, m4 }:
+
+let
+  pname = "ecm";
+  version = "7.0.4";
+  name = "${pname}-${version}";
+in
+
+stdenv.mkDerivation {
+  inherit name;
+
+  src = fetchurl {
+    url = "http://gforge.inria.fr/frs/download.php/file/36224/ecm-${version}.tar.gz";
+    sha256 = "0hxs24c2m3mh0nq1zz63z3sb7dhy1rilg2s1igwwcb26x3pb7xqc";
+  };
+
+  # See https://trac.sagemath.org/ticket/19233
+  configureFlags = lib.optional stdenv.isDarwin "--disable-asm-redc";
+
+  buildInputs = [ m4 gmp ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Elliptic Curve Method for Integer Factorization";
+    mainProgram = "ecm";
+    license = lib.licenses.gpl2Plus;
+    homepage = "http://ecm.gforge.inria.fr/";
+    maintainers = [ lib.maintainers.roconnor ];
+    platforms = with lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/eigenmath/default.nix b/nixpkgs/pkgs/applications/science/math/eigenmath/default.nix
new file mode 100644
index 000000000000..358e491b2f4a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/eigenmath/default.nix
@@ -0,0 +1,49 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, buildPackages
+, unstableGitUpdater
+}:
+
+stdenv.mkDerivation rec {
+  pname = "eigenmath";
+  version = "unstable-2024-03-20";
+
+  src = fetchFromGitHub {
+    owner = "georgeweigt";
+    repo = pname;
+    rev = "262a6525225be7bcef52c3072b1061db3c238055";
+    hash = "sha256-QH8mLlcCOuq77vLer8RsSnD9VeJu9kAVv2qWAH3ky6I=";
+  };
+
+  checkPhase = let emulator = stdenv.hostPlatform.emulator buildPackages; in ''
+    runHook preCheck
+
+    for testcase in selftest1 selftest2; do
+      ${emulator} ./eigenmath "test/$testcase"
+    done
+
+    runHook postCheck
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    install -Dm555 eigenmath "$out/bin/eigenmath"
+    runHook postInstall
+  '';
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = unstableGitUpdater { };
+  };
+
+  meta = with lib;{
+    description = "Computer algebra system written in C";
+    mainProgram = "eigenmath";
+    homepage = "https://georgeweigt.github.io";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ nickcao ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/engauge-digitizer/default.nix b/nixpkgs/pkgs/applications/science/math/engauge-digitizer/default.nix
new file mode 100644
index 000000000000..95306a0820fa
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/engauge-digitizer/default.nix
@@ -0,0 +1,61 @@
+{ lib, stdenv, fetchFromGitHub, fftw, libjpeg, log4cpp, openjpeg
+, libpng12, poppler, qtbase, qt5, qmake, wrapQtAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "engauge-digitizer";
+  version = "12.2.2";
+
+  src = fetchFromGitHub {
+    owner = "markummitchell";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-Wj9o3wWbtHsEi6LFH4xDpwVR9BwcWc472jJ/QFDQZvY=";
+  };
+
+  nativeBuildInputs = [ qmake wrapQtAppsHook ];
+
+  buildInputs = [
+    qtbase
+    qt5.qttools
+    poppler
+    libpng12
+    openjpeg
+    openjpeg.dev
+    log4cpp
+    libjpeg
+    fftw
+  ];
+
+  qmakeFlags = [
+    "CONFIG+=jpeg2000"
+    "CONFIG+=pdf"
+    "CONFIG+=log4cpp_null"
+  ];
+
+  POPPLER_INCLUDE = "${poppler.dev}/include/poppler/qt5";
+
+  POPPLER_LIB = "${poppler}/lib";
+
+  OPENJPEG_INCLUDE = "${openjpeg.dev}/include/${openjpeg.pname}-${lib.versions.majorMinor openjpeg.version}";
+
+  OPENJPEG_LIB = "${openjpeg}/lib";
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin
+    cp bin/engauge $out/bin/
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Engauge Digitizer is a tool for recovering graph data from an image file";
+    mainProgram = "engauge";
+    homepage = "https://markummitchell.github.io/engauge-digitizer";
+    license = with licenses; [ gpl2Only ];
+    platforms = platforms.linux;
+    maintainers = [ maintainers.sheepforce ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/eukleides/default.nix b/nixpkgs/pkgs/applications/science/math/eukleides/default.nix
new file mode 100644
index 000000000000..f682a57ec951
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/eukleides/default.nix
@@ -0,0 +1,75 @@
+{ lib, stdenv, fetchurl, bison, flex, makeWrapper, texinfo4, getopt, readline, texlive }:
+
+stdenv.mkDerivation (finalAttrs: rec {
+  pname = "eukleides";
+  version = "1.5.4";
+
+  src = fetchurl {
+    url = "http://www.eukleides.org/files/${pname}-${version}.tar.bz2";
+    sha256 = "0s8cyh75hdj89v6kpm3z24i48yzpkr8qf0cwxbs9ijxj1i38ki0q";
+  };
+
+  patches = [
+    # use $CC instead of hardcoded gcc
+    ./use-CC.patch
+    # allow PostScript transparency in epstopdf call
+    ./gs-allowpstransparency.patch
+  ];
+
+  nativeBuildInputs = [ bison flex texinfo4 makeWrapper ];
+
+  buildInputs = [ getopt readline ];
+
+  preConfigure = ''
+    substituteInPlace Makefile \
+      --replace mktexlsr true
+
+    substituteInPlace doc/Makefile \
+      --replace ginstall-info install-info
+
+    substituteInPlace Config \
+      --replace '/usr/local' "$out" \
+      --replace '$(SHARE_DIR)/texmf' "$tex"
+  '';
+
+  # Workaround build failure on -fno-common toolchains like upstream
+  # gcc-10. Otherwise build fails as:
+  #   ld: eukleides_build/triangle.o:(.bss+0x28): multiple definition of `A';
+  #     eukleides_build/quadrilateral.o:(.bss+0x18): first defined here
+  env.NIX_CFLAGS_COMPILE = "-fcommon";
+
+  preInstall = ''
+    mkdir -p $out/bin
+  '';
+
+  postInstall = ''
+    wrapProgram $out/bin/euktoeps \
+      --prefix PATH : ${lib.makeBinPath [ getopt ]}
+  '';
+
+  outputs = [ "out" "doc" "tex" ];
+
+  passthru = {
+    tlType = "run";
+    # packages needed by euktoeps, euktopdf and eukleides.sty
+    tlDeps = with texlive; [ collection-pstricks epstopdf iftex moreverb ];
+    pkgs = [ finalAttrs.finalPackage.tex ];
+  };
+
+  meta = {
+    description = "Geometry Drawing Language";
+    homepage = "http://www.eukleides.org/";
+    license = lib.licenses.gpl3Plus;
+
+    longDescription = ''
+      Eukleides is a computer language devoted to elementary plane
+      geometry. It aims to be a fairly comprehensive system to create
+      geometric figures, either static or dynamic. Eukleides allows to
+      handle basic types of data: numbers and strings, as well as
+      geometric types of data: points, vectors, sets (of points), lines,
+      circles and conics.
+    '';
+
+    platforms = lib.platforms.unix;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/math/eukleides/gs-allowpstransparency.patch b/nixpkgs/pkgs/applications/science/math/eukleides/gs-allowpstransparency.patch
new file mode 100644
index 000000000000..aa92e6cc9fa7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/eukleides/gs-allowpstransparency.patch
@@ -0,0 +1,10 @@
+--- a/bash/euktopdf
++++ b/bash/euktopdf
+@@ -55,6 +55,6 @@ do
+     exit 1
+   fi
+   dvips -q -E -o $base.eps $base.dvi &&
+-  epstopdf $base.eps &&
++  epstopdf --gsopt=-dALLOWPSTRANSPARENCY $base.eps &&
+   rm -f $base.{tex,log,dvi,eps}
+ done
diff --git a/nixpkgs/pkgs/applications/science/math/eukleides/use-CC.patch b/nixpkgs/pkgs/applications/science/math/eukleides/use-CC.patch
new file mode 100644
index 000000000000..08bd71ec9dc5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/eukleides/use-CC.patch
@@ -0,0 +1,11 @@
+--- a/build/Makefile
++++ b/build/Makefile
+@@ -11,7 +11,7 @@ LEX = flex
+ LFLAGS = -8
+ YACC = bison
+ YFLAGS = -d
+-CC = gcc
++CC ?= gcc
+ IFLAGS = -I$(COMMON_DIR) -I$(MAIN_DIR) -I$(BUILD_DIR) 
+ ifneq ($(strip $(LOCALES)),)
+ MOFLAGS = -DMO_DIR=\"$(MO_DIR)\" 
diff --git a/nixpkgs/pkgs/applications/science/math/form/default.nix b/nixpkgs/pkgs/applications/science/math/form/default.nix
new file mode 100644
index 000000000000..c56ee432bdae
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/form/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, gmp, zlib }:
+
+stdenv.mkDerivation {
+  version = "4.3.1";
+  pname = "form";
+
+  # This tarball is released by author, it is not downloaded from tag, so can't use fetchFromGitHub
+  src = fetchurl {
+    url = "https://github.com/vermaseren/form/releases/download/v4.3.1/form-4.3.1.tar.gz";
+    sha256 = "sha256-8fUS3DT+m71rGfLf7wX8uZEt+0PINop1t5bsRy7ou84=";
+  };
+
+  buildInputs = [ gmp zlib ];
+
+  meta = with lib; {
+    description = "The FORM project for symbolic manipulation of very big expressions";
+    homepage = "https://www.nikhef.nl/~form/";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.veprbl ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/fricas/default.nix b/nixpkgs/pkgs/applications/science/math/fricas/default.nix
new file mode 100644
index 000000000000..355238ace15c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/fricas/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, sbcl, libX11, libXpm, libICE, libSM, libXt, libXau, libXdmcp }:
+
+stdenv.mkDerivation rec {
+  pname = "fricas";
+  version = "1.3.9";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/fricas/fricas/${version}/fricas-${version}-full.tar.bz2";
+    sha256 = "sha256-5RPcffM0GN0l6r8IgHJlwdxwwp2y4kIdJ5M3JnGZCzc=";
+  };
+
+  buildInputs = [ sbcl libX11 libXpm libICE libSM libXt libXau libXdmcp ];
+
+  dontStrip = true;
+
+  meta = {
+    homepage = "https://fricas.sourceforge.net/";
+    description = "An advanced computer algebra system";
+    license = lib.licenses.bsd3;
+
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.sprock ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/gap/default.nix b/nixpkgs/pkgs/applications/science/math/gap/default.nix
new file mode 100644
index 000000000000..7a466f8c000c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/gap/default.nix
@@ -0,0 +1,158 @@
+{ stdenv
+, lib
+, fetchurl
+, makeWrapper
+, readline
+, gmp
+, pari
+, zlib
+# one of
+# - "minimal" (~400M):
+#     Install the bare minimum of packages required by gap to start.
+#     This is likely to break a lot of stuff. Do not expect upstream support with
+#     this configuration.
+# - "standard" (~700M):
+#     Install the "standard packages" which gap autoloads by default. These
+#     packages are effectively considered a part of gap.
+# - "full" (~1.7G):
+#     Install all available packages. This takes a lot of space.
+, packageSet ? "standard"
+# Kept for backwards compatibility. Overrides packageSet to "full".
+, keepAllPackages ? false
+}:
+let
+  # packages absolutely required for gap to start
+  # `*` represents the version where applicable
+  requiredPackages = [
+    "gapdoc"
+    "primgrp"
+    "smallgrp"
+    "transgrp"
+  ];
+  # packages autoloaded by default if available, and their dependencies
+  autoloadedPackages = [
+    "atlasrep"
+    "autpgrp"
+    "alnuth"
+    "crisp"
+    "ctbllib"
+    "factint"
+    "fga"
+    "irredsol"
+    "laguna"
+    "polenta"
+    "polycyclic"
+    "resclasses"
+    "sophus"
+    "tomlib"
+    "autodoc"  # dependency of atlasrep
+    "io"       # used by atlasrep to fetch data from online sources
+    "radiroot" # dependency of polenta
+    "utils"    # dependency of atlasrep
+  ];
+  keepAll = keepAllPackages || (packageSet == "full");
+  packagesToKeep = requiredPackages ++ lib.optionals (packageSet == "standard") autoloadedPackages;
+
+  # Generate bash script that removes all packages from the `pkg` subdirectory
+  # that are not on the whitelist. The whitelist consists of strings expected by
+  # `find`'s `-name`.
+  removeNonWhitelistedPkgs = whitelist: ''
+    find pkg -type d -maxdepth 1 -mindepth 1 \
+  '' + (lib.concatStringsSep "\n" (map (str: "-not -name '${str}' \\") whitelist)) + ''
+    -exec echo "Removing package {}" \; \
+    -exec rm -r '{}' \;
+  '';
+in
+stdenv.mkDerivation rec {
+  pname = "gap";
+  # https://www.gap-system.org/Releases/
+  version = "4.12.2";
+
+  src = fetchurl {
+    url = "https://github.com/gap-system/gap/releases/download/v${version}/gap-${version}.tar.gz";
+    sha256 = "sha256-ZyMIdF63iiIklO6N1nhu3VvDMUVvzGRWrAZL2yjVh6g=";
+  };
+
+  # remove all non-essential packages (which take up a lot of space)
+  preConfigure = lib.optionalString (!keepAll) (removeNonWhitelistedPkgs packagesToKeep) + ''
+    patchShebangs .
+  '';
+
+  buildInputs = [
+    readline
+    gmp
+    zlib
+  ];
+
+  nativeBuildInputs = [
+    makeWrapper
+  ];
+
+  propagatedBuildInputs = [
+    pari # used at runtime by the alnuth package
+  ];
+
+  # "teststandard" is a superset of the tests run by "check". it takes ~20min
+  # instead of ~1min. tests are run twice, once with all packages loaded and
+  # once without.
+  # installCheckTarget = "teststandard";
+
+  doInstallCheck = true;
+  installCheckTarget = "check";
+
+  preInstallCheck = ''
+    # gap tests check that the home directory exists
+    export HOME="$TMP/gap-home"
+    mkdir -p "$HOME"
+
+    # make sure gap is in PATH
+    export PATH="$out/bin:$PATH"
+
+    # make sure we don't accidentally use the wrong gap binary
+    rm -r bin
+
+    # like the defaults the Makefile, but use gap from PATH instead of the
+    # one from builddir
+    installCheckFlagsArray+=(
+      "TESTGAPcore=gap --quitonbreak -b -q -r"
+      "TESTGAPauto=gap --quitonbreak -b -q -r -m 100m -o 1g -x 80"
+      "TESTGAP=gap --quitonbreak -b -q -r -m 100m -o 1g -x 80 -A"
+    )
+  '';
+
+  postBuild = ''
+    pushd pkg
+    # failures are ignored unless --strict is set
+    bash ../bin/BuildPackages.sh ${lib.optionalString (!keepAll) "--strict"}
+    popd
+  '';
+
+  postInstall = ''
+    # make install creates an empty pkg dir. since we run "make check" on
+    # installCheckPhase to make sure the installed GAP finds its libraries, we
+    # also install the tst dir. this is probably excessively cautious, see
+    # https://github.com/NixOS/nixpkgs/pull/192548#discussion_r992824942
+    rm -r "$out/share/gap/pkg"
+    cp -ar pkg tst "$out/share/gap"
+  '';
+
+  preFixup = ''
+    # patchelf won't strip references to the build dir if it still exists
+    rm -rf pkg
+  '';
+
+  meta = with lib; {
+    description = "Computational discrete algebra system";
+    # We are also grateful to ChrisJefferson for previous work on the package,
+    # and to ChrisJefferson and fingolfin for help with GAP-related questions
+    # from the upstream point of view.
+    maintainers = teams.sage.members;
+    platforms = platforms.all;
+    # keeping all packages increases the package size considerably, which is
+    # why a local build is preferable in that situation. The timeframe is
+    # reasonable and that way the binary cache doesn't get overloaded.
+    hydraPlatforms = lib.optionals (!keepAllPackages) meta.platforms;
+    license = licenses.gpl2;
+    homepage = "https://www.gap-system.org";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/geogebra/default.nix b/nixpkgs/pkgs/applications/science/math/geogebra/default.nix
new file mode 100644
index 000000000000..5fa4862bb9b4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/geogebra/default.nix
@@ -0,0 +1,100 @@
+{ lib, stdenv, fetchurl, libGL, xorg, jre, makeDesktopItem, makeWrapper, unzip, language ? "en_US" }:
+let
+  pname = "geogebra";
+  version = "5-0-785-0";
+
+  srcIcon = fetchurl {
+    url = "https://web.archive.org/web/20200227000442if_/https://static.geogebra.org/images/geogebra-logo.svg";
+    hash = "sha256-Vd7Wteya04JJT4WNirXe8O1sfVKUgc0hKGOy7d47Xgc=";
+  };
+
+  desktopItem = makeDesktopItem {
+    name = "geogebra";
+    exec = "geogebra";
+    icon = "geogebra";
+    desktopName = "Geogebra";
+    genericName = "Geogebra";
+    comment = meta.description;
+    categories = [ "Education" "Science" "Math" ];
+    mimeTypes = [ "application/vnd.geogebra.file" "application/vnd.geogebra.tool" ];
+  };
+
+  meta = with lib; {
+    description = "Dynamic mathematics software with graphics, algebra and spreadsheets";
+    longDescription = ''
+      Dynamic mathematics software for all levels of education that brings
+      together geometry, algebra, spreadsheets, graphing, statistics and
+      calculus in one easy-to-use package.
+    '';
+    homepage = "https://www.geogebra.org/";
+    maintainers = with maintainers; [ sikmir soupglasses ];
+    license = with licenses; [ gpl3 cc-by-nc-sa-30 geogebra ];
+    sourceProvenance = with sourceTypes; [
+      binaryBytecode
+      binaryNativeCode  # some jars include native binaries
+    ];
+    platforms = with platforms; linux ++ darwin;
+    hydraPlatforms = [];
+  };
+
+  linuxPkg = stdenv.mkDerivation {
+    inherit pname version meta srcIcon desktopItem;
+
+    preferLocalBuild = true;
+
+    src = fetchurl {
+      urls = [
+        "https://download.geogebra.org/installers/5.0/GeoGebra-Linux-Portable-${version}.tar.bz2"
+        "https://web.archive.org/web/20230627211902/https://download.geogebra.org/installers/5.0/GeoGebra-Linux-Portable-${version}.tar.bz2"
+      ];
+      hash = "sha256-cL4ERKZpE9Y6IdOjvYiX3nIIW3E2qoqkpMyTszvFseM=";
+    };
+
+    nativeBuildInputs = [ makeWrapper ];
+
+    installPhase = ''
+      install -D geogebra/* -t "$out/libexec/geogebra/"
+
+      # The bundled jogl (required for 3D graphics) links to libXxf86vm, and loads libGL at runtime
+      # OpenGL versions newer than 3.0 cause "javax.media.opengl.GLException: Not a GL2 implementation"
+      makeWrapper "$out/libexec/geogebra/geogebra" "$out/bin/geogebra" \
+        --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libGL xorg.libXxf86vm ]}" \
+        --set MESA_GL_VERSION_OVERRIDE 3.0 \
+        --set JAVACMD "${jre}/bin/java" \
+        --set GG_PATH "$out/libexec/geogebra" \
+        --add-flags "--language=${language}"
+
+      install -Dm644 "${desktopItem}/share/applications/"* \
+        -t $out/share/applications/
+
+      install -Dm644 "${srcIcon}" \
+        "$out/share/icons/hicolor/scalable/apps/geogebra.svg"
+    '';
+  };
+
+  darwinPkg = stdenv.mkDerivation {
+    inherit pname version meta;
+
+    preferLocalBuild = true;
+
+    src = fetchurl {
+      urls = [
+        "https://download.geogebra.org/installers/5.0/GeoGebra-MacOS-Installer-withJava-${version}-x64.zip"
+        "https://web.archive.org/web/20230627211427/https://download.geogebra.org/installers/5.0/GeoGebra-MacOS-Installer-withJava-${version}-x64.zip"
+      ];
+      hash = "sha256-KHjNH8c3/aMJ5CcwCwW9z0QRxJwqYU5I610zpMMruBQ=";
+    };
+
+    dontUnpack = true;
+
+    nativeBuildInputs = [ unzip ];
+
+    installPhase = ''
+      install -dm755 $out/Applications
+      unzip $src -d $out/Applications
+    '';
+  };
+in
+if stdenv.isDarwin
+then darwinPkg
+else linuxPkg
diff --git a/nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix b/nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix
new file mode 100644
index 000000000000..38b668804ad1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix
@@ -0,0 +1,89 @@
+{ lib, stdenv, unzip, fetchurl, electron, makeWrapper, geogebra }:
+let
+  pname = "geogebra";
+  version = "6-0-794-0";
+
+  srcIcon = geogebra.srcIcon;
+  desktopItem = geogebra.desktopItem;
+
+  meta = with lib; {
+    description = "Dynamic mathematics software with graphics, algebra and spreadsheets";
+    longDescription = ''
+      Dynamic mathematics software for all levels of education that brings
+      together geometry, algebra, spreadsheets, graphing, statistics and
+      calculus in one easy-to-use package.
+    '';
+    homepage = "https://www.geogebra.org/";
+    maintainers = with maintainers; [ voidless sikmir ];
+    license = licenses.geogebra;
+    sourceProvenance = with sourceTypes; [
+      binaryBytecode
+      binaryNativeCode  # some jars include native binaries
+    ];
+    platforms = with platforms; linux ++ darwin;
+    hydraPlatforms = [];
+  };
+
+  linuxPkg = stdenv.mkDerivation {
+    inherit pname version meta;
+
+    src = fetchurl {
+      urls = [
+        "https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
+        "https://web.archive.org/web/20230824011801/https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
+      ];
+      hash = "sha256-sNCq1Xcx/Y5r+SIRiqQYcG9dVsfIC2Ef5KJf+tgfxC8=";
+    };
+
+    dontConfigure = true;
+    dontBuild = true;
+
+    nativeBuildInputs = [
+      unzip
+      makeWrapper
+    ];
+
+    unpackPhase = ''
+      unzip $src
+    '';
+
+    installPhase = ''
+      mkdir -p $out/libexec/geogebra/ $out/bin
+      cp -r GeoGebra-linux-x64/{resources,locales} "$out/"
+      makeWrapper ${lib.getBin electron}/bin/electron $out/bin/geogebra --add-flags "$out/resources/app"
+      install -Dm644 "${desktopItem}/share/applications/"* \
+        -t $out/share/applications/
+
+      install -Dm644 "${srcIcon}" \
+        "$out/share/icons/hicolor/scalable/apps/geogebra.svg"
+    '';
+  };
+
+  darwinPkg = stdenv.mkDerivation {
+    inherit pname version;
+
+    src = fetchurl {
+      urls = [
+        "https://download.geogebra.org/installers/6.0/GeoGebra-Classic-6-MacOS-Portable-${version}.zip"
+        "https://web.archive.org/web/20230824012900/https://download.geogebra.org/installers/6.0/GeoGebra-Classic-6-MacOS-Portable-${version}.zip"
+      ];
+      hash = "sha256-CrSoKAjXiejfJHyv8wIpcRr2d8u/50HnatiDm1CdnGQ=";
+    };
+
+    dontUnpack = true;
+
+    nativeBuildInputs = [ unzip ];
+
+    installPhase = ''
+      install -dm755 $out/Applications
+      unzip $src -d $out/Applications
+    '';
+
+    meta = meta // {
+      sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
+    };
+  };
+in
+if stdenv.isDarwin
+then darwinPkg
+else linuxPkg
diff --git a/nixpkgs/pkgs/applications/science/math/getdp/default.nix b/nixpkgs/pkgs/applications/science/math/getdp/default.nix
new file mode 100644
index 000000000000..d28f59e4be2f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/getdp/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, cmake, gfortran, blas, lapack, mpi, petsc, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "getdp";
+  version = "3.6.0";
+  src = fetchurl {
+    url = "http://getdp.info/src/getdp-${version}-source.tgz";
+    sha256 = "sha256-N1cb72W77Dr+TzeHpLgv5FuFb+SJqyGcfn+kOfEvZgA=";
+  };
+
+  inherit (petsc) mpiSupport;
+  nativeBuildInputs = [ cmake python3 ];
+  buildInputs = [ gfortran blas lapack petsc ]
+    ++ lib.optional mpiSupport mpi
+  ;
+  cmakeFlags = lib.optional mpiSupport "-DENABLE_MPI=1";
+
+  meta = with lib; {
+    description = "A General Environment for the Treatment of Discrete Problems";
+    mainProgram = "getdp";
+    longDescription = ''
+      GetDP is a free finite element solver using mixed elements to discretize
+      de Rham-type complexes in one, two and three dimensions.  The main
+      feature of GetDP is the closeness between the input data defining
+      discrete problems (written by the user in ASCII data files) and the
+      symbolic mathematical expressions of these problems.
+    '';
+    homepage = "http://getdp.info/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/gfan/default.nix b/nixpkgs/pkgs/applications/science/math/gfan/default.nix
new file mode 100644
index 000000000000..11a42d1cfdf8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/gfan/default.nix
@@ -0,0 +1,30 @@
+{lib, stdenv, fetchurl, gmp, mpir, cddlib}:
+stdenv.mkDerivation rec {
+  pname = "gfan";
+  version = "0.6.2";
+
+  src = fetchurl {
+    url = "http://home.math.au.dk/jensen/software/gfan/gfan${version}.tar.gz";
+    sha256 = "02pihqb1lb76a0xbfwjzs1cd6ay3ldfxsm8dvsbl6qs3vkjxax56";
+  };
+
+  patches = [
+    ./gfan-0.6.2-cddlib-prefix.patch
+  ];
+
+  postPatch = lib.optionalString stdenv.cc.isClang ''
+    substituteInPlace Makefile --replace "-fno-guess-branch-probability" ""
+  '';
+
+  buildFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "CXX=${stdenv.cc.targetPrefix}c++" ];
+  installFlags = [ "PREFIX=$(out)" ];
+  buildInputs = [ gmp mpir cddlib ];
+
+  meta = {
+    description = "A software package for computing Gröbner fans and tropical varieties";
+    license = lib.licenses.gpl2 ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
+    homepage = "http://home.math.au.dk/jensen/software/gfan/gfan.html";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/gfan/gfan-0.6.2-cddlib-prefix.patch b/nixpkgs/pkgs/applications/science/math/gfan/gfan-0.6.2-cddlib-prefix.patch
new file mode 100644
index 000000000000..8a96a991cf75
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/gfan/gfan-0.6.2-cddlib-prefix.patch
@@ -0,0 +1,55 @@
+diff -ru gfan0.6.2.orig/src/app_librarytest.cpp gfan0.6.2/src/app_librarytest.cpp
+--- gfan0.6.2.orig/src/app_librarytest.cpp	2020-10-19 08:41:27.981863500 +0900
++++ gfan0.6.2/src/app_librarytest.cpp	2020-10-19 08:42:44.551863500 +0900
+@@ -12,8 +12,8 @@
+ #include "setoper.h"
+ #include "cdd.h"
+ #else
+-#include "cdd/setoper.h"
+-#include "cdd/cdd.h"
++#include "cddlib/setoper.h"
++#include "cddlib/cdd.h"
+ #endif
+ #include <iostream>
+ #include <fstream>
+diff -ru gfan0.6.2.orig/src/gfanlib_zcone.cpp gfan0.6.2/src/gfanlib_zcone.cpp
+--- gfan0.6.2.orig/src/gfanlib_zcone.cpp	2020-10-19 08:41:27.981863500 +0900
++++ gfan0.6.2/src/gfanlib_zcone.cpp	2020-10-19 08:42:44.571863500 +0900
+@@ -16,8 +16,8 @@
+ #include "setoper.h"
+ #include "cdd.h"
+ #else
+-#include "cdd/setoper.h"
+-#include "cdd/cdd.h"
++#include "cddlib/setoper.h"
++#include "cddlib/cdd.h"
+ #endif
+ //}
+ 
+@@ -52,8 +52,8 @@
+ 				  "dd_free_global_constants()\n"
+ 				  "in your deinitialisation code (only available for cddlib version>=094d).\n"
+ 				  "This requires the header includes:\n"
+-				  "#include \"cdd/setoper.h\"\n"
+-				  "#include \"cdd/cdd.h\"\n"
++				  "#include \"cddlib/setoper.h\"\n"
++				  "#include \"cddlib/cdd.h\"\n"
+ 				  "\n"
+ 				  "Alternatively, you may call gfan:initializeCddlibIfRequired() and deinitializeCddlibIfRequired()\n"
+ 				  "if gfanlib is the only code using cddlib. If at some point cddlib is no longer required by gfanlib\n"
+diff -ru gfan0.6.2.orig/src/lp_cdd.cpp gfan0.6.2/src/lp_cdd.cpp
+--- gfan0.6.2.orig/src/lp_cdd.cpp	2020-10-19 08:41:27.991863500 +0900
++++ gfan0.6.2/src/lp_cdd.cpp	2020-10-19 08:42:44.571863500 +0900
+@@ -5,9 +5,9 @@
+ #include "cdd.h"
+ #include "cdd_f.h"
+ #else
+-#include "cdd/setoper.h"
+-#include "cdd/cdd.h"
+-#include "cdd/cdd_f.h"
++#include "cddlib/setoper.h"
++#include "cddlib/cdd.h"
++#include "cddlib/cdd_f.h"
+ #endif
+ //}
+ #include "termorder.h"
diff --git a/nixpkgs/pkgs/applications/science/math/giac/default.nix b/nixpkgs/pkgs/applications/science/math/giac/default.nix
new file mode 100644
index 000000000000..0dc12b6dcb05
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/giac/default.nix
@@ -0,0 +1,135 @@
+{ stdenv, lib, fetchurl, fetchpatch, texliveSmall, bison, flex, lapack, blas
+, autoreconfHook, gmp, mpfr, pari, ntl, gsl, mpfi, ecm, glpk, nauty
+, buildPackages, readline, gettext, libpng, libao, gfortran, perl
+, enableGUI ? false, libGL, libGLU, xorg, fltk
+, enableMicroPy ? false, python3
+}:
+
+assert (!blas.isILP64) && (!lapack.isILP64);
+
+stdenv.mkDerivation rec {
+  pname = "giac${lib.optionalString enableGUI "-with-xcas"}";
+  version = "1.9.0-43"; # TODO try to remove preCheck phase on upgrade
+
+  src = fetchurl {
+    url = "https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/giac_${version}.tar.gz";
+    sha256 = "sha256-466jB8ZRqHkU5XCY+j0Fh7Dq/mMaOu10rHECKbtNGrs=";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "pari_2_11.patch";
+      url = "https://raw.githubusercontent.com/sagemath/sage/21ba7540d385a9864b44850d6987893dfa16bfc0/build/pkgs/giac/patches/pari_2_11.patch";
+      sha256 = "sha256-vEo/5MNzMdYRPWgLFPsDcMT1W80Qzj4EPBjx/B8j68k=";
+    })
+
+    # giac calls scanf/printf with non-constant first arguments, which
+    # the compiler rightfully warns about (with an error nowadays).
+    (fetchpatch {
+      name = "fix-string-compiler-error.patch";
+      url = "https://salsa.debian.org/science-team/giac/-/raw/9ca8dbf4bb16d9d96948aa4024326d32485d7917/debian/patches/fix-string-compiler-error.patch";
+      sha256 = "sha256-r+M+9MRPRqhHcdhYWI6inxyNvWbXUbBcPCeDY7aulvk=";
+    })
+
+    # increase pari stack size for test chk_fhan{4,6}
+    ./increase-pari-stack-size.patch
+  ] ++ lib.optionals (!enableGUI) [
+    # when enableGui is false, giac is compiled without fltk. That
+    # means some outputs differ in the make check. Patch around this:
+    (fetchpatch {
+      name = "nofltk-check.patch";
+      url = "https://raw.githubusercontent.com/sagemath/sage/7553a3c8dfa7bcec07241a07e6a4e7dcf5bb4f26/build/pkgs/giac/patches/nofltk-check.patch";
+      sha256 = "sha256-nAl5q3ufLjK3X9s0qMlGNowdRRf3EaC24eVtJABzdXY=";
+    })
+  ];
+
+  # 1.9.0-5's tarball contains a binary (src/mkjs) which is executed
+  # at build time. we will delete and rebuild it.
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+
+  postPatch = ''
+    for i in doc/*/Makefile* micropython*/xcas/Makefile*; do
+      substituteInPlace "$i" --replace "/bin/cp" "cp";
+    done;
+    rm src/mkjs
+    substituteInPlace src/Makefile.am --replace "g++ mkjs.cc" \
+      "${buildPackages.stdenv.cc.targetPrefix}c++ mkjs.cc"
+
+    # to open help
+    substituteInPlace src/global.cc --replace 'browser="mozilla"' 'browser="xdg-open"'
+  '';
+
+  nativeBuildInputs = [
+    autoreconfHook texliveSmall bison flex
+  ];
+
+  # perl is only needed for patchShebangs fixup.
+  buildInputs = [
+    gmp mpfr pari ntl gsl blas mpfi glpk nauty
+    readline gettext libpng libao perl ecm
+    # gfortran.cc default output contains static libraries compiled without -fPIC
+    # we want libgfortran.so.3 instead
+    (lib.getLib gfortran.cc)
+    lapack blas
+  ] ++ lib.optionals enableGUI [
+    libGL libGLU fltk xorg.libX11
+  ] ++ lib.optional enableMicroPy python3;
+
+  # xcas Phys and Turtle menus are broken with split outputs
+  # and interactive use is likely to need docs
+  outputs = [ "out" ] ++ lib.optional (!enableGUI) "doc";
+
+  doCheck = true;
+  preCheck = lib.optionalString (!enableGUI) ''
+    # even with the nofltk patch, some changes in src/misc.cc (grep
+    # for HAVE_LIBFLTK) made it so that giac behaves differently
+    # when fltk is disabled. disable these tests for now.
+    echo > check/chk_fhan2
+    echo > check/chk_fhan9
+  '';
+
+  enableParallelBuilding = true;
+
+  configureFlags = [
+    "--enable-gc" "--enable-png" "--enable-gsl" "--enable-lapack"
+    "--enable-pari" "--enable-ntl" "--enable-gmpxx" # "--enable-cocoa"
+    "--enable-ao" "--enable-ecm" "--enable-glpk"
+  ] ++ lib.optionals enableGUI [
+    "--enable-gui" "--with-x"
+  ] ++ lib.optionals (!enableGUI) [
+    "--disable-fltk"
+  ] ++ lib.optionals (!enableMicroPy) [
+    "--disable-micropy"
+  ];
+
+  postInstall = ''
+    # example Makefiles contain the full path to some commands
+    # notably texlive, and we don't want texlive to become a runtime
+    # dependency
+    for file in $(find $out -name Makefile) ; do
+      sed -i "s@${builtins.storeDir}/[^/]*/bin/@@" "$file" ;
+    done;
+
+    # reference cycle
+    rm "$out/share/giac/doc/el/"{casinter,tutoriel}/Makefile
+
+    if [ -n "$doc" ]; then
+      mkdir -p "$doc/share/giac"
+      mv "$out/share/giac/doc" "$doc/share/giac"
+      mv "$out/share/giac/examples" "$doc/share/giac"
+    fi
+  '' + lib.optionalString (!enableGUI) ''
+    for i in pixmaps application-registry applications icons; do
+      rm -r "$out/share/$i";
+    done;
+  '';
+
+  meta = with lib; {
+    description = "A free computer algebra system (CAS)";
+    homepage = "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux ++ (optionals (!enableGUI) platforms.darwin);
+    broken = stdenv.isDarwin && stdenv.isAarch64;
+    maintainers = [ maintainers.symphorien ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/giac/increase-pari-stack-size.patch b/nixpkgs/pkgs/applications/science/math/giac/increase-pari-stack-size.patch
new file mode 100644
index 000000000000..b12b4b7fad66
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/giac/increase-pari-stack-size.patch
@@ -0,0 +1,18 @@
+diff -ur a/check/chk_fhan4 b/check/chk_fhan4
+--- a/check/chk_fhan4	2018-03-13 19:27:11.000000000 +0100
++++ b/check/chk_fhan4	2023-05-20 16:31:30.349063063 +0200
+@@ -1,4 +1,5 @@
+ #! /bin/sh
+ unset LANG
++export PARI_SIZE=2048000
+ ../src/icas TP04-sol.cas > TP04.tst
+ diff TP04.tst TP04-sol.cas.out1
+diff -ur a/check/chk_fhan6 b/check/chk_fhan6
+--- a/check/chk_fhan6	2018-03-13 19:27:21.000000000 +0100
++++ b/check/chk_fhan6	2023-05-20 16:32:04.199407065 +0200
+@@ -1,4 +1,5 @@
+ #! /bin/sh
+ unset LANG
++export PARI_SIZE=2048000
+ ../src/icas TP06-sol.cas > TP06.tst
+ diff TP06.tst TP06-sol.cas.out1
diff --git a/nixpkgs/pkgs/applications/science/math/ginac/default.nix b/nixpkgs/pkgs/applications/science/math/ginac/default.nix
new file mode 100644
index 000000000000..d9d12cbf388d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/ginac/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, cln, pkg-config, readline, gmp, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "ginac";
+  version = "1.8.7";
+
+  src = fetchurl {
+    url = "https://www.ginac.de/ginac-${version}.tar.bz2";
+    sha256 = "sha256-cf9PLYoA5vB86P7mm3bcweu7cnvmdgtYfB+7XM97Yeo=";
+  };
+
+  propagatedBuildInputs = [ cln ];
+
+  buildInputs = [ readline ]
+    ++ lib.optional stdenv.isDarwin gmp;
+
+  nativeBuildInputs = [ pkg-config python3 ];
+
+  strictDeps = true;
+
+  preConfigure = ''
+    patchShebangs ginsh
+  '';
+
+  configureFlags = [ "--disable-rpath" ];
+
+  meta = with lib; {
+    description = "GiNaC is Not a CAS";
+    homepage = "https://www.ginac.de/";
+    maintainers = with maintainers; [ lovek323 ];
+    license = licenses.gpl2;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/glsurf/default.nix b/nixpkgs/pkgs/applications/science/math/glsurf/default.nix
new file mode 100644
index 000000000000..d2ebba75638b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/glsurf/default.nix
@@ -0,0 +1,73 @@
+{ lib
+, stdenv
+, fetchurl
+, ocamlPackages
+, makeWrapper
+, libGLU
+, libGL
+, freeglut
+, mpfr
+, gmp
+, pkgsHostTarget
+}:
+
+let
+  inherit (pkgsHostTarget.targetPackages.stdenv) cc;
+in
+
+stdenv.mkDerivation rec {
+  pname = "glsurf";
+  version = "3.3.1";
+
+  src = fetchurl {
+    url = "https://raffalli.eu/~christophe/glsurf/glsurf-${version}.tar.gz";
+    sha256 = "0w8xxfnw2snflz8wdr2ca9f5g91w5vbyp1hwlx1v7vg83d4bwqs7";
+  };
+
+  nativeBuildInputs = [
+    makeWrapper
+  ] ++ (with ocamlPackages; [
+    ocaml
+    findlib
+  ]);
+
+  buildInputs = [
+    freeglut
+    libGL
+    libGLU
+    mpfr
+    gmp
+  ] ++ (with ocamlPackages; [
+    camlp4
+    lablgl
+    camlimages
+    num
+  ]);
+
+  postPatch = ''
+    for f in callbacks*/Makefile src/Makefile; do
+      substituteInPlace "$f" --replace "+camlp4" \
+        "${ocamlPackages.camlp4}/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/camlp4"
+    done
+
+    # Fatal error: exception Sys_error("Mutex.unlock: Operation not permitted")
+    sed -i "/gl_started/d" src/draw.ml* src/main.ml
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/doc/glsurf
+    cp ./src/glsurf.opt $out/bin/glsurf
+    cp ./doc/doc.pdf $out/share/doc/glsurf
+    cp -r ./examples $out/share/doc/glsurf
+
+    wrapProgram "$out/bin/glsurf" --set CC "${cc}/bin/${cc.targetPrefix}cc"
+  '';
+
+  meta = {
+    homepage = "https://raffalli.eu/~christophe/glsurf/";
+    description = "A program to draw implicit surfaces and curves";
+    mainProgram = "glsurf";
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/gmsh/default.nix b/nixpkgs/pkgs/applications/science/math/gmsh/default.nix
new file mode 100644
index 000000000000..669d3a3ab8f1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/gmsh/default.nix
@@ -0,0 +1,71 @@
+{ lib, stdenv, fetchurl, fetchpatch, cmake, blas, lapack, gfortran, gmm, fltk, libjpeg
+, zlib, libGL, libGLU, xorg, opencascade-occt
+, python ? null, enablePython ? false }:
+
+assert (!blas.isILP64) && (!lapack.isILP64);
+assert enablePython -> (python != null);
+
+stdenv.mkDerivation rec {
+  pname = "gmsh";
+  version = "4.11.1";
+
+  src = fetchurl {
+    url = "https://gmsh.info/src/gmsh-${version}-source.tgz";
+    sha256 = "sha256-xf4bfL1AOIioFJKfL9D11p4nYAIioYx4bbW3boAFs2U=";
+  };
+
+  buildInputs = [
+    blas lapack gmm fltk libjpeg zlib opencascade-occt
+  ] ++ lib.optionals (!stdenv.isDarwin) [
+    libGL libGLU xorg.libXrender xorg.libXcursor xorg.libXfixes
+    xorg.libXext xorg.libXft xorg.libXinerama xorg.libX11 xorg.libSM
+    xorg.libICE
+  ] ++ lib.optional enablePython python;
+
+  enableParallelBuilding = true;
+
+  patches = [
+    ./fix-python.patch
+
+    # Pull upstream fix git gcc-13:
+    #   https://gitlab.onelab.info/gmsh/gmsh/-/issues/2416
+    (fetchpatch {
+      name = "gcc-13-p1.patch";
+      url = "https://gitlab.onelab.info/gmsh/gmsh/-/commit/fb81a9c9026700e078de947b4522cb39e543a86b.patch";
+      hash = "sha256-1GInFqQZvOgflC3eQTjmZ9uBGFASRNCpCwDACN3yTQ4=";
+    })
+    (fetchpatch {
+      name = "gcc-13-p2.patch";
+      url = "https://gitlab.onelab.info/gmsh/gmsh/-/commit/aceb09c807b78ea26555f99fcb16c4f87c31fb5a.patch";
+      hash = "sha256-6FI0hIvj8hglCvxoKV0GzT2/F/Wz+ddkxV/TLzzJBLU=";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace api/gmsh.py --subst-var-by LIBPATH ${placeholder "out"}/lib/libgmsh.so
+  '';
+
+  # N.B. the shared object is used by bindings
+  cmakeFlags = [
+    "-DENABLE_BUILD_SHARED=ON"
+    "-DENABLE_BUILD_DYNAMIC=ON"
+    "-DENABLE_OPENMP=ON"
+  ];
+
+  nativeBuildInputs = [ cmake gfortran ];
+
+  postFixup = lib.optionalString enablePython ''
+    mkdir -p $out/lib/python${python.pythonVersion}/site-packages
+    mv $out/lib/gmsh.py $out/lib/python${python.pythonVersion}/site-packages
+    mv $out/lib/*.dist-info $out/lib/python${python.pythonVersion}/site-packages
+  '';
+
+  doCheck = true;
+
+  meta = {
+    description = "A three-dimensional finite element mesh generator";
+    mainProgram = "gmsh";
+    homepage = "https://gmsh.info/";
+    license = lib.licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/gmsh/fix-python.patch b/nixpkgs/pkgs/applications/science/math/gmsh/fix-python.patch
new file mode 100644
index 000000000000..ac07c169c99b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/gmsh/fix-python.patch
@@ -0,0 +1,50 @@
+diff --git a/api/gmsh.py b/api/gmsh.py
+index 747acb203..02004da5d 100644
+--- a/api/gmsh.py
++++ b/api/gmsh.py
+@@ -44,44 +44,7 @@ moduledir = os.path.dirname(os.path.realpath(__file__))
+ parentdir1 = os.path.dirname(moduledir)
+ parentdir2 = os.path.dirname(parentdir1)
+ 
+-if platform.system() == "Windows":
+-    libname = "gmsh-4.11.dll"
+-elif platform.system() == "Darwin":
+-    libname = "libgmsh.4.11.dylib"
+-else:
+-    libname = "libgmsh.so.4.11"
+-
+-# check if the library is in the same directory as the module...
+-libpath = os.path.join(moduledir, libname)
+-
+-# ... or in the parent directory or its lib or Lib subdirectory
+-if not os.path.exists(libpath):
+-    libpath = os.path.join(parentdir1, libname)
+-if not os.path.exists(libpath):
+-    libpath = os.path.join(parentdir1, "lib", libname)
+-if not os.path.exists(libpath):
+-    libpath = os.path.join(parentdir1, "Lib", libname)
+-
+-# ... or in the parent of the parent directory or its lib or Lib subdirectory
+-if not os.path.exists(libpath):
+-    libpath = os.path.join(parentdir2, libname)
+-if not os.path.exists(libpath):
+-    libpath = os.path.join(parentdir2, "lib", libname)
+-if not os.path.exists(libpath):
+-    libpath = os.path.join(parentdir2, "Lib", libname)
+-
+-# if we couldn't find it, use ctype's find_library utility...
+-if not os.path.exists(libpath):
+-    if platform.system() == "Windows":
+-        libpath = find_library("gmsh-4.11")
+-        if not libpath:
+-            libpath = find_library("gmsh")
+-    else:
+-        libpath = find_library("gmsh")
+-
+-# ... and print a warning if everything failed
+-if not os.path.exists(libpath):
+-    print("Warning: could not find Gmsh shared library " + libname)
++libpath = "@LIBPATH@"
+ 
+ lib = CDLL(libpath)
+ 
diff --git a/nixpkgs/pkgs/applications/science/math/gretl/default.nix b/nixpkgs/pkgs/applications/science/math/gretl/default.nix
new file mode 100644
index 000000000000..2c3963cecec9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/gretl/default.nix
@@ -0,0 +1,67 @@
+{ lib
+, stdenv
+, fetchurl
+, curl
+, fftw
+, gmp
+, gnuplot
+, gtk3
+, gtksourceview3
+, json-glib
+, lapack
+, libxml2
+, mpfr
+, openblas
+, readline
+, Accelerate
+, pkg-config
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "gretl";
+  version = "2023c";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gretl/gretl-${finalAttrs.version}.tar.xz";
+    hash = "sha256-vTxCmHrTpYTo9CIPousUCnpcalS6cN1u8bRaOJyu6MI=";
+  };
+
+  buildInputs = [
+    curl
+    fftw
+    gmp
+    gnuplot
+    gtk3
+    gtksourceview3
+    json-glib
+    lapack
+    libxml2
+    mpfr
+    openblas
+    readline
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
+    Accelerate
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  enableParallelBuilding = true;
+  # Missing install depends:
+  #  cp: cannot stat '...-gretl-2022c/share/gretl/data/plotbars': Not a directory
+  #  make[1]: *** [Makefile:73: install_datafiles] Error 1
+  enableParallelInstalling = false;
+
+  meta = {
+    description = "A software package for econometric analysis";
+    homepage = "https://gretl.sourceforge.net";
+    license = lib.licenses.gpl3;
+    longDescription = ''
+      gretl is a cross-platform software package for econometric analysis,
+      written in the C programming language.
+    '';
+    maintainers = with lib.maintainers; [ dmrauh ];
+    platforms = lib.platforms.all;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/math/gurobi/default.nix b/nixpkgs/pkgs/applications/science/math/gurobi/default.nix
new file mode 100644
index 000000000000..35b9e9d7a8d4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/gurobi/default.nix
@@ -0,0 +1,57 @@
+{ stdenv, lib, fetchurl, autoPatchelfHook, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "gurobi";
+  version = "9.5.1";
+
+  src = fetchurl {
+    url = "https://packages.gurobi.com/${lib.versions.majorMinor version}/gurobi${version}_linux64.tar.gz";
+    sha256 = "sha256-+oKFnTPwj7iuudpmsPvZFxjtVzxTT1capSNyyd64kdo=";
+  };
+
+  sourceRoot = "gurobi${builtins.replaceStrings ["."] [""] version}/linux64";
+
+  nativeBuildInputs = [ autoPatchelfHook ];
+  buildInputs = [ (python3.withPackages (ps: [ ps.gurobipy ])) ];
+
+  strictDeps = true;
+
+  makeFlags = [ "--directory=src/build" ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp bin/* $out/bin/
+    rm $out/bin/gurobi.sh
+    rm $out/bin/python*
+
+    cp lib/gurobi.py $out/bin/gurobi.sh
+
+    mkdir -p $out/include
+    cp include/gurobi*.h $out/include/
+
+    mkdir -p $out/lib
+    cp lib/*.jar $out/lib/
+    cp lib/libGurobiJni*.so $out/lib/
+    cp lib/libgurobi*.so* $out/lib/
+    cp lib/libgurobi*.a $out/lib/
+    cp src/build/*.a $out/lib/
+
+    mkdir -p $out/share/java
+    ln -s $out/lib/gurobi.jar $out/share/java/
+    ln -s $out/lib/gurobi-javadoc.jar $out/share/java/
+  '';
+
+  passthru.libSuffix = lib.replaceStrings [ "." ] [ "" ] (lib.versions.majorMinor version);
+
+  meta = with lib; {
+    description = "Optimization solver for mathematical programming";
+    homepage = "https://www.gurobi.com";
+    sourceProvenance = with sourceTypes; [
+      binaryBytecode
+      binaryNativeCode
+    ];
+    license = licenses.unfree;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/hmetis/default.nix b/nixpkgs/pkgs/applications/science/math/hmetis/default.nix
new file mode 100644
index 000000000000..1c0152b7bfc7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/hmetis/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchurl, ghostscript }:
+
+stdenv.mkDerivation rec {
+  pname = "hmetis";
+  version = "1.5";
+
+  src = fetchurl {
+    url = "http://glaros.dtc.umn.edu/gkhome/fetch/sw/hmetis/hmetis-${version}-linux.tar.gz";
+    sha256 = "e835a098c046e9c26cecb8addfea4d18ff25214e49585ffd87038e72819be7e1";
+  };
+
+  nativeBuildInputs = [ ghostscript ];
+
+  binaryFiles = "hmetis khmetis shmetis";
+
+  patchPhase = ''
+    for binaryfile in $binaryFiles; do
+      patchelf \
+        --set-interpreter ${stdenv.cc.libc}/lib/ld-linux.so.2 \
+        --set-rpath ${stdenv.cc.libc}/lib \
+        $binaryfile
+    done
+  '';
+
+  buildPhase = ''
+    gs -sOutputFile=manual.pdf -sDEVICE=pdfwrite -SNOPAUSE -dBATCH manual.ps
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/doc/hmetis $out/lib
+    mv $binaryFiles $out/bin
+    mv manual.pdf $out/share/doc/hmetis
+    mv libhmetis.a $out/lib
+  '';
+
+  meta = with lib; {
+    description = "hMETIS is a set of programs for partitioning hypergraphs";
+    homepage = "http://glaros.dtc.umn.edu/gkhome/metis/hmetis/overview";
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    license = licenses.unfree;
+    platforms = [ "i686-linux" "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/jags/default.nix b/nixpkgs/pkgs/applications/science/math/jags/default.nix
new file mode 100644
index 000000000000..50d7df24417a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/jags/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, gfortran, blas, lapack }:
+
+stdenv.mkDerivation rec {
+  pname = "JAGS";
+  version = "4.3.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/mcmc-jags/JAGS-${version}.tar.gz";
+    sha256 = "sha256-hx9VavQDp8LOag8C8Vz4WlcnY+CT0mZY66xVxKtHL8g=";
+  };
+
+  nativeBuildInputs = [ gfortran ];
+
+  buildInputs = [ blas lapack ];
+
+  configureFlags = [ "--with-blas=-lblas" "--with-lapack=-llapack" ];
+
+  meta = with lib; {
+    description = "Just Another Gibbs Sampler";
+    mainProgram = "jags";
+    license = licenses.gpl2;
+    homepage = "http://mcmc-jags.sourceforge.net";
+    maintainers = [ maintainers.andres ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/labplot/default.nix b/nixpkgs/pkgs/applications/science/math/labplot/default.nix
new file mode 100644
index 000000000000..8bb667e1a8fa
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/labplot/default.nix
@@ -0,0 +1,107 @@
+{ lib
+, stdenv
+, fetchurl
+, cmake
+, extra-cmake-modules
+, shared-mime-info
+, wrapQtAppsHook
+
+, qtbase
+
+, karchive
+, kcompletion
+, kconfig
+, kcoreaddons
+, kcrash
+, kdoctools
+, ki18n
+, kiconthemes
+, kio
+, knewstuff
+, kparts
+, ktextwidgets
+, kxmlgui
+, syntax-highlighting
+
+, gsl
+
+, poppler
+, fftw
+, hdf5
+, netcdf
+, cfitsio
+, libcerf
+, cantor
+, zlib
+, lz4
+, readstat
+, matio
+, qtserialport
+, discount
+}:
+
+stdenv.mkDerivation rec {
+  pname = "labplot";
+  version = "2.10.1";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/labplot/labplot-${version}.tar.xz";
+    sha256 = "sha256-K24YFRfPtuDf/3uJXz6yDHzjWeZzLThUXgdXya6i2u8=";
+  };
+
+  cmakeFlags = [
+    # Disable Vector BLF since it depends on DBC parser which fails to be detected
+    "-DENABLE_VECTOR_BLF=OFF"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+    shared-mime-info
+    wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    qtbase
+
+    karchive
+    kcompletion
+    kconfig
+    kcoreaddons
+    kcrash
+    kdoctools
+    ki18n
+    kiconthemes
+    kio
+    knewstuff
+    kparts
+    ktextwidgets
+    kxmlgui
+
+    syntax-highlighting
+    gsl
+
+    poppler
+    fftw
+    hdf5
+    netcdf
+    cfitsio
+    libcerf
+    cantor
+    zlib
+    lz4
+    readstat
+    matio
+    qtserialport
+    discount
+  ];
+
+  meta = with lib; {
+    description = "LabPlot is a FREE, open source and cross-platform Data Visualization and Analysis software accessible to everyone";
+    homepage = "https://labplot.kde.org";
+    license = with licenses; [ asl20 bsd3 cc-by-30 cc0 gpl2Only gpl2Plus gpl3Only gpl3Plus lgpl3Plus mit ];
+    maintainers = with maintainers; [ hqurve ];
+    mainProgram = "labplot2";
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/lp_solve/default.nix b/nixpkgs/pkgs/applications/science/math/lp_solve/default.nix
new file mode 100644
index 000000000000..fdabc8896a58
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/lp_solve/default.nix
@@ -0,0 +1,68 @@
+{ lib
+, stdenv
+, fetchurl
+, cctools
+, fixDarwinDylibNames
+, autoSignDarwinBinariesHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "lp_solve";
+  version = "5.5.2.11";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/lpsolve/lpsolve/${version}/lp_solve_${version}_source.tar.gz";
+    sha256 = "sha256-bUq/9cxqqpM66ObBeiJt8PwLZxxDj2lxXUHQn+gfkC8=";
+  };
+
+  nativeBuildInputs = lib.optionals stdenv.isDarwin [
+    cctools
+    fixDarwinDylibNames
+  ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
+    autoSignDarwinBinariesHook
+  ];
+
+  env = {
+    NIX_CFLAGS_COMPILE = "-Wno-error=implicit-int";
+  } // lib.optionalAttrs (stdenv.isDarwin && stdenv.isx86_64) {
+    NIX_LDFLAGS = "-headerpad_max_install_names";
+  };
+
+  dontConfigure = true;
+
+  buildPhase =
+    let
+      ccc = if stdenv.isDarwin then "ccc.osx" else "ccc";
+    in
+    ''
+      runHook preBuild
+
+      (cd lpsolve55 && bash -x -e ${ccc})
+      (cd lp_solve  && bash -x -e ${ccc})
+
+      runHook postBuild
+    '';
+
+  installPhase = ''
+    runHook preInstall
+
+    install -d -m755 $out/bin $out/lib $out/include/lpsolve
+    install -m755 lp_solve/bin/*/lp_solve -t $out/bin
+    install -m644 lpsolve55/bin/*/liblpsolve* -t $out/lib
+    install -m644 lp_*.h -t $out/include/lpsolve
+
+    rm $out/lib/liblpsolve*.a
+    rm $out/include/lpsolve/lp_solveDLL.h  # A Windows header
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "A Mixed Integer Linear Programming (MILP) solver";
+    mainProgram = "lp_solve";
+    homepage = "https://lpsolve.sourceforge.net";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ smironov ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/lrcalc/default.nix b/nixpkgs/pkgs/applications/science/math/lrcalc/default.nix
new file mode 100644
index 000000000000..90ee50c68280
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/lrcalc/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv
+, fetchFromBitbucket
+, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  version = "2.1";
+  pname = "lrcalc";
+
+  src = fetchFromBitbucket {
+    owner = "asbuch";
+    repo = "lrcalc";
+    rev = "lrcalc-${version}";
+    sha256 = "0s3amf3z75hnrjyszdndrvk4wp5p630dcgyj341i6l57h43d1p4k";
+  };
+
+  doCheck = true;
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
+  meta = with lib; {
+    description = "Littlewood-Richardson calculator";
+    homepage = "http://math.rutgers.edu/~asbuch/lrcalc/";
+    license = licenses.gpl2Plus;
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/mathematica/10.nix b/nixpkgs/pkgs/applications/science/math/mathematica/10.nix
new file mode 100644
index 000000000000..e5ab259b8f70
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/mathematica/10.nix
@@ -0,0 +1,132 @@
+{ lib
+, patchelf
+, requireFile
+, stdenv
+# arguments from default.nix
+, lang
+, meta
+, name
+, src
+, version
+# dependencies
+, alsa-lib
+, coreutils
+, cudaPackages
+, fontconfig
+, freetype
+, gcc
+, glib
+, libuuid
+, libxml2
+, ncurses
+, opencv2
+, openssl
+, unixODBC
+, xorg
+# options
+, cudaSupport
+}:
+
+let
+  platform =
+    if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux" then
+      "Linux"
+    else
+      throw "Mathematica requires i686-linux or x86_64 linux";
+in
+stdenv.mkDerivation rec {
+  inherit meta src version;
+
+  pname = "mathematica";
+
+  buildInputs = [
+    coreutils
+    patchelf
+    alsa-lib
+    coreutils
+    fontconfig
+    freetype
+    gcc.cc
+    gcc.libc
+    glib
+    ncurses
+    opencv2
+    openssl
+    unixODBC
+    libxml2
+    libuuid
+  ] ++ (with xorg; [
+    libX11
+    libXext
+    libXtst
+    libXi
+    libXmu
+    libXrender
+    libxcb
+    libXcursor
+    libXfixes
+    libXrandr
+    libICE
+    libSM
+  ]);
+
+  ldpath = lib.makeLibraryPath buildInputs
+    + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux")
+      (":" + lib.makeSearchPathOutput "lib" "lib64" buildInputs);
+
+  dontConfigure = true;
+  dontBuild = true;
+
+  unpackPhase = ''
+    echo "=== Extracting makeself archive ==="
+    # find offset from file
+    offset=$(${stdenv.shell} -c "$(grep -axm1 -e 'offset=.*' $src); echo \$offset" $src)
+    dd if="$src" ibs=$offset skip=1 | tar -xf -
+    cd Unix
+  '';
+
+  installPhase = ''
+    cd Installer
+    # don't restrict PATH, that has already been done
+    sed -i -e 's/^PATH=/# PATH=/' MathInstaller
+
+    echo "=== Running MathInstaller ==="
+    ./MathInstaller -auto -createdir=y -execdir=$out/bin -targetdir=$out/libexec/Mathematica -platforms=${platform} -silent
+  '';
+
+  preFixup = ''
+    echo "=== PatchElfing away ==="
+    # This code should be a bit forgiving of errors, unfortunately
+    set +e
+    find $out/libexec/Mathematica/SystemFiles -type f -perm -0100 | while read f; do
+      type=$(readelf -h "$f" 2>/dev/null | grep 'Type:' | sed -e 's/ *Type: *\([A-Z]*\) (.*/\1/')
+      if [ -z "$type" ]; then
+        :
+      elif [ "$type" == "EXEC" ]; then
+        echo "patching $f executable <<"
+        patchelf --shrink-rpath "$f"
+        patchelf \
+    --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+          --set-rpath "$(patchelf --print-rpath "$f"):${ldpath}" \
+          "$f" \
+          && patchelf --shrink-rpath "$f" \
+          || echo unable to patch ... ignoring 1>&2
+      elif [ "$type" == "DYN" ]; then
+        echo "patching $f library <<"
+        patchelf \
+          --set-rpath "$(patchelf --print-rpath "$f"):${ldpath}" \
+          "$f" \
+          && patchelf --shrink-rpath "$f" \
+          || echo unable to patch ... ignoring 1>&2
+      else
+        echo "not patching $f <<: unknown elf type"
+      fi
+    done
+  '';
+
+  # all binaries are already stripped
+  dontStrip = true;
+
+  # we did this in prefixup already
+  dontPatchELF = true;
+}
diff --git a/nixpkgs/pkgs/applications/science/math/mathematica/11.nix b/nixpkgs/pkgs/applications/science/math/mathematica/11.nix
new file mode 100644
index 000000000000..5b9460f76e06
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/mathematica/11.nix
@@ -0,0 +1,146 @@
+{ lib
+, patchelf
+, requireFile
+, stdenv
+# arguments from default.nix
+, lang
+, meta
+, name
+, src
+, version
+# dependencies
+, alsa-lib
+, coreutils
+, cudaPackages
+, dbus
+, fontconfig
+, freetype
+, gcc
+, glib
+, libGL
+, libGLU
+, libuuid
+, libxml2
+, ncurses
+, opencv2
+, openssl
+, unixODBC
+, xkeyboard_config
+, xorg
+, zlib
+# options
+, cudaSupport
+}:
+
+stdenv.mkDerivation rec {
+  inherit meta name src version;
+
+  buildInputs = [
+    coreutils
+    patchelf
+    alsa-lib
+    coreutils
+    dbus
+    fontconfig
+    freetype
+    gcc.cc
+    gcc.libc
+    glib
+    ncurses
+    opencv2
+    openssl
+    unixODBC
+    xkeyboard_config
+    libxml2
+    libuuid
+    zlib
+    libGL
+    libGLU
+  ] ++ (with xorg; [
+    libX11
+    libXext
+    libXtst
+    libXi
+    libXmu
+    libXrender
+    libxcb
+    libXcursor
+    libXfixes
+    libXrandr
+    libICE
+    libSM
+  ]);
+
+  ldpath = lib.makeLibraryPath buildInputs
+    + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux")
+      (":" + lib.makeSearchPathOutput "lib" "lib64" buildInputs);
+
+  dontConfigure = true;
+  dontBuild = true;
+
+  unpackPhase = ''
+    echo "=== Extracting makeself archive ==="
+    # find offset from file
+    offset=$(${stdenv.shell} -c "$(grep -axm1 -e 'offset=.*' $src); echo \$offset" $src)
+    dd if="$src" ibs=$offset skip=1 | tar -xf -
+    cd Unix
+  '';
+
+  installPhase = ''
+    cd Installer
+    # don't restrict PATH, that has already been done
+    sed -i -e 's/^PATH=/# PATH=/' MathInstaller
+    sed -i -e 's/\/bin\/bash/\/bin\/sh/' MathInstaller
+
+    echo "=== Running MathInstaller ==="
+    ./MathInstaller -auto -createdir=y -execdir=$out/bin -targetdir=$out/libexec/Mathematica -silent
+
+    # Fix library paths
+    cd $out/libexec/Mathematica/Executables
+    for path in mathematica MathKernel Mathematica WolframKernel wolfram math; do
+      sed -i -e 's#export LD_LIBRARY_PATH$#export LD_LIBRARY_PATH=${zlib}/lib:\''${LD_LIBRARY_PATH}#' $path
+    done
+
+    # Fix xkeyboard config path for Qt
+    for path in mathematica Mathematica; do
+      line=$(grep -n QT_PLUGIN_PATH $path | sed 's/:.*//')
+      sed -i -e "$line iexport QT_XKB_CONFIG_ROOT=\"${xkeyboard_config}/share/X11/xkb\"" $path
+    done
+  '';
+
+  preFixup = ''
+    echo "=== PatchElfing away ==="
+    # This code should be a bit forgiving of errors, unfortunately
+    set +e
+    find $out/libexec/Mathematica/SystemFiles -type f -perm -0100 | while read f; do
+      type=$(readelf -h "$f" 2>/dev/null | grep 'Type:' | sed -e 's/ *Type: *\([A-Z]*\) (.*/\1/')
+      if [ -z "$type" ]; then
+        :
+      elif [ "$type" == "EXEC" ]; then
+        echo "patching $f executable <<"
+        patchelf --shrink-rpath "$f"
+        patchelf \
+    --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+          --set-rpath "$(patchelf --print-rpath "$f"):${ldpath}" \
+          "$f" \
+          && patchelf --shrink-rpath "$f" \
+          || echo unable to patch ... ignoring 1>&2
+      elif [ "$type" == "DYN" ]; then
+        echo "patching $f library <<"
+        patchelf \
+          --set-rpath "$(patchelf --print-rpath "$f"):${ldpath}" \
+          "$f" \
+          && patchelf --shrink-rpath "$f" \
+          || echo unable to patch ... ignoring 1>&2
+      else
+        echo "not patching $f <<: unknown elf type"
+      fi
+    done
+  '';
+
+  # all binaries are already stripped
+  dontStrip = true;
+
+  # we did this in prefixup already
+  dontPatchELF = true;
+}
diff --git a/nixpkgs/pkgs/applications/science/math/mathematica/9.nix b/nixpkgs/pkgs/applications/science/math/mathematica/9.nix
new file mode 100644
index 000000000000..c2fc07c532fc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/mathematica/9.nix
@@ -0,0 +1,118 @@
+{ lib
+, patchelf
+, requireFile
+, stdenv
+# arguments from default.nix
+, lang
+, meta
+, name
+, src
+, version
+# dependencies
+, alsa-lib
+, coreutils
+, cudaPackages
+, fontconfig
+, freetype
+, gcc
+, glib
+, ncurses
+, opencv2
+, openssl
+, unixODBC
+, xorg
+# options
+, cudaSupport
+}:
+
+let
+  platform =
+    if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux" then
+      "Linux"
+    else
+      throw "Mathematica requires i686-linux or x86_64 linux";
+in
+stdenv.mkDerivation rec {
+  inherit meta src version;
+  pname = "mathematica";
+
+  buildInputs = [
+    coreutils
+    patchelf
+    alsa-lib
+    coreutils
+    fontconfig
+    freetype
+    gcc.cc
+    gcc.libc
+    glib
+    ncurses
+    opencv2
+    openssl
+    unixODBC
+  ] ++ (with xorg; [
+    libX11
+    libXext
+    libXtst
+    libXi
+    libXmu
+    libXrender
+    libxcb
+  ]);
+
+  ldpath = lib.makeLibraryPath buildInputs
+    + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux")
+    (":" + lib.makeSearchPathOutput "lib" "lib64" buildInputs);
+
+  dontConfigure = true;
+  dontBuild = true;
+
+  unpackPhase = ''
+    echo "=== Extracting makeself archive ==="
+    # find offset from file
+    offset=$(${stdenv.shell} -c "$(grep -axm1 -e 'offset=.*' $src); echo \$offset" $src)
+    dd if="$src" ibs=$offset skip=1 | tar -xf -
+    cd Unix
+  '';
+
+  installPhase = ''
+    cd Installer
+    # don't restrict PATH, that has already been done
+    sed -i -e 's/^PATH=/# PATH=/' MathInstaller
+
+    echo "=== Running MathInstaller ==="
+    ./MathInstaller -auto -createdir=y -execdir=$out/bin -targetdir=$out/libexec/Mathematica -platforms=${platform} -silent
+  '';
+
+  preFixup = ''
+    echo "=== PatchElfing away ==="
+    find $out/libexec/Mathematica/SystemFiles -type f -perm -0100 | while read f; do
+      type=$(readelf -h "$f" 2>/dev/null | grep 'Type:' | sed -e 's/ *Type: *\([A-Z]*\) (.*/\1/')
+      if [ -z "$type" ]; then
+        :
+      elif [ "$type" == "EXEC" ]; then
+        echo "patching $f executable <<"
+        patchelf \
+            --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+            --set-rpath "${ldpath}" \
+            "$f"
+        patchelf --shrink-rpath "$f"
+      elif [ "$type" == "DYN" ]; then
+        echo "patching $f library <<"
+        patchelf \
+          --set-rpath "$(patchelf --print-rpath "$f"):${ldpath}" \
+          "$f" \
+          && patchelf --shrink-rpath "$f" \
+          || echo unable to patch ... ignoring 1>&2
+      else
+        echo "not patching $f <<: unknown elf type"
+      fi
+    done
+  '';
+
+  # all binaries are already stripped
+  dontStrip = true;
+
+  # we did this in prefixup already
+  dontPatchELF = true;
+}
diff --git a/nixpkgs/pkgs/applications/science/math/mathematica/default.nix b/nixpkgs/pkgs/applications/science/math/mathematica/default.nix
new file mode 100644
index 000000000000..c4cebcd8e29a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/mathematica/default.nix
@@ -0,0 +1,83 @@
+{ callPackage
+, config
+, lib
+, cudaPackages
+, cudaSupport ? config.cudaSupport
+, lang ? "en"
+, webdoc ? false
+, version ? null
+/*
+If you wish to completely override the src, use:
+my_mathematica = mathematica.override {
+  source = pkgs.requireFile {
+    name = "Mathematica_XX.X.X_BNDL_LINUX.sh";
+    # Get this hash via a command similar to this:
+    # nix-store --query --hash \
+    # $(nix store add-path Mathematica_XX.X.X_BNDL_LINUX.sh --name 'Mathematica_XX.X.X_BNDL_LINUX.sh')
+    sha256 = "0000000000000000000000000000000000000000000000000000";
+    message = ''
+      Your override for Mathematica includes a different src for the installer,
+      and it is missing.
+    '';
+    hashMode = "recursive";
+  };
+}
+*/
+, source ? null
+}:
+
+let versions = callPackage ./versions.nix { };
+
+    matching-versions =
+      lib.sort (v1: v2: lib.versionAtLeast v1.version v2.version) (lib.filter
+        (v: v.lang == lang
+            && (version == null || isMatching v.version version)
+            && matchesDoc v)
+        versions);
+
+    found-version =
+      if matching-versions == []
+      then throw ("No registered Mathematica version found to match"
+                  + " version=${toString version} and language=${lang},"
+                  + " ${if webdoc
+                        then "using web documentation"
+                        else "and with local documentation"}")
+      else lib.head matching-versions;
+
+    specific-drv = ./. + "/${lib.versions.major found-version.version}.nix";
+
+    real-drv = if lib.pathExists specific-drv
+               then specific-drv
+               else ./generic.nix;
+
+    isMatching = v1: v2:
+      let as      = lib.splitVersion v1;
+          bs      = lib.splitVersion v2;
+          n       = lib.min (lib.length as) (lib.length bs);
+          sublist = l: lib.sublist 0 n l;
+      in lib.compareLists lib.compare (sublist as) (sublist bs) == 0;
+
+    matchesDoc = v:
+      builtins.match (if webdoc
+                      then ".*[0-9]_LINUX.sh"
+                      else ".*[0-9]_BNDL_LINUX.sh") v.src.name != null;
+
+in
+
+callPackage real-drv {
+  inherit cudaSupport cudaPackages;
+  inherit (found-version) version lang;
+  src = if source == null then found-version.src else source;
+  name = ("mathematica"
+          + lib.optionalString cudaSupport "-cuda"
+          + "-${found-version.version}"
+          + lib.optionalString (lang != "en") "-${lang}");
+  meta = with lib; {
+    description = "Wolfram Mathematica computational software system";
+    homepage = "http://www.wolfram.com/mathematica/";
+    license = licenses.unfree;
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    maintainers = with maintainers; [ herberteuler rafaelrc ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/mathematica/generic.nix b/nixpkgs/pkgs/applications/science/math/mathematica/generic.nix
new file mode 100644
index 000000000000..5a96bf1a2625
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/mathematica/generic.nix
@@ -0,0 +1,206 @@
+{ addOpenGLRunpath
+, autoPatchelfHook
+, lib
+, makeWrapper
+, requireFile
+, runCommand
+, stdenv
+, symlinkJoin
+# arguments from default.nix
+, lang
+, meta
+, name
+, src
+, version
+# dependencies
+, alsa-lib
+, cudaPackages
+, cups
+, dbus
+, flite
+, fontconfig
+, freetype
+, gcc-unwrapped
+, glib
+, gmpxx
+, keyutils
+, libGL
+, libGLU
+, libpcap
+, libtins
+, libuuid
+, libxkbcommon
+, libxml2
+, llvmPackages_12
+, matio
+, mpfr
+, ncurses
+, opencv4
+, openjdk11
+, openssl
+, pciutils
+, tre
+, unixODBC
+, xcbutilimage
+, xcbutilkeysyms
+, xkeyboard_config
+, xorg
+, zlib
+# options
+, cudaSupport
+}:
+
+let cudaEnv = symlinkJoin {
+      name = "mathematica-cuda-env";
+      paths = with cudaPackages; [
+        cuda_cudart cuda_nvcc libcublas libcufft libcurand libcusparse
+      ];
+      postBuild = ''
+        if [ ! -e $out/lib/libcuda.so ]; then
+            ln -s ${addOpenGLRunpath.driverLink}/lib/libcuda.so $out/lib
+        fi
+        ln -s lib $out/lib64
+      '';
+    };
+
+in stdenv.mkDerivation {
+  inherit meta name src version;
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+    makeWrapper
+  ] ++ lib.optional cudaSupport addOpenGLRunpath;
+
+  buildInputs = [
+    alsa-lib
+    cups.lib
+    dbus
+    flite
+    fontconfig
+    freetype
+    glib
+    gmpxx
+    keyutils.lib
+    libGL
+    libGLU
+    libpcap
+    libtins
+    libuuid
+    libxkbcommon
+    libxml2
+    llvmPackages_12.libllvm.lib
+    matio
+    mpfr
+    ncurses
+    opencv4
+    openjdk11
+    openssl
+    pciutils
+    tre
+    unixODBC
+    xcbutilimage
+    xcbutilkeysyms
+    xkeyboard_config
+  ] ++ (with xorg; [
+    libICE
+    libSM
+    libX11
+    libXScrnSaver
+    libXcomposite
+    libXcursor
+    libXdamage
+    libXext
+    libXfixes
+    libXi
+    libXinerama
+    libXmu
+    libXrandr
+    libXrender
+    libXtst
+    libxcb
+  ]) ++ lib.optional cudaSupport cudaEnv;
+
+  wrapProgramFlags = [
+    "--prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [
+      dbus
+      gcc-unwrapped.lib
+      zlib
+    ]}"
+    "--prefix PATH : ${lib.makeBinPath [ stdenv.cc ]}"
+    # Fix libQt errors - #96490
+    "--set USE_WOLFRAM_LD_LIBRARY_PATH 1"
+    # Fix xkeyboard config path for Qt
+    "--set QT_XKB_CONFIG_ROOT ${xkeyboard_config}/share/X11/xkb"
+    # if wayland isn't supported we fail over to xcb
+    # see https://github.com/qt/qtbase/blob/35d0f012ee9b95e8cf3563a41d710ff3c023d841/src/gui/kernel/qguiapplication.cpp#L1218
+    "--set QT_QPA_PLATFORM wayland;xcb"
+  ] ++ lib.optionals cudaSupport [
+    "--set CUDA_PATH ${cudaEnv}"
+    "--set NVIDIA_DRIVER_LIBRARY_PATH ${addOpenGLRunpath.driverLink}/lib/libnvidia-tls.so"
+    "--set CUDA_LIBRARY_PATH ${addOpenGLRunpath.driverLink}/lib/libcuda.so"
+  ];
+
+  unpackPhase = ''
+    runHook preUnpack
+
+    # Find offset from file
+    offset=$(${stdenv.shell} -c "$(grep -axm1 -e 'offset=.*' $src); echo \$offset" $src)
+    tail -c +$(($offset + 1)) $src | tar -xf -
+
+    runHook postUnpack
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    cd "$TMPDIR/Unix/Installer"
+
+    mkdir -p "$out/lib/udev/rules.d"
+
+    # Patch MathInstaller's shebangs and udev rules dir
+    patchShebangs MathInstaller
+    substituteInPlace MathInstaller \
+      --replace /etc/udev/rules.d $out/lib/udev/rules.d
+
+    # Remove PATH restriction, root and avahi daemon checks, and hostname call
+    sed -i '
+      s/^\s*PATH=/# &/
+      s/isRoot="false"/# &/
+      s/^\s*checkAvahiDaemon$/:/
+      s/^\s*installBundledInstall$/:/
+      s/`hostname`/""/
+    ' MathInstaller
+
+    # NOTE: some files placed under HOME may be useful
+    XDG_DATA_HOME="$out/share" HOME="$TMPDIR/home" vernierLink=y \
+      ./MathInstaller -execdir="$out/bin" -targetdir="$out/libexec/Mathematica" -auto -verbose -createdir=y
+
+    # Check if MathInstaller produced any errors
+    errLog="$out/libexec/Mathematica/InstallErrors"
+    if [ -f "$errLog" ]; then
+      echo "Installation errors:"
+      cat "$errLog"
+      return 1
+    fi
+
+    runHook postInstall
+  '';
+
+  preFixup = ''
+    for bin in $out/libexec/Mathematica/Executables/*; do
+      wrapProgram "$bin" ''${wrapProgramFlags[@]}
+    done
+  '';
+
+  dontConfigure = true;
+  dontBuild = true;
+
+  # This is primarily an IO bound build; there's little benefit to building remotely
+  preferLocalBuild = true;
+
+  # All binaries are already stripped
+  dontStrip = true;
+
+  # NOTE: Some deps are still not found; ignore for now
+  autoPatchelfIgnoreMissingDeps = true;
+}
diff --git a/nixpkgs/pkgs/applications/science/math/mathematica/versions.nix b/nixpkgs/pkgs/applications/science/math/mathematica/versions.nix
new file mode 100644
index 000000000000..3bbf70433471
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/mathematica/versions.nix
@@ -0,0 +1,193 @@
+{ lib, requireFile }:
+
+/*
+ * To calculate the hash of an installer, use a command like this:
+ *
+ *   nix --extra-experimental-features nix-command hash file <installer-file>
+ */
+
+let versions = [
+  {
+    version = "14.0.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-NzMhGQZq6o6V4UdtJxUH/yyP2s7wjTR86SRA7lW7JfI=";
+    installer = "Mathematica_14.0.0_LINUX.sh";
+  }
+  {
+    version = "14.0.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-UrcBEg6G6nbVX++X0z0oG5JjieXL0AquAqtjzY5EBn4=";
+    installer = "Mathematica_14.0.0_BNDL_LINUX.sh";
+  }
+  {
+    version = "13.3.1";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-0+mYVGiF4Qn3eiLIoINSHVIqT8GtlBPFRYIOF+nHyQo=";
+    installer = "Mathematica_13.3.1_LINUX.sh";
+  }
+  {
+    version = "13.3.1";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-03R4s05fmTcZnlZIMSI6xlLER58MIoccoCr27F8BXOk=";
+    installer = "Mathematica_13.3.1_BNDL_LINUX.sh";
+  }
+  {
+    version = "13.3.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-24MC0O+kBUe3TrwXUb+7QZt8tQHvWVIT8F9B6Ih+4k8=";
+    installer = "Mathematica_13.3.0_LINUX.sh";
+  }
+  {
+    version = "13.3.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-91bw7+4ht+7g+eF32BNYf77yEQWyuPffisj4kB63pcI=";
+    installer = "Mathematica_13.3.0_BNDL_LINUX.sh";
+  }
+  {
+    version = "13.2.1";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-GA2k+jvE4mTJsIbMHce5c516h/glHLnXdthEfnNmk0w=";
+    installer = "Mathematica_13.2.1_LINUX.sh";
+  }
+  {
+    version = "13.2.1";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-ZvgG2W/gjQIo4hyXHsGta5FyTslrz/ltOe/ZK/U2Sx8=";
+    installer = "Mathematica_13.2.1_BNDL_LINUX.sh";
+  }
+  {
+    version = "13.2.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-T9XOXA6jpgN6bcO/do9sw1L73ABtyxuZCLzftv4Cl6o=";
+    installer = "Mathematica_13.2.0_LINUX.sh";
+  }
+  {
+    version = "13.2.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-YRUvl2H9SwpwDZx04ugd7ZnK5G+t88bzAObXsGGVhk0=";
+    installer = "Mathematica_13.2.0_BNDL_LINUX.sh";
+  }
+  {
+    version = "13.1.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-GZyUYslx/M4aFI3Pj9Osw3/w79/Jp/4T3mRE277pNuM=";
+    installer = "Mathematica_13.1.0_LINUX.sh";
+  }
+  {
+    version = "13.1.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-LIpGAJ3uTkZgjc0YykwusyyHQKlCnTvrZGStFfSOz60=";
+    installer = "Mathematica_13.1.0_BNDL_LINUX.sh";
+  }
+  {
+    version = "13.0.1";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-NnKpIMG0rxr9SAcz9tZ2Zbr4JYdX3+WabtbXRAzybbo=";
+    installer = "Mathematica_13.0.1_BNDL_LINUX.sh";
+  }
+  {
+    version = "13.0.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-FbutOaWZUDEyXR0Xj2OwDnFwbT7JAB66bRaB+8mR0+E=";
+    installer = "Mathematica_13.0.0_BNDL_LINUX.sh";
+  }
+  {
+    version = "12.3.1";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-UbnKsS/ZGwCep61JaKLIpZ6U3FXS5swdcSrNW6LE1Qk=";
+    installer = "Mathematica_12.3.1_LINUX.sh";
+  }
+  {
+    version = "12.3.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-BF3wRfbnlt7Vn2TrLg8ZSayI3LodW24F+1PqCkrtchU=";
+    installer = "Mathematica_12.3.0_LINUX.sh";
+  }
+  {
+    version = "12.2.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-O2Z2ogPGrbfpxBilSEsDeXQoe1vgnGTn3+p03cDkANc=";
+    installer = "Mathematica_12.2.0_LINUX.sh";
+  }
+  {
+    version = "12.1.1";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-rUe4hr5KmGTXD1I/eSYVoFHU68mH2aD2VLZFtOtDswo=";
+    installer = "Mathematica_12.1.1_LINUX.sh";
+  }
+  {
+    version = "12.1.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-56P1KKOTJkQj+K9wppAsnYpej/YB3VUNL7DPLYGgqZY=";
+    installer = "Mathematica_12.1.0_LINUX.sh";
+  }
+  {
+    version = "12.0.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-uftx4a/MHXLCABlv+kNFEtII+ikg4geHhDP1BOWK6dc=";
+    installer = "Mathematica_12.0.0_LINUX.sh";
+  }
+  {
+    version = "11.3.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-D8/iCMHqyESOe+OvC9uENwsXvZxdBmwBOSjI7pWu0Q4=";
+    installer = "Mathematica_11.3.0_LINUX.sh";
+  }
+  {
+    version = "11.2.0";
+    lang = "ja";
+    language = "Japanese";
+    sha256 = "sha256-kWOS7dMr7YYiI430Nd2OhkJrsEMDijM28w3xDYGbSbE=";
+    installer = "Mathematica_11.2.0_ja_LINUX.sh";
+  }
+  {
+    version = "9.0.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-mKgxdd7dLWa5EOuR5C37SeU+UC9Cv5YTbY5xSK9y34A=";
+    installer = "Mathematica_9.0.0_LINUX.sh";
+  }
+  {
+    version = "10.0.2";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-NHUg1jzLos1EsIr8TdYdNaA5+3jEcFqVZIr9GVVUXrQ=";
+    installer = "Mathematica_10.0.2_LINUX.sh";
+  }
+];
+
+in
+
+lib.flip map versions ({ version, lang, language, sha256, installer }: {
+  inherit version lang;
+  src = requireFile {
+    name = installer;
+    message = ''
+      This nix expression requires that ${installer} is
+      already part of the store. Find the file on your Mathematica CD
+      and add it to the nix store with nix-store --add-fixed sha256 <FILE>.
+    '';
+    inherit sha256;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/math/maxima/default.nix b/nixpkgs/pkgs/applications/science/math/maxima/default.nix
new file mode 100644
index 000000000000..e7ac178cd5d1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/maxima/default.nix
@@ -0,0 +1,118 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchpatch
+, texinfo
+, perl
+, python3
+, makeWrapper
+, autoreconfHook
+, rlwrap ? null
+, tk ? null
+, gnuplot ? null
+, lisp-compiler
+}:
+
+let
+  # Allow to remove some executables from the $PATH of the wrapped binary
+  searchPath = lib.makeBinPath
+    (lib.filter (x: x != null) [ lisp-compiler rlwrap tk gnuplot ]);
+in
+stdenv.mkDerivation (finalAttrs: {
+  pname = "maxima";
+  version = "5.46.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${finalAttrs.pname}/${finalAttrs.pname}-${finalAttrs.version}.tar.gz";
+    sha256 = "sha256-c5Dwa0jaZckDPosvYpuXi5AFZFSlQCLbfecOIiWqiwc=";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    lisp-compiler
+    makeWrapper
+    python3
+    texinfo
+  ];
+
+  strictDeps = true;
+
+  nativeCheckInputs = [
+    gnuplot
+  ];
+
+  postPatch = ''
+    substituteInPlace doc/info/Makefile.am --replace "/usr/bin/env perl" "${perl}/bin/perl"
+  '';
+
+  postInstall = ''
+    # Make sure that maxima can find its runtime dependencies.
+    for prog in "$out/bin/"*; do
+      wrapProgram "$prog" --prefix PATH ":" "$out/bin:${searchPath}"
+    done
+    # Move emacs modules and documentation into the right place.
+    mkdir -p $out/share/emacs $out/share/doc
+    ln -s ../maxima/${finalAttrs.version}/emacs $out/share/emacs/site-lisp
+    ln -s ../maxima/${finalAttrs.version}/doc $out/share/doc/maxima
+  ''
+   + (lib.optionalString (lisp-compiler.pname == "ecl") ''
+     cp src/binary-ecl/maxima.fas* "$out/lib/maxima/${finalAttrs.version}/binary-ecl/"
+   '')
+  ;
+
+  patches = [
+    # fix path to info dir (see https://trac.sagemath.org/ticket/11348)
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/sagemath/sage/07d6c37d18811e2b377a9689790a7c5e24da16ba/build/pkgs/maxima/patches/infodir.patch";
+      sha256 = "09v64n60f7i6frzryrj0zd056lvdpms3ajky4f9p6kankhbiv21x";
+    })
+
+    # fix https://sourceforge.net/p/maxima/bugs/2596/
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/sagemath/sage/07d6c37d18811e2b377a9689790a7c5e24da16ba/build/pkgs/maxima/patches/matrixexp.patch";
+      sha256 = "06961hn66rhjijfvyym21h39wk98sfxhp051da6gz0n9byhwc6zg";
+    })
+
+    # undo https://sourceforge.net/p/maxima/code/ci/f5e9b0f7eb122c4e48ea9df144dd57221e5ea0ca
+    # see https://trac.sagemath.org/ticket/13364#comment:93
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/sagemath/sage/07d6c37d18811e2b377a9689790a7c5e24da16ba/build/pkgs/maxima/patches/undoing_true_false_printing_patch.patch";
+      sha256 = "0fvi3rcjv6743sqsbgdzazy9jb6r1p1yq63zyj9fx42wd1hgf7yx";
+    })
+  ];
+
+  # The test suite is disabled since 5.42.2 because of the following issues:
+  #
+  #   Error(s) found:
+  #   /build/maxima-5.44.0/share/linearalgebra/rtest_matrixexp.mac problems:
+  #   (20 21 22)
+  #   Tests that were expected to fail but passed:
+  #   /build/maxima-5.44.0/share/vector/rtest_vect.mac problem:
+  #   (19)
+  #   3 tests failed out of 16,184 total tests.
+  #
+  # These failures don't look serious. It would be nice to fix them, but I
+  # don't know how and probably won't have the time to find out.
+  doCheck = false;    # try to re-enable after next version update
+
+  enableParallelBuilding = true;
+
+  passthru = {
+    inherit lisp-compiler;
+  };
+
+  meta = with lib; {
+    description = "Computer algebra system";
+    homepage = "http://maxima.sourceforge.net";
+    license = licenses.gpl2Plus;
+
+    longDescription = ''
+      Maxima is a fairly complete computer algebra system written in
+      lisp with an emphasis on symbolic computation. It is based on
+      DOE-MACSYMA and licensed under the GPL. Its abilities include
+      symbolic integration, 3D plotting, and an ODE solver.
+    '';
+    maintainers = with maintainers; [ doronbehar ];
+    platforms = platforms.unix;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/math/mpsolve/default.nix b/nixpkgs/pkgs/applications/science/math/mpsolve/default.nix
new file mode 100644
index 000000000000..e9b8a3185a85
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/mpsolve/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, stdenv
+, fetchurl
+, gmp
+, pkg-config
+, qtbase
+, wrapQtAppsHook
+, gtk3
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "mpsolve";
+  version = "3.2.1";
+
+  src = fetchurl {
+    url = "https://numpi.dm.unipi.it/_media/software/mpsolve/mpsolve-${finalAttrs.version}.tar.gz";
+    hash = "sha256-PRFCiumrLgIPJMq/vNnk2bIuxXLPcK8NRP6Nrh1R544=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    gmp
+    gtk3
+    qtbase
+  ];
+
+  meta = {
+    homepage = "https://numpi.dm.unipi.it/scientific-computing-libraries/mpsolve/";
+    description = "Multiprecision Polynomial Solver";
+    license = lib.licenses.gpl3Plus;
+    maintainers = with lib.maintainers; [ kilianar ];
+    mainProgram = "mpsolve";
+    platforms = lib.platforms.linux;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/math/msieve/default.nix b/nixpkgs/pkgs/applications/science/math/msieve/default.nix
new file mode 100644
index 000000000000..1de6d416a0e6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/msieve/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchsvn, zlib, gmp, ecm }:
+
+stdenv.mkDerivation rec {
+  pname = "msieve";
+  version = "r1050";
+
+  src = fetchsvn {
+    url = "svn://svn.code.sf.net/p/msieve/code/trunk";
+    rev = "1050";
+    hash = "sha256-cn6OhE4zhrpB7BFrRdOnucjATbfo5mLkK7O0Usx1quE=";
+  };
+
+  buildInputs = [ zlib gmp ecm ];
+
+  ECM = if ecm == null then "0" else "1";
+
+  # Doesn't hurt Linux but lets clang-based platforms like Darwin work fine too
+  makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "all" ];
+
+  installPhase = ''
+    mkdir -p $out/bin/
+    cp msieve $out/bin/
+  '';
+
+  meta = {
+    description = "A C library implementing a suite of algorithms to factor large integers";
+    mainProgram = "msieve";
+    license = lib.licenses.publicDomain;
+    homepage = "http://msieve.sourceforge.net/";
+    maintainers = [ lib.maintainers.roconnor ];
+    platforms = [ "x86_64-linux" ] ++ lib.platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/mxnet/default.nix b/nixpkgs/pkgs/applications/science/math/mxnet/default.nix
new file mode 100644
index 000000000000..993da2b89898
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/mxnet/default.nix
@@ -0,0 +1,90 @@
+{ config, stdenv, lib, fetchurl, fetchpatch, bash, cmake
+, opencv4, gtest, blas, gomp, llvmPackages, perl
+, cudaSupport ? config.cudaSupport, cudaPackages ? { }, nvidia_x11
+, cudnnSupport ? cudaSupport
+}:
+
+let
+  inherit (cudaPackages) cudatoolkit cudaFlags cudnn;
+in
+
+assert cudnnSupport -> cudaSupport;
+
+stdenv.mkDerivation rec {
+  pname = "mxnet";
+  version = "1.9.1";
+
+  src = fetchurl {
+    name = "apache-mxnet-src-${version}-incubating.tar.gz";
+    url = "https://dlcdn.apache.org/incubator/mxnet/${version}/apache-mxnet-src-${version}-incubating.tar.gz";
+    hash = "sha256-EephMoF02MKblvNBl34D3rC/Sww3rOZY+T442euMkyI=";
+  };
+
+  patches = [
+    # Remove the following two patches when updating mxnet to 2.0.
+    (fetchpatch {
+      name = "1-auto-disable-sse-for-non-x86.patch";
+      url = "https://github.com/apache/incubator-mxnet/commit/55e69871d4cadec51a8bbb6700131065388cb0b9.patch";
+      hash = "sha256-uaMpM0F9HRtEBXz2ewB/dlbuKaY5/RineCPUE2T6CHU=";
+    })
+    (fetchpatch {
+      name = "2-auto-disable-sse-for-non-x86.patch";
+      url = "https://github.com/apache/incubator-mxnet/commit/c1b96f562f55dfa024ac941d7b104f00e239ee0f.patch";
+      excludes = ["ci/docker/runtime_functions.sh"];
+      hash = "sha256-r1LbC8ueRooW5tTNakAlRSJ+9aR4WXXoEKx895DgOs4=";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake perl ];
+
+  buildInputs = [ opencv4 gtest blas.provider ]
+    ++ lib.optional stdenv.cc.isGNU gomp
+    ++ lib.optional stdenv.cc.isClang llvmPackages.openmp
+    # FIXME: when cuda build is fixed, remove nvidia_x11, and use /run/opengl-driver/lib
+    ++ lib.optionals cudaSupport [ cudatoolkit nvidia_x11 ]
+    ++ lib.optional cudnnSupport cudnn;
+
+  cmakeFlags =
+    [ "-DUSE_MKL_IF_AVAILABLE=OFF" ]
+    ++ (if cudaSupport then [
+      "-DUSE_OLDCMAKECUDA=ON"  # see https://github.com/apache/incubator-mxnet/issues/10743
+      "-DCUDA_ARCH_NAME=All"
+      "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc"
+      "-DMXNET_CUDA_ARCH=${builtins.concatStringsSep ";" cudaFlags.realArches}"
+    ] else [ "-DUSE_CUDA=OFF" ])
+    ++ lib.optional (!cudnnSupport) "-DUSE_CUDNN=OFF";
+
+  env.NIX_CFLAGS_COMPILE = toString [
+    # Needed with GCC 12
+    "-Wno-error=uninitialized"
+  ];
+
+  postPatch = ''
+    substituteInPlace 3rdparty/mkldnn/tests/CMakeLists.txt \
+      --replace "/bin/bash" "${bash}/bin/bash"
+
+    # Build against the system version of OpenMP.
+    # https://github.com/apache/incubator-mxnet/pull/12160
+    rm -rf 3rdparty/openmp
+  '';
+
+  postInstall = ''
+    rm "$out"/lib/*.a
+  '';
+
+  # used to mark cudaSupport in python310Packages.mxnet as broken;
+  # other attributes exposed for consistency
+  passthru = {
+    inherit cudaSupport cudnnSupport cudatoolkit cudnn;
+  };
+
+  meta = with lib; {
+    description = "Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler";
+    homepage = "https://mxnet.incubator.apache.org/";
+    maintainers = with maintainers; [ abbradar ];
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    # Build failures when linking mxnet_unit_tests: https://gist.github.com/6d17447ee3557967ec52c50d93b17a1d
+    broken = cudaSupport;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/nasc/default.nix b/nixpkgs/pkgs/applications/science/math/nasc/default.nix
new file mode 100644
index 000000000000..d25f0ad34496
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/nasc/default.nix
@@ -0,0 +1,86 @@
+{ lib, stdenv
+, fetchFromGitHub
+, pkg-config
+, python3
+, meson
+, ninja
+, vala
+, gtk3
+, glib
+, pantheon
+, gtksourceview
+, libgee
+, nix-update-script
+, webkitgtk
+, libqalculate
+, intltool
+, gnuplot
+, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "nasc";
+  version = "0.8.0";
+
+  src = fetchFromGitHub {
+    owner = "parnold-x";
+    repo = pname;
+    rev = version;
+    sha256 = "02b9a59a9fzsb6nn3ycwwbcbv04qfzm6x7csq2addpzx5wak6dd8";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [
+    glib # post_install.py
+    gtk3 # post_install.py
+    intltool # for libqalculate
+    meson
+    ninja
+    pkg-config
+    python3
+    vala
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    glib
+    gtk3
+    gtksourceview
+    libgee
+    pantheon.granite
+    webkitgtk
+    # We add libqalculate's runtime dependencies because nasc has it as a modified subproject.
+  ] ++ libqalculate.buildInputs ++ libqalculate.propagatedBuildInputs;
+
+  postPatch = ''
+    chmod +x meson/post_install.py
+    patchShebangs meson/post_install.py
+
+    # patch subproject. same code in libqalculate expression
+    substituteInPlace subprojects/libqalculate/libqalculate/Calculator-plot.cc \
+      --replace 'commandline = "gnuplot"' 'commandline = "${gnuplot}/bin/gnuplot"' \
+      --replace '"gnuplot - ' '"${gnuplot}/bin/gnuplot - '
+    substituteInPlace subprojects/libqalculate/libqalculate/meson.build \
+      --replace "link_with: 'libqalculate_lib_static'" "link_with: libqalculate_lib_static"
+  '';
+
+  passthru = {
+    updateScript = nix-update-script { };
+  };
+
+  meta = with lib; {
+    description = "Do maths like a normal person, designed for elementary OS";
+    longDescription = ''
+      It’s an app where you do maths like a normal person. It lets you
+      type whatever you want and smartly figures out what is math and
+      spits out an answer on the right pane. Then you can plug those
+      answers in to future equations and if that answer changes, so does
+      the equations it’s used in.
+    '';
+    homepage = "https://github.com/parnold-x/nasc";
+    maintainers = teams.pantheon.members;
+    platforms = platforms.linux;
+    license = licenses.gpl3Plus;
+    mainProgram = "com.github.parnold_x.nasc";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/nauty/default.nix b/nixpkgs/pkgs/applications/science/math/nauty/default.nix
new file mode 100644
index 000000000000..c1feeffdcb6d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/nauty/default.nix
@@ -0,0 +1,50 @@
+{ stdenv
+, lib
+, fetchurl
+}:
+stdenv.mkDerivation rec {
+  pname = "nauty";
+  version = "2.8.8";
+
+  src = fetchurl {
+    url = "https://pallini.di.uniroma1.it/nauty${builtins.replaceStrings ["."] ["_"] version}.tar.gz";
+    sha256 = "sha256-FZ0hVoEKa7JAQQzWHrZBrdhQiNnxXIiM2qN7hoH5Kc4=";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  configureFlags = [
+    # Prevent nauty from sniffing some cpu features. While those are very
+    # widely available, it can lead to nasty bugs when they are not available:
+    # https://groups.google.com/forum/#!topic/sage-packaging/Pe4SRDNYlhA
+    "--enable-generic" # don't use -march=native
+    "--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-popcnt"
+    "--${if stdenv.hostPlatform.sse4_aSupport then "enable" else "disable"}-clz"
+  ];
+
+  installPhase = ''
+    mkdir -p "$out"/{bin,share/doc/nauty} "$dev"/{lib,include/nauty}
+
+    find . -type f -perm -111 \! -name '*.*' \! -name configure -exec cp '{}' "$out/bin" \;
+    cp [Rr][Ee][Aa][Dd]* COPYRIGHT This* [Cc]hange* "$out/share/doc/nauty"
+
+    cp *.h "$dev/include/nauty"
+    for i in *.a; do
+      cp "$i" "$dev/lib/lib$i";
+    done
+  '';
+
+  checkTarget = "checks";
+
+  meta = with lib; {
+    description = "Programs for computing automorphism groups of graphs and digraphs";
+    license = licenses.asl20;
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+    # I'm not sure if the filename will remain the same for future changelog or
+    # if it will track changes to minor releases. Lets see. Better than nothing
+    # in any case.
+    changelog = "https://pallini.di.uniroma1.it/changes24-28.txt";
+    homepage = "https://pallini.di.uniroma1.it/";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/nota/default.nix b/nixpkgs/pkgs/applications/science/math/nota/default.nix
new file mode 100644
index 000000000000..810d7d6d72bc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/nota/default.nix
@@ -0,0 +1,41 @@
+{ mkDerivation, haskellPackages, fetchurl, lib }:
+
+mkDerivation rec {
+  pname = "nota";
+  version = "1.0";
+
+  # Can't use fetchFromGitLab since codes.kary.us doesn't support https
+  src = fetchurl {
+    url = "http://codes.kary.us/nota/nota/-/archive/V${version}/nota-V${version}.tar.bz2";
+    sha256 = "0bbs6bm9p852hvqadmqs428ir7m65h2prwyma238iirv42pk04v8";
+  };
+
+  postUnpack = ''
+    export sourceRoot=$sourceRoot/source
+  '';
+
+  isLibrary = false;
+  isExecutable = true;
+
+  libraryHaskellDepends = with haskellPackages; [
+    base
+    bytestring
+    array
+    split
+    scientific
+    parsec
+    ansi-terminal
+    regex-compat
+    containers
+    terminal-size
+    numbers
+    text
+    time
+  ];
+
+  description = "The most beautiful command line calculator";
+  homepage = "https://kary.us/nota";
+  license = lib.licenses.mpl20;
+  maintainers = with lib.maintainers; [ dtzWill ];
+  mainProgram = "nota";
+}
diff --git a/nixpkgs/pkgs/applications/science/math/numworks-epsilon/0001-ion-linux-makerules.patch b/nixpkgs/pkgs/applications/science/math/numworks-epsilon/0001-ion-linux-makerules.patch
new file mode 100644
index 000000000000..0bc29b9aab5f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/numworks-epsilon/0001-ion-linux-makerules.patch
@@ -0,0 +1,12 @@
+diff --git a/ion/src/simulator/linux/Makefile b/ion/src/simulator/linux/Makefile
+index ca7da03fa..b05bba115 100644
+--- a/ion/src/simulator/linux/Makefile
++++ b/ion/src/simulator/linux/Makefile
+@@ -28,7 +28,6 @@ ion_src += $(addprefix ion/src/simulator/shared/, \
+   collect_registers.cpp \
+   haptics.cpp \
+   journal.cpp \
+-  platform_action_modifier_ctrl.cpp \
+   state_file.cpp \
+ )
+ 
diff --git a/nixpkgs/pkgs/applications/science/math/numworks-epsilon/default.nix b/nixpkgs/pkgs/applications/science/math/numworks-epsilon/default.nix
new file mode 100644
index 000000000000..a90ebc67b65b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/numworks-epsilon/default.nix
@@ -0,0 +1,63 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, libpng
+, libjpeg
+, freetype
+, xorg
+, python3
+, imagemagick
+, gcc-arm-embedded
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "numworks-epsilon";
+  version = "15.5.0";
+
+  src = fetchFromGitHub {
+    owner = "numworks";
+    repo = "epsilon";
+    rev = version;
+    sha256 = "fPBO3FzZ4k5OxG+Ifc6R/au4Te974HNKAEdHz+aFdSg=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    libpng
+    libjpeg
+    freetype
+    xorg.libXext
+    python3
+    imagemagick
+    gcc-arm-embedded
+  ];
+
+  makeFlags = [
+    "PLATFORM=simulator"
+  ];
+
+  patches = [
+    # Remove make rule Introduced in cba596dde7
+    # which causes it to not build with nix
+    ./0001-ion-linux-makerules.patch
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mv ./output/release/simulator/linux/{epsilon.bin,epsilon}
+    mkdir -p $out/bin
+    cp -r ./output/release/simulator/linux/* $out/bin/
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Simulator for Epsilon, a High-performance graphing calculator operating system";
+    homepage = "https://numworks.com/";
+    license = licenses.cc-by-nc-sa-40;
+    maintainers = with maintainers; [ erikbackman ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/pagsuite/default.nix b/nixpkgs/pkgs/applications/science/math/pagsuite/default.nix
new file mode 100644
index 000000000000..6994712e18fd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/pagsuite/default.nix
@@ -0,0 +1,37 @@
+{ lib
+, stdenv
+, fetchurl
+, cmake
+, unzip
+, gmp
+, scalp
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pagsuite";
+  version = "1.80";
+
+  src = fetchurl {
+    url = "https://gitlab.com/kumm/pagsuite/-/raw/master/releases/pagsuite_${lib.replaceStrings ["."] ["_"] version}.zip";
+    hash = "sha256-TYd+dleVPWEWU9Cb3XExd7ixJZyiUAp9QLtorYJSIbQ=";
+  };
+
+  sourceRoot = "pagsuite_${lib.replaceStrings ["."] ["_"] version}";
+
+  nativeBuildInputs = [
+    cmake
+    unzip
+  ];
+
+  buildInputs = [
+    gmp
+    scalp
+  ];
+
+  meta = with lib; {
+    description = "Optimization tools for the (P)MCM problem";
+    homepage = "https://gitlab.com/kumm/pagsuite";
+    maintainers = with maintainers; [ wegank ];
+    license = licenses.unfree;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/palp/default.nix b/nixpkgs/pkgs/applications/science/math/palp/default.nix
new file mode 100644
index 000000000000..2fe77aa14a65
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/palp/default.nix
@@ -0,0 +1,91 @@
+{ lib
+, stdenv
+, fetchurl
+, dimensions ? 6 # works for <= dimensions dimensions, but is only optimized for that exact value
+, doSymlink ? true # symlink the executables to the default location (without dimension postfix)
+}:
+
+let
+  dim = toString dimensions;
+in
+stdenv.mkDerivation rec {
+  pname = "palp";
+  version = "2.21";
+
+  src = fetchurl {
+    url = "http://hep.itp.tuwien.ac.at/~kreuzer/CY/palp/${pname}-${version}.tar.gz";
+    sha256 = "sha256-fkp78hmZioRMC8zgoXbknQdDy0tQWg4ZUym/LsGW3dc=";
+  };
+
+  hardeningDisable = [
+    "format"
+  ];
+
+  patchPhase = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace GNUmakefile --replace gcc cc
+  '';
+
+  preBuild = ''
+    echo Building PALP optimized for ${dim} dimensions
+    sed -i "s/^#define[^a-zA-Z]*POLY_Dmax.*/#define POLY_Dmax ${dim}/" Global.h
+  '';
+
+  # palp has no tests of its own. This test is an adapted sage test that failed
+  # when #28029 was merged.
+  doCheck = true;
+  checkPhase = ''
+    ./nef.x -f -N << EOF | grep -q 'np='
+      3 6
+      1  0  0 -1  0  0
+      0  1  0  0 -1  0
+      0  0  1  0  0 -1
+    EOF
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    for file in poly class cws nef mori; do
+      cp -p $file.x "$out/bin/$file-${dim}d.x"
+    done
+  '' + lib.optionalString doSymlink ''
+    cd $out/bin
+    for file in poly class cws nef mori; do
+      ln -sf $file-6d.x $file.x
+    done
+  '';
+
+  meta = with lib; {
+    description = "A Package for Analyzing Lattice Polytopes";
+    longDescription = ''
+      A Package for Analyzing Lattice Polytopes (PALP) is a set of C
+      programs for calculations with lattice polytopes and applications to
+      toric geometry.
+
+      It contains routines for vertex and facet enumeration, computation of
+      incidences and symmetries, as well as completion of the set of lattice
+      points in the convex hull of a given set of points. In addition, there
+      are procedures specialised to reflexive polytopes such as the
+      enumeration of reflexive subpolytopes, and applications to toric
+      geometry and string theory, like the computation of Hodge data and
+      fibration structures for toric Calabi-Yau varieties.  The package is
+      well tested and optimised in speed as it was used for time consuming
+      tasks such as the classification of reflexive polyhedra in 4
+      dimensions and the creation and manipulation of very large lists of
+      5-dimensional polyhedra.
+
+      While originally intended for low-dimensional applications, the
+      algorithms work in any dimension and our key routine for vertex and
+      facet enumeration compares well with existing packages.
+    '';
+    homepage = "http://hep.itp.tuwien.ac.at/~kreuzer/CY/CYpalp.html";
+    # Not really a changelog, but a one-line summary of each update that should
+    # be reviewed on update.
+    changelog = "http://hep.itp.tuwien.ac.at/~kreuzer/CY/CYpalp.html";
+    # Just a link on the website pointing to gpl -- now gplv3. When the last
+    # version was released that pointed to gplv2 however, so thats probably
+    # the right license.
+    license = licenses.gpl2;
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/pari/default.nix b/nixpkgs/pkgs/applications/science/math/pari/default.nix
new file mode 100644
index 000000000000..16c8def750d7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/pari/default.nix
@@ -0,0 +1,84 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchpatch
+, gmp
+, libX11
+, libpthreadstubs
+, perl
+, readline
+, texliveBasic
+, withThread ? true
+}:
+
+assert withThread -> libpthreadstubs != null;
+
+stdenv.mkDerivation rec {
+  pname = "pari";
+  version = "2.15.5";
+
+  src = fetchurl {
+    urls = [
+      "https://pari.math.u-bordeaux.fr/pub/pari/unix/${pname}-${version}.tar.gz"
+      # old versions are at the url below
+      "https://pari.math.u-bordeaux.fr/pub/pari/OLD/${lib.versions.majorMinor version}/${pname}-${version}.tar.gz"
+    ];
+    hash = "sha256-Dv3adRXZ2VT2MyTDSzTFYOYPc6gcOSSnEmCizJHV+YE=";
+  };
+
+  buildInputs = [
+    gmp
+    libX11
+    perl
+    readline
+    texliveBasic
+  ] ++ lib.optionals withThread [
+    libpthreadstubs
+  ];
+
+  configureScript = "./Configure";
+  configureFlags = [
+    "--with-gmp=${lib.getDev gmp}"
+    "--with-readline=${lib.getDev readline}"
+  ]
+  ++ lib.optional withThread "--mt=pthread";
+
+  preConfigure = ''
+    export LD=$CC
+  '';
+
+  makeFlags = [ "all" ];
+
+  meta = with lib; {
+    homepage = "http://pari.math.u-bordeaux.fr";
+    description = "Computer algebra system for high-performance number theory computations";
+    longDescription = ''
+       PARI/GP is a widely used computer algebra system designed for fast
+       computations in number theory (factorizations, algebraic number theory,
+       elliptic curves...), but also contains a large number of other useful
+       functions to compute with mathematical entities such as matrices,
+       polynomials, power series, algebraic numbers etc., and a lot of
+       transcendental functions. PARI is also available as a C library to allow
+       for faster computations.
+
+       Originally developed by Henri Cohen and his co-workers (Université
+       Bordeaux I, France), PARI is now under the GPL and maintained by Karim
+       Belabas with the help of many volunteer contributors.
+
+       - PARI is a C library, allowing fast computations.
+       - gp is an easy-to-use interactive shell giving access to the PARI
+         functions.
+       - GP is the name of gp's scripting language.
+       - gp2c, the GP-to-C compiler, combines the best of both worlds by
+         compiling GP scripts to the C language and transparently loading the
+         resulting functions into gp. (gp2c-compiled scripts will typically run
+         3 or 4 times faster.) gp2c currently only understands a subset of the
+         GP language.
+    '';
+    downloadPage = "http://pari.math.u-bordeaux.fr/download.html";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ ertes ] ++ teams.sage.members;
+    platforms = platforms.linux ++ platforms.darwin;
+    mainProgram = "gp";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/pari/gp2c.nix b/nixpkgs/pkgs/applications/science/math/pari/gp2c.nix
new file mode 100644
index 000000000000..512aaba78d54
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/pari/gp2c.nix
@@ -0,0 +1,33 @@
+{ lib
+, stdenv
+, fetchurl
+, pari
+, perl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gp2c";
+  version = "0.0.13";
+
+  src = fetchurl {
+    url = "https://pari.math.u-bordeaux.fr/pub/pari/GP2C/${pname}-${version}.tar.gz";
+    hash = "sha256-JhN07Kc+vXbBEqlZPcootkgSqnYlYf2lpLLCzXmmnTY=";
+  };
+
+  buildInputs = [
+    pari
+    perl
+  ];
+
+  configureFlags = [
+    "--with-paricfg=${pari}/lib/pari/pari.cfg"
+    "--with-perl=${perl}/bin/perl"
+  ];
+
+  meta = with lib; {
+    homepage = "http://pari.math.u-bordeaux.fr/";
+    description =  "A compiler to translate GP scripts to PARI programs";
+    downloadPage = "http://pari.math.u-bordeaux.fr/download.html";
+    inherit (pari.meta) license maintainers platforms broken;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/pcalc/default.nix b/nixpkgs/pkgs/applications/science/math/pcalc/default.nix
new file mode 100644
index 000000000000..64ab5acebed2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/pcalc/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, bison, flex }:
+
+stdenv.mkDerivation rec {
+  pname = "pcalc";
+  version = "20181202";
+
+  src = fetchFromGitHub {
+    owner = "vapier";
+    repo = "pcalc";
+    rev = "d93be9e19ecc0b2674cf00ec91cbb79d32ccb01d";
+    sha256 = "sha256-m4xdsEJGKxLgp/d5ipxQ+cKG3z7rlvpPL6hELnDu6Hk=";
+  };
+
+  makeFlags = [ "DESTDIR= BINDIR=$(out)/bin" ];
+  nativeBuildInputs = [ bison flex ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://vapier.github.io/pcalc/";
+    description = "Programmer's calculator";
+    mainProgram = "pcalc";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ ftrvxmtrx ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/perseus/default.nix b/nixpkgs/pkgs/applications/science/math/perseus/default.nix
new file mode 100644
index 000000000000..9a37eeac66da
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/perseus/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, unzip }:
+
+stdenv.mkDerivation {
+  pname = "perseus";
+  version = "4-beta";
+  nativeBuildInputs = [ unzip ];
+
+  hardeningDisable = [ "stackprotector" ];
+
+  src = fetchurl {
+    url = "http://people.maths.ox.ac.uk/nanda/source/perseus_4_beta.zip";
+    sha256 = "sha256-cnkJEIC4tu+Ni7z0cKdjmLdS8QLe8iKpdA8uha2MeSU=";
+  };
+
+  sourceRoot = ".";
+  env.NIX_CFLAGS_COMPILE = toString [ "-std=c++14" ];
+  buildPhase = ''
+    g++ Pers.cpp -O3 -fpermissive -o perseus
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp perseus $out/bin
+  '';
+
+  meta = {
+    description = "The Persistent Homology Software";
+    mainProgram = "perseus";
+    longDescription = ''
+      Persistent homology - or simply, persistence - is an algebraic
+      topological invariant of a filtered cell complex. Perseus
+      computes this invariant for a wide class of filtrations built
+      around datasets arising from point samples, images, distance
+      matrices and so forth.
+    '';
+    homepage = "http://people.maths.ox.ac.uk/nanda/perseus/index.html";
+    license = lib.licenses.gpl3;
+    maintainers = with lib.maintainers; [ erikryb ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/polymake/default.nix b/nixpkgs/pkgs/applications/science/math/polymake/default.nix
new file mode 100644
index 000000000000..fe9210641d2e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/polymake/default.nix
@@ -0,0 +1,83 @@
+{ lib
+, stdenv
+, fetchurl
+, gmp
+, mpfr
+, flint
+, boost
+, bliss
+, ppl
+, singular
+, cddlib
+, lrs
+, nauty
+, ninja
+, ant
+, openjdk
+, perl536Packages
+, makeWrapper
+}:
+let
+  # log says: polymake does not work with perl 5.37 or newer;
+  perlPackages = perl536Packages;
+  inherit (perlPackages) perl;
+in
+# polymake compiles its own version of sympol and atint because we
+# don't have those packages. other missing optional dependencies:
+# javaview, libnormaliz, scip, soplex, jreality.
+
+stdenv.mkDerivation rec {
+  pname = "polymake";
+  version = "4.11";
+
+  src = fetchurl {
+    # "The minimal version is a packager friendly version which omits
+    # the bundled sources of cdd, lrs, libnormaliz, nauty and jReality."
+    url = "https://polymake.org/lib/exe/fetch.php/download/polymake-${version}-minimal.tar.bz2";
+    sha256 = "sha256-XfbwrNcAEZvQxLV2Z2KFL/vYV3ZbXcyIgC/10hCK3SM=";
+  };
+
+  nativeBuildInputs = [
+    makeWrapper
+    ninja
+    ant
+    perl
+  ];
+
+  buildInputs = [
+    perl
+    gmp
+    mpfr
+    flint
+    boost
+    bliss
+    ppl
+    singular
+    cddlib
+    lrs
+    nauty
+    openjdk
+  ] ++ (with perlPackages; [
+    JSON
+    TermReadLineGnu
+    TermReadKey
+    XMLSAX
+  ]);
+
+  ninjaFlags = [ "-C" "build/Opt" ];
+
+  postInstall = ''
+    for i in "$out"/bin/*; do
+      wrapProgram "$i" --prefix PERL5LIB : "$PERL5LIB"
+    done
+  '';
+
+  meta = with lib; {
+    description = "Software for research in polyhedral geometry";
+    homepage = "https://www.polymake.org/doku.php";
+    changelog = "https://github.com/polymake/polymake/blob/V${version}/ChangeLog";
+    license = licenses.gpl2Plus;
+    maintainers = teams.sage.members;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/programmer-calculator/default.nix b/nixpkgs/pkgs/applications/science/math/programmer-calculator/default.nix
new file mode 100644
index 000000000000..9cb220ceca6a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/programmer-calculator/default.nix
@@ -0,0 +1,35 @@
+{ lib, gccStdenv, fetchFromGitHub, ncurses }:
+
+gccStdenv.mkDerivation rec {
+  pname = "programmer-calculator";
+  version = "3.0";
+
+  src = fetchFromGitHub {
+    owner = "alt-romes";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-9mv8Jac6j3fKWLLCu1Bd/T5dbegUB8rRgsj9MaQhFDw=";
+  };
+
+  buildInputs = [ ncurses ];
+
+  installPhase = ''
+    runHook preInstall
+    install -Dm 555 pcalc -t "$out/bin"
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "A terminal calculator for programmers";
+    mainProgram = "pcalc";
+    longDescription = ''
+      Terminal calculator made for programmers working with multiple number
+      representations, sizes, and overall close to the bits
+    '';
+    homepage = "https://alt-romes.github.io/programmer-calculator";
+    changelog = "https://github.com/alt-romes/programmer-calculator/releases/tag/v${version}";
+    license = licenses.gpl3Only;
+    maintainers = with lib.maintainers; [ cjab ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/pspp/default.nix b/nixpkgs/pkgs/applications/science/math/pspp/default.nix
new file mode 100644
index 000000000000..032ae257c564
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/pspp/default.nix
@@ -0,0 +1,58 @@
+{ lib, stdenv, fetchurl, libxml2, readline, zlib, perl, cairo, gtk3, gsl
+, pkg-config, gtksourceview4, pango, gettext, dconf
+, makeWrapper, gsettings-desktop-schemas, hicolor-icon-theme
+, texinfo, ssw, python3, iconv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pspp";
+  version = "2.0.0";
+
+  src = fetchurl {
+    url = "mirror://gnu/pspp/${pname}-${version}.tar.gz";
+    sha256 = "sha256-qPbLiGr1sIOENXm81vsZHAVKzOKMxotY58XwmZai2N8=";
+  };
+
+  nativeBuildInputs = [ pkg-config texinfo python3 makeWrapper ];
+  buildInputs = [ libxml2 readline zlib perl cairo gtk3 gsl
+                  gtksourceview4 pango gettext
+                  gsettings-desktop-schemas hicolor-icon-theme ssw iconv
+                ];
+
+  C_INCLUDE_PATH =
+    "${libxml2.dev}/include/libxml2/:" +
+    lib.makeSearchPathOutput "dev" "include" buildInputs;
+  LIBRARY_PATH = lib.makeLibraryPath buildInputs;
+
+  doCheck = false;
+
+  enableParallelBuilding = true;
+
+  preFixup = ''
+    wrapProgram "$out/bin/psppire" \
+     --prefix XDG_DATA_DIRS : "$out/share" \
+     --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS" \
+     --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
+     --prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules"
+  '';
+
+  meta = {
+    homepage = "https://www.gnu.org/software/pspp/";
+    description = "A free replacement for SPSS, a program for statistical analysis of sampled data";
+    license = lib.licenses.gpl3Plus;
+
+    longDescription = ''
+      PSPP is a program for statistical analysis of sampled data. It is
+      a Free replacement for the proprietary program SPSS.
+
+      PSPP can perform descriptive statistics, T-tests, anova, linear
+      and logistic regression, cluster analysis, factor analysis,
+      non-parametric tests and more. Its backend is designed to perform
+      its analyses as fast as possible, regardless of the size of the
+      input data. You can use PSPP with its graphical interface or the
+      more traditional syntax commands.
+    '';
+
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/pynac/default.nix b/nixpkgs/pkgs/applications/science/math/pynac/default.nix
new file mode 100644
index 000000000000..88515b92beaf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/pynac/default.nix
@@ -0,0 +1,60 @@
+{ lib, stdenv
+, fetchpatch
+, fetchFromGitHub
+, autoreconfHook
+, pkg-config
+, flint
+, gmp
+, python3
+, singular
+, ncurses
+}:
+
+stdenv.mkDerivation rec {
+  version = "0.7.29";
+  pname = "pynac";
+
+  src = fetchFromGitHub {
+    owner = "pynac";
+    repo = "pynac";
+    rev = "pynac-${version}";
+    sha256 = "sha256-ocR7emXtKs+Xe2f6dh4xEDAacgiolY8mtlLnWnNBS8A=";
+  };
+
+  patches = [
+    # the patch below is included in sage 9.4 and should be included
+    # in a future pynac release. see https://trac.sagemath.org/ticket/28357
+    (fetchpatch {
+      name = "realpartloop.patch";
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/pynac/patches/realpartloop.patch?h=9.4.beta5";
+      sha256 = "sha256-1nj0xtlFN5fZKEiRLD+tiW/ZtxMQre1ziEGA0OVUGE4=";
+    })
+  ];
+
+  buildInputs = [
+    flint
+    gmp
+    singular
+    python3
+    ncurses
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+  ];
+
+  meta = with lib; {
+    description = "Python is Not a CAS -- modified version of Ginac";
+    longDescription = ''
+      Pynac -- "Python is Not a CAS" is a modified version of Ginac that
+      replaces the depency of GiNaC on CLN by a dependency instead of Python.
+      It is a lite version of GiNaC as well, not implementing all the features
+      of the full GiNaC, and it is *only* meant to be used as a Python library.
+    '';
+    homepage    = "http://pynac.org";
+    license = licenses.gpl2Plus;
+    maintainers = teams.sage.members;
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/qalculate-gtk/default.nix b/nixpkgs/pkgs/applications/science/math/qalculate-gtk/default.nix
new file mode 100644
index 000000000000..2a2b4617d24b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/qalculate-gtk/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, intltool, autoreconfHook, pkg-config, libqalculate, gtk3, curl, wrapGAppsHook, desktopToDarwinBundle }:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "qalculate-gtk";
+  version = "5.0.0";
+
+  src = fetchFromGitHub {
+    owner = "qalculate";
+    repo = "qalculate-gtk";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-hlGNL7aMzxBxtATWJBqJTFEQqMv10oC3sRCdtRLHOww=";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  nativeBuildInputs = [ intltool pkg-config autoreconfHook wrapGAppsHook ]
+    ++ lib.optionals stdenv.isDarwin [ desktopToDarwinBundle ];
+  buildInputs = [ libqalculate gtk3 curl ];
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "The ultimate desktop calculator";
+    homepage = "http://qalculate.github.io";
+    maintainers = with maintainers; [ gebner doronbehar alyaeanyx ];
+    license = licenses.gpl2Plus;
+    mainProgram = "qalculate-gtk";
+    platforms = platforms.all;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/math/qalculate-qt/default.nix b/nixpkgs/pkgs/applications/science/math/qalculate-qt/default.nix
new file mode 100644
index 000000000000..296fc5f783f3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/qalculate-qt/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, intltool, pkg-config, qmake, wrapQtAppsHook, libqalculate, qtbase, qttools, qtsvg, qtwayland }:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "qalculate-qt";
+  version = "5.0.0";
+
+  src = fetchFromGitHub {
+    owner = "qalculate";
+    repo = "qalculate-qt";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-X7IY2yXpZiyE+T2dl0G4tWpJ5O6MVCy/sOY3v9inma0=";
+  };
+
+  nativeBuildInputs = [ qmake intltool pkg-config qttools wrapQtAppsHook ];
+  buildInputs = [ libqalculate qtbase qtsvg ]
+    ++ lib.optionals stdenv.isLinux [ qtwayland ];
+
+  postPatch = ''
+    substituteInPlace qalculate-qt.pro\
+      --replace "LRELEASE" "${qttools.dev}/bin/lrelease"
+  '';
+
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    mkdir -p $out/Applications
+    mv $out/bin/qalculate-qt.app $out/Applications
+    makeWrapper $out/{Applications/qalculate-qt.app/Contents/MacOS,bin}/qalculate-qt
+  '';
+
+  meta = with lib; {
+    description = "The ultimate desktop calculator";
+    homepage = "http://qalculate.github.io";
+    maintainers = with maintainers; [ _4825764518 ];
+    license = licenses.gpl2Plus;
+    mainProgram = "qalculate-qt";
+    platforms = platforms.unix;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/math/ratpoints/default.nix b/nixpkgs/pkgs/applications/science/math/ratpoints/default.nix
new file mode 100644
index 000000000000..69b972fe9790
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/ratpoints/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, fetchpatch, gmp }:
+stdenv.mkDerivation rec {
+  pname = "ratpoints";
+  version = "2.1.3.p4";
+
+  src = fetchurl {
+    url = "http://www.mathe2.uni-bayreuth.de/stoll/programs/ratpoints-${version}.tar.gz";
+    sha256 = "0zhad84sfds7izyksbqjmwpfw4rvyqk63yzdjd3ysd32zss5bgf4";
+  };
+
+  enableParallelBuilding = true;
+
+  patches = [
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/sagemath/sage/1615f58890e8f9881c4228c78a6b39b9aab1303a/build/pkgs/ratpoints/patches/sturm_and_rp_private.patch";
+      sha256 = "0q3wajncyfr3gahd8gwk9x7g56zw54lpywrl63lqk7drkf60mrcl";
+    })
+  ];
+
+  buildInputs = [ gmp ];
+
+  makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
+  buildFlags = lib.optionals stdenv.isDarwin ["CCFLAGS2=-lgmp -lc -lm" "CCFLAGS=-UUSE_SSE"];
+  installFlags = [ "INSTALL_DIR=$(out)" ];
+
+  preInstall = ''mkdir -p "$out"/{bin,share,lib,include}'';
+
+  meta = {
+    description = "A program to find rational points on hyperelliptic curves";
+    mainProgram = "ratpoints";
+    license = lib.licenses.gpl2Plus;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
+    homepage = "http://www.mathe2.uni-bayreuth.de/stoll/programs/";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/readstat/default.nix b/nixpkgs/pkgs/applications/science/math/readstat/default.nix
new file mode 100644
index 000000000000..6abae18c5c66
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/readstat/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, pkg-config, libiconv }:
+
+stdenv.mkDerivation rec {
+  pname = "readstat";
+  version = "1.1.9";
+
+  src = fetchFromGitHub {
+    owner = "WizardMac";
+    repo = "ReadStat";
+    rev = "v${version}";
+    sha256 = "sha256-4lRJgZPB2gfaQ9fQKvDDpGhy1eDNT/nT1QmeZlCmCis=";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/WizardMac/ReadStat/commit/211c342a1cfe46fb7fb984730dd7a29ff4752f35.patch";
+      hash = "sha256-nkaEgusylVu7NtzSzBklBuOnqO9qJPovf0qn9tTE6ls=";
+    })
+
+    # Backport use-after-free:
+    #   https://github.com/WizardMac/ReadStat/pull/298
+    (fetchpatch {
+      url = "https://github.com/WizardMac/ReadStat/commit/718d49155e327471ed9bf4a8c157f849f285b46c.patch";
+      hash = "sha256-9hmuFa05b4JlxSzquIxXArOGhbi27A+3y5gH1IDg+R0=";
+    })
+  ];
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+
+  buildInputs = [ libiconv ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "https://github.com/WizardMac/ReadStat";
+    description = "Command-line tool (+ C library) for converting SAS, Stata, and SPSS files";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ swflint ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/ries/default.nix b/nixpkgs/pkgs/applications/science/math/ries/default.nix
new file mode 100644
index 000000000000..5c0626913e3c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/ries/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchzip }:
+stdenv.mkDerivation rec {
+  pname = "ries";
+  version = "2018.04.11-1";
+
+  # upstream does not provide a stable link
+  src = fetchzip {
+    url = "https://salsa.debian.org/debian/ries/-/archive/debian/${version}/ries-debian-${version}.zip";
+    sha256 = "1h2wvd4k7f0l0i1vm9niz453xdbcs3nxccmri50qyrzzzc1b0842";
+  };
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = with lib; {
+    homepage = "https://mrob.com/pub/ries/";
+    description = "Tool to produce a list of equations that approximately solve to a given number";
+    mainProgram = "ries";
+    platforms = platforms.all;
+    maintainers = with maintainers; [ symphorien ];
+    license = licenses.gpl3Plus;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/science/math/ripser/default.nix b/nixpkgs/pkgs/applications/science/math/ripser/default.nix
new file mode 100644
index 000000000000..83cf6bc51aa4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/ripser/default.nix
@@ -0,0 +1,59 @@
+{ lib, stdenv, fetchFromGitHub
+, useCoefficients ? false
+, indicateProgress ? false
+, useGoogleHashmap ? false, sparsehash ? null
+, fileFormat ? "lowerTriangularCsv"
+}:
+
+with lib;
+
+assert assertOneOf "fileFormat" fileFormat
+  ["lowerTriangularCsv" "upperTriangularCsv" "dipha"];
+assert useGoogleHashmap -> sparsehash != null;
+
+let
+  inherit (lib) optional;
+  version = "1.2.1";
+in
+stdenv.mkDerivation {
+  pname = "ripser";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "Ripser";
+    repo = "ripser";
+    rev = "v${version}";
+    sha256 = "sha256-BxmkPQ/nl5cF+xwQMTjXnLgkLgdmT/39y7Kzl2wDfpE=";
+  };
+
+  buildInputs = optional useGoogleHashmap sparsehash;
+
+  buildFlags = [
+    "-std=c++11"
+    "-O3"
+    "-D NDEBUG"
+  ]
+  ++ optional useCoefficients "-D USE_COEFFICIENTS"
+  ++ optional indicateProgress "-D INDICATE_PROGRESS"
+  ++ optional useGoogleHashmap "-D USE_GOOGLE_HASHMAP"
+  ++ optional (fileFormat == "lowerTriangularCsv") "-D FILE_FORMAT_LOWER_TRIANGULAR_CSV"
+  ++ optional (fileFormat == "upperTriangularCsv") "-D FILE_FORMAT_UPPER_TRIANGULAR_CSV"
+  ++ optional (fileFormat == "dipha") "-D FILE_FORMAT_DIPHA"
+  ;
+
+  buildPhase = "c++ ripser.cpp -o ripser $buildFlags";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp ripser $out/bin
+  '';
+
+  meta = {
+    description = "A lean C++ code for the computation of Vietoris–Rips persistence barcodes";
+    mainProgram = "ripser";
+    homepage = "https://github.com/Ripser/ripser";
+    license = lib.licenses.lgpl3;
+    maintainers = with lib.maintainers; [erikryb];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/rofi-calc/0001-Patch-plugindir-to-output.patch b/nixpkgs/pkgs/applications/science/math/rofi-calc/0001-Patch-plugindir-to-output.patch
new file mode 100644
index 000000000000..197d1347d535
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/rofi-calc/0001-Patch-plugindir-to-output.patch
@@ -0,0 +1,25 @@
+From 0eaef67b683683fb423fcb2d5096b3cdf9a4a9cd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= <mkg20001@gmail.com>
+Date: Sun, 22 Mar 2020 12:26:10 +0100
+Subject: [PATCH] Patch plugindir to output
+
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 50edb74..639ee86 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -50,7 +50,7 @@ PKG_CHECK_MODULES([glib],     [glib-2.0 >= 2.40 gio-unix-2.0 gmodule-2.0 ])
+ PKG_CHECK_MODULES([cairo],    [cairo])
+ PKG_CHECK_MODULES([rofi],     [rofi >= 1.5.4])
+ 
+-[rofi_PLUGIN_INSTALL_DIR]="`$PKG_CONFIG --variable=pluginsdir rofi`"
++[rofi_PLUGIN_INSTALL_DIR]="`echo $out/lib/rofi`"
+ AC_SUBST([rofi_PLUGIN_INSTALL_DIR])
+ 
+ LT_INIT([disable-static])
+-- 
+2.25.1
+
diff --git a/nixpkgs/pkgs/applications/science/math/rofi-calc/default.nix b/nixpkgs/pkgs/applications/science/math/rofi-calc/default.nix
new file mode 100644
index 000000000000..6b15073675f7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/rofi-calc/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, pkg-config
+, rofi-unwrapped
+, libqalculate
+, glib
+, cairo
+, gobject-introspection
+, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "rofi-calc";
+  version = "2.2.0";
+
+  src = fetchFromGitHub {
+    owner = "svenstaro";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-SGDORHX+lk6PS5/sPAmKZLfZD99/A7XvDPDnuAygDAM=";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+    gobject-introspection
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    rofi-unwrapped
+    libqalculate
+    glib
+    cairo
+  ];
+
+  patches = [
+    ./0001-Patch-plugindir-to-output.patch
+  ];
+
+  postPatch = ''
+    sed "s|qalc_binary = \"qalc\"|qalc_binary = \"${libqalculate}/bin/qalc\"|" -i src/calc.c
+  '';
+
+  meta = with lib; {
+    description = "Do live calculations in rofi!";
+    homepage = "https://github.com/svenstaro/rofi-calc";
+    license = licenses.mit;
+    maintainers = with maintainers; [ luc65r albakham ];
+    platforms = with platforms; linux;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/science/math/sage/README.md b/nixpkgs/pkgs/applications/science/math/sage/README.md
new file mode 100644
index 000000000000..35e8d0deeffb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/README.md
@@ -0,0 +1,46 @@
+# Sage on nixos
+
+Sage is a pretty complex package that depends on many other complex packages and patches some of those. As a result, the sage nix package is also quite complex.
+
+Don't feel discouraged to fix, simplify or improve things though. The individual files have comments explaining their purpose. The most important ones are `default.nix` linking everything together, `sage-src.nix` adding patches and `sagelib.nix` building the actual sage package.
+
+## The sage build is broken
+
+First you should find out which change to nixpkgs is at fault (if you don't already know). You can use `git-bisect` for that (see the manpage).
+
+If the build broke as a result of a package update, try those solutions in order:
+
+- search the [sage GitHub repo](https://github.com/sagemath/sage) for keywords like "Upgrade <package>". Maybe somebody has already proposed a patch that fixes the issue. You can then add a `fetchpatch` to `sage-src.nix`.
+
+- check if [gentoo](https://github.com/cschwan/sage-on-gentoo/tree/master/sci-mathematics/sage), [debian](https://salsa.debian.org/science-team/sagemath/tree/master/debian) or [arch linux](https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/sagemath) already solved the problem. You can then again add a `fetchpatch` to `sage-src.nix`. If applicable you should also [propose the patch upstream](#proposing-a-sage-patch).
+
+- fix the problem yourself. First clone the sagemath source and then check out the sage version you want to patch:
+
+```
+[user@localhost ~]$ git clone https://github.com/sagemath/sage.git
+[user@localhost ~]$ cd sage
+[user@localhost sage]$ git checkout 9.8 # substitute the relevant version here
+```
+
+Then make the needed changes and generate a patch with `git diff`:
+
+```
+[user@localhost ~]$ <make changes>
+[user@localhost ~]$ git diff -u > /path/to/nixpkgs/pkgs/applications/science/math/sage/patches/name-of-patch.patch
+```
+
+Now just add the patch to `sage-src.nix` and test your changes. If they fix the problem, submit a PR upstream (refer to sages [Developer's Guide](http://doc.sagemath.org/html/en/developer/index.html) for further details).
+
+- pin the package version in `default.nix` and add a note that explains why that is necessary.
+
+## I want to update sage
+
+You'll need to change the `version` field in `sage-src.nix`. Afterwards just try to build and let nix tell you which patches no longer apply (hopefully because they were adopted upstream). Remove those.
+
+Hopefully the build will succeed now. If it doesn't and the problem is obvious, fix it as described in [The sage build is broken](#the-sage-build-is-broken).
+If the problem is not obvious, you can try to first update sage to an intermediate version (remember that you can also set the `version` field to any git revision of sage) and locate the sage commit that introduced the issue. You can even use `git-bisect` for that (it will only be a bit tricky to keep track of which patches to apply). Hopefully after that the issue will be obvious.
+
+## Well, that didn't help!
+
+If you couldn't fix the problem, create a GitHub issue on the nixpkgs repo and ping the sage maintainers (as listed in the sage package).
+Describe what you did and why it didn't work. Afterwards it would be great if you help the next guy out and improve this documentation!
diff --git a/nixpkgs/pkgs/applications/science/math/sage/default.nix b/nixpkgs/pkgs/applications/science/math/sage/default.nix
new file mode 100644
index 000000000000..6624dcc36528
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/default.nix
@@ -0,0 +1,177 @@
+{ pkgs
+, withDoc ? false
+, requireSageTests ? true
+, extraPythonPackages ? ps: []
+}:
+
+# Here sage and its dependencies are put together. Some dependencies may be pinned
+# as a last resort. Patching sage for compatibility with newer dependency versions
+# is always preferred, see `sage-src.nix` for that.
+
+let
+  inherit (pkgs) symlinkJoin callPackage nodePackages;
+
+  python3 = pkgs.python3 // {
+    pkgs = pkgs.python3.pkgs.overrideScope (self: super: {
+      # `sagelib`, i.e. all of sage except some wrappers and runtime dependencies
+      sagelib = self.callPackage ./sagelib.nix {
+        inherit flint3;
+        inherit sage-src env-locations singular;
+        inherit (maxima) lisp-compiler;
+        linbox = pkgs.linbox.override { withSage = true; };
+        pkg-config = pkgs.pkg-config; # not to confuse with pythonPackages.pkg-config
+      };
+
+      sage-docbuild = self.callPackage ./python-modules/sage-docbuild.nix {
+        inherit sage-src;
+      };
+
+      sage-setup = self.callPackage ./python-modules/sage-setup.nix {
+        inherit sage-src;
+      };
+    });
+  };
+
+  # matches src/sage/repl/ipython_kernel/install.py:kernel_spec
+  jupyter-kernel-definition = {
+    displayName = "SageMath ${sage-src.version}";
+    argv = [
+      "${sage-with-env}/bin/sage" # FIXME which sage
+      "--python"
+      "-m"
+      "sage.repl.ipython_kernel"
+      "-f"
+      "{connection_file}"
+    ];
+    language = "sage";
+    # just one 16x16 logo is available
+    logo32 = "${sage-src}/src/doc/common/themes/sage/static/sageicon.png";
+    logo64 = "${sage-src}/src/doc/common/themes/sage/static/sageicon.png";
+  };
+
+  jupyter-kernel-specs = pkgs.jupyter-kernel.create {
+    definitions = pkgs.jupyter-kernel.default // {
+      sagemath = jupyter-kernel-definition;
+    };
+  };
+
+  three = callPackage ./threejs-sage.nix { };
+
+  # A bash script setting various environment variables to tell sage where
+  # the files its looking fore are located. Also see `sage-env`.
+  env-locations = callPackage ./env-locations.nix {
+    inherit pari_data;
+    inherit singular maxima;
+    inherit three;
+    cysignals = python3.pkgs.cysignals;
+    mathjax = nodePackages.mathjax;
+  };
+
+  # The shell file that gets sourced on every sage start. Will also source
+  # the env-locations file.
+  sage-env = callPackage ./sage-env.nix {
+    sagelib = python3.pkgs.sagelib;
+    sage-docbuild = python3.pkgs.sage-docbuild;
+    inherit env-locations;
+    inherit python3 singular palp flint3 pythonEnv maxima;
+    pkg-config = pkgs.pkg-config; # not to confuse with pythonPackages.pkg-config
+  };
+
+  # The documentation for sage, building it takes a lot of ram.
+  sagedoc = callPackage ./sagedoc.nix {
+    inherit sage-with-env jupyter-kernel-specs;
+  };
+
+  # sagelib with added wrappers and a dependency on sage-tests to make sure thet tests were run.
+  sage-with-env = callPackage ./sage-with-env.nix {
+    inherit python3 pythonEnv;
+    inherit sage-env;
+    inherit singular maxima;
+    inherit three;
+    pkg-config = pkgs.pkg-config; # not to confuse with pythonPackages.pkg-config
+  };
+
+  # Doesn't actually build anything, just runs sages testsuite. This is a
+  # separate derivation to make it possible to re-run the tests without
+  # rebuilding sagelib (which takes ~30 minutes).
+  # Running the tests should take something in the order of 1h.
+  sage-tests = callPackage ./sage-tests.nix {
+    inherit sage-with-env;
+  };
+
+  sage-src = callPackage ./sage-src.nix {};
+
+  pythonRuntimeDeps = with python3.pkgs; [
+    sagelib
+    sage-docbuild
+    cvxopt
+    networkx
+    service-identity
+    psutil
+    sympy
+    fpylll
+    matplotlib
+    tkinter # optional, as a matplotlib backend (use with `%matplotlib tk`)
+    scipy
+    ipywidgets
+    notebook # for "sage -n"
+    rpy2
+    sphinx
+    pillow
+  ] ++ extraPythonPackages python3.pkgs;
+
+  pythonEnv = python3.buildEnv.override {
+    extraLibs = pythonRuntimeDeps;
+    ignoreCollisions = true;
+  } // { extraLibs = pythonRuntimeDeps; }; # make the libs accessible
+
+  singular = pkgs.singular.override { inherit flint3; };
+
+  maxima = pkgs.maxima-ecl.override {
+    lisp-compiler = pkgs.ecl.override {
+      # "echo syntax error | ecl > /dev/full 2>&1" segfaults in
+      # ECL. We apply a patch to fix it (write_error.patch), but it
+      # only works if threads are disabled.  sage 9.2 tests this
+      # (src/sage/interfaces/tests.py) and ships ecl like so.
+      # https://gitlab.com/embeddable-common-lisp/ecl/-/merge_requests/1#note_1657275
+      threadSupport = false;
+
+      # if we don't use the system boehmgc, sending a SIGINT to ecl
+      # can segfault if we it happens during memory allocation.
+      # src/sage/libs/ecl.pyx would intermittently fail in this case.
+      useBoehmgc = true;
+    };
+  };
+
+  # With openblas (64 bit), the tests fail the same way as when sage is build with
+  # openblas instead of openblasCompat. Apparently other packages somehow use flints
+  # blas when it is available. Alternative would be to override flint to use
+  # openblasCompat.
+  flint3 = pkgs.flint3.override { withBlas = false; };
+
+  # Multiple palp dimensions need to be available and sage expects them all to be
+  # in the same folder.
+  palp = symlinkJoin {
+    name = "palp-${pkgs.palp.version}";
+    paths = [
+      (pkgs.palp.override { dimensions = 4; doSymlink = false; })
+      (pkgs.palp.override { dimensions = 5; doSymlink = false; })
+      (pkgs.palp.override { dimensions = 6; doSymlink = true; })
+      (pkgs.palp.override { dimensions = 11; doSymlink = false; })
+    ];
+  };
+
+  # Sage expects those in the same directory.
+  pari_data = symlinkJoin {
+    name = "pari_data";
+    paths = with pkgs; [
+      pari-galdata
+      pari-seadata-small
+    ];
+  };
+in
+# A wrapper around sage that makes sure sage finds its docs (if they were build).
+callPackage ./sage.nix {
+  inherit sage-tests sage-with-env sagedoc jupyter-kernel-definition jupyter-kernel-specs;
+  inherit withDoc requireSageTests;
+}
diff --git a/nixpkgs/pkgs/applications/science/math/sage/dist-tests.nix b/nixpkgs/pkgs/applications/science/math/sage/dist-tests.nix
new file mode 100644
index 000000000000..24a86a8f37a4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/dist-tests.nix
@@ -0,0 +1,17 @@
+# Lists past failures and files associated with it. The intention is to build
+# up a subset of a testsuite that catches 95% of failures that are relevant for
+# distributions while only taking ~5m to run. This in turn makes it more
+# reasonable to re-test sage on dependency changes and makes it easier for
+# users to override the sage derivation.
+# This is an experiment for now. If it turns out that there really is a small
+# subset of files responsible for the vast majority of packaging tests, we can
+# think about moving this upstream.
+[
+	"src/sage/env.py" # [1]
+	"src/sage/misc/persist.pyx" # [1]
+	"src/sage/misc/inline_fortran.py" # [1]
+	"src/sage/repl/ipython_extension.py" # [1]
+]
+
+# Numbered list of past failures to annotate files with
+# [1] PYTHONPATH related issue https://github.com/NixOS/nixpkgs/commit/ec7f569211091282410050e89e68832d4fe60528
diff --git a/nixpkgs/pkgs/applications/science/math/sage/env-locations.nix b/nixpkgs/pkgs/applications/science/math/sage/env-locations.nix
new file mode 100644
index 000000000000..1ca0f471a7ee
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/env-locations.nix
@@ -0,0 +1,45 @@
+{ writeTextFile
+, pari_data
+, pari
+, singular
+, maxima
+, graphs
+, elliptic_curves
+, polytopes_db
+, gap
+, combinatorial_designs
+, jmol
+, mathjax
+, three
+, cysignals
+}:
+
+# A bash script setting various environment variables to tell sage where
+# the files its looking fore are located. Also see `sage-env`.
+writeTextFile rec {
+  name = "sage-env-locations";
+  destination = "/${name}";
+  text = ''
+    export GP_DATA_DIR="${pari_data}/share/pari"
+    export PARI_DATA_DIR="${pari_data}"
+    export GPHELP="${pari}/bin/gphelp"
+    export GPDOCDIR="${pari}/share/pari/doc"
+    export SINGULARPATH='${singular}/share/singular'
+    export SINGULAR_SO='${singular}/lib/libSingular.so'
+    export SINGULAR_EXECUTABLE='${singular}/bin/Singular'
+    export MAXIMA_FAS='${maxima}/lib/maxima/${maxima.version}/binary-ecl/maxima.fas'
+    export MAXIMA_PREFIX="${maxima}"
+    export GRAPHS_DATA_DIR='${graphs}/share/graphs'
+    export ELLCURVE_DATA_DIR='${elliptic_curves}/share/ellcurves'
+    export POLYTOPE_DATA_DIR='${polytopes_db}/share/reflexive_polytopes'
+    export GAP_ROOT_PATHS='${gap}/lib/gap;${gap}/share/gap'
+    export ECLDIR='${maxima.lisp-compiler}/lib/${maxima.lisp-compiler.pname}-${maxima.lisp-compiler.version}/'
+    export COMBINATORIAL_DESIGN_DATA_DIR="${combinatorial_designs}/share/combinatorial_designs"
+    export CREMONA_MINI_DATA_DIR="${elliptic_curves}/share/cremona"
+    export JMOL_DIR="${jmol}/share/jmol" # point to the directory that contains JmolData.jar
+    export JSMOL_DIR="${jmol}/share/jsmol"
+    export MATHJAX_DIR="${mathjax}/lib/node_modules/mathjax"
+    export THREEJS_DIR="${three}/lib/node_modules/three"
+    export SAGE_INCLUDE_DIRECTORIES="${cysignals}/${cysignals.pythonModule.sitePackages}"
+  '';
+}
diff --git a/nixpkgs/pkgs/applications/science/math/sage/patches/disable-slow-glpk-test.patch b/nixpkgs/pkgs/applications/science/math/sage/patches/disable-slow-glpk-test.patch
new file mode 100644
index 000000000000..89f0613589d4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/patches/disable-slow-glpk-test.patch
@@ -0,0 +1,17 @@
+diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py
+index 2deb533f7f..663ff2cd13 100644
+--- a/src/sage/graphs/generic_graph.py
++++ b/src/sage/graphs/generic_graph.py
+@@ -6953,12 +6953,6 @@ class GenericGraph(GenericGraph_pyx):
+             sage: G = DiGraph(d6, format='dig6')
+             sage: G.edge_connectivity()
+             5
+-            sage: G.edge_disjoint_spanning_trees(5)     # long time                     # needs sage.numerical.mip
+-            [Digraph on 28 vertices,
+-             Digraph on 28 vertices,
+-             Digraph on 28 vertices,
+-             Digraph on 28 vertices,
+-             Digraph on 28 vertices]
+ 
+         Small cases::
+ 
diff --git a/nixpkgs/pkgs/applications/science/math/sage/patches/linbox-1.7-upgrade.patch b/nixpkgs/pkgs/applications/science/math/sage/patches/linbox-1.7-upgrade.patch
new file mode 100644
index 000000000000..91e080aa294a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/patches/linbox-1.7-upgrade.patch
@@ -0,0 +1,58 @@
+diff --git a/src/sage/libs/linbox/conversion.pxd b/src/sage/libs/linbox/conversion.pxd
+index 7794c9edc3..1753277b1f 100644
+--- a/src/sage/libs/linbox/conversion.pxd
++++ b/src/sage/libs/linbox/conversion.pxd
+@@ -177,9 +177,8 @@ cdef inline Vector_integer_dense new_sage_vector_integer_dense(P, DenseVector_in
+     - v -- linbox vector
+     """
+     cdef Vector_integer_dense res = P()
+-    cdef cppvector[Integer] * vec = &v.refRep()
+     cdef size_t i
+     for i in range(<size_t> res._degree):
+-        mpz_set(res._entries[i], vec[0][i].get_mpz_const())
++        mpz_set(res._entries[i], v.getEntry(i).get_mpz_const())
+ 
+     return res
+diff --git a/src/sage/libs/linbox/linbox.pxd b/src/sage/libs/linbox/linbox.pxd
+index 9112d151f8..dcc482960c 100644
+--- a/src/sage/libs/linbox/linbox.pxd
++++ b/src/sage/libs/linbox/linbox.pxd
+@@ -32,7 +32,7 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_double Field
+         ctypedef double Element
+         DenseMatrix_Modular_double(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_double(Field F, Element*, size_t m, size_t n)
++        DenseMatrix_Modular_double(Field F, size_t m, size_t n, Element*)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -42,7 +42,7 @@ cdef extern from "linbox/matrix/dense-matrix.h":
+         ctypedef Modular_float Field
+         ctypedef float Element
+         DenseMatrix_Modular_float(Field F, size_t m, size_t n)
+-        DenseMatrix_Modular_float(Field F, Element*, size_t m, size_t n)
++        DenseMatrix_Modular_float(Field F, size_t m, size_t n, Element*)
+         void setEntry(size_t i, size_t j, Element& a)
+         Element &getEntry(size_t i, size_t j)
+ 
+@@ -101,7 +101,6 @@ cdef extern from "linbox/vector/vector.h":
+         DenseVector_integer (Field &F)
+         DenseVector_integer (Field &F, long& m)
+         DenseVector_integer (Field &F, cppvector[Integer]&)
+-        cppvector[Element]& refRep()
+         size_t size()
+         void resize(size_t)
+         void resize(size_t n, const Element&)
+diff --git a/src/sage/matrix/matrix_modn_dense_template.pxi b/src/sage/matrix/matrix_modn_dense_template.pxi
+index 010365d76f..3d60726ff9 100644
+--- a/src/sage/matrix/matrix_modn_dense_template.pxi
++++ b/src/sage/matrix/matrix_modn_dense_template.pxi
+@@ -219,7 +219,7 @@ cdef inline linbox_echelonize_efd(celement modulus, celement* entries, Py_ssize_
+         return 0,[]
+ 
+     cdef ModField *F = new ModField(<long>modulus)
+-    cdef DenseMatrix *A = new DenseMatrix(F[0], <ModField.Element*>entries,<Py_ssize_t>nrows, <Py_ssize_t>ncols)
++    cdef DenseMatrix *A = new DenseMatrix(F[0], <Py_ssize_t>nrows, <Py_ssize_t>ncols, <ModField.Element*>entries)
+     cdef Py_ssize_t r = reducedRowEchelonize(A[0])
+     cdef Py_ssize_t i,j
+     for i in range(nrows):
diff --git a/nixpkgs/pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch b/nixpkgs/pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch
new file mode 100644
index 000000000000..2bfac780dfca
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch
@@ -0,0 +1,62 @@
+diff --git a/src/sage_docbuild/builders.py b/src/sage_docbuild/builders.py
+index c5be38600a..e1d15f62d3 100644
+--- a/src/sage_docbuild/builders.py
++++ b/src/sage_docbuild/builders.py
+@@ -105,31 +105,6 @@ def builder_helper(type):
+     """
+     Return a function which builds the documentation for
+     output type ``type``.
+-
+-    TESTS:
+-
+-    Check that :trac:`25161` has been resolved::
+-
+-        sage: from sage_docbuild.builders import DocBuilder
+-        sage: from sage_docbuild.__main__ import setup_parser
+-        sage: DocBuilder._options = setup_parser().parse_args([]) # builder_helper needs _options to be set
+-
+-        sage: import sage_docbuild.sphinxbuild
+-        sage: def raiseBaseException():
+-        ....:     raise BaseException("abort pool operation")
+-        sage: original_runsphinx, sage_docbuild.sphinxbuild.runsphinx = sage_docbuild.sphinxbuild.runsphinx, raiseBaseException
+-
+-        sage: from sage.misc.temporary_file import tmp_dir
+-        sage: os.environ['SAGE_DOC'] = tmp_dir()
+-        sage: sage.env.var('SAGE_DOC') # random
+-        sage: from sage_docbuild.builders import builder_helper, build_ref_doc
+-        sage: from sage_docbuild.builders import _build_many as build_many
+-        sage: helper = builder_helper("html")
+-        sage: try:  # optional - sagemath_doc_html
+-        ....:     build_many(build_ref_doc, [("docname", "en", "html", {})])
+-        ....: except Exception as E:
+-        ....:     "Non-exception during docbuild: abort pool operation" in str(E)
+-        True
+     """
+     def f(self, *args, **kwds):
+         output_dir = self._output_dir(type)
+@@ -157,10 +132,9 @@ def builder_helper(type):
+         logger.debug(build_command)
+ 
+         # Run Sphinx with Sage's special logger
+-        sys.argv = ["sphinx-build"] + build_command.split()
+-        from .sphinxbuild import runsphinx
++        args = "python3 -um sage_docbuild.sphinxbuild -N".split() + build_command.split()
+         try:
+-            runsphinx()
++            subprocess.check_call(args)
+         except Exception:
+             if build_options.ABORT_ON_ERROR:
+                 raise
+diff --git a/src/sage_docbuild/sphinxbuild.py b/src/sage_docbuild/sphinxbuild.py
+index 07c584de55..b83283a9ee 100644
+--- a/src/sage_docbuild/sphinxbuild.py
++++ b/src/sage_docbuild/sphinxbuild.py
+@@ -331,3 +331,8 @@ def runsphinx():
+         sys.stderr = saved_stderr
+         sys.stdout.flush()
+         sys.stderr.flush()
++
++if __name__ == '__main__':
++    import sys
++    sys.argv[0] = "sphinx-build"
++    runsphinx()
diff --git a/nixpkgs/pkgs/applications/science/math/sage/patches/sympow-cache.patch b/nixpkgs/pkgs/applications/science/math/sage/patches/sympow-cache.patch
new file mode 100644
index 000000000000..d71f3acbc706
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/patches/sympow-cache.patch
@@ -0,0 +1,21 @@
+diff --git a/src/sage/lfunctions/sympow.py b/src/sage/lfunctions/sympow.py
+index 92cb01fd73..b123e6accc 100644
+--- a/src/sage/lfunctions/sympow.py
++++ b/src/sage/lfunctions/sympow.py
+@@ -50,6 +50,7 @@ from __future__ import print_function, absolute_import
+ 
+ import os
+ 
++from sage.env import DOT_SAGE
+ from sage.structure.sage_object import SageObject
+ from sage.misc.all import pager
+ from sage.misc.verbose import verbose
+@@ -78,7 +79,7 @@ class Sympow(SageObject):
+         """
+         Used to call sympow with given args
+         """
+-        cmd = 'sympow %s' % args
++        cmd = 'env SYMPOW_CACHEDIR="%s/sympow///" sympow %s' % (DOT_SAGE, args)
+         with os.popen(cmd) as f:
+             v = f.read().strip()
+         verbose(v, level=2)
diff --git a/nixpkgs/pkgs/applications/science/math/sage/python-modules/sage-docbuild.nix b/nixpkgs/pkgs/applications/science/math/sage/python-modules/sage-docbuild.nix
new file mode 100644
index 000000000000..b45998bbcb86
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/python-modules/sage-docbuild.nix
@@ -0,0 +1,34 @@
+{ lib
+, buildPythonPackage
+, sage-src
+, jupyter-sphinx
+, sphinx
+, sphinx-copybutton
+, sphinx-inline-tabs
+}:
+
+buildPythonPackage rec {
+  version = src.version;
+  pname = "sage-docbuild";
+  src = sage-src;
+
+  propagatedBuildInputs = [
+    jupyter-sphinx
+    sphinx
+    sphinx-copybutton
+    sphinx-inline-tabs
+  ];
+
+  preBuild = ''
+    cd pkgs/sage-docbuild
+  '';
+
+  doCheck = false; # we will run tests in sagedoc.nix
+
+  meta = with lib; {
+    description = "Build system of the Sage documentation";
+    homepage = "https://www.sagemath.org";
+    license = licenses.gpl2Plus;
+    maintainers = teams.sage.members;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/sage/python-modules/sage-setup.nix b/nixpkgs/pkgs/applications/science/math/sage/python-modules/sage-setup.nix
new file mode 100644
index 000000000000..a96f7ccd5d4c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/python-modules/sage-setup.nix
@@ -0,0 +1,30 @@
+{ lib
+, buildPythonPackage
+, sage-src
+, cython_3
+, jinja2
+, pkgconfig # the python module, not the pkg-config alias
+}:
+
+buildPythonPackage rec {
+  version = src.version;
+  pname = "sage-setup";
+  src = sage-src;
+
+  nativeBuildInputs = [ cython_3 ];
+  buildInputs = [ pkgconfig ];
+  propagatedBuildInputs = [ jinja2 ];
+
+  preBuild = ''
+    cd pkgs/sage-setup
+  '';
+
+  doCheck = false; # sagelib depends on sage-setup, but sage-setup's tests depend on sagelib
+
+  meta = with lib; {
+    description = "Build system of the Sage library";
+    homepage = "https://www.sagemath.org";
+    license = licenses.gpl2Plus;
+    maintainers = teams.sage.members;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/sage/sage-env.nix b/nixpkgs/pkgs/applications/science/math/sage/sage-env.nix
new file mode 100644
index 000000000000..4f179ea3a42b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/sage-env.nix
@@ -0,0 +1,194 @@
+{ stdenv
+, lib
+, writeTextFile
+, sagelib
+, sage-docbuild
+, env-locations
+, gfortran
+, bash
+, coreutils
+, gnused
+, gnugrep
+, binutils
+, pythonEnv
+, python3
+, pkg-config
+, pari
+, gap
+, maxima
+, singular
+, fflas-ffpack
+, givaro
+, gd
+, libpng
+, linbox
+, m4ri
+, giac
+, palp
+, rWrapper
+, gfan
+, cddlib
+, jmol
+, tachyon
+, glpk
+, eclib
+, sympow
+, nauty
+, sqlite
+, ppl
+, ecm
+, lcalc
+, rubiks
+, flintqs
+, blas
+, lapack
+, flint3
+, gmp
+, mpfr
+, zlib
+, gsl
+, ntl
+, jdk
+, less
+}:
+
+assert (!blas.isILP64) && (!lapack.isILP64);
+
+# This generates a `sage-env` shell file that will be sourced by sage on startup.
+# It sets up various environment variables, telling sage where to find its
+# dependencies.
+
+let
+  runtimepath = (lib.makeBinPath ([
+    "@sage-local@"
+    "@sage-local@/build"
+    pythonEnv
+    gfortran # for inline fortran
+    stdenv.cc # for cython
+    bash
+    coreutils
+    gnused
+    gnugrep
+    binutils.bintools
+    pkg-config
+    pari
+    gap
+    maxima.lisp-compiler
+    maxima
+    singular
+    giac
+    palp
+    # needs to be rWrapper since the default `R` doesn't include R's default libraries
+    rWrapper
+    gfan
+    cddlib
+    jmol
+    tachyon
+    glpk
+    eclib
+    sympow
+    nauty
+    sqlite
+    ppl
+    ecm
+    lcalc
+    rubiks
+    flintqs
+    jdk # only needed for `jmol` which may be replaced in the future
+    less # needed to prevent transient test errors until https://github.com/ipython/ipython/pull/11864 is resolved
+  ]
+  ));
+in
+writeTextFile rec {
+  name = "sage-env";
+  destination = "/${name}";
+  text = ''
+    export PKG_CONFIG_PATH='${lib.makeSearchPathOutput "dev" "lib/pkgconfig" [
+        # This should only be needed during build. However, since the  doctests
+        # also test the cython build (for example in src/sage/misc/cython.py),
+        # it is also needed for the testsuite to pass. We could fix the
+        # testsuite instead, but since all the packages are also runtime
+        # dependencies it doesn't really hurt to include them here.
+        singular
+        blas lapack
+        fflas-ffpack givaro
+        gd
+        libpng zlib
+        gsl
+        linbox
+        m4ri
+      ]
+    }'
+    export SAGE_ROOT='${sagelib.src}'
+  '' +
+    # TODO: is using pythonEnv instead of @sage-local@ here a good
+    # idea? there is a test in src/sage/env.py that checks if the values
+    # SAGE_ROOT and SAGE_LOCAL set here match the ones set in env.py.
+    # we fix up env.py's SAGE_ROOT in sage-src.nix (which does not
+    # have access to sage-with-env), but env.py autodetects
+    # SAGE_LOCAL to be pythonEnv.
+    # setting SAGE_LOCAL to pythonEnv also avoids having to create
+    # python3, ipython, ipython3 and jupyter symlinks in
+    # sage-with-env.nix.
+  ''
+    export SAGE_LOCAL='${pythonEnv}'
+
+    export SAGE_SHARE='${sagelib}/share'
+    export SAGE_ENV_CONFIG_SOURCED=1 # sage-env complains if sage-env-config is not sourced beforehand
+    orig_path="$PATH"
+    export PATH='${runtimepath}'
+
+    # set dependent vars, like JUPYTER_CONFIG_DIR
+    source "${sagelib.src}/src/bin/sage-env"
+    export PATH="$RUNTIMEPATH_PREFIX:${runtimepath}:$orig_path" # sage-env messes with PATH
+
+    export SAGE_LOGS="$TMPDIR/sage-logs"
+    export SAGE_DOC="''${SAGE_DOC_OVERRIDE:-doc-placeholder}"
+    export SAGE_DOC_SRC="''${SAGE_DOC_SRC_OVERRIDE:-${sagelib.src}/src/doc}"
+
+    # set locations of dependencies
+    . ${env-locations}/sage-env-locations
+
+    # needed for cython
+    export CC='${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc'
+    export CXX='${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++'
+    # cython needs to find these libraries, otherwise will fail with `ld: cannot find -lflint` or similar
+    export LDFLAGS='${
+      lib.concatStringsSep " " (map (pkg: "-L${pkg}/lib") [
+        flint3
+        gap
+        glpk
+        gmp
+        mpfr
+        pari
+        zlib
+        eclib
+        gsl
+        ntl
+        jmol
+        sympow
+      ])
+    }'
+    export CFLAGS='${
+      lib.concatStringsSep " " (map (pkg: "-isystem ${pkg}/include") [
+        singular
+        gmp.dev
+        glpk
+        flint3
+        gap
+        mpfr.dev
+      ])
+    }'
+    export CXXFLAGS=$CFLAGS
+
+    export SAGE_LIB='${sagelib}/${python3.sitePackages}'
+
+    export SAGE_EXTCODE='${sagelib.src}/src/sage/ext_data'
+
+  # for find_library
+    export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular giac]}''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
+  '';
+} // { # equivalent of `passthru`, which `writeTextFile` doesn't support
+  lib = sagelib;
+  docbuild = sage-docbuild;
+}
diff --git a/nixpkgs/pkgs/applications/science/math/sage/sage-src.nix b/nixpkgs/pkgs/applications/science/math/sage/sage-src.nix
new file mode 100644
index 000000000000..11bcc9ee3d5a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/sage-src.nix
@@ -0,0 +1,97 @@
+{ stdenv
+, fetchFromGitHub
+, fetchpatch
+, fetchurl
+}:
+
+# This file is responsible for fetching the sage source and adding necessary patches.
+# It does not actually build anything, it just copies the patched sources to $out.
+# This is done because multiple derivations rely on these sources and they should
+# all get the same sources with the same patches applied.
+
+stdenv.mkDerivation rec {
+  version = "10.3";
+  pname = "sage-src";
+
+  src = fetchFromGitHub {
+    owner = "sagemath";
+    repo = "sage";
+    rev = version;
+    hash = "sha256-OHtMv8t0RrP6R8XIREU+C1vpazeQLWa75wx9Mv6BN1U=";
+  };
+
+  # contains essential files (e.g., setup.cfg) generated by the bootstrap script.
+  # TODO: investigate https://github.com/sagemath/sage/pull/35950
+  configure-src = fetchurl {
+    # the hash below is the tagged commit's _parent_. it can also be found by looking for
+    # the "configure" asset at https://github.com/sagemath/sage/releases/tag/${version}
+    url = "mirror://sageupstream/configure/configure-ab1a517b64b02bf15bbcb8d7c2d4d643bd5eff9b.tar.gz";
+    hash = "sha256-pe9AxTM+gFSR4/eVfUzay+4bwjoubbYeDPc+avKjlaw=";
+  };
+
+  # Patches needed because of particularities of nix or the way this is packaged.
+  # The goal is to upstream all of them and get rid of this list.
+  nixPatches = [
+    # Parallelize docubuild using subprocesses, fixing an isolation issue. See
+    # https://groups.google.com/forum/#!topic/sage-packaging/YGOm8tkADrE
+    ./patches/sphinx-docbuild-subprocesses.patch
+
+    # After updating smypow to (https://github.com/sagemath/sage/issues/3360)
+    # we can now set the cache dir to be within the .sage directory. This is
+    # not strictly necessary, but keeps us from littering in the user's HOME.
+    ./patches/sympow-cache.patch
+  ];
+
+  # Since sage unfortunately does not release bugfix releases, packagers must
+  # fix those bugs themselves. This is for critical bugfixes, where "critical"
+  # == "causes (transient) doctest failures / somebody complained".
+  bugfixPatches = [
+    # Sage uses mixed integer programs (MIPs) to find edge disjoint
+    # spanning trees. For some reason, aarch64 glpk takes much longer
+    # than x86_64 glpk to solve such MIPs. Since the MIP formulation
+    # has "numerous problems" and will be replaced by a polynomial
+    # algorithm soon, disable this test for now.
+    # https://github.com/sagemath/sage/issues/34575
+    ./patches/disable-slow-glpk-test.patch
+  ];
+
+  # Patches needed because of package updates. We could just pin the versions of
+  # dependencies, but that would lead to rebuilds, confusion and the burdons of
+  # maintaining multiple versions of dependencies. Instead we try to make sage
+  # compatible with never dependency versions when possible. All these changes
+  # should come from or be proposed to upstream. This list will probably never
+  # be empty since dependencies update all the time.
+  packageUpgradePatches = [
+    # https://github.com/sagemath/sage/pull/37492
+    (fetchpatch {
+      name = "singular-4.3.2p14-upgrade.patch";
+      url = "https://github.com/sagemath/sage/commit/a0c56816b051e97da44ac0a4e4d4f6915cf7fa0f.diff";
+      sha256 = "sha256-WGMmPeBoj2LUC+2qxWuaJL89QUuGt6axGvxWkpM9LYg=";
+    })
+  ];
+
+  patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;
+
+  # do not create .orig backup files if patch applies with fuzz
+  patchFlags = [ "--no-backup-if-mismatch" "-p1" ];
+
+  postPatch = ''
+    # Make sure sage can at least be imported without setting any environment
+    # variables. It won't be close to feature complete though.
+    sed -i \
+      "s|var(\"SAGE_ROOT\".*|var(\"SAGE_ROOT\", \"$out\")|" \
+      src/sage/env.py
+
+    # sage --docbuild unsets JUPYTER_PATH, which breaks our docbuilding
+    # https://trac.sagemath.org/ticket/33650#comment:32
+    sed -i "/export JUPYTER_PATH/d" src/bin/sage
+  '';
+
+  buildPhase = "# do nothing";
+
+  installPhase = ''
+    cp -r . "$out"
+    tar xkzf ${configure-src} -C "$out"
+    rm "$out/configure"
+  '';
+}
diff --git a/nixpkgs/pkgs/applications/science/math/sage/sage-tests.nix b/nixpkgs/pkgs/applications/science/math/sage/sage-tests.nix
new file mode 100644
index 000000000000..1a415ae65e96
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/sage-tests.nix
@@ -0,0 +1,61 @@
+{ stdenv
+, lib
+, sage-with-env
+, makeWrapper
+, files ? null # "null" means run all tests
+, longTests ? true # run tests marked as "long time" (roughly doubles runtime)
+# Run as many tests as possible in approximately n seconds. This will give each
+# file to test a "time budget" and stop tests if it is exceeded. 300 is the
+# upstream default value.
+# https://trac.sagemath.org/ticket/25270 for details.
+, timeLimit ? null
+}:
+
+# for a quick test of some source files:
+# nix-build -E 'with (import ./. {}); sage.tests.override { files = [ "src/sage/misc/cython.py" ];}'
+
+let
+  src = sage-with-env.env.lib.src;
+  runAllTests = files == null;
+  testArgs = if runAllTests then "--all" else testFileList;
+  patienceSpecifier = lib.optionalString longTests "--long";
+  timeSpecifier = lib.optionalString (timeLimit != null) "--short ${toString timeLimit}";
+  relpathToArg = relpath: lib.escapeShellArg "${src}/${relpath}"; # paths need to be absolute
+  testFileList = lib.concatStringsSep " " (map relpathToArg files);
+in
+stdenv.mkDerivation {
+  version = src.version;
+  pname = "sage-tests";
+  inherit src;
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [
+    sage-with-env
+  ];
+
+  dontUnpack = true;
+  configurePhase = "#do nothing";
+  buildPhase = "#do nothing";
+
+  installPhase = ''
+    # This output is not actually needed for anything, the package just
+    # exists to decouple the sage build from its t ests.
+
+    mkdir -p "$out/bin"
+    # Like a symlink, but make sure that $0 points to the original.
+    makeWrapper "${sage-with-env}/bin/sage" "$out/bin/sage"
+  '';
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    export HOME="$TMPDIR/sage-home"
+    mkdir -p "$HOME"
+
+    # avoid running out of memory with many threads in subprocesses, see
+    # https://github.com/NixOS/nixpkgs/pull/65802
+    export GLIBC_TUNABLES=glibc.malloc.arena_max=4
+
+    echo "Running sage tests with arguments ${timeSpecifier} ${patienceSpecifier} ${testArgs}"
+    "sage" -t --timeout=0 --nthreads "$NIX_BUILD_CORES" --optional=sage ${timeSpecifier} ${patienceSpecifier} ${testArgs}
+  '';
+}
diff --git a/nixpkgs/pkgs/applications/science/math/sage/sage-with-env.nix b/nixpkgs/pkgs/applications/science/math/sage/sage-with-env.nix
new file mode 100644
index 000000000000..b2c0843d3100
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/sage-with-env.nix
@@ -0,0 +1,137 @@
+{ stdenv
+, lib
+, sage-env
+, blas
+, lapack
+, pkg-config
+, three
+, singular
+, gap
+, giac
+, maxima
+, pari
+, gmp
+, gfan
+, python3
+, flintqs
+, eclib
+, ntl
+, ecm
+, pythonEnv
+}:
+
+# lots of segfaults with (64 bit) blas
+assert (!blas.isILP64) && (!lapack.isILP64);
+
+# Wrapper that combined `sagelib` with `sage-env` to produce an actually
+# executable sage. No tests are run yet and no documentation is built.
+
+let
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    pythonEnv # for patchShebangs
+    blas lapack
+    singular
+    three
+    giac
+    gap
+    pari
+    gmp
+    gfan
+    maxima
+    eclib
+    flintqs
+    ntl
+    ecm
+  ];
+
+  # remove python prefix, replace "-" in the name by "_", apply patch_names
+  # python3.8-some-pkg-1.0 -> some_pkg-1.0
+  pkg_to_spkg_name = pkg: patch_names: let
+    parts = lib.splitString "-" pkg.name;
+    # remove python3.8-
+    stripped_parts = if (builtins.head parts) == python3.libPrefix then builtins.tail parts else parts;
+    version = lib.last stripped_parts;
+    orig_pkgname = lib.init stripped_parts;
+    pkgname = patch_names (lib.concatStringsSep "_" orig_pkgname);
+  in pkgname + "-" + version;
+
+
+  # return the names of all dependencies in the transitive closure
+  transitiveClosure = dep:
+  if dep == null then
+    # propagatedBuildInputs might contain null
+    # (although that might be considered a programming error in the derivation)
+    []
+  else
+    [ dep ] ++ (
+      if builtins.hasAttr "propagatedBuildInputs" dep then
+        lib.unique (builtins.concatLists (map transitiveClosure dep.propagatedBuildInputs))
+      else
+      []
+    );
+
+  allInputs = lib.remove null (nativeBuildInputs ++ buildInputs ++ pythonEnv.extraLibs);
+  transitiveDeps = lib.unique (builtins.concatLists (map transitiveClosure allInputs ));
+  # fix differences between spkg and sage names
+  # (could patch sage instead, but this is more lightweight and also works for packages depending on sage)
+  patch_names = builtins.replaceStrings [
+    "zope.interface"
+    "node_three"
+  ] [
+    "zope-interface"
+    "threejs"
+  ];
+  # spkg names (this_is_a_package-version) of all transitive deps
+  input_names = map (dep: pkg_to_spkg_name dep patch_names) transitiveDeps;
+in
+stdenv.mkDerivation rec {
+  version = src.version;
+  pname = "sage-with-env";
+  src = sage-env.lib.src;
+
+  inherit nativeBuildInputs buildInputs;
+
+  configurePhase = "#do nothing";
+
+  buildPhase = ''
+    mkdir installed
+    for pkg in ${lib.concatStringsSep " " input_names}; do
+      touch "installed/$pkg"
+    done
+
+    # threejs version is in format 0.<version>.minor, but sage currently still
+    # relies on installed_packages for the online version of threejs to work
+    # and expects the format r<version>. This is a hotfix for now.
+    # upstream: https://trac.sagemath.org/ticket/26434
+    rm "installed/threejs"*
+    touch "installed/threejs-r${lib.versions.minor three.version}"
+  '';
+
+  installPhase = ''
+    mkdir -p "$out/var/lib/sage"
+    cp -r installed "$out/var/lib/sage"
+
+    mkdir -p "$out/etc"
+    # sage tests will try to create this file if it doesn't exist
+    touch "$out/etc/sage-started.txt"
+
+    mkdir -p "$out/build"
+
+    # the scripts in src/bin will find the actual sage source files using environment variables set in `sage-env`
+    cp -r src/bin "$out/bin"
+    cp -r build/bin "$out/build/bin"
+
+    # sage assumes the existence of sage-src-env-config.in means it's being executed in-tree. in this case, it
+    # adds SAGE_SRC/bin to PATH, breaking our wrappers
+    rm "$out/bin"/*.in "$out/build/bin"/*.in
+
+    cp -f '${sage-env}/sage-env' "$out/bin/sage-env"
+    substituteInPlace "$out/bin/sage-env" \
+      --subst-var-by sage-local "$out"
+  '';
+
+  passthru = {
+    env = sage-env;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/sage/sage.nix b/nixpkgs/pkgs/applications/science/math/sage/sage.nix
new file mode 100644
index 000000000000..81b55e841d24
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/sage.nix
@@ -0,0 +1,65 @@
+{ lib, stdenv
+, makeWrapper
+, sage-tests
+, sage-with-env
+, jupyter-kernel-definition
+, jupyter-kernel-specs
+, sagedoc
+, withDoc
+, requireSageTests
+}:
+
+# A wrapper that makes sure sage finds its docs (if they were build) and the
+# jupyter kernel spec.
+
+stdenv.mkDerivation rec {
+  version = src.version;
+  pname = "sage";
+  src = sage-with-env.env.lib.src;
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = lib.optionals requireSageTests [
+    # This is a hack to make sure sage-tests is evaluated. It doesn't acutally
+    # produce anything of value, it just decouples the tests from the build.
+    sage-tests
+  ];
+
+  dontUnpack = true;
+  configurePhase = "#do nothing";
+  buildPhase = "#do nothing";
+
+  installPhase = ''
+    mkdir -p "$out/bin"
+    makeWrapper "${sage-with-env}/bin/sage" "$out/bin/sage" \
+      --set SAGE_DOC_SRC_OVERRIDE "${src}/src/doc" ${
+        lib.optionalString withDoc "--set SAGE_DOC_OVERRIDE ${sagedoc}/share/doc/sage"
+      } \
+      --prefix JUPYTER_PATH : "${jupyter-kernel-specs}"
+  '';
+
+  doInstallCheck = withDoc;
+  installCheckPhase = ''
+    export HOME="$TMPDIR/sage-home"
+    mkdir -p "$HOME"
+    "$out/bin/sage" -c 'browse_sage_doc._open("reference", testing=True)'
+  '';
+
+  passthru = {
+    tests = sage-tests;
+    quicktest = sage-tests.override { longTests = false; timeLimit = 600; }; # as many tests as possible in ~10m
+    lib = sage-with-env.env.lib;
+    with-env = sage-with-env;
+    kernelspec = jupyter-kernel-definition;
+  } // lib.optionalAttrs withDoc {
+    doc = sagedoc;
+  };
+
+  meta = with lib; {
+    description = "Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab";
+    mainProgram = "sage";
+    homepage = "https://www.sagemath.org";
+    license = licenses.gpl2Plus;
+    maintainers = teams.sage.members;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/sage/sagedoc.nix b/nixpkgs/pkgs/applications/science/math/sage/sagedoc.nix
new file mode 100644
index 000000000000..5e2191486bf0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/sagedoc.nix
@@ -0,0 +1,67 @@
+{ stdenv
+, sage-with-env
+, python3
+, jupyter-kernel-specs
+}:
+
+stdenv.mkDerivation rec {
+  version = src.version;
+  pname = "sagedoc";
+  src = sage-with-env.env.lib.src;
+
+  strictDeps = true;
+
+  unpackPhase = ''
+    export SAGE_DOC_OVERRIDE="$PWD/share/doc/sage"
+    export SAGE_DOC_SRC_OVERRIDE="$PWD/docsrc"
+
+    cp -r "${src}/src/doc" "$SAGE_DOC_SRC_OVERRIDE"
+    chmod -R 755 "$SAGE_DOC_SRC_OVERRIDE"
+  '';
+
+  buildPhase = ''
+    export SAGE_NUM_THREADS="$NIX_BUILD_CORES"
+    export HOME="$TMPDIR/sage_home"
+    mkdir -p "$HOME"
+
+    # adapted from src/doc/Makefile (doc-src target), which tries to call Sage from PATH
+    mkdir -p $SAGE_DOC_SRC_OVERRIDE/en/reference/repl
+    ${sage-with-env}/bin/sage -advanced > $SAGE_DOC_SRC_OVERRIDE/en/reference/repl/options.txt
+
+    # needed to link them in the sage docs using intersphinx
+    export PPLPY_DOCS=${python3.pkgs.pplpy.doc}/share/doc/pplpy
+
+    # jupyter-sphinx calls the sagemath jupyter kernel during docbuild
+    export JUPYTER_PATH=${jupyter-kernel-specs}
+
+    ${sage-with-env}/bin/sage --docbuild \
+      --mathjax \
+      --no-pdf-links \
+      all html
+  '';
+
+  installPhase = ''
+    cd "$SAGE_DOC_OVERRIDE"
+
+    mkdir -p "$out/share/doc/sage"
+    cp -r html "$out"/share/doc/sage
+
+    # Replace duplicated files by symlinks (Gentoo)
+    cd "$out"/share/doc/sage
+    mv html/en/_static{,.tmp}
+    for _dir in `find -name _static` ; do
+          rm -r $_dir
+          ln -rs html/en/_static $_dir
+    done
+    mv html/en/_static{.tmp,}
+  '';
+
+  doCheck = true;
+  checkPhase = ''
+    # sagemath_doc_html tests assume sage tests are being run, so we
+    # compromise: we run standard tests, but only on files containing
+    # relevant tests. as of Sage 9.6, there are only 4 such files.
+    grep -PRl "#.*(optional|needs).*sagemath_doc_html" ${src}/src/sage{,_docbuild} | \
+      xargs ${sage-with-env}/bin/sage -t --optional=sage,sagemath_doc_html
+  '';
+}
diff --git a/nixpkgs/pkgs/applications/science/math/sage/sagelib.nix b/nixpkgs/pkgs/applications/science/math/sage/sagelib.nix
new file mode 100644
index 000000000000..b67b74e3a0f2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/sagelib.nix
@@ -0,0 +1,216 @@
+{ sage-src
+, env-locations
+, python
+, buildPythonPackage
+, m4
+, perl
+, pkg-config
+, sage-setup
+, gd
+, iml
+, libpng
+, readline
+, blas
+, boost
+, brial
+, cliquer
+, eclib
+, ecm
+, fflas-ffpack
+, flint3
+, gap
+, giac
+, givaro
+, glpk
+, gsl
+, lapack
+, lcalc
+, libbraiding
+, libhomfly
+, libmpc
+, linbox
+, lisp-compiler
+, lrcalc
+, m4ri
+, m4rie
+, mpfi
+, mpfr
+, ntl
+, pari
+, planarity
+, ppl
+, rankwidth
+, ratpoints
+, singular
+, sqlite
+, symmetrica
+, conway-polynomials
+, cvxopt
+, cypari2
+, cysignals
+, cython_3
+, fpylll
+, gmpy2
+, importlib-metadata
+, importlib-resources
+, ipykernel
+, ipython
+, ipywidgets
+, jinja2
+, jupyter-client
+, jupyter-core
+, lrcalc-python
+, matplotlib
+, memory-allocator
+, mpmath
+, networkx
+, numpy
+, pexpect
+, pillow
+, pip
+, pkgconfig
+, pplpy
+, primecountpy
+, ptyprocess
+, requests
+, rpy2
+, scipy
+, sphinx
+, sympy
+, typing-extensions
+, nbclassic
+}:
+
+assert (!blas.isILP64) && (!lapack.isILP64);
+
+# This is the core sage python package. Everything else is just wrappers gluing
+# stuff together. It is not very useful on its own though, since it will not
+# find many of its dependencies without `sage-env`, will not be tested without
+# `sage-tests` and will not have html docs without `sagedoc`.
+
+buildPythonPackage rec {
+  version = src.version;
+  pname = "sagelib";
+  src = sage-src;
+  pyproject = true;
+
+  nativeBuildInputs = [
+    iml
+    lisp-compiler
+    m4
+    perl
+    pip # needed to query installed packages
+    pkg-config
+    sage-setup
+  ];
+
+  buildInputs = [
+    gd
+    iml
+    libpng
+    readline
+  ];
+
+  propagatedBuildInputs = [
+    # native dependencies (TODO: determine which ones need to be propagated)
+    blas
+    boost
+    brial
+    cliquer
+    eclib
+    ecm
+    fflas-ffpack
+    flint3
+    gap
+    giac
+    givaro
+    glpk
+    gsl
+    lapack
+    lcalc
+    libbraiding
+    libhomfly
+    libmpc
+    linbox
+    lisp-compiler
+    lrcalc
+    m4ri
+    m4rie
+    mpfi
+    mpfr
+    ntl
+    pari
+    planarity
+    ppl
+    rankwidth
+    ratpoints
+    singular
+    sqlite
+    symmetrica
+
+    # from src/sage/setup.cfg and requirements.txt
+    conway-polynomials
+    cvxopt
+    cypari2
+    cysignals
+    cython_3
+    fpylll
+    gmpy2
+    importlib-metadata
+    importlib-resources
+    ipykernel
+    ipython
+    ipywidgets
+    jinja2
+    jupyter-client
+    jupyter-core
+    lrcalc-python
+    matplotlib
+    memory-allocator
+    mpmath
+    networkx
+    numpy
+    pexpect
+    pillow
+    pip
+    pkgconfig
+    pplpy
+    primecountpy
+    ptyprocess
+    requests
+    rpy2
+    scipy
+    sphinx
+    sympy
+    typing-extensions
+
+    nbclassic
+  ];
+
+  preBuild = ''
+    export SAGE_ROOT="$PWD"
+    export SAGE_LOCAL="$SAGE_ROOT"
+    export SAGE_SHARE="$SAGE_LOCAL/share"
+
+    # set locations of dependencies (needed for nbextensions like threejs)
+    . ${env-locations}/sage-env-locations
+
+    export JUPYTER_PATH="$SAGE_LOCAL/jupyter"
+    export PATH="$SAGE_ROOT/build/bin:$SAGE_ROOT/src/bin:$PATH"
+
+    export SAGE_NUM_THREADS="$NIX_BUILD_CORES"
+
+    mkdir -p "$SAGE_SHARE/sage/ext/notebook-ipython"
+    mkdir -p "var/lib/sage/installed"
+
+    sed -i "/sage-conf/d" src/{setup.cfg,pyproject.toml,requirements.txt}
+
+    cd build/pkgs/sagelib/src
+  '';
+
+  postInstall = ''
+    rm -r "$out/${python.sitePackages}/sage/cython_debug"
+  '';
+
+  doCheck = false; # we will run tests in sage-tests.nix
+}
diff --git a/nixpkgs/pkgs/applications/science/math/sage/threejs-sage.nix b/nixpkgs/pkgs/applications/science/math/sage/threejs-sage.nix
new file mode 100644
index 000000000000..bc7230f333ab
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/threejs-sage.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "threejs-sage";
+  version = "r122";
+
+  src = fetchFromGitHub {
+    owner = "sagemath";
+    repo = "threejs-sage";
+    rev = version;
+    sha256 = "sha256-xPAPt36Fon3hYQq6SOmGkIyUzAII2LMl10nqYG4UPI0=";
+  };
+
+  installPhase = ''
+    mkdir -p "$out/lib/node_modules/three/"
+    cp version "$out/lib/node_modules/three"
+    cp -r build "$out/lib/node_modules/three/$(cat version)"
+  '';
+}
diff --git a/nixpkgs/pkgs/applications/science/math/scalp/default.nix b/nixpkgs/pkgs/applications/science/math/scalp/default.nix
new file mode 100644
index 000000000000..fc230a11966f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/scalp/default.nix
@@ -0,0 +1,59 @@
+{ lib
+, stdenv
+, fetchgit
+, cmake
+, withGurobi ? false
+, gurobi
+, withCplex ? false
+, cplex
+, withLpsolve ? true
+, lp_solve
+}:
+
+stdenv.mkDerivation rec {
+  pname = "scalp";
+  version = "unstable-2022-03-15";
+
+  src = fetchgit {
+    url = "https://digidev.digi.e-technik.uni-kassel.de/git/scalp.git";
+    # mirrored at https://git.sr.ht/~weijia/scalp
+    rev = "185b84e4ff967f42cf2de5db4db4e6fa0cc18fb8";
+    sha256 = "sha256-NyMZdJwdD3FR6uweYCclJjfcf3Y24Bns1ViwsmJ5izg=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = lib.optionals withGurobi [
+    gurobi
+  ] ++ lib.optionals withCplex [
+    cplex
+  ] ++ lib.optionals withLpsolve [
+    lp_solve
+  ];
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace CMakeLists.txt \
+      --replace "\''$ORIGIN" "\''${CMAKE_INSTALL_PREFIX}/lib"
+  '';
+
+  cmakeFlags = [
+    "-DBUILD_TESTS=${lib.boolToString doCheck}"
+  ] ++ lib.optionals withGurobi [
+    "-DGUROBI_DIR=${gurobi}"
+  ] ++ lib.optionals withCplex [
+    "-DCPLEX_DIR=${cplex}"
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Scalable Linear Programming Library";
+    mainProgram = "scalp";
+    homepage = "https://digidev.digi.e-technik.uni-kassel.de/scalp/";
+    license = licenses.lgpl3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ wegank ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/scilab-bin/default.nix b/nixpkgs/pkgs/applications/science/math/scilab-bin/default.nix
new file mode 100644
index 000000000000..f6da20531385
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/scilab-bin/default.nix
@@ -0,0 +1,103 @@
+{ lib
+, stdenv
+, fetchurl
+, makeWrapper
+, undmg
+, autoPatchelfHook
+, alsa-lib
+, ncurses5
+, xorg
+}:
+
+let
+  pname = "scilab-bin";
+  version = "6.1.1";
+
+  srcs = {
+    aarch64-darwin = fetchurl {
+      url = "https://www.utc.fr/~mottelet/scilab/download/${version}/scilab-${version}-accelerate-arm64.dmg";
+      sha256 = "sha256-L4dxD8R8bY5nd+4oDs5Yk0LlNsFykLnAM+oN/O87SRI=";
+    };
+    x86_64-darwin = fetchurl {
+      url = "https://www.utc.fr/~mottelet/scilab/download/${version}/scilab-${version}-x86_64.dmg";
+      sha256 = "sha256-tBeqzllMuogrGcJxGqEl2DdNXaiwok3yhzWSdlWY5Fc=";
+    };
+    x86_64-linux = fetchurl {
+      url = "https://www.scilab.org/download/${version}/scilab-${version}.bin.linux-x86_64.tar.gz";
+      sha256 = "sha256-PuGnz2YdAhriavwnuf5Qyy0cnCeRHlWC6dQzfr7bLHk=";
+    };
+  };
+  src = srcs.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
+
+  meta = {
+    homepage = "http://www.scilab.org/";
+    description = "Scientific software package for numerical computations (Matlab lookalike)";
+    platforms = [ "aarch64-darwin" "x86_64-darwin" "x86_64-linux" ];
+    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
+    license = lib.licenses.gpl2Only;
+    mainProgram = "scilab";
+  };
+
+  darwin = stdenv.mkDerivation rec {
+    inherit pname version src meta;
+
+    nativeBuildInputs = [
+      makeWrapper
+      undmg
+    ];
+
+    sourceRoot = "scilab-${version}.app";
+
+    installPhase = ''
+      runHook preInstall
+
+      mkdir -p $out/{Applications/scilab.app,bin}
+      cp -R . $out/Applications/scilab.app
+      makeWrapper $out/{Applications/scilab.app/Contents/MacOS,bin}/scilab
+
+      runHook postInstall
+    '';
+  };
+
+  linux = stdenv.mkDerivation rec {
+    inherit pname version src meta;
+
+    nativeBuildInputs = [
+      autoPatchelfHook
+    ];
+
+    buildInputs = [
+      alsa-lib
+      ncurses5
+      stdenv.cc.cc
+    ] ++ (with xorg; [
+      libX11
+      libXcursor
+      libXext
+      libXft
+      libXi
+      libXrandr
+      libXrender
+      libXtst
+      libXxf86vm
+    ]);
+
+    installPhase = ''
+      runHook preInstall
+
+      mkdir -p $out
+      mv -t $out bin include lib share thirdparty
+      sed -i \
+        -e 's|\$(/bin/|$(|g' \
+        -e 's|/usr/bin/||g' \
+        $out/bin/{scilab,xcos}
+      sed -i \
+        -e "s|Exec=|Exec=$out/bin/|g" \
+        -e "s|Terminal=.*$|Terminal=true|g" \
+        $out/share/applications/*.desktop
+
+      runHook postInstall
+    '';
+  };
+in
+if stdenv.isDarwin then darwin else linux
diff --git a/nixpkgs/pkgs/applications/science/math/scotch/default.nix b/nixpkgs/pkgs/applications/science/math/scotch/default.nix
new file mode 100644
index 000000000000..1eb057cfc7c5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/scotch/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, bison, mpi, flex, zlib}:
+
+stdenv.mkDerivation rec {
+  version = "6.1.1";
+  pname = "scotch";
+  src_name = "scotch_${version}";
+
+  buildInputs = [ bison mpi flex zlib ];
+
+  src = fetchurl {
+    url = "https://gforge.inria.fr/frs/download.php/file/34618/${src_name}.tar.gz";
+    sha256 = "sha256-OQUvWf9HSkppzvwlzzyvhClACIneugEO5kA8oYj4sxE=";
+  };
+
+  sourceRoot = "${src_name}/src";
+
+  preConfigure = ''
+    ln -s Make.inc/Makefile.inc.x86-64_pc_linux2 Makefile.inc
+  '';
+
+  buildFlags = [ "scotch ptscotch" ];
+  installFlags = [ "prefix=\${out}" ];
+
+  meta = {
+    description = "Graph and mesh/hypergraph partitioning, graph clustering, and sparse matrix ordering";
+    longDescription = ''
+      Scotch is a software package for graph and mesh/hypergraph partitioning, graph clustering,
+      and sparse matrix ordering.
+    '';
+    homepage = "http://www.labri.fr/perso/pelegrin/scotch";
+    license = lib.licenses.cecill-c;
+    maintainers = [ lib.maintainers.bzizou ];
+    platforms = lib.platforms.linux;
+  };
+}
+
diff --git a/nixpkgs/pkgs/applications/science/math/singular/default.nix b/nixpkgs/pkgs/applications/science/math/singular/default.nix
new file mode 100644
index 000000000000..a6c64066d88e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/singular/default.nix
@@ -0,0 +1,172 @@
+{ stdenv, fetchFromGitHub, gmp, bison, perl, ncurses, readline, coreutils, pkg-config
+, lib
+, autoreconfHook
+, buildPackages
+, sharutils
+, file
+, getconf
+, flint3
+, ntl
+, cddlib
+, gfan
+, lrcalc
+, doxygen
+, graphviz
+, latex2html
+# upstream generates docs with texinfo 4. later versions of texinfo
+# use letters instead of numbers for post-appendix chapters, and we
+# want it to match the upstream format because sage depends on it.
+, texinfo4
+, texliveSmall
+, enableDocs ? true
+, enableGfanlib ? true
+}:
+
+stdenv.mkDerivation rec {
+  pname = "singular";
+  version = "4.3.2p16";
+
+  # since the tarball does not contain tests, we fetch from GitHub.
+  src = fetchFromGitHub {
+    owner = "Singular";
+    repo = "Singular";
+
+    # if a release is tagged (which sometimes does not happen), it will
+    # be in the format below.
+    rev = "Release-${lib.replaceStrings ["."] ["-"] version}";
+    sha256 = "sha256-5JZgI5lnfX4JlBSEAL7Wv6uao/57GBaMqwgslJt9Bjk=";
+
+    # the repository's .gitattributes file contains the lines "/Tst/
+    # export-ignore" and "/doc/ export-ignore" so some directories are
+    # not included in the tarball downloaded by fetchzip.
+    forceFetchGit = true;
+  };
+
+  configureFlags = [
+    "--with-ntl=${ntl}"
+    "--disable-pyobject-module"
+  ] ++ lib.optionals enableDocs [
+    "--enable-doc-build"
+  ] ++ lib.optionals enableGfanlib [
+    "--enable-gfanlib"
+  ];
+
+  prePatch = ''
+    # don't let the tests depend on `hostname`
+    substituteInPlace Tst/regress.cmd --replace 'mysystem_catch("hostname")' 'nix_test_runner'
+
+    patchShebangs .
+  '';
+
+  # For reference (last checked on commit 75f460d):
+  # https://github.com/Singular/Singular/blob/spielwiese/doc/Building-Singular-from-source.md
+  # https://github.com/Singular/Singular/blob/spielwiese/doc/external-packages-dynamic-modules.md
+  buildInputs = [
+    # necessary
+    gmp
+    # by upstream recommended but optional
+    ncurses
+    readline
+    ntl
+    flint3
+    lrcalc
+    gfan
+  ] ++ lib.optionals enableGfanlib [
+    cddlib
+  ];
+
+  nativeBuildInputs = [
+    bison
+    perl
+    pkg-config
+    autoreconfHook
+    sharutils # needed for regress.cmd install checks
+  ] ++ lib.optionals enableDocs [
+    doxygen
+    graphviz
+    latex2html
+    texinfo4
+    texliveSmall
+  ] ++ lib.optionals stdenv.isDarwin [ getconf ];
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+
+  preAutoreconf = ''
+    find . -type f -readable -writable -exec sed \
+      -e 's@/bin/rm@${coreutils}&@g' \
+      -e 's@/bin/uname@${coreutils}&@g' \
+      -e 's@/usr/bin/file@${file}/bin/file@g' \
+      -i '{}' ';'
+  '';
+
+  hardeningDisable = lib.optional stdenv.isi686 "stackprotector";
+
+  doCheck = true; # very basic checks, does not test any libraries
+
+  installPhase = ''
+    make install
+  '' + lib.optionalString enableDocs ''
+    # Sage uses singular.info, which is not installed by default
+    mkdir -p $out/share/info
+    cp doc/singular.info $out/share/info
+  '' + ''
+    # Make sure patchelf picks up the right libraries
+    rm -rf libpolys factory resources omalloc Singular
+  '';
+
+  # singular tests are a bit complicated, see
+  # https://github.com/Singular/Singular/tree/spielwiese/Tst
+  # https://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=2773
+  testsToRun = [
+    "Old/universal.lst"
+    "Buch/buch.lst"
+    "Plural/short.lst"
+    "Old/factor.tst"
+  ] ++ lib.optionals enableGfanlib [
+    # tests that require gfanlib
+    "Short/ok_s.lst"
+  ];
+
+  # simple test to make sure singular starts and finds its libraries
+  doInstallCheck = true;
+  installCheckPhase = ''
+    # Very basic sanity check to make sure singular starts and finds its libraries.
+    # This is redundant with the below tests. It is only kept because the singular test
+    # runner is a bit complicated. In case we decide to give up those tests in the future,
+    # this will still be useful. It takes barely any time.
+    "$out/bin/Singular" -c 'LIB "freegb.lib"; exit;'
+    if [ $? -ne 0 ]; then
+        echo >&2 "Error loading the freegb library in Singular."
+        exit 1
+    fi
+
+    # Run the test suite
+    cd Tst
+    perl ./regress.cmd \
+      -s "$out/bin/Singular" \
+      ${lib.concatStringsSep " " (map lib.escapeShellArg testsToRun)} \
+      2>"$TMPDIR/out-err.log"
+
+    # unfortunately regress.cmd always returns exit code 0, so check stderr
+    # https://www.singular.uni-kl.de/forum/viewtopic.php?f=10&t=2773
+    if [[ -s "$TMPDIR/out-err.log" ]]; then
+      cat "$TMPDIR/out-err.log"
+      exit 1
+    fi
+
+    echo "Exit status $?"
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A CAS for polynomial computations";
+    maintainers = teams.sage.members;
+    # 32 bit x86 fails with some link error: `undefined reference to `__divmoddi4@GCC_7.0.0'`
+    # https://www.singular.uni-kl.de:8002/trac/ticket/837
+    platforms = subtractLists platforms.i686 platforms.unix;
+    license = licenses.gpl3; # Or GPLv2 at your option - but not GPLv4
+    homepage = "https://www.singular.uni-kl.de";
+    downloadPage = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/";
+    mainProgram = "Singular";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/speedcrunch/default.nix b/nixpkgs/pkgs/applications/science/math/speedcrunch/default.nix
new file mode 100644
index 000000000000..a77474b86ffa
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/speedcrunch/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, mkDerivation, lib, fetchFromBitbucket, cmake, qtbase, qttools }:
+
+mkDerivation rec {
+  pname = "speedcrunch";
+  version = "unstable-2021-10-09";
+
+  src = fetchFromBitbucket {
+    owner = "heldercorreia";
+    repo = pname;
+    rev = "74756f3438149c01e9edc3259b0f411fa319a22f";
+    sha256 = "sha256-XxQv+A5SfYXFIRK7yacxGHHne1Q93pwCGeHhchIKizU=";
+  };
+
+  buildInputs = [ qtbase qttools ];
+
+  nativeBuildInputs = [ cmake ];
+
+  preConfigure = ''
+    cd src
+  '';
+
+  meta = with lib; {
+    homepage    = "http://speedcrunch.org";
+    license     = licenses.gpl2Plus;
+    description = "A fast power user calculator";
+    mainProgram = "speedcrunch";
+    longDescription = ''
+      SpeedCrunch is a fast, high precision and powerful desktop calculator.
+      Among its distinctive features are a scrollable display, up to 50 decimal
+      precisions, unlimited variable storage, intelligent automatic completion
+      full keyboard-friendly and more than 15 built-in math function.
+    '';
+    maintainers = with maintainers; [ gebner j0hax ];
+    inherit (qtbase.meta) platforms;
+    broken = stdenv.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/symmetrica/default.nix b/nixpkgs/pkgs/applications/science/math/symmetrica/default.nix
new file mode 100644
index 000000000000..eea34fb77885
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/symmetrica/default.nix
@@ -0,0 +1,35 @@
+{ stdenv
+, lib
+, fetchFromGitLab
+, autoreconfHook
+}:
+stdenv.mkDerivation rec {
+  pname = "symmetrica";
+  version = "3.0.1";
+
+  # Fork of the original symmetrica, which can be found here
+  # http://www.algorithm.uni-bayreuth.de/en/research/SYMMETRICA/index.html
+  # "This fork was created to modernize the codebase, and to resume making
+  # releases with the fixes that have accrued over the years."
+  # Also see https://trac.sagemath.org/ticket/29061#comment:3.
+  src = fetchFromGitLab {
+    owner = "sagemath";
+    repo = "symmetrica";
+    rev = version;
+    sha256 = "0wfmrzw82f5i91d7rf24mcdqcj2fmgrgy02pw4pliz7ncwaq14w3";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A collection of routines for representation theory and combinatorics";
+    license = licenses.isc;
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+    homepage = "https://gitlab.com/sagemath/symmetrica";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/weka/default.nix b/nixpkgs/pkgs/applications/science/math/weka/default.nix
new file mode 100644
index 000000000000..6f907ba9c0c3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/weka/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, jre, unzip, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "weka";
+  version = "3.9.6";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/weka/${lib.replaceStrings ["."]["-"] "${pname}-${version}"}.zip";
+    sha256 = "sha256-8fVN4MXYqXNEmyVtXh1IrauHTBZWgWG8AvsGI5Y9Aj0=";
+  };
+
+  nativeBuildInputs = [ makeWrapper unzip ];
+
+  # The -Xmx1000M comes suggested from their download page:
+  # https://www.cs.waikato.ac.nz/ml/weka/downloading.html
+  installPhase = ''
+    mkdir -pv $out/share/weka
+    cp -Rv * $out/share/weka
+
+    makeWrapper ${jre}/bin/java $out/bin/weka \
+      --add-flags "-Xmx1000M -jar $out/share/weka/weka.jar"
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.cs.waikato.ac.nz/ml/weka/";
+    description = "Collection of machine learning algorithms for data mining tasks";
+    mainProgram = "weka";
+    sourceProvenance = with sourceTypes; [ binaryBytecode ];
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.mimame ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/wolfram-engine/default.nix b/nixpkgs/pkgs/applications/science/math/wolfram-engine/default.nix
new file mode 100644
index 000000000000..685bc1bff3b1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/wolfram-engine/default.nix
@@ -0,0 +1,155 @@
+{ lib
+, stdenv
+, autoPatchelfHook
+, requireFile
+, callPackage
+, makeWrapper
+, alsa-lib
+, dbus
+, fontconfig
+, freetype
+, gcc
+, glib
+, installShellFiles
+, libssh2
+, ncurses
+, opencv4
+, openssl
+, unixODBC
+, xkeyboard_config
+, xorg
+, zlib
+, libxml2
+, libuuid
+, lang ? "en"
+, libGL
+, libGLU
+, wrapQtAppsHook
+}:
+
+let
+  l10n = import ./l10ns.nix {
+    lib = lib;
+    inherit requireFile lang;
+  };
+  dirName = "WolframEngine";
+in
+stdenv.mkDerivation rec {
+  inherit (l10n) version name src;
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+    installShellFiles
+    wrapQtAppsHook
+  ];
+  dontWrapQtApps = true;
+
+  buildInputs = [
+    alsa-lib
+    dbus
+    fontconfig
+    freetype
+    gcc.cc
+    gcc.libc
+    glib
+    libssh2
+    ncurses
+    opencv4
+    openssl
+    stdenv.cc.cc.lib
+    unixODBC
+    xkeyboard_config
+    libxml2
+    libuuid
+    zlib
+    libGL
+    libGLU
+  ] ++ (with xorg; [
+    libX11
+    libXext
+    libXtst
+    libXi
+    libXmu
+    libXrender
+    libxcb
+    libXcursor
+    libXfixes
+    libXrandr
+    libICE
+    libSM
+  ]);
+
+  # some bundled libs are found through LD_LIBRARY_PATH
+  autoPatchelfIgnoreMissingDeps = true;
+
+  ldpath = lib.makeLibraryPath buildInputs
+    + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux")
+      (":" + lib.makeSearchPathOutput "lib" "lib64" buildInputs);
+
+  unpackPhase = ''
+    # find offset from file
+    offset=$(${stdenv.shell} -c "$(grep -axm1 -e 'offset=.*' $src); echo \$offset" $src)
+    dd if="$src" ibs=$offset skip=1 | tar -xf -
+    cd Unix
+  '';
+
+  installPhase = ''
+    cd Installer
+    sed -i -e 's/^PATH=/# PATH=/' -e 's/=`id -[ug]`/=0/' MathInstaller
+
+    # Installer wants to write default config in HOME
+    export HOME=$(mktemp -d)
+
+    # Fix the installation script
+    patchShebangs MathInstaller
+    substituteInPlace MathInstaller \
+      --replace '`hostname`' "" \
+      --replace "chgrp" "# chgrp" \
+      --replace "chown" ": # chown"
+
+    # Install the desktop items
+    export XDG_DATA_HOME="$out/share"
+
+    ./MathInstaller -auto -createdir=y -execdir=$out/bin -targetdir=$out/libexec/${dirName} -silent
+
+    # Fix library paths
+    cd $out/libexec/${dirName}/Executables
+    for path in MathKernel math mcc wolfram; do
+      makeWrapper $out/libexec/${dirName}/Executables/$path $out/bin/$path --set LD_LIBRARY_PATH "${zlib}/lib:${stdenv.cc.cc.lib}/lib:${libssh2}/lib:\''${LD_LIBRARY_PATH}"
+    done
+
+    for path in WolframKernel wolframscript; do
+      makeWrapper $out/libexec/${dirName}/SystemFiles/Kernel/Binaries/Linux-x86-64/$path $out/bin/$path --set LD_LIBRARY_PATH "${zlib}/lib:${stdenv.cc.cc.lib}/lib:${libssh2}/lib:\''${LD_LIBRARY_PATH}"
+    done
+
+    wrapQtApp "$out/libexec/${dirName}/SystemFiles/FrontEnd/Binaries/Linux-x86-64/WolframPlayer" \
+      --set LD_LIBRARY_PATH "${zlib}/lib:${stdenv.cc.cc.lib}/lib:${libssh2}/lib:\''${LD_LIBRARY_PATH}" \
+      --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb"
+    if ! isELF "$out/libexec/${dirName}/SystemFiles/FrontEnd/Binaries/Linux-x86-64/WolframPlayer"; then
+      substituteInPlace $out/libexec/${dirName}/SystemFiles/FrontEnd/Binaries/Linux-x86-64/WolframPlayer \
+        --replace "TopDirectory=" "TopDirectory=$out/libexec/${dirName} #";
+    fi
+
+    for path in WolframPlayer wolframplayer; do
+      makeWrapper $out/libexec/${dirName}/Executables/$path $out/bin/$path
+    done
+
+    # Install man pages
+    installManPage $out/libexec/${dirName}/SystemFiles/SystemDocumentation/Unix/*
+  '';
+
+  # This is primarily an IO bound build; there's little benefit to building remotely.
+  preferLocalBuild = true;
+
+  # Stripping causes the program to core dump.
+  dontStrip = true;
+
+  meta = with lib; {
+    description = "Wolfram Engine computational software system";
+    homepage = "https://www.wolfram.com/engine/";
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    license = licenses.unfree;
+    maintainers = with maintainers; [ fbeffa ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/wolfram-engine/l10ns.nix b/nixpkgs/pkgs/applications/science/math/wolfram-engine/l10ns.nix
new file mode 100644
index 000000000000..ae1886bae154
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/wolfram-engine/l10ns.nix
@@ -0,0 +1,72 @@
+{ lib
+, requireFile
+, lang
+, majorVersion ? null
+}:
+
+let allVersions = with lib; flip map
+  # N.B. Versions in this list should be ordered from newest to oldest.
+  [
+    {
+      version = "13.3.0";
+      lang = "en";
+      language = "English";
+      sha256 = "96106ac8ed6d0e221a68d846117615c14025320f927e5e0ed95b1965eda68e31";
+      installer = "WolframEngine_13.3.0_LINUX.sh";
+    }
+    {
+      version = "13.2.0";
+      lang = "en";
+      language = "English";
+      sha256 = "1xvg1n64iq52jxnk9y551m5iwkkz6cxzwyw28h8d0kq36aaiky24";
+      installer = "WolframEngine_13.2.0_LINUX.sh";
+    }
+    {
+      version = "13.1.0";
+      lang = "en";
+      language = "English";
+      sha256 = "1659kyp38a8xknic95pynx9fsgn96i8jn9lnk89pc8n6vydw1460";
+      installer = "WolframEngine_13.1.0_LINUX.sh";
+    }
+    {
+      version = "13.0.1";
+      lang = "en";
+      language = "English";
+      sha256 = "1rrxi7d51m02407k719fq829jzanh550wr810i22n3irhk8axqga";
+      installer = "WolframEngine_13.0.1_LINUX.sh";
+    }
+    {
+      version = "13.0.0";
+      lang = "en";
+      language = "English";
+      sha256 = "10cpwllz9plxz22iqdh6xgkxqphl9s9nq8ax16pafjll6j9kqy1q";
+      installer = "WolframEngine_13.0.0_LINUX.sh";
+    }
+  ]
+  ({ version, lang, language, sha256, installer }: {
+    inherit version lang;
+    name = "wolfram-engine-${version}" + optionalString (lang != "en") "-${lang}";
+    src = requireFile {
+      name = installer;
+      message = ''
+        This nix expression requires that ${installer} is
+        already part of the store. Download the file from
+        https://www.wolfram.com/engine/ and add it to the nix store
+        with nix-store --add-fixed sha256 <FILE>.
+      '';
+      inherit sha256;
+    };
+  });
+minVersion =
+  with lib;
+  if majorVersion == null
+  then elemAt (builtins.splitVersion (elemAt allVersions 0).version) 0
+  else majorVersion;
+maxVersion = toString (1 + builtins.fromJSON minVersion);
+in
+with lib;
+findFirst (l: (l.lang == lang
+               && l.version >= minVersion
+               && l.version < maxVersion))
+          (throw "Version ${minVersion} in language ${lang} not supported")
+          allVersions
diff --git a/nixpkgs/pkgs/applications/science/math/wolfram-engine/notebook.nix b/nixpkgs/pkgs/applications/science/math/wolfram-engine/notebook.nix
new file mode 100644
index 000000000000..85570eeca7fb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/wolfram-engine/notebook.nix
@@ -0,0 +1,9 @@
+{ lib, stdenv, writeScriptBin, jupyter, wolfram-for-jupyter-kernel }:
+
+let
+  wolfram-jupyter = jupyter.override { definitions = { wolfram = wolfram-for-jupyter-kernel.definition; }; };
+in
+  writeScriptBin "wolfram-notebook" ''
+    #! ${stdenv.shell}
+    ${wolfram-jupyter}/bin/jupyter-notebook
+  ''
diff --git a/nixpkgs/pkgs/applications/science/math/wxmaxima/default.nix b/nixpkgs/pkgs/applications/science/math/wxmaxima/default.nix
new file mode 100644
index 000000000000..4d2815d12997
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/wxmaxima/default.nix
@@ -0,0 +1,55 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, wrapGAppsHook
+, cmake
+, gettext
+, maxima
+, wxGTK
+, gnome
+, glib
+}:
+
+stdenv.mkDerivation (finalAttrs:{
+  pname = "wxmaxima";
+  version = "24.02.2";
+
+  src = fetchFromGitHub {
+    owner = "wxMaxima-developers";
+    repo = "wxmaxima";
+    rev = "Version-${finalAttrs.version}";
+    hash = "sha256-ewyg+ZhbRbPjJkYTZFuhbOWMDNZGW7ejmSv38zxcTsw=";
+  };
+
+  buildInputs = [
+    wxGTK
+    maxima
+    # So it won't embed svg files into headers.
+    gnome.adwaita-icon-theme
+    # So it won't crash under Sway.
+    glib
+  ];
+
+  nativeBuildInputs = [
+    wrapGAppsHook
+    cmake
+    gettext
+  ];
+
+  cmakeFlags = [
+    "-DwxWidgets_LIBRARIES=${wxGTK}/lib"
+  ];
+
+  preConfigure = ''
+    gappsWrapperArgs+=(--prefix PATH ":" ${maxima}/bin)
+  '';
+
+  meta = with lib; {
+    description = "Cross platform GUI for the computer algebra system Maxima";
+    mainProgram = "wxmaxima";
+    license = licenses.gpl2;
+    homepage = "https://wxmaxima-developers.github.io/wxmaxima/";
+    maintainers = with maintainers; [ doronbehar ];
+    platforms = platforms.linux;
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/math/yacas/default.nix b/nixpkgs/pkgs/applications/science/math/yacas/default.nix
new file mode 100644
index 000000000000..7fa2fe1a6075
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/yacas/default.nix
@@ -0,0 +1,86 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, perl
+, enableGui ? false
+, qtbase
+, wrapQtAppsHook
+, qtwebengine
+, enableJupyter ? true
+, boost
+, jsoncpp
+, openssl
+, zmqpp
+, enableJava ? false
+, openjdk
+, gtest
+}:
+
+stdenv.mkDerivation rec {
+  pname = "yacas";
+  version = "1.9.1";
+
+  src = fetchFromGitHub {
+    owner = "grzegorzmazur";
+    repo = "yacas";
+    rev = "v${version}";
+    sha256 = "0dqgqvsb6ggr8jb3ngf0jwfkn6xwj2knhmvqyzx3amc74yd3ckqx";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  cmakeFlags = [
+    "-DENABLE_CYACAS_GUI=${if enableGui then "ON" else "OFF"}"
+    "-DENABLE_CYACAS_KERNEL=${if enableJupyter then "ON" else "OFF"}"
+    "-DENABLE_JYACAS=${if enableJava then "ON" else "OFF"}"
+    "-DENABLE_CYACAS_UNIT_TESTS=ON"
+  ];
+  patches = [
+    # upstream issue: https://github.com/grzegorzmazur/yacas/issues/340
+    # Upstream patch which doesn't apply on 1.9.1 is:
+    # https://github.com/grzegorzmazur/yacas/pull/342
+    ./jsoncpp-fix-include.patch
+    # Fixes testing - https://github.com/grzegorzmazur/yacas/issues/339
+    # PR: https://github.com/grzegorzmazur/yacas/pull/343
+    (fetchpatch {
+      url = "https://github.com/grzegorzmazur/yacas/commit/8bc22d517ecfdde3ac94800dc8506f5405564d48.patch";
+      sha256 = "sha256-aPO5T8iYNkGtF8j12YxNJyUPJJPKrXje1DmfCPt317A=";
+    })
+  ];
+  preCheck = ''
+    patchShebangs ../tests/test-yacas
+  '';
+  nativeCheckInputs = [
+    gtest
+  ];
+  doCheck = true;
+
+  nativeBuildInputs = [
+    cmake
+    # Perl is only for the documentation
+    perl
+  ] ++ lib.optionals enableJava [
+    openjdk
+  ];
+  buildInputs = [
+  ] ++ lib.optionals enableGui [
+    qtbase
+    wrapQtAppsHook
+    qtwebengine
+  ] ++ lib.optionals enableJupyter [
+    boost
+    jsoncpp
+    openssl
+    zmqpp
+  ];
+
+  meta = {
+    description = "Easy to use, general purpose Computer Algebra System${lib.optionalString enableGui ", built with GUI."}";
+    homepage = "http://www.yacas.org/";
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [ viric ];
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/math/yacas/jsoncpp-fix-include.patch b/nixpkgs/pkgs/applications/science/math/yacas/jsoncpp-fix-include.patch
new file mode 100644
index 000000000000..8fe914e55be3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/yacas/jsoncpp-fix-include.patch
@@ -0,0 +1,63 @@
+diff --git i/cyacas/yacas-kernel/CMakeLists.txt w/cyacas/yacas-kernel/CMakeLists.txt
+index fe1600aa..dcc329f8 100644
+--- i/cyacas/yacas-kernel/CMakeLists.txt
++++ w/cyacas/yacas-kernel/CMakeLists.txt
+@@ -22,8 +22,9 @@ find_library (ZEROMQ_LIBRARY NAMES zmq)
+ find_path (ZMQPP_INCLUDE_DIR zmqpp.hpp)
+ find_library (ZMQPP_LIBRARY NAMES zmqpp)
+ 
+-find_path (JSONCPP_INCLUDE_DIR json.h)
+-find_library (JSONCPP_LIBRARY NAMES jsoncpp)
++# https://github.com/open-source-parsers/jsoncpp/wiki/Building#another-approach-for-cmake
++find_package(jsoncpp REQUIRED)
++get_target_property(JSON_INC_PATH jsoncpp_lib INTERFACE_INCLUDE_DIRECTORIES)
+ 
+ find_package (OpenSSL)
+ find_package (Boost REQUIRED date_time filesystem)
+@@ -31,6 +32,6 @@ find_package (Boost REQUIRED date_time filesystem)
+ include_directories (include)
+ 
+ add_executable (yacas-kernel src/main.cpp src/yacas_kernel.cpp src/yacas_engine.cpp src/hmac_sha256.cpp src/base64.cpp)
+-target_link_libraries (yacas-kernel libyacas ${ZMQPP_LIBRARY} ${ZEROMQ_LIBRARY} ${JSONCPP_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} ${Boost_LIBRARIES} pthread ${CMAKE_DL_LIBS})
++target_link_libraries (yacas-kernel libyacas ${ZMQPP_LIBRARY} ${ZEROMQ_LIBRARY} jsoncpp_lib ${OPENSSL_CRYPTO_LIBRARY} ${Boost_LIBRARIES} pthread ${CMAKE_DL_LIBS})
+ 
+ install (TARGETS yacas-kernel DESTINATION ${CMAKE_INSTALL_BINDIR})
+diff --git i/cyacas/yacas-kernel/include/yacas_kernel.hpp w/cyacas/yacas-kernel/include/yacas_kernel.hpp
+index 91d36ac0..d12f905c 100644
+--- i/cyacas/yacas-kernel/include/yacas_kernel.hpp
++++ w/cyacas/yacas-kernel/include/yacas_kernel.hpp
+@@ -29,7 +29,7 @@
+ #include "yacas_engine.hpp"
+ 
+ #include <boost/uuid/random_generator.hpp>
+-#include <jsoncpp/json/json.h>
++#include <json/json.h>
+ #include <zmqpp/zmqpp.hpp>
+ 
+ #include <map>
+diff --git i/cyacas/yacas-kernel/src/main.cpp w/cyacas/yacas-kernel/src/main.cpp
+index c31f17f2..832e9128 100644
+--- i/cyacas/yacas-kernel/src/main.cpp
++++ w/cyacas/yacas-kernel/src/main.cpp
+@@ -24,7 +24,7 @@
+ 
+ #include "yacas_kernel.hpp"
+ 
+-#include <jsoncpp/json/json.h>
++#include <json/json.h>
+ 
+ #include <boost/dll/runtime_symbol_info.hpp>
+ 
+diff --git i/cyacas/yacas-kernel/src/yacas_engine.cpp w/cyacas/yacas-kernel/src/yacas_engine.cpp
+index 6ed60ca3..18e9b3fd 100644
+--- i/cyacas/yacas-kernel/src/yacas_engine.cpp
++++ w/cyacas/yacas-kernel/src/yacas_engine.cpp
+@@ -22,7 +22,7 @@
+  * Created on November 7, 2015, 12:52 PM
+  */
+ 
+-#include <jsoncpp/json/writer.h>
++#include <json/writer.h>
+ 
+ #include "yacas_engine.hpp"
+ 
diff --git a/nixpkgs/pkgs/applications/science/math/zegrapher/default.nix b/nixpkgs/pkgs/applications/science/math/zegrapher/default.nix
new file mode 100644
index 000000000000..2beaf5757a55
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/zegrapher/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv
+, fetchFromGitHub
+, qmake
+, wrapQtAppsHook
+, boost }:
+
+stdenv.mkDerivation rec {
+  pname = "zegrapher";
+  version = "3.1.1";
+
+  src = fetchFromGitHub {
+    owner = "AdelKS";
+    repo = "ZeGrapher";
+    rev = "v${version}";
+    sha256 = "sha256-OSQXm0gDI1zM2MBM4iiY43dthJcAZJkprklolsNMEvk=";
+  };
+
+  nativeBuildInputs = [
+    qmake
+    wrapQtAppsHook
+  ];
+  buildInputs = [
+    boost
+  ];
+
+  meta = with lib; {
+    homepage = "https://zegrapher.com/";
+    description = "An open source math plotter";
+    mainProgram = "ZeGrapher";
+    longDescription = ''
+      An open source, free and easy to use math plotter. It can plot functions,
+      sequences, parametric equations and data on the plane.
+    '';
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ AndersonTorres ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/medicine/dcmtk/default.nix b/nixpkgs/pkgs/applications/science/medicine/dcmtk/default.nix
new file mode 100644
index 000000000000..812606f9f03f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/medicine/dcmtk/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, zlib, libtiff, libxml2, openssl, libiconv
+, libpng, cmake, fetchpatch }:
+
+with lib;
+stdenv.mkDerivation rec {
+  pname = "dcmtk";
+  version = "3.6.8";
+  src = fetchFromGitHub {
+    owner = "DCMTK";
+    repo = pname;
+    rev = "DCMTK-${version}";
+    hash = "sha256-PQR9+xSlfBvogv0p6AL/yapelJpsYteA4T4lPkOIfLc=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libpng zlib libtiff libxml2 openssl libiconv ];
+
+  doCheck = true;
+
+  meta = {
+    description =
+      "Collection of libraries and applications implementing large parts of the DICOM standard";
+    longDescription = ''
+      DCMTK is a collection of libraries and applications implementing large parts of the DICOM standard.
+      It includes software for examining, constructing and converting DICOM image files, handling offline media,
+      sending and receiving images over a network connection, as well as demonstrative image storage and worklist servers.
+      DCMTK is is written in a mixture of ANSI C and C++.
+      It comes in complete source code and is made available as "open source" software.
+    '';
+    homepage = "https://dicom.offis.de/dcmtk";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ iimog ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/medicine/xmedcon/default.nix b/nixpkgs/pkgs/applications/science/medicine/xmedcon/default.nix
new file mode 100644
index 000000000000..b09183f71b96
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/medicine/xmedcon/default.nix
@@ -0,0 +1,37 @@
+{ stdenv
+, lib
+, fetchurl
+, gtk3
+, glib
+, pkg-config
+, libpng
+, zlib
+, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "xmedcon";
+  version = "0.23.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-g1CRJDokLDzB+1YIuVQNByBLx01CI47EwGeluqVDujk=";
+  };
+
+  buildInputs = [
+    gtk3
+    glib
+    libpng
+    zlib
+  ];
+
+  nativeBuildInputs = [ pkg-config wrapGAppsHook ];
+
+  meta = with lib; {
+    description = "An open source toolkit for medical image conversion ";
+    homepage = "https://xmedcon.sourceforge.net/";
+    license = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ arianvp flokli ];
+    platforms = platforms.darwin ++ platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/bada-bib/default.nix b/nixpkgs/pkgs/applications/science/misc/bada-bib/default.nix
new file mode 100644
index 000000000000..189531532574
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/bada-bib/default.nix
@@ -0,0 +1,82 @@
+{ lib
+, meson
+, ninja
+, fetchFromGitHub
+, appstream-glib
+, desktop-file-utils
+, gdk-pixbuf
+, gettext
+, glib
+, gnome
+, gobject-introspection
+, gtk4
+, gtksourceview5
+, libadwaita
+, libxml2
+, pkg-config
+, python3Packages
+, wrapGAppsHook4
+}:
+
+python3Packages.buildPythonApplication rec {
+  pname = "bada-bib";
+  version = "0.8.1";
+  format = "other";
+
+  src = fetchFromGitHub {
+    owner = "RogerCrocker";
+    repo = "BadaBib";
+    rev = "refs/tags/v${version}";
+    sha256 = "sha256-8lpkmQCVh94+qhFJijAIVyYeJRFz2u/OYR1C5E+gtOE=";
+  };
+
+  nativeBuildInputs = [
+    gettext
+    gobject-introspection
+    libxml2
+    meson
+    ninja
+    pkg-config
+    wrapGAppsHook4
+  ];
+
+  buildInputs = [
+    gdk-pixbuf
+    glib
+    gtk4
+    gtksourceview5
+    libadwaita
+  ];
+
+  nativeCheckInputs = [
+    appstream-glib
+    desktop-file-utils
+  ];
+
+  pythonPath = with python3Packages; [
+    bibtexparser
+    pygobject3
+  ];
+
+  postPatch = ''
+    patchShebangs build-aux/meson/postinstall.py
+  '';
+
+  dontWrapGApps = true; # Needs python wrapper
+
+  preFixup = ''
+    makeWrapperArgs+=("''${gappsWrapperArgs[@]}")
+  '';
+
+  postFixup = ''
+    wrapPythonProgramsIn "$out/libexec" "$out $pythonPath"
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/RogerCrocker/BadaBib";
+    description = "A simple BibTeX Viewer and Editor";
+    mainProgram = "badabib";
+    maintainers = [ maintainers.Cogitri ];
+    license = licenses.gpl3Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/boinc/default.nix b/nixpkgs/pkgs/applications/science/misc/boinc/default.nix
new file mode 100644
index 000000000000..b2a76f5fb252
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/boinc/default.nix
@@ -0,0 +1,84 @@
+{ fetchFromGitHub
+, lib
+, stdenv
+, autoconf
+, automake
+, pkg-config
+, m4
+, curl
+, libGLU
+, libGL
+, libXmu
+, libXi
+, freeglut
+, libjpeg
+, libtool
+, wxGTK32
+, xcbutil
+, sqlite
+, gtk3
+, patchelf
+, libXScrnSaver
+, libnotify
+, libX11
+, libxcb
+, headless ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "boinc";
+  version = "7.24.3";
+
+  src = fetchFromGitHub {
+    name = "${pname}-${version}-src";
+    owner = "BOINC";
+    repo = "boinc";
+    rev = "client_release/${lib.versions.majorMinor version}/${version}";
+    hash = "sha256-0gyCO5t8t0SbOCBClVVu+C2VpBlxsnoRHBRYgI8nNO4=";
+  };
+
+  nativeBuildInputs = [ libtool automake autoconf m4 pkg-config ];
+
+  buildInputs = [
+    curl
+    sqlite
+    patchelf
+  ] ++ lib.optionals (!headless) [
+    libGLU
+    libGL
+    libXmu
+    libXi
+    freeglut
+    libjpeg
+    wxGTK32
+    gtk3
+    libXScrnSaver
+    libnotify
+    libX11
+    libxcb
+    xcbutil
+  ];
+
+  NIX_LDFLAGS = lib.optionalString (!headless) "-lX11";
+
+  preConfigure = ''
+    ./_autosetup
+    configureFlags="$configureFlags --sysconfdir=$out/etc"
+  '';
+
+  enableParallelBuilding = true;
+
+  configureFlags = [ "--disable-server" ] ++ lib.optionals headless [ "--disable-manager" ];
+
+  postInstall = ''
+    install --mode=444 -D 'client/scripts/boinc-client.service' "$out/etc/systemd/system/boinc.service"
+  '';
+
+  meta = with lib; {
+    description = "Free software for distributed and grid computing";
+    homepage = "https://boinc.berkeley.edu/";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ Luflosi ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/colmap/default.nix b/nixpkgs/pkgs/applications/science/misc/colmap/default.nix
new file mode 100644
index 000000000000..64a7952be4cc
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/colmap/default.nix
@@ -0,0 +1,54 @@
+{ mkDerivation, lib, fetchFromGitHub, cmake, boost179, ceres-solver, eigen,
+  freeimage, glog, libGLU, glew, qtbase,
+  config,
+  cudaSupport ? config.cudaSupport, cudaPackages }:
+
+assert cudaSupport -> cudaPackages != { };
+
+let
+  boost_static = boost179.override { enableStatic = true; };
+
+  # TODO: migrate to redist packages
+  inherit (cudaPackages) cudatoolkit;
+in
+mkDerivation rec {
+  version = "3.7";
+  pname = "colmap";
+  src = fetchFromGitHub {
+     owner = "colmap";
+     repo = "colmap";
+     rev = version;
+     hash = "sha256-uVAw6qwhpgIpHkXgxttKupU9zU+vD0Za0maw2Iv4x+I=";
+  };
+
+  # TODO: rm once the gcc11 issue is closed, https://github.com/colmap/colmap/issues/1418#issuecomment-1049305256
+  cmakeFlags = lib.optionals cudaSupport [
+    "-DCUDA_ENABLED=ON"
+    "-DCUDA_NVCC_FLAGS=--std=c++14"
+  ];
+
+  buildInputs = [
+    boost_static ceres-solver eigen
+    freeimage glog libGLU glew qtbase
+  ] ++ lib.optionals cudaSupport [
+    cudatoolkit
+  ];
+
+  nativeBuildInputs = [
+    cmake
+  ] ++ lib.optionals cudaSupport [
+    cudaPackages.autoAddDriverRunpath
+  ];
+
+  meta = with lib; {
+    description = "COLMAP - Structure-From-Motion and Multi-View Stereo pipeline";
+    longDescription = ''
+       COLMAP is a general-purpose Structure-from-Motion (SfM) and Multi-View Stereo (MVS) pipeline
+       with a graphical and command-line interface.
+    '';
+    homepage = "https://colmap.github.io/index.html";
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ lebastr ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/convertall/default.nix b/nixpkgs/pkgs/applications/science/misc/convertall/default.nix
new file mode 100644
index 000000000000..534562b028d8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/convertall/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, python3, wrapQtAppsHook }:
+
+let
+  inherit (python3.pkgs) wrapPython pyqt5;
+in stdenv.mkDerivation rec {
+  pname = "convertall";
+  version = "0.8.0";
+
+  src = fetchFromGitHub {
+    owner = "doug-101";
+    repo = "ConvertAll";
+    rev = "v${version}";
+    sha256 = "02xxasgbjbivsbhyfpn3cpv52lscdx5kc95s6ns1dvnmdg0fpng0";
+  };
+
+  nativeBuildInputs = [ python3 wrapPython wrapQtAppsHook ];
+
+  propagatedBuildInputs = [ pyqt5 ];
+
+  installPhase = ''
+    python3 install.py -p $out -x
+  '';
+
+  postFixup = ''
+    buildPythonPath $out
+    patchPythonScript $out/share/convertall/convertall.py
+    makeQtWrapper $out/share/convertall/convertall.py $out/bin/convertall
+  '';
+
+  meta = with lib; {
+    homepage = "https://convertall.bellz.org/";
+    description = "Graphical unit converter";
+    mainProgram = "convertall";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ orivej ];
+    platforms = pyqt5.meta.platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/cwltool/default.nix b/nixpkgs/pkgs/applications/science/misc/cwltool/default.nix
new file mode 100644
index 000000000000..9b4c711aba8f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/cwltool/default.nix
@@ -0,0 +1,93 @@
+{ lib
+, fetchFromGitHub
+, git
+, nodejs
+, python3
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "cwltool";
+  version = "3.1.20240112164112";
+  pyproject = true;
+
+  src = fetchFromGitHub {
+    owner = "common-workflow-language";
+    repo = "cwltool";
+    rev = "refs/tags/${version}";
+    hash = "sha256-Y0DORypXlTDv04qh796oXPSTxCXGb7rLQ8Su+/As7Lo=";
+  };
+
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace "ruamel.yaml >= 0.16, < 0.19" "ruamel.yaml" \
+      --replace "prov == 1.5.1" "prov" \
+      --replace '"schema-salad >= 8.4.20230426093816, < 9",' "" \
+      --replace "PYTEST_RUNNER + " ""
+    substituteInPlace pyproject.toml \
+      --replace "mypy==1.8.0" "mypy" \
+      --replace "ruamel.yaml>=0.16.0,<0.18" "ruamel.yaml"
+  '';
+
+  nativeBuildInputs = [
+    git
+  ] ++ (with python3.pkgs; [
+    setuptools
+    setuptools-scm
+  ]);
+
+  propagatedBuildInputs = with python3.pkgs; [
+    argcomplete
+    bagit
+    coloredlogs
+    cwl-utils
+    mypy
+    mypy-extensions
+    prov
+    psutil
+    pydot
+    rdflib
+    requests
+    ruamel-yaml
+    schema-salad
+    shellescape
+    spython
+    toml
+    types-psutil
+    types-requests
+    typing-extensions
+  ];
+
+  nativeCheckInputs = with python3.pkgs; [
+    mock
+    nodejs
+    pytest-mock
+    pytest-httpserver
+    pytest-xdist
+    pytestCheckHook
+  ];
+
+  disabledTests = [
+    "test_content_types"
+    "test_env_filtering"
+    "test_http_path_mapping"
+    "test_modification_date"
+  ];
+
+  disabledTestPaths = [
+    "tests/test_udocker.py"
+    "tests/test_provenance.py"
+  ];
+
+  pythonImportsCheck = [
+    "cwltool"
+  ];
+
+  meta = with lib; {
+    description = "Common Workflow Language reference implementation";
+    mainProgram = "cwltool";
+    homepage = "https://www.commonwl.org";
+    changelog = "https://github.com/common-workflow-language/cwltool/releases/tag/${version}";
+    license = with licenses; [ asl20 ];
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/cytoscape/default.nix b/nixpkgs/pkgs/applications/science/misc/cytoscape/default.nix
new file mode 100644
index 000000000000..f4aaac1a3823
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/cytoscape/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchurl, jre, makeWrapper, substituteAll, coreutils }:
+
+stdenv.mkDerivation rec {
+  pname = "cytoscape";
+  version = "3.10.1";
+
+  src = fetchurl {
+    url = "https://github.com/cytoscape/cytoscape/releases/download/${version}/${pname}-unix-${version}.tar.gz";
+    sha256 = "sha256-fqxAsnpMYCYj0hW2oxu/NH4PqesRlWPs5eDSeSjy1aU=";
+  };
+
+  patches = [
+    # By default, gen_vmoptions.sh tries to store custom options in $out/share
+    # at run time. This patch makes sure $HOME is used instead.
+    (substituteAll {
+      src = ./gen_vmoptions_to_homedir.patch;
+      inherit coreutils;
+    })
+  ];
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ jre ];
+
+  installPhase = ''
+    mkdir -pv $out/{share,bin}
+    cp -Rv * $out/share/
+
+    ln -s $out/share/cytoscape.sh $out/bin/cytoscape
+
+    wrapProgram $out/share/cytoscape.sh \
+      --set JAVA_HOME "${jre}" \
+      --set JAVA  "${jre}/bin/java"
+
+    chmod +x $out/bin/cytoscape
+  '';
+
+  meta = {
+    homepage = "http://www.cytoscape.org";
+    description = "A general platform for complex network analysis and visualization";
+    mainProgram = "cytoscape";
+    license = lib.licenses.lgpl21;
+    maintainers = [lib.maintainers.mimame];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/cytoscape/gen_vmoptions_to_homedir.patch b/nixpkgs/pkgs/applications/science/misc/cytoscape/gen_vmoptions_to_homedir.patch
new file mode 100644
index 000000000000..e31681e8541f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/cytoscape/gen_vmoptions_to_homedir.patch
@@ -0,0 +1,19 @@
+diff -Nur a/gen_vmoptions.sh b/gen_vmoptions.sh
+--- a/gen_vmoptions.sh	2020-03-30 21:57:47.000000000 +0100
++++ b/gen_vmoptions.sh	2020-05-05 09:49:57.974989824 +0100
+@@ -1,13 +1,10 @@
+ #!/bin/sh
+ # Generates the Cytoscape.vmoptions file
+ 
+-script_path="$(dirname -- $0)"
+-
+-#vm_options_path="$HOME/.cytoscape"
+-vm_options_path=$script_path
++vm_options_path="$HOME/.cytoscape"
+ 
+ if [ ! -e $vm_options_path ]; then
+-    /bin/mkdir $vm_options_path
++    @coreutils@/bin/mkdir $vm_options_path
+ fi
+ 
+ # Determine amount of physical memory present:
diff --git a/nixpkgs/pkgs/applications/science/misc/fityk/default.nix b/nixpkgs/pkgs/applications/science/misc/fityk/default.nix
new file mode 100644
index 000000000000..5ec7973065d2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/fityk/default.nix
@@ -0,0 +1,50 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, wxGTK32
+, boost
+, lua
+, zlib
+, bzip2
+, xylib
+, readline
+, gnuplot
+, swig3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fityk";
+  version = "1.3.2";
+
+  src = fetchFromGitHub {
+    owner = "wojdyr";
+    repo = "fityk";
+    rev = "v${version}";
+    sha256 = "sha256-m2RaZMYT6JGwa3sOUVsBIzCdZetTbiygaInQWoJ4m1o=";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [
+    wxGTK32
+    boost
+    lua
+    zlib
+    bzip2
+    xylib
+    readline
+    gnuplot
+    swig3
+  ];
+
+  env.NIX_CFLAGS_COMPILE = toString [
+    "-std=c++11"
+  ];
+
+  meta = {
+    description = "Curve fitting and peak fitting software";
+    license = lib.licenses.gpl2;
+    homepage = "https://fityk.nieto.pl/";
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/foldingathome/client.nix b/nixpkgs/pkgs/applications/science/misc/foldingathome/client.nix
new file mode 100644
index 000000000000..6ff159cc54cb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/foldingathome/client.nix
@@ -0,0 +1,87 @@
+{ lib
+, buildFHSEnv
+, fetchFromGitHub
+, ocl-icd
+, openssl
+, re2
+, libevent
+, git
+, zlib
+, expat
+, scons
+, stdenv
+, extraPkgs ? [ ]
+}:
+let
+  version = "8.3.7";
+
+  cbangSrc = fetchFromGitHub {
+    owner = "cauldrondevelopmentllc";
+    repo = "cbang";
+    rev = "bastet-v${version}";
+    sha256 = "sha256-acAImItdkgo6PBFL6Vu/caIdcnvp/3VEW2lgVDgKy9g=";
+  };
+
+  fah-client = stdenv.mkDerivation {
+    pname = "fah-client";
+    inherit version;
+
+    src = fetchFromGitHub {
+      owner = "FoldingAtHome";
+      repo = "fah-client-bastet";
+      rev = "v${version}";
+      sha256 = "sha256-d+LY/R4TAko+2e2W76KEBQ8fXj0hzzmBOm+c4tksXMA=";
+    };
+
+    nativeBuildInputs = [ scons re2 libevent git ];
+
+    buildInputs = [ openssl ];
+
+    postUnpack = ''
+      export CBANG_HOME=$NIX_BUILD_TOP/cbang
+
+      cp -r --no-preserve=mode ${cbangSrc} $CBANG_HOME
+    '';
+
+    preBuild = ''
+      scons -C $CBANG_HOME
+    '';
+
+    installPhase = ''
+      runHook preInstall
+
+      mkdir -p $out/{bin,share/applications}
+
+      cp fah-client $out/bin/fah-client
+
+      cp install/lin/fah-client.desktop.in $out/share/applications/fah-client.desktop
+      sed \
+        -e "s|Icon=.*|Icon=$out/share/feh-client/images/fahlogo.png|g" \
+        -e "s|%(PACKAGE_URL)s|https://github.com/FoldingAtHome/fah-client-bastet|g" \
+        -i $out/share/applications/fah-client.desktop
+
+      runHook postInstall
+    '';
+
+  };
+in
+buildFHSEnv {
+  name = fah-client.name;
+
+  targetPkgs = _: [ fah-client ocl-icd zlib expat ] ++ extraPkgs;
+
+  runScript = "/bin/fah-client";
+
+  extraInstallCommands = ''
+    mv $out/bin/$name $out/bin/fah-client
+  '';
+
+  meta = {
+    description = "Folding@home client";
+    homepage = "https://foldingathome.org/";
+    license = lib.licenses.gpl3;
+    mainProgram = "fah-client";
+    maintainers = [ lib.maintainers.zimbatm ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/foldingathome/control.nix b/nixpkgs/pkgs/applications/science/misc/foldingathome/control.nix
new file mode 100644
index 000000000000..a64c973914c6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/foldingathome/control.nix
@@ -0,0 +1,57 @@
+{ lib, stdenv
+, dpkg
+, fahviewer
+, fetchurl
+, makeWrapper
+, python2
+}:
+let
+  majMin = lib.versions.majorMinor version;
+  version = "7.6.21";
+
+  python = python2.withPackages
+    (
+      ps: [
+        ps.pycairo
+        ps.pygobject2
+        ps.pygtk
+      ]
+    );
+in
+stdenv.mkDerivation rec {
+  inherit version;
+  pname = "fahcontrol";
+
+  src = fetchurl {
+    url = "https://download.foldingathome.org/releases/public/release/fahcontrol/debian-stable-64bit/v${majMin}/fahcontrol_${version}-1_all.deb";
+    sha256 = "1vfrdqkrvdlyxaw3f6z92w5dllrv6810lmf8yhcmjcwmphipvf71";
+  };
+
+  nativeBuildInputs = [
+    dpkg
+    makeWrapper
+  ];
+
+  buildInputs = [ fahviewer python ];
+
+  unpackPhase = ''
+    dpkg-deb -x ${src} ./
+  '';
+
+  installPhase = "cp -ar usr $out";
+
+  postFixup = ''
+    sed -e "s|/usr/bin|$out/bin|g" -i $out/share/applications/FAHControl.desktop
+    wrapProgram "$out/bin/FAHControl" \
+      --suffix PATH : "${fahviewer.outPath}/bin" \
+      --set PYTHONPATH "$out/lib/python2.7/dist-packages"
+  '';
+
+  meta = {
+    description = "Folding@home control";
+    homepage = "https://foldingathome.org/";
+    license = lib.licenses.unfree;
+    maintainers = [ lib.maintainers.zimbatm ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/foldingathome/viewer.nix b/nixpkgs/pkgs/applications/science/misc/foldingathome/viewer.nix
new file mode 100644
index 000000000000..7f28c8d1b146
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/foldingathome/viewer.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv
+, autoPatchelfHook
+, dpkg
+, fetchurl
+, freeglut
+, gcc-unwrapped
+, libGL
+, libGLU
+, makeWrapper
+, zlib
+}:
+let
+  majMin = lib.versions.majorMinor version;
+  version = "7.6.21";
+in
+stdenv.mkDerivation rec {
+  inherit version;
+  pname = "fahviewer";
+
+  src = fetchurl {
+    url = "https://download.foldingathome.org/releases/public/release/fahviewer/debian-stable-64bit/v${majMin}/fahviewer_${version}_amd64.deb";
+    sha256 = "00fd00pf6fcpplcaahvy9ir60mk69d9rcmwsyq3jrv9mxqm9aq7p";
+  };
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+    dpkg
+    makeWrapper
+  ];
+
+  buildInputs = [
+    freeglut
+    gcc-unwrapped.lib
+    libGL
+    libGLU
+    zlib
+  ];
+
+  unpackPhase = ''
+    dpkg-deb -x ${src} ./
+    sed -e "s|/usr/bin|$out/bin|g" -i usr/share/applications/FAHViewer.desktop
+  '';
+
+  installPhase = ''
+    cp -ar usr $out
+  '';
+
+  meta = {
+    description = "Folding@home viewer";
+    homepage = "https://foldingathome.org/";
+    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
+    license = lib.licenses.unfree;
+    maintainers = [ lib.maintainers.zimbatm ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/gephi/default.nix b/nixpkgs/pkgs/applications/science/misc/gephi/default.nix
new file mode 100644
index 000000000000..ab8134daf3ae
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/gephi/default.nix
@@ -0,0 +1,49 @@
+{ lib, fetchFromGitHub, jdk11, maven, jogl }:
+
+let
+  mavenJdk11 = maven.override {
+    jdk = jdk11;
+  };
+in
+mavenJdk11.buildMavenPackage rec {
+  pname = "gephi";
+  version = "0.10.1";
+
+  src = fetchFromGitHub {
+    owner = "gephi";
+    repo = "gephi";
+    rev = "v${version}";
+    hash = "sha256-ZNSEaiD32zFfF2ISKa1CmcT9Nq6r5i2rNHooQAcVbn4=";
+  };
+
+  mvnHash = "sha256-/2/Yb26Ry0NHQQ3j0LXnjwC0wQqJiztvTgWixyMJqvg=";
+
+  nativeBuildInputs = [ jdk11 ];
+
+  installPhase = ''
+    cp -r modules/application/target/gephi $out
+
+    # remove garbage
+    find $out -type f -name  .lastModified -delete
+    find $out -type f -regex '.+\.exe'     -delete
+
+    # use self-compiled JOGL to avoid patchelf'ing .so inside jars
+    rm $out/gephi/modules/ext/org.gephi.visualization/org-jogamp-{jogl,gluegen}/*.jar
+    cp ${jogl}/share/java/jogl*.jar $out/gephi/modules/ext/org.gephi.visualization/org-jogamp-jogl/
+    cp ${jogl}/share/java/glue*.jar $out/gephi/modules/ext/org.gephi.visualization/org-jogamp-gluegen/
+
+    printf "\n\njdkhome=${jdk11}\n" >> $out/etc/gephi.conf
+  '';
+
+  meta = with lib; {
+    description = "A platform for visualizing and manipulating large graphs";
+    mainProgram = "gephi";
+    homepage = "https://gephi.org";
+    sourceProvenance = with sourceTypes; [
+      fromSource
+      binaryBytecode  # deps
+    ];
+    license = licenses.gpl3;
+    maintainers = [ maintainers.taeer ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/golly/default.nix b/nixpkgs/pkgs/applications/science/misc/golly/default.nix
new file mode 100644
index 000000000000..52b05cbb7e9b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/golly/default.nix
@@ -0,0 +1,52 @@
+{lib, stdenv, fetchurl, wxGTK, perl, python3, zlib, libGLU, libGL, libX11, SDL2}:
+stdenv.mkDerivation rec {
+  pname = "golly";
+  version = "4.2";
+
+  src = fetchurl {
+    hash = "sha256-VpEoqSPaZMP/AGIYZAbk5R/f8Crqvx8pKYN1O9Bl6V0=";
+    url="mirror://sourceforge/project/golly/golly/golly-${version}/golly-${version}-src.tar.gz";
+  };
+
+  buildInputs = [
+    wxGTK perl python3 zlib libGLU libGL libX11 SDL2
+  ];
+
+  setSourceRoot = ''
+    sourceRoot=$(echo */gui-wx)
+  '';
+
+  postPatch = ''
+    sed -e 's@PYTHON_SHLIB@${python3}/lib/libpython3.so@' -i wxprefs.cpp
+    sed -e 's@PERL_SHLIB@'"$(find "${perl}/lib/" -name libperl.so)"'@' -i wxprefs.cpp
+    ! grep _SHLIB *.cpp
+
+    grep /lib/libpython wxprefs.cpp
+    grep /libperl wxprefs.cpp
+  '';
+
+  makeFlags=[
+    "-f" "makefile-gtk"
+    "ENABLE_SOUND=1" "ENABLE_PERL=1"
+    "GOLLYDIR=${placeholder "out"}/share/golly"
+  ];
+
+  installPhase = ''
+    mkdir -p "$out/bin"
+    cp ../golly ../bgolly "$out/bin"
+
+    mkdir -p "$out/share/doc/golly/"
+    cp ../docs/*  "$out/share/doc/golly/"
+
+    mkdir -p "$out/share/golly"
+    cp -r ../{Help,Patterns,Scripts,Rules} "$out/share/golly"
+  '';
+
+  meta = {
+    description = "Cellular automata simulation program";
+    license = lib.licenses.gpl2;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
+    downloadPage = "https://sourceforge.net/projects/golly/files/golly";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/gplates/boost-placeholders.patch b/nixpkgs/pkgs/applications/science/misc/gplates/boost-placeholders.patch
new file mode 100644
index 000000000000..7166b92f646a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/gplates/boost-placeholders.patch
@@ -0,0 +1,75 @@
+diff --unified --recursive a/src/gui/TopologyTools.cc b/src/gui/TopologyTools.cc
+--- a/src/gui/TopologyTools.cc	2021-07-05 05:11:47.000000000 +0200
++++ b/src/gui/TopologyTools.cc	2022-12-07 22:35:20.444054124 +0100
+@@ -3448,7 +3448,7 @@
+ 			std::find_if(
+ 					d_visible_boundary_section_seq.begin(),
+ 					d_visible_boundary_section_seq.end(),
+-					boost::bind(&VisibleSection::d_section_info_index, _1) ==
++					boost::bind(&VisibleSection::d_section_info_index, boost::placeholders::_1) ==
+ 						boost::cref(section_index));
+ 
+ 	if (visible_section_iter == d_visible_boundary_section_seq.end())
+@@ -3467,7 +3467,7 @@
+ 			std::find_if(
+ 					d_visible_interior_section_seq.begin(),
+ 					d_visible_interior_section_seq.end(),
+-					boost::bind(&VisibleSection::d_section_info_index, _1) ==
++					boost::bind(&VisibleSection::d_section_info_index, boost::placeholders::_1) ==
+ 						boost::cref(section_index));
+ 
+ 	if (visible_section_iter == d_visible_interior_section_seq.end())
+diff --unified --recursive a/src/presentation/ReconstructionGeometryRenderer.cc b/src/presentation/ReconstructionGeometryRenderer.cc
+--- a/src/presentation/ReconstructionGeometryRenderer.cc	2021-07-05 05:11:50.000000000 +0200
++++ b/src/presentation/ReconstructionGeometryRenderer.cc	2022-12-07 22:36:11.117884262 +0100
+@@ -274,7 +274,7 @@
+ GPlatesPresentation::ReconstructionGeometryRenderer::RenderParamsPopulator::visit_reconstruct_visual_layer_params(
+ 		const ReconstructVisualLayerParams &params)
+ {
+-	d_render_params.show_vgp = boost::bind(&ReconstructVisualLayerParams::show_vgp, &params, _1, _2);
++	d_render_params.show_vgp = boost::bind(&ReconstructVisualLayerParams::show_vgp, &params, boost::placeholders::_1, boost::placeholders::_2);
+ 	d_render_params.vgp_draw_circular_error = params.get_vgp_draw_circular_error();
+ 	d_render_params.fill_polygons = params.get_fill_polygons();
+ 	d_render_params.fill_polylines = params.get_fill_polylines();
+diff --unified --recursive a/src/presentation/VisualLayerRegistry.cc b/src/presentation/VisualLayerRegistry.cc
+--- a/src/presentation/VisualLayerRegistry.cc	2021-07-05 05:11:50.000000000 +0200
++++ b/src/presentation/VisualLayerRegistry.cc	2022-12-07 22:38:12.950877614 +0100
+@@ -448,7 +448,7 @@
+ 			&GPlatesQtWidgets::ReconstructScalarCoverageLayerOptionsWidget::create,
+ 			boost::bind(
+ 					&ReconstructScalarCoverageVisualLayerParams::create,
+-					_1),
++					boost::placeholders::_1),
+ 			true);
+ 
+ 	registry.register_visual_layer_type(
+@@ -498,7 +498,7 @@
+ 					// NOTE: We pass in ViewState and not the GlobeAndMapWidget, obtained from
+ 					// ViewportWindow, because ViewportWindow is not yet available (a reference to
+ 					// it not yet been initialised inside ViewState) so accessing it would crash...
+-					_1, boost::ref(view_state)),
++					boost::placeholders::_1, boost::ref(view_state)),
+ 			true);
+ 
+ 	// DERIVED_DATA group.
+@@ -549,7 +549,7 @@
+ 			&GPlatesQtWidgets::VelocityFieldCalculatorLayerOptionsWidget::create,
+ 			boost::bind(
+ 					&VelocityFieldCalculatorVisualLayerParams::create,
+-					_1, boost::cref(view_state.get_rendered_geometry_parameters())),
++					boost::placeholders::_1, boost::cref(view_state.get_rendered_geometry_parameters())),
+ 			true);
+ 
+ 	using namespace  GPlatesUtils;
+diff --unified --recursive a/src/qt-widgets/ViewportWindow.cc b/src/qt-widgets/ViewportWindow.cc
+--- a/src/qt-widgets/ViewportWindow.cc	2021-08-05 05:44:01.000000000 +0200
++++ b/src/qt-widgets/ViewportWindow.cc	2022-12-07 22:39:20.487981302 +0100
+@@ -326,7 +326,7 @@
+ 			*d_geometry_operation_state_ptr,
+ 			*d_modify_geometry_state,
+ 			*d_measure_distance_state_ptr,
+-			boost::bind(&canvas_tool_status_message, boost::ref(*this), _1),
++			boost::bind(&canvas_tool_status_message, boost::ref(*this), boost::placeholders::_1),
+ 			get_view_state(),
+ 			*this);
+ 
diff --git a/nixpkgs/pkgs/applications/science/misc/gplates/default.nix b/nixpkgs/pkgs/applications/science/misc/gplates/default.nix
new file mode 100644
index 000000000000..74dd61a2228c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/gplates/default.nix
@@ -0,0 +1,76 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, doxygen
+, graphviz
+, boost
+, cgal_5
+, gdal
+, glew
+, gmp
+, libGL
+, libGLU
+, libSM
+, mpfr
+, proj
+, python3
+, qtxmlpatterns
+, qwt
+, wrapQtAppsHook
+}:
+
+let
+  python = python3.withPackages (ps: with ps; [
+    numpy
+  ]);
+  boost' = boost.override {
+    enablePython = true;
+    inherit python;
+  };
+  cgal = cgal_5.override {
+    boost = boost';
+  };
+in stdenv.mkDerivation (finalAttrs: {
+  pname = "gplates";
+  version = "2.4";
+
+  src = fetchFromGitHub {
+    owner = "GPlates";
+    repo = "GPlates";
+    rev = "GPlates-${finalAttrs.version}";
+    hash = "sha256-BRvrqczGguE2z44ZboxeJxgWEA+t02XkzvU+yF4ki6s=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    doxygen
+    graphviz
+    wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    boost'
+    cgal
+    gdal
+    glew
+    gmp
+    libGL
+    libGLU
+    libSM
+    mpfr
+    proj
+    python
+    qtxmlpatterns
+    qwt
+  ];
+
+  meta = with lib; {
+    description = "Desktop software for the interactive visualisation of plate-tectonics";
+    mainProgram = "gplates";
+    homepage = "https://www.gplates.org";
+    license = licenses.gpl2Only;
+    platforms = platforms.all;
+    broken = stdenv.isDarwin; # FIX: this check: https://github.com/GPlates/GPlates/blob/gplates/cmake/modules/Config_h.cmake#L72
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/misc/graphia/breakpad-sigstksz.patch b/nixpkgs/pkgs/applications/science/misc/graphia/breakpad-sigstksz.patch
new file mode 100644
index 000000000000..6e90faf9f037
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/graphia/breakpad-sigstksz.patch
@@ -0,0 +1,13 @@
+diff --git a/source/thirdparty/breakpad/src/client/linux/handler/exception_handler.cc b/source/thirdparty/breakpad/src/client/linux/handler/exception_handler.cc
+index ca353c4099..499be0a986 100644
+--- a/source/thirdparty/breakpad/src/client/linux/handler/exception_handler.cc
++++ b/source/thirdparty/breakpad/src/client/linux/handler/exception_handler.cc
+@@ -138,7 +138,7 @@ void InstallAlternateStackLocked() {
+   // SIGSTKSZ may be too small to prevent the signal handlers from overrunning
+   // the alternative stack. Ensure that the size of the alternative stack is
+   // large enough.
+-  static const unsigned kSigStackSize = std::max(16384, SIGSTKSZ);
++  const unsigned kSigStackSize = std::max<unsigned>(16384, SIGSTKSZ);
+ 
+   // Only set an alternative stack if there isn't already one, or if the current
+   // one is too small.
diff --git a/nixpkgs/pkgs/applications/science/misc/graphia/default.nix b/nixpkgs/pkgs/applications/science/misc/graphia/default.nix
new file mode 100644
index 000000000000..b24d5375ef9b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/graphia/default.nix
@@ -0,0 +1,57 @@
+{ stdenv
+, lib
+, cmake
+, git
+, fetchFromGitHub
+, fetchpatch
+, wrapQtAppsHook
+, qtbase
+, qtdeclarative
+, qtsvg
+, qtwebengine
+}:
+
+stdenv.mkDerivation rec {
+  pname = "graphia";
+  version = "4.2";
+
+  src = fetchFromGitHub {
+    owner = "graphia-app";
+    repo = "graphia";
+    rev = version;
+    sha256 = "sha256-8+tlQbTr6BGx+/gjviuNrQQWcxC/j6dJ+PxwB4fYmqQ=";
+  };
+
+  patches = [
+    # Fix gcc-13 build:
+    (fetchpatch {
+      name = "gcc-13.patch";
+      url = "https://github.com/graphia-app/graphia/commit/78fb55a4d73f96e9a182de433c7da60330bd5b5e.patch";
+      hash = "sha256-waI2ur3gOKMQvqB2Qnyz7oMOMConl3jLMVKKmOmTpJs=";
+    })
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    git # needs to define some hash as a version
+    wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    qtbase
+    qtdeclarative
+    qtsvg
+    qtwebengine
+  ];
+
+  meta = with lib; {
+    # never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/graphia.x86_64-darwin
+    broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
+    description = "A visualisation tool for the creation and analysis of graphs.";
+    homepage = "https://graphia.app";
+    license = licenses.gpl3Only;
+    mainProgram = "Graphia";
+    maintainers = [ maintainers.bgamari ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/megam/default.nix b/nixpkgs/pkgs/applications/science/misc/megam/default.nix
new file mode 100644
index 000000000000..cae0fe9b26fd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/megam/default.nix
@@ -0,0 +1,65 @@
+{ lib
+, stdenv
+, fetchurl
+, ocaml
+, ncurses
+}:
+
+stdenv.mkDerivation {
+  pname = "megam";
+  version = "0.92";
+
+  src = fetchurl {
+    url = "http://hal3.name/megam/megam_src.tgz";
+    sha256 = "dc0e9f59ff8513449fe3bd40b260141f89c88a4edf6ddc8b8a394c758e49724e";
+  };
+
+  patches = [ ./ocaml-includes.patch ./ocaml-3.12.patch ];
+
+  postPatch = ''
+    # Deprecated in ocaml 3.10 https://github.com/ocaml/ocaml/commit/f6190f3d0c49c5220d443ee8d03ca5072d68aa87
+    # Deprecated in ocaml 3.08 https://github.com/ocaml/ocaml/commit/0c7aecb88dc696f66f49f3bed54a037361a26b8d
+    substituteInPlace fastdot_c.c --replace copy_double caml_copy_double --replace Bigarray_val Caml_ba_array_val --replace caml_bigarray caml_ba_array
+    # They were already deprecated in 3.12 https://v2.ocaml.org/releases/3.12/htmlman/libref/Array.html
+    substituteInPlace abffs.ml main.ml --replace create_matrix make_matrix
+    substituteInPlace intHashtbl.ml --replace Array.create Array.make
+  '';
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml ];
+
+  buildInputs = [ ncurses ];
+
+  makeFlags = [
+    "CAML_INCLUDES=${ocaml}/lib/ocaml/caml"
+    ("WITHBIGARRAY=" + lib.optionalString (lib.versionOlder ocaml.version "4.08.0") "bigarray.cma")
+    "all"
+    "opt"
+  ];
+
+  # see https://bugzilla.redhat.com/show_bug.cgi?id=435559
+  dontStrip = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm755 megam $out/bin/megam
+    install -Dm755 megam.opt $out/bin/megam.opt
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "MEGA Model Optimization Package";
+    longDescription = ''
+      The software here is an implementation of maximum likelihood and maximum a
+      posterior optimization of the parameters of these models. The algorithms
+      used are much more efficient than the iterative scaling techniques used in
+      almost every other maxent package out there.
+    '';
+    homepage = "http://www.umiacs.umd.edu/~hal/megam";
+    license = "non-commercial";
+    maintainers = with maintainers; [ leixb ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/megam/ocaml-3.12.patch b/nixpkgs/pkgs/applications/science/misc/megam/ocaml-3.12.patch
new file mode 100644
index 000000000000..8265acf6e4a7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/megam/ocaml-3.12.patch
@@ -0,0 +1,12 @@
+diff -ru megam_0.92/Makefile megam_0.92-b/Makefile
+--- megam_0.92/Makefile	2007-10-08 18:06:04.000000000 +0100
++++ megam_0.92-b/Makefile	2013-11-25 10:14:20.000000000 +0000
+@@ -59,7 +59,7 @@
+ 
+ WITHUNIX =unix.cma -cclib -lunix
+ 
+-WITHSTR =str.cma -cclib -lstr
++WITHSTR =str.cma -cclib -lcamlstr
+ 
+ WITHBIGARRAY =bigarray.cma -cclib -lbigarray
+ 
diff --git a/nixpkgs/pkgs/applications/science/misc/megam/ocaml-includes.patch b/nixpkgs/pkgs/applications/science/misc/megam/ocaml-includes.patch
new file mode 100644
index 000000000000..d4f38949b4d3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/megam/ocaml-includes.patch
@@ -0,0 +1,21 @@
+diff -ru megam_0.92/Makefile megam_0.92-b/Makefile
+--- megam_0.92/Makefile	2007-10-08 18:06:04.000000000 +0100
++++ megam_0.92-b/Makefile	2013-11-25 10:14:20.000000000 +0000
+@@ -41,7 +41,7 @@
+ #
+ # The Caml compilers. #
+ # You may fix here the path to access the Caml compiler on your machine
+-CAMLC = ocamlc -g
++CAMLC = ocamlc -g $(WITHCLIBS)
+ CAMLOPT = ocamlopt -unsafe -ccopt -O4 -ccopt -ffast-math -inline 99999 
+ CAMLDEP = ocamldep
+ CAMLLEX = ocamllex
+@@ -70,7 +70,7 @@
+ WITHDBM =dbm.cma -cclib -lmldbm -cclib -lndbm
+ 
+ #WITHCLIBS =-I /usr/lib/ocaml/3.09.2/caml
+-WITHCLIBS =-I /usr/lib/ocaml/caml
++WITHCLIBS =-I $(CAML_INCLUDES) -I +unix -I +str
+ 
+ ################ End of user's variables #####################
+ 
diff --git a/nixpkgs/pkgs/applications/science/misc/netlogo/default.nix b/nixpkgs/pkgs/applications/science/misc/netlogo/default.nix
new file mode 100644
index 000000000000..13c3c36f90ae
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/netlogo/default.nix
@@ -0,0 +1,60 @@
+{ jre, lib, stdenv, fetchurl, makeWrapper, makeDesktopItem }:
+
+let
+
+  desktopItem = makeDesktopItem rec {
+    name = "netlogo";
+    exec = name;
+    icon = name;
+    comment = "A multi-agent programmable modeling environment";
+    desktopName = "NetLogo";
+    categories = [ "Science" ];
+  };
+
+in
+
+stdenv.mkDerivation rec {
+  pname = "netlogo";
+  version = "6.1.1";
+
+  src = fetchurl {
+    url = "https://ccl.northwestern.edu/netlogo/${version}/NetLogo-${version}-64.tgz";
+    sha256 = "1j08df68pgggxqkmpzd369w4h97q0pivmmljdb48hjghx7hacblp";
+  };
+
+  src1 = fetchurl {
+    name = "netlogo.png";
+    url = "https://netlogoweb.org/assets/images/desktopicon.png";
+    sha256 = "1i43lhr31lzva8d2r0dxpcgr58x496gb5vmb0h2da137ayvifar8";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  installPhase = ''
+    mkdir -pv $out/share/netlogo $out/share/icons/hicolor/256x256/apps $out/share/applications $out/share/doc
+    cp -rv app $out/share/netlogo
+    cp -v readme.md $out/share/doc/
+
+    # launcher with `cd` is required b/c otherwise the model library isn't usable
+    makeWrapper "${jre}/bin/java" "$out/bin/netlogo" \
+      --chdir "$out/share/netlogo/app" \
+      --add-flags "-jar netlogo-${version}.jar"
+
+    cp $src1 $out/share/icons/hicolor/256x256/apps/netlogo.png
+    cp ${desktopItem}/share/applications/* $out/share/applications
+  '';
+
+  meta = with lib; {
+    description = "A multi-agent programmable modeling environment";
+    mainProgram = "netlogo";
+    longDescription = ''
+      NetLogo is a multi-agent programmable modeling environment. It is used by
+      many tens of thousands of students, teachers and researchers worldwide.
+    '';
+    homepage = "https://ccl.northwestern.edu/netlogo/index.shtml";
+    sourceProvenance = with sourceTypes; [ binaryBytecode ];
+    license = licenses.gpl2;
+    maintainers = [ maintainers.dpaetzel ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/nextinspace/default.nix b/nixpkgs/pkgs/applications/science/misc/nextinspace/default.nix
new file mode 100644
index 000000000000..742b4cb622c2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/nextinspace/default.nix
@@ -0,0 +1,45 @@
+{ lib
+, fetchFromGitHub
+, python3
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "nextinspace";
+  version = "2.0.5";
+  format = "pyproject";
+
+  src = fetchFromGitHub {
+    owner = "not-stirred";
+    repo = pname;
+    rev = "refs/tags/v${version}";
+    hash = "sha256-CrhzCvIA3YAFsWvdemvK1RLMacsM5RtgMjLeiqz5MwY=";
+  };
+
+  nativeBuildInputs = with python3.pkgs; [
+    poetry-core
+  ];
+
+  pythonPath = with python3.pkgs; [
+    requests
+    tzlocal
+    colorama
+  ];
+
+  nativeCheckInputs = with python3.pkgs; [
+    pytest-lazy-fixture
+    pytestCheckHook
+    requests-mock
+  ];
+
+  pythonImportsCheck = [
+    "nextinspace"
+  ];
+
+  meta = with lib; {
+    description = "Print upcoming space-related events in your terminal";
+    mainProgram = "nextinspace";
+    homepage = "https://github.com/The-Kid-Gid/nextinspace";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ penguwin ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/combined/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/combined/default.nix
new file mode 100644
index 000000000000..bc6bc9620215
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/combined/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, lib, openmodelica, symlinkJoin, gnumake, blas, lapack, makeWrapper }:
+symlinkJoin {
+  name = "openmodelica-combined";
+  paths = with openmodelica; [
+    omcompiler
+    omsimulator
+    omplot
+    omparser
+    omedit
+    omlibrary
+    omshell
+  ];
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    wrapProgram $out/bin/OMEdit \
+      --prefix PATH : ${lib.makeBinPath [ gnumake stdenv.cc ]} \
+      --prefix LIBRARY_PATH : "${lib.makeLibraryPath [ blas lapack ]}" \
+      --set-default OPENMODELICALIBRARY "${openmodelica.omlibrary}/lib/omlibrary"
+  '';
+
+  meta = with lib; {
+    description = "An open-source Modelica-based modeling and simulation environment intended for industrial and academic usage";
+    homepage = "https://openmodelica.org";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ balodja smironov ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/default.nix
new file mode 100644
index 000000000000..10fccfdf6da8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/default.nix
@@ -0,0 +1,17 @@
+{ lib, newScope, libsForQt5, clangStdenv }:
+lib.makeScope newScope (self:
+  let
+    callPackage = self.newScope { stdenv = clangStdenv; };
+    callQtPackage = self.newScope (libsForQt5 // { stdenv = clangStdenv; });
+  in
+  {
+    mkOpenModelicaDerivation = callPackage ./mkderivation { };
+    omcompiler = callPackage ./omcompiler { };
+    omplot = callQtPackage ./omplot { };
+    omsimulator = callPackage ./omsimulator { };
+    omparser = callPackage ./omparser { };
+    omedit = callQtPackage ./omedit { };
+    omlibrary = callPackage ./omlibrary { };
+    omshell = callQtPackage ./omshell { };
+    combined = callPackage ./combined { };
+  })
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix
new file mode 100644
index 000000000000..ffa0a158ac95
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix
@@ -0,0 +1,101 @@
+# mkOpenModelicaDerivation is an mkDerivation function for packages
+# from OpenModelica suite.
+
+{ stdenv, lib, fetchgit, autoconf, automake, libtool, cmake, autoreconfHook, symlinkJoin }:
+pkg:
+let
+  inherit (builtins) hasAttr getAttr length elemAt;
+  inherit (lib) attrByPath concatStringsSep;
+
+
+  # A few helpers functions:
+
+  # getAttrDef is just a getAttr with default fallback
+  getAttrDef = attr: default: x: attrByPath [ attr ] default x;
+
+  # getAttr-like helper for optional append to string:
+  # "Hello" + appendByAttr "a" " " {a = "world";} = "Hello world"
+  # "Hello" + appendByAttr "a" " " {} = "Hello"
+  appendByAttr = attr: sep: x: lib.optionalString (hasAttr attr x) (sep + (getAttr attr x));
+
+  # Are there any OM dependencies at all?
+  ifDeps = length pkg.omdeps != 0;
+
+  # Dependencies of current OpenModelica-target joined in one file tree.
+  # Return the dep itself in case it is a single one.
+  joinedDeps =
+    if length pkg.omdeps == 1
+    then elemAt pkg.omdeps 0
+    else
+      symlinkJoin {
+        name = pkg.pname + "-omhome";
+        paths = pkg.omdeps;
+      };
+
+  # Should we run ./configure for the target pkg?
+  omautoconf = getAttrDef "omautoconf" false pkg;
+
+  # Name of the make target
+  omtarget = getAttrDef "omtarget" pkg.pname pkg;
+
+  # Directory of target sources
+  omdir = getAttrDef "omdir" pkg.pname pkg;
+
+  # Simple to to m4 configuration scripts
+  postPatch = lib.optionalString ifDeps ''
+    sed -i ''$(find -name omhome.m4) -e 's|if test ! -z "$USINGPRESETBUILDDIR"|if test ! -z "$USINGPRESETBUILDDIR" -a -z "$OMHOME"|'
+  '' +
+  appendByAttr "postPatch" "\n" pkg;
+
+  # Update shebangs in the scripts before running configuration.
+  preAutoreconf = "patchShebangs --build common" +
+    appendByAttr "preAutoreconf" "\n" pkg;
+
+  # Tell OpenModelica where built dependencies are located.
+  configureFlags = lib.optional ifDeps "--with-openmodelicahome=${joinedDeps}" ++
+    getAttrDef "configureFlags" [ ] pkg;
+
+  # Our own configurePhase that accounts for omautoconf
+  configurePhase = ''
+    runHook preConfigure
+    export configureFlags="''${configureFlags} --with-ombuilddir=$PWD/build --prefix=$prefix"
+    ./configure --no-recursion $configureFlags
+    ${lib.optionalString omautoconf "(cd ${omdir}; ./configure $configureFlags)"}
+    runHook postConfigure
+  '';
+
+  # Targets that we want to build ourselves:
+  deptargets = lib.forEach pkg.omdeps (dep: dep.omtarget);
+
+  # ... so we ask openmodelica makefile to skip those targets.
+  preBuild = ''
+    for target in ${concatStringsSep " " deptargets}; do
+      touch ''${target}.skip;
+    done
+  '' +
+  appendByAttr "preBuild" "\n" pkg;
+
+  makeFlags = "${omtarget}" +
+    appendByAttr "makeFlags" " " pkg;
+
+  installFlags = "-i " +
+    appendByAttr "installFlags" " " pkg;
+
+
+in
+stdenv.mkDerivation (pkg // {
+  inherit omtarget postPatch preAutoreconf configureFlags configurePhase preBuild makeFlags installFlags;
+
+  src = fetchgit (import ./src-main.nix);
+  version = "1.18.0";
+
+  nativeBuildInputs = getAttrDef "nativeBuildInputs" [ ] pkg
+    ++ [ autoconf automake libtool cmake autoreconfHook ];
+
+  buildInputs = getAttrDef "buildInputs" [ ] pkg
+    ++ lib.optional ifDeps joinedDeps;
+
+  dontUseCmakeConfigure = true;
+
+  hardeningDisable = [ "format" ];
+})
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/src-main.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/src-main.nix
new file mode 100644
index 000000000000..1ab8d9390db3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/src-main.nix
@@ -0,0 +1,7 @@
+{
+  url = "https://github.com/OpenModelica/OpenModelica/";
+  rev = "49be4faa5a625a18efbbd74cc2f5be86aeea37bb";
+  sha256 = "0klqiy4sdizl1djb9hb0arcvfcjz2mmnakrjx81mmxcbr8yq2016";
+  fetchSubmodules = true;
+}
+# Update with: nix run -f ./nixpkgs/default.nix nix-prefetch-git -c nix-prefetch-git 'https://github.com/OpenModelica/OpenModelica/' 'v1.18.0' --fetch-submodules
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix
new file mode 100644
index 000000000000..360fea56fedf
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix
@@ -0,0 +1,63 @@
+{ stdenv
+, lib
+, gfortran
+, flex
+, bison
+, jre8
+, blas
+, lapack
+, curl
+, readline
+, expat
+, pkg-config
+, buildPackages
+, targetPackages
+, libffi
+, binutils
+, mkOpenModelicaDerivation
+}:
+let
+  isCross = stdenv.buildPlatform != stdenv.hostPlatform;
+  nativeOMCompiler = buildPackages.openmodelica.omcompiler;
+in
+mkOpenModelicaDerivation ({
+  pname = "omcompiler";
+  omtarget = "omc";
+  omdir = "OMCompiler";
+  omdeps = [ ];
+  omautoconf = true;
+
+  nativeBuildInputs = [
+    jre8
+    gfortran
+    flex
+    bison
+    pkg-config
+  ] ++ lib.optional isCross nativeOMCompiler;
+
+  buildInputs = [ targetPackages.stdenv.cc.cc blas lapack curl readline expat libffi binutils ];
+
+  postPatch = ''
+    sed -i -e '/^\s*AR=ar$/ s/ar/${stdenv.cc.targetPrefix}ar/
+               /^\s*ar / s/ar /${stdenv.cc.targetPrefix}ar /
+               /^\s*ranlib/ s/ranlib /${stdenv.cc.targetPrefix}ranlib /' \
+        $(find ./OMCompiler -name 'Makefile*')
+  '';
+
+  preFixup = ''
+    for entry in $(find $out -name libipopt.so); do
+      patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$entry"
+      patchelf --set-rpath '$ORIGIN':"$(patchelf --print-rpath $entry)" "$entry"
+    done
+  '';
+
+  meta = with lib; {
+    description = "Modelica compiler from OpenModelica suite";
+    homepage = "https://openmodelica.org";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ balodja smironov ];
+    platforms = platforms.linux;
+  };
+} // lib.optionalAttrs isCross {
+  configureFlags = [ "--with-omc=${nativeOMCompiler}/bin/omc" ];
+})
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omedit/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omedit/default.nix
new file mode 100644
index 000000000000..57863482fef6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omedit/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, jre8
+, qmake
+, qtbase
+, qttools
+, qtwebkit
+, qtxmlpatterns
+, binutils
+, wrapQtAppsHook
+, openmodelica
+, openscenegraph
+, mkOpenModelicaDerivation
+}:
+with openmodelica;
+mkOpenModelicaDerivation rec {
+  pname = "omedit";
+  omdir = "OMEdit";
+  omdeps = [ omcompiler omplot omparser omsimulator ];
+  omautoconf = true;
+
+  nativeBuildInputs = [ jre8 qmake qtbase qttools wrapQtAppsHook ];
+
+  buildInputs = [ qtwebkit openscenegraph qtxmlpatterns binutils ];
+
+  postPatch = ''
+    sed -i ''$(find -name qmake.m4) -e '/^\s*LRELEASE=/ s|LRELEASE=.*$|LRELEASE=${lib.getDev qttools}/bin/lrelease|'
+  '';
+
+  dontUseQmakeConfigure = true;
+  QMAKESPEC = "linux-clang";
+
+  meta = with lib; {
+    description = "A Modelica connection editor for OpenModelica";
+    homepage = "https://openmodelica.org";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ balodja smironov ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/default.nix
new file mode 100644
index 000000000000..6821e33d1a62
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, stdenv
+, fetchgit
+, bash
+, openmodelica
+, mkOpenModelicaDerivation
+}:
+let
+  fakegit = import ./fakegit.nix { inherit lib stdenv fetchgit bash; };
+in
+mkOpenModelicaDerivation {
+  pname = "omlibrary";
+  omdir = "libraries";
+  omtarget = "omlibrary-all";
+  omdeps = [ openmodelica.omcompiler ];
+
+  postPatch = ''
+    patchShebangs --build libraries
+    cp -fv ${fakegit}/bin/checkout-git.sh libraries/checkout-git.sh
+
+    # The EMOTH library is broken in OpenModelica 1.17.0
+    # Let's remove it from targets.
+    sed -i -e '/^OTHER_LIBS=/ s/EMOTH //' libraries/Makefile.libs
+  '';
+
+  meta = with lib; {
+    description = "A collection of Modelica libraries to use with OpenModelica,
+including Modelica Standard Library";
+    homepage = "https://openmodelica.org";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ balodja smironov ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/fakegit.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/fakegit.nix
new file mode 100644
index 000000000000..cad21c2a6e44
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/fakegit.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchgit, bash }:
+let
+  mkscript = path: text: ''
+    mkdir -pv `dirname ${path}`
+    cat > ${path} <<"EOF"
+    #!${bash}/bin/bash
+    ME=$(basename ${path})
+    ${text}
+    EOF
+    sed -i "s@%out@$out@g" ${path}
+    chmod +x ${path}
+  '';
+
+  hashname = r:
+    let
+      rpl = lib.replaceStrings [ ":" "/" ] [ "_" "_" ];
+    in
+    (rpl r.url) + "-" + (rpl r.rev);
+
+in
+stdenv.mkDerivation {
+  name = "fakegit";
+
+  buildCommand = ''
+    mkdir -pv $out/repos
+    ${lib.concatMapStrings
+      (r: "cp -r ${fetchgit r} $out/repos/${hashname r}\n")
+      (import ./src-libs.nix)}
+
+    ${mkscript "$out/bin/checkout-git.sh" ''
+      if test "$#" -ne 4; then
+        echo "Usage: $0 DESTINATION URL GITBRANCH HASH"
+        exit 1
+      fi
+      DEST=$1
+      URL=`echo $2 | tr :/ __`
+      GITBRANCH=$3
+      REVISION=$4
+
+      REVISION=`echo $REVISION | tr :/ __`
+
+      rm -rf $DEST
+      mkdir -pv $DEST
+      echo "FAKEGIT cp -r %out/repos/$URL-$REVISION $DEST" >&2
+      cp -r %out/repos/$URL-$REVISION/* $DEST
+      chmod u+w -R $DEST
+    ''}
+  '';
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/src-libs.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/src-libs.nix
new file mode 100644
index 000000000000..dff5ee78936a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/src-libs.nix
@@ -0,0 +1,81 @@
+[
+{ url = "https://github.com/modelica-3rdparty/AdvancedNoise.git"; rev = "5ce57acd279dadd0d25b76a6b02d3f9e9d061246"; sha256 = "07jjbj0y6bak269md3xniqb5lgc33m92ar5qixqxj5yxdjaahfs2"; fetchSubmodules = true; }
+{ url = "https://github.com/RWTH-EBC/AixLib.git"; rev = "65e49ddf5c935846888a61aa303e52c909619079"; sha256 = "18xn8j3x3j4x9bpjgqnq0b6p3yzzsg5n62fv1ldqbbjcmi0vimd5"; fetchSubmodules = true; }
+{ url = "https://github.com/RWTH-EBC/AixLib.git"; rev = "v0.4.0"; sha256 = "0dw34mjq29n55xh51g1c9a9d0d8gbpn16gj309dfxn4v2hbnfvzx"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/AlgebraTestSuite.git"; rev = "b937e1a7f447138c59abec9b2092f84f16bf02e8"; sha256 = "0406inasx61dk7vcnziiyhxkna7g61a5hn0znnbxj817hz6q11zn"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/ApproxSpline.git"; rev = "28420f5c1a88c9cd069defbd8c05e4a78a090675"; sha256 = "07gpyi2brj5zpvrlsnflqjnhbrgxvpqbdshp8lp4lh9mnj5jv95d"; fetchSubmodules = true; }
+{ url = "https://github.com/OpenModelica/BioChem.git"; rev = "v1.0.2"; sha256 = "037bvj2lqrslg8k5r0rjgdzccslj9bj25b55k4g440vabm5p05qm"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/BondGraph.git"; rev = "20c23e60d12989bd4668ccac47659d82d39d29cc"; sha256 = "0yrkk708v4bvf423xb4zgpmnaj8qhq5primdg758ayddgli23wa9"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/BrineProp.git"; rev = "834fb3519ca8f89efe268582d39d00a7c3991150"; sha256 = "1iwqh4kr36wgxc0gci63gdgbqln2sap1w4bkydk1vkss2s302lg4"; fetchSubmodules = true; }
+{ url = "https://github.com/EDF-TREE/BuildSysPro.git"; rev = "v3.3.0"; sha256 = "1cvcany3q9p1xndarxa2d8mmqxdnqk22476q8l61nayz5qy25x61"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/BuildingControlLib.git"; rev = "v1.0.0"; sha256 = "0ckdxway0m755mbrl94k4458sijzgknlzsrf7xs5bjymxchm8r2m"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/BuildingSystems.git"; rev = "c3070d48015ee75c1577f349cb388a498bef7270"; sha256 = "0r876wm6f1xx4cli1lqlylpl3zgaddmy06hcafbnzry9j38vbz4y"; fetchSubmodules = true; }
+{ url = "https://github.com/lbl-srg/modelica-buildings.git"; rev = "v6.0.0"; sha256 = "0rnnk1clji0myzr7adggki6knbl6v8381vwnqgiz8mkxbmzdwm4f"; fetchSubmodules = true; }
+{ url = "https://github.com/lbl-srg/modelica-buildings.git"; rev = "v7.0.0"; sha256 = "04n04pp4zvyg8n8h7h79c3wyk7lmn940mh7qzs0lv76g1ybypnlz"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/Chemical.git"; rev = "5645573fced862430b7b598b4d7ec1a39c7aa0fa"; sha256 = "1kh7kpmjfz55pb8553srlnrh8l00nw21xf5mjzh7nx9b1rndnmyg"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/DeployStructLib.git"; rev = "v1.0"; sha256 = "1k4zw9lnd0javw4zigxc15l58yf7xdz36b7808g65qxy89w6ksr2"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/DisHeatLib.git"; rev = "b11f53379c122870a52f2da9b1705d2c911cd21d"; sha256 = "1vm96a4z0b40r0nisxrrzyvan4yphjdkx4ad655phva2636xb5rr"; fetchSubmodules = true; }
+{ url = "https://github.com/AHaumer/DriveControl.git"; rev = "b7233fd97a92867bb4ec2c3647c7f7e888398644"; sha256 = "0nyp1n8wrkjzfypsmjjzac0g9p4wbc1cxxr040fj20bqdg9l3h1b"; fetchSubmodules = true; }
+{ url = "https://github.com/christiankral/ElectroMechanicalDrives.git"; rev = "v2.2.0"; sha256 = "0012phmn1y9fgpph45lwbjk0yhm5czidf2z6khm8lddvk93wf31b"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/ExternData.git"; rev = "v2.5.0"; sha256 = "19dsyq1mk5vl54fqaffzqafm5w94l011cy7pg16c7i933dbqnkki"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica/ExternalMedia.git"; rev = "6138312c96142ff3c01190147e6277991bfa2fca"; sha256 = "1d9g2hbdvgz13j7kdi1kglkkllj9f00x3dwdp5piyypvs464jsn5"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/ExternalMemoryLib.git"; rev = "6488d5815bda23c665123baa916789e283e16d2c"; sha256 = "06y1i5w690b3b9x23nzls8y67fl7yd7bn4xl5j0dmyi4qx33aqda"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/FMITest.git"; rev = "a67a276083f4010b249802ad8fc70dc30c09adfd"; sha256 = "0mg8jlvlwql2nsjiy7c3rdibv73bkfk149ac0450d5pc0hfn9mln"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/FailureModes.git"; rev = "v1.2.1"; sha256 = "1z8bwrld1rkydgssab5gnrd76frrbky8qxi1lvlaf2jidj6bzn1l"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/FaultTriggering.git"; rev = "v0.6.6"; sha256 = "0a08yyrbg4a49s0bgqgyds6pidx9xr47yspvl9bdak1mq34qibip"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/FeedDriveLibrary.git"; rev = "1.0.1"; sha256 = "15fi9dj6zgl0fr90cwxqjbpphj0dwrrmk74hf25j6zd85w2ycqdz"; fetchSubmodules = true; }
+{ url = "https://github.com/DLR-SR/FractionalOrder.git"; rev = "99918820e346c362c3ad52d782c8215e5deeac4c"; sha256 = "1pycss6fqh86frfdbdfffjhaz09fz1558f9azgckhf8drx6ry1qs"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/Greenhouses-Library.git"; rev = "89ae0e8097eb0751abce2013d304fa5f9c09b885"; sha256 = "1q77xj6aysqsn3d7kjmcq7dihbw18iqm35ifzdi75xgf3cgwla4f"; fetchSubmodules = true; }
+{ url = "https://github.com/christiankral/HanserModelica.git"; rev = "v1.1.0"; sha256 = "0zwkrhg2y42m18p4z51izrickiv1vikgz0z7fpjia4dbppckav8i"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/HelmholtzMedia.git"; rev = "3b4a4bca94d388744b2d045344ea2f9b0b4d405b"; sha256 = "17fzpan89075vb5vbhw5ylgxcdsmj2vjnmmka7cgzh06izb69nvh"; fetchSubmodules = true; }
+{ url = "https://github.com/ibpsa/modelica-ibpsa.git"; rev = "v3.0.0"; sha256 = "0xwgfndlw76zfmiiqadl85l9na9igsqlmfcawx526sdw2lhhgics"; fetchSubmodules = true; }
+{ url = "https://github.com/open-ideas/IDEAS.git"; rev = "v2.1.0"; sha256 = "0xp0zg6ib5536d5vl361lsn5w5faqdf6djhcmfxns629wjima8rn"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/IndustrialControlSystems.git"; rev = "v1.1.0"; sha256 = "1nvgx94iy1pws0768anrl7ssjlzslb5mbp21j7xvf6wpqfmj0npc"; fetchSubmodules = true; }
+{ url = "https://github.com/christiankral/KeyWordIO.git"; rev = "v0.9.0"; sha256 = "10kvj6zn2r6m3403ja8nkkxbfcchkz0pfk3g70ibr76zivxb5nim"; fetchSubmodules = true; }
+{ url = "https://github.com/FishSim/LibRAS.git"; rev = "fca9de50a484a2213f3ca1b39e275c237c471688"; sha256 = "0w1c87sifq8klq0f2l70qxjrlvahyxy1cx9rln80rni4d427yc1k"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/LinearMPC.git"; rev = "v1.0"; sha256 = "1crj60i5f33l9pgip0xbv6ankcga7px0644cj7c2wnzn1fjmn2k8"; fetchSubmodules = true; }
+{ url = "https://github.com/looms-polimi/MEV.git"; rev = "v1.0.1"; sha256 = "1a7ih9lc01wzaq8a8aznggpi4aqnczyzq49q5hc4fqvmfwl7l0j3"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/ModPowerSystems.git"; rev = "df3afce27d5e935c4111f392275744a655abe216"; sha256 = "1b1fikm92lv6gj82imka3hxbjwv04i4h33y69yhcxdpqa6z6hm4z"; fetchSubmodules = true; }
+{ url = "https://github.com/OpenModelica/OpenModelica-ModelicaStandardLibrary.git"; rev = "4a91d52248b0f17415bba1d58881fc730bd94215"; sha256 = "19caxz6hvlrsls3b2387a24zwwnykbb138jpb42gwpy8jlh93yzi"; fetchSubmodules = true; }
+{ url = "https://github.com/OpenModelica/OpenModelica-ModelicaStandardLibrary.git"; rev = "cab27240a4a3ed4ea137226f056bbc0d79543f7a"; sha256 = "06y911i2hs7hg4ykhb8wngvxhwnaww8rsakwa7ssd047a7glzsb0"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/Modelica-Arduino.git"; rev = "v0.1.0"; sha256 = "1n34dksqhrn1synv2mp2ifk4dxyhp15f5v1jb1b3dbw9n19951qb"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/Modelica-GNU_ScientificLibrary.git"; rev = "9235ab28bdd7f0fe3e7abba48af53d73332858ec"; sha256 = "168g9gg12lfa863ifs41bnx6yd0yyjnal6986dgpm51dj5arw6id"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/Modelica-MVEM.git"; rev = "v1.0.1"; sha256 = "1p68691dnl06lgwm4bl9g036brn4vl7m5x3gq4rxc291339frixk"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/ModelicaADS.git"; rev = "v1.0.1"; sha256 = "0fhxrl07d7v3wa79d30psm1gxydc0p7s2akfirdx6dai0633skp9"; fetchSubmodules = true; }
+{ url = "https://github.com/xogeny/ModelicaBook.git"; rev = "v0.6.0"; sha256 = "0yqbll6p738yvpi1x11cjngpz2glda07mljrkjlm23p7l53x63dc"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-compliance/compliance.git"; rev = "8a91e75d8a26acc4de30fc0e5d5e9db83c970bd6"; sha256 = "1cym1wlgsvfrryq8zqzzrgs4wam1l7pc20q07hk3d615nhq21lg6"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/ModelicaDFR.git"; rev = "37a441934d05330cf3d13e9ec551954d27eca84c"; sha256 = "13rpcs8cl9x15vi655150zmhmg1iaxpzvxrl3rqif46zpl5dhlj2"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica/Modelica_DeviceDrivers.git"; rev = "v1.8.2"; sha256 = "16c0p9zn0qrraz59ivinibmikdd251plm1vqngznzhksjwvz6bja"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica/Modelica_LinearSystems2.git"; rev = "v2.3.5"; sha256 = "0rzicynqgayydxqynnairxk7ybg4alv1xnfz8cgkrpicl2g9bacg"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/Modelica_Requirements.git"; rev = "a427b5cb7997e9036c577d219e6b8a5d0c28389a"; sha256 = "1ihx46kifnfi9kw1g8nmd9sarl766whbzdk6a44alczsya4gg45k"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica/Modelica_Synchronous.git"; rev = "c8350276bfd945086962cf4150ba941b9c57ed13"; sha256 = "12ad7fpjy50ky3lvl65r9d5xvlzvw5yqdnbp4rsgl3qw7s3wrmja"; fetchSubmodules = true; }
+{ url = "https://github.com/jwindahlModelon/MultiPhaseMixtureMedia.git"; rev = "0bda0c58af6384f8e0edf7aa7520afb369af3e38"; sha256 = "11bqm69504bh4h05dxlwdmjfxwls06mr49cz47kl8jmrygkfi4i2"; fetchSubmodules = true; }
+{ url = "https://github.com/OpenIPSL/OpenIPSL.git"; rev = "v1.5.0"; sha256 = "09xrcz0rdxdy220ki5zyl7920y0a4lg24p0aibna4ad15vszhhwj"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/Optimisers.git"; rev = "e33c69edaad6dad8029167b0ca00533964a6fe37"; sha256 = "0hcxsrr2n4fzaxdjvgvqayz38kpfk86cclvg5pzcfmjc5bznb8bs"; fetchSubmodules = true; }
+{ url = "https://github.com/lochel/PNlib.git"; rev = "059545d48dd9ceeccfa3b4e47689ec8dd334dcd8"; sha256 = "1a0hxkgsi4klw9c8zav1dy2p1c85ald29gx82hfacwv55xl9f127"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/PVSystems.git"; rev = "v0.6.2"; sha256 = "0vcgvdaqfbn46lpzk0kvsif3d55wf8yzhkbdpf5zv04kv7zw25w9"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/PhotoVoltaics.git"; rev = "v1.6.0"; sha256 = "0zqx77z217iln3vfxn2v3c2jl0jz5kgcd96ylvimjnwr30mxr09n"; fetchSubmodules = true; }
+{ url = "https://github.com/MarekMatejak/Physiolibrary.git"; rev = "v2.3.1"; sha256 = "0nxfw63m278gaff18zz29n2s1vk4kwdbv2qvbjmcq86fl1i5b3bg"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/Physiomodel.git"; rev = "v1.0.0"; sha256 = "1sdhv5qgjqv3zdq57pkkrh04ainwv9n5zqd8mb9a3ybjmwdjf6f9"; fetchSubmodules = true; }
+{ url = "https://github.com/dzimmer/PlanarMechanics.git"; rev = "55224a9e76de8aa7f708236bd4d7dee624ecba50"; sha256 = "0hf7vi44adss86x5ahk5if7bdjgw773d8mb3d8ianq12g8azycyd"; fetchSubmodules = true; }
+{ url = "https://github.com/PowerGrids/PowerGrids.git"; rev = "v1.0.0"; sha256 = "06bx8mqvmizhfwg99djdfgh2mblc4wzmg0zq4ilrp586jwfninmz"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica/PowerSystems.git"; rev = "v1.0.0"; sha256 = "1xwhwich7gi6vl33zl2r78xdjklchgkjcnvww6390j20l1wjznkn"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica/PowerSystems.git"; rev = "f0721333f4875143565147a7d043bee1c300873b"; sha256 = "0gbvx0gzf3akb0w7yvdxfq2y4ps91cy5b93iwnvnw7652x716813"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/RealTimeCoordinationLibrary.git"; rev = "v1.0.2"; sha256 = "0ch4la04hm059ii5wzph9gsbvqhnfqrvvpqi57qn27bm10c4la0m"; fetchSubmodules = true; }
+{ url = "https://github.com/casella/ScalableTestSuite.git"; rev = "v1.11.5"; sha256 = "0bhj1q9b8d29nrbr253zszy1w1yvyizvyr3law1pqjj6mhbqmg4i"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/Servomechanisms.git"; rev = "3bf82ba5d3f31b4a0ae05f99ae690037358e153e"; sha256 = "1swka7d58wkg5pqv59lqgfi7gv6rg5vra4j6r76pn9czx9ddal8w"; fetchSubmodules = true; }
+{ url = "https://github.com/SolarTherm/SolarTherm.git"; rev = "203fb5af3b95c731c7fcbe2833d51fd420e80796"; sha256 = "1bh4y4igzd0k59xm8j14p52gnlbwkiwwy6bhhyarpr361yrchn33"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/Soltermica.git"; rev = "9f7224bd89335f95dffe1ccdaa094df5a3279fdf"; sha256 = "1bif3cnwjas6x7b8ahwkm7dbrqrfdqwwa26zmdc6zrpfncl3kqd0"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/SystemDynamics.git"; rev = "2f6bd9382c5aac2aff9148cd9113a418767734b6"; sha256 = "0ii2mj6ngwjir3gzyad8wsj86pvd6wzal91nz2y7gzwj1djchb3x"; fetchSubmodules = true; }
+{ url = "https://github.com/thom-marx/ThermalSeparation.git"; rev = "ffa0495ba829ecab105be4bfb3b7652625ec9c03"; sha256 = "1czm97bcrpp2jv0a0kd31a929wqlrlzdhdxvyy4w499dn20jzv1l"; fetchSubmodules = true; }
+{ url = "https://github.com/casella/ThermoPower.git"; rev = "650be2c8cbd5abc3535e92b865e509073afc8aeb"; sha256 = "08ijrx8xw43dadz5s3kiwa17ax9faq2wyq9gm0vlz9ddbkj0hcaq"; fetchSubmodules = true; }
+{ url = "https://openmodelica.org/git/ThermoSysPro.git"; rev = "db81ae1b5a6a85f6c6c7693244cafa6087e18ff5"; sha256 = "12fsf0xxxc1ja6vmm9ff85f8j5sg1lb7w4g57s2w3fkf4d3a7d0c"; fetchSubmodules = true; }
+{ url = "https://openmodelica.org/git/ThermoSysPro.git"; rev = "5cef9acb4dedf8af6f4638a4448f08a544ebd30b"; sha256 = "0ihnz1s4rs42yis9zym9nw29ia2lqz2yx2wblc50p6f221w7q78s"; fetchSubmodules = true; }
+{ url = "https://github.com/lenaRB/VVDRlib.git"; rev = "eae4981674642eddffc7f2aa3690320fcaddee0e"; sha256 = "0qxxk2xlas5mqyc1h8ndic208qj1sm5mr5y8664kv3py7i8jdqi4"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica/VehicleInterfaces.git"; rev = "v1.2.5"; sha256 = "044k17cpc88wprrvw03p6crm6dy6x9a6xj5104d5nln71lqz5sdq"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/WasteWater.git"; rev = "v2.1.0"; sha256 = "1dxr4m9j7b5266daj4klbrhvnkqr73sximdw9bk9v5qf0s28li99"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/WindPowerPlants.git"; rev = "v1.2.0"; sha256 = "1lyrqwsb6sm1wc7vlj72zk5cpjhhzh27fviiqayddqy2b903xish"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/ipsl.git"; rev = "v1.1.1"; sha256 = "1w2iah8c5d8n01wmxydjk0rrcxh88g8yjy2zmv403azcccq7byzp"; fetchSubmodules = true; }
+{ url = "https://github.com/modelica-3rdparty/netCDF-DataReader.git"; rev = "v2.5.0"; sha256 = "1pd5xf5bgz010lryv8bj6lvlfqn9p184csiffwj8icx7rycnlcqb"; fetchSubmodules = true; }
+{ url = "https://github.com/joewa/open-bldc-modelica.git"; rev = "58a83b5b36f267613de4676c95163489b1ddc2e7"; sha256 = "0wf6dn64d2psv9b3xg5227vzpk109r3dqzi4m2wwhrilaxs3v004"; fetchSubmodules = true; }
+]
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/update-src-libs.sh b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/update-src-libs.sh
new file mode 100755
index 000000000000..b8f2e95923b5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/update-src-libs.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env nix-shell
+#! nix-shell -i bash -p bash
+
+CWD=$PWD
+
+chko() {
+  (
+    T=`mktemp -d`
+    trap "rm -rf $T" EXIT INT PIPE
+    cd $T
+    cat >check.nix <<EOF
+with import <nixpkgs> {};
+fetchgit `cat $CWD/../mkderivation/src-main.nix`
+EOF
+    nix-build check.nix
+    cat result/libraries/Makefile.libs
+  )
+}
+
+getsha256() {
+  URL=$(echo "$1" | sed 's/^"\(.*\)"$/\1/')
+  REV=$(echo "$2" | sed 's/^"\(.*\)"$/\1/')
+  SHA=$(nix run nixpkgs.nix-prefetch-git -c nix-prefetch-git --fetch-submodules "$URL" "$REV" 2>/dev/null | sed -n 's/.*"sha256": "\(.*\)",/\1/g p')
+  echo "{ url = $1; rev = $2; sha256 = \"$SHA\"; fetchSubmodules = true; }"
+}
+
+OUT=src-libs.nix
+
+echo '[' > $OUT
+
+chko |
+grep checkout-git.sh |
+tr \' \" |
+while read NM TGT URL BR REV ; do
+  echo Trying $TGT $URL $REV >&2
+  getsha256 $URL $REV >> $OUT || exit 1
+done
+
+echo ']' >> $OUT
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/Makefile.in.patch b/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/Makefile.in.patch
new file mode 100644
index 000000000000..a8f04203a8c9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/Makefile.in.patch
@@ -0,0 +1,22 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -23,7 +23,7 @@
+ omedit-testsuite: omedit-testsuite.skip
+ omedit-testsuite.skip: omedit.skip testsuite-depends
+ 	$(MAKE) -f $(defaultMakefileTarget) -C OMEdit/Testsuite
+-omparser: omparser.skip
++omparser: build-dirs omparser.skip
+ omparser.skip:
+ 	test -f $@ || $(MAKE) -C OMParser OMBUILDDIR=@OMBUILDDIR@ "host_short=@host_short@" CC="@CC@" CXX="@CXX@" CFLAGS="@CFLAGS@" CPPFLAGS="@CPPFLAGS@" CXXFLAGS="@CXXFLAGS@"
+ omsimulator: omsimulator.skip
+@@ -134,6 +134,10 @@
+ INSTALL_JAVADIR    = ${DESTDIR}${datadir}/omc/java
+ INSTALL_LOCALEDIR  = ${DESTDIR}${datadir}/locale
+ 
++build-dirs:
++	mkdir -p "@OMBUILDDIR@"/lib/@host_short@/omc
++	mkdir -p "@OMBUILDDIR@"/include/omc
++
+ install-dirs:
+ 	@test ! "${DESTDIR}/@prefix@" -ef "@OMBUILDDIR@" || (echo Error: Install and build dirs are the same && false)
+ 	if [ "@APP@" = ".app" ]; then mkdir -p ${INSTALL_APPDIR}; fi
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/default.nix
new file mode 100644
index 000000000000..cbf8f2255e76
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/default.nix
@@ -0,0 +1,28 @@
+{ lib
+, pkg-config
+, jre8
+, libuuid
+, openmodelica
+, mkOpenModelicaDerivation
+}:
+
+mkOpenModelicaDerivation rec {
+  pname = "omparser";
+  omdir = "OMParser";
+  omdeps = [ openmodelica.omcompiler ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ jre8 libuuid ];
+
+  patches = [ ./Makefile.in.patch ];
+
+  meta = with lib; {
+    description = "An antlr4-based parser of Modelica files from OpenModelica
+suite";
+    homepage = "https://openmodelica.org";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ balodja smironov ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omplot/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omplot/default.nix
new file mode 100644
index 000000000000..51ab89407f4c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omplot/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, qtbase
+, qttools
+, qmake
+, wrapQtAppsHook
+, openmodelica
+, mkOpenModelicaDerivation
+}:
+
+mkOpenModelicaDerivation rec {
+  pname = "omplot";
+  omdir = "OMPlot";
+  omdeps = [ openmodelica.omcompiler ];
+  omautoconf = true;
+
+  nativeBuildInputs = [ qtbase qttools qmake wrapQtAppsHook ];
+
+  postPatch = ''
+    sed -i OMPlot/Makefile.in -e 's|bindir = @includedir@|includedir = @includedir@|'
+    sed -i OMPlot/OMPlot/OMPlotGUI/*.pro -e '/INCLUDEPATH +=/s|$| ../../qwt/src|'
+    sed -i ''$(find -name qmake.m4) -e '/^\s*LRELEASE=/ s|LRELEASE=.*$|LRELEASE=${lib.getDev qttools}/bin/lrelease|'
+  '';
+
+  dontUseQmakeConfigure = true;
+  QMAKESPEC = "linux-clang";
+
+  meta = with lib; {
+    description = "Plotting tool for OpenModelica-generated results files";
+    homepage = "https://openmodelica.org";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ balodja smironov ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omshell/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omshell/default.nix
new file mode 100644
index 000000000000..3c39d62f92d6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omshell/default.nix
@@ -0,0 +1,40 @@
+{ lib, qttools, qmake, qtwebkit, wrapQtAppsHook, readline, openmodelica, mkOpenModelicaDerivation }:
+
+mkOpenModelicaDerivation rec {
+  pname = "omshell";
+  omdir = "OMShell";
+  omdeps = [ openmodelica.omcompiler ];
+  omautoconf = true;
+
+  nativeBuildInputs = [ qmake wrapQtAppsHook ];
+
+  buildInputs = [ readline qtwebkit ];
+
+  postPatch = with openmodelica; ''
+    sed -i ''$(find -name qmake.m4) -e '/^\s*LRELEASE=/ s|LRELEASE=.*$|LRELEASE=${lib.getDev qttools}/bin/lrelease|'
+    sed -i OMShell/OMShell/OMShellGUI/*.pro -e '
+      s|\$\$\[QT_INSTALL_BINS\]/lrelease|${lib.getDev qttools}/bin/lrelease|
+      /^\s*OMCLIBS =/ s|\$\$(OMBUILDDIR)|${omcompiler}|
+      /^\s*OMCINC =/ s|\$\$(OMBUILDDIR)|${omcompiler}|
+    '
+    sed -i OMShell/OMShell/OMShellGUI/OMShell.config.in -e '
+      s|@OMBUILDDIR@|${omcompiler}|
+      s|@OPENMODELICAHOME@|${omcompiler}|
+    '
+    sed -i OMShell/mosh/src/Makefile.in -e '
+      /^CFLAGS =/ s|-I../../../build|-I${omcompiler}|
+      /^LIBS =/ s|-L@OMBUILDDIR@|-L${omcompiler}|
+      '
+  '';
+
+  dontUseQmakeConfigure = true;
+  QMAKESPEC = "linux-clang";
+
+  meta = with lib; {
+    description = "Interactive OpenModelica session shell";
+    homepage = "https://openmodelica.org";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ balodja smironov ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omsimulator/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omsimulator/default.nix
new file mode 100644
index 000000000000..d91d427a0770
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omsimulator/default.nix
@@ -0,0 +1,26 @@
+{ lib
+, pkg-config
+, boost
+, readline
+, libxml2
+, openmodelica
+, mkOpenModelicaDerivation
+}:
+
+mkOpenModelicaDerivation rec {
+  pname = "omsimulator";
+  omdir = "OMSimulator";
+  omdeps = [ openmodelica.omcompiler ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ readline libxml2 boost ];
+
+  meta = with lib; {
+    description = "The OpenModelica FMI & SSP-based co-simulation environment";
+    homepage = "https://openmodelica.org";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ balodja smironov ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmvg/default.nix b/nixpkgs/pkgs/applications/science/misc/openmvg/default.nix
new file mode 100644
index 000000000000..5cf4dc437752
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmvg/default.nix
@@ -0,0 +1,83 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, cmake
+, cereal
+, ceres-solver
+, clp
+, coin-utils
+, eigen
+, lemon-graph
+, libjpeg
+, libpng
+, libtiff
+, nix-update-script
+, openmp
+, osi
+, zlib
+, enableShared ? !stdenv.hostPlatform.isStatic
+, enableExamples ? false
+, enableDocs ? false }:
+
+stdenv.mkDerivation rec {
+  version = "2.1";
+  pname = "openmvg";
+
+  src = fetchFromGitHub {
+    owner = "openmvg";
+    repo = "openmvg";
+    rev = "v${version}";
+    hash = "sha256-vG+tW9Gl/DAUL8DeY+rJVDJH/oMPH3XyZMUgzjtwFv0=";
+  };
+
+  # Pretend we checked out the dependency submodules
+  postPatch = ''
+    mkdir src/dependencies/cereal/include
+  '';
+
+  buildInputs = [
+    cereal
+    ceres-solver
+    clp
+    coin-utils
+    eigen
+    lemon-graph
+    libjpeg
+    libpng
+    libtiff
+    openmp
+    osi
+    zlib
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  # flann is missing because the lz4 dependency isn't propagated: https://github.com/openMVG/openMVG/issues/1265
+  cmakeFlags = [
+    "-DOpenMVG_BUILD_EXAMPLES=${if enableExamples then "ON" else "OFF"}"
+    "-DOpenMVG_BUILD_DOC=${if enableDocs then "ON" else "OFF"}"
+    "-DTARGET_ARCHITECTURE=generic"
+    "-DCLP_INCLUDE_DIR_HINTS=${lib.getDev clp}/include"
+    "-DCOINUTILS_INCLUDE_DIR_HINTS=${lib.getDev coin-utils}/include"
+    "-DLEMON_INCLUDE_DIR_HINTS=${lib.getDev lemon-graph}/include"
+    "-DOSI_INCLUDE_DIR_HINTS=${lib.getDev osi}/include"
+  ] ++ lib.optional enableShared "-DOpenMVG_BUILD_SHARED=ON";
+
+  cmakeDir = "./src";
+
+  dontUseCmakeBuildDir = true;
+
+  # This can be enabled, but it will exhause virtual memory on most machines.
+  enableParallelBuilding = false;
+
+  # Without hardeningDisable, certain flags are passed to the compile that break the build (primarily string format errors)
+  hardeningDisable = [ "all" ];
+
+  passthru.updateScript = nix-update-script { };
+
+  meta = {
+    broken = stdenv.isDarwin && stdenv.isx86_64;
+    description = "A library for computer-vision scientists and targeted for the Multiple View Geometry community";
+    homepage = "https://openmvg.readthedocs.io/en/latest/";
+    license = lib.licenses.mpl20;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ mdaiter bouk ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmvs/default.nix b/nixpkgs/pkgs/applications/science/misc/openmvs/default.nix
new file mode 100644
index 000000000000..35f46f7a4552
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmvs/default.nix
@@ -0,0 +1,82 @@
+{ lib
+, boost
+, breakpad
+, ceres-solver
+, cgal
+, cmake
+, eigen
+, fetchFromGitHub
+, glfw
+, gmp
+, libjpeg
+, libpng
+, libtiff
+, mpfr
+, opencv
+, openmp
+, pkg-config
+, stdenv
+, vcg
+, zstd
+}:
+
+let
+  boostWithZstd = boost.overrideAttrs (old: {
+    buildInputs = old.buildInputs ++ [ zstd ];
+  });
+in
+stdenv.mkDerivation rec {
+  version = "2.2.0";
+  pname = "openmvs";
+
+  src = fetchFromGitHub {
+    owner = "cdcseacave";
+    repo = "openmvs";
+    rev = "v${version}";
+    sha256 = "sha256-j/tGkR73skZiU+bP4j6aZ5CxkbIcHtqKcaUTgNvj0C8=";
+    fetchSubmodules = true;
+  };
+
+  # SSE is enabled by default
+  cmakeFlags = lib.optional (!stdenv.isx86_64) "-DOpenMVS_USE_SSE=OFF";
+
+  buildInputs = [
+    boostWithZstd
+    breakpad
+    ceres-solver
+    cgal
+    eigen
+    glfw
+    gmp
+    libjpeg
+    libpng
+    libtiff
+    mpfr
+    opencv
+    openmp
+    vcg
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  postInstall = ''
+    mv $out/bin/OpenMVS/* $out/bin
+    rmdir $out/bin/OpenMVS
+    rm $out/bin/Tests
+  '';
+
+  doCheck = true;
+  checkPhase = ''
+    runHook preCheck
+    ctest
+    runHook postCheck
+  '';
+
+  meta = {
+    description = "Open Multi-View Stereo reconstruction library";
+    homepage = "https://github.com/cdcseacave/openMVS";
+    license = lib.licenses.agpl3Only;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ bouk ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openrefine/default.nix b/nixpkgs/pkgs/applications/science/misc/openrefine/default.nix
new file mode 100644
index 000000000000..9f2ef0f29b31
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openrefine/default.nix
@@ -0,0 +1,137 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, buildNpmPackage
+, curl
+, jdk
+, jq
+, makeWrapper
+, maven
+, writeText
+}:
+
+let
+  maven' = maven.override {
+    inherit jdk;
+  };
+
+  version = "3.7.9";
+  src = fetchFromGitHub {
+    owner = "openrefine";
+    repo = "openrefine";
+    rev = version;
+    hash = "sha256-wtg0BOGr/aJPZeFQbJSBHtTVfpcSCSHP++8AnpS8pgQ=";
+  };
+
+  npmPkg = buildNpmPackage {
+    inherit src version;
+
+    pname = "openrefine-npm";
+    sourceRoot = "${src.name}/main/webapp";
+
+    npmDepsHash = "sha256-8GhcL4tohQ5u2HeYN6JyTMMobUOqAL8ETCLiP1SoDSk=";
+
+    # package.json doesn't supply a version, which npm doesn't like - fix this.
+    # directly referencing jq because buildNpmPackage doesn't pass
+    # nativeBuildInputs through to fetchNpmDeps
+    postPatch = ''
+      NEW_PACKAGE_JSON=$(mktemp)
+      ${jq}/bin/jq '. + {version: $ENV.version}' package.json > $NEW_PACKAGE_JSON
+      cp $NEW_PACKAGE_JSON package.json
+    '';
+
+    dontNpmBuild = true;
+    installPhase = ''
+      mkdir -p $out
+      cp -r modules/core/3rdparty/* $out/
+    '';
+  };
+
+in maven'.buildMavenPackage {
+  inherit src version;
+
+  pname = "openrefine";
+
+  postPatch = ''
+    cp -r ${npmPkg} main/webapp/modules/core/3rdparty
+  '';
+  mvnParameters = "-DskipTests=true -pl !packaging";
+  mvnHash = "sha256-MqE+iloqzBav6E3/rf1LP5BlKhW/FBIt6+6U+S8UJWA=";
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  installPhase = let
+    gitProperties = writeText "git.properties" (builtins.toJSON {
+      "git.build.version" = version;
+      "git.branch" = "none";
+      "git.build.time" = "1970-01-01T00:00:00+0000";
+      "git.commit.id.abbrev" = "none";
+      "git.commit.id.describe" = "none";
+    });
+  in ''
+    mkdir -p $out/lib/server/target/lib
+    cp -r server/target/lib/* $out/lib/server/target/lib/
+    cp server/target/openrefine-*-server.jar $out/lib/server/target/lib/
+
+    mkdir -p $out/lib/webapp
+    cp -r main/webapp/{WEB-INF,modules} $out/lib/webapp/
+    (
+      cd extensions
+      for ext in * ; do
+        if [ -d "$ext/module" ] ; then
+          mkdir -p "$out/lib/webapp/extensions/$ext"
+          cp -r "$ext/module" "$out/lib/webapp/extensions/$ext/"
+        fi
+      done
+    )
+
+    cp ${gitProperties} $out/lib/webapp/WEB-INF/classes/git.properties
+
+    mkdir -p $out/etc
+    cp refine.ini $out/etc/
+
+    mkdir -p $out/bin
+    cp refine $out/bin/
+  '';
+
+  preFixup = ''
+    find $out -name '*.java' -delete
+    sed -i -E 's|^(butterfly\.modules\.path =).*extensions.*$|\1 '"$out/lib/webapp/extensions|" \
+      $out/lib/webapp/WEB-INF/butterfly.properties
+
+    sed -i 's|^cd `dirname \$0`$|cd '"$out/lib|" $out/bin/refine
+
+    cat >> $out/etc/refine.ini <<EOF
+    REFINE_WEBAPP='$out/lib/webapp'
+    REFINE_LIB_DIR='$out/lib/server/target/lib'
+
+    JAVA_HOME='${jdk.home}'
+
+    # non-headless mode tries to launch a browser, causing a
+    # number of purity problems
+    JAVA_OPTIONS='-Drefine.headless=true'
+    EOF
+
+    wrapProgram $out/bin/refine \
+      --prefix PATH : '${lib.makeBinPath [ jdk curl ]}' \
+      --set-default REFINE_INI_PATH "$out/etc/refine.ini"
+  '';
+
+  passthru = {
+    inherit npmPkg;
+    updateScript = ./update.sh;
+  };
+
+  meta = with lib; {
+    description = "Power tool for working with messy data and improving it";
+    homepage = "https://openrefine.org";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ ris ];
+    sourceProvenance = with sourceTypes; [
+      fromSource
+      binaryBytecode  # maven dependencies
+    ];
+    broken = stdenv.isDarwin;  # builds, doesn't run
+    mainProgram = "refine";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openrefine/update.sh b/nixpkgs/pkgs/applications/science/misc/openrefine/update.sh
new file mode 100755
index 000000000000..545a5bd4e198
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openrefine/update.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p nix nix-update
+
+set -euxo pipefail
+
+nix-update "${UPDATE_NIX_ATTR_PATH}"
+nix-update "${UPDATE_NIX_ATTR_PATH}.npmPkg" --version=skip
+
+FILE="$(nix-instantiate --eval -E 'with import ./. {}; (builtins.unsafeGetAttrPos "version" '"${UPDATE_NIX_ATTR_PATH}"').file' | tr -d '"')"
+
+MVNHASH_OLD=$(nix-instantiate --eval . -A "${UPDATE_NIX_ATTR_PATH}.mvnHash" | tr -d '"')
+MVNHASH_OLD_ESCAPED=$(echo "${MVNHASH_OLD}" | sed -re 's|[+]|\\&|g')
+FAKEHASH=$(nix-instantiate --eval . -A "lib.fakeHash" | tr -d '"')
+FAKEHASH_ESCAPED=$(echo "${FAKEHASH}" | sed -re 's|[+]|\\&|g')
+
+sed -E -i "s|${MVNHASH_OLD_ESCAPED}|${FAKEHASH}|g" "${FILE}"
+
+MVNHASH_NEW="$(nix-build . -A "${UPDATE_NIX_ATTR_PATH}" 2>&1 | tail -n10 | grep 'got:' | cut -d: -f2- | xargs echo || true)"
+
+sed -E -i "s|${FAKEHASH_ESCAPED}|${MVNHASH_NEW}|g" "${FILE}"
diff --git a/nixpkgs/pkgs/applications/science/misc/reason-shell/default.nix b/nixpkgs/pkgs/applications/science/misc/reason-shell/default.nix
new file mode 100644
index 000000000000..848f31abe4c6
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/reason-shell/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, pkg-config
+, openssl
+, stdenv
+, darwin
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "reason";
+  version = "0.3.10";
+
+  src = fetchFromGitHub {
+    owner = "jaywonchung";
+    repo = "reason";
+    rev = "v${version}";
+    hash = "sha256-oytRquZJgb1sfpZil1bSGwIIvm+5N4mkVmIMzWyzDco=";
+  };
+
+  cargoHash = "sha256-4AEuFSM2dY6UjjIFRU8ipkRMoEb2LjnOr3H6rZrLokE=";
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  buildInputs = [
+    openssl
+  ] ++ lib.optionals stdenv.isDarwin [
+    darwin.apple_sdk.frameworks.CoreServices
+  ];
+
+  meta = with lib; {
+    description = "A shell for research papers";
+    mainProgram = "reason";
+    homepage = "https://github.com/jaywonchung/reason";
+    changelog = "https://github.com/jaywonchung/reason/releases/tag/${src.rev}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ figsoda ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/rink/default.nix b/nixpkgs/pkgs/applications/science/misc/rink/default.nix
new file mode 100644
index 000000000000..1e88047eba72
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/rink/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, rustPlatform, openssl, pkg-config, ncurses
+, libiconv, Security }:
+
+rustPlatform.buildRustPackage rec {
+  version = "0.7.0";
+  pname = "rink";
+
+  src = fetchFromGitHub {
+    owner = "tiffany352";
+    repo = "rink-rs";
+    rev = "v${version}";
+    sha256 = "sha256-5UrSJ/y6GxDUNaljal57JJY17NuI+2yLwVTwp+xBNxs=";
+  };
+
+  cargoHash = "sha256-G30NcP1ej01ygHzaxZ2OdgfksvXe/SCsmZFwamxlDvA=";
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ ncurses ]
+    ++ (if stdenv.isDarwin then [ libiconv Security ] else [ openssl ]);
+
+  # Some tests fail and/or attempt to use internet servers.
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Unit-aware calculator";
+    mainProgram = "rink";
+    homepage = "https://rinkcalc.app";
+    license = with licenses; [ mpl20 gpl3Plus ];
+    maintainers = with maintainers; [ sb0 Br1ght0ne ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/root/5.nix b/nixpkgs/pkgs/applications/science/misc/root/5.nix
new file mode 100644
index 000000000000..dfe7b5eca97f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/root/5.nix
@@ -0,0 +1,162 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchpatch
+, cmake
+, pcre
+, pkg-config
+, python3
+, libX11
+, libXpm
+, libXft
+, libXext
+, libGLU
+, libGL
+, zlib
+, libxml2
+, libxcrypt
+, lz4
+, xz
+, gsl
+, xxHash
+, Cocoa
+, OpenGL
+, noSplash ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "root";
+  version = "5.34.38";
+
+  src = fetchurl {
+    url = "https://root.cern.ch/download/root_v${version}.source.tar.gz";
+    sha256 = "1ln448lszw4d6jmbdphkr2plwxxlhmjkla48vmmq750xc1lxlfrc";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ pcre python3 zlib libxml2 lz4 xz gsl xxHash libxcrypt ]
+    ++ lib.optionals (!stdenv.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ]
+    ++ lib.optionals (stdenv.isDarwin) [ Cocoa OpenGL ]
+  ;
+
+  patches = [
+    ./sw_vers_root5.patch
+
+    # prevents rootcint from looking in /usr/includes and such
+    ./purify_include_paths_root5.patch
+
+    # disable dictionary generation for stuff that includes libc headers
+    # our glibc requires a modern compiler
+    ./disable_libc_dicts_root5.patch
+
+    (fetchpatch {
+      name = "root5-gcc9-fix.patch";
+      url = "https://github.com/root-project/root/commit/348f30a6a3b5905ef734a7bd318bc0ee8bca6dc9.diff";
+      sha256 = "0dvrsrkpacyn5z87374swpy7aciv9a8s6m61b4iqd7a956r67rn3";
+    })
+    (fetchpatch {
+      name = "root5-gcc10-fix.patch";
+      url = "https://github.com/root-project/root/commit/3c243b18768d3c3501faf3ca4e4acfc071021350.diff";
+      sha256 = "1hjmgnp4zx6im8ps78673x0rrhmfyy1nffhgxjlfl1r2z8cq210z";
+    })
+    (fetchpatch {
+      name = "root5-python37-fix.patch";
+      url = "https://github.com/root-project/root/commit/c75458024082de0cc35b45505c652b8460a9e71b.patch";
+      sha256 = "sha256-A5zEjQE9OGPFp/L1HUs4NIdxQMRiwbwCRNWOLN2ENrM=";
+    })
+    # Backport Python 3.11 fix to v5 from v6.26
+    # https://github.com/root-project/root/commit/484deb056dacf768aba4954073b41105c431bffc
+    ./root5-python311-fix.patch
+  ];
+
+  # https://github.com/root-project/root/issues/13216
+  hardeningDisable = [ "fortify3" ];
+
+  preConfigure = ''
+    # binutils 2.37 fixes
+    fixupList=(
+      cint/demo/gl/make0
+      cint/demo/exception/Makefile
+      cint/demo/makecint/KRcc/Makefile
+      cint/demo/makecint/Stub2/Make2
+      cint/demo/makecint/Array/Makefile
+      cint/demo/makecint/DArray/Makefile
+      cint/demo/makecint/ReadFile/Makefile
+      cint/demo/makecint/stl/Makefile
+      cint/demo/makecint/Stub2/Make1
+      cint/cint/include/makemat
+      cint/cint/lib/WildCard/Makefile
+      cint/cint/include/make.arc
+      cint/cint/lib/qt/Makefile
+      cint/cint/lib/pthread/Makefile
+      graf2d/asimage/src/libAfterImage/Makefile.in
+    )
+    for toFix in "''${fixupList[@]}"; do
+      substituteInPlace "$toFix" --replace "clq" "cq"
+    done
+
+    patchShebangs build/unix/
+    ln -s ${lib.getDev stdenv.cc.libc}/include/AvailabilityMacros.h cint/cint/include/
+
+    # __malloc_hook is deprecated
+    substituteInPlace misc/memstat/src/TMemStatHook.cxx \
+      --replace "defined(R__GNU) && (defined(R__LINUX) || defined(__APPLE__))" \
+                "defined(R__GNU) && (defined(__APPLE__))"
+  ''
+  # Fix CINTSYSDIR for "build" version of rootcint
+  # This is probably a bug that breaks out-of-source builds
+  + ''
+    substituteInPlace cint/cint/src/loadfile.cxx\
+      --replace 'env = "cint";' 'env = "'`pwd`'/cint";'
+  '' + lib.optionalString noSplash ''
+    substituteInPlace rootx/src/rootx.cxx --replace "gNoLogo = false" "gNoLogo = true"
+  '';
+
+  cmakeFlags = [
+    "-Drpath=ON"
+    "-DCMAKE_INSTALL_LIBDIR=lib"
+    "-DCMAKE_INSTALL_INCLUDEDIR=include"
+    "-DCMAKE_CXX_FLAGS=-std=c++11"
+    "-Dalien=OFF"
+    "-Dbonjour=OFF"
+    "-Dcastor=OFF"
+    "-Dchirp=OFF"
+    "-Ddavix=OFF"
+    "-Ddcache=OFF"
+    "-Dfftw3=OFF"
+    "-Dfitsio=OFF"
+    "-Dfortran=OFF"
+    "-Dgfal=OFF"
+    "-Dgsl_shared=ON"
+    "-Dgviz=OFF"
+    "-Dhdfs=OFF"
+    "-Dkrb5=OFF"
+    "-Dldap=OFF"
+    "-Dmathmore=ON"
+    "-Dmonalisa=OFF"
+    "-Dmysql=OFF"
+    "-Dodbc=OFF"
+    "-Dopengl=ON"
+    "-Doracle=OFF"
+    "-Dpgsql=OFF"
+    "-Dpythia6=OFF"
+    "-Dpythia8=OFF"
+    "-Drfio=OFF"
+    "-Dsqlite=OFF"
+    "-Dssl=OFF"
+    "-Dxml=ON"
+    "-Dxrootd=OFF"
+  ]
+  ++ lib.optional stdenv.isDarwin "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks";
+
+  setupHook = ./setup-hook.sh;
+
+  meta = with lib; {
+    homepage = "https://root.cern.ch/";
+    description = "A data analysis framework";
+    platforms = platforms.unix;
+    broken = !stdenv.isx86_64 || stdenv.cc.isClang or false;
+    maintainers = with maintainers; [ veprbl ];
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/root/default.nix b/nixpkgs/pkgs/applications/science/misc/root/default.nix
new file mode 100644
index 000000000000..9548db1c7c47
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/root/default.nix
@@ -0,0 +1,279 @@
+{ stdenv
+, lib
+, callPackage
+, fetchurl
+, fetchpatch
+, makeWrapper
+, cmake
+, coreutils
+, git
+, davix
+, ftgl
+, gl2ps
+, glew
+, gnugrep
+, gnused
+, gsl
+, gtest
+, lapack
+, libX11
+, libXpm
+, libXft
+, libXext
+, libGLU
+, libGL
+, libxcrypt
+, libxml2
+, llvm_13
+, lsof
+, lz4
+, xz
+, man
+, openblas
+, openssl
+, pcre
+, nlohmann_json
+, pkg-config
+, procps
+, python
+, which
+, xxHash
+, zlib
+, zstd
+, libAfterImage
+, giflib
+, libjpeg
+, libtiff
+, libpng
+, patchRcPathCsh
+, patchRcPathFish
+, patchRcPathPosix
+, tbb
+, xrootd
+, Cocoa
+, CoreSymbolication
+, OpenGL
+, noSplash ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "root";
+  version = "6.30.04";
+
+  passthru = {
+    tests = import ./tests { inherit callPackage; };
+  };
+
+  src = fetchurl {
+    url = "https://root.cern.ch/download/root_v${version}.source.tar.gz";
+    hash = "sha256-K0GAtpjznMZdkQhNgzqIRRWzJbxfZzyOOavoGLAl2Mw=";
+  };
+
+  nativeBuildInputs = [ makeWrapper cmake pkg-config git ];
+  propagatedBuildInputs = [
+    nlohmann_json
+  ];
+  buildInputs = [
+    davix
+    ftgl
+    gl2ps
+    glew
+    pcre
+    zlib
+    zstd
+    lapack
+    libxcrypt
+    libxml2
+    llvm_13
+    lz4
+    xz
+    gsl
+    gtest
+    openblas
+    openssl
+    xxHash
+    libAfterImage
+    giflib
+    libjpeg
+    libtiff
+    libpng
+    patchRcPathCsh
+    patchRcPathFish
+    patchRcPathPosix
+    python.pkgs.numpy
+    tbb
+    xrootd
+  ]
+  ++ lib.optionals (!stdenv.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ]
+  ++ lib.optionals (stdenv.isDarwin) [ Cocoa CoreSymbolication OpenGL ]
+  ;
+
+  patches = [
+    ./sw_vers.patch
+
+    # compatibility with recent XRootD
+    # https://github.com/root-project/root/pull/13752
+    (fetchpatch {
+      url = "https://github.com/root-project/root/commit/3d3cda6c520791282298782189cdb8ca07ace4b9.diff";
+      hash = "sha256-O3aXzrOEQiPjZgbAj9TL6Wt/adN1kKFwjooeaFRyT4I=";
+    })
+    (fetchpatch {
+      url = "https://github.com/root-project/root/commit/6e7798e62dbed1ffa8b91a180fa5a080b7c04ba3.diff";
+      hash = "sha256-47/J631DBnVlvM1Pm9iicKXDKAqN8v9hjAstQuHmH8Q=";
+    })
+  ];
+
+  preConfigure = ''
+    for path in builtins/*; do
+      if [[ "$path" != "builtins/openui5" ]] && [[ "$path" != "builtins/rendercore" ]]; then
+        rm -rf "$path"
+      fi
+    done
+    substituteInPlace cmake/modules/SearchInstalledSoftware.cmake \
+      --replace 'set(lcgpackages ' '#set(lcgpackages '
+
+    substituteInPlace interpreter/llvm-project/clang/tools/driver/CMakeLists.txt \
+      --replace 'add_clang_symlink(''${link} clang)' ""
+
+    # Don't require textutil on macOS
+    : > cmake/modules/RootCPack.cmake
+
+    # Hardcode path to fix use with cmake
+    sed -i cmake/scripts/ROOTConfig.cmake.in \
+      -e '1iset(nlohmann_json_DIR "${nlohmann_json}/lib/cmake/nlohmann_json/")'
+
+    patchShebangs build/unix/
+  '' + lib.optionalString noSplash ''
+    substituteInPlace rootx/src/rootx.cxx --replace "gNoLogo = false" "gNoLogo = true"
+  '' + lib.optionalString stdenv.isDarwin ''
+    # Eliminate impure reference to /System/Library/PrivateFrameworks
+    substituteInPlace core/macosx/CMakeLists.txt \
+      --replace "-F/System/Library/PrivateFrameworks " ""
+  '' + lib.optionalString (stdenv.isDarwin && lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") ''
+    MACOSX_DEPLOYMENT_TARGET=10.16
+  '';
+
+  cmakeFlags = [
+    "-Drpath=ON"
+    "-DCMAKE_INSTALL_BINDIR=bin"
+    "-DCMAKE_INSTALL_LIBDIR=lib"
+    "-DCMAKE_INSTALL_INCLUDEDIR=include"
+    "-Dbuiltin_llvm=OFF"
+    "-Dbuiltin_freetype=OFF"
+    "-Dbuiltin_gtest=OFF"
+    "-Dbuiltin_nlohmannjson=OFF"
+    "-Dbuiltin_openui5=ON"
+    "-Dalien=OFF"
+    "-Dbonjour=OFF"
+    "-Dcastor=OFF"
+    "-Dchirp=OFF"
+    "-Dclad=OFF"
+    "-Ddavix=ON"
+    "-Ddcache=OFF"
+    "-Dfail-on-missing=ON"
+    "-Dfftw3=OFF"
+    "-Dfitsio=OFF"
+    "-Dfortran=OFF"
+    "-Dgnuinstall=ON"
+    "-Dimt=ON"
+    "-Dgfal=OFF"
+    "-Dgviz=OFF"
+    "-Dhdfs=OFF"
+    "-Dhttp=ON"
+    "-Dkrb5=OFF"
+    "-Dldap=OFF"
+    "-Dmonalisa=OFF"
+    "-Dmysql=OFF"
+    "-Dodbc=OFF"
+    "-Dopengl=ON"
+    "-Doracle=OFF"
+    "-Dpgsql=OFF"
+    "-Dpythia6=OFF"
+    "-Dpythia8=OFF"
+    "-Drfio=OFF"
+    "-Droot7=ON"
+    "-Dsqlite=OFF"
+    "-Dssl=ON"
+    "-Dtmva=ON"
+    "-Dtmva-pymva=OFF"
+    "-Dvdt=OFF"
+    "-Dwebgui=ON"
+    "-Dxml=ON"
+    "-Dxrootd=ON"
+  ]
+  ++ lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${lib.getDev stdenv.cc.libc}/include"
+  ++ lib.optionals stdenv.isDarwin [
+    "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks"
+    "-DCMAKE_DISABLE_FIND_PACKAGE_Python2=TRUE"
+
+    # fatal error: module map file '/nix/store/<hash>-Libsystem-osx-10.12.6/include/module.modulemap' not found
+    # fatal error: could not build module '_Builtin_intrinsics'
+    "-Druntime_cxxmodules=OFF"
+  ];
+
+  # suppress warnings from compilation of the vendored clang to avoid running into log limits on the Hydra
+  NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [ "-Wno-shadow" "-Wno-maybe-uninitialized" ];
+
+  postInstall = ''
+    for prog in rootbrowse rootcp rooteventselector rootls rootmkdir rootmv rootprint rootrm rootslimtree; do
+      wrapProgram "$out/bin/$prog" \
+        --set PYTHONPATH "$out/lib"
+    done
+
+    # Make ldd and sed available to the ROOT executable by prefixing PATH.
+    wrapProgram "$out/bin/root" \
+      --prefix PATH : "${lib.makeBinPath [
+        gnused # sed
+        stdenv.cc # c++ ld etc.
+        stdenv.cc.libc # ldd
+      ]}"
+
+    # Patch thisroot.{sh,csh,fish}
+
+    # The main target of `thisroot.sh` is "bash-like shells",
+    # but it also need to support Bash-less POSIX shell like dash,
+    # as they are mentioned in `thisroot.sh`.
+
+    patchRcPathPosix "$out/bin/thisroot.sh" "${lib.makeBinPath [
+      coreutils # dirname tail
+      gnugrep # grep
+      gnused # sed
+      lsof # lsof
+      man # manpath
+      procps # ps
+      which # which
+    ]}"
+    patchRcPathCsh "$out/bin/thisroot.csh" "${lib.makeBinPath [
+      coreutils
+      gnugrep
+      gnused
+      lsof # lsof
+      man
+      which
+    ]}"
+    patchRcPathFish "$out/bin/thisroot.fish" "${lib.makeBinPath [
+      coreutils
+      man
+      which
+    ]}"
+  '';
+
+  # To use the debug information on the fly (without installation)
+  # add the outPath of root.debug into NIX_DEBUG_INFO_DIRS (in PATH-like format)
+  # and make sure that gdb from Nixpkgs can be found in PATH.
+  #
+  # Darwin currently fails to support it (#203380)
+  # we set it to true hoping to benefit from the future fix.
+  # Before that, please make sure if root.debug exists before using it.
+  separateDebugInfo = true;
+
+  setupHook = ./setup-hook.sh;
+
+  meta = with lib; {
+    homepage = "https://root.cern.ch/";
+    description = "A data analysis framework";
+    platforms = platforms.unix;
+    maintainers = [ maintainers.veprbl ];
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/root/disable_libc_dicts_root5.patch b/nixpkgs/pkgs/applications/science/misc/root/disable_libc_dicts_root5.patch
new file mode 100644
index 000000000000..abd6222847ef
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/root/disable_libc_dicts_root5.patch
@@ -0,0 +1,27 @@
+diff --git a/cint/ROOT/CMakeLists.txt b/cint/ROOT/CMakeLists.txt
+--- a/cint/ROOT/CMakeLists.txt
++++ b/cint/ROOT/CMakeLists.txt
+@@ -47,21 +47,13 @@ set(CINTSTLDLLHEADERS
+     ${CMAKE_SOURCE_DIR}/cint/cint/lib/stdstrct/stdcxxfunc.h
+   )
+ set(CINTINCDLLNAMES 
+-    stdfunc 
++#    stdfunc 
+ #    stdcxxfunc
+    )
+ set(CINTINCDLLHEADERS
+-    ${CMAKE_SOURCE_DIR}/cint/cint/lib/stdstrct/stdfunc.h 
++#    ${CMAKE_SOURCE_DIR}/cint/cint/lib/stdstrct/stdfunc.h 
+ #    ${CMAKE_SOURCE_DIR}/cint/cint/lib/stdstrct/stdcxxfunc.h
+    )
+-if(NOT WIN32)
+-  set(CINTSTLDLLNAMES ${CINTSTLDLLNAMES}  valarray)
+-  set(CINTSTLDLLHEADERS ${CINTSTLDLLHEADERS} ${CINTDLLDIR}/vary.h)
+-  set(CINTINCDLLNAMES ${CINTINCDLLNAMES} posix ipc)
+-  set(CINTINCDLLHEADERS ${CINTINCDLLHEADERS} 
+-    ${CMAKE_SOURCE_DIR}/cint/cint/lib/posix/exten.h 
+-    ${CMAKE_SOURCE_DIR}/cint/cint/lib/ipc/ipcif.h)
+-endif()
+ 
+ set(CINTBUILDLOADER
+     vector 
diff --git a/nixpkgs/pkgs/applications/science/misc/root/purify_include_paths_root5.patch b/nixpkgs/pkgs/applications/science/misc/root/purify_include_paths_root5.patch
new file mode 100644
index 000000000000..6773603b8ad3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/root/purify_include_paths_root5.patch
@@ -0,0 +1,204 @@
+diff --git a/cint/cint/src/loadfile.cxx b/cint/cint/src/loadfile.cxx
+--- a/cint/cint/src/loadfile.cxx
++++ b/cint/cint/src/loadfile.cxx
+@@ -1365,92 +1365,6 @@ int G__statfilename(const char *filenamein, struct stat *statBuf,
+          }
+       }         
+ #endif /* G__EDU_VERSION */
+-      
+-#ifdef G__VISUAL
+-      /**********************************************
+-       * try /msdev/include
+-       **********************************************/
+-      if('\0'!=G__cintsysdir[0]) {
+-         workname.Format("/msdev/include/%s%s",filename(),addpost[i2]);
+-         res = stat( workname, statBuf );         
+-         if (res==0) {
+-            if (fullPath) fullPath->Swap(workname);
+-            return res;
+-         }
+-      }
+-#endif /* G__VISUAL */
+-         
+-#ifdef G__SYMANTEC
+-      /**********************************************
+-       * try /sc/include
+-       **********************************************/
+-      if('\0'!=G__cintsysdir[0]) {
+-         workname.Format("/sc/include/%s%s",filename(),addpost[i2]);
+-         res = stat( workname, statBuf );         
+-         if (res==0) {
+-            if (fullPath) fullPath->Swap(workname);
+-            return res;
+-         }
+-      }
+-#endif // G__SYMANTEC
+-         
+-#ifndef G__WIN32
+-      /**********************************************
+-       * try /usr/include/filename
+-       **********************************************/
+-      if('\0'!=G__cintsysdir[0]) {
+-         workname.Format("/usr/include/%s%s",filename(),addpost[i2]);
+-         res = stat( workname, statBuf );         
+-         if (res==0) {
+-            if (fullPath) fullPath->Swap(workname);
+-            return res;
+-         }
+-      }
+-#endif
+-      
+-#ifdef __GNUC__
+-      /**********************************************
+-       * try /usr/include/g++/filename
+-       **********************************************/
+-      if('\0'!=G__cintsysdir[0]) {
+-         workname.Format("/usr/include/g++/%s%s",filename(),addpost[i2]);
+-         res = stat( workname, statBuf );         
+-         if (res==0) {
+-            if (fullPath) fullPath->Swap(workname);
+-            return res;
+-         }
+-      }
+-#endif /* __GNUC__ */
+-      
+-#ifndef G__WIN32
+-      /* #ifdef __hpux */
+-      /**********************************************
+-       * try /usr/include/CC/filename
+-       **********************************************/
+-      if('\0'!=G__cintsysdir[0]) {
+-         workname.Format("/usr/include/CC/%s%s",filename(),addpost[i2]);
+-         res = stat( workname, statBuf );         
+-         if (res==0) {
+-            if (fullPath) fullPath->Swap(workname);
+-            return res;
+-         }
+-      }         
+-#endif
+-         
+-#ifndef G__WIN32
+-      /**********************************************
+-       * try /usr/include/codelibs/filename
+-       **********************************************/
+-      if('\0'!=G__cintsysdir[0]) {
+-         workname.Format("/usr/include/codelibs/%s%s"
+-                         ,filename(),addpost[i2]);
+-         res = stat( workname, statBuf );         
+-         if (res==0) {
+-            if (fullPath) fullPath->Swap(workname);
+-            return res;
+-         }
+-      }
+-#endif
+    }
+    return -1;
+ }
+@@ -1960,107 +1874,6 @@ int G__loadfile(const char *filenamein)
+       }
+       if(G__ifile.fp) break;
+ #endif /* G__EDU_VERSION */
+-
+-#ifdef G__VISUAL
+-      /**********************************************
+-       * try /msdev/include
+-       **********************************************/
+-      if('\0'!=G__cintsysdir[0]) {
+-         G__snprintf(G__ifile.name,G__MAXFILENAME,"/msdev/include/%s%s",filename(),addpost[i2]);
+-#ifndef G__WIN32
+-        G__ifile.fp = fopen(G__ifile.name,"r");
+-#else
+-        G__ifile.fp = fopen(G__ifile.name,"rb");
+-#endif
+-        G__globalcomp=G__store_globalcomp;
+-      }
+-      if(G__ifile.fp) break;
+-#endif /* G__VISUAL */
+-
+-#ifdef G__SYMANTEC
+-      /**********************************************
+-       * try /sc/include
+-       **********************************************/
+-      if('\0'!=G__cintsysdir[0]) {
+-         G__snprintf(G__ifile.name,G__MAXFILENAME,"/sc/include/%s%s",filename(),addpost[i2]);
+-#ifndef G__WIN32
+-        G__ifile.fp = fopen(G__ifile.name,"r");
+-#else
+-        G__ifile.fp = fopen(G__ifile.name,"rb");
+-#endif
+-        G__globalcomp=G__store_globalcomp;
+-      }
+-      if(G__ifile.fp) break;
+-#endif /* G__SYMANTEC */
+-
+-#ifndef G__WIN32
+-      /**********************************************
+-       * try /usr/include/filename
+-       **********************************************/
+-      if('\0'!=G__cintsysdir[0]) {
+-         G__snprintf(G__ifile.name,G__MAXFILENAME,"/usr/include/%s%s",filename(),addpost[i2]);
+-#ifndef G__WIN32
+-        G__ifile.fp = fopen(G__ifile.name,"r");
+-#else
+-        G__ifile.fp = fopen(G__ifile.name,"rb");
+-#endif
+-        G__globalcomp=G__store_globalcomp;
+-      }
+-      if(G__ifile.fp) break;
+-#endif
+-
+-#ifdef __GNUC__
+-      /**********************************************
+-       * try /usr/include/g++/filename
+-       **********************************************/
+-      if('\0'!=G__cintsysdir[0]) {
+-         G__snprintf(G__ifile.name,G__MAXFILENAME,"/usr/include/g++/%s%s",filename(),addpost[i2]);
+-#ifndef G__WIN32
+-        G__ifile.fp = fopen(G__ifile.name,"r");
+-#else
+-        G__ifile.fp = fopen(G__ifile.name,"rb");
+-#endif
+-        G__globalcomp=G__store_globalcomp;
+-      }
+-      if(G__ifile.fp) break;
+-#endif /* __GNUC__ */
+-
+-#ifndef G__WIN32
+-/* #ifdef __hpux */
+-      /**********************************************
+-       * try /usr/include/CC/filename
+-       **********************************************/
+-      if('\0'!=G__cintsysdir[0]) {
+-         G__snprintf(G__ifile.name,G__MAXFILENAME,"/usr/include/CC/%s%s",filename(),addpost[i2]);
+-#ifndef G__WIN32
+-        G__ifile.fp = fopen(G__ifile.name,"r");
+-#else
+-        G__ifile.fp = fopen(G__ifile.name,"rb");
+-#endif
+-        G__globalcomp=G__store_globalcomp;
+-      }
+-      if(G__ifile.fp) break;
+-/* #endif __hpux */
+-#endif
+-
+-#ifndef G__WIN32
+-/* #ifdef __hpux */
+-      /**********************************************
+-       * try /usr/include/codelibs/filename
+-       **********************************************/
+-      if('\0'!=G__cintsysdir[0]) {
+-        G__snprintf(G__ifile.name,G__MAXFILENAME,"/usr/include/codelibs/%s%s"
+-                    ,filename(),addpost[i2]);
+-#ifndef G__WIN32
+-        G__ifile.fp = fopen(G__ifile.name,"r");
+-#else
+-        G__ifile.fp = fopen(G__ifile.name,"rb");
+-#endif
+-        G__globalcomp=G__store_globalcomp;
+-      }
+-      if(G__ifile.fp) break;
+-/* #endif __hpux */
+-#endif
+     }
+   }
+ 
diff --git a/nixpkgs/pkgs/applications/science/misc/root/root5-python311-fix.patch b/nixpkgs/pkgs/applications/science/misc/root/root5-python311-fix.patch
new file mode 100644
index 000000000000..3005b3a73f9b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/root/root5-python311-fix.patch
@@ -0,0 +1,17 @@
+diff --git a/bindings/pyroot/src/MethodProxy.cxx b/bindings/pyroot/src/MethodProxy.cxx
+--- a/bindings/pyroot/src/MethodProxy.cxx
++++ b/bindings/pyroot/src/MethodProxy.cxx
+@@ -4,10 +4,10 @@
+ // Bindings
+ #include "PyROOT.h"
+ #include "structmember.h"    // from Python
+-#if PY_VERSION_HEX >= 0x02050000
+-#include "code.h"            // from Python
+-#else
++#if PY_VERSION_HEX < 0x02050000
+ #include "compile.h"         // from Python
++#elif PY_VERSION_HEX < 0x030b0000
++#include "code.h"            // from Python
+ #endif
+ #ifndef CO_NOFREE
+ // python2.2 does not have CO_NOFREE defined
diff --git a/nixpkgs/pkgs/applications/science/misc/root/setup-hook.sh b/nixpkgs/pkgs/applications/science/misc/root/setup-hook.sh
new file mode 100644
index 000000000000..34c9bfdcebbd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/root/setup-hook.sh
@@ -0,0 +1,19 @@
+thisroot () {
+    # Workaround thisroot.sh dependency on man
+    if [ -z "${MANPATH-}" ]; then
+        MANPATH=:
+    fi
+    local oldOpts="-u"
+    shopt -qo nounset || oldOpts="+u"
+    set +u
+    source @out@/bin/thisroot.sh
+    set "$oldOpts"
+}
+
+postHooks+=(thisroot)
+
+addRootInludePath() {
+    addToSearchPath ROOT_INCLUDE_PATH $1/include
+}
+
+addEnvHooks "$targetOffset" addRootInludePath
diff --git a/nixpkgs/pkgs/applications/science/misc/root/sw_vers.patch b/nixpkgs/pkgs/applications/science/misc/root/sw_vers.patch
new file mode 100644
index 000000000000..54ad1091392e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/root/sw_vers.patch
@@ -0,0 +1,86 @@
+diff a/cmake/modules/SetUpMacOS.cmake b/cmake/modules/SetUpMacOS.cmake
+--- a/cmake/modules/SetUpMacOS.cmake
++++ b/cmake/modules/SetUpMacOS.cmake
+@@ -8,17 +8,10 @@
+ set(ROOT_PLATFORM macosx)
+ 
+ if (CMAKE_SYSTEM_NAME MATCHES Darwin)
+-  EXECUTE_PROCESS(COMMAND sw_vers "-productVersion"
+-                  COMMAND cut -d . -f 1-2
+-                  OUTPUT_VARIABLE MACOSX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+-
+   MESSAGE(STATUS "Found a macOS system ${MACOSX_VERSION}")
+ 
+-  if(MACOSX_VERSION VERSION_GREATER 10.7 AND ${CMAKE_CXX_COMPILER_ID} MATCHES Clang)
+     set(libcxx ON CACHE BOOL "Build using libc++" FORCE)
+-  endif()
+ 
+-  if(MACOSX_VERSION VERSION_GREATER 10.4)
+     #TODO: check haveconfig and rpath -> set rpath true
+     #TODO: check Thread, define link command
+     #TODO: more stuff check configure script
+@@ -37,22 +30,7 @@
+        SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -m64")
+        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
+        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
+-    else()
+-       SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
+-       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
+-       SET(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -m32")
+     endif()
+-  endif()
+-
+-  if(MACOSX_VERSION VERSION_GREATER 10.6)
+-    set(MACOSX_SSL_DEPRECATED ON)
+-  endif()
+-  if(MACOSX_VERSION VERSION_GREATER 10.7)
+-    set(MACOSX_ODBC_DEPRECATED ON)
+-  endif()
+-  if(MACOSX_VERSION VERSION_GREATER 10.8)
+-    set(MACOSX_GLU_DEPRECATED ON)
+-  endif()
+ 
+   if (CMAKE_COMPILER_IS_GNUCXX)
+      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pipe -W -Wshadow -Wall -Woverloaded-virtual -fsigned-char -fno-common")
+@@ -96,7 +74,6 @@
+   endif()
+ 
+   #---Set Linker flags----------------------------------------------------------------------
+-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mmacosx-version-min=${MACOSX_VERSION}")
+ else (CMAKE_SYSTEM_NAME MATCHES Darwin)
+   MESSAGE(FATAL_ERROR "There is no setup for this this Apple system up to now. Don't know waht to do. Stop cmake at this point.")
+ endif (CMAKE_SYSTEM_NAME MATCHES Darwin)
+diff a/config/root-config.in b/config/root-config.in
+--- a/config/root-config.in
++++ b/config/root-config.in
+@@ -307,12 +307,6 @@
+    ;;
+ macosx64|macosxarm64)
+    # MacOS X with gcc (GNU cc v4.x) in 64 bit mode
+-   macosx_major=`sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 1 | sed -e 's/^[[:space:]]*//'`
+-   macosx_minor=`sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2`
+-   # cannot find the one linked to libGraf if relocated after built
+-   if [ $macosx_major -eq 10 -a $macosx_minor -le 4 ]; then
+-      rootlibs="$rootlibs -lfreetype"
+-   fi
+    auxcflags="${cxxversionflag} -m64"
+    auxldflags="-m64"
+    auxlibs="-lm -ldl"
+@@ -387,17 +381,11 @@
+    done
+    ;;
+ macosx*)
+-   if [ \( $macosx_major -eq 10 -a $macosx_minor -ge 5 \) -o $macosx_major -gt 10  ]; then
+       auxcflags="-pthread $auxcflags"
+       auxlibs="-lpthread $auxlibs"
+-   else
+-      auxlibs="-lpthread $auxlibs"
+-   fi
+    for f in $features ; do
+       if test "x$f" = "xrpath" ; then
+-         if [ \( $macosx_major -eq 10 -a $macosx_minor -ge 5 \) -o $macosx_major -gt 10  ]; then
+             auxlibs="-Wl,-rpath,$libdir $auxlibs"
+-         fi
+       fi
+       if test "x$f" = "xlibcxx" ; then
+          auxcflags="-stdlib=libc++ $auxcflags"
diff --git a/nixpkgs/pkgs/applications/science/misc/root/sw_vers_root5.patch b/nixpkgs/pkgs/applications/science/misc/root/sw_vers_root5.patch
new file mode 100644
index 000000000000..f044bed91f3d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/root/sw_vers_root5.patch
@@ -0,0 +1,104 @@
+diff --git a/build/unix/compiledata.sh b/build/unix/compiledata.sh
+--- a/build/unix/compiledata.sh
++++ b/build/unix/compiledata.sh
+@@ -49,7 +49,7 @@ fi
+ 
+ if [ "$ARCH" = "macosx" ] || [ "$ARCH" = "macosx64" ] || \
+    [ "$ARCH" = "macosxicc" ]; then
+-   macosx_minor=`sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2`
++   macosx_minor=7
+    SOEXT="so"
+    if [ $macosx_minor -ge 5 ]; then
+       if [ "x`echo $SOFLAGS | grep -- '-install_name'`" != "x" ]; then
+diff --git a/cmake/modules/SetUpMacOS.cmake b/cmake/modules/SetUpMacOS.cmake
+--- a/cmake/modules/SetUpMacOS.cmake
++++ b/cmake/modules/SetUpMacOS.cmake
+@@ -12,25 +12,11 @@ set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} /usr/X11R6)
+ #---------------------------------------------------------------------------------------------------------
+ 
+ if (CMAKE_SYSTEM_NAME MATCHES Darwin)
+-  EXECUTE_PROCESS(COMMAND sw_vers "-productVersion"
+-                  COMMAND cut -d . -f 1-2
+-                  OUTPUT_VARIABLE MACOSX_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
+-  MESSAGE(STATUS "Found a Mac OS X System ${MACOSX_VERSION}")
+-  EXECUTE_PROCESS(COMMAND sw_vers "-productVersion"
+-                  COMMAND cut -d . -f 2
+-                  OUTPUT_VARIABLE MACOSX_MINOR OUTPUT_STRIP_TRAILING_WHITESPACE)
+-
+-  if(MACOSX_VERSION VERSION_GREATER 10.7 AND ${CMAKE_CXX_COMPILER_ID} STREQUAL Clang)
+     set(libcxx ON CACHE BOOL "Build using libc++" FORCE)
+-  endif()
+ 
+-  if(${MACOSX_MINOR} GREATER 4)
+     #TODO: check haveconfig and rpath -> set rpath true
+     #TODO: check Thread, define link command
+     #TODO: more stuff check configure script
+-    execute_process(COMMAND /usr/sbin/sysctl machdep.cpu.extfeatures OUTPUT_VARIABLE SYSCTL_OUTPUT)
+-    if(${SYSCTL_OUTPUT} MATCHES 64)
+-       MESSAGE(STATUS "Found a 64bit system")
+        set(ROOT_ARCHITECTURE macosx64)
+        SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}")
+        SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -m64")
+@@ -38,28 +24,6 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin)
+        SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m64")
+        SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m64")
+        SET(CMAKE_FORTRAN_FLAGS "${CMAKE_FORTRAN_FLAGS} -m64")
+-    else(${SYSCTL_OUTPUT} MATCHES 64)
+-       MESSAGE(STATUS "Found a 32bit system")
+-       SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32")
+-       SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32")
+-       SET(CMAKE_FORTRAN_FLAGS "${CMAKE_FORTRAN_FLAGS} -m32")
+-    endif(${SYSCTL_OUTPUT} MATCHES 64)
+-  endif()
+-
+-  if(MACOSX_VERSION VERSION_GREATER 10.6)
+-    set(MACOSX_SSL_DEPRECATED ON)
+-  endif()
+-  if(MACOSX_VERSION VERSION_GREATER 10.7)
+-    set(MACOSX_ODBC_DEPRECATED ON)
+-  endif()
+-  if(MACOSX_VERSION VERSION_GREATER 10.8)
+-    set(MACOSX_GLU_DEPRECATED ON)
+-    set(MACOSX_KRB5_DEPRECATED ON)
+-    set(MACOSX_TMPNAM_DEPRECATED ON)
+-  endif()
+-  if(MACOSX_VERSION VERSION_GREATER 10.9)
+-    set(MACOSX_LDAP_DEPRECATED ON)
+-  endif()
+ 
+   if (CMAKE_COMPILER_IS_GNUCXX)
+      message(STATUS "Found GNU compiler collection")
+@@ -132,7 +96,7 @@ if (CMAKE_SYSTEM_NAME MATCHES Darwin)
+   endif()
+ 
+   #---Set Linker flags----------------------------------------------------------------------
+-  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS}  -mmacosx-version-min=${MACOSX_VERSION} -Wl,-rpath,@loader_path/../lib")
++  set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,@loader_path/../lib")
+ 
+ 
+ else (CMAKE_SYSTEM_NAME MATCHES Darwin)
+diff --git a/config/root-config.in b/config/root-config.in
+--- a/config/root-config.in
++++ b/config/root-config.in
+@@ -391,7 +391,7 @@ macosxicc)
+    ;;
+ macosx64)
+    # MacOS X with gcc (GNU cc v4.x) in 64 bit mode
+-   macosx_minor=`sw_vers | sed -n 's/ProductVersion://p' | cut -d . -f 2`
++   macosx_minor=7
+    # cannot find the one linked to libGraf if relocated after built
+    if [ $macosx_minor -le 4 ]; then
+       rootlibs="$rootlibs -lfreetype"
+diff --git a/cint/ROOT/CMakeLists.txt b/cint/ROOT/CMakeLists.txt
+--- a/cint/ROOT/CMakeLists.txt
++++ b/cint/ROOT/CMakeLists.txt
+@@ -232,9 +232,7 @@ foreach(_name ${CINTINCDLLNAMES})
+                        DEPENDS ${HEADER_OUTPUT_PATH}/systypes.h
+                       )
+
+-    if(MACOSX_MINOR GREATER 4)
+       set(_ExtraFlag "-D__DARWIN_UNIX03")
+-    endif()
+
+     add_custom_command(OUTPUT ${OutFileName}
+                        COMMAND cint_tmp -K -w1 -z${_name} -n${OutFileName} -D__MAKECINT__ -DG__MAKECINT ${_ExtraFlag} -c-2 -Z0 ${InFileName} ${AdditionalHeaderFiles} ${CMAKE_BINARY_DIR}/cint/cint/include/sys/types.h ${CMAKE_SOURCE_DIR}/cint/cint/lib/posix/posix.h
\ No newline at end of file
diff --git a/nixpkgs/pkgs/applications/science/misc/root/tests/default.nix b/nixpkgs/pkgs/applications/science/misc/root/tests/default.nix
new file mode 100644
index 000000000000..9d2da2533f7f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/root/tests/default.nix
@@ -0,0 +1,4 @@
+{ callPackage }:
+{
+  test-thisroot = callPackage ./test-thisroot.nix { };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/root/tests/test-thisroot.nix b/nixpkgs/pkgs/applications/science/misc/root/tests/test-thisroot.nix
new file mode 100644
index 000000000000..3540dde8c913
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/root/tests/test-thisroot.nix
@@ -0,0 +1,49 @@
+{ lib
+, runCommand
+, root
+, bash
+, fish
+, ksh
+, tcsh
+, zsh
+}: runCommand "test-thisroot"
+{
+  meta = with lib; {
+    description = "Test for root thisroot.* sourcing";
+    maintainers = unique ((with maintainers; [ ShamrockLee ]) ++ root.meta.maintainers);
+  };
+}
+  ''
+    set -eu -o pipefail
+    declare -a shellNameArray shellOutpathArray sourcefileNameArray sourceCommandArray
+    shellNameArray=( bash zsh tcsh fish )
+    shellOutpathArray=( "${bash}" "${zsh}" "${tcsh}" "${fish}")
+    sourcefileNameArray=( thisroot.sh thisroot.sh thisroot.csh thisroot.fish )
+    sourceCommandArray=( "source" "source" "source" "source" )
+    debugFlagstrArray=( "-e" "-e" "-e" "" )
+    nShellToTest="''${#shellNameArray[@]}"
+    if [[ "''${#shellOutpathArray[@]}" -ne "$nShellToTest" ]] \
+      || [[ "''${#sourcefileNameArray[@]}" -ne "$nShellToTest" ]] \
+      || [[ "''${#sourceCommandArray[@]}" -ne "$nShellToTest" ]] \
+      || [[ "''${#debugFlagstrArray[@]}" -ne "$nShellToTest" ]]
+    then
+      echo "error: Lengths of test parameter arrays doesn't match." >&2
+      exit 1
+    fi
+    typePExpect="${root}/bin/root"
+    for ((i=0; i<$nShellToTest; ++i)); do
+      tryCommand="''${sourceCommandArray[$i]} \"${root}/bin/''${sourcefileNameArray[$i]}\""
+      echo "Testing ''${shellNameArray[$i]} $tryCommand"
+      # Home directory for Fish
+      HOME_TEMP="$(mktemp -d temporary_home_XXXXXX)"
+      binPATHGot="$(PATH="''${shellOutpathArray[$i]}/bin" HOME=$HOME_TEMP "''${shellNameArray[$i]}" ''${debugFlagstrArray[$i]} -c "$tryCommand && echo \"\$PATH\"")"
+      rm -r "$HOME_TEMP"
+      typePGot="$(PATH="$binPATHGot" type -p root)"
+      if [[ "$typePGot" != "$typePExpect" ]]; then
+        echo "error: Got PATH \"$binPATHGot\", in which the root executable path is \"$typePGot\". Expect root executable path \"$typePExpect\"." >&2
+        exit 1
+      fi
+    done
+    echo "test-thisroot pass!"
+    touch "$out"
+  ''
diff --git a/nixpkgs/pkgs/applications/science/misc/sasview/default.nix b/nixpkgs/pkgs/applications/science/misc/sasview/default.nix
new file mode 100644
index 000000000000..e896b19ede83
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/sasview/default.nix
@@ -0,0 +1,78 @@
+{ lib
+, python3
+, fetchFromGitHub
+, wrapQtAppsHook
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "sasview";
+  version = "5.0.6";
+  pyproject = true;
+
+  src = fetchFromGitHub {
+    owner = "SasView";
+    repo = "sasview";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-cwP9VuvO4GPlbAxCqw31xISTi9NoF5RoBQmjWusrnzc=";
+  };
+
+  # AttributeError: module 'numpy' has no attribute 'float'.
+  postPatch = ''
+    substituteInPlace src/sas/sascalc/pr/p_invertor.py \
+      --replace "dtype=np.float)" "dtype=float)"
+  '';
+
+  nativeBuildInputs = [
+    python3.pkgs.pyqt5
+    python3.pkgs.setuptools
+    wrapQtAppsHook
+  ];
+
+  propagatedBuildInputs = with python3.pkgs; [
+    bumps
+    h5py
+    lxml
+    periodictable
+    pillow
+    pyparsing
+    pyqt5
+    qt5reactor
+    sasmodels
+    scipy
+    setuptools
+    xhtml2pdf
+  ];
+
+  postBuild = ''
+    ${python3.interpreter} src/sas/qtgui/convertUI.py
+  '';
+
+  dontWrapQtApps = true;
+
+  makeWrapperArgs = [
+    "\${qtWrapperArgs[@]}"
+  ];
+
+  nativeCheckInputs = with python3.pkgs; [
+    pytestCheckHook
+    unittest-xml-reporting
+  ];
+
+  pytestFlagsArray = [
+    "test"
+  ];
+
+  disabledTests = [
+    # NoKnownLoaderException
+    "test_invalid_cansas"
+    "test_data_reader_exception"
+  ];
+
+  meta = with lib; {
+    description = "Fitting and data analysis for small angle scattering data";
+    homepage = "https://www.sasview.org";
+    changelog = "https://github.com/SasView/sasview/releases/tag/v${version}";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ rprospero ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/sasview/xhtml2pdf.nix b/nixpkgs/pkgs/applications/science/misc/sasview/xhtml2pdf.nix
new file mode 100644
index 000000000000..41d15e2f1bab
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/sasview/xhtml2pdf.nix
@@ -0,0 +1,33 @@
+{lib, fetchPypi, buildPythonPackage, html5lib, httplib2, nose, pillow, pypdf2, reportlab}:
+
+let
+  #xhtml2pdf specifically requires version "1.0b10" of html5lib
+  html5 = html5lib.overrideAttrs( oldAttrs: rec {
+    name = "${oldAttrs.pname}-${version}";
+    version = "1.0b10";
+    src = oldAttrs.src.override {
+      inherit version;
+      sha256 = "1yd068a5c00wd0ajq0hqimv7fd82lhrw0w3s01vbhy9bbd6xapqd";
+    };
+  });
+in
+
+buildPythonPackage rec {
+  pname = "xhtml2pdf";
+  version = "0.2.1";
+
+  buildInputs = [html5];
+  propagatedBuildInputs = [httplib2 nose pillow pypdf2 reportlab html5];
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1n9r8zdk9gc2x539fq60bhszmd421ipj8g78zmsn3njvma1az9k1";
+  };
+
+  meta = {
+    description = "A pdf converter for the ReportLab Toolkit";
+    homepage = "https://github.com/xhtml2pdf/xhtml2pdf";
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ rprospero ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/simgrid/default.nix b/nixpkgs/pkgs/applications/science/misc/simgrid/default.nix
new file mode 100644
index 000000000000..a2b04e1877f8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/simgrid/default.nix
@@ -0,0 +1,125 @@
+{ stdenv, lib, fetchFromGitLab, cmake, perl, python3, boost
+, fortranSupport ? false, gfortran
+, buildDocumentation ? false, fig2dev, ghostscript, doxygen
+, buildJavaBindings ? false, openjdk
+, buildPythonBindings ? true, python3Packages
+, modelCheckingSupport ? false, libunwind, libevent, elfutils # Inside elfutils: libelf and libdw
+, bmfSupport ? true, eigen
+, minimalBindings ? false
+, debug ? false
+, optimize ? (!debug)
+, moreTests ? false
+, withoutBin ? false
+}:
+
+with lib;
+
+let
+  optionOnOff = option: if option then "on" else "off";
+in
+
+stdenv.mkDerivation rec {
+  pname = "simgrid";
+  version = "3.35";
+
+  src = fetchFromGitLab {
+    domain = "framagit.org";
+    owner = pname;
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-WaFANZiPfiN/utfNZbwyH5mxgJNWafPMCcL863V8w0g=";
+  };
+
+  propagatedBuildInputs = [ boost ];
+  nativeBuildInputs = [ cmake perl python3 ]
+    ++ optionals fortranSupport [ gfortran ]
+    ++ optionals buildJavaBindings [ openjdk ]
+    ++ optionals buildPythonBindings [ python3Packages.pybind11 ]
+    ++ optionals buildDocumentation [ fig2dev ghostscript doxygen ]
+    ++ optionals bmfSupport [ eigen ]
+    ++ optionals modelCheckingSupport [ libunwind libevent elfutils ];
+
+  outputs = [ "out" ]
+    ++ optionals buildPythonBindings [ "python" ];
+
+  # "Release" does not work. non-debug mode is Debug compiled with optimization
+  cmakeBuildType = "Debug";
+  cmakeFlags = [
+    "-Denable_documentation=${optionOnOff buildDocumentation}"
+    "-Denable_java=${optionOnOff buildJavaBindings}"
+    "-Denable_python=${optionOnOff buildPythonBindings}"
+    "-DSIMGRID_PYTHON_LIBDIR=./" # prevents CMake to install in ${python3} dir
+    "-Denable_msg=${optionOnOff buildJavaBindings}"
+    "-Denable_fortran=${optionOnOff fortranSupport}"
+    "-Denable_model-checking=${optionOnOff modelCheckingSupport}"
+    "-Denable_ns3=off"
+    "-Denable_lua=off"
+    "-Denable_lib_in_jar=off"
+    "-Denable_maintainer_mode=off"
+    "-Denable_mallocators=on"
+    "-Denable_debug=on"
+    "-Denable_smpi=on"
+    "-Dminimal-bindings=${optionOnOff minimalBindings}"
+    "-Denable_smpi_ISP_testsuite=${optionOnOff moreTests}"
+    "-Denable_smpi_MPICH3_testsuite=${optionOnOff moreTests}"
+    "-Denable_compile_warnings=off"
+    "-Denable_compile_optimizations=${optionOnOff optimize}"
+    "-Denable_lto=${optionOnOff optimize}"
+
+    # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
+    "-DCMAKE_SKIP_BUILD_RPATH=ON"
+  ];
+  makeFlags = optional debug "VERBOSE=1";
+
+  # needed to run tests and to ensure correct shabangs in output scripts
+  preBuild = ''
+    patchShebangs ..
+  '';
+
+  # needed by tests (so libsimgrid.so is found)
+  preConfigure = ''
+    export LD_LIBRARY_PATH="$PWD/build/lib"
+  '';
+
+  doCheck = true;
+  preCheck = ''
+    # prevent the execution of tests known to fail
+    cat <<EOW >CTestCustom.cmake
+    SET(CTEST_CUSTOM_TESTS_IGNORE smpi-replay-multiple)
+    EOW
+
+    # make sure tests are built in parallel (this can be long otherwise)
+    make tests -j $NIX_BUILD_CORES
+  '';
+
+  postInstall = lib.optionalString withoutBin ''
+    # remove bin from output if requested.
+    # having a specific bin output would be cleaner but it does not work currently (circular references)
+    rm -rf $out/bin
+  '' + lib.optionalString buildPythonBindings ''
+    # manually install the python binding if requested.
+    mkdir -p $python/lib/python${lib.versions.majorMinor python3.version}/site-packages/
+    cp ./lib/simgrid.cpython*.so $python/lib/python${lib.versions.majorMinor python3.version}/site-packages/
+   '';
+
+  # improve debuggability if requested
+  hardeningDisable = lib.optionals debug [ "fortify" ];
+  dontStrip = debug;
+
+  meta = {
+    description = "Framework for the simulation of distributed applications";
+    longDescription = ''
+      SimGrid is a toolkit that provides core functionalities for the
+      simulation of distributed applications in heterogeneous distributed
+      environments.  The specific goal of the project is to facilitate
+      research in the area of distributed and parallel application
+      scheduling on distributed computing platforms ranging from simple
+      network of workstations to Computational Grids.
+    '';
+    homepage = "https://simgrid.org/";
+    license = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ mickours mpoquet ];
+    platforms = platforms.all;
+    broken = stdenv.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/snakemake/default.nix b/nixpkgs/pkgs/applications/science/misc/snakemake/default.nix
new file mode 100644
index 000000000000..628b40cd1300
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/snakemake/default.nix
@@ -0,0 +1,102 @@
+{ lib
+, fetchFromGitHub
+, python3
+, runtimeShell
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "snakemake";
+  version = "8.4.12";
+  format = "setuptools";
+
+  src = fetchFromGitHub {
+    owner = "snakemake";
+    repo = pname;
+    rev = "refs/tags/v${version}";
+    hash = "sha256-ehQIrTw1+klFW+Hu4WsWaCJ0YoN2hIqryqqaoNQb1us=";
+    # https://github.com/python-versioneer/python-versioneer/issues/217
+    postFetch = ''
+      sed -i "$out"/snakemake/_version.py -e 's#git_refnames = ".*"#git_refnames = " (tag: v${version})"#'
+    '';
+  };
+
+  postPatch = ''
+    patchShebangs --build tests/
+    patchShebangs --host snakemake/executors/jobscript.sh
+    substituteInPlace snakemake/shell.py \
+      --replace "/bin/sh" "${runtimeShell}"
+  '';
+
+  propagatedBuildInputs = with python3.pkgs; [
+    appdirs
+    configargparse
+    connection-pool
+    datrie
+    docutils
+    gitpython
+    humanfriendly
+    immutables
+    jinja2
+    jsonschema
+    nbformat
+    psutil
+    pulp
+    pyyaml
+    requests
+    reretry
+    smart-open
+    snakemake-interface-executor-plugins
+    snakemake-interface-common
+    snakemake-interface-storage-plugins
+    stopit
+    tabulate
+    throttler
+    toposort
+    wrapt
+    yte
+  ];
+
+  # See
+  # https://github.com/snakemake/snakemake/blob/main/.github/workflows/main.yml#L99
+  # for the current basic test suite. Slurm, Tibanna and Tes require extra
+  # setup.
+
+  nativeCheckInputs = with python3.pkgs; [
+    numpy
+    pandas
+    pytestCheckHook
+    requests-mock
+    snakemake-executor-plugin-cluster-generic
+  ];
+
+  disabledTestPaths = [
+    "tests/test_conda_python_3_7_script/test_script.py"
+  ];
+
+  disabledTests = [
+    "test_deploy_sources"
+  ];
+
+  pythonImportsCheck = [
+    "snakemake"
+  ];
+
+  preCheck = ''
+    export HOME="$(mktemp -d)"
+  '';
+
+  meta = with lib; {
+    homepage = "https://snakemake.github.io";
+    license = licenses.mit;
+    description = "Python-based execution environment for make-like workflows";
+    mainProgram = "snakemake";
+    longDescription = ''
+      Snakemake is a workflow management system that aims to reduce the complexity of
+      creating workflows by providing a fast and comfortable execution environment,
+      together with a clean and readable specification language in Python style. Snakemake
+      workflows are essentially Python scripts extended by declarative code to define
+      rules. Rules describe how to create output files from input files.
+    '';
+    maintainers = with maintainers; [ helkafen renatoGarcia veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/toil/default.nix b/nixpkgs/pkgs/applications/science/misc/toil/default.nix
new file mode 100644
index 000000000000..9142676fff48
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/toil/default.nix
@@ -0,0 +1,90 @@
+{ lib
+, fetchFromGitHub
+, python3
+, rsync
+}:
+
+python3.pkgs.buildPythonApplication rec {
+  pname = "toil";
+  version = "5.12.0";
+  format = "setuptools";
+
+  src = fetchFromGitHub {
+    owner = "DataBiosphere";
+    repo = pname;
+    rev = "refs/tags/releases/${version}";
+    hash = "sha256-cTpbQo9tPZifUO59vbnIa3XUinFJ2/5Slfe4yszglFM=";
+  };
+
+  propagatedBuildInputs = with python3.pkgs; [
+    addict
+    dill
+    docker
+    enlighten
+    psutil
+    py-tes
+    pypubsub
+    python-dateutil
+    pytz
+    pyyaml
+    requests
+    typing-extensions
+  ];
+
+  nativeCheckInputs = [
+    rsync
+  ] ++ (with python3.pkgs; [
+    boto
+    botocore
+    flask
+    pytestCheckHook
+    stubserver
+  ]);
+
+  pytestFlagsArray = [
+    "src/toil/test"
+  ];
+
+  pythonImportsCheck = [
+    "toil"
+  ];
+
+  disabledTestPaths = [
+    # Tests are reaching their timeout
+    "src/toil/test/docs/scriptsTest.py"
+    "src/toil/test/jobStores/jobStoreTest.py"
+    "src/toil/test/provisioners/aws/awsProvisionerTest.py"
+    "src/toil/test/src"
+    "src/toil/test/wdl"
+    "src/toil/test/utils/utilsTest.py"
+    "src/toil/test/cwl/cwlTest.py"
+    "src/toil/test/lib/test_ec2.py"
+    "src/toil/test/lib/aws/test_iam.py"
+    "src/toil/test/lib/aws/test_s3.py"
+  ];
+
+  disabledTests = [
+    # Tests fail starting with 5.7.1
+    "testServices"
+    "testConcurrencyWithDisk"
+    "testJobConcurrency"
+    "testNestedResourcesDoNotBlock"
+    "test_omp_threads"
+    "testFileSingle"
+    "testFileSingle10000"
+    "testFileSingleCheckpoints"
+    "testFileSingleNonCaching"
+    "testFetchJobStoreFiles"
+    "testFetchJobStoreFilesWSymlinks"
+    "testJobStoreContents"
+    "test_cwl_on_arm"
+    "test_cwl_toil_kill"
+  ];
+
+  meta = with lib; {
+    description = "Workflow engine written in pure Python";
+    homepage = "https://toil.ucsc-cgl.org/";
+    license = with licenses; [ asl20 ];
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/tulip/default.nix b/nixpkgs/pkgs/applications/science/misc/tulip/default.nix
new file mode 100644
index 000000000000..02b5ad0c0458
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/tulip/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchurl, libxml2, freetype, libGLU, libGL, glew
+, qtbase, wrapQtAppsHook, autoPatchelfHook, python3
+, cmake, libjpeg, llvmPackages }:
+
+stdenv.mkDerivation rec {
+  pname = "tulip";
+  version = "5.7.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/auber/tulip-${version}_src.tar.gz";
+    hash = "sha256-arpC+FsDYGMf47phtSzyjjvDg/UYZS+akOe5CYfajdU=";
+  };
+
+  nativeBuildInputs = [ cmake wrapQtAppsHook ]
+    ++ lib.optionals stdenv.isLinux [ autoPatchelfHook ];
+
+  buildInputs = [ libxml2 freetype glew libjpeg qtbase python3 ]
+    ++ lib.optionals stdenv.isDarwin [ llvmPackages.openmp ]
+    ++ lib.optionals stdenv.isLinux [ libGLU libGL ];
+
+  qtWrapperArgs = [ ''--prefix PATH : ${lib.makeBinPath [ python3 ]}'' ];
+
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin (toString [
+    # fatal error: 'Python.h' file not found
+    "-I${python3}/include/${python3.libPrefix}"
+    # error: format string is not a string literal (potentially insecure)
+    "-Wno-format-security"
+  ]);
+
+  # FIXME: "make check" needs Docbook's DTD 4.4, among other things.
+  doCheck = false;
+
+  meta = {
+    description = "A visualization framework for the analysis and visualization of relational data";
+
+    longDescription =
+      '' Tulip is an information visualization framework dedicated to the
+         analysis and visualization of relational data.  Tulip aims to
+         provide the developer with a complete library, supporting the design
+         of interactive information visualization applications for relational
+         data that can be tailored to the problems he or she is addressing.
+      '';
+
+    homepage = "http://tulip.labri.fr/";
+
+    license = lib.licenses.gpl3Plus;
+
+    maintainers = [ ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/vite/default.nix b/nixpkgs/pkgs/applications/science/misc/vite/default.nix
new file mode 100644
index 000000000000..f1c9329c94df
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/vite/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitLab, lib, cmake, qtbase, qttools, qtcharts, libGLU, libGL, glm, glew, wrapQtAppsHook }:
+
+stdenv.mkDerivation rec {
+  pname = "vite";
+  version = "unstable-2022-05-17";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.inria.fr";
+    owner = "solverstack";
+    repo = pname;
+    rev = "6d497cc519fac623e595bd174e392939c4de845c";
+    hash = "sha256-Yf2jYALZplIXzVtd/sg6gzEYrZ+oU0zLG1ETd/hiTi0=";
+  };
+
+  nativeBuildInputs = [ cmake qttools wrapQtAppsHook ];
+  buildInputs = [ qtbase qtcharts libGLU libGL glm glew ];
+
+  meta = {
+    description = "Visual Trace Explorer (ViTE), a tool to visualize execution traces";
+    mainProgram = "vite";
+
+    longDescription = ''
+      ViTE is a trace explorer. It is a tool to visualize execution
+      traces in Pajé or OTF format for debugging and profiling
+      parallel or distributed applications.
+    '';
+
+    homepage = "http://vite.gforge.inria.fr/";
+    license = lib.licenses.cecill20;
+    maintainers = with lib.maintainers; [ ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/molecular-dynamics/dl-poly-classic/default.nix b/nixpkgs/pkgs/applications/science/molecular-dynamics/dl-poly-classic/default.nix
new file mode 100644
index 000000000000..75ab576212d7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/molecular-dynamics/dl-poly-classic/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchurl
+, gfortran, mpi
+}:
+
+stdenv.mkDerivation {
+  version = "1.10";
+  pname = "DL_POLY_Classic";
+
+  src = fetchurl {
+    url = "https://ccpforge.cse.rl.ac.uk/gf/download/frsrelease/574/8924/dl_class_1.10.tar.gz";
+    sha256 = "1r76zvln3bwycxlmqday0sqzv5j260y7mdh66as2aqny6jzd5ld7";
+  };
+
+  nativeBuildInputs = [ gfortran ];
+
+  buildInputs = [ mpi ];
+
+  configurePhase = ''
+    cd source
+    cp -v ../build/MakePAR Makefile
+  '';
+
+  # https://gitlab.com/DL_POLY_Classic/dl_poly/-/blob/master/README
+  env.NIX_CFLAGS_COMPILE = "-fallow-argument-mismatch";
+
+  buildPhase = ''
+    make dlpoly
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -v ../execute/DLPOLY.X $out/bin
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.ccp5.ac.uk/DL_POLY_C";
+    description = "DL_POLY Classic is a general purpose molecular dynamics simulation package";
+    mainProgram = "DLPOLY.X";
+    license = licenses.bsdOriginal;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.costrouc ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/molecular-dynamics/gromacs/default.nix b/nixpkgs/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
new file mode 100644
index 000000000000..6ab9ec5d9cc3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
@@ -0,0 +1,150 @@
+{ lib
+, stdenv
+, fetchurl
+, cmake
+, hwloc
+, fftw
+, perl
+, blas
+, lapack
+, llvmPackages
+, mpi
+, cudaPackages
+, plumed
+, singlePrec ? true
+, config
+, enableCuda ? config.cudaSupport
+, enableMpi ? false
+, enablePlumed ? false
+, cpuAcceleration ? null
+}:
+
+
+# CUDA is only implemented for single precission
+assert enableCuda -> singlePrec;
+
+let
+  inherit (cudaPackages.cudaFlags) cudaCapabilities dropDot;
+
+  # Select reasonable defaults for all major platforms
+  # The possible values are defined in CMakeLists.txt:
+  # AUTO None SSE2 SSE4.1 AVX_128_FMA AVX_256 AVX2_256
+  # AVX2_128 AVX_512 AVX_512_KNL MIC ARM_NEON ARM_NEON_ASIMD
+  SIMD = x: if (cpuAcceleration != null) then x else
+    if stdenv.hostPlatform.system == "i686-linux" then "SSE2" else
+    if stdenv.hostPlatform.system == "x86_64-linux" then "SSE4.1" else
+    if stdenv.hostPlatform.system == "x86_64-darwin" then "SSE4.1" else
+    if stdenv.hostPlatform.system == "aarch64-linux" then "ARM_NEON_ASIMD" else
+    "None";
+
+  source =
+    if enablePlumed then
+      {
+        version = "2023";
+        hash = "sha256-rJLG2nL7vMpBT9io2Xnlbs8XxMHNq+0tpc+05yd7e6g=";
+      }
+    else
+      {
+        version = "2024.1";
+        hash = "sha256-k32PEqNv/78q963XGtu1qlxVN4ktRsmnavvsqxqgqsc=";
+      };
+
+in stdenv.mkDerivation rec {
+  pname = "gromacs";
+  version = source.version;
+
+  src = fetchurl {
+    url = "ftp://ftp.gromacs.org/pub/gromacs/gromacs-${version}.tar.gz";
+    inherit (source) hash;
+  };
+
+  patches = [ ./pkgconfig.patch ];
+
+  postPatch = lib.optionalString enablePlumed ''
+    plumed patch -p -e gromacs-2023
+  '';
+
+  outputs = [ "out" "dev" "man" ];
+
+  nativeBuildInputs =
+    [ cmake ]
+    ++ lib.optional enablePlumed plumed
+    ++ lib.optionals enableCuda [ cudaPackages.cuda_nvcc ];
+
+  buildInputs = [
+    fftw
+    perl
+    hwloc
+    blas
+    lapack
+  ] ++ lib.optional enableMpi mpi
+  ++ lib.optionals enableCuda [
+    cudaPackages.cuda_cccl
+    cudaPackages.cuda_cudart
+    cudaPackages.libcufft
+    cudaPackages.cuda_profiler_api
+  ] ++ lib.optional stdenv.isDarwin llvmPackages.openmp;
+
+  propagatedBuildInputs = lib.optional enableMpi mpi;
+  propagatedUserEnvPkgs = lib.optional enableMpi mpi;
+
+  cmakeFlags = [
+    (lib.cmakeBool "GMX_HWLOC" true)
+    "-DGMX_SIMD:STRING=${SIMD cpuAcceleration}"
+    "-DGMX_OPENMP:BOOL=TRUE"
+    "-DBUILD_SHARED_LIBS=ON"
+  ] ++ (
+    if singlePrec then [
+      "-DGMX_DOUBLE=OFF"
+    ] else [
+      "-DGMX_DOUBLE=ON"
+      "-DGMX_DEFAULT_SUFFIX=OFF"
+    ]
+  ) ++ (
+    if enableMpi
+      then [
+        "-DGMX_MPI:BOOL=TRUE"
+        "-DGMX_THREAD_MPI:BOOL=FALSE"
+      ]
+     else [
+       "-DGMX_MPI:BOOL=FALSE"
+     ]
+  ) ++ lib.optionals enableCuda [
+    "-DGMX_GPU=CUDA"
+    (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" (builtins.concatStringsSep ";" (map dropDot cudaCapabilities)))
+
+    # Gromacs seems to ignore and override the normal variables, so we add this ad hoc:
+    (lib.cmakeFeature "GMX_CUDA_TARGET_COMPUTE" (builtins.concatStringsSep ";" (map dropDot cudaCapabilities)))
+  ];
+
+  postInstall = ''
+    moveToOutput share/cmake $dev
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.gromacs.org";
+    license = licenses.lgpl21Plus;
+    description = "Molecular dynamics software package";
+    longDescription = ''
+      GROMACS is a versatile package to perform molecular dynamics,
+      i.e. simulate the Newtonian equations of motion for systems
+      with hundreds to millions of particles.
+
+      It is primarily designed for biochemical molecules like
+      proteins, lipids and nucleic acids that have a lot of
+      complicated bonded interactions, but since GROMACS is
+      extremely fast at calculating the nonbonded interactions (that
+      usually dominate simulations) many groups are also using it
+      for research on non-biological systems, e.g. polymers.
+
+      GROMACS supports all the usual algorithms you expect from a
+      modern molecular dynamics implementation, (check the online
+      reference or manual for details), but there are also quite a
+      few features that make it stand out from the competition.
+
+      See: https://www.gromacs.org/about.html for details.
+    '';
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ sheepforce markuskowa ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/molecular-dynamics/gromacs/pkgconfig.patch b/nixpkgs/pkgs/applications/science/molecular-dynamics/gromacs/pkgconfig.patch
new file mode 100644
index 000000000000..6740d2312369
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/molecular-dynamics/gromacs/pkgconfig.patch
@@ -0,0 +1,24 @@
+diff --git a/src/external/muparser/muparser.pc.in b/src/external/muparser/muparser.pc.in
+index 646787cb53..9b97ad57f7 100644
+--- a/src/external/muparser/muparser.pc.in
++++ b/src/external/muparser/muparser.pc.in
+@@ -1,7 +1,5 @@
+-prefix=@CMAKE_INSTALL_PREFIX@

+-exec_prefix=${prefix}

+-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@

+-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@

++libdir=@CMAKE_INSTALL_FULL_LIBDIR@

++includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@

+ 

+ Name: @PACKAGE_NAME@

+ Description: Mathematical expressions parser library

+diff --git a/src/gromacs/libgromacs.pc.cmakein b/src/gromacs/libgromacs.pc.cmakein
+index ec1ed6684e..ca1105474a 100644
+--- a/src/gromacs/libgromacs.pc.cmakein
++++ b/src/gromacs/libgromacs.pc.cmakein
+@@ -1,4 +1,4 @@
+-libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@
++libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+ 
+ Name: libgromacs@GMX_LIBS_SUFFIX@
+ Description: Gromacs library
diff --git a/nixpkgs/pkgs/applications/science/molecular-dynamics/lammps/default.nix b/nixpkgs/pkgs/applications/science/molecular-dynamics/lammps/default.nix
new file mode 100644
index 000000000000..4c2a80c2f1b7
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/molecular-dynamics/lammps/default.nix
@@ -0,0 +1,121 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, libpng
+, gzip
+, fftw
+, blas
+, lapack
+, cmake
+, cudaPackages
+, pkg-config
+# Available list of packages can be found near here:
+#
+# - https://github.com/lammps/lammps/blob/develop/cmake/CMakeLists.txt#L222
+# - https://docs.lammps.org/Build_extras.html
+, packages ? {
+  ASPHERE = true;
+  BODY = true;
+  CLASS2 = true;
+  COLLOID = true;
+  COMPRESS = true;
+  CORESHELL = true;
+  DIPOLE = true;
+  GRANULAR = true;
+  KSPACE = true;
+  MANYBODY = true;
+  MC = true;
+  MISC = true;
+  MOLECULE = true;
+  OPT = true;
+  PERI = true;
+  QEQ = true;
+  REPLICA = true;
+  RIGID = true;
+  SHOCK = true;
+  ML-SNAP = true;
+  SRD = true;
+  REAXFF = true;
+}
+# Extra cmakeFlags to add as "-D${attr}=${value}"
+, extraCmakeFlags ? {}
+# Extra `buildInputs` - meant for packages that require more inputs
+, extraBuildInputs ? []
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  # LAMMPS has weird versioning convention. Updates should go smoothly with:
+  # nix-update --commit lammps --version-regex 'stable_(.*)'
+  version = "2Aug2023_update3";
+  pname = "lammps";
+
+  src = fetchFromGitHub {
+    owner = "lammps";
+    repo = "lammps";
+    rev = "stable_${finalAttrs.version}";
+    hash = "sha256-jx0hkiYxQlnE2sa4WTvluEgphF//sNbK91VGAQJMwjw=";
+  };
+  preConfigure = ''
+    cd cmake
+  '';
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    # Although not always needed, it is needed if cmakeFlags include
+    # GPU_API=cuda, and it doesn't users that don't enable the GPU package.
+    cudaPackages.autoAddDriverRunpath
+  ];
+
+  passthru = {
+    # Remove these at some point - perhaps after release 23.11. See discussion at:
+    # https://github.com/NixOS/nixpkgs/pull/238771#discussion_r1235459961
+    mpi = throw "`lammps-mpi.passthru.mpi` was removed in favor of `extraBuildInputs`";
+    inherit packages;
+    inherit extraCmakeFlags;
+    inherit extraBuildInputs;
+  };
+  cmakeFlags = [
+  ]
+  ++ (builtins.map (p: "-DPKG_${p}=ON") (builtins.attrNames (lib.filterAttrs (n: v: v) packages)))
+  ++ (lib.mapAttrsToList (n: v: "-D${n}=${v}") extraCmakeFlags)
+  ;
+
+  buildInputs = [
+    fftw
+    libpng
+    blas
+    lapack
+    gzip
+  ] ++ extraBuildInputs
+  ;
+
+  postInstall = ''
+    # For backwards compatibility
+    ln -s $out/bin/lmp $out/bin/lmp_serial
+    # Install vim and neovim plugin
+    install -Dm644 ../../tools/vim/lammps.vim $out/share/vim-plugins/lammps/syntax/lammps.vim
+    install -Dm644 ../../tools/vim/filetype.vim $out/share/vim-plugins/lammps/ftdetect/lammps.vim
+    mkdir -p $out/share/nvim
+    ln -s $out/share/vim-plugins/lammps $out/share/nvim/site
+  '';
+
+  meta = with lib; {
+    description = "Classical Molecular Dynamics simulation code";
+    longDescription = ''
+      LAMMPS is a classical molecular dynamics simulation code designed to
+      run efficiently on parallel computers. It was developed at Sandia
+      National Laboratories, a US Department of Energy facility, with
+      funding from the DOE. It is an open-source code, distributed freely
+      under the terms of the GNU Public License (GPL).
+      '';
+    homepage = "https://www.lammps.org";
+    license = licenses.gpl2Only;
+    platforms = platforms.linux;
+    # compiling lammps with 64 bit support blas and lapack might cause runtime
+    # segfaults. In anycase both blas and lapack should have the same #bits
+    # support.
+    broken = (blas.isILP64 && lapack.isILP64);
+    maintainers = [ maintainers.costrouc maintainers.doronbehar ];
+    mainProgram = "lmp";
+  };
+})
diff --git a/nixpkgs/pkgs/applications/science/molecular-dynamics/raspa/data.nix b/nixpkgs/pkgs/applications/science/molecular-dynamics/raspa/data.nix
new file mode 100644
index 000000000000..bcc9dc3b372e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/molecular-dynamics/raspa/data.nix
@@ -0,0 +1,33 @@
+{ lib
+, stdenvNoCC
+, gzip
+, raspa
+}:
+
+stdenvNoCC.mkDerivation rec {
+  pname = "raspa-data";
+  inherit (raspa) version src;
+
+  outputs = [ "out" "doc" ];
+
+  nativeBuildInpuhs = [ gzip ];
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p "$out/share/raspa"
+    mv examples "$out/share/raspa"
+    mkdir -p "$doc/share/raspa"
+    mv -T "Docs" "$doc/share/raspa/doc"
+    runHook postInstall
+  '';
+
+  # Keep the shebangs of the examples from being patched
+  dontPatchShebangs = true;
+
+  meta = with lib; {
+    inherit (raspa.meta) homepage license maintainers;
+    description = "Example packs and documentation of RASPA";
+    outputsToInstall = [ "out" "doc" ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/molecular-dynamics/raspa/default.nix b/nixpkgs/pkgs/applications/science/molecular-dynamics/raspa/default.nix
new file mode 100644
index 000000000000..149db0504bf1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/molecular-dynamics/raspa/default.nix
@@ -0,0 +1,79 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, makeWrapper
+, fftw
+, lapack
+, openblas
+, runCommandLocal
+, raspa
+, raspa-data
+}:
+stdenv.mkDerivation rec {
+  pname = "raspa";
+  version = "2.0.47";
+
+  src = fetchFromGitHub {
+    owner = "iRASPA";
+    repo = "RASPA2";
+    rev = "v${version}";
+    hash = "sha256-i8Y+pejiOuyPNJto+/0CmRoAnMljCrnDFx8qDh4I/68=";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    makeWrapper
+  ];
+
+  buildInputs = [
+    fftw
+    lapack
+    openblas
+  ];
+
+  # Prepare for the Python binding packaging.
+  strictDeps = true;
+
+  enableParallelBuilding = true;
+
+  preAutoreconf = ''
+    mkdir "m4"
+  '';
+
+  postAutoreconf = ''
+    automake --add-missing
+    autoconf
+  '';
+
+  doCheck = true;
+
+  # Wrap with RASPA_DIR
+  # so that users can run $out/bin/simulate directly
+  # without the need of a `run` srcipt.
+  postInstall = ''
+    wrapProgram "$out/bin/simulate" \
+      --set RASPA_DIR "$out"
+  '';
+
+  passthru.tests.run-an-example = runCommandLocal "raspa-test-run-an-example" { }
+    ''
+      set -eu -o pipefail
+      exampleDir="${raspa-data}/share/raspa/examples/Basic/1_MC_Methane_in_Box"
+      exampleDirWritable="$(basename "$exampleDir")"
+      cp -rT "$exampleDir" "./$exampleDirWritable"
+      chmod u+rw -R "$exampleDirWritable"
+      cd "$exampleDirWritable"
+      ${raspa}/bin/simulate
+      touch "$out"
+    '';
+
+  meta = with lib; {
+    description = "A general purpose classical molecular simulation package";
+    homepage = "https://iraspa.org/raspa/";
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ ShamrockLee ];
+    mainProgram = "simulate";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/molecular-dynamics/viennarna/default.nix b/nixpkgs/pkgs/applications/science/molecular-dynamics/viennarna/default.nix
new file mode 100644
index 000000000000..f292cbb378c9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/molecular-dynamics/viennarna/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, stdenv
+, fetchurl
+, gsl
+, mpfr
+, perl
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "viennarna";
+  version = "2.5.1";
+
+  src = fetchurl {
+    url = "https://www.tbi.univie.ac.at/RNA/download/sourcecode/2_5_x/ViennaRNA-${version}.tar.gz";
+    sha256 = "sha256-BUAEN88VWV4QsaJd9snEiFbzVhMPnR44D6iGa20n9Fc=";
+  };
+
+  buildInputs = [
+    gsl
+    mpfr
+    perl
+    python3
+  ];
+
+  configureFlags = [
+    "--with-cluster"
+    "--with-kinwalker"
+  ];
+
+  meta = with lib; {
+    description = "Prediction and comparison of RNA secondary structures";
+    homepage = "https://www.tbi.univie.ac.at/RNA/";
+    license = licenses.unfree;
+    maintainers = with maintainers; [ prusnak ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/networking/sumo/default.nix b/nixpkgs/pkgs/applications/science/networking/sumo/default.nix
new file mode 100644
index 000000000000..956691582bda
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/networking/sumo/default.nix
@@ -0,0 +1,69 @@
+{ lib, bzip2, cmake, eigen, fetchFromGitHub, ffmpeg_4, fox_1_6, gdal,
+  git, gl2ps, gpp , gtest, jdk, libGL, libGLU, libX11, libjpeg,
+  libpng, libtiff, libxcrypt, openscenegraph , proj, python3,
+  python3Packages, stdenv, swig, xercesc, xorg, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "sumo";
+  version = "1.19.0";
+
+  src = fetchFromGitHub {
+    owner = "eclipse";
+    repo = "sumo";
+    rev = "v${lib.replaceStrings ["."] ["_"] version}";
+    sha256 = "sha256-uB7Gy0uX3LsZDeeITyjl7DN76TFJQKgsQs4RoDVfSmY=";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [
+    cmake
+    git
+    swig
+  ];
+
+  buildInputs = [
+    bzip2
+    eigen
+    ffmpeg_4
+    fox_1_6
+    gdal
+    gl2ps
+    gpp
+    gtest
+    jdk
+    libGL
+    libGLU
+    libjpeg
+    libpng
+    libtiff
+    libxcrypt
+    openscenegraph
+    proj
+    python3Packages.setuptools
+    xercesc
+    zlib
+    python3
+  ] ++ (with xorg; [
+    libX11
+    libXcursor
+    libXext
+    libXfixes
+    libXft
+    libXrandr
+    libXrender
+  ]);
+
+  meta = with lib; {
+    description = "The SUMO traffic simulator";
+    longDescription = ''
+      Eclipse SUMO is an open source, highly
+      portable, microscopic and continuous traffic simulation package
+      designed to handle large networks. It allows for intermodal
+      simulation including pedestrians and comes with a large set of
+      tools for scenario creation.
+    '';
+    homepage = "https://github.com/eclipse/sumo";
+    license = licenses.epl20;
+    maintainers = with maintainers; [ mtreca ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/physics/MCFM/default.nix b/nixpkgs/pkgs/applications/science/physics/MCFM/default.nix
new file mode 100644
index 000000000000..7b6000dfea8d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/MCFM/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, cmake, gfortran, lhapdf }:
+
+stdenv.mkDerivation rec {
+  pname = "MCFM";
+  version = "10.0.1";
+
+  src = fetchurl {
+    url = "https://mcfm.fnal.gov/downloads/${pname}-${version}.tar.gz";
+    sha256 = "sha256-3Dg4KoILb0XhgGkzItDh/1opCtYrrIvtbuALYqPUvE8=";
+  };
+
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace 'target_link_libraries(mcfm lhapdf_lib)' \
+                'target_link_libraries(mcfm ''${lhapdf_lib})'
+  '';
+
+  nativeBuildInputs = [ cmake gfortran ];
+  buildInputs = [ lhapdf ];
+
+  cmakeFlags = [
+    "-Duse_external_lhapdf=ON"
+    "-Duse_internal_lhapdf=OFF"
+  ];
+
+  meta = with lib; {
+    description = "Monte Carlo for FeMtobarn processes";
+    homepage = "https://mcfm.fnal.gov";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ veprbl ];
+    platforms = lib.platforms.x86_64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/physics/crystfel/default.nix b/nixpkgs/pkgs/applications/science/physics/crystfel/default.nix
new file mode 100644
index 000000000000..92b48ec86309
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/crystfel/default.nix
@@ -0,0 +1,242 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchFromGitHub
+, fetchpatch
+, fetchzip
+, cmake
+, lz4
+, bzip2
+, m4
+, hdf5
+, gsl
+, unzip
+, makeWrapper
+, meson
+, git
+, ninja
+, eigen
+, pkg-config
+, wrapGAppsHook
+, flex
+, bison
+, doxygen
+, opencl-headers
+, ncurses
+, msgpack
+, fftw
+, zeromq
+, ocl-icd
+, gtk3
+, gdk-pixbuf
+, argp-standalone
+, memorymappingHook
+, withGui ? true
+, withBitshuffle ? true
+}:
+
+let
+  libccp4 = stdenv.mkDerivation rec {
+    pname = "libccp4";
+    version = "8.0.0";
+    src = fetchurl {
+      url = "https://ftp.ccp4.ac.uk/opensource/${pname}-${version}.tar.gz";
+      hash = "sha256-y4E66GYSoIZjKd6rfO6W6sVz2BvlskA0HUD5rVMi/y0=";
+    };
+    nativeBuildInputs = [ meson ninja ];
+    buildInputs = [ hdf5 gsl ];
+
+    configureFlags = [ "FFLAGS=-fallow-argument-mismatch" ];
+
+    # libccp4 tries to read syminfo.lib by looking at an environment variable, which hinders reproducibility.
+    # We hard-code this by providing a little patch and then passing the absolute path to syminfo.lib as a
+    # preprocessor flag.
+    env.NIX_CFLAGS_COMPILE = "-DNIX_PROVIDED_SYMOP_FILE=\"${placeholder "out"}/share/ccp4/syminfo.lib\"";
+
+    patches = [
+      ./libccp4-use-hardcoded-syminfo-lib.patch
+    ];
+
+    postPatch =
+      let
+        mesonPatch = fetchzip {
+          url = "https://wrapdb.mesonbuild.com/v2/libccp4c_8.0.0-1/get_patch#somefile.zip";
+          hash = "sha256-ohskfKh+972Pl56KtwAeWwHtAaAFNpCzz5vZBAI/vdU=";
+        };
+      in
+      ''
+        cp ${mesonPatch}/meson.build .
+      '';
+  };
+  # This is the statically-linked, pre-built binary of mosflm. Compiling it ourselves turns out to be very difficult
+  # since the build process is very hard-coded for a specific machine, architecture, and libraries.
+  mosflm =
+    let
+      version = "7.4.0";
+      src =
+        if stdenv.isDarwin then
+          fetchurl
+            {
+              url = "https://www.mrc-lmb.cam.ac.uk/mosflm/mosflm/ver${builtins.replaceStrings [ "." ] [ "" ] version}/pre-built/mosflm-osx-64-noX11.zip";
+              sha256 = "1da5wimv3kl8bccp49j69vh8gi28cn7axg59lrmb38s68c618h7j";
+            }
+        else
+          fetchurl {
+            url = "https://www.mrc-lmb.cam.ac.uk/mosflm/mosflm/ver${builtins.replaceStrings [ "." ] [ "" ] version}/pre-built/mosflm-linux-64-noX11.zip";
+            hash = "sha256:1f2qins5kaz5v6mkaclncqpirx3mlz177ywm13py9p6s9mk99g32";
+          };
+      mosflmBinary = if stdenv.isDarwin then "bin/mosflm" else "mosflm-linux-64-noX11";
+    in
+    stdenv.mkDerivation rec {
+      pname = "mosflm";
+
+      inherit version src;
+
+      dontBuild = true;
+
+      nativeBuildInputs = [ unzip makeWrapper ];
+
+      sourceRoot = ".";
+
+      # mosflm statically links against its own libccp4, which as the syminfo.lib environment variable problem.
+      # Here, we circumvent it by creating a little wrapper script that calls mosflm after setting the SYMINFO variable.
+      installPhase = ''
+        mkdir -p $out/bin
+        cp ${mosflmBinary} $out/bin/mosflm-raw
+        makeWrapper $out/bin/mosflm-raw $out/bin/mosflm --set SYMINFO ${libccp4}/share/syminfo.lib --add-flags -n
+      '';
+    };
+
+  xgandalf = stdenv.mkDerivation rec {
+    pname = "xgandalf";
+    version = "c6c5003ff1086e8c0fb5313660b4f02f3a3aab7b";
+    src = fetchurl {
+      url = "https://gitlab.desy.de/thomas.white/${pname}/-/archive/${version}/${pname}-${version}.tar.gz";
+      hash = "sha256-/uZlBwAINSoYqgLQFTMz8rS1Rpadu79JkO6Bu/+Nx9E=";
+    };
+
+    nativeBuildInputs = [ meson pkg-config ninja ];
+    buildInputs = [ eigen ];
+  };
+
+  pinkIndexer = stdenv.mkDerivation rec {
+    pname = "pinkindexer";
+    version = "5d4e016941eb2a9e50a10df96ded7ff1e2464503";
+    src = fetchurl {
+      url = "https://gitlab.desy.de/thomas.white/${pname}/-/archive/${version}/${pname}-${version}.tar.gz";
+      hash = "sha256-VnJOJJ247dNoBlos4Fu3GQBlAnTk9el+yZDRiicJtu0=";
+    };
+
+    nativeBuildInputs = [ meson pkg-config ninja ];
+    buildInputs = [ eigen ];
+  };
+
+  fdip = stdenv.mkDerivation rec {
+    pname = "fdip";
+    version = "5628fedddd79323b4b26df9b85e9543d83286d4c";
+    src = fetchurl {
+      url = "https://gitlab.desy.de/thomas.white/fdip/-/archive/${version}/fdip-${version}.tar.gz";
+      hash = "sha256-EaihnW7p//ecgMn+KKlfmBeXrnAqs+HdhN+ovuSrtiQ=";
+    };
+
+    nativeBuildInputs = [ meson ninja pkg-config ];
+    buildInputs = [ eigen ];
+  };
+
+  hdf5-external-filter-plugins = stdenv.mkDerivation rec {
+    pname = "HDF5-External-Filter-Plugins";
+    version = "0.1.0";
+    src = fetchFromGitHub {
+      owner = "nexusformat";
+      repo = pname;
+      rev = "49e3b65eca772bca77af13ba047d8b577673afba";
+      hash = "sha256-bEzfWdZuHmb0PDzCqy8Dey4tLtq+4coO0sT0GzqrTYI=";
+    };
+
+    patches = [
+      (fetchpatch {
+        url = "https://github.com/spanezz/HDF5-External-Filter-Plugins/commit/6b337fe36da97a3ef72354393687ce3386c0709d.patch";
+        hash = "sha256-wnBEdL/MjEyRHPwaVtuhzY+DW1AFeaUQUmIXh+JaRHo=";
+      })
+    ];
+
+    nativeBuildInputs = [ cmake ];
+    buildInputs = [ hdf5 lz4 bzip2 ];
+
+    cmakeFlags = [
+      "-DENABLE_BITSHUFFLE_PLUGIN=yes"
+      "-DENABLE_LZ4_PLUGIN=yes"
+      "-DENABLE_BZIP2_PLUGIN=yes"
+    ];
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "crystfel";
+  version = "0.10.2";
+  src = fetchurl {
+    url = "https://www.desy.de/~twhite/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "sha256-nCO9ndDKS54bVN9IhFBiCVNzqk7BsCljXFrOmlx+sP4=";
+  };
+  nativeBuildInputs = [ meson pkg-config ninja flex bison doxygen opencl-headers makeWrapper ]
+    ++ lib.optionals withGui [ wrapGAppsHook ];
+  buildInputs = [
+    hdf5
+    gsl
+    ncurses
+    msgpack
+    fftw
+    fdip
+    zeromq
+    ocl-icd
+    libccp4
+    mosflm
+    pinkIndexer
+    xgandalf
+  ] ++ lib.optionals withGui [ gtk3 gdk-pixbuf ]
+  ++ lib.optionals stdenv.isDarwin [
+    argp-standalone
+  ] ++ lib.optionals (stdenv.isDarwin && !stdenv.isAarch64) [
+    memorymappingHook
+  ]
+  ++ lib.optionals withBitshuffle [ hdf5-external-filter-plugins ];
+
+  patches = [
+    ./link-to-argp-standalone-if-needed.patch
+    ./disable-fmemopen-on-aarch64-darwin.patch
+    (fetchpatch {
+      url = "https://gitlab.desy.de/thomas.white/crystfel/-/commit/3c54d59e1c13aaae716845fed2585770c3ca9d14.diff";
+      hash = "sha256-oaJNBQQn0c+z4p1pnW4osRJA2KdKiz4hWu7uzoKY7wc=";
+    })
+  ];
+
+  # CrystFEL calls mosflm by searching PATH for it. We could've create a wrapper script that sets the PATH, but
+  # we'd have to do that for every CrystFEL executable (indexamajig, crystfel, partialator). Better to just
+  # hard-code mosflm's path once.
+  postPatch = ''
+    sed -i -e 's#execlp("mosflm"#execl("${mosflm}/bin/mosflm"#' libcrystfel/src/indexers/mosflm.c;
+  '';
+
+  postInstall = lib.optionalString withBitshuffle ''
+    for file in $out/bin/*; do
+      wrapProgram $file --set HDF5_PLUGIN_PATH ${hdf5-external-filter-plugins}/lib/plugins
+    done
+  '';
+
+  meta = with lib; {
+    description = "Data processing for serial crystallography";
+    longDescription = ''
+      CrystFEL is a suite of programs for processing (and simulating) Bragg diffraction data from "serial crystallography" experiments, often (but not always) performed using an X-ray Free-Electron Laser. Compared to rotation data, some of the particular characteristics of such data which call for a specialised software suite are:
+
+      - The sliced, rather than integrated, measurement of intensity data. Many, if not all reflections are partially integrated.
+      - Many patterns (thousands) are required - high throughput is needed.
+      - The crystal orientations in each pattern are random and uncorrelated.
+      - Merging into lower symmetry point groups may require the resolution of indexing ambiguities.'';
+    homepage = "https://www.desy.de/~twhite/crystfel/";
+    changelog = "https://www.desy.de/~twhite/crystfel/changes.html";
+    downloadPage = "https://www.desy.de/~twhite/crystfel/download.html";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ pmiddend ];
+    platforms = platforms.unix;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/science/physics/crystfel/disable-fmemopen-on-aarch64-darwin.patch b/nixpkgs/pkgs/applications/science/physics/crystfel/disable-fmemopen-on-aarch64-darwin.patch
new file mode 100644
index 000000000000..c35350d0008f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/crystfel/disable-fmemopen-on-aarch64-darwin.patch
@@ -0,0 +1,13 @@
+diff --git a/libcrystfel/src/image-cbf.c b/libcrystfel/src/image-cbf.c
+index b8f09a1f..f8a15c1b 100644
+--- a/libcrystfel/src/image-cbf.c
++++ b/libcrystfel/src/image-cbf.c
+@@ -287,7 +287,7 @@ static float *read_cbf_data(const char *filename, int gz, int *w, int *h)
+ 
+ 	} else {
+ 
+-		#ifdef HAVE_ZLIB
++		#if defined(HAVE_ZLIB) && !(defined(__aarch64__) && defined(__APPLE__))
+ 		gzFile gzfh;
+ 		int len_read;
+ 		size_t len;
diff --git a/nixpkgs/pkgs/applications/science/physics/crystfel/libccp4-use-hardcoded-syminfo-lib.patch b/nixpkgs/pkgs/applications/science/physics/crystfel/libccp4-use-hardcoded-syminfo-lib.patch
new file mode 100644
index 000000000000..1806d9b2b9da
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/crystfel/libccp4-use-hardcoded-syminfo-lib.patch
@@ -0,0 +1,40 @@
+diff --git a/ccp4/csymlib.c b/ccp4/csymlib.c
+index 76bc70b..3616121 100644
+--- a/ccp4/csymlib.c
++++ b/ccp4/csymlib.c
+@@ -136,25 +136,7 @@ CCP4SPG *ccp4spg_load_spacegroup(const int numspg, const int ccp4numspg,
+     }
+   }
+ 
+-  /* Open the symop file: */
+-  if (!(symopfile = getenv("SYMINFO"))) {
+-    if (debug)
+-      printf("Environment variable SYMINFO not set ... guessing location of symmetry file. \n");
+-    if (!(ccp4dir = getenv("CLIBD"))) {
+-      printf("Environment variable CLIBD not set ... big trouble! \n");
+-      return NULL;
+-    }
+-
+-    symopfile = ccp4_utils_malloc((strlen(ccp4dir)+22)*sizeof(char));
+-    strcpy(symopfile,ccp4_utils_joinfilenames(ccp4dir,"syminfo.lib"));
+-    symopfile[strlen(ccp4dir)+21] = '\0';
+-    ccp4printf(1," SYMINFO file set to %s \n",symopfile);
+-  } else {
+-    if (debug) {
+-      ccp4printf(1,"\n Spacegroup information obtained from library file: \n");
+-      ccp4printf(1," Logical Name: SYMINFO   Filename: %s\n\n",symopfile);
+-    }
+-  }
++  symopfile = NIX_PROVIDED_SYMOP_FILE;
+ 
+   filein = fopen(symopfile,"r");
+   if (!filein) {
+@@ -162,8 +144,6 @@ CCP4SPG *ccp4spg_load_spacegroup(const int numspg, const int ccp4numspg,
+     return NULL;
+   }
+ 
+-  if (!(getenv("SYMINFO"))) free(symopfile);
+-
+   parser = ccp4_parse_start(20);
+   if (parser == NULL) 
+     ccp4_signal(CSYM_ERRNO(CSYMERR_ParserFail),"ccp4spg_load_spacegroup",NULL);
diff --git a/nixpkgs/pkgs/applications/science/physics/crystfel/link-to-argp-standalone-if-needed.patch b/nixpkgs/pkgs/applications/science/physics/crystfel/link-to-argp-standalone-if-needed.patch
new file mode 100644
index 000000000000..8314be29ac00
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/crystfel/link-to-argp-standalone-if-needed.patch
@@ -0,0 +1,26 @@
+diff --git a/meson.build b/meson.build
+index 59bbcfb7..dd75d4e2 100644
+--- a/meson.build
++++ b/meson.build
+@@ -80,6 +80,12 @@ if cc.has_function('clock_gettime', prefix: '#include <time.h>')
+   conf_data.set10('HAVE_CLOCK_GETTIME', true)
+ endif
+ 
++if build_machine.system() == 'darwin' or build_machine.system() == 'freebsd' or not cc.links('#include <argp.h>\nstatic error_t parse_opt (int key, char *arg, struct argp_state *state) { argp_usage(state); return 0; }; void main() {}')
++    argpdep = cc.find_library('argp')
++else
++    argpdep = dependency('', required : false)
++endif
++
+ # ************************ libcrystfel (subdir) ************************
+ 
+ subdir('libcrystfel')
+@@ -180,7 +186,7 @@ endif
+ 
+ indexamajig = executable('indexamajig', indexamajig_sources,
+                          dependencies: [mdep, libcrystfeldep, gsldep,
+-                                        pthreaddep, zmqdep, asapodep],
++                                        pthreaddep, zmqdep, asapodep, argpdep],
+                          install: true,
+                          install_rpath: '$ORIGIN/../lib64/:$ORIGIN/../lib')
+ 
diff --git a/nixpkgs/pkgs/applications/science/physics/dawn/default.nix b/nixpkgs/pkgs/applications/science/physics/dawn/default.nix
new file mode 100644
index 000000000000..c174d4c0720f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/dawn/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, stdenv
+, fetchurl
+, tk
+, makeWrapper
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dawn";
+  version = "3.91a";
+
+  src = fetchurl {
+    url = "https://geant4.kek.jp/~tanaka/src/dawn_${builtins.replaceStrings ["."] ["_"] version}.tgz";
+    hash = "sha256-gdhV6tERdoGxiCQt0L46JOAF2b1AY/0r2pp6eU689fQ=";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace 'CC =' 'CC = $(CXX) #' \
+      --replace 'INSTALL_DIR =' "INSTALL_DIR = $out/bin#"
+  '';
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  dontConfigure = true;
+
+  preInstall = ''
+    mkdir -p "$out/bin"
+  '';
+
+  postInstall = ''
+    wrapProgram "$out/bin/DAWN_GUI" \
+      --prefix PATH : ${lib.makeBinPath [ tk ]}
+  '';
+
+  meta = with lib; {
+    description = "A vectorized 3D PostScript processor with analytical hidden line/surface removal";
+    license = licenses.unfree;
+    homepage = "https://geant4.kek.jp/~tanaka/DAWN/About_DAWN.html";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/physics/dawncut/default.nix b/nixpkgs/pkgs/applications/science/physics/dawncut/default.nix
new file mode 100644
index 000000000000..5c17837d2e95
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/dawncut/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, stdenv
+, fetchurl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dawncut";
+  version = "1.54a";
+
+  src = fetchurl {
+    name = "${pname}-${version}.tar.gz";
+    url = "https://geant4.kek.jp/~tanaka/src/dawncut_${builtins.replaceStrings ["."] ["_"] version}.taz";
+    hash = "sha256-Ux4fDi7TXePisYAxCMDvtzLYOgxnbxQIO9QacTRrT6k=";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile.architecture \
+      --replace 'CXX      := g++' ""
+  '';
+
+  dontConfigure = true;
+
+  env.NIX_CFLAGS_COMPILE = "-std=c++98";
+
+  installPhase = ''
+    runHook preInstall
+
+    install -Dm 500 dawncut "$out/bin/dawncut"
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "A tool to generate a 3D scene data clipped with an arbitrary plane";
+    license = licenses.unfree;
+    homepage = "https://geant4.kek.jp/~tanaka/DAWN/About_DAWNCUT.html";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/physics/elmerfem/default.nix b/nixpkgs/pkgs/applications/science/physics/elmerfem/default.nix
new file mode 100644
index 000000000000..e63203a93f28
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/elmerfem/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv, fetchFromGitHub, cmake, git, gfortran, mpi, blas, liblapack, pkg-config, libGL, libGLU, opencascade-occt, libsForQt5, tbb, vtkWithQt5 }:
+
+stdenv.mkDerivation rec {
+  pname = "elmerfem";
+  version = "unstable-2023-09-18";
+
+  src = fetchFromGitHub {
+    owner = "elmercsc";
+    repo = pname;
+    rev = "0fcced06f91c93f44557efd6a5f10b2da5c7066c";
+    hash = "sha256-UuARDYW7D3a4dB6I86s2Ed5ecQxc+Y/es3YIeF2VyTc=";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  nativeBuildInputs = [
+    cmake
+    gfortran
+    pkg-config
+    libsForQt5.wrapQtAppsHook
+  ];
+  buildInputs = [
+    mpi
+    blas
+    liblapack
+    libsForQt5.qtbase
+    libsForQt5.qtscript
+    libsForQt5.qwt
+    libGL
+    libGLU
+    opencascade-occt
+    tbb
+    vtkWithQt5
+  ];
+
+  preConfigure = ''
+    patchShebangs ./
+  '';
+
+  storepath = placeholder "out";
+
+  cmakeFlags = [
+  "-DELMER_INSTALL_LIB_DIR=${storepath}/lib"
+  "-DWITH_OpenMP:BOOLEAN=TRUE"
+  "-DWITH_MPI:BOOLEAN=TRUE"
+  "-DWITH_QT5:BOOLEAN=TRUE"
+  "-DWITH_OCC:BOOLEAN=TRUE"
+  "-DWITH_VTK:BOOLEAN=TRUE"
+  "-DWITH_ELMERGUI:BOOLEAN=TRUE"
+  "-DCMAKE_INSTALL_LIBDIR=lib"
+  "-DCMAKE_INSTALL_INCLUDEDIR=include"
+  "-DCMAKE_OpenGL_GL_PREFERENCE=GLVND"
+  ];
+
+  meta = with lib; {
+    homepage = "https://elmerfem.org";
+    description = "A finite element software for multiphysical problems";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ wulfsta broke ];
+    license = licenses.lgpl21;
+  };
+
+}
diff --git a/nixpkgs/pkgs/applications/science/physics/fasthenry/default.nix b/nixpkgs/pkgs/applications/science/physics/fasthenry/default.nix
new file mode 100644
index 000000000000..6b9a73f6dd17
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/fasthenry/default.nix
@@ -0,0 +1,61 @@
+{ stdenv
+, fetchFromGitHub
+, lib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fasthenry";
+  # later versions are Windows only ports
+  # nixpkgs-update: no auto update
+  version = "3.0.1";
+
+  # we don't use the original MIT code at
+  # https://www.rle.mit.edu/cpg/research_codes.htm
+  # since the FastFieldSolvers S.R.L. version includes
+  # a couple of bug fixes
+  src = fetchFromGitHub {
+    owner = "ediloren";
+    repo = "FastHenry2";
+    rev = "R${version}";
+    sha256 = "017kcri69zhyhii59kxj1ak0gyfn7jf0qp6p2x3nnljia8njdkcc";
+  };
+
+  dontConfigure = true;
+
+  preBuild = ''
+    makeFlagsArray=(
+      CC="gcc"
+      RM="rm"
+      SHELL="sh"
+      "all"
+    )
+    '' + (if stdenv.isx86_64 then ''
+    makeFlagsArray+=(
+      CFLAGS="-fcommon -O -DFOUR -m64"
+    );
+    '' else ''
+      makeFlagsArray+=(
+        CFLAGS="-fcommon -O -DFOUR"
+    );
+  '');
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp -r bin/* $out/bin/
+    mkdir -p $out/share/doc/${pname}-${version}
+    cp -r doc/* $out/share/doc/${pname}-${version}
+    mkdir -p $out/share/${pname}-${version}/examples
+    cp -r examples/* $out/share/${pname}-${version}/examples
+  '';
+
+  meta = with lib; {
+    description = "Multipole-accelerated inductance analysis program";
+    longDescription = ''
+       Fasthenry is an inductance extraction program based on a
+       multipole-accelerated algorithm.'';
+    homepage = "https://www.fastfieldsolvers.com/fasthenry2.htm";
+    license = licenses.lgpl2Only;
+    maintainers = with maintainers; [ fbeffa ];
+    platforms = intersectLists (platforms.linux) (platforms.x86_64 ++ platforms.x86);
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/physics/nnpdf/default.nix b/nixpkgs/pkgs/applications/science/physics/nnpdf/default.nix
new file mode 100644
index 000000000000..d0104095f39a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/nnpdf/default.nix
@@ -0,0 +1,66 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, apfel
+, gsl
+, lhapdf
+, libarchive
+, yaml-cpp
+, python3
+, sqlite
+, swig
+}:
+
+stdenv.mkDerivation rec {
+  pname = "nnpdf";
+  version = "4.0.9";
+
+  src = fetchFromGitHub {
+    owner = "NNPDF";
+    repo = pname;
+    rev = version;
+    hash = "sha256-PyhkHlOlzKfDxUX91NkeZWjdEzFR4PW0Yh5Yz6ZA27g=";
+  };
+
+  postPatch = ''
+    for file in CMakeLists.txt buildmaster/CMakeLists.txt; do
+      substituteInPlace $file \
+        --replace "-march=nocona -mtune=haswell" ""
+    done
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  buildInputs = [
+    apfel
+    gsl
+    lhapdf
+    libarchive
+    yaml-cpp
+    python3
+    python3.pkgs.numpy
+    sqlite
+    swig
+  ];
+
+  cmakeFlags = [
+    "-DCOMPILE_filter=ON"
+    "-DCOMPILE_evolvefit=ON"
+  ];
+
+  meta = with lib; {
+    description = "An open-source machine learning framework for global analyses of parton distributions";
+    mainProgram = "evolven3fit";
+    homepage = "https://docs.nnpdf.science/";
+    license = licenses.gpl3Only;
+    maintainers = [ maintainers.veprbl ];
+    platforms = platforms.unix;
+    # never built on aarch64-darwin since first introduction in nixpkgs
+    broken = (stdenv.isDarwin && stdenv.isAarch64) || (stdenv.isLinux && stdenv.isAarch64);
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/physics/professor/default.nix b/nixpkgs/pkgs/applications/science/physics/professor/default.nix
new file mode 100644
index 000000000000..6d52951ee9c9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/professor/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, eigen, makeWrapper, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "professor";
+  version = "2.3.3";
+
+  src = fetchurl {
+    name = "Professor-${version}.tar.gz";
+    url = "https://professor.hepforge.org/downloads/?f=Professor-${version}.tar.gz";
+    sha256 = "17q026r2fpfxzf74d1013ksy3a9m57rcr2q164n9x02ci40bmib0";
+  };
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace Makefile \
+      --replace '-shared -o' '-shared -install_name "$(out)/$@" -o'
+  '';
+
+  nativeBuildInputs = [ python3.pkgs.cython makeWrapper ];
+  buildInputs = [ python3 eigen ];
+  propagatedBuildInputs = with python3.pkgs; [ iminuit numpy matplotlib yoda ];
+
+  CPPFLAGS = [ "-I${eigen}/include/eigen3" ];
+  PREFIX = placeholder "out";
+
+  postInstall = ''
+    for prog in "$out"/bin/*; do
+      wrapProgram "$prog" --set PYTHONPATH "$PYTHONPATH:$(toPythonPath "$out")"
+    done
+  '';
+
+  doInstallCheck = true;
+  installCheckTarget = "check";
+
+  meta = with lib; {
+    description = "A tuning tool for Monte Carlo event generators";
+    homepage = "https://professor.hepforge.org/";
+    license = licenses.unfree; # no license specified
+    maintainers = [ maintainers.veprbl ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/physics/quantomatic/default.nix b/nixpkgs/pkgs/applications/science/physics/quantomatic/default.nix
new file mode 100644
index 000000000000..caff65f1d71b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/quantomatic/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, jre, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "quantomatic";
+  version = "0.7";
+
+  src = fetchurl {
+    url = "https://github.com/Quantomatic/quantomatic/releases/download/v${version}/Quantomatic-v${version}.jar";
+    sha256 = "04dd5p73a7plb4l4x2balam8j7mxs8df06rjkalxycrr1id52q4r";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ jre ];
+
+  dontUnpack = true;
+
+  installPhase = ''
+    mkdir -p $out/libexec/quantomatic
+    cp $src $out/libexec/quantomatic/quantomatic.jar
+    mkdir -p $out/bin
+    makeWrapper ${jre}/bin/java $out/bin/quantomatic --add-flags "-jar $out/libexec/quantomatic/quantomatic.jar"
+  '';
+
+  meta = with lib; {
+    description = "A piece of software for reasoning about monoidal theories; in particular, quantum information processing";
+    mainProgram = "quantomatic";
+    license = licenses.gpl3;
+    homepage = "https://quantomatic.github.io/";
+    sourceProvenance = with sourceTypes; [ binaryBytecode ];
+    maintainers = with maintainers; [ nickhu ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/physics/sacrifice/compat.patch b/nixpkgs/pkgs/applications/science/physics/sacrifice/compat.patch
new file mode 100644
index 000000000000..c66b91b76280
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/sacrifice/compat.patch
@@ -0,0 +1,12 @@
+diff --git a/src/PythiaMain.cxx b/src/PythiaMain.cxx
+index 0e5ddd2..2b626ab 100644
+--- a/src/PythiaMain.cxx
++++ b/src/PythiaMain.cxx
+@@ -96,7 +96,6 @@ int main(int argc, char **argv){
+   HepMCConverter pythiaToHepMC;
+ 
+   pythiaToHepMC.set_store_pdf(true);
+-  pythiaToHepMC.set_crash_on_problem(true);
+   
+   if(photosHandler.isEnabled()){
+     photosHandler.initialise();
diff --git a/nixpkgs/pkgs/applications/science/physics/sacrifice/default.nix b/nixpkgs/pkgs/applications/science/physics/sacrifice/default.nix
new file mode 100644
index 000000000000..352b65dc700c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/sacrifice/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchurl, boost, hepmc2, lhapdf, pythia, makeWrapper }:
+
+stdenv.mkDerivation {
+  pname = "sacrifice";
+  version = "1.0.0";
+
+  src = fetchurl {
+    url = "https://www.hepforge.org/archive/agile/Sacrifice-1.0.0.tar.gz";
+    sha256 = "10bvpq63kmszy1habydwncm0j1dgvam0fkrmvkgbkvf804dcjp6g";
+  };
+
+  buildInputs = [ boost hepmc2 lhapdf pythia ];
+  nativeBuildInputs = [ makeWrapper ];
+
+  patches = [
+    ./compat.patch
+    ./pythia83xx.patch
+  ];
+
+  preConfigure = ''
+    substituteInPlace configure --replace HAVE_LCG=yes HAVE_LCG=no
+  ''
+  + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace configure --replace LIB_SUFFIX=\"so\" LIB_SUFFIX=\"dylib\"
+  '';
+
+  configureFlags = [
+    "--with-HepMC=${hepmc2}"
+    "--with-pythia=${pythia}"
+  ];
+
+  postInstall = if stdenv.isDarwin then ''
+    install_name_tool -add_rpath ${pythia}/lib "$out"/bin/run-pythia
+  '' else ''
+    wrapProgram $out/bin/run-pythia \
+      --prefix LD_LIBRARY_PATH : "${pythia}/lib"
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "A standalone contribution to AGILe for steering Pythia 8";
+    mainProgram = "run-pythia";
+    license     = lib.licenses.gpl2;
+    homepage    = "https://agile.hepforge.org/trac/wiki/Sacrifice";
+    platforms   = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ veprbl ];
+    # never built on aarch64-darwin since first introduction in nixpkgs
+    broken = stdenv.isDarwin && stdenv.isAarch64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/physics/sacrifice/pythia83xx.patch b/nixpkgs/pkgs/applications/science/physics/sacrifice/pythia83xx.patch
new file mode 100644
index 000000000000..ea162e30c9a8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/sacrifice/pythia83xx.patch
@@ -0,0 +1,55 @@
+diff --git a/include/Sacrifice/UserHooksFactory.hh b/include/Sacrifice/UserHooksFactory.hh
+index 04b105b..19f2b4f 100644
+--- a/include/Sacrifice/UserHooksFactory.hh
++++ b/include/Sacrifice/UserHooksFactory.hh
+@@ -12,7 +12,7 @@
+ 
+ namespace Sacrifice{
+ 
+-  using Pythia8::UserHooks;
++  using Pythia8::UserHooksPtr;
+   using std::string;
+   using std::map;
+ 
+@@ -21,7 +21,7 @@ namespace Sacrifice{
+ 
+   public:
+ 
+-    static UserHooks* create(const string &hookName);
++    static UserHooksPtr create(const string &hookName);
+ 
+     /**
+      *  Loads a library of UserHooks
+@@ -39,7 +39,7 @@ namespace Sacrifice{
+ 
+     class ICreator{
+     public:
+-      virtual UserHooks *create() const = 0;
++      virtual UserHooksPtr create() const = 0;
+       virtual ~ICreator(){};
+     };
+ 
+@@ -61,8 +61,8 @@ namespace Sacrifice{
+         }
+       }
+ 
+-      UserHooks *create()const{
+-        return new T;
++      UserHooksPtr create()const{
++        return std::make_shared<T>();
+       }
+ 
+     private:
+diff --git a/src/UserHooksFactory.cxx b/src/UserHooksFactory.cxx
+index 84a485b..5274119 100644
+--- a/src/UserHooksFactory.cxx
++++ b/src/UserHooksFactory.cxx
+@@ -11,7 +11,7 @@ namespace Sacrifice{
+   using std::ifstream;
+ 
+   //////////////////////////////////////////////////////////////////////////////
+-  UserHooks *UserHooksFactory::create(const string &name){
++  UserHooksPtr UserHooksFactory::create(const string &name){
+     map<string, const ICreator*>::const_iterator it = s_creators().find(name);
+     if(it == s_creators().end()){
+       //eek!
diff --git a/nixpkgs/pkgs/applications/science/physics/sherpa/default.nix b/nixpkgs/pkgs/applications/science/physics/sherpa/default.nix
new file mode 100644
index 000000000000..21a5ee7ec234
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/sherpa/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, autoconf, gfortran, hepmc2, fastjet, lhapdf, rivet, sqlite }:
+
+stdenv.mkDerivation rec {
+  pname = "sherpa";
+  version = "2.2.15";
+
+  src = fetchurl {
+    url = "https://www.hepforge.org/archive/sherpa/SHERPA-MC-${version}.tar.gz";
+    sha256 = "sha256-3zvLa1k/bm7uOWKUsTyQM39cPBXJJlF1OgPgznl1hks=";
+  };
+
+  postPatch = lib.optionalString (stdenv.hostPlatform.libc == "glibc") ''
+    sed -ie '/sys\/sysctl.h/d' ATOOLS/Org/Run_Parameter.C
+  '';
+
+  nativeBuildInputs = [ autoconf gfortran ];
+
+  buildInputs = [ sqlite lhapdf rivet ];
+
+  enableParallelBuilding = true;
+
+  configureFlags = [
+    "--with-sqlite3=${sqlite.dev}"
+    "--enable-hepmc2=${hepmc2}"
+    "--enable-fastjet=${fastjet}"
+    "--enable-lhapdf=${lhapdf}"
+    "--enable-rivet=${rivet}"
+    "--enable-pythia"
+  ];
+
+  meta = with lib; {
+    description = "Simulation of High-Energy Reactions of PArticles in lepton-lepton, lepton-photon, photon-photon, lepton-hadron and hadron-hadron collisions";
+    license = licenses.gpl2;
+    homepage = "https://gitlab.com/sherpa-team/sherpa";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+    # never built on aarch64-darwin since first introduction in nixpkgs
+    broken = stdenv.isDarwin && stdenv.isAarch64;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/physics/shtns/default.nix b/nixpkgs/pkgs/applications/science/physics/shtns/default.nix
new file mode 100644
index 000000000000..a720213b3913
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/shtns/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchgit, fftw }:
+
+stdenv.mkDerivation rec {
+  pname = "shtns";
+  version = "3.5.1";
+
+  src = fetchgit {
+    url = "https://bitbucket.org/nschaeff/shtns";
+    rev = "v${version}";
+    sha256 = "1ajrplhv7a2dvb3cn3n638281w0bzdcydvvwbg64awbjg622mdpd";
+  };
+
+  buildInputs = [ fftw ];
+
+  meta = with lib; {
+    description = "High performance library for Spherical Harmonic Transform";
+    homepage = "https://nschaeff.bitbucket.io/shtns/";
+    license = licenses.cecill21;
+    maintainers = [ maintainers.bzizou ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/physics/xfitter/0001-src-GetChisquare.f-use-correct-types-in-calls-to-DSY.patch b/nixpkgs/pkgs/applications/science/physics/xfitter/0001-src-GetChisquare.f-use-correct-types-in-calls-to-DSY.patch
new file mode 100644
index 000000000000..dd43e17cc7a2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/xfitter/0001-src-GetChisquare.f-use-correct-types-in-calls-to-DSY.patch
@@ -0,0 +1,50 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -54,21 +54,7 @@ endif()
+ endif()
+ 
+ #Use c preprocessor with fortran
+-
+-if(UNIX AND NOT APPLE)
+-  set(CMAKE_Fortran_FLAGS "-cpp -Wno-argument-mismatch")
+-endif()
+-
+-if(APPLE)
+-  set(CMAKE_Fortran_FLAGS "-cpp -fallow-argument-mismatch")
+-endif()
+-
+-
+-if (CMAKE_MAJOR_VERSION VERSION_GREATER_EQUAL "3")
+-if(CMAKE_Fortran_COMPILER_VERSION VERSION_GREATER_EQUAL "10")
+-  set(CMAKE_Fortran_FLAGS "-cpp -fallow-argument-mismatch")
+-endif()
+-endif()
++set(CMAKE_Fortran_FLAGS "-cpp")
+ 
+ 
+ #For Fortran
+diff --git a/src/GetChisquare.f b/src/GetChisquare.f
+index b21413fe..28391bcb 100644
+--- a/src/GetChisquare.f
++++ b/src/GetChisquare.f
+@@ -2418,8 +2418,8 @@ C> @Brief Interface to lapack, to dynamically allocate work arrays
+       integer NCovar, NDimCovar
+       double precision Covar(NDimCovar,NDimCovar), EigenValues(NCovar)
+       integer IFail
+-      double precision Work
+-      integer IWork
++      double precision Work(1)
++      integer IWork(1)
+       Character*80 msg
+ C---------------------------------------------------------------
+ C Determine optimal size of the work array:
+@@ -2432,7 +2432,7 @@ C Determine optimal size of the work array:
+      $     int(work)+1, iwork
+       call HF_ERRLOG(14121701,msg)
+       call MyDSYEVD2(NCovar,Covar,NDimCovar, EigenValues,
+-     $     int(work)+1,iwork,ifail)
++     $     int(work(1))+1,iwork(1),ifail)
+ 
+       end
+ 
diff --git a/nixpkgs/pkgs/applications/science/physics/xfitter/default.nix b/nixpkgs/pkgs/applications/science/physics/xfitter/default.nix
new file mode 100644
index 000000000000..77b57e08e2bb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/xfitter/default.nix
@@ -0,0 +1,64 @@
+{ lib
+, stdenv
+, fetchurl
+, apfel
+, apfelgrid
+, applgrid
+, blas
+, ceres-solver
+, cmake
+, gfortran
+, gsl
+, lapack
+, lhapdf
+, libtirpc
+, libyaml
+, yaml-cpp
+, pkg-config
+, qcdnum
+, root
+, zlib
+, memorymappingHook, memstreamHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "xfitter";
+  version = "2.2.0";
+
+  src = fetchurl {
+    name = "${pname}-${version}.tgz";
+    url = "https://www.xfitter.org/xFitter/xFitter/DownloadPage?action=AttachFile&do=get&target=${pname}-${version}.tgz";
+    sha256 = "sha256-ZHIQ5hOY+k0/wmpE0o4Po+RZ4MkVMk+bK1Rc6eqwwH0=";
+  };
+
+  patches = [
+    # Avoid need for -fallow-argument-mismatch
+    ./0001-src-GetChisquare.f-use-correct-types-in-calls-to-DSY.patch
+  ];
+
+  nativeBuildInputs = [ cmake gfortran pkg-config ];
+  buildInputs =
+    [ apfel blas ceres-solver lhapdf lapack libyaml root qcdnum gsl yaml-cpp zlib ]
+    ++ lib.optionals ("5" == lib.versions.major root.version) [ apfelgrid applgrid ]
+    ++ lib.optionals (stdenv.system == "x86_64-darwin") [ memorymappingHook memstreamHook ]
+    ++ lib.optional (stdenv.hostPlatform.libc == "glibc") libtirpc
+    ;
+
+  env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "-I${libtirpc.dev}/include/tirpc";
+  NIX_LDFLAGS = lib.optional (stdenv.hostPlatform.libc == "glibc") "-ltirpc";
+
+  hardeningDisable = [ "format" ];
+
+  # workaround wrong library IDs
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    ln -sv "$out/lib/xfitter/"* "$out/lib/"
+  '';
+
+  meta = with lib; {
+    description = "The xFitter project is an open source QCD fit framework ready to extract PDFs and assess the impact of new data";
+    license     = licenses.gpl3;
+    homepage    = "https://www.xfitter.org/xFitter";
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/physics/xflr5/default.nix b/nixpkgs/pkgs/applications/science/physics/xflr5/default.nix
new file mode 100644
index 000000000000..497be8fcbaa9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/xflr5/default.nix
@@ -0,0 +1,24 @@
+{ mkDerivation, lib, qmake, fetchsvn }:
+
+mkDerivation rec {
+  pname = "xflr5";
+  version = "6.61";
+
+  sourceRoot = "${src.name}/xflr5";
+  src = fetchsvn {
+    url = "https://svn.code.sf.net/p/xflr5/code/trunk";
+    rev = "1480";
+    sha256 = "sha256-Uj6R15OT5i5tAJEYWqyFyN5Z51Wz5RjO26mWC3Y6QAI=";
+  };
+
+  nativeBuildInputs = [ qmake ];
+
+  meta = with lib; {
+    description = "An analysis tool for airfoils, wings and planes";
+    mainProgram = "xflr5";
+    homepage = "https://sourceforge.net/projects/xflr5/";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.esclear ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/physics/xnec2c/default.nix b/nixpkgs/pkgs/applications/science/physics/xnec2c/default.nix
new file mode 100644
index 000000000000..26ec1518fed5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/physics/xnec2c/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, stdenv
+, fetchurl
+, autoreconfHook
+, wrapGAppsHook
+, pkg-config
+, which
+, gtk3
+, blas
+, lapack
+}:
+
+assert (!blas.isILP64) && (!lapack.isILP64);
+
+stdenv.mkDerivation rec {
+  pname = "xnec2c";
+  version = "4.4.12";
+
+  src = fetchurl {
+    url = "https://www.xnec2c.org/releases/${pname}-v${version}.tar.gz";
+    hash = "sha256-6Yrx6LkJjfnMA/kJUDWLhGzGopZeecARSrcR++UScsU=";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    wrapGAppsHook
+    pkg-config
+    which
+  ];
+  buildInputs = [ gtk3 blas lapack ];
+
+  meta = with lib; {
+    homepage = "https://www.xnec2c.org/";
+    description = "Graphical antenna simulation";
+    mainProgram = "xnec2c";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ mvs ];
+    platforms = platforms.unix;
+
+    # Darwin support likely to be fixed upstream in the next release
+    broken = stdenv.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/programming/fdr/default.nix b/nixpkgs/pkgs/applications/science/programming/fdr/default.nix
new file mode 100644
index 000000000000..f7b12342a665
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/programming/fdr/default.nix
@@ -0,0 +1,70 @@
+{ lib, stdenv, fetchurl, qtbase, qtx11extras, ncurses5, xorg, zlib, python27Packages }:
+stdenv.mkDerivation {
+  pname = "fdr";
+  version = "4.2.7";
+  src = fetchurl {
+    url = "https://dl.cocotec.io/fdr/fdr-3814-linux-x86_64.tar.gz";
+    sha256 = "0cajz1gz4slq9nfhm8dqdgxl0kc950838n0lrf8jw4vl54gv6chh";
+  };
+
+  libPath = lib.makeLibraryPath [
+    stdenv.cc.cc
+    python27Packages.python
+    qtbase
+    qtx11extras
+    ncurses5
+    xorg.libX11
+    xorg.libXft
+    zlib
+  ];
+
+  dontConfigure = true;
+  installPhase = ''
+    mkdir -p "$out"
+
+    # shipped Qt is buggy
+    rm lib/libQt*
+    rm -r lib/qt_plugins
+
+    cp -r * "$out"
+    ln -s ${ncurses5.out}/lib/libtinfo.so.5 $out/lib/libtinfo.so.5
+    ln -s ${qtbase.bin}/${qtbase.qtPluginPrefix} $out/lib/qt_plugins
+    ln -s ${zlib.out}/lib/libz.so.1 $out/lib/libz.so.1
+
+    for b in fdr4 _fdr4 refines _refines cspmprofiler cspmexplorerprof
+    do
+      patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
+        --set-rpath "$libPath:$out/lib" \
+        "$out/bin/$b"
+    done
+
+    for l in corei7/librefines.so \
+      libcspm_process_compiler.so \
+      libcsp_operators.so \
+      _fdr.so \
+      libfdr.so \
+      libfdr_java.so \
+      libprocess_compiler.so \
+      librefines_gui.so \
+      librefines_licensing.so  \
+      libboost_date_time.so.1.60.0 \
+      libboost_filesystem.so.1.60.0 \
+      libboost_iostreams.so.1.60.0 \
+      libboost_program_options.so.1.60.0 \
+      libboost_serialization.so.1.60.0 \
+      libboost_system.so.1.60.0
+    do
+      patchelf --set-rpath "$libPath:$out/lib" \
+        "$out/lib/$l"
+    done
+  '';
+
+  meta = with lib; {
+    homepage = "https://cocotec.io/fdr/";
+    description = "The CSP refinement checker";
+    license = licenses.unfreeRedistributable;
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ nickhu ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/programming/groove/default.nix b/nixpkgs/pkgs/applications/science/programming/groove/default.nix
new file mode 100644
index 000000000000..fb314cdff30c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/programming/groove/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv, fetchurl, unzip, makeWrapper, makeDesktopItem, icoutils, jre8 }:
+
+let
+  desktopItem = makeDesktopItem {
+    name = "groove-simulator";
+    exec = "groove-simulator";
+    icon = "groove";
+    desktopName = "GROOVE Simulator";
+    comment = "GRaphs for Object-Oriented VErification";
+    categories = [ "Science" "ComputerScience" ];
+  };
+
+in stdenv.mkDerivation rec {
+  pname = "groove";
+  version = "5.8.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/groove/groove/${version}/${pname}-${builtins.replaceStrings ["."] ["_"] version}-bin.zip";
+    sha256 = "sha256-JwoUlO6F2+8NtCnLC+xm5q0Jm8RIyU1rnuKGmjgJhFU=";
+  };
+
+  nativeBuildInputs = [ unzip makeWrapper icoutils ];
+
+  dontBuild = true;
+
+  installPhase = ''
+    mkdir -p $out/share/groove
+    cp -r bin lib $out/share/groove/
+
+    mkdir -p $out/share/doc/groove
+    cp CHANGES README *.pdf $out/share/doc/groove/
+
+    mkdir -p $out/bin
+    for bin in Generator Imager ModelChecker PrologChecker Simulator Viewer; do
+      makeWrapper ${jre8}/bin/java $out/bin/groove-''${bin,,} \
+        --add-flags "-jar $out/share/groove/bin/$bin.jar"
+    done
+
+    mkdir -p $out/share/applications
+    ln -s ${desktopItem}/share/applications/* $out/share/applications/
+
+    mkdir -p $out/share/icons/hicolor/{16x16,32x32}/apps
+    icotool -x -i 1 -o $out/share/icons/hicolor/32x32/apps/groove.png groove-green-g.ico
+    icotool -x -i 2 -o $out/share/icons/hicolor/16x16/apps/groove.png groove-green-g.ico
+  '';
+
+  meta = with lib; {
+    description = "GRaphs for Object-Oriented VErification";
+    homepage = "http://groove.cs.utwente.nl/";
+    license = licenses.asl20;
+    sourceProvenance = with sourceTypes; [ binaryBytecode ];
+    platforms = platforms.all;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/programming/plm/default.nix b/nixpkgs/pkgs/applications/science/programming/plm/default.nix
new file mode 100644
index 000000000000..a0a16515e228
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/programming/plm/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, makeWrapper, jre, gcc, valgrind }:
+# gcc and valgrind are not strict dependencies, they could be made
+# optional. They are here because plm can only help you learn C if you
+# have them installed.
+stdenv.mkDerivation rec {
+  pname = "plm";
+  version = "2.9.3";
+
+  src = fetchurl {
+    url = "https://github.com/BuggleInc/PLM/releases/download/v${version}/plm-${version}.jar";
+    sha256 = "0i9ghx9pm3kpn9x9n1hl10zdr36v5mv3drx8lvhsqwhlsvz42p5i";
+    name = "${pname}-${version}.jar";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ jre gcc valgrind ];
+
+  dontUnpack = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p "$prefix/bin"
+
+    makeWrapper ${jre}/bin/java $out/bin/plm \
+      --add-flags "-jar $src" \
+      --prefix PATH : "$PATH"
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Free cross-platform programming exerciser";
+    mainProgram = "plm";
+    homepage = "http://people.irisa.fr/Martin.Quinson/Teaching/PLM/";
+    license = licenses.gpl3;
+    sourceProvenance = with sourceTypes; [ binaryBytecode ];
+    maintainers = [ ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/robotics/apmplanner2/default.nix b/nixpkgs/pkgs/applications/science/robotics/apmplanner2/default.nix
new file mode 100644
index 000000000000..34509f05daa3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/robotics/apmplanner2/default.nix
@@ -0,0 +1,43 @@
+{ lib, mkDerivation, fetchFromGitHub, qmake
+, qtbase, qtscript, qtwebkit, qtserialport, qtsvg, qtdeclarative, qtquickcontrols2
+, alsa-lib, libsndfile, flite, openssl, udev, SDL2
+}:
+
+mkDerivation rec {
+  pname = "apmplanner2";
+  version = "2.0.28";
+
+  src = fetchFromGitHub {
+    owner = "ArduPilot";
+    repo = "apm_planner";
+    rev = version;
+    sha256 = "0wvbfjnnf7sh6fpgw8gimh5hgzywj3nwrgr80r782f5gayd3v2l1";
+  };
+
+  buildInputs = [
+    alsa-lib libsndfile flite openssl udev SDL2
+    qtbase qtscript qtwebkit qtserialport qtsvg qtdeclarative qtquickcontrols2
+  ];
+
+  nativeBuildInputs = [ qmake ];
+
+  qmakeFlags = [ "apm_planner.pro" ];
+
+  # this ugly hack is necessary, as `bin/apmplanner2` needs the contents of `share/APMPlanner2` inside of `bin/`
+  preFixup = ''
+    ln --relative --symbolic $out/share/APMPlanner2/* $out/bin/
+    substituteInPlace $out/share/applications/apmplanner2.desktop \
+      --replace /usr $out
+  '';
+
+  meta = {
+    description = "Ground station software for autonomous vehicles";
+    longDescription = ''
+      A GUI ground control station for autonomous vehicles using the MAVLink protocol.
+      Includes support for the APM and PX4 based controllers.
+    '';
+    homepage = "https://ardupilot.org/planner2/";
+    license = lib.licenses.gpl3;
+    maintainers = with lib.maintainers; [ wucke13 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/robotics/betaflight-configurator/default.nix b/nixpkgs/pkgs/applications/science/robotics/betaflight-configurator/default.nix
new file mode 100644
index 000000000000..252eadc1c39c
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/robotics/betaflight-configurator/default.nix
@@ -0,0 +1,58 @@
+{lib, stdenv, fetchurl, unzip, makeDesktopItem, nwjs, wrapGAppsHook, gsettings-desktop-schemas, gtk3 }:
+
+let
+  pname = "betaflight-configurator";
+  desktopItem = makeDesktopItem {
+    name = pname;
+    exec = pname;
+    icon = pname;
+    comment = "Betaflight configuration tool";
+    desktopName = "Betaflight Configurator";
+    genericName = "Flight controller configuration tool";
+  };
+in
+stdenv.mkDerivation rec {
+  inherit pname;
+  version = "10.9.0";
+  src = fetchurl {
+    url = "https://github.com/betaflight/${pname}/releases/download/${version}/${pname}_${version}_linux64-portable.zip";
+    sha256 = "sha256-9FzMyBIR2u1zXHtTWJABM6RF1+OyjYdEPlRwtig9blI=";
+  };
+
+  # remove large unneeded files
+  postUnpack = ''
+    find -name "lib*.so" -delete
+  '';
+
+  nativeBuildInputs = [ wrapGAppsHook unzip ];
+
+  buildInputs = [ gsettings-desktop-schemas gtk3 ];
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/bin \
+             $out/opt/${pname}
+
+    cp -r . $out/opt/${pname}/
+    install -m 444 -D icon/bf_icon_128.png $out/share/icons/hicolor/128x128/apps/${pname}.png
+    cp -r ${desktopItem}/share/applications $out/share/
+
+    makeWrapper ${nwjs}/bin/nw $out/bin/${pname} --add-flags $out/opt/${pname}
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "The Betaflight flight control system configuration tool";
+    mainProgram = "betaflight-configurator";
+    longDescription = ''
+      A crossplatform configuration tool for the Betaflight flight control system.
+      Various types of aircraft are supported by the tool and by Betaflight, e.g.
+      quadcopters, hexacopters, octocopters and fixed-wing aircraft.
+    '';
+    homepage    = "https://github.com/betaflight/betaflight/wiki";
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    license     = licenses.gpl3;
+    maintainers = with maintainers; [ wucke13 ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/robotics/emuflight-configurator/default.nix b/nixpkgs/pkgs/applications/science/robotics/emuflight-configurator/default.nix
new file mode 100644
index 000000000000..2c51355eb54f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/robotics/emuflight-configurator/default.nix
@@ -0,0 +1,52 @@
+{lib, stdenv, fetchurl, unzip, makeDesktopItem, copyDesktopItems, nwjs
+, wrapGAppsHook, gsettings-desktop-schemas, gtk3 }:
+
+stdenv.mkDerivation rec {
+  pname = "emuflight-configurator";
+  version = "0.4.1";
+
+  src = fetchurl {
+    url = "https://github.com/emuflight/EmuConfigurator/releases/download/${version}/emuflight-configurator_${version}_linux64.zip";
+    sha256 = "sha256-e4HNg5yr9V5LyT0hYP6gzw0tZm4dLidJg5MQtH3L3JI=";
+  };
+
+  nativeBuildInputs = [ wrapGAppsHook unzip copyDesktopItems ];
+
+  buildInputs = [ gsettings-desktop-schemas gtk3 ];
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/${pname}
+
+    cp -r . $out/share/${pname}/
+    install -m 444 -D icon/emu_icon_128.png $out/share/icons/hicolor/128x128/apps/${pname}.png
+
+    makeWrapper ${nwjs}/bin/nw $out/bin/${pname} --add-flags $out/share/${pname}
+  '';
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = pname;
+      exec = pname;
+      icon = pname;
+      comment = "Emuflight configuration tool";
+      desktopName = "Emuflight Configurator";
+      genericName = "Flight controller configuration tool";
+    })
+  ];
+
+  meta = with lib; {
+    description = "The Emuflight flight control system configuration tool";
+    mainProgram = "emuflight-configurator";
+    longDescription = ''
+      A crossplatform configuration tool for the Emuflight flight control system.
+      Various types of aircraft are supported by the tool and by Emuflight, e.g.
+      quadcopters, hexacopters, octocopters and fixed-wing aircraft.
+      The application allows you to configure the Emuflight software running on any supported Emuflight target.
+    '';
+    homepage    = "https://github.com/emuflight/EmuConfigurator";
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    license     = licenses.gpl3Only;
+    maintainers = with maintainers; [ beezow ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/robotics/inav-configurator/default.nix b/nixpkgs/pkgs/applications/science/robotics/inav-configurator/default.nix
new file mode 100644
index 000000000000..f5216eaf6c92
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/robotics/inav-configurator/default.nix
@@ -0,0 +1,59 @@
+{ lib, stdenv, fetchurl, makeDesktopItem, copyDesktopItems, nwjs, wrapGAppsHook, gsettings-desktop-schemas, gtk3 }:
+
+stdenv.mkDerivation rec {
+  pname = "inav-configurator";
+  version = "5.1.0";
+
+  src = fetchurl {
+    url = "https://github.com/iNavFlight/inav-configurator/releases/download/${version}/INAV-Configurator_linux64_${version}.tar.gz";
+    sha256 = "sha256-ZvZxQICa5fnJBTx0aW/hqQCuhQW9MkcVa2sOjPYaPXM=";
+  };
+
+  icon = fetchurl {
+    url = "https://raw.githubusercontent.com/iNavFlight/inav-configurator/bf3fc89e6df51ecb83a386cd000eebf16859879e/images/inav_icon_128.png";
+    sha256 = "1i844dzzc5s5cr4vfpi6k2kdn8jiqq2n6c0fjqvsp4wdidwjahzw";
+  };
+
+  nativeBuildInputs = [ copyDesktopItems wrapGAppsHook ];
+
+  buildInputs = [ gsettings-desktop-schemas gtk3 ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin \
+             $out/opt/${pname}
+
+    cp -r inav-configurator $out/opt/inav-configurator/
+    install -m 444 -D $icon $out/share/icons/hicolor/128x128/apps/${pname}.png
+
+    chmod +x $out/opt/inav-configurator/inav-configurator
+    makeWrapper ${nwjs}/bin/nw $out/bin/${pname} --add-flags $out/opt/inav-configurator/inav-configurator
+
+    runHook postInstall
+  '';
+
+  desktopItems = makeDesktopItem {
+    name = pname;
+    exec = pname;
+    icon = pname;
+    comment = "iNavFlight configuration tool";
+    desktopName = "iNav Configurator";
+    genericName = "Flight controller configuration tool";
+  };
+
+  meta = with lib; {
+    description = "The iNav flight control system configuration tool";
+    mainProgram = "inav-configurator";
+    longDescription = ''
+      A crossplatform configuration tool for the iNav flight control system.
+      Various types of aircraft are supported by the tool and by iNav, e.g.
+      quadcopters, hexacopters, octocopters and fixed-wing aircraft.
+    '';
+    homepage = "https://github.com/iNavFlight/inav/wiki";
+    sourceProvenance = with sourceTypes; [ binaryNativeCode ];
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ tilcreator wucke13 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/robotics/mavproxy/default.nix b/nixpkgs/pkgs/applications/science/robotics/mavproxy/default.nix
new file mode 100644
index 000000000000..f86ca5f635e4
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/robotics/mavproxy/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, lib, buildPythonApplication, fetchPypi, lxml, matplotlib, numpy
+, opencv4, pymavlink, pyserial, setuptools, wxpython, billiard
+, gnureadline }:
+
+buildPythonApplication rec {
+  pname = "MAVProxy";
+  version = "1.8.70";
+
+  src = fetchPypi {
+    inherit pname version;
+    hash = "sha256-U5K+0lxJbBvwETnJ3MTMkk47CMOSlJBeFrCLHW9OSh8=";
+  };
+
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace "opencv-python" ""
+  '';
+
+  propagatedBuildInputs = [
+    lxml
+    matplotlib
+    numpy
+    opencv4
+    pymavlink
+    pyserial
+    setuptools
+    wxpython
+  ] ++ lib.optionals stdenv.isDarwin [ billiard gnureadline ];
+
+  # No tests
+  doCheck = false;
+
+  meta = with lib; {
+    description = "MAVLink proxy and command line ground station";
+    homepage = "https://github.com/ArduPilot/MAVProxy";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ lopsided98 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/robotics/mission-planner/default.nix b/nixpkgs/pkgs/applications/science/robotics/mission-planner/default.nix
new file mode 100644
index 000000000000..f6e7e5f114fa
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/robotics/mission-planner/default.nix
@@ -0,0 +1,60 @@
+{ lib, stdenv, fetchurl, makeDesktopItem, makeWrapper, unzip, mono }:
+
+let
+  pname = "mission-planner";
+  desktopItem = makeDesktopItem {
+    name = pname;
+    exec = pname;
+    icon = pname;
+    comment = "MissionPlanner GCS & Ardupilot configuration tool";
+    desktopName = "MissionPlanner";
+    genericName = "Ground Control Station";
+  };
+in stdenv.mkDerivation rec {
+  inherit pname;
+  version = "1.3.80";
+
+  src = fetchurl {
+    url = "https://firmware.ardupilot.org/Tools/MissionPlanner/MissionPlanner-${version}.zip";
+    sha256 = "sha256-iivlaQWtOMJHchmR92FoqTaosGJ9F1AgFtuFgDE/9qQ=";
+  };
+
+  nativeBuildInputs = [ makeWrapper mono unzip ];
+  sourceRoot = ".";
+
+  AOT_FILES = [ "MissionPlanner.exe" "MissionPlanner.*.dll" ];
+
+  buildPhase = ''
+    runHook preBuild
+    for file in $AOT_FILES
+    do
+      mono --aot $file
+    done
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/{bin,opt/mission-planner}
+    install -m 444 -D mpdesktop150.png $out/share/icons/mission-planner.png
+    cp -r ${desktopItem}/share/applications $out/share/
+    mv * $out/opt/mission-planner
+    makeWrapper ${mono}/bin/mono $out/bin/mission-planner \
+      --add-flags $out/opt/mission-planner/MissionPlanner.exe
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "An ArduPilot ground station";
+    mainProgram = "mission-planner";
+    longDescription = ''
+      Full-featured ground station application for the ArduPilot open source
+      autopilot project.  Lets you both flash, configure and control ArduPilot
+      Plane, Copter and Rover targets.
+    '';
+    homepage = "https://ardupilot.org/planner/";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ wucke13 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/robotics/mujoco/default.nix b/nixpkgs/pkgs/applications/science/robotics/mujoco/default.nix
new file mode 100644
index 000000000000..15d2e156a589
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/robotics/mujoco/default.nix
@@ -0,0 +1,188 @@
+{ cereal_1_3_2
+, cmake
+, fetchFromGitHub
+, fetchFromGitLab
+, glfw
+, glm
+, lib
+, spdlog
+, stdenv
+}:
+
+let
+  pin = {
+
+    # See https://github.com/google-deepmind/mujoco/blob/3.0.0/cmake/MujocoDependencies.cmake#L17-L64
+    abseil-cpp = fetchFromGitHub {
+      owner = "abseil";
+      repo = "abseil-cpp";
+      rev = "2f9e432cce407ce0ae50676696666f33a77d42ac";
+      hash = "sha256-D4E11bICKr3Z5RRah7QkfXVsXtuUg32FMmKpiOGjZDM=";
+    };
+    benchmark = fetchFromGitHub {
+      owner = "google";
+      repo = "benchmark";
+      rev = "e45585a4b8e75c28479fa4107182c28172799640";
+      hash = "sha256-pgHvmRpPd99ePUVRsi7WXLVSZngZ5q6r1vWW4mdGvxY=";
+    };
+    ccd = fetchFromGitHub {
+      owner = "danfis";
+      repo = "libccd";
+      rev = "7931e764a19ef6b21b443376c699bbc9c6d4fba8";
+      hash = "sha256-TIZkmqQXa0+bSWpqffIgaBela0/INNsX9LPM026x1Wk=";
+    };
+    eigen3 = fetchFromGitLab {
+      owner = "libeigen";
+      repo = "eigen";
+      rev = "2a9055b50ed22101da7d77e999b90ed50956fe0b";
+      hash = "sha256-tx/XR7xJ7IMh5RMvL8wRo/g+dfD3xcjZkLPSY4D9HaY=";
+    };
+    googletest = fetchFromGitHub {
+      owner = "google";
+      repo = "googletest";
+      rev = "f8d7d77c06936315286eb55f8de22cd23c188571";
+      hash = "sha256-t0RchAHTJbuI5YW4uyBPykTvcjy90JW9AOPNjIhwh6U=";
+    };
+    lodepng = fetchFromGitHub {
+      owner = "lvandeve";
+      repo = "lodepng";
+      rev = "b4ed2cd7ecf61d29076169b49199371456d4f90b";
+      hash = "sha256-5cCkdj/izP4e99BKfs/Mnwu9aatYXjlyxzzYiMD/y1M=";
+    };
+    qhull = fetchFromGitHub {
+      owner = "qhull";
+      repo = "qhull";
+      rev = "0c8fc90d2037588024d9964515c1e684f6007ecc";
+      hash = "sha256-Ptzxad3ewmKJbbcmrBT+os4b4SR976zlCG9F0nq0x94=";
+    };
+    tinyobjloader = fetchFromGitHub {
+      owner = "tinyobjloader";
+      repo = "tinyobjloader";
+      rev = "1421a10d6ed9742f5b2c1766d22faa6cfbc56248";
+      hash = "sha256-9z2Ne/WPCiXkQpT8Cun/pSGUwgClYH+kQ6Dx1JvW6w0=";
+    };
+    tinyxml2 = fetchFromGitHub {
+      owner = "leethomason";
+      repo = "tinyxml2";
+      rev = "9a89766acc42ddfa9e7133c7d81a5bda108a0ade";
+      hash = "sha256-YGAe4+Ttv/xeou+9FoJjmQCKgzupTYdDhd+gzvtz/88=";
+    };
+    marchingcubecpp = fetchFromGitHub {
+      owner = "aparis69";
+      repo = "MarchingCubeCpp";
+      rev = "5b79e5d6bded086a0abe276a4b5a69fc17ae9bf1";
+      hash = "sha256-L0DH1GJZ/3vatQAU/KZj/2xTKE6Fwcw9eQYzLdqX2N4=";
+    };
+
+    tmd = stdenv.mkDerivation rec {
+      name = "TriangleMeshDistance";
+
+      src = fetchFromGitHub {
+        owner = "InteractiveComputerGraphics";
+        repo = name;
+        rev = "e55a15c20551f36242fd6368df099a99de71d43a";
+        hash = "sha256-vj6TMMT8mp7ciLa5nzVAhMWPcAHXq+ZwHlWsRA3uCmg=";
+      };
+
+      installPhase = ''
+        mkdir -p $out/include/tmd
+        cp ${name}/include/tmd/${name}.h $out/include/tmd/
+      '';
+    };
+
+    sdflib = stdenv.mkDerivation rec {
+      name = "SdfLib";
+
+      src = fetchFromGitHub {
+        owner = "UPC-ViRVIG";
+        repo = name;
+        rev = "1927bee6bb8225258a39c8cbf14e18a4d50409ae";
+        hash = "sha256-+SFUOdZ6pGZvnQa0mT+yfbTMHWe2CTOlroXcuVBHdOE=";
+      };
+
+      patches = [ ./sdflib-system-deps.patch ];
+
+      cmakeFlags = [
+        "-DSDFLIB_USE_ASSIMP=OFF"
+        "-DSDFLIB_USE_OPENMP=OFF"
+        "-DSDFLIB_USE_ENOKI=OFF"
+        "-DSDFLIB_USE_SYSTEM_GLM=ON"
+        "-DSDFLIB_USE_SYSTEM_SPDLOG=ON"
+        "-DSDFLIB_USE_SYSTEM_CEREAL=ON"
+        "-DSDFLIB_USE_SYSTEM_TRIANGLEMESHDISTANCE=ON"
+      ];
+
+      nativeBuildInputs = [ cmake ];
+      buildInputs = [
+        pin.tmd
+
+        # Mainline. The otherwise pinned glm realease from 2018 does
+        # not build due to test failures and missing files.
+        glm
+
+        spdlog
+        cereal_1_3_2
+      ];
+    };
+
+  };
+
+in stdenv.mkDerivation rec {
+  pname = "mujoco";
+  version = "3.1.3";
+
+  # Bumping version? Make sure to look though the MuJoCo's commit
+  # history for bumped dependency pins!
+  src = fetchFromGitHub {
+    owner = "google-deepmind";
+    repo = "mujoco";
+    rev = "refs/tags/${version}";
+    hash = "sha256-22yH3zAD479TRNS3XSqy6PuuLqyWmjvwScUTVfKumzY=";
+  };
+
+  patches = [ ./mujoco-system-deps-dont-fetch.patch ];
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [
+    pin.sdflib
+    glm
+
+    # non-numerical
+    spdlog
+    cereal_1_3_2
+    glfw
+  ];
+
+  cmakeFlags = [
+    "-DMUJOCO_USE_SYSTEM_sdflib=ON"
+    "-DMUJOCO_SIMULATE_USE_SYSTEM_GLFW=ON"
+    "-DMUJOCO_SAMPLES_USE_SYSTEM_GLFW=ON"
+  ];
+
+  # Move things into place so that cmake doesn't try downloading dependencies.
+  preConfigure = ''
+    mkdir -p build/_deps
+    ln -s ${pin.abseil-cpp} build/_deps/abseil-cpp-src
+    ln -s ${pin.benchmark} build/_deps/benchmark-src
+    ln -s ${pin.ccd} build/_deps/ccd-src
+    ln -s ${pin.eigen3} build/_deps/eigen3-src
+    ln -s ${pin.googletest} build/_deps/googletest-src
+    ln -s ${pin.lodepng} build/_deps/lodepng-src
+    ln -s ${pin.qhull} build/_deps/qhull-src
+    ln -s ${pin.tinyobjloader} build/_deps/tinyobjloader-src
+    ln -s ${pin.tinyxml2} build/_deps/tinyxml2-src
+    ln -s ${pin.marchingcubecpp} build/_deps/marchingcubecpp-src
+  '';
+
+  passthru.pin = { inherit (pin) lodepng eigen3 abseil-cpp; };
+
+  meta = with lib; {
+    description = "Multi-Joint dynamics with Contact. A general purpose physics simulator.";
+    homepage = "https://mujoco.org/";
+    changelog = "https://github.com/google-deepmind/mujoco/releases/tag/${version}";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ samuela tmplt ];
+    broken = stdenv.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/robotics/mujoco/mujoco-system-deps-dont-fetch.patch b/nixpkgs/pkgs/applications/science/robotics/mujoco/mujoco-system-deps-dont-fetch.patch
new file mode 100644
index 000000000000..c09787ff84c5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/robotics/mujoco/mujoco-system-deps-dont-fetch.patch
@@ -0,0 +1,519 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index eea180c0..efb39178 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -93,7 +93,7 @@ add_subdirectory(src/render)
+ add_subdirectory(src/thread)
+ add_subdirectory(src/ui)
+ 
+-target_compile_definitions(mujoco PRIVATE _GNU_SOURCE CCD_STATIC_DEFINE MUJOCO_DLL_EXPORTS -DMC_IMPLEM_ENABLE)
++target_compile_definitions(mujoco PRIVATE _GNU_SOURCE MUJOCO_DLL_EXPORTS -DMC_IMPLEM_ENABLE)
+ if(MUJOCO_ENABLE_AVX_INTRINSICS)
+   target_compile_definitions(mujoco PUBLIC mjUSEPLATFORMSIMD)
+ endif()
+@@ -118,7 +118,7 @@ target_link_libraries(
+           lodepng
+           qhullstatic_r
+           tinyobjloader
+-          tinyxml2
++          tinyxml2::tinyxml2
+ )
+ 
+ set_target_properties(
+diff --git a/cmake/MujocoDependencies.cmake b/cmake/MujocoDependencies.cmake
+index 44962272..656beeb8 100644
+--- a/cmake/MujocoDependencies.cmake
++++ b/cmake/MujocoDependencies.cmake
+@@ -93,28 +93,36 @@ set(BUILD_SHARED_LIBS
+ if(NOT TARGET lodepng)
+   FetchContent_Declare(
+     lodepng
+-    GIT_REPOSITORY https://github.com/lvandeve/lodepng.git
+-    GIT_TAG ${MUJOCO_DEP_VERSION_lodepng}
+   )
++endif()
+ 
+-  FetchContent_GetProperties(lodepng)
+-  if(NOT lodepng_POPULATED)
+-    FetchContent_Populate(lodepng)
+-    # This is not a CMake project.
+-    set(LODEPNG_SRCS ${lodepng_SOURCE_DIR}/lodepng.cpp)
+-    set(LODEPNG_HEADERS ${lodepng_SOURCE_DIR}/lodepng.h)
+-    add_library(lodepng STATIC ${LODEPNG_HEADERS} ${LODEPNG_SRCS})
+-    target_compile_options(lodepng PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
+-    target_link_options(lodepng PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
+-    target_include_directories(lodepng PUBLIC ${lodepng_SOURCE_DIR})
++if(NOT TARGET lodepng)
++  if(NOT MUJOCO_USE_SYSTEM_lodepng)
++    fetchcontent_declare(
++      lodepng
++      GIT_REPOSITORY https://github.com/lvandeve/lodepng.git
++      GIT_TAG ${MUJOCO_DEP_VERSION_lodepng}
++    )
++
++    FetchContent_GetProperties(lodepng)
++    if(NOT lodepng_POPULATED)
++      FetchContent_Populate(lodepng)
++      # This is not a CMake project.
++      set(LODEPNG_SRCS ${lodepng_SOURCE_DIR}/lodepng.cpp)
++      set(LODEPNG_HEADERS ${lodepng_SOURCE_DIR}/lodepng.h)
++      add_library(lodepng STATIC ${LODEPNG_HEADERS} ${LODEPNG_SRCS})
++      target_compile_options(lodepng PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
++      target_link_options(lodepng PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
++      target_include_directories(lodepng PUBLIC ${lodepng_SOURCE_DIR})
++    endif()
++  else()
++    find_package(lodepng REQUIRED)
+   endif()
+ endif()
+ 
+ if(NOT TARGET marchingcubecpp)
+   FetchContent_Declare(
+     marchingcubecpp
+-    GIT_REPOSITORY https://github.com/aparis69/MarchingCubeCpp.git
+-    GIT_TAG ${MUJOCO_DEP_VERSION_MarchingCubeCpp}
+   )
+ 
+   FetchContent_GetProperties(marchingcubecpp)
+@@ -124,119 +132,158 @@ if(NOT TARGET marchingcubecpp)
+   endif()
+ endif()
+ 
++option(MUJOCO_USE_SYSTEM_qhull "Use installed qhull version." OFF)
++mark_as_advanced(MUJOCO_USE_SYSTEM_qhull)
++
+ set(QHULL_ENABLE_TESTING OFF)
+ 
+ findorfetch(
+   USE_SYSTEM_PACKAGE
+-  OFF
++  ${MUJOCO_USE_SYSTEM_qhull}
+   PACKAGE_NAME
+-  qhull
++  Qhull
+   LIBRARY_NAME
+   qhull
+-  GIT_REPO
+-  https://github.com/qhull/qhull.git
+-  GIT_TAG
+-  ${MUJOCO_DEP_VERSION_qhull}
+   TARGETS
+   qhull
+   EXCLUDE_FROM_ALL
+ )
+-# MuJoCo includes a file from libqhull_r which is not exported by the qhull include directories.
+-# Add it to the target.
+-target_include_directories(
+-  qhullstatic_r INTERFACE $<BUILD_INTERFACE:${qhull_SOURCE_DIR}/src/libqhull_r>
+-)
+-target_compile_options(qhullstatic_r PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
+-target_link_options(qhullstatic_r PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
++if(NOT MUJOCO_USE_SYSTEM_qhull)
++  # MuJoCo includes a file from libqhull_r which is not exported by the qhull include directories.
++  # Add it to the target.
++  target_include_directories(
++    qhullstatic_r INTERFACE $<BUILD_INTERFACE:${qhull_SOURCE_DIR}/src/libqhull_r>
++  )
++  target_compile_options(qhullstatic_r PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
++  target_link_options(qhullstatic_r PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
++else()
++  if(NOT TARGET qhullstatic_r)
++    add_library(qhullstatic_r INTERFACE)
++    set_target_properties(qhullstatic_r PROPERTIES INTERFACE_LINK_LIBRARIES Qhull::qhull_r)
++
++    # Workaround as headers are installed in <prefix>/include/libqhull_r/something.h
++    # but mujoco include them as #include <something.h>
++    get_property(qhull_include_dirs TARGET Qhull::qhull_r PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
++    foreach(qhull_include_dir IN LISTS qhull_include_dirs)
++      target_include_directories(qhullstatic_r INTERFACE ${qhull_include_dirs}/libqhull_r)
++    endforeach()
++    target_include_directories(qhullstatic_r INTERFACE )
++  endif()
++endif()
++
++option(MUJOCO_USE_SYSTEM_tinyxml2 "Use installed tinyxml2 version." OFF)
++mark_as_advanced(MUJOCO_USE_SYSTEM_tinyxml2)
+ 
+ set(tinyxml2_BUILD_TESTING OFF)
+ findorfetch(
+   USE_SYSTEM_PACKAGE
+-  OFF
++  ${MUJOCO_USE_SYSTEM_tinyxml2}
+   PACKAGE_NAME
+   tinyxml2
+   LIBRARY_NAME
+   tinyxml2
+-  GIT_REPO
+-  https://github.com/leethomason/tinyxml2.git
+-  GIT_TAG
+-  ${MUJOCO_DEP_VERSION_tinyxml2}
+   TARGETS
+-  tinyxml2
++  tinyxml2::tinyxml2
+   EXCLUDE_FROM_ALL
+ )
+-target_compile_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
+-target_link_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
++if(NOT MUJOCO_USE_SYSTEM_tinyxml2)
++  target_compile_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
++  target_link_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
++endif()
++
++option(MUJOCO_USE_SYSTEM_tinyobjloader "Use installed tinyobjloader version." OFF)
++mark_as_advanced(MUJOCO_USE_SYSTEM_tinyobjloader)
+ 
+ findorfetch(
+   USE_SYSTEM_PACKAGE
+-  OFF
++  ${MUJOCO_USE_SYSTEM_tinyobjloader}
+   PACKAGE_NAME
+   tinyobjloader
+   LIBRARY_NAME
+   tinyobjloader
+-  GIT_REPO
+-  https://github.com/tinyobjloader/tinyobjloader.git
+-  GIT_TAG
+-  ${MUJOCO_DEP_VERSION_tinyobjloader}
+   TARGETS
+   tinyobjloader
+   EXCLUDE_FROM_ALL
+ )
+ 
++if(MUJOCO_USE_SYSTEM_tinyobjloader)
++  # As of tinyobjloader v2.0.0rc10, the tinyobjloader target is named tinyobjloader in the build,
++  # but tinyobjloader::tinyobjloader when it is installed. To deal with this, if tinyobjloader is
++  # found in the system, we create an ALIAS
++  # The following is equivalent to add_library(tinyobjloader ALIAS tinyobjloader::tinyobjloader),
++  # but compatible with CMake 3.16 . Once the minimum CMake is bumped to CMake 3.18, we can use
++  # the simpler version
++  add_library(tinyobjloader INTERFACE IMPORTED)
++  set_target_properties(tinyobjloader PROPERTIES INTERFACE_LINK_LIBRARIES tinyobjloader::tinyobjloader)
++endif()
++
++option(MUJOCO_USE_SYSTEM_sdflib "Use installed sdflib version." OFF)
++mark_as_advanced(MUJOCO_USE_SYSTEM_sdflib)
++
+ option(SDFLIB_USE_ASSIMP OFF)
+ option(SDFLIB_USE_OPENMP OFF)
+ option(SDFLIB_USE_ENOKI OFF)
++
+ findorfetch(
+   USE_SYSTEM_PACKAGE
+-  OFF
++  ${MUJOCO_USE_SYSTEM_sdflib}
+   PACKAGE_NAME
+-  sdflib
++  SdfLib
+   LIBRARY_NAME
+   sdflib
+-  GIT_REPO
+-  https://github.com/UPC-ViRVIG/SdfLib.git
+-  GIT_TAG
+-  ${MUJOCO_DEP_VERSION_sdflib}
+   TARGETS
+-  SdfLib
++  SdfLib::SdfLib
+   EXCLUDE_FROM_ALL
+ )
+-target_compile_options(SdfLib PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
+-target_link_options(SdfLib PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
++
++if(NOT MUJOCO_USE_SYSTEM_sdflib)
++  target_compile_options(SdfLib PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
++  target_link_options(SdfLib PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
++endif()
++
++option(MUJOCO_USE_SYSTEM_ccd "Use installed ccd version." OFF)
++mark_as_advanced(MUJOCO_USE_SYSTEM_ccd)
+ 
+ set(ENABLE_DOUBLE_PRECISION ON)
+ set(CCD_HIDE_ALL_SYMBOLS ON)
+ findorfetch(
+   USE_SYSTEM_PACKAGE
+-  OFF
++  ${MUJOCO_USE_SYSTEM_ccd}
+   PACKAGE_NAME
+   ccd
+   LIBRARY_NAME
+   ccd
+-  GIT_REPO
+-  https://github.com/danfis/libccd.git
+-  GIT_TAG
+-  ${MUJOCO_DEP_VERSION_ccd}
+   TARGETS
+   ccd
+   EXCLUDE_FROM_ALL
+ )
+-target_compile_options(ccd PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
+-target_link_options(ccd PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
+-
+-# libCCD has an unconditional `#define _CRT_SECURE_NO_WARNINGS` on Windows.
+-# TODO(stunya): Remove this after https://github.com/danfis/libccd/pull/77 is merged.
+-if(WIN32)
+-  if(MSVC)
+-    # C4005 is the MSVC equivalent of -Wmacro-redefined.
+-    target_compile_options(ccd PRIVATE /wd4005)
+-  else()
+-    target_compile_options(ccd PRIVATE -Wno-macro-redefined)
++
++if(NOT MUJOCO_USE_SYSTEM_ccd)
++  target_compile_options(ccd PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
++  target_link_options(ccd PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
++  # This is necessary to ensure that the any library that consumes the ccd
++  # compiled internally by MuJoCo (as static library) has CCD_EXPORT correctly
++  # defined as an empty string. For ccd itself, this is ensured by the variable
++  # CCD_HIDE_ALL_SYMBOLS set to ON before the call to findorfetch
++  # See https://github.com/danfis/libccd/pull/79
++  target_compile_definitions(ccd INTERFACE CCD_STATIC_DEFINE)
++
++  # libCCD has an unconditional `#define _CRT_SECURE_NO_WARNINGS` on Windows.
++  # TODO(stunya): Remove this after https://github.com/danfis/libccd/pull/77 is merged.
++  if(WIN32)
++    if(MSVC)
++      # C4005 is the MSVC equivalent of -Wmacro-redefined.
++      target_compile_options(ccd PRIVATE /wd4005)
++    else()
++      target_compile_options(ccd PRIVATE -Wno-macro-redefined)
++    endif()
+   endif()
+ endif()
+ 
+ if(MUJOCO_BUILD_TESTS)
++  option(MUJOCO_USE_SYSTEM_abseil "Use installed abseil version." OFF)
++  mark_as_advanced(MUJOCO_USE_SYSTEM_abseil)
++
+   set(ABSL_PROPAGATE_CXX_STD ON)
+ 
+   # This specific version of Abseil does not have the following variable. We need to work with BUILD_TESTING
+@@ -249,15 +296,11 @@ if(MUJOCO_BUILD_TESTS)
+   set(ABSL_BUILD_TESTING OFF)
+   findorfetch(
+     USE_SYSTEM_PACKAGE
+-    OFF
++    ${MUJOCO_USE_SYSTEM_abseil}
+     PACKAGE_NAME
+     absl
+     LIBRARY_NAME
+     abseil-cpp
+-    GIT_REPO
+-    https://github.com/abseil/abseil-cpp.git
+-    GIT_TAG
+-    ${MUJOCO_DEP_VERSION_abseil}
+     TARGETS
+     absl::core_headers
+     EXCLUDE_FROM_ALL
+@@ -268,6 +311,9 @@ if(MUJOCO_BUILD_TESTS)
+       CACHE BOOL "Build tests." FORCE
+   )
+ 
++  option(MUJOCO_USE_SYSTEM_gtest "Use installed gtest version." OFF)
++  mark_as_advanced(MUJOCO_USE_SYSTEM_gtest)
++
+   # Avoid linking errors on Windows by dynamically linking to the C runtime.
+   set(gtest_force_shared_crt
+       ON
+@@ -276,22 +322,20 @@ if(MUJOCO_BUILD_TESTS)
+ 
+   findorfetch(
+     USE_SYSTEM_PACKAGE
+-    OFF
++    ${MUJOCO_USE_SYSTEM_gtest}
+     PACKAGE_NAME
+     GTest
+     LIBRARY_NAME
+     googletest
+-    GIT_REPO
+-    https://github.com/google/googletest.git
+-    GIT_TAG
+-    ${MUJOCO_DEP_VERSION_gtest}
+     TARGETS
+-    gtest
+-    gmock
+-    gtest_main
++    GTest::gmock
++    GTest::gtest_main
+     EXCLUDE_FROM_ALL
+   )
+ 
++  option(MUJOCO_USE_SYSTEM_benchmark "Use installed benchmark version." OFF)
++  mark_as_advanced(MUJOCO_USE_SYSTEM_benchmark)
++
+   set(BENCHMARK_EXTRA_FETCH_ARGS "")
+   if(WIN32 AND NOT MSVC)
+     set(BENCHMARK_EXTRA_FETCH_ARGS
+@@ -310,15 +354,11 @@ if(MUJOCO_BUILD_TESTS)
+ 
+   findorfetch(
+     USE_SYSTEM_PACKAGE
+-    OFF
++    ${MUJOCO_USE_SYSTEM_benchmark}
+     PACKAGE_NAME
+     benchmark
+     LIBRARY_NAME
+     benchmark
+-    GIT_REPO
+-    https://github.com/google/benchmark.git
+-    GIT_TAG
+-    ${MUJOCO_DEP_VERSION_benchmark}
+     TARGETS
+     benchmark::benchmark
+     benchmark::benchmark_main
+@@ -328,15 +368,18 @@ if(MUJOCO_BUILD_TESTS)
+ endif()
+ 
+ if(MUJOCO_TEST_PYTHON_UTIL)
++  option(MUJOCO_USE_SYSTEM_Eigen3 "Use installed Eigen3 version." OFF)
++  mark_as_advanced(MUJOCO_USE_SYSTEM_Eigen3)
++
+   add_compile_definitions(EIGEN_MPL2_ONLY)
+-  if(NOT TARGET eigen)
+-    # Support new IN_LIST if() operator.
+-    set(CMAKE_POLICY_DEFAULT_CMP0057 NEW)
++  if(NOT TARGET Eigen3::Eigen)
++    if(NOT MUJOCO_USE_SYSTEM_Eigen3)
++      # Support new IN_LIST if() operator.
++      set(CMAKE_POLICY_DEFAULT_CMP0057 NEW)
++    endif()
+ 
+     FetchContent_Declare(
+       Eigen3
+-      GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
+-      GIT_TAG ${MUJOCO_DEP_VERSION_Eigen3}
+     )
+ 
+     FetchContent_GetProperties(Eigen3)
+@@ -348,6 +391,19 @@ if(MUJOCO_TEST_PYTHON_UTIL)
+       set_target_properties(
+         Eigen3::Eigen PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${eigen3_SOURCE_DIR}"
+       )
++
++      fetchcontent_getproperties(Eigen3)
++      # if(NOT Eigen3_POPULATED)
++      #   fetchcontent_populate(Eigen3)
++
++      #   # Mark the library as IMPORTED as a workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/15415
++      #   add_library(Eigen3::Eigen INTERFACE IMPORTED)
++      #   set_target_properties(
++      #     Eigen3::Eigen PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${eigen3_SOURCE_DIR}"
++      #   )
++      # endif()
++    else()
++      find_package(Eigen3 REQUIRED)
+     endif()
+   endif()
+ endif()
+diff --git a/plugin/sdf/CMakeLists.txt b/plugin/sdf/CMakeLists.txt
+index 3e216fc4..e7e3a1eb 100644
+--- a/plugin/sdf/CMakeLists.txt
++++ b/plugin/sdf/CMakeLists.txt
+@@ -37,7 +37,7 @@ set(MUJOCO_SDF_SRCS
+ add_library(sdf SHARED)
+ target_sources(sdf PRIVATE ${MUJOCO_SDF_SRCS})
+ target_include_directories(sdf PRIVATE ${MUJOCO_SDF_INCLUDE})
+-target_link_libraries(sdf PRIVATE mujoco SdfLib)
++target_link_libraries(sdf PRIVATE mujoco SdfLib::SdfLib)
+ target_compile_options(
+   sdf
+   PRIVATE ${AVX_COMPILE_OPTIONS}
+diff --git a/python/mujoco/util/CMakeLists.txt b/python/mujoco/util/CMakeLists.txt
+index 666a3725..d89bb499 100644
+--- a/python/mujoco/util/CMakeLists.txt
++++ b/python/mujoco/util/CMakeLists.txt
+@@ -63,8 +63,8 @@ if(BUILD_TESTING)
+   target_link_libraries(
+     array_traits_test
+     array_traits
+-    gmock
+-    gtest_main
++    GTest::gmock
++    GTest::gtest_main
+   )
+   gtest_add_tests(TARGET array_traits_test SOURCES array_traits_test.cc)
+ 
+@@ -72,8 +72,8 @@ if(BUILD_TESTING)
+   target_link_libraries(
+     func_traits_test
+     func_traits
+-    gmock
+-    gtest_main
++    GTest::gmock
++    GTest::gtest_main
+   )
+   gtest_add_tests(TARGET func_traits_test SOURCES func_traits_test.cc)
+ 
+@@ -81,8 +81,8 @@ if(BUILD_TESTING)
+   target_link_libraries(
+     func_wrap_test
+     func_wrap
+-    gmock
+-    gtest_main
++    GTest::gmock
++    GTest::gtest_main
+   )
+   gtest_add_tests(TARGET func_wrap_test SOURCES func_wrap_test.cc)
+ 
+@@ -90,8 +90,8 @@ if(BUILD_TESTING)
+   target_link_libraries(
+     tuple_tools_test
+     func_wrap
+-    gmock
+-    gtest_main
++    GTest::gmock
++    GTest::gtest_main
+   )
+   gtest_add_tests(TARGET tuple_tools_test SOURCES tuple_tools_test.cc)
+ endif()
+diff --git a/simulate/cmake/SimulateDependencies.cmake b/simulate/cmake/SimulateDependencies.cmake
+index 5141406c..75ff7884 100644
+--- a/simulate/cmake/SimulateDependencies.cmake
++++ b/simulate/cmake/SimulateDependencies.cmake
+@@ -81,10 +81,6 @@ findorfetch(
+   glfw3
+   LIBRARY_NAME
+   glfw3
+-  GIT_REPO
+-  https://github.com/glfw/glfw.git
+-  GIT_TAG
+-  ${MUJOCO_DEP_VERSION_glfw3}
+   TARGETS
+   glfw
+   EXCLUDE_FROM_ALL
+diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
+index 122760a9..ddd90819 100644
+--- a/test/CMakeLists.txt
++++ b/test/CMakeLists.txt
+@@ -30,7 +30,7 @@ macro(mujoco_test name)
+   )
+ 
+   add_executable(${name} ${name}.cc)
+-  target_link_libraries(${name} gtest_main mujoco)
++  target_link_libraries(${name} GTest::gtest_main mujoco)
+   target_include_directories(${name} PRIVATE ${MUJOCO_TEST_INCLUDE})
+   set_target_properties(${name} PROPERTIES BUILD_RPATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
+   # gtest_discover_tests is recommended over gtest_add_tests, but has some issues in Windows.
+@@ -60,20 +60,20 @@ target_link_libraries(
+          absl::synchronization
+          absl::flat_hash_map
+          absl::flat_hash_set
+-         gtest
+-         gmock
++         GTest::gtest
++         GTest::gmock
+          mujoco::mujoco
+ )
+ target_include_directories(fixture PRIVATE ${mujoco_SOURCE_DIR}/include gmock)
+ 
+ mujoco_test(fixture_test)
+-target_link_libraries(fixture_test fixture gmock)
++target_link_libraries(fixture_test fixture GTest::gmock)
+ 
+ mujoco_test(header_test)
+-target_link_libraries(header_test fixture gmock)
++target_link_libraries(fixture_test fixture GTest::gmock)
+ 
+ mujoco_test(pipeline_test)
+-target_link_libraries(pipeline_test fixture gmock)
++target_link_libraries(fixture_test fixture GTest::gmock)
+ 
+ add_subdirectory(benchmark)
+ add_subdirectory(engine)
diff --git a/nixpkgs/pkgs/applications/science/robotics/mujoco/sdflib-system-deps.patch b/nixpkgs/pkgs/applications/science/robotics/mujoco/sdflib-system-deps.patch
new file mode 100644
index 000000000000..ca84c60a63df
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/robotics/mujoco/sdflib-system-deps.patch
@@ -0,0 +1,192 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 251c456..3d30231 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -27,7 +27,7 @@ option(SDFLIB_USE_SYSTEM_GLM "Use glm library via find_package instead of downlo
+ option(SDFLIB_USE_SYSTEM_SPDLOG "Use spdlog library via find_package instead of downloading it" OFF)
+ option(SDFLIB_USE_SYSTEM_CEREAL "Use cereal library via find_package instead of downloading it" OFF)
+ option(SDFLIB_USE_SYSTEM_ASSIMP "Use assimp library via find_package instead of downloading it" OFF)
+-
++option(SDFLIB_USE_SYSTEM_TRIANGLEMESHDISTANCE "Use TriangleMeshDistance library via system includes instead of downloading it" OFF)
+ 
+ if(SDFLIB_DEBUG_INFO)
+     add_compile_definitions(SDFLIB_PRINT_STATISTICS)
+@@ -55,13 +55,52 @@ file(GLOB UTILS_SOURCE_FILES src/utils/*.cpp)
+ file(GLOB UTILS_HEADER_FILES src/utils/*.h)
+ 
+ # Add libraries
+-add_library(${PROJECT_NAME} STATIC  ${SOURCE_FILES} ${HEADER_FILES} ${PUBLIC_HEADER_FILES}
+-                                    ${SDF_SOURCE_FILES} ${SDF_HEADER_FILES}
+-                                    ${UTILS_SOURCE_FILES} ${UTILS_HEADER_FILES})
+-
+-target_include_directories(${PROJECT_NAME} PUBLIC include/)
++add_library(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES} ${PUBLIC_HEADER_FILES}
++                            ${SDF_SOURCE_FILES} ${SDF_HEADER_FILES}
++                            ${UTILS_SOURCE_FILES} ${UTILS_HEADER_FILES})
++add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
++if(BUILD_SHARED_LIBS AND WIN32)
++    set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
++endif()
++include(GNUInstallDirs)
++target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
++                                                  $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
+ target_include_directories(${PROJECT_NAME} PRIVATE src/)
+ 
++# Install library and CMake config files
++install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME})
++install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/SdfLib
++        DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
++
++install(EXPORT ${PROJECT_NAME}
++        FILE ${PROJECT_NAME}Targets.cmake
++        DESTINATION lib/cmake/${PROJECT_NAME}
++        NAMESPACE ${PROJECT_NAME}::
++)
++
++include(CMakePackageConfigHelpers)
++set(PACKAGE_DEPENDENCIES "")
++if(SDFLIB_USE_SYSTEM_GLM)
++    string(APPEND PACKAGE_DEPENDENCIES "find_dependency(glm)\n")
++endif()
++if(SDFLIB_USE_SYSTEM_SPDLOG)
++    string(APPEND PACKAGE_DEPENDENCIES "find_dependency(spdlog)\n")
++endif()
++if(SDFLIB_USE_SYSTEM_CEREAL)
++    string(APPEND PACKAGE_DEPENDENCIES "find_dependency(cereal)\n")
++endif()
++if(SDFLIB_USE_ASSIMP AND SDFLIB_USE_SYSTEM_ASSIMP)
++    string(APPEND PACKAGE_DEPENDENCIES "find_dependency(assimp)\n")
++endif()
++
++configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in
++                              "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
++                              INSTALL_DESTINATION "lib/cmake/${PROJECT_NAME}"
++                              NO_SET_AND_CHECK_MACRO
++                              NO_CHECK_REQUIRED_COMPONENTS_MACRO)
++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
++        DESTINATION lib/cmake/${PROJECT_NAME})
++
+ # Add shaders
+ file(GLOB SHADER_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src/render_engine/shaders 
+                        src/render_engine/shaders/*.frag 
+@@ -69,7 +108,7 @@ file(GLOB SHADER_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src/render_engine/sh
+                        src/render_engine/shaders/*.comp)
+ 
+ foreach(SHADER IN LISTS SHADER_FILES)
+-    add_custom_command(OUTPUT ${SHADER}
++add_custom_command(OUTPUT ${SHADER}
+             COMMAND cmake -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/src/render_engine/shaders/${SHADER} $<TARGET_FILE_DIR:${PROJECT_NAME}>/shaders/${SHADER}
+             DEPENDS src/render_engine/shaders/${SHADER}
+         )
+@@ -112,7 +151,10 @@ endif()
+ target_link_libraries(${PROJECT_NAME} PUBLIC ${SDFLIB_GLM_TARGET})
+ target_link_libraries(${PROJECT_NAME} PUBLIC spdlog::spdlog)
+ target_link_libraries(${PROJECT_NAME} PUBLIC cereal::cereal)
+-target_link_libraries(${PROJECT_NAME} PUBLIC icg)
++
++if(NOT SDFLIB_USE_SYSTEM_TRIANGLEMESHDISTANCE)
++    target_link_libraries(${PROJECT_NAME} PUBLIC TriangleMeshDistance)
++endif()
+ 
+ if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
+     target_link_libraries(${PROJECT_NAME} PUBLIC -lstdc++fs)
+diff --git a/SdfLibConfig.cmake.in b/SdfLibConfig.cmake.in
+new file mode 100644
+index 0000000..9b8265c
+--- /dev/null
++++ b/SdfLibConfig.cmake.in
+@@ -0,0 +1,7 @@
++@PACKAGE_INIT@

++

++include(CMakeFindDependencyMacro)

++

++@PACKAGE_DEPENDENCIES@

++

++include("${CMAKE_CURRENT_LIST_DIR}/SdfLibTargets.cmake")

+diff --git a/include/SdfLib/TrianglesInfluence.h b/include/SdfLib/TrianglesInfluence.h
+index fc2ca52..b276f23 100644
+--- a/include/SdfLib/TrianglesInfluence.h
++++ b/include/SdfLib/TrianglesInfluence.h
+@@ -11,7 +11,7 @@
+ #include "InterpolationMethods.h"
+ #include "utils/Timer.h"
+ #include "utils/GJK.h"
+-#include <InteractiveComputerGraphics/TriangleMeshDistance.h>
++#include <tmd/TriangleMeshDistance.h>
+ 
+ #include <vector>
+ #include <array>
+diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt
+index 79f70c1..e2a4f10 100644
+--- a/libs/CMakeLists.txt
++++ b/libs/CMakeLists.txt
+@@ -137,9 +137,10 @@ if(SDFLIB_BUILD_APPS OR SDFLIB_BUILD_DEBUG_APPS)
+ 	target_include_directories(stb_image INTERFACE stb)
+  endif()
+ 
+-# icg
+-add_library(icg INTERFACE)
+-target_include_directories(icg INTERFACE InteractiveComputerGraphics)
++if (NOT SDFLIB_USE_SYSTEM_TRIANGLEMESHDISTANCE)
++	add_library(TriangleMeshDistance INTERFACE)
++	target_include_directories(TriangleMeshDistance INTERFACE InteractiveComputerGraphics)
++endif()
+ 
+ if(SDFLIB_BUILD_APPS OR SDFLIB_BUILD_DEBUG_APPS)
+ 	# glfw
+diff --git a/libs/InteractiveComputerGraphics/InteractiveComputerGraphics/TriangleMeshDistance.h b/libs/InteractiveComputerGraphics/tmd/TriangleMeshDistance.h
+similarity index 100%
+rename from libs/InteractiveComputerGraphics/InteractiveComputerGraphics/TriangleMeshDistance.h
+rename to libs/InteractiveComputerGraphics/tmd/TriangleMeshDistance.h
+diff --git a/src/tools/ImageQueryTime/main.cpp b/src/tools/ImageQueryTime/main.cpp
+index 357a78b..f4fd9e7 100644
+--- a/src/tools/ImageQueryTime/main.cpp
++++ b/src/tools/ImageQueryTime/main.cpp
+@@ -17,7 +17,7 @@
+ 
+ #define TEST_METHODS 
+ #ifdef TEST_METHODS
+-#include <InteractiveComputerGraphics/TriangleMeshDistance.h>
++#include <tmd/TriangleMeshDistance.h>
+ // #include <CGAL/Simple_cartesian.h>
+ // #include <CGAL/AABB_tree.h>
+ // #include <CGAL/AABB_traits.h>
+diff --git a/src/tools/SdfErrorCompare/main.cpp b/src/tools/SdfErrorCompare/main.cpp
+index deef25f..9e402c4 100644
+--- a/src/tools/SdfErrorCompare/main.cpp
++++ b/src/tools/SdfErrorCompare/main.cpp
+@@ -23,7 +23,7 @@ using namespace sdflib;
+ // #define TEST_OPENVDB
+ 
+ #ifdef TEST_ICG
+-#include <InteractiveComputerGraphics/TriangleMeshDistance.h>
++#include <tmd/TriangleMeshDistance.h>
+ #endif
+ #ifdef TEST_CGAL
+ #include <CGAL/Simple_cartesian.h>
+diff --git a/src/tools/SdfLibUnity/SdfExportFunc.cpp b/src/tools/SdfLibUnity/SdfExportFunc.cpp
+index ff4e017..7e06ada 100644
+--- a/src/tools/SdfLibUnity/SdfExportFunc.cpp
++++ b/src/tools/SdfLibUnity/SdfExportFunc.cpp
+@@ -1,7 +1,7 @@
+ #include "SdfExportFunc.h"
+ #include "spdlog/sinks/rotating_file_sink.h"
+ 
+-#include <InteractiveComputerGraphics/TriangleMeshDistance.h>
++#include <tmd/TriangleMeshDistance.h>
+ 
+ using namespace sdflib;
+ 
+diff --git a/src/tools/SdfOffsets/main.cpp b/src/tools/SdfOffsets/main.cpp
+index b6769d7..07f137b 100644
+--- a/src/tools/SdfOffsets/main.cpp
++++ b/src/tools/SdfOffsets/main.cpp
+@@ -9,7 +9,7 @@
+ #include <glm/gtc/type_ptr.hpp>
+ #include <glm/gtc/matrix_transform.hpp>
+ 
+-#include <InteractiveComputerGraphics/TriangleMeshDistance.h>
++#include <tmd/TriangleMeshDistance.h>
+ #include <CGAL/Surface_mesh_default_triangulation_3.h>
+ #include <CGAL/Complex_2_in_triangulation_3.h>
+ #include <CGAL/make_surface_mesh.h>
diff --git a/nixpkgs/pkgs/applications/science/robotics/qgroundcontrol/default.nix b/nixpkgs/pkgs/applications/science/robotics/qgroundcontrol/default.nix
new file mode 100644
index 000000000000..25b1f4e5d5ce
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/robotics/qgroundcontrol/default.nix
@@ -0,0 +1,82 @@
+{ lib, stdenv, fetchFromGitHub, SDL2, qtbase, qtcharts, qtlocation, qtserialport
+, qtsvg, qtquickcontrols2, qtgraphicaleffects, qtspeech, qtx11extras, qmake
+, qttools, gst_all_1, wayland, pkg-config, wrapQtAppsHook }:
+
+stdenv.mkDerivation rec {
+  pname = "qgroundcontrol";
+  version = "4.3.0";
+
+  propagatedBuildInputs = [
+    qtbase qtcharts qtlocation qtserialport qtsvg qtquickcontrols2
+    qtgraphicaleffects qtspeech qtx11extras
+  ];
+
+  gstInputs = with gst_all_1; [
+    gstreamer
+    gst-plugins-base
+    (gst-plugins-good.override { qt5Support = true; })
+    gst-plugins-bad
+    gst-libav
+    wayland
+  ];
+
+  buildInputs = [ SDL2 ] ++ gstInputs ++ propagatedBuildInputs;
+  nativeBuildInputs = [ pkg-config qmake qttools wrapQtAppsHook ];
+
+  preConfigure = ''
+    mkdir build
+    cd build
+  '';
+
+  qmakeFlags = [
+    "CONFIG+=StableBuild"
+    # Default install tries to copy Qt files into package
+    "CONFIG+=QGC_DISABLE_BUILD_SETUP"
+    # Tries to download x86_64-only prebuilt binaries
+    "DEFINES+=DISABLE_AIRMAP"
+    "../qgroundcontrol.pro"
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    cd ..
+
+    mkdir -p $out/share/applications
+    sed 's/Exec=.*$/Exec=QGroundControl/g' --in-place deploy/qgroundcontrol.desktop
+    cp -v deploy/qgroundcontrol.desktop $out/share/applications
+
+    mkdir -p $out/bin
+    cp -v build/staging/QGroundControl "$out/bin/"
+
+    mkdir -p $out/share/qgroundcontrol
+    cp -rv resources/ $out/share/qgroundcontrol
+
+    mkdir -p $out/share/pixmaps
+    cp -v resources/icons/qgroundcontrol.png $out/share/pixmaps
+
+    runHook postInstall
+  '';
+
+  postInstall = ''
+    qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
+  '';
+
+  # TODO: package mavlink so we can build from a normal source tarball
+  src = fetchFromGitHub {
+    owner = "mavlink";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-a0+cpT413qi88PvaWQPxKABHfK7vbPE7B42n84n/SAk=";
+    fetchSubmodules = true;
+  };
+
+  meta = with lib; {
+    description = "Provides full ground station support and configuration for the PX4 and APM Flight Stacks";
+    homepage = "http://qgroundcontrol.com/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ lopsided98 ];
+    mainProgram = "QGroundControl";
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/robotics/sumorobot-manager/default.nix b/nixpkgs/pkgs/applications/science/robotics/sumorobot-manager/default.nix
new file mode 100644
index 000000000000..eb9322f0fb22
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/robotics/sumorobot-manager/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, python3, qt5, fetchFromGitHub, wrapPython, pyqt5, pyserial, dos2unix }:
+
+stdenv.mkDerivation rec {
+  pname = "sumorobot-manager";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "robokoding";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "07snhwmqqp52vdgr66vx50zxx0nmpmns5cdjgh50hzlhji2z1fl9";
+  };
+
+  buildInputs = [ python3 ];
+  pythonPath = [
+    pyqt5.dev pyserial
+  ];
+
+  nativeBuildInputs = [ wrapPython qt5.wrapQtAppsHook dos2unix ];
+
+  buildPhase = "true";
+
+  installPhase = ''
+    mkdir -p $out/opt/sumorobot-manager
+    cp -r main.py lib res $out/opt/sumorobot-manager
+    chmod -R 644 $out/opt/sumorobot-manager/lib/*
+    mkdir $out/bin
+    dos2unix $out/opt/sumorobot-manager/main.py
+    makeQtWrapper $out/opt/sumorobot-manager/main.py $out/bin/sumorobot-manager \
+      --chdir "$out/opt/sumorobot-manager"
+  '';
+
+  preFixup = ''
+    patchShebangs $out/opt/sumorobot-manager/main.py
+    wrapPythonProgramsIn "$out/opt" "$pythonPath"
+  '';
+
+  meta = with lib; {
+    description = "Desktop App for managing SumoRobots";
+    mainProgram = "sumorobot-manager";
+    homepage = "https://www.robokoding.com/kits/sumorobot/sumomanager/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/robotics/yarp/default.nix b/nixpkgs/pkgs/applications/science/robotics/yarp/default.nix
new file mode 100644
index 000000000000..3b33096dc683
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/robotics/yarp/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, cmake, ace
+}:
+
+stdenv.mkDerivation rec {
+  pname = "yarp";
+  version = "2.3.70.2";
+  src = fetchFromGitHub {
+    owner = "robotology";
+    repo = "yarp";
+    rev = "v${version}";
+    sha256 = "0mphh899niy30xbjjwi9xpsliq8mladfldbbbjfngdrqfhiray1a";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ ace ];
+
+  cmakeFlags = [
+    "-DYARP_COMPILE_UNMAINTAINED:BOOL=ON"
+    "-DCREATE_YARPC:BOOL=ON"
+    "-DCREATE_YARPCXX:BOOL=ON"
+  ];
+
+  # since we cant expand $out in cmakeFlags
+  preConfigure = ''cmakeFlags="$cmakeFlags -DCMAKE_INSTALL_LIBDIR=$out/lib"'';
+
+  postInstall = "mv ./$out/lib/*.so $out/lib/";
+
+  meta = {
+    description = "Yet Another Robot Platform";
+    homepage = "http://yarp.it";
+    license = lib.licenses.lgpl21;
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.nico202 ];
+  };
+}
+