mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-11-20 08:59:32 +03:00
Merge pull request #176424 from thiagokokada/mcomix-init
mcomix: init at 2.0.2; mcomix3: remove and alias it to mcomix
This commit is contained in:
commit
49c4223e98
64
pkgs/applications/graphics/mcomix/default.nix
Normal file
64
pkgs/applications/graphics/mcomix/default.nix
Normal file
@ -0,0 +1,64 @@
|
||||
{ lib
|
||||
, fetchurl
|
||||
, gdk-pixbuf
|
||||
, gobject-introspection
|
||||
, gtk3
|
||||
, mcomix
|
||||
, python3
|
||||
, testVersion
|
||||
, wrapGAppsHook
|
||||
|
||||
# Recommended Dependencies:
|
||||
, lhasa
|
||||
, mupdf
|
||||
, p7zip
|
||||
, unrar
|
||||
, unrarSupport ? false # unfree software
|
||||
}:
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "mcomix";
|
||||
version = "2.0.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://sourceforge/mcomix/${pname}-${version}.tar.gz";
|
||||
sha256 = "sha256-7zjQcT5WoHxy+YzCDJ6s2ngOOfO4L9exuqBqacecClg=";
|
||||
};
|
||||
|
||||
buildInputs = [ gobject-introspection gtk3 gdk-pixbuf ];
|
||||
nativeBuildInputs = [ wrapGAppsHook ];
|
||||
propagatedBuildInputs = (with python3.pkgs; [ pillow pygobject3 pycairo ]);
|
||||
|
||||
# Tests are broken
|
||||
doCheck = false;
|
||||
|
||||
# Correct wrapper behavior, see https://github.com/NixOS/nixpkgs/issues/56943
|
||||
# until https://github.com/NixOS/nixpkgs/pull/102613
|
||||
strictDeps = false;
|
||||
|
||||
# prevent double wrapping
|
||||
dontWrapGApps = true;
|
||||
|
||||
preFixup = ''
|
||||
makeWrapperArgs+=(
|
||||
"''${gappsWrapperArgs[@]}"
|
||||
"--prefix" "PATH" ":" "${lib.makeBinPath ([ p7zip lhasa mupdf ] ++ lib.optional (unrarSupport) unrar)}"
|
||||
)
|
||||
'';
|
||||
|
||||
passthru.tests.version = testVersion {
|
||||
package = mcomix;
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Comic book reader and image viewer";
|
||||
longDescription = ''
|
||||
User-friendly, customizable image viewer, specifically designed to handle
|
||||
comic books and manga supporting a variety of container formats
|
||||
(including CBR, CBZ, CB7, CBT, LHA and PDF)
|
||||
'';
|
||||
homepage = "https://sourceforge.net/projects/mcomix/";
|
||||
license = licenses.gpl2Plus;
|
||||
maintainers = with maintainers; [ thiagokokada ];
|
||||
};
|
||||
}
|
@ -1,105 +0,0 @@
|
||||
{ lib
|
||||
, fetchFromGitHub
|
||||
, wrapGAppsHook
|
||||
, installShellFiles
|
||||
, python3
|
||||
, gobject-introspection
|
||||
, gtk3
|
||||
, gdk-pixbuf
|
||||
|
||||
# Recommended Dependencies:
|
||||
, unrarSupport ? false # unfree software
|
||||
, unrar
|
||||
, p7zip
|
||||
, lhasa
|
||||
, mupdf
|
||||
}:
|
||||
|
||||
python3.pkgs.buildPythonApplication rec {
|
||||
pname = "mcomix3";
|
||||
version = "unstable-2021-04-23";
|
||||
|
||||
# no official release on pypi/github and no build system
|
||||
src = fetchFromGitHub {
|
||||
repo = "${pname}";
|
||||
owner = "multiSnow";
|
||||
rev = "139344e23898c28484328fc29fd0c6659affb12d";
|
||||
sha256 = "0q9xgl60ryf7qmy5vgzgfry4rvw5j9rb4d1ilxmpjmvm7dd3fm2k";
|
||||
};
|
||||
|
||||
buildInputs = [ gobject-introspection gtk3 gdk-pixbuf ];
|
||||
nativeBuildInputs = [ wrapGAppsHook installShellFiles ];
|
||||
propagatedBuildInputs = (with python3.pkgs; [ pillow pygobject3 pycairo ]);
|
||||
|
||||
format = "other";
|
||||
|
||||
# Correct wrapper behavior, see https://github.com/NixOS/nixpkgs/issues/56943
|
||||
# until https://github.com/NixOS/nixpkgs/pull/102613
|
||||
strictDeps = false;
|
||||
|
||||
preInstall = ''
|
||||
libdir=$out/lib/${python3.libPrefix}/site-packages
|
||||
mkdir -p $out/share/{icons/hicolor,man/man1,applications,metainfo,thumbnailers}
|
||||
mkdir -p $out/bin $libdir
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
substituteInPlace mime/*.desktop \
|
||||
--replace "Exec=mcomix" "Exec=mcomix3" \
|
||||
--replace "Icon=mcomix" "Icon=${pname}"
|
||||
${python3.executable} installer.py --srcdir=mcomix --target=$libdir
|
||||
mv $libdir/mcomix/mcomixstarter.py $out/bin/${pname}
|
||||
mv $libdir/mcomix/comicthumb.py $out/bin/comicthumb
|
||||
mv $libdir/mcomix/mcomix/* $libdir/mcomix
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
postInstall = ''
|
||||
rmdir $libdir/mcomix/mcomix
|
||||
mv man/mcomix.1 man/${pname}.1
|
||||
installManPage man/*
|
||||
cp -r mime/icons/* $out/share/icons/hicolor/
|
||||
cp mime/*.desktop $out/share/applications/
|
||||
cp mime/*.appdata.xml $out/share/metainfo/
|
||||
cp mime/*.thumbnailer $out/share/thumbnailers/
|
||||
for folder in $out/share/icons/hicolor/*; do
|
||||
mkdir $folder/{apps,mimetypes}
|
||||
mv $folder/*.png $folder/mimetypes
|
||||
cp $libdir/mcomix/images/$(basename $folder)/mcomix.png $folder/apps/${pname}.png
|
||||
cp $folder/mimetypes/application-x-cbt.png $folder/mimetypes/application-x-cbr.png
|
||||
cp $folder/mimetypes/application-x-cbt.png $folder/mimetypes/application-x-cbz.png
|
||||
done
|
||||
'';
|
||||
|
||||
# prevent double wrapping
|
||||
dontWrapGApps = true;
|
||||
preFixup = ''
|
||||
makeWrapperArgs+=(
|
||||
"''${gappsWrapperArgs[@]}"
|
||||
"--prefix" "PATH" ":" "${lib.makeBinPath ([ p7zip lhasa mupdf ] ++ lib.optional (unrarSupport) unrar)}"
|
||||
)
|
||||
'';
|
||||
|
||||
# real pytests broken upstream
|
||||
checkPhase = ''
|
||||
$out/bin/comicthumb --help > /dev/null
|
||||
$out/bin/${pname} --help > /dev/null
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Comic book reader and image viewer; python3 fork of mcomix";
|
||||
longDescription = ''
|
||||
User-friendly, customizable image viewer, specifically designed to handle
|
||||
comic books and manga supporting a variety of container formats
|
||||
(including CBR, CBZ, CB7, CBT, LHA and PDF)
|
||||
'';
|
||||
homepage = "https://github.com/multiSnow/mcomix3";
|
||||
changelog = "https://github.com/multiSnow/mcomix3/blob/gtk3/ChangeLog";
|
||||
license = licenses.gpl2Plus;
|
||||
maintainers = with maintainers; [ confus ];
|
||||
platforms = platforms.all;
|
||||
};
|
||||
}
|
@ -833,6 +833,7 @@ mapAliases ({
|
||||
matrique = spectral; # Added 2020-01-27
|
||||
maui-nota = libsForQt5.mauiPackages.nota; # added 2022-05-17
|
||||
mcgrid = throw "mcgrid has been removed from nixpkgs, as it's not compatible with rivet 3"; # Added 2020-05-23
|
||||
mcomix3 = mcomix; # Added 2022-06-05
|
||||
mediatomb = throw "mediatomb is no longer maintained upstream, use gerbera instead"; # added 2022-01-04
|
||||
meme = meme-image-generator; # Added 2021-04-21
|
||||
memtest86 = throw "'memtest86' has been renamed to/replaced by 'memtest86plus'"; # Converted to throw 2022-02-22
|
||||
|
@ -28037,7 +28037,7 @@ with pkgs;
|
||||
|
||||
mbrola = callPackage ../applications/audio/mbrola { };
|
||||
|
||||
mcomix3 = callPackage ../applications/graphics/mcomix3 {};
|
||||
mcomix = callPackage ../applications/graphics/mcomix { };
|
||||
|
||||
mcpp = callPackage ../development/compilers/mcpp { };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user