nur-packages

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

package.nix (1983B)


      1 {
      2   lib,
      3   fetchFromGitHub,
      4   fetchYarnDeps,
      5   python3Packages,
      6   nodejs,
      7   yarnConfigHook,
      8 }:
      9 
     10 let
     11   version = "0.20.0";
     12 
     13   src = fetchFromGitHub {
     14     owner = "jupyter-widgets";
     15     repo = "ipyleaflet";
     16     tag = version;
     17     hash = "sha256-V8HWrCI4TdPHvV4kGjqK60kx1QBo+/kmhtaIe8JIkus=";
     18   };
     19 
     20   jupyter-leaflet = python3Packages.buildPythonPackage rec {
     21     pname = "jupyter-leaflet";
     22     inherit version src;
     23     pyproject = true;
     24 
     25     __structuredAttrs = true;
     26 
     27     patches = [ ./yarn.lock.patch ];
     28     sourceRoot = "${src.name}/python/jupyter_leaflet";
     29 
     30     yarnOfflineCache = fetchYarnDeps {
     31       inherit src patches sourceRoot;
     32       hash = "sha256-Y9WrJVP9Tra+5eieD5WYwUeu5JIZ1ZGd92vV/gi8aC0=";
     33     };
     34 
     35     build-system = with python3Packages; [
     36       hatchling
     37       hatch-jupyter-builder
     38       hatch-nodejs-version
     39       jupyterlab
     40     ];
     41 
     42     nativeBuildInputs = [
     43       nodejs
     44       yarnConfigHook
     45     ];
     46 
     47     # Build JS assets ourselves; hatch-jupyter-builder would run `jlpm install` online
     48     env.SKIP_JUPYTER_BUILDER = true;
     49 
     50     preBuild = ''
     51       yarn --offline run build
     52     '';
     53 
     54     meta = {
     55       description = "ipyleaflet extensions for JupyterLab and Jupyter Notebook";
     56       homepage = "https://github.com/jupyter-widgets/ipyleaflet";
     57       license = lib.licenses.bsd3;
     58       maintainers = [ lib.maintainers.sikmir ];
     59     };
     60   };
     61 in
     62 python3Packages.buildPythonPackage {
     63   pname = "ipyleaflet";
     64   inherit version src;
     65   pyproject = true;
     66 
     67   __structuredAttrs = true;
     68 
     69   sourceRoot = "${src.name}/python/ipyleaflet";
     70 
     71   build-system = with python3Packages; [
     72     hatchling
     73   ];
     74 
     75   dependencies = with python3Packages; [
     76     ipywidgets
     77     traittypes
     78     xyzservices
     79     branca
     80     jupyter-leaflet
     81   ];
     82 
     83   pythonImportsCheck = [ "ipyleaflet" ];
     84 
     85   meta = {
     86     description = "A Jupyter - Leaflet.js bridge";
     87     homepage = "https://github.com/jupyter-widgets/ipyleaflet";
     88     license = lib.licenses.bsd3;
     89     maintainers = [ lib.maintainers.sikmir ];
     90   };
     91 }