Skip to content

Commit

Permalink
feat: add raven
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Aug 2, 2024
1 parent 90cebab commit 272f2df
Show file tree
Hide file tree
Showing 8 changed files with 146 additions and 0 deletions.
13 changes: 13 additions & 0 deletions apps/sources/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,16 @@ source = "github"
use_max_tag = true
github = "frappe/hrms"
submodules = true

[raven]
source = "github"
use_max_tag = true
github = "The-Commit-Company/Raven"

[raven.passthru]
since = "v1.0.0"
upstream = """
URL: https://github.com/The-Commit-Company/Raven
Pull: +refs/heads/develop:refs/remotes/upstream/develop
Pull: +refs/heads/main:refs/remotes/upstream/main
"""
6 changes: 6 additions & 0 deletions apps/sources/newver.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
"revision": "59302de3c0a11558823c21e26b704e0a7e16cc3b",
"url": "https://github.com/frappe/print_designer/releases/tag/v1.3.3"
},
"raven": {
"version": "v1.6.4",
"gitref": "refs/tags/v1.6.4",
"revision": "943509478306a2e3a05026cde87d4f7009fc1f10",
"url": "https://github.com/The-Commit-Company/Raven/releases/tag/v1.6.4"
},
"webshop": {
"version": "20240607.063925",
"revision": "2ba73816791724acb2e8c7cce35c28a56c537b31",
Expand Down
6 changes: 6 additions & 0 deletions apps/sources/oldver.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@
"revision": "59302de3c0a11558823c21e26b704e0a7e16cc3b",
"url": "https://github.com/frappe/print_designer/releases/tag/v1.3.3"
},
"raven": {
"version": "v1.6.4",
"gitref": "refs/tags/v1.6.4",
"revision": "943509478306a2e3a05026cde87d4f7009fc1f10",
"url": "https://github.com/The-Commit-Company/Raven/releases/tag/v1.6.4"
},
"webshop": {
"version": "20240607.063925",
"revision": "2ba73816791724acb2e8c7cce35c28a56c537b31",
Expand Down
16 changes: 16 additions & 0 deletions apps/sources/raven.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
pname = "raven";
version = "v1.6.4";
meta = {
url = "https://github.com/The-Commit-Company/Raven/releases/tag/v1.6.4";
description = "Sources for raven (v1.6.4)";
};
src = builtins.fetchTree {
type = "github";
owner = "The-Commit-Company";
repo = "Raven";
narHash = "sha256-nTSjIHT9PpGMn9jBQh3LL9ItLOLNwHo1X2dIFkGWPPQ=";
rev = "943509478306a2e3a05026cde87d4f7009fc1f10";
};
passthru = builtins.fromJSON ''{}'';
}
1 change: 1 addition & 0 deletions src/overlays/frappe/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ in {
print-designer = callPackage ./print-designer.nix {};
webshop = callPackage ./webshop.nix {};
wiki = callPackage ./wiki.nix {};
raven = callPackage ./raven {};
});
}
61 changes: 61 additions & 0 deletions src/overlays/frappe/raven/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
appSources,
lib,
buildPythonPackage,
pythonRelaxDepsHook,
flit-core,
python,
extractFrappeMeta,
mkAssets,
applyPatches,
fetchpatch,
}:
buildPythonPackage rec {
inherit
(extractFrappeMeta src)
pname
version
format
;

src = mkAssets (appSources.raven
// {
src = applyPatches {
inherit (appSources.raven) src;
name = "raven-prod";
patches = [
(fetchpatch {
url = "https://patch-diff.githubusercontent.com/raw/The-Commit-Company/Raven/pull/989.patch";
hash = "sha256-nst92Mr8wQQG4WdRPoGYLLFTJ/cRHarkGHNuYB3O8xE=";
})
(fetchpatch {
url = "https://patch-diff.githubusercontent.com/raw/The-Commit-Company/Raven/pull/990.patch";
hash = "sha256-DLambvibZQoKcuQuP3wlI0sNfrMa0zojhmiXuhBAkiE=";
})
];
};
});
inherit (appSources.raven) passthru;

nativeBuildInputs = [
pythonRelaxDepsHook
flit-core
];

propagatedBuildInputs = with python.pkgs; [
linkpreview
];

# pythonRemoveDeps = [
# "rembg" # TODO: package
# ];

# pythonImportsCheck = ["gameplan"];

meta = with lib; {
description = "Simple, open source team messaging platform";
homepage = "https://github.com/The-Commit-Company/Raven";
license = licenses.agpl3Only;
maintainers = with maintainers; [blaggacao];
};
}
3 changes: 3 additions & 0 deletions src/overlays/python/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ pyFinal: pyPrev: {
shopify-python-api = pyFinal.callPackage ./shopify-python-api.nix {};
pyactiveresource = pyFinal.callPackage ./pyactiveresource.nix {};

# raven dependencies
linkpreview = pyFinal.callPackage ./linkpreview.nix {};

# fjsd dependency
json-source-map = pyFinal.callPackage ./json-source-map.nix {};
}
40 changes: 40 additions & 0 deletions src/overlays/python/linkpreview.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
lib,
buildPythonPackage,
fetchPypi,
setuptools,
wheel,
beautifulsoup4,
requests,
}:
buildPythonPackage rec {
pname = "linkpreview";
version = "0.9.0";
pyproject = true;

src = fetchPypi {
inherit pname version;
hash = "sha256-9aHxeJU1AfF/YGAV6XkkW7qA4NY+5MqnnqYly/UkFe8=";
};

build-system = [
setuptools
wheel
];

dependencies = [
beautifulsoup4
requests
];

pythonImportsCheck = [
"linkpreview"
];

meta = with lib; {
description = "Get link (URL) preview";
homepage = "https://pypi.org/project/linkpreview/";
license = licenses.mit;
maintainers = with maintainers; [];
};
}

0 comments on commit 272f2df

Please sign in to comment.