mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 14:26:33 +01:00
0e639f2cc0
Gancio is a shared agenda for local communities: https://gancio.org/
101 lines
2.1 KiB
Nix
101 lines
2.1 KiB
Nix
{
|
|
mkYarnPackage,
|
|
fetchFromGitLab,
|
|
fetchYarnDeps,
|
|
python3,
|
|
pkg-config,
|
|
nodePackages,
|
|
node-gyp,
|
|
vips,
|
|
lib,
|
|
nixosTests,
|
|
}:
|
|
mkYarnPackage rec {
|
|
inherit (nodePackages) nodejs;
|
|
version = "1.19.0";
|
|
|
|
src = fetchFromGitLab {
|
|
domain = "framagit.org";
|
|
owner = "les";
|
|
repo = "gancio";
|
|
rev = "v${version}";
|
|
hash = "sha256-cMUM7jqLsrw57gySiIK7DBZA7lPiXL2HAadMk+7wkzs=";
|
|
};
|
|
|
|
offlineCache = fetchYarnDeps {
|
|
yarnLock = src + "/yarn.lock";
|
|
hash = "sha256-ONPvBvT3zf8IVkIEOmiQgcjI7zPCFwDuQfo+fOvDGzM=";
|
|
};
|
|
|
|
packageJSON = ./package.json;
|
|
|
|
# for pkg-config dependencies:
|
|
yarnPreBuild = ''
|
|
export npm_config_nodedir=${nodePackages.nodejs}
|
|
'';
|
|
# So that sqlite can be found:
|
|
pkgConfig.sqlite3 = {
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
nodePackages.prebuild-install
|
|
node-gyp
|
|
python3
|
|
];
|
|
postInstall = ''
|
|
yarn --offline run install
|
|
'';
|
|
};
|
|
# Sharp need to find a vips library
|
|
pkgConfig.sharp = {
|
|
nativeBuildInputs = [
|
|
pkg-config
|
|
python3
|
|
node-gyp
|
|
nodePackages.semver
|
|
];
|
|
buildInputs = [ vips ];
|
|
postInstall = ''
|
|
yarn --offline run install
|
|
'';
|
|
};
|
|
|
|
# build need a writeable node_modules
|
|
configurePhase = ''
|
|
runHook preConfigure
|
|
|
|
cp -r $node_modules node_modules
|
|
chmod -R +w node_modules
|
|
|
|
runHook postConfigure
|
|
'';
|
|
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
|
|
export HOME=$(mktemp -d)
|
|
yarn --offline build
|
|
yarn --offline pack --filename gancio.tgz
|
|
mkdir -p deps/gancio
|
|
tar -C deps/gancio/ --strip-components=1 -xf gancio.tgz
|
|
rm gancio.tgz
|
|
|
|
runHook postBuild
|
|
'';
|
|
|
|
passthru = {
|
|
updateScript = ./update.sh;
|
|
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 ];
|
|
};
|
|
}
|