nextcloud31Packages.apps.memories: package by hand to remove pre-compiled binaries; nextcloud31Packages.apps.recognize: more cleanup (#388067)

authored by Sandro and committed by GitHub e1bb5891 2dcc4b15

+131 -33
-10
pkgs/servers/nextcloud/packages/30.json
··· 219 219 "agpl" 220 220 ] 221 221 }, 222 - "memories": { 223 - "hash": "sha256-BfxJDCGsiRJrZWkNJSQF3rSFm/G3zzQn7C6DCETSzw4=", 224 - "url": "https://github.com/pulsejet/memories/releases/download/v7.5.2/memories.tar.gz", 225 - "version": "7.5.2", 226 - "description": "# Memories: Photo Management for Nextcloud\n\nMemories is a *batteries-included* photo management solution for Nextcloud with advanced features including:\n\n- **πŸ“Έ Timeline**: Sort photos and videos by date taken, parsed from Exif data.\n- **βͺ Rewind**: Jump to any time in the past instantly and relive your memories.\n- **πŸ€– AI Tagging**: Group photos by people and objects, powered by [recognize](https://github.com/nextcloud/recognize) and [facerecognition](https://github.com/matiasdelellis/facerecognition).\n- **πŸ–ΌοΈ Albums**: Create albums to group photos and videos together. Then share these albums with others.\n- **πŸ«±πŸ»β€πŸ«²πŸ» External Sharing**: Share photos and videos with people outside of your Nextcloud instance.\n- **πŸ“± Mobile Support**: Work from any device, of any shape and size through the web app.\n- **✏️ Edit Metadata**: Edit dates and other metadata on photos quickly and in bulk.\n- **πŸ“¦ Archive**: Store photos you don't want to see in your timeline in a separate folder.\n- **πŸ“Ή Video Transcoding**: Transcode videos and use HLS for maximal performance.\n- **πŸ—ΊοΈ Map**: View your photos on a map, tagged with accurate reverse geocoding.\n- **πŸ“¦ Migration**: Migrate easily from Nextcloud Photos and Google Takeout.\n- **⚑️ Performance**: Do all this very fast.\n\n## πŸš€ Installation\n\n1. Install the app from the Nextcloud app store (try a demo [here](https://demo.memories.gallery/apps/memories/)).\n1. Perform the recommended [configuration steps](https://memories.gallery/config/).\n1. Run `php occ memories:index` to generate metadata indices for existing photos.\n1. Open the πŸ“· Memories app in Nextcloud and set the directory containing your photos.", 227 - "homepage": "https://memories.gallery", 228 - "licenses": [ 229 - "agpl" 230 - ] 231 - }, 232 222 "music": { 233 223 "hash": "sha256-h83Xc292/NQPWOTRIbUSgqHUH/Sp4fYJ8GAHSiJWHP0=", 234 224 "url": "https://github.com/owncloud/music/releases/download/v2.1.4/music_2.1.4_for_nextcloud.tar.gz",
-10
pkgs/servers/nextcloud/packages/31.json
··· 219 219 "agpl" 220 220 ] 221 221 }, 222 - "memories": { 223 - "hash": "sha256-BfxJDCGsiRJrZWkNJSQF3rSFm/G3zzQn7C6DCETSzw4=", 224 - "url": "https://github.com/pulsejet/memories/releases/download/v7.5.2/memories.tar.gz", 225 - "version": "7.5.2", 226 - "description": "# Memories: Photo Management for Nextcloud\n\nMemories is a *batteries-included* photo management solution for Nextcloud with advanced features including:\n\n- **πŸ“Έ Timeline**: Sort photos and videos by date taken, parsed from Exif data.\n- **βͺ Rewind**: Jump to any time in the past instantly and relive your memories.\n- **πŸ€– AI Tagging**: Group photos by people and objects, powered by [recognize](https://github.com/nextcloud/recognize) and [facerecognition](https://github.com/matiasdelellis/facerecognition).\n- **πŸ–ΌοΈ Albums**: Create albums to group photos and videos together. Then share these albums with others.\n- **πŸ«±πŸ»β€πŸ«²πŸ» External Sharing**: Share photos and videos with people outside of your Nextcloud instance.\n- **πŸ“± Mobile Support**: Work from any device, of any shape and size through the web app.\n- **✏️ Edit Metadata**: Edit dates and other metadata on photos quickly and in bulk.\n- **πŸ“¦ Archive**: Store photos you don't want to see in your timeline in a separate folder.\n- **πŸ“Ή Video Transcoding**: Transcode videos and use HLS for maximal performance.\n- **πŸ—ΊοΈ Map**: View your photos on a map, tagged with accurate reverse geocoding.\n- **πŸ“¦ Migration**: Migrate easily from Nextcloud Photos and Google Takeout.\n- **⚑️ Performance**: Do all this very fast.\n\n## πŸš€ Installation\n\n1. Install the app from the Nextcloud app store (try a demo [here](https://demo.memories.gallery/apps/memories/)).\n1. Perform the recommended [configuration steps](https://memories.gallery/config/).\n1. Run `php occ memories:index` to generate metadata indices for existing photos.\n1. Open the πŸ“· Memories app in Nextcloud and set the directory containing your photos.", 227 - "homepage": "https://memories.gallery", 228 - "licenses": [ 229 - "agpl" 230 - ] 231 - }, 232 222 "music": { 233 223 "hash": "sha256-h83Xc292/NQPWOTRIbUSgqHUH/Sp4fYJ8GAHSiJWHP0=", 234 224 "url": "https://github.com/owncloud/music/releases/download/v2.1.4/music_2.1.4_for_nextcloud.tar.gz",
+32
pkgs/servers/nextcloud/packages/apps/memories-paths.diff
··· 1 + diff --git a/lib/Settings/SystemConfig.php b/lib/Settings/SystemConfig.php 2 + index 7814f071..bb1309fa 100644 3 + --- a/lib/Settings/SystemConfig.php 4 + +++ b/lib/Settings/SystemConfig.php 5 + @@ -124,6 +125,14 @@ class SystemConfig 6 + */ 7 + public static function get(string $key, mixed $default = null): mixed 8 + { 9 + + switch ($key) { 10 + + case "memories.exiftool": return "@exiftool@"; 11 + + case "memories.exiftool_no_local": return false; 12 + + case "memories.vod.ffmpeg": return "@ffmpeg@"; 13 + + case "memories.vod.ffprobe": return "@ffprobe@"; 14 + + case "memories.vod.path": return "@go-vod@"; 15 + + } 16 + + 17 + if (!\array_key_exists($key, self::DEFAULTS)) { 18 + throw new \InvalidArgumentException("Invalid system config key: {$key}"); 19 + } 20 + @@ -154,6 +161,12 @@ public static function get(string $key, mixed $default = null): mixed 21 + */ 22 + public static function set(string $key, mixed $value): void 23 + { 24 + + // Ignore those paths and always use the nix paths. 25 + + // We cannot return a proper error message except a 500 here without changing the code to much. 26 + + if (in_array($key, array("memories.exiftool", "memories.exiftool_no_local", "memories.vod.ffmpeg", "memories.vod.ffprobe", "memories.vod.path"))) { 27 + + throw new \InvalidArgumentException("Cannot set nix-managed key: {$key}"); 28 + + } 29 + + 30 + // Check if the key is valid 31 + if (!\array_key_exists($key, self::DEFAULTS)) { 32 + throw new \InvalidArgumentException("Invalid system config key: {$key}");
+91
pkgs/servers/nextcloud/packages/apps/memories.nix
··· 1 + { 2 + stdenv, 3 + buildGoModule, 4 + exiftool, 5 + fetchurl, 6 + ffmpeg-headless, 7 + fetchFromGitHub, 8 + lib, 9 + replaceVars, 10 + 11 + ncVersion, 12 + }: 13 + let 14 + latestVersionForNc = { 15 + "31" = latestVersionForNc."30"; 16 + "30" = { 17 + version = "7.5.2"; 18 + appHash = "sha256-BfxJDCGsiRJrZWkNJSQF3rSFm/G3zzQn7C6DCETSzw4="; 19 + srcHash = "sha256-imBO/64NW5MiozpufbMRcTI9WCaN8grnHlVo+fsUNlU="; 20 + }; 21 + }; 22 + currentVersionInfo = 23 + latestVersionForNc.${ncVersion} 24 + or (throw "memories currently does not support nextcloud version ${ncVersion}"); 25 + 26 + commonMeta = with lib; { 27 + homepage = "https://apps.nextcloud.com/apps/memories"; 28 + changelog = "https://github.com/pulsejet/memories/blob/v${currentVersionInfo.version}/CHANGELOG.md"; 29 + license = licenses.agpl3Only; 30 + maintainers = with maintainers; [ SuperSandro2000 ]; 31 + }; 32 + 33 + go-vod = buildGoModule rec { 34 + pname = "go-vod"; 35 + inherit (currentVersionInfo) version; 36 + 37 + src = fetchFromGitHub { 38 + owner = "pulsejet"; 39 + repo = "memories"; 40 + tag = "v${version}"; 41 + hash = currentVersionInfo.srcHash; 42 + }; 43 + 44 + sourceRoot = "${src.name}/go-vod"; 45 + 46 + vendorHash = null; 47 + 48 + meta = commonMeta // { 49 + description = "Extremely minimal on-demand video transcoding server in go"; 50 + mainProgram = "go-vod"; 51 + }; 52 + }; 53 + in 54 + stdenv.mkDerivation rec { 55 + pname = "nextcloud-app-memories"; 56 + inherit (currentVersionInfo) version; 57 + 58 + src = fetchurl { 59 + url = "https://github.com/pulsejet/memories/releases/download/v${version}/memories.tar.gz"; 60 + hash = currentVersionInfo.appHash; 61 + }; 62 + 63 + patches = [ 64 + (replaceVars ./memories-paths.diff { 65 + exiftool = lib.getExe exiftool; 66 + ffmpeg = lib.getExe ffmpeg-headless; 67 + ffprobe = lib.getExe' ffmpeg-headless "ffprobe"; 68 + go-vod = lib.getExe go-vod; 69 + }) 70 + ]; 71 + 72 + postPatch = '' 73 + rm appinfo/signature.json 74 + rm -rf bin-ext/ 75 + 76 + substituteInPlace lib/Service/BinExt.php \ 77 + --replace-fail "EXIFTOOL_VER = '12.70'" "EXIFTOOL_VER = '${exiftool.version}'" 78 + ''; 79 + 80 + installPhase = '' 81 + mkdir -p $out 82 + cp -r ./* $out/ 83 + ''; 84 + 85 + meta = commonMeta // { 86 + description = "Fast, modern and advanced photo management suite"; 87 + longDescription = '' 88 + All settings related to required packages and installed programs are hardcoded in program code and cannot be changed. 89 + ''; 90 + }; 91 + }
+5 -10
pkgs/servers/nextcloud/packages/apps/recognize.nix
··· 38 38 srcs = 39 39 [ 40 40 (fetchurl { 41 - inherit version; 42 41 url = "https://github.com/nextcloud/recognize/releases/download/v${version}/recognize-${version}.tar.gz"; 43 42 hash = currentVersionInfo.appHash; 44 43 }) 45 44 46 45 (fetchurl { 47 - inherit version; 48 46 url = "https://github.com/nextcloud/recognize/archive/refs/tags/v${version}.tar.gz"; 49 47 hash = currentVersionInfo.modelHash; 50 48 }) 51 49 ] 52 50 ++ lib.optionals useLibTensorflow [ 53 - (fetchurl rec { 51 + (fetchurl { 54 52 # For version see LIBTENSORFLOW_VERSION in https://github.com/tensorflow/tfjs/blob/master/tfjs-node/scripts/deps-constants.js 55 - version = "2.9.1"; 56 - url = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-${version}.tar.gz"; 53 + url = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.9.1.tar.gz"; 57 54 hash = "sha256-f1ENJUbj214QsdEZRjaJAD1YeEKJKtPJW8pRz4KCAXM="; 58 55 }) 59 56 ]; ··· 61 58 unpackPhase = 62 59 '' 63 60 # Merge the app and the models from github 64 - tar -xzpf "${builtins.elemAt srcs 0}" recognize; 61 + tar -xzpf "${builtins.elemAt srcs 0}" recognize 65 62 tar -xzpf "${builtins.elemAt srcs 1}" -C recognize --strip-components=1 recognize-${version}/models 66 63 '' 67 64 + lib.optionalString useLibTensorflow '' ··· 80 77 --replace-quiet "\$this->config->getAppValueString('node_binary', '""')" "'${lib.getExe nodejs}'" \ 81 78 --replace-quiet "\$this->config->getAppValueString('node_binary')" "'${lib.getExe nodejs}'" 82 79 test "$(grep "get[a-zA-Z]*('node_binary'" recognize/lib/**/*.php | wc -l)" -eq 0 83 - 84 - 85 80 86 81 # Skip trying to install it... (less warnings in the log) 87 82 sed -i '/public function run/areturn ; //skip' recognize/lib/Migration/InstallDeps.php ··· 110 105 node src/test_libtensorflow.js 111 106 cd .. 112 107 ''; 108 + 113 109 installPhase = '' 114 110 approot="$(dirname $(dirname $(find -path '*/appinfo/info.xml' | head -n 1)))" 115 - if [ -d "$approot" ]; 116 - then 111 + if [ -d "$approot" ]; then 117 112 mv "$approot/" $out 118 113 chmod -R a-w $out 119 114 fi
-1
pkgs/servers/nextcloud/packages/nextcloud-apps.json
··· 23 23 , "integration_paperless": "agpl3Plus" 24 24 , "mail": "agpl3Plus" 25 25 , "maps": "agpl3Plus" 26 - , "memories": "agpl3Plus" 27 26 , "music": "agpl3Plus" 28 27 , "news": "agpl3Plus" 29 28 , "nextpod": "agpl3Only"
+3 -2
pkgs/servers/nextcloud/packages/thirdparty.nix
··· 5 5 6 6 apps = apps.extend ( 7 7 self: super: { 8 + hmr_enabler = callPackage ./apps/hmr_enabler.nix { }; 9 + 10 + memories = callPackage ./apps/memories.nix { inherit ncVersion; }; 8 11 9 - hmr_enabler = callPackage ./apps/hmr_enabler.nix { }; 10 12 recognize = callPackage ./apps/recognize.nix { inherit ncVersion; }; 11 - 12 13 } 13 14 ); 14 15 }