biblioteca: init at 1.5
This commit is contained in:
parent
d533f739c4
commit
4c1bfb83b0
38
pkgs/by-name/bi/biblioteca/dont-use-flatpak.patch
Normal file
38
pkgs/by-name/bi/biblioteca/dont-use-flatpak.patch
Normal file
@ -0,0 +1,38 @@
|
||||
From 46a92740dde0372fbe3e75a9a334ea79b6f53da1 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= <ballogyor@gmail.com>
|
||||
Date: Fri, 8 Nov 2024 00:04:01 +0100
|
||||
Subject: [PATCH] Don't check if running under Flatpak
|
||||
|
||||
---
|
||||
src/bin.js | 8 --------
|
||||
1 file changed, 8 deletions(-)
|
||||
|
||||
diff --git a/src/bin.js b/src/bin.js
|
||||
index 5dcc3eb..362ce67 100755
|
||||
--- a/src/bin.js
|
||||
+++ b/src/bin.js
|
||||
@@ -3,7 +3,6 @@
|
||||
import { exit, programArgs } from "system";
|
||||
import GLib from "gi://GLib";
|
||||
import { setConsoleLogDomain } from "console";
|
||||
-import Xdp from "gi://Xdp";
|
||||
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
imports.package.init({
|
||||
@@ -16,13 +15,6 @@ imports.package.init({
|
||||
setConsoleLogDomain(pkg.name);
|
||||
GLib.set_application_name("Biblioteca");
|
||||
|
||||
-if (!Xdp.Portal.running_under_flatpak()) {
|
||||
- console.error(
|
||||
- "Flatpak required\nBiblioteca is only meant to be run sandboxed in a specific target environment.\nBypassing this will exposes users to arbitrary code breakage.",
|
||||
- );
|
||||
- exit(1);
|
||||
-}
|
||||
-
|
||||
globalThis.__DEV__ = pkg.name.endsWith(".Devel");
|
||||
if (__DEV__) {
|
||||
pkg.sourcedir = "@sourcedir@";
|
||||
--
|
||||
2.47.0
|
||||
|
104
pkgs/by-name/bi/biblioteca/package.nix
Normal file
104
pkgs/by-name/bi/biblioteca/package.nix
Normal file
@ -0,0 +1,104 @@
|
||||
{
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
meson,
|
||||
ninja,
|
||||
desktop-file-utils,
|
||||
glib,
|
||||
gjs,
|
||||
blueprint-compiler,
|
||||
pkg-config,
|
||||
gtk4,
|
||||
gobject-introspection,
|
||||
libadwaita,
|
||||
webkitgtk,
|
||||
coreutils,
|
||||
makeShellWrapper,
|
||||
wrapGAppsHook4,
|
||||
glib-networking,
|
||||
symlinkJoin,
|
||||
extraDocsPackage ? [ ],
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "biblioteca";
|
||||
version = "1.5";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "workbenchdev";
|
||||
repo = "Biblioteca";
|
||||
rev = "refs/tags/v${finalAttrs.version}";
|
||||
fetchSubmodules = true;
|
||||
hash = "sha256-zrrI3u4ukGN6eb/eK/aZG4gi/xtXciyRS+JX9Js9KEw=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
./dont-use-flatpak.patch # From https://gitlab.archlinux.org/archlinux/packaging/packages/biblioteca/-/blob/main/biblioteca-no-flatpak.patch?ref_type=heads
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
meson
|
||||
ninja
|
||||
desktop-file-utils
|
||||
makeShellWrapper
|
||||
gjs
|
||||
wrapGAppsHook4
|
||||
pkg-config
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
glib
|
||||
gtk4
|
||||
gobject-introspection
|
||||
libadwaita
|
||||
webkitgtk
|
||||
glib-networking
|
||||
];
|
||||
|
||||
docPath = symlinkJoin {
|
||||
name = "biblioteca-docs";
|
||||
paths = [
|
||||
gtk4.devdoc
|
||||
glib.devdoc
|
||||
libadwaita.devdoc
|
||||
webkitgtk.devdoc
|
||||
gobject-introspection.devdoc
|
||||
] ++ extraDocsPackage;
|
||||
};
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace src/meson.build \
|
||||
--replace-fail "/app/bin/blueprint-compiler" "${lib.getExe blueprint-compiler}" \
|
||||
|
||||
patchShebangs .
|
||||
|
||||
substituteInPlace build-aux/build-index.js \
|
||||
--replace-fail "/usr/bin/env -S gjs -m" "${coreutils}/bin/env -S ${gjs}/bin/gjs -m" \
|
||||
--replace-fail "/app/share/doc" "${finalAttrs.docPath}/share/doc"
|
||||
|
||||
substituteInPlace src/Shortcuts.js \
|
||||
--replace-fail "/app/share/doc" "${finalAttrs.docPath}/share/doc"
|
||||
substituteInPlace src/window.blp \
|
||||
--replace-fail "/app/share/doc" "${finalAttrs.docPath}/share/doc"
|
||||
substituteInPlace src/window.js \
|
||||
--replace-fail "/app/share/doc" "${finalAttrs.docPath}/share/doc"
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
mv $out/bin/app.drey.Biblioteca $out/share/app.drey.Biblioteca/app.drey.Biblioteca
|
||||
substituteInPlace $out/bin/biblioteca \
|
||||
--replace-fail app.drey.Biblioteca $out/share/app.drey.Biblioteca/app.drey.Biblioteca
|
||||
'';
|
||||
|
||||
doCheck = true;
|
||||
|
||||
meta = {
|
||||
homepage = "https://apps.gnome.org/Biblioteca/";
|
||||
platforms = lib.platforms.linux;
|
||||
maintainers = with lib.maintainers; [ bot-wxt1221 ];
|
||||
license = lib.licenses.gpl3Only;
|
||||
description = "Documentation viewer for GNOME";
|
||||
mainProgram = "biblioteca";
|
||||
};
|
||||
})
|
@ -19208,4 +19208,8 @@ with pkgs;
|
||||
tree-from-tags = callPackage ../by-name/tr/tree-from-tags/package.nix {
|
||||
ruby = ruby_3_1;
|
||||
};
|
||||
|
||||
biblioteca = callPackage ../by-name/bi/biblioteca/package.nix {
|
||||
webkitgtk = webkitgtk_6_0;
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user