python312Packages.types-aiobotocore: 2.15.2 -> 2.15.2.post3 (#361801)
[NixPkgs.git] / pkgs / by-name / om / omnom / package.nix
blob0b651a6451cf92d32b623f1c30b65aad77aecb74
2   lib,
3   buildGoModule,
4   fetchFromGitHub,
5   makeWrapper,
7   # for addons
8   buildNpmPackage,
9   zip,
12 buildGoModule rec {
13   pname = "omnom";
14   version = "0-unstable-2024-11-20";
16   src = fetchFromGitHub {
17     owner = "asciimoo";
18     repo = "omnom";
19     rev = "dbf40c9c50b74335286faea7c5070bba11dced83";
20     hash = "sha256-dl0jfFwn+Fd8/aQNhXFNEoDIMgMia2MHZntp0EKhimg=";
21     fetchSubmodules = true;
22   };
24   vendorHash = "sha256-dsS5w8JXIwkneWScOFzLSDiXq+clgK+RdYiMw0+FnvY=";
26   patches = [ ./0001-fix-minimal-go-version.patch ];
28   nativeBuildInputs = [ makeWrapper ];
30   ldflags = [
31     "-s"
32     "-w"
33   ];
35   postBuild =
36     let
37       omnom-addons = buildNpmPackage {
38         pname = "omnom-addons";
39         inherit version src;
41         npmDepsHash = "sha256-sUn5IvcHWJ/yaqeGz9SGvGx9HHAlrcnS0lJxIxUVS6M=";
42         sourceRoot = "${src.name}/ext";
43         npmPackFlags = [ "--ignore-scripts" ];
45         nativeBuildInputs = [ zip ];
47         postBuild = ''
48           mkdir -p $out
50           zip -r "$out/omnom_ext_src.zip" README.md src utils package* webpack.config.js
52           pushd build
53             zip "$out/omnom_ext_chrome.zip" ./* icons/* -x manifest_ff.json
54             zip "$out/omnom_ext_firefox.zip" ./* icons/* -x manifest_ff.json
55           popd
56         '';
58         postCheck = ''
59           npm run build-test
60         '';
61       };
62     in
63     ''
64       mkdir -p $out/share/addons
66       # Copy Firefox and Chrome addons
67       cp -r ${omnom-addons}/*.zip $out/share/addons
68     '';
70   postInstall = ''
71     mkdir -p $out/share/examples
73     cp -r static templates $out/share
74     cp config.yml_sample $out/share/examples/config.yml
75   '';
77   meta = {
78     description = "A webpage bookmarking and snapshotting service";
79     homepage = "https://github.com/asciimoo/omnom";
80     license = lib.licenses.agpl3Only;
81     maintainers = lib.teams.ngi.members;
82     mainProgram = "omnom";
83   };