Skip to content

Commit 4e17c3e

Browse files
committed
ocis: init at 5.0.9
1 parent 96fd503 commit 4e17c3e

File tree

3 files changed

+158
-0
lines changed

3 files changed

+158
-0
lines changed

pkgs/by-name/oc/ocis/package.nix

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
{
2+
lib,
3+
stdenvNoCC,
4+
fetchFromGitHub,
5+
buildGoModule,
6+
callPackage,
7+
gnumake,
8+
pnpm,
9+
nodejs,
10+
ocis,
11+
}:
12+
let
13+
idp-assets = stdenvNoCC.mkDerivation {
14+
pname = "idp-assets";
15+
version = "0-unstable-2020-10-14";
16+
src = fetchFromGitHub {
17+
owner = "owncloud";
18+
repo = "assets";
19+
rev = "e8b6aeadbcee1865b9df682e9bd78083842d2b5c";
20+
hash = "sha256-PzGff2Zx8xmvPYQa4lS4yz2h+y/lerKvUZkYI7XvAUw=";
21+
};
22+
installPhase = ''
23+
mkdir -p $out/share
24+
cp logo.svg favicon.ico $out/share/
25+
'';
26+
dontConfigure = true;
27+
dontBuild = true;
28+
dontFixup = true;
29+
};
30+
in
31+
buildGoModule rec {
32+
pname = "ocis";
33+
version = "5.0.9";
34+
35+
vendorHash = null;
36+
37+
src = fetchFromGitHub {
38+
owner = "owncloud";
39+
repo = "ocis";
40+
rev = "refs/tags/v${version}";
41+
hash = "sha256-TsMrQx+P1F2t66e0tGG0VvRi4W7+pCpDHd0aNsacOsI=";
42+
};
43+
44+
nativeBuildInputs = [
45+
gnumake
46+
nodejs
47+
pnpm.configHook
48+
];
49+
50+
pnpmDeps = pnpm.fetchDeps {
51+
inherit pname version src;
52+
sourceRoot = "${src.name}/services/idp";
53+
hash = "sha256-gNlN+u/bobnTsXrsOmkDcWs67D/trH3inT5AVQs3Brs=";
54+
};
55+
pnpmRoot = "services/idp";
56+
57+
buildPhase = ''
58+
runHook preBuild
59+
cp -r ${ocis.web}/share/* services/web/assets/
60+
pnpm -C services/idp build
61+
62+
mkdir -p services/idp/assets/identifier/static
63+
cp -r ${idp-assets}/share/* services/idp/assets/identifier/static/
64+
65+
make -C ocis VERSION=${version} DATE=${version} build
66+
runHook postBuild
67+
'';
68+
69+
installPhase = ''
70+
runHook preInstall
71+
mkdir -p $out/bin/
72+
cp ocis/bin/ocis $out/bin/
73+
runHook postInstall
74+
'';
75+
76+
passthru = {
77+
web = callPackage ./web.nix { };
78+
updateScript = ./update.sh;
79+
};
80+
81+
meta = {
82+
homepage = "https://github.com/owncloud/web";
83+
description = "Next generation frontend for ownCloud Infinite Scale";
84+
license = lib.licenses.asl20;
85+
mainProgram = "ocis";
86+
maintainers = with lib.maintainers; [ xinyangli ];
87+
};
88+
}

pkgs/by-name/oc/ocis/update.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/usr/bin/env nix-shell
2+
#!nix-shell -i bash -p curl jq gnugrep nix-update coreutils
3+
set -ex
4+
5+
TAGS=$(curl -s https://api.github.com/repos/owncloud/ocis/releases | jq -r ".[].tag_name")
6+
7+
for tag in $TAGS; do
8+
main_version_old=$(echo "v$UPDATE_NIX_OLD_VERSION" | cut -d'.' -f1)
9+
main_version_new=$(echo "$tag" | cut -d'.' -f1)
10+
11+
# Compare the main versions
12+
if [[ "$main_version_old" == "$main_version_new" ]]; then
13+
UPDATE_NIX_NEW_VERSION=$tag
14+
break
15+
else
16+
continue
17+
fi
18+
done
19+
20+
OCIS_WEB_VERSION=$(curl -s https://raw.githubusercontent.com/owncloud/ocis/$UPDATE_NIX_NEW_VERSION/services/web/Makefile | grep -oP '(?<=WEB_ASSETS_VERSION = )v[0-9]+\.[0-9]+\.[0-9]+')
21+
nix-update -vr 'v(.*)' --version=$OCIS_WEB_VERSION ocis.web
22+
nix-update -vr 'v(.*)' --version=$UPDATE_NIX_NEW_VERSION ocis

pkgs/by-name/oc/ocis/web.nix

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
lib,
3+
stdenvNoCC,
4+
nodejs,
5+
pnpm,
6+
fetchFromGitHub,
7+
}:
8+
stdenvNoCC.mkDerivation rec {
9+
pname = "ocis-web";
10+
version = "8.0.5";
11+
12+
src = fetchFromGitHub {
13+
owner = "owncloud";
14+
repo = "web";
15+
rev = "refs/tags/v${version}";
16+
hash = "sha256-hupdtK/V74+X7/eXoDmUjFvSKuhnoOtNQz7o6TLJXG4=";
17+
};
18+
19+
nativeBuildInputs = [
20+
nodejs
21+
pnpm.configHook
22+
];
23+
24+
buildPhase = ''
25+
runHook preBuild
26+
pnpm build
27+
runHook postBuild
28+
'';
29+
30+
installPhase = ''
31+
runHook preInstall
32+
mkdir -p $out/share
33+
cp -r dist/* $out/share/
34+
runHook postInstall
35+
'';
36+
37+
pnpmDeps = pnpm.fetchDeps {
38+
inherit pname version src;
39+
hash = "sha256-3Erva6srdkX1YQ727trx34Ufx524nz19MUyaDQToz6M=";
40+
};
41+
42+
meta = {
43+
homepage = "https://github.com/owncloud/ocis";
44+
description = "ownCloud Infinite Scale Stack";
45+
maintainers = with lib.maintainers; [ xinyangli ];
46+
license = lib.licenses.agpl3Only;
47+
};
48+
}

0 commit comments

Comments
 (0)