2024-05-03 02:31:36 -06:00
|
|
|
{
|
2024-10-29 05:15:53 -06:00
|
|
|
lib,
|
|
|
|
stdenv,
|
2024-05-03 02:31:36 -06:00
|
|
|
fetchFromGitLab,
|
|
|
|
fetchYarnDeps,
|
2024-10-29 05:15:53 -06:00
|
|
|
|
|
|
|
yarnConfigHook,
|
|
|
|
yarnBuildHook,
|
|
|
|
yarnInstallHook,
|
|
|
|
nodejs,
|
2024-05-03 02:31:36 -06:00
|
|
|
pkg-config,
|
2024-10-29 05:15:53 -06:00
|
|
|
|
2024-05-03 02:31:36 -06:00
|
|
|
vips,
|
2024-10-29 05:15:53 -06:00
|
|
|
sqlite,
|
|
|
|
|
2024-05-03 02:31:36 -06:00
|
|
|
nixosTests,
|
|
|
|
}:
|
2024-10-29 05:15:53 -06:00
|
|
|
|
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
|
|
|
pname = "gancio";
|
2024-09-30 01:33:41 -06:00
|
|
|
version = "1.19.4";
|
2024-05-03 02:31:36 -06:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "framagit.org";
|
|
|
|
owner = "les";
|
|
|
|
repo = "gancio";
|
2024-10-29 05:15:53 -06:00
|
|
|
rev = "v${finalAttrs.version}";
|
2024-09-30 01:33:41 -06:00
|
|
|
hash = "sha256-x8s7eBVmHCY3kAjHjACotCncvZq6OBiLPJGF6hvfawE=";
|
2024-05-03 02:31:36 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
offlineCache = fetchYarnDeps {
|
2024-10-29 05:15:53 -06:00
|
|
|
yarnLock = finalAttrs.src + "/yarn.lock";
|
2024-09-30 01:33:41 -06:00
|
|
|
hash = "sha256-LXeAyxZSZOm6GxRuJb5rlHTlQpYa1fdKSENVjwLY4tU=";
|
2024-05-03 02:31:36 -06:00
|
|
|
};
|
|
|
|
|
2024-10-29 05:15:53 -06:00
|
|
|
nativeBuildInputs = [
|
|
|
|
yarnConfigHook
|
|
|
|
yarnBuildHook
|
|
|
|
yarnInstallHook
|
|
|
|
nodejs
|
|
|
|
(nodejs.python.withPackages (ps: [ ps.setuptools ]))
|
|
|
|
pkg-config
|
|
|
|
];
|
2024-05-03 02:31:36 -06:00
|
|
|
|
2024-10-29 05:15:53 -06:00
|
|
|
buildInputs = [
|
|
|
|
vips
|
|
|
|
sqlite
|
|
|
|
];
|
2024-05-03 02:31:36 -06:00
|
|
|
|
2024-10-29 05:15:53 -06:00
|
|
|
# generate .node binaries
|
|
|
|
preBuild = ''
|
|
|
|
npm rebuild --verbose --nodedir=${nodejs} --sqlite=${lib.getDev sqlite}
|
2024-05-03 02:31:36 -06:00
|
|
|
'';
|
|
|
|
|
2024-10-29 05:15:53 -06:00
|
|
|
# the node_modules directory will be regenerated by yarnInstallHook, so we save our .node binaries
|
|
|
|
preInstall = ''
|
|
|
|
cp node_modules/sharp/build/Release/sharp.node .
|
|
|
|
cp node_modules/sqlite3/build/Release/node_sqlite3.node .
|
|
|
|
'';
|
2024-05-03 02:31:36 -06:00
|
|
|
|
2024-10-29 05:15:53 -06:00
|
|
|
# and then place them where they belong
|
|
|
|
postInstall = ''
|
|
|
|
install -Dm755 sharp.node -t $out/lib/node_modules/gancio/node_modules/sharp/build/Release
|
|
|
|
install -Dm755 node_sqlite3.node -t $out/lib/node_modules/gancio/node_modules/sqlite3/build/Release
|
2024-05-03 02:31:36 -06:00
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
2024-10-29 05:15:53 -06:00
|
|
|
inherit nodejs;
|
2024-05-03 02:31:36 -06:00
|
|
|
tests = {
|
|
|
|
inherit (nixosTests) gancio;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Shared agenda for local communities, running on nodejs";
|
|
|
|
homepage = "https://gancio.org/";
|
|
|
|
changelog = "https://framagit.org/les/gancio/-/raw/master/CHANGELOG.md";
|
|
|
|
license = lib.licenses.agpl3Plus;
|
|
|
|
platforms = lib.platforms.linux;
|
|
|
|
mainProgram = "gancio";
|
|
|
|
maintainers = with lib.maintainers; [ jbgi ];
|
|
|
|
};
|
2024-10-29 05:15:53 -06:00
|
|
|
})
|