bukubrow: use structuredAttrs instead of passAsFile (#498266)
This commit is contained in:
@@ -21,18 +21,14 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
src = fetchFromGitHub {
|
||||
owner = "SamHH";
|
||||
repo = "bukubrow-host";
|
||||
rev = "v${finalAttrs.version}";
|
||||
sha256 = "sha256-xz5Agsm+ATQXXgpPGN4EQ00i1t8qUlrviNHauVdCu4U=";
|
||||
tag = "v${finalAttrs.version}";
|
||||
hash = "sha256-xz5Agsm+ATQXXgpPGN4EQ00i1t8qUlrviNHauVdCu4U=";
|
||||
};
|
||||
|
||||
cargoHash = "sha256-mCPJE9WW14NtahbMnDcE+0xXl5w25dzerPy3wv78l20=";
|
||||
|
||||
buildInputs = [ sqlite ];
|
||||
|
||||
passAsFile = [
|
||||
"firefoxManifest"
|
||||
"chromeManifest"
|
||||
];
|
||||
firefoxManifest = builtins.toJSON (
|
||||
manifest
|
||||
// {
|
||||
@@ -46,14 +42,20 @@ rustPlatform.buildRustPackage (finalAttrs: {
|
||||
}
|
||||
);
|
||||
postBuild = ''
|
||||
substituteAll $firefoxManifestPath firefox.json
|
||||
substituteAll $chromeManifestPath chrome.json
|
||||
printf "%s" "$firefoxManifest" > firefox.json
|
||||
substituteInPlace firefox.json \
|
||||
--replace-fail "@out@" "$out"
|
||||
printf "%s" "$chromeManifest" > chrome.json
|
||||
substituteInPlace chrome.json \
|
||||
--replace-fail "@out@" "$out"
|
||||
'';
|
||||
postInstall = ''
|
||||
install -Dm0644 firefox.json $out/lib/mozilla/native-messaging-hosts/com.samhh.bukubrow.json
|
||||
install -Dm0644 chrome.json $out/etc/chromium/native-messaging-hosts/com.samhh.bukubrow.json
|
||||
'';
|
||||
|
||||
__structuredAttrs = true;
|
||||
|
||||
meta = {
|
||||
description = "WebExtension for Buku, a command-line bookmark manager";
|
||||
homepage = "https://github.com/SamHH/bukubrow-host";
|
||||
|
||||
Reference in New Issue
Block a user