cbconvert: init at 1.0.4

This commit is contained in:
Jordan Williams 2024-10-19 08:40:03 -05:00
parent 99fdc1971b
commit e7e66352e9
No known key found for this signature in database
GPG Key ID: 9FB42B0E7F657D8C
3 changed files with 137 additions and 0 deletions

View File

@ -0,0 +1,48 @@
{
buildGoModule,
cbconvert,
gtk3,
wrapGAppsHook3,
}:
buildGoModule rec {
pname = "cbconvert-gui";
inherit (cbconvert)
patches
proxyVendor
src
tags
version
;
nativeBuildInputs = cbconvert.nativeBuildInputs ++ [
wrapGAppsHook3
];
buildInputs = cbconvert.buildInputs ++ [ gtk3 ];
vendorHash = "sha256-vvCvKecPszhNCQdgm3mQMb5+486BGZ9sz3R0b70eLeQ=";
modRoot = "cmd/cbconvert-gui";
ldflags = [
"-s"
"-w"
"-X main.appVersion=${version}"
];
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
'';
postFixup = ''
substituteInPlace $out/share/metainfo/cbconvert.metainfo.xml \
--replace-fail "io.github.gen2brain.cbconvert" "cbconvert"
'';
meta = cbconvert.meta // {
mainProgram = "cbconvert-gui";
};
}

View File

@ -0,0 +1,87 @@
{
buildGoModule,
bzip2,
callPackage,
cbconvert,
fetchFromGitHub,
fetchpatch2,
imagemagick,
lib,
libunarr,
mupdf-headless,
nix-update-script,
pkg-config,
testers,
zlib,
}:
buildGoModule rec {
pname = "cbconvert";
version = "1.0.4";
src = fetchFromGitHub {
owner = "gen2brain";
repo = "cbconvert";
rev = "v${version}";
hash = "sha256-9x7RXyiQoV2nIVFnG1XHcYfTQiMZ88Ck7uuY7NLK8CA=";
};
# 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=";
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" ];
ldflags = [
"-s"
"-w"
"-X main.appVersion=${version}"
];
nativeBuildInputs = [
pkg-config
];
buildInputs = [
bzip2
imagemagick
libunarr
mupdf-headless
zlib
];
passthru = {
gui = callPackage ./gui.nix { };
updateScript = nix-update-script { };
tests.version = testers.testVersion {
package = cbconvert;
command = "cbconvert version";
};
};
meta = {
description = "Comic Book converter";
homepage = "https://github.com/gen2brain/cbconvert";
changelog = "https://github.com/gen2brain/cbconvert/releases/tag/v${version}";
license = with lib.licenses; [ gpl3Only ];
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ jwillikers ];
mainProgram = "cbconvert";
};
}

View File

@ -28410,6 +28410,8 @@ with pkgs;
cbc = callPackage ../applications/science/math/cbc { };
cbconvert-gui = cbconvert.gui;
cddiscid = callPackage ../applications/audio/cd-discid {
inherit (darwin) IOKit;
};