Initial Packages
This commit was merged in pull request #1.
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
{
|
||||
fetchPypi,
|
||||
python3Packages,
|
||||
}:
|
||||
python3Packages.buildPythonPackage rec {
|
||||
pname = "arcosparse";
|
||||
version = "0.4.2";
|
||||
format = "pyproject";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit version;
|
||||
pname = "arcosparse";
|
||||
sha256 = "sha256-Z8NW+dsC3uXk101kr8tzsgjAoFb4KNdGkxyFkJ5UhFA=";
|
||||
};
|
||||
|
||||
pythonRelaxDeps = true;
|
||||
|
||||
nativeBuildInputs = [ python3Packages.poetry-core ];
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
pyarrow
|
||||
pandas
|
||||
pystac
|
||||
tqdm
|
||||
requests
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
{
|
||||
fetchPypi,
|
||||
python3Packages,
|
||||
arcosparse,
|
||||
}:
|
||||
python3Packages.buildPythonPackage rec {
|
||||
pname = "copernicusmarine";
|
||||
version = "2.2.2";
|
||||
format = "pyproject";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit version;
|
||||
pname = "copernicusmarine";
|
||||
sha256 = "sha256-5T3iH4Hh08wIao2MMveb/bVnVz0pK0PoN4CRk811P0g=";
|
||||
};
|
||||
|
||||
pythonRelaxDeps = true;
|
||||
|
||||
nativeBuildInputs = [ python3Packages.poetry-core ];
|
||||
propagatedBuildInputs = with python3Packages; [
|
||||
boto3
|
||||
click
|
||||
dask
|
||||
h5netcdf
|
||||
arcosparse
|
||||
lxml
|
||||
numpy
|
||||
pydantic
|
||||
pystac
|
||||
requests
|
||||
semver
|
||||
setuptools
|
||||
tqdm
|
||||
xarray
|
||||
zarr
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,102 @@
|
||||
{
|
||||
autoPatchelfHook,
|
||||
pkg-config,
|
||||
cmake,
|
||||
fetchFromGitHub,
|
||||
patchelf,
|
||||
python3,
|
||||
stdenv,
|
||||
xgboost,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "openzl";
|
||||
version = "0.2.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "facebook";
|
||||
repo = "openzl";
|
||||
rev = "46e4826715ed31c9fe13922951f088f0af5b6a91";
|
||||
sha256 = "sha256-ZMFoEjgKQPVF+u3gNtKpNwuql1X3wemg4ug/Qy+Js1o=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
autoPatchelfHook
|
||||
cmake
|
||||
patchelf
|
||||
pkg-config
|
||||
python3
|
||||
];
|
||||
|
||||
buildInputs = [ xgboost ];
|
||||
|
||||
# Replace the ExternalProject_Add(xgboost_external ...) block in ml_selector
|
||||
# with find_package calls and a stub INTERFACE target, so the nixpkgs xgboost
|
||||
# is used instead of downloading from github (which is not allowed in the sandbox).
|
||||
preConfigure = ''
|
||||
python3 - <<'PYEOF'
|
||||
import re, pathlib
|
||||
|
||||
p = pathlib.Path("tools/ml_selector/CMakeLists.txt")
|
||||
src = p.read_text()
|
||||
|
||||
replacement = """\
|
||||
find_package(xgboost REQUIRED)
|
||||
# Stub target: downstream CMakeLists add_dependencies on xgboost_external
|
||||
add_library(xgboost_external INTERFACE)
|
||||
target_link_libraries(xgboost_external INTERFACE xgboost::xgboost)
|
||||
|
||||
add_library(xgboost ALIAS xgboost::xgboost)
|
||||
"""
|
||||
|
||||
# Replace everything from include(ExternalProject) up to (and including)
|
||||
# add_dependencies(dmlc xgboost_external)
|
||||
src = re.sub(
|
||||
r'include\(ExternalProject\).*?add_dependencies\(dmlc xgboost_external\)\n',
|
||||
replacement,
|
||||
src,
|
||||
flags=re.DOTALL,
|
||||
)
|
||||
|
||||
# Fix ml_selector include path: remove reference to XGBOOST_INSTALL_DIR
|
||||
src = src.replace(
|
||||
" ''${XGBOOST_INSTALL_DIR}/include\n",
|
||||
"",
|
||||
)
|
||||
|
||||
# Replace xgboost/dmlc link targets with xgboost::xgboost (dmlc is bundled in xgboost)
|
||||
src = src.replace(
|
||||
" openzl\n openzl_cpp\n xgboost\n dmlc\n",
|
||||
" openzl\n openzl_cpp\n xgboost::xgboost\n",
|
||||
)
|
||||
|
||||
p.write_text(src)
|
||||
PYEOF
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
# Install the zli CLI and all its internal shared libraries that CMake
|
||||
# does not install by default (libcommands.so, libargs.so, etc.).
|
||||
install -Dm755 cli/zli $out/bin/zli
|
||||
find "$NIX_BUILD_TOP" \( -name '*.so' -o -name '*.so.*' \) \
|
||||
-not -path "$out/*" \
|
||||
-exec install -Dm755 {} -t $out/lib \;
|
||||
|
||||
# Fix rpaths: replace build-dir references with $out/lib
|
||||
for f in $out/bin/* $out/lib/*.so $out/lib/*.so.*; do
|
||||
[ -f "$f" ] || continue
|
||||
patchelf --set-rpath "$out/lib" "$f" || true
|
||||
done
|
||||
'';
|
||||
|
||||
cmakeFlags = [
|
||||
"-DBUILD_SHARED_LIBS=ON"
|
||||
"-DOPENZL_BUILD_TESTS=OFF"
|
||||
"-DOPENZL_BUILD_BENCHMARKS=OFF"
|
||||
"-DOPENZL_BUILD_PYTHON_EXT=OFF"
|
||||
"-DOPENZL_BUILD_EXAMPLES=OFF"
|
||||
"-DOPENZL_ALLOW_INTROSPECTION=ON"
|
||||
];
|
||||
|
||||
meta.mainProgram = "zli";
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
python3Packages,
|
||||
fetchPypi,
|
||||
}:
|
||||
python3Packages.buildPythonPackage rec {
|
||||
pname = "pygments-styles";
|
||||
version = "0.3.0";
|
||||
|
||||
format = "wheel";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit version;
|
||||
format = "wheel";
|
||||
dist = "py3";
|
||||
python = "py3";
|
||||
pname = "pygments_styles";
|
||||
hash = "sha256-xsRemTnrdZA0W8kIQRO6xGxF8SsAnRNCK+AugOhKA0w=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
python3Packages.pygments
|
||||
];
|
||||
|
||||
pythonImportsCheck = [ "pygments_styles" ];
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
{
|
||||
gitMinimal,
|
||||
python3Packages,
|
||||
fetchFromGitHub,
|
||||
lib,
|
||||
}:
|
||||
python3Packages.buildPythonPackage {
|
||||
pname = "sphinx-last-updated-by-git";
|
||||
version = "0.3.8-unstable-2025-08-26";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "mgeier";
|
||||
repo = "sphinx-last-updated-by-git";
|
||||
rev = "07ac1a98af2a927e773a65c6524ce83067c977b8";
|
||||
hash = "sha256-2TGFR11Ejh/9zpVC/TEdmMNaBt38wE5yeJeYixZSVUE=";
|
||||
fetchSubmodules = true;
|
||||
leaveDotGit = true;
|
||||
};
|
||||
|
||||
build-system = [ python3Packages.setuptools ];
|
||||
|
||||
dependencies = with python3Packages; [
|
||||
sphinx
|
||||
gitpython
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
# we cant just substitute by matching `'git'` due to collisons
|
||||
substituteInPlace src/sphinx_last_updated_by_git.py \
|
||||
--replace-fail "'git', 'ls-tree'" " '${lib.getExe gitMinimal}', 'ls-tree'" \
|
||||
--replace-fail "'git', 'log'" "'${lib.getExe gitMinimal}', 'log'" \
|
||||
--replace-fail "'git', 'rev-parse'" "'${lib.getExe gitMinimal}', 'rev-parse'" \
|
||||
'';
|
||||
|
||||
propagatedBuildInputs = [ gitMinimal ];
|
||||
|
||||
nativeCheckInputs = with python3Packages; [
|
||||
pytestCheckHook
|
||||
sphinx-pytest
|
||||
pytest-cov-stub
|
||||
];
|
||||
|
||||
disabledTests = [
|
||||
"test_no_git" # we hardcoded the git path
|
||||
|
||||
"test_repo_shallow"
|
||||
"test_repo_shallow_without_warning"
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
python3Packages,
|
||||
fetchPypi,
|
||||
pygments-styles,
|
||||
}:
|
||||
python3Packages.buildPythonPackage rec {
|
||||
pname = "sphinx-shibuya-theme";
|
||||
version = "2026.1.9";
|
||||
|
||||
format = "wheel";
|
||||
|
||||
src = fetchPypi {
|
||||
inherit version;
|
||||
format = "wheel";
|
||||
dist = "py3";
|
||||
python = "py3";
|
||||
pname = "shibuya";
|
||||
hash = "sha256-tYo8xuVhnHHQD88L5KMGDIcEDCpiobPxqTpqQcqOr0U=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [
|
||||
python3Packages.sphinx
|
||||
pygments-styles
|
||||
];
|
||||
|
||||
pythonImportsCheck = [ "shibuya" ];
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
{
|
||||
python3Packages,
|
||||
fetchFromGitHub,
|
||||
sphinx-last-updated-by-git,
|
||||
}:
|
||||
python3Packages.buildPythonPackage rec {
|
||||
pname = "sphinx-sitemap";
|
||||
version = "2.9.0";
|
||||
pyproject = true;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "jdillard";
|
||||
repo = "sphinx-sitemap";
|
||||
tag = "v${version}";
|
||||
hash = "sha256-TiR6F9wMWOGYexSKDzbSPPq0oiIDrZwSiO3a9DajL+0=";
|
||||
};
|
||||
|
||||
build-system = [ python3Packages.setuptools ];
|
||||
|
||||
dependencies = [
|
||||
python3Packages.sphinx
|
||||
sphinx-last-updated-by-git
|
||||
];
|
||||
|
||||
nativeCheckInputs = with python3Packages; [
|
||||
pytestCheckHook
|
||||
sphinx-pytest
|
||||
defusedxml
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
lib,
|
||||
stdenv,
|
||||
cmake,
|
||||
pkg-config,
|
||||
fetchFromGitHub,
|
||||
zstd,
|
||||
gsl,
|
||||
llvmPackages,
|
||||
}:
|
||||
stdenv.mkDerivation {
|
||||
pname = "sz3";
|
||||
version = "3.3.x";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "szcompressor";
|
||||
repo = "SZ3";
|
||||
rev = "34b36f2af0d43aa4f5dea0e39500e91f6d35c9cf";
|
||||
sha256 = "0fckf5939m9d2w3095isnq3qfrz8fxpppn7y3c2hwzdh72vdzic7";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
cmake
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs =
|
||||
[
|
||||
zstd
|
||||
gsl
|
||||
]
|
||||
++ lib.optionals stdenv.cc.isClang [
|
||||
llvmPackages.openmp
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-DBUILD_SHARED_LIBS=ON"
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "A modular error-bounded lossy compression framework for scientific datasets";
|
||||
homepage = "https://github.com/szcompressor/SZ3";
|
||||
license = licenses.bsd3;
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user