-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
146 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
From 46a92740dde0372fbe3e75a9a334ea79b6f53da1 Mon Sep 17 00:00:00 2001 | ||
From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= <[email protected]> | ||
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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"; | ||
}; | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters