pkgs: add ocis

This commit is contained in:
xinyangli 2024-09-18 11:04:02 +08:00
parent 6b375fea91
commit 74fe93e5d8
Signed by: xin
SSH key fingerprint: SHA256:UU5pRTl7NiLFJbWJZa+snLylZSXIz5rgHmwjzv8v4oE
3 changed files with 129 additions and 1 deletions

View file

@ -1 +1,4 @@
(final: prev: { oidc-agent = prev.callPackage ./pkgs/oidc-agent { }; }) (final: prev: {
oidc-agent = prev.callPackage ./pkgs/oidc-agent { };
ocis = prev.callPackage ./pkgs/ocis { };
})

View file

@ -0,0 +1,85 @@
{
lib,
stdenvNoCC,
callPackage,
fetchFromGitHub,
buildGoModule,
gnumake,
pnpm,
nodejs,
}:
let
web = callPackage ./web.nix { };
idp-assets = stdenvNoCC.mkDerivation {
pname = "idp-assets";
version = "0-unstable-2020-10-14";
src = fetchFromGitHub {
owner = "owncloud";
repo = "assets";
rev = "e8b6aeadbcee1865b9df682e9bd78083842d2b5c";
hash = "sha256-PzGff2Zx8xmvPYQa4lS4yz2h+y/lerKvUZkYI7XvAUw=";
};
installPhase = ''
mkdir -p $out/share
cp logo.svg favicon.ico $out/share/
'';
dontConfigure = true;
dontBuild = true;
dontFixup = true;
};
in
buildGoModule rec {
pname = "ocis";
version = "v5.0.7";
vendorHash = null;
src = fetchFromGitHub {
owner = "owncloud";
repo = "ocis";
rev = version;
hash = "sha256-vCEr7UCGEPm0x04U8DpsUNz9c64ZSEIK4SDcitCIDCw=";
};
nativeBuildInputs = [
gnumake
nodejs
pnpm.configHook
];
pnpmDeps = pnpm.fetchDeps {
inherit pname version src;
sourceRoot = "${src.name}/services/idp";
hash = "sha256-ojrgoyl+xBsgEsx3d3gv5Wf6ziabHoFkEpAoDZcYavo=";
};
pnpmRoot = "services/idp";
buildPhase = ''
runHook preBuild
cp -r ${web}/share/* services/web/assets/
pnpm -C services/idp build
mkdir -p services/idp/assets/identifier/static
cp -r ${idp-assets}/share/* services/idp/assets/identifier/static/
make -C ocis VERSION=${version} DATE=${version} build
runHook postBuild
'';
installPhase = ''
mkdir -p $out/bin/
cp ocis/bin/ocis $out/bin/
'';
passthru = {
inherit web;
};
meta = with lib; {
homepage = "https://github.com/owncloud/ocis";
description = "ownCloud Infinite Scale Stack";
mainProgram = "ocis";
license = licenses.asl20;
maintainers = with maintainers; [ xinyangli ];
};
}

View file

@ -0,0 +1,40 @@
{
lib,
stdenvNoCC,
nodejs,
pnpm,
fetchFromGitHub,
}:
stdenvNoCC.mkDerivation rec {
pname = "ocis-web";
version = "v8.0.5";
src = fetchFromGitHub {
owner = "owncloud";
repo = "web";
rev = version;
hash = "sha256-hupdtK/V74+X7/eXoDmUjFvSKuhnoOtNQz7o6TLJXG4=";
};
nativeBuildInputs = [ pnpm.configHook ];
buildInputs = [ nodejs ];
buildPhase = ''
pnpm build
'';
installPhase = ''
mkdir -p $out/share
cp -r dist/* $out/share/
'';
pnpmDeps = pnpm.fetchDeps {
inherit pname version src;
hash = "sha256-m6yGqUmDor5273JsAlKs52Ug+bc3uhpI8F+MUhULAh4=";
};
meta = with lib; {
license = [ licenses.agpl3Only ];
};
}