nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

package.nix (1566B)


      1 {
      2   lib,
      3   fetchFromGitHub,
      4   fetchYarnDeps,
      5   python3Packages,
      6   nodejs,
      7   yarnConfigHook,
      8 }:
      9 
     10 python3Packages.buildPythonPackage (finalAttrs: {
     11   pname = "ipytree";
     12   version = "0.2.2-unstable-2022-11-23";
     13   pyproject = true;
     14 
     15   __structuredAttrs = true;
     16 
     17   src = fetchFromGitHub {
     18     owner = "martinRenou";
     19     repo = "ipytree";
     20     rev = "9bcd5090b8d8a3fd168562d941b107679d78e0f3";
     21     hash = "sha256-FxPbXPt1h5Q+YDQKa9ckAjG6EqK+DY4d2Ub8DHzLMQw=";
     22   };
     23 
     24   yarnOfflineCache = fetchYarnDeps {
     25     yarnLock = "${finalAttrs.src}/js/yarn.lock";
     26     hash = "sha256-Ffn+uhbXwHmPZ+VkCUACDNtulB4GRJvGrt6DdvW60cc=";
     27   };
     28 
     29   build-system = with python3Packages; [
     30     setuptools
     31     jupyter-packaging
     32     jupyterlab
     33   ];
     34 
     35   postPatch = ''
     36     substituteInPlace pyproject.toml \
     37       --replace-fail '"jupyter_packaging~=0.7.0"' '"jupyter_packaging"' \
     38       --replace-fail '"jupyterlab==3.*"' '"jupyterlab"'
     39   '';
     40 
     41   nativeBuildInputs = [
     42     nodejs
     43     yarnConfigHook
     44   ];
     45 
     46   # yarn.lock lives in js/, run the hook there manually
     47   dontYarnInstallDeps = true;
     48 
     49   # Build JS assets ourselves; jupyter-packaging skips its online build when targets exist
     50   preBuild = ''
     51     pushd js
     52     yarnConfigHook
     53     yarn --offline run build
     54     popd
     55   '';
     56 
     57   dependencies = with python3Packages; [ ipywidgets ];
     58 
     59   pythonImportsCheck = [ "ipytree" ];
     60 
     61   meta = {
     62     description = "A Tree Widget using Jupyter-widgets protocol and jsTree";
     63     homepage = "https://github.com/martinRenou/ipytree";
     64     license = lib.licenses.mit;
     65     maintainers = [ lib.maintainers.sikmir ];
     66   };
     67 })