diff options
-rw-r--r-- | flake.nix | 2 | ||||
-rw-r--r-- | racket-env.nix | 419 | ||||
-rwxr-xr-x | vendor/gen-vendor.py | 68 |
3 files changed, 488 insertions, 1 deletions
@@ -28,7 +28,7 @@ tex # latex environment pkgs.biber # bibliography backend - pkgs.racket-minimal + (pkgs.callPackage ./racket-env.nix {}) pkgs.z3 ]; }; diff --git a/racket-env.nix b/racket-env.nix new file mode 100644 index 0000000..57c94a6 --- /dev/null +++ b/racket-env.nix @@ -0,0 +1,419 @@ +{pkgs ? import <nixpkgs> {}, ...}: let + inherit (pkgs) fetchurl fetchgit; + collection = pkgs.stdenv.mkDerivation { + name = "raco-collection"; + buildInputs = [pkgs.racket-minimal]; + phases = ["buildPhase"]; + dontUnpack = true; + + buildPhase = '' + mkdir -p $out + export PLTADDONDIR=$out + raco pkg install --batch --fail-fast -j 4 --deps force --copy ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/2d-lib.zip"; + hash = "sha256-ww55SdKLMzRGAqZ/oD16kqI5CKV2ZngF2HF6ZWFjJuc="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/at-exp-lib.zip"; + hash = "sha256-sXQclvE04pAZQ/4+cCHdvleyY4vtsqTf6FiiELHRMWc="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/cext-lib.zip"; + hash = "sha256-VfTX7zrI5v+5CLvsOoRKsluEZmWFcohgHAkIe8gmSaQ="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/class-iop-lib.zip"; + hash = "sha256-fK0IYDNzavtTgQL6Md4fQ3RciVSIs8y3JZ4croHjmt4="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/compatibility-doc.zip"; + hash = "sha256-M6+d9lEDTz8g4FDDZVc3IwAJocmfsrRkyWOpDt83vx4="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/compatibility-lib.zip"; + hash = "sha256-/PKFC2Y241HQ3xEwwmFtraq/2H8nnAg6Fb+qq7ISD6E="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/compiler-lib.zip"; + hash = "sha256-4LoHG01k0uXk8Vwnk5vT28fzMLpy2xU1s5GBISA4WkE="; + }} \ + ${fetchgit { + url = "https://github.com/rmculpepper/custom-load.git"; + rev = "4e70205c29ab0672663fcae78ded32563f01414b"; + hash = "sha256-7+bNCqE2CXVCujQQ7zSRwmLfzisugKZju3cxHFLW1FY="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/data-doc.zip"; + hash = "sha256-gZ7katgLH0QVy/HIU59J0PQ6fdPc3wNGxB/qJcZ4KEM="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/data-enumerate-lib.zip"; + hash = "sha256-FGkam9SrD4Kbtp5xSrkUpGHETdEPhjbA0oIo+/v81Ao="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/data-lib.zip"; + hash = "sha256-aV6MUFMX+52VTfXLVHcTE4pDfpBNa/YtiFfOxtDIExQ="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/db-doc.zip"; + hash = "sha256-VQ8BikIWxt2F03Ezgj7b+jN/9GgHm1Gsk/BOn7jNxbw="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/db-lib.zip"; + hash = "sha256-dHrEGLC1lTtY5LxzctJLidc2Ui5WYyvzPxAWUB0dXMU="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/distributed-places-doc.zip"; + hash = "sha256-GOmVZ3epPYyYiGiixET4Dy+Mkj9dqHyLLmhUkHsRsuE="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/distributed-places-lib.zip"; + hash = "sha256-J5l5xXl5RWE+897HZ6pL7qDGvA/GIwetKbnIy7C9KBE="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/draw-doc.zip"; + hash = "sha256-N7UlNM4UL6bz2euaF+BudiDsmodtSi8JsJmHFFnkqaw="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/draw-lib.zip"; + hash = "sha256-0VDXpqq9OHi84f0xeM4kimTKhWTtC8BNKssngMHTI58="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/dynext-lib.zip"; + hash = "sha256-MM2wV5NF6g+++zznGFq+KY/adBmvlro9kde6zgYsJxU="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/errortrace-doc.zip"; + hash = "sha256-ryeOgts9TrbPHHAG3phb+y3dfXb8QyXMYEDmmqkpU8E="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/errortrace-lib.zip"; + hash = "sha256-7z8tK5dUMy0/70+2xp2ZaBkg5AZ0LyXZoa3+CedZ/q0="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/future-visualizer.zip"; + hash = "sha256-EKjwHb5N37oLVx6FhfwEbCGe0xGTx9SjE/NS+u670DE="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/future-visualizer-pict.zip"; + hash = "sha256-Ce/POR3foY65N5l/WYX4kZnqFHNDKhRRrQ8bGUo0dhM="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/gui-doc.zip"; + hash = "sha256-HfqLlJHAcGaAc/NYRlYO/RrSeBXjXxFWGevSNR+PEdU="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/gui-lib.zip"; + hash = "sha256-Bhdx/XIxeIzpd4FeIkKYVItyXRvFydF7z1Xl5UQcNMs="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/icons.zip"; + hash = "sha256-NOAONfoZdGXgC0svTfbhGdCh05SYXQvDL2oC3VKNe50="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/images-gui-lib.zip"; + hash = "sha256-CHMq7wMkB1lgU8u1JD/3gfAqwJ5dC6uqSqjcyA1EqO0="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/images-lib.zip"; + hash = "sha256-baRiP4lGcTlRfzBuxJqxLv0SN3KrXBXI6/RYbSrpKHY="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/macro-debugger.zip"; + hash = "sha256-fBAaN80NnPMo+CMsEOIGk4N8k0ugmWMY0xvDzZpXIS8="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/macro-debugger-text-lib.zip"; + hash = "sha256-Y8BAyT/tDnXucDS/1rtkdXaPuQ+RMUJBgF2pOLqlL7s="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/math-doc.zip"; + hash = "sha256-YsqL67+SNUnF01dRqXn34C1olA0dCp/c5+DNBMFk1Y4="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/math-lib.zip"; + hash = "sha256-Wn37KoXNhpGT6yV6d8akpaTLwCNl9x9fD0lv3jNaTgM="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/mzscheme-doc.zip"; + hash = "sha256-24LBl1+ugwvbCQsnO5/RqZZSC0KGA8b+VwbhfC6rBxw="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/net-cookies-doc.zip"; + hash = "sha256-AcKQErgA2B7QEpQR9iQDgE36/gyd36xF+tYvuIvhETo="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/net-cookies-lib.zip"; + hash = "sha256-l+RmHYXN4M2uc2m6ounl855vOUzmFZeAfIPFhc528IE="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/net-doc.zip"; + hash = "sha256-RaoCsuY7o7Fd5FAH8ZMXfVcq7XdwPxuNZRtD0k+Flpw="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/net-lib.zip"; + hash = "sha256-HzgU1D/EpQGbbYectRnpA4uh+pv61re4GPLzen68Nmk="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/option-contract-lib.zip"; + hash = "sha256-mLRp1leG6sourAxeMqMcPxytXGEL1h3Etvr3+uPA8QA="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/parser-tools-lib.zip"; + hash = "sha256-Xw3auBvOtukFx8neSIY0c04/9I2i1a70HuEa3WM7620="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/pconvert-lib.zip"; + hash = "sha256-Y4a+e/BYbF0SkEXJRIEABSZdJpHEFi0N01tB6DAS7kE="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/pict-doc.zip"; + hash = "sha256-9bnIk3dyOf7DiACiVymJCTPK4Q5jFNV0TZFU12monf4="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/pict-lib.zip"; + hash = "sha256-l1ZdFXhNOWwjeCfb9W11nYzofZ2jyIIkiovKqwfnnGg="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/planet-doc.zip"; + hash = "sha256-WO6d1Iz4QlSKKb1z8DzVeOPNeJejgETYaNVlExF6w5s="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/planet-lib.zip"; + hash = "sha256-RKUGOMNrzAQa4oZbTD7Ypek1/D0WMN1UBBgP5BAnV5U="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/plot-compat.zip"; + hash = "sha256-vW8NQqAAPCACLKW/k/jpOdwigQDPyI0UeqoOZZPGq2U="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/plot-doc.zip"; + hash = "sha256-pyQa+X2ACiCziiA0gdI4UZnq7YEbJWf3l8+vpw3xsfg="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/plot-gui-lib.zip"; + hash = "sha256-6KS5OlkQTuh/fsFROSSrtk1qoe5wUQTHkQeUu7mnE5E="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/plot-lib.zip"; + hash = "sha256-0wWpbgVyhvxlGobWQABSN3sfraJ/8zRyGCyMjFxOEPw="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/profile-doc.zip"; + hash = "sha256-prXhRSUdgmZPHiedccOMXoxSW3nNOw8439ulXflL+HA="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/profile-lib.zip"; + hash = "sha256-NazU186ZxVSFMLzQPTSGp2/YcA+jL46tkP8fBSOV0t8="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/r5rs-doc.zip"; + hash = "sha256-PvE0j6Vm7eY7mQhKzytOX3/NvdVC5hLZoTvqPsWZ0lM="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/r5rs-lib.zip"; + hash = "sha256-UGm52qxWjR3IAv27ZW8dzE2Z/bRBVcvSg9lqhFZzFGA="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/r6rs-doc.zip"; + hash = "sha256-ERtV9FUVC8wyXxKpcMxwX4XfnkSU/arD9KpTgdWHzrY="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/r6rs-lib.zip"; + hash = "sha256-c7sWPK1XxLpY3CyTYd7Nb1FQmEFQYMGx9yU7jPYvaH4="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/racket-doc.zip"; + hash = "sha256-jIHyZRa1UuEWjkz3ux63S65xefaVjJd/KarROUOij7g="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/racket-index.zip"; + hash = "sha256-tdXy9YsiK9VvyuX9m00motCLPkLg07qTg1JcJnBeDKI="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/rackunit-doc.zip"; + hash = "sha256-ayszYi2sbmmqiC3PluWS/HgTxEuZ0GsON4Fsy+d3jm0="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/rackunit-gui.zip"; + hash = "sha256-0enxbqsPzvd5NAiwolMLO3KV2w1GQ0mhsfrRHfjwfIk="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/rackunit-lib.zip"; + hash = "sha256-AGSHt83RU2mMEAqo4qAOC/Wsi47kOQfwRaQi0Bfhimc="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/rackunit-typed.zip"; + hash = "sha256-BRATj2ezo3/wsWu/1iSo29J1ek+6IJ7c1tsk8IxeXVE="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/readline-doc.zip"; + hash = "sha256-xEOzL6ZKOs2oBHzMCMEiuVFGam8ZP5InH39Qj+cvioI="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/readline-lib.zip"; + hash = "sha256-5vUA6uDepmr5bsSOZT12iYnWI515mYyoPIo3vu5H98M="; + }} \ + ${fetchgit { + url = "https://github.com/tonyg/racket-rfc6455.git"; + rev = "e3a87e914e25841a6e1bb996aa001aeb178284bf"; + hash = "sha256-KZjnYFj8PWZ02EbDh11Hkdz/tlCcqEceLiIU5j/xAVU="; + }} \ + ${fetchgit { + url = "https://github.com/emina/rosette.git"; + rev = "edf682df5e70420fcb31f71a5791c17875655bd2"; + hash = "sha256-hEJbuDWUKsbrUI5+eW4Xz74fdQiMhBzlCYs8eN4gP0o="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/sandbox-lib.zip"; + hash = "sha256-kUGSy9t71MdF4Ughmf/Z8wiSKjBQm8kj+jvKg9pCeSI="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/sasl-lib.zip"; + hash = "sha256-IGkeiVyF42SFxl5CRF8gl+VfnqIwZLYehb26APUcvic="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/scheme-doc.zip"; + hash = "sha256-YXpWhsVEs/8PXMeKdX2V/l8IjoXXKFQWudE26hviIfk="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/scheme-lib.zip"; + hash = "sha256-6EIiaWhwQrjUdsVtHX4fecUc1nSY+6tQmhUX2sG7vTw="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/scribble-doc.zip"; + hash = "sha256-wBIv2Vb2SnkqapPfD+rSTOngdOz0CdgH6vHx1I7vFk0="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/scribble-html-lib.zip"; + hash = "sha256-jRVoenXpTaOx4HV0T3Ed94ms+Nvx7lzgjQWOCBS0YXA="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/scribble-lib.zip"; + hash = "sha256-IWlHbsTmBqg/czmqDE7I0s+yKDFrYirdhypecBXs0jo="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/scribble-text-lib.zip"; + hash = "sha256-F96Q25Gwt5b+CwNNwITUHaMH1+lYdh14FxZnJoATYLQ="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/serialize-cstruct-lib.zip"; + hash = "sha256-o86NGWX4BTVCRKMbkfo3J0MoRKUNrXQhUnxVr5AZ+WI="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/simple-tree-text-markup-doc.zip"; + hash = "sha256-sZjbpsL/rgLRenTs5xUrqg3zPSni68OjHPf6CBcLfGE="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/simple-tree-text-markup-lib.zip"; + hash = "sha256-+cPUUINFks+6nHHkaHRz2Dm97sppgHYoz43l/3GktU8="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/slideshow-doc.zip"; + hash = "sha256-p15SKa2PaPIAFmJJcW5y+1exrhJLkAgLtiZlx/rGCOo="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/slideshow-lib.zip"; + hash = "sha256-NkhTy7JnD9+ybh+87ddHYmGS2KLIAaL2DJRYObGzV/s="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/snip-lib.zip"; + hash = "sha256-3byeewxPngrObo3+SwaAcd0/gdOfQooxrfsUr0PPUgs="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/source-syntax.zip"; + hash = "sha256-/Xt31tfLM0dn7c8OD5iE3b60paCJI1h2pvXEeUe8kSk="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/srfi-doc.zip"; + hash = "sha256-ZCE13bgDoeHsbWGpby/VVStOclAQa2dEtiFXw7OzEkQ="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/srfi-lib.zip"; + hash = "sha256-GKo2FjerLUVW0BJs9ZtVWbwsmR6wBdXP3H1Ej0b07xM="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/srfi-lite-lib.zip"; + hash = "sha256-jUjLINuySBeb4MGyq6yyHB+QmzoKYirN0TG4VPMkN70="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/string-constants-doc.zip"; + hash = "sha256-a3dxgMSgZvJ8xErLi9XfkDFWrSFOy7psorE+zOJdcVQ="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/string-constants-lib.zip"; + hash = "sha256-rxi7Eb5yWwg+xscUB5Fe73pIiEhupXE2bRz0wrOr2j0="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/syntax-color-doc.zip"; + hash = "sha256-toCEB7KBtgVmPVDE+oMn/58xXVFB7eev1ohgmp2OowM="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/syntax-color-lib.zip"; + hash = "sha256-zTdYzld5VBr3BQfUj14Yiplfa9UbKs9QFaPa/nAcliQ="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/testing-util-lib.zip"; + hash = "sha256-5we7jpxxrCkVmvJOVyZtNCQa1xwzlIcLdpvKAhp33Vw="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/tex-table.zip"; + hash = "sha256-fgclqu77DWMTa8cc/yuWr7sxjBgRxbhioGzbCn3sC/Y="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/typed-racket-compatibility.zip"; + hash = "sha256-qcvfVCTL+LNQoZFYcPY0AY224KPs9JRKYyZSCf86vrk="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/typed-racket-doc.zip"; + hash = "sha256-bAEHGIqPi2cwZMMMo+eeEuLaPxOJFgGhSTYK9Bh9TLY="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/typed-racket-lib.zip"; + hash = "sha256-vOdXNBs1VctqLl8veA43GAFbcvd+EPgk+fiKp/ZvUhM="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/typed-racket-more.zip"; + hash = "sha256-eeFmPWJsgl6aMWVKiikiFTO2bq0Zn9a/H7uX+BKe+AY="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/unix-socket-lib.zip"; + hash = "sha256-axVk7fvaysSndW2XtblYjcixkDVd8DwtsTWudSEpjEk="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/web-server-doc.zip"; + hash = "sha256-uUdsJGm5QgGAlaLQgUcMLqpgDmnCS6C+tHjfDi2aoyI="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/web-server-lib.zip"; + hash = "sha256-Ih5qlcFz67dHinuIK78S5JPIjeGD9iAZJ0VCAfF5V8M="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/wxme-lib.zip"; + hash = "sha256-4rDg2RlR0Cbag93JlGfZr5aRpwNWO6upvL/Qc7tvSzI="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/xrepl-doc.zip"; + hash = "sha256-2oD6aLYsIKYFt9Cuxoe4jorcCa7hotl71O6gsuM+qEk="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/xrepl-lib.zip"; + hash = "sha256-cMP5p7ykNtCUVXNVEWCfUGld83TrBd4+u9Cg+Bfqdjg="; + }} \ + ${fetchurl { + url = "https://download.racket-lang.org/releases/8.10/pkgs/zo-lib.zip"; + hash = "sha256-q+cspYfV9f9zgldCQIr1vFjFDJuX3wj4MNwHb7cpB4Y="; + }} \ + ''; + }; +in + pkgs.stdenv.mkDerivation { + name = "racket-wrapped"; + buildInputs = [pkgs.makeWrapper]; + phases = ["installPhase"]; + installPhase = '' + mkdir -p $out/bin + makeWrapper ${pkgs.racket-minimal}/bin/racket $out/bin/racket \ + --set PLTADDONDIR ${collection}; + ''; + } diff --git a/vendor/gen-vendor.py b/vendor/gen-vendor.py new file mode 100755 index 0000000..a38da61 --- /dev/null +++ b/vendor/gen-vendor.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python +import subprocess +from os.path import exists +import re + +# tee the output of the given command +def run(cmd): + proc = subprocess.Popen(cmd, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE, encoding='utf-8') + + outp = "" + while proc.poll() is None: + line = proc.stdout.readline() + if line: + print(line.strip()) + outp += line + return outp + +pkgs = run(["raco", "pkg", "show", "-a", "--scope" ,"user"]).split("\n") +catalog_pkg_names = [l.split(" ")[0].replace("*", "") for l in pkgs if "catalog" in l] + +print("Found %d packages" % len(catalog_pkg_names)) + +infos = [] +for pkg in catalog_pkg_names: + info = run(["raco", "pkg", "catalog-show", pkg]) + m = re.search(r'Source: (.*)', info) + url = m.group(1) + fname = url.split("/")[-1] + if not exists(fname): + run(["curl", "-OL", url]) + infos.append((pkg, url, run(["nix", "hash", "file", fname]).strip())) + +# fetch files and install packages +configurePhase = "mkdir -p $out\n" + "\n".join([ + "raco pkg install --scope-dir $out -t dir -n %s --no-setup --deps force ${fetchurl { url = \"%s\"; hash = \"%s\"; }}" % (name, url, hash) + for (name, url, hash) in infos +]) + +# do building +buildPhase = "raco pkg install --scope-dir $out --skip-installed " + " ".join(catalog_pkg_names) + +with open("./default.nix", "w") as f: + f.write(""" +{pkgs ? import <nixpkgs> {}, ...}: let + inherit (pkgs) fetchurl; + collection = pkgs.stdenv.mkDerivation { + name = "raco-catalog"; + buildInputs = [pkgs.racket-minimal]; + dontUnpack = true; + + configurePhase = '' + %s + ''; + buildPhase = "%s"; + }; in + pkgs.stdenv.mkDerivation { + name = "racket-wrapped"; + installPhase = '' + mkdir -p $out/bin + ln -s $out/pkgs ${collection}; + mkWrapper ${pkgs.racket-minimal}/bin/racket \ + $out/bin/racket \ + --set PLTADDONDIR $out/pkgs; + ''; + } + """ % (configurePhase, buildPhase)) |