part-db: init at 1.14.5

Co-authored-by: Sandro <7258858+supersandro2000@users.noreply.github.com>
Co-authored-by: Tert0 <62036464+tert0@users.noreply.github.com>
This commit is contained in:
Nico Felbinger 2024-12-14 22:24:02 +01:00
parent b689696c3c
commit 10e92c1832
No known key found for this signature in database
GPG key ID: 6E4C8C7087EFEEAE
2 changed files with 114 additions and 0 deletions

View file

@ -0,0 +1,24 @@
diff --git a/composer.json b/composer.json
index 0659f2ee..5a2dee70 100644
--- a/composer.json
+++ b/composer.json
@@ -1,4 +1,6 @@
{
+ "name": "part-db/part-db-server",
+ "description": "Part-DB is an Open source inventory management system for your electronic components",
"type": "project",
"license": "AGPL-3.0-or-later",
"require": {
diff --git a/composer.lock b/composer.lock
index 614a35f7..e0c949eb 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "465fa2ab7f9f8dad2b8cfbeaa640c136",
+ "content-hash": "cec123f8cbf51820ba08c5c69ec2ded4",
"packages": [
{
"name": "amphp/amp",

View file

@ -0,0 +1,90 @@
{
stdenv,
php,
lib,
fetchFromGitHub,
fetchYarnDeps,
nodejs,
yarnConfigHook,
yarnBuildHook,
yarnInstallHook,
envLocalPath ? "/var/lib/part-db/env.local",
cachePath ? "/var/cache/part-db/",
logPath ? "/var/log/part-db/",
}:
let
pname = "part-db";
version = "1.14.5";
srcWithVendor = php.buildComposerProject ({
inherit pname version;
src = fetchFromGitHub {
owner = "Part-DB";
repo = "Part-DB-server";
tag = "v${version}";
hash = "sha256-KtNWog4aSnmgJsFckDuBrlnd9cj1f8kmSFi+nv2cZOg=";
};
patches = [
./fix-composer-validate.diff
];
php = php.buildEnv {
extensions = (
{ enabled, all }:
enabled
++ (with all; [
xsl
])
);
};
vendorHash = "sha256-PJtm/3Vdm2zomUklVMKlDAe/vziJN4e+JNNf/u8N3B4=";
composerNoPlugins = false;
postInstall = ''
mv "$out"/share/php/part-db/* $out/
mv "$out"/share/php/part-db/.* $out/
cd $out/
php -d memory_limit=256M bin/console cache:warmup
'';
});
in
stdenv.mkDerivation (finalAttrs: {
inherit pname version;
src = srcWithVendor;
yarnOfflineCache = fetchYarnDeps {
yarnLock = finalAttrs.src + "/yarn.lock";
hash = "sha256-Mjss2UUHVUdJ4UAI3GkG6HB6g7LbJTqvgrIXFhZmw1Q=";
};
nativeBuildInputs = [
yarnConfigHook
yarnBuildHook
nodejs
];
installPhase = ''
rm -r node_modules
mkdir $out
mv * .* $out/
rm -rf $out/var/{cache,log}
ln -s ${envLocalPath} $out/.env.local
ln -s ${logPath} $out/var/log
ln -s ${cachePath} $out/var/cache
'';
meta = {
description = "Open source inventory management system for your electronic components";
homepage = "https://docs.part-db.de/";
changelog = "https://github.com/Part-DB/Part-DB-server/releases/tag/v${version}";
license = lib.licenses.agpl3Plus;
maintainers = with lib.maintainers; [ felbinger ];
platforms = lib.platforms.linux;
};
})