gucharmap: use ucd from pkgs

This commit is contained in:
Jan Tojnar 2019-11-07 23:12:52 +01:00
parent ad9135a4b2
commit 133da5970f
No known key found for this signature in database
GPG Key ID: 7FAB2A15F7A607A4
2 changed files with 29 additions and 49 deletions

View File

@ -1,6 +1,7 @@
{ stdenv
, intltool
, fetchFromGitLab
, fetchpatch
, pkgconfig
, gtk3
, adwaita-icon-theme
@ -20,13 +21,29 @@
, gsettings-desktop-schemas
, callPackage
, unzip
, unicode-character-database
, unihan-database
, runCommand
, symlinkJoin
, gobject-introspection
}:
let
unicode-data = callPackage ./unicode-data.nix {};
in
stdenv.mkDerivation rec {
# TODO: make upstream patch allowing to use the uncompressed file,
# preferably from XDG_DATA_DIRS.
# https://gitlab.gnome.org/GNOME/gucharmap/issues/13
unihanZip = runCommand "unihan" {} ''
mkdir -p $out/share/unicode
ln -s ${unihan-database.src} $out/share/unicode/Unihan.zip
'';
ucd = symlinkJoin {
name = "ucd+unihan";
paths = [
unihanZip
unicode-character-database
];
};
in stdenv.mkDerivation rec {
pname = "gucharmap";
version = "12.0.1";
@ -40,6 +57,14 @@ stdenv.mkDerivation rec {
sha256 = "0si3ymyfzc5v7ly0dmcs3qgw2wp8cyasycq5hmcr8frl09lr6gkw";
};
patches = [
# fix build with Unicode 12.1
(fetchpatch {
url = "https://salsa.debian.org/gnome-team/gucharmap/raw/de079ad494a15f662416257fca2f2b8db757f4ea/debian/patches/update-to-unicode-12.1.patch";
sha256 = "093gqsxfpp3s0b88p1dgkskr4ng3hv8irmxc60l3fdrkl8am00xh";
})
];
nativeBuildInputs = [
pkgconfig
wrapGAppsHook
@ -66,7 +91,7 @@ stdenv.mkDerivation rec {
];
configureFlags = [
"--with-unicode-data=${unicode-data}"
"--with-unicode-data=${ucd}/share/unicode"
"--enable-gtk-doc"
];

View File

@ -1,45 +0,0 @@
{ fetchurl, stdenv, gnome3 }:
stdenv.mkDerivation rec {
pname = "unicode-data";
version = "12.0.0";
srcs = [
(fetchurl {
url = "http://www.unicode.org/Public/${version}/ucd/Blocks.txt";
sha256 = "041sk54v6rjzb23b9x7yjdwzdp2wc7gvfz7ybavgg4gbh51wm8x1";
})
(fetchurl {
url = "http://www.unicode.org/Public/${version}/ucd/DerivedAge.txt";
sha256 = "04j92xp07v273z3pxkbfmi1svmw9kmnjl9nvz9fv0g5ybk9zk7r6";
})
(fetchurl {
url = "http://www.unicode.org/Public/${version}/ucd/NamesList.txt";
sha256 = "0vsq8gx7hws8mvxy3nlglpwxw7ky57q0fs09d7w9xgb2ylk7fz61";
})
(fetchurl {
url = "http://www.unicode.org/Public/${version}/ucd/Scripts.txt";
sha256 = "18c63hx4y5yg408a8d0wx72d2hfnlz4l560y1fsf9lpzifxpqcmx";
})
(fetchurl {
url = "http://www.unicode.org/Public/${version}/ucd/UnicodeData.txt";
sha256 = "07d1kq190kgl92ispfx6zmdkvwvhjga0ishxsngzlw8j3kdkz4ap";
})
(fetchurl {
url = "http://www.unicode.org/Public/${version}/ucd/Unihan.zip";
sha256 = "1kfdhgg2gm52x3s07bijb5cxjy0jxwhd097k5lqhvzpznprm6ibf";
})
];
phases = "installPhase";
installPhase = with stdenv.lib; ''
mkdir $out
for f in $srcs;do
cp $f $out/$(stripHash $f)
done
'';
meta = with stdenv.lib; {
homepage = http://www.unicode.org/ucd/;
description = "Unicode Character Database";
maintainers = gnome3.maintainers;
license = licenses.mit;
platforms = platforms.all;
};
}