mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-16 09:03:42 +00:00
![Jan Tojnar](/assets/img/avatar_default.png)
This was achieved using the following command: sd 'wrapGAppsHook\b' wrapGAppsHook3 (rg -l 'wrapGAppsHook\b') And then manually reverted the following changes: - alias in top-level.nix - function name in wrap-gapps-hook.sh - comment in postFixup of at-spi2-core - comment in gtk4 - comment in preFixup of 1password-gui/linux.nix - comment in postFixup of qgis/unwrapped-ltr.nix and qgis/unwrapped.nix - comment in postFixup of telegram-desktop - comment in postFixup of fwupd - buildCommand of mongodb-compass - postFixup of xflux-gui - comment in a patch in kdePackages.kde-gtk-config and plasma5Packages.kde-gtk-config - description of programs.sway.wrapperFeatures.gtk NixOS option (manual rebuild)
105 lines
2.4 KiB
Nix
105 lines
2.4 KiB
Nix
{ lib
|
|
, buildPythonApplication
|
|
, fetchFromGitHub
|
|
, brotlicffi
|
|
, gst-python
|
|
, kiss-headers
|
|
, logbook
|
|
, pillow
|
|
, pygobject3
|
|
, python-zbar
|
|
, requests
|
|
, single-version
|
|
, gobject-introspection
|
|
, gst-plugins-good
|
|
, gtk3
|
|
, libhandy
|
|
, librsvg
|
|
, networkmanager
|
|
, setuptools
|
|
, python
|
|
, pytestCheckHook
|
|
, wrapGAppsHook3
|
|
}:
|
|
|
|
buildPythonApplication rec {
|
|
pname = "cobang";
|
|
version = "0.10.9";
|
|
pyproject = true;
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "hongquan";
|
|
repo = "CoBang";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-xOP2XkmHOGMe50dn4StX/9veTdloLHq76ENWEUK4Keo=";
|
|
};
|
|
|
|
postPatch = ''
|
|
# Fixes "Multiple top-level packages discovered in a flat-layout"
|
|
sed -i '$ a\[tool.setuptools]' pyproject.toml
|
|
sed -i '$ a\packages = ["cobang"]' pyproject.toml
|
|
'';
|
|
|
|
nativeBuildInputs = [
|
|
# Needed to recognize gobject namespaces
|
|
gobject-introspection
|
|
wrapGAppsHook3
|
|
setuptools
|
|
];
|
|
|
|
buildInputs = [
|
|
# Requires v4l2src
|
|
gst-plugins-good
|
|
# For gobject namespaces
|
|
libhandy
|
|
networkmanager
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
brotlicffi
|
|
kiss-headers
|
|
logbook
|
|
pillow
|
|
requests
|
|
single-version
|
|
# Unlisted dependencies
|
|
pygobject3
|
|
python-zbar
|
|
# Needed as a gobject namespace and to fix 'Caps' object is not subscriptable
|
|
gst-python
|
|
];
|
|
|
|
nativeCheckInputs = [
|
|
pytestCheckHook
|
|
];
|
|
|
|
# Wrapping this manually for SVG recognition
|
|
dontWrapGApps = true;
|
|
|
|
postInstall = ''
|
|
# Needed by the application
|
|
cp -R data $out/${python.sitePackages}/
|
|
|
|
# Icons and applications
|
|
install -Dm 644 $out/${python.sitePackages}/data/vn.hoabinh.quan.CoBang.svg -t $out/share/pixmaps/
|
|
install -Dm 644 $out/${python.sitePackages}/data/vn.hoabinh.quan.CoBang.desktop.in -t $out/share/applications/
|
|
mv $out/${python.sitePackages}/data/vn.hoabinh.quan.CoBang.desktop{.in,}
|
|
'';
|
|
|
|
preFixup = ''
|
|
wrapProgram $out/bin/cobang \
|
|
''${gappsWrapperArgs[@]} \
|
|
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
|
|
--set GDK_PIXBUF_MODULE_FILE "${librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "A QR code scanner desktop app for Linux";
|
|
homepage = "https://github.com/hongquan/CoBang";
|
|
license = licenses.gpl3Only;
|
|
maintainers = with maintainers; [ wolfangaukang ];
|
|
mainProgram = "cobang";
|
|
platforms = [ "x86_64-linux" ];
|
|
};
|
|
}
|