omnom: fix & refactor (#421398)
This commit is contained in:
@@ -34,55 +34,54 @@ buildGoModule (finalAttrs: {
|
||||
"-w"
|
||||
];
|
||||
|
||||
postBuild =
|
||||
let
|
||||
omnom-addons = buildNpmPackage {
|
||||
pname = "omnom-addons";
|
||||
inherit (finalAttrs) version src;
|
||||
|
||||
npmDepsHash = "sha256-sUn5IvcHWJ/yaqeGz9SGvGx9HHAlrcnS0lJxIxUVS6M=";
|
||||
sourceRoot = "${finalAttrs.src.name}/ext";
|
||||
npmPackFlags = [ "--ignore-scripts" ];
|
||||
|
||||
nativeBuildInputs = [ zip ];
|
||||
|
||||
# Fix path for the `static` directory
|
||||
postConfigure = ''
|
||||
substituteInPlace webpack.config.js \
|
||||
--replace-fail '"..", ".."' '".."'
|
||||
'';
|
||||
|
||||
postBuild = ''
|
||||
mkdir -p $out
|
||||
|
||||
zip -r "$out/omnom_ext_src.zip" README.md src utils package* webpack.config.js
|
||||
|
||||
pushd build
|
||||
zip "$out/omnom_ext_chrome.zip" ./* icons/* -x manifest_ff.json
|
||||
zip "$out/omnom_ext_firefox.zip" ./* icons/* -x manifest_ff.json
|
||||
popd
|
||||
'';
|
||||
|
||||
postCheck = ''
|
||||
npm run build-test
|
||||
'';
|
||||
};
|
||||
in
|
||||
''
|
||||
mkdir -p $out/share/addons
|
||||
|
||||
# Copy Firefox and Chrome addons
|
||||
cp -r ${omnom-addons}/*.zip $out/share/addons
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p $out/share/addons
|
||||
|
||||
# Copy Firefox and Chrome addons
|
||||
cp -r ${finalAttrs.passthru.omnom-addons}/*.zip $out/share/addons
|
||||
|
||||
mkdir -p $out/share/examples
|
||||
|
||||
cp -r static templates $out/share
|
||||
cp config.yml_sample $out/share/examples/config.yml
|
||||
'';
|
||||
|
||||
passthru.tests = nixosTests.omnom;
|
||||
passthru = {
|
||||
omnom-addons = buildNpmPackage (finalAttrs': {
|
||||
pname = "omnom-addons";
|
||||
inherit (finalAttrs) version src;
|
||||
|
||||
npmDepsHash = "sha256-sUn5IvcHWJ/yaqeGz9SGvGx9HHAlrcnS0lJxIxUVS6M=";
|
||||
sourceRoot = "${finalAttrs'.src.name}/ext";
|
||||
npmPackFlags = [ "--ignore-scripts" ];
|
||||
|
||||
nativeBuildInputs = [ zip ];
|
||||
|
||||
# Fix path for the `static` directory
|
||||
postConfigure = ''
|
||||
substituteInPlace webpack.config.js \
|
||||
--replace-fail '"..", ".."' '".."'
|
||||
'';
|
||||
|
||||
postBuild = ''
|
||||
mkdir -p $out
|
||||
|
||||
zip -r "$out/omnom_ext_src.zip" README.md src utils package* webpack.config.js
|
||||
|
||||
pushd build
|
||||
zip "$out/omnom_ext_chrome.zip" ./* icons/* -x manifest_ff.json
|
||||
cp manifest_ff.json manifest.json
|
||||
zip "$out/omnom_ext_firefox.zip" ./* icons/* -x manifest_ff.json
|
||||
popd
|
||||
'';
|
||||
|
||||
postCheck = ''
|
||||
npm run build-test
|
||||
'';
|
||||
});
|
||||
|
||||
tests = nixosTests.omnom;
|
||||
};
|
||||
|
||||
meta = {
|
||||
description = "Webpage bookmarking and snapshotting service";
|
||||
|
||||
Reference in New Issue
Block a user