Commit ed3b338b authored by Naoki OKAMURA's avatar Naoki OKAMURA

new: foliate/default.nix is imported from pull request on nixpkgs origin, and...

new: foliate/default.nix is imported from pull request on nixpkgs origin, and updated platik-theme definition
parent e9b45eb9
{ stdenv, fetchurl, ninja, meson, gettext, webkitgtk, gnome3, wrapGAppsHook }:
{ stdenv
, fetchFromGitHub
, meson
, ninja
, gettext
, pkgconfig
, python3
, wrapGAppsHook
, gobject-introspection
, gjs
, gnused
, gtk3
, gsettings-desktop-schemas
, webkitgtk
, glib
, desktop-file-utils
, hicolor-icon-theme /* setup hook */
, libarchive
/*, hyphen */
, dict
}:
stdenv.mkDerivation rec {
name = "foliate";
pname = "foliate";
version = "1.5.3";
src = fetchurl {
url = "https://github.com/johnfactotum/foliate/archive/${version}.tar.gz";
sha256 = "1mz27qj9zwkn978yd4sdswha4laq5gf9s6cs5xrkqfj9242mrx4m";
# Fetch this from gnome mirror if/when available there instead!
src = fetchFromGitHub {
owner = "johnfactotum";
repo = pname;
rev = version;
sha256 = "1bjlk9n1j34yx3bvzl95mpb56m2fjc5xcd6yks96pwfyfvjnbp93";
};
buildInputs = [
gettext webkitgtk gnome3.gjs
];
nativeBuildInputs = [
ninja meson wrapGAppsHook
meson
ninja
pkgconfig
gettext
gnused
python3
desktop-file-utils
wrapGAppsHook
hicolor-icon-theme
];
buildInputs = [
glib
gtk3
gjs
webkitgtk
gsettings-desktop-schemas
gobject-introspection
libarchive
# TODO: Add once packaged, unclear how language packages best handled
# hyphen
dict # dictd for offline dictionary support
];
doCheck = true;
prePatch = ''
sed -i 's!const python = [^\n]\+!const python = "${python3}/bin/python";!' src/main.js
'';
postPatch = ''
chmod +x build-aux/meson/postinstall.py
patchShebangs build-aux/meson/postinstall.py
'';
# Kludge so gjs can find resources by using the unwrapped name
# Improvements/alternatives welcome, but this seems to work for now :/.
# See: https://github.com/NixOS/nixpkgs/issues/31168#issuecomment-341793501
postInstall = ''
sed -e $'2iimports.package._findEffectiveEntryPointName = () => \'com.github.johnfactotum.Foliate\' ' \
-i $out/bin/com.github.johnfactotum.Foliate
'';
meta = with stdenv.lib; {
description = "Simple and modern GTK eBook reader";
homepage = "https://johnfactotum.github.io/foliate/";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ dtzWill ];
};
}
{ stdenv, fetchFromGitHub }:
{ stdenv, fetchFromGitHub, gtk3 }:
stdenv.mkDerivation rec {
name = "Newaita-${version}";
version = "git";
......@@ -9,9 +9,27 @@ stdenv.mkDerivation rec {
sha256 = "0mfcnpbrm7cmrhq9jrfqa074zm07q373akyc6bz7wdbsngx2z4a5";
};
nativeBuildInputs = [ gtk3 ];
installPhase = ''
mkdir -p $out/share/icons
mv Newaita-dark $out/share/icons
mv Newaita $out/share/icons
'';
postFixup = ''
for base in Newaita{,-dark}; do
cd $out/share/icons/$base/emblems
for size in 16 22 24 32 48; do
ln -sf $size "''${size}@2x"
done
done
find $out/share/icons | grep ' (' | xargs -I{} rm {}
find $out/share/icons | grep ' ' | xargs -I{} sh -c 'mv "{}" "$(echo "{}" | sed "s/ //g")"'
gtk-update-icon-cache $out/share/icons/Newaita
gtk-update-icon-cache $out/share/icons/Newaita-dark
'';
}
......@@ -18,6 +18,6 @@ in stdenv.mkDerivation rec {
installPhase = ''
mkdir -p $out/share/themes
cp -R * $out/share/themes
mv Plastik* $out/share/themes
'';
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment