szurubooru: init at 2.5-unstable-2025-02-11

This commit is contained in:
RatCornu 2025-02-16 19:31:19 +01:00 committed by Valentin Gagarin
parent 11f0150cf6
commit 9925eb8339
4 changed files with 140 additions and 0 deletions

View File

@ -0,0 +1,36 @@
{
src,
version,
lib,
buildNpmPackage,
}:
buildNpmPackage {
pname = "szurubooru-client";
inherit version;
src = "${src}/client";
npmDepsHash = "sha256-HtcitZl2idgVleB6c0KCTSNLxh7hP8/G/RGdMaQG3iI=";
makeCacheWritable = true;
npmBuildFlags = [
"--gzip"
];
installPhase = ''
runHook preInstall
mkdir $out
mv ./public/* $out
runHook postInstall
'';
meta = with lib; {
description = "Client of szurubooru, an image board engine for small and medium communities";
homepage = "https://github.com/rr-/szurubooru";
license = licenses.gpl3;
maintainers = with maintainers; [ ratcornu ];
};
}

View File

@ -0,0 +1,20 @@
{
callPackage,
fetchFromGitHub,
recurseIntoAttrs,
}:
let
version = "2.5-unstable-2025-02-11";
src = fetchFromGitHub {
owner = "rr-";
repo = "szurubooru";
rev = "376f687c386f65522b2f65e98b998b21af26ee29";
hash = "sha256-4w1iOYp+CVg60dYxRilj08D4Hle6R9Y0v+Nd3fws1Zc=";
};
in
recurseIntoAttrs {
client = callPackage ./client.nix { inherit src version; };
server = callPackage ./server.nix { inherit src version; };
}

View File

@ -0,0 +1,82 @@
{
src,
version,
lib,
fetchPypi,
python3,
}:
let
overrides = [
(self: super: {
alembic = super.alembic.overridePythonAttrs (oldAttrs: rec {
version = "1.14.1";
src = fetchPypi {
pname = "alembic";
inherit version;
sha256 = "sha256-SW6IgkWlOt8UmPyrMXE6Rpxlg2+N524BOZqhw+kN0hM=";
};
doCheck = false;
});
pyheif = super.pyheif.overridePythonAttrs (oldAttrs: {
doCheck = false;
});
sqlalchemy = super.sqlalchemy.overridePythonAttrs (oldAttrs: rec {
version = "1.3.23";
src = fetchPypi {
pname = "SQLAlchemy";
inherit version;
sha256 = "sha256-b8ozZyV4Zm9lfBMVUsTviXnBYG5JT3jNUZl0LfsmkYs=";
};
doCheck = false;
});
})
];
python = python3.override {
self = python;
packageOverrides = lib.composeManyExtensions overrides;
};
in
python.pkgs.buildPythonApplication {
pname = "szurubooru-server";
inherit version;
pyproject = true;
src = "${src}/server";
nativeBuildInputs = with python.pkgs; [ setuptools ];
propagatedBuildInputs = with python.pkgs; [
alembic
certifi
coloredlogs
heif-image-plugin
numpy
pillow-avif-plugin
pillow
psycopg2-binary
pyheif
pynacl
pyrfc3339
pytz
pyyaml
sqlalchemy
yt-dlp
];
postInstall = ''
mkdir $out/bin
install -m0755 $src/szuru-admin $out/bin/szuru-admin
'';
meta = with lib; {
description = "Server of szurubooru, an image board engine for small and medium communities";
homepage = "https://github.com/rr-/szurubooru";
license = licenses.gpl3;
maintainers = with maintainers; [ ratcornu ];
};
}

View File

@ -9676,6 +9676,8 @@ with pkgs;
svxlink = libsForQt5.callPackage ../applications/radio/svxlink { };
szurubooru = callPackage ../servers/web-apps/szurubooru { };
tclap = tclap_1_2;
tclap_1_2 = callPackage ../development/libraries/tclap/1.2.nix { };