[Backport release-24.11] cbconvert: 1.0.4 -> 1.1.0 (#357279)

This commit is contained in:
Weijia Wang 2024-11-20 14:03:05 +01:00 committed by GitHub
commit 413b5d2bcf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 19 additions and 38 deletions

View File

@ -1,7 +1,10 @@
{
buildGoModule,
cbconvert,
cbconvert-gui,
gtk3,
pkg-config,
testers,
wrapGAppsHook3,
}:
@ -10,18 +13,18 @@ buildGoModule rec {
inherit (cbconvert)
patches
proxyVendor
src
tags
version
;
nativeBuildInputs = cbconvert.nativeBuildInputs ++ [
nativeBuildInputs = [
pkg-config
wrapGAppsHook3
];
buildInputs = cbconvert.buildInputs ++ [ gtk3 ];
vendorHash = "sha256-vvCvKecPszhNCQdgm3mQMb5+486BGZ9sz3R0b70eLeQ=";
vendorHash = "sha256-oMW5zfAw2VQSVaB+Z1pE51OtNIFr+PnRMM+oBYNLWxk=";
modRoot = "cmd/cbconvert-gui";
ldflags = [
@ -31,16 +34,18 @@ buildGoModule rec {
];
postInstall = ''
install -D --mode=0644 --target-directory=$out/share/applications/ dist/linux/cbconvert.desktop
install -D --mode=0644 --target-directory=$out/icons/hicolor/256x256/apps dist/linux/cbconvert.png
install -D --mode=0644 --target-directory=$out/share/thumbnailers dist/linux/cbconvert.thumbnailer
install -D --mode=0644 dist/linux/flatpak/io.github.gen2brain.cbconvert.metainfo.xml $out/share/metainfo/cbconvert.metainfo.xml
install -D --mode=0644 --target-directory=$out/icons/hicolor/256x256/apps dist/linux/io.github.gen2brain.cbconvert.png
install -D --mode=0644 --target-directory=$out/share/applications/ dist/linux/io.github.gen2brain.cbconvert.desktop
install -D --mode=0644 --target-directory=$out/share/metainfo dist/linux/io.github.gen2brain.cbconvert.metainfo.xml
install -D --mode=0644 --target-directory=$out/share/thumbnailers dist/linux/io.github.gen2brain.cbconvert.thumbnailer
'';
postFixup = ''
substituteInPlace $out/share/metainfo/cbconvert.metainfo.xml \
--replace-fail "io.github.gen2brain.cbconvert" "cbconvert"
'';
passthru = {
tests.version = testers.testVersion {
package = cbconvert-gui;
command = "cbconvert-gui version";
};
};
meta = cbconvert.meta // {
mainProgram = "cbconvert-gui";

View File

@ -4,47 +4,28 @@
callPackage,
cbconvert,
fetchFromGitHub,
fetchpatch2,
imagemagick,
lib,
libunarr,
mupdf-headless,
nix-update-script,
pkg-config,
testers,
zlib,
}:
buildGoModule rec {
pname = "cbconvert";
version = "1.0.4";
version = "1.1.0";
src = fetchFromGitHub {
owner = "gen2brain";
repo = "cbconvert";
rev = "v${version}";
hash = "sha256-9x7RXyiQoV2nIVFnG1XHcYfTQiMZ88Ck7uuY7NLK8CA=";
hash = "sha256-C2Eox6fpKS0fPB7KFgBn62HKbWYacSVMJK0CkT6+FBU=";
};
# Update dependencies in order to use the extlib tag.
patches = [
(fetchpatch2 {
name = "update-dependencies-1.patch";
url = "https://github.com/gen2brain/cbconvert/commit/1a36ec17b2c012f278492d60d469b8e8457a6110.patch";
hash = "sha256-E+HWYPz9FtU3JAktzIRflF/pHdLfoaciBmjb7UOQYLo=";
})
(fetchpatch2 {
name = "update-dependencies-2.patch";
url = "https://github.com/gen2brain/cbconvert/commit/74c5de699413e95133f97666b64a1866f88fedd5.patch";
hash = "sha256-rrJsYJHcfNWF90vwUAT3J/gqg22e1gk6I48LsTrYbmU=";
})
];
vendorHash = "sha256-aVInsWvygNH+/h7uQs4hAPOO2gsSkBx+tI+TK77M/hg=";
vendorHash = "sha256-uV8aIUKy9HQdZvR3k8CTTrHsh9TyBw21gFTdjR1XJlg=";
modRoot = "cmd/cbconvert";
proxyVendor = true;
# The extlib tag forces the github.com/gen2brain/go-unarr module to use external libraries instead of bundled ones.
tags = [ "extlib" ];
@ -54,13 +35,8 @@ buildGoModule rec {
"-X main.appVersion=${version}"
];
nativeBuildInputs = [
pkg-config
];
buildInputs = [
bzip2
imagemagick
libunarr
mupdf-headless
zlib