nixpkgs/pkgs/desktops/deepin/dtkcore/default.nix
2019-04-02 20:12:33 -03:00

54 lines
1.3 KiB
Nix

{ stdenv, fetchFromGitHub, pkgconfig, qmake, gsettings-qt, pythonPackages, deepin }:
stdenv.mkDerivation rec {
name = "${pname}-${version}";
pname = "dtkcore";
version = "2.0.10";
src = fetchFromGitHub {
owner = "linuxdeepin";
repo = pname;
rev = version;
sha256 = "0dwpq6c38gaa95mgjnwj3vjz57n0cz6jfk950xi6s9ww2f4g6kq7";
};
nativeBuildInputs = [
pkgconfig
qmake
pythonPackages.wrapPython
];
buildInputs = [
gsettings-qt
];
postPatch = ''
# Only define QT_HOST_DATA if it is empty
sed '/QT_HOST_DATA=/a }' -i src/dtk_module.prf
sed '/QT_HOST_DATA=/i isEmpty(QT_HOST_DATA) {' -i src/dtk_module.prf
# Fix shebang
sed -i tools/script/dtk-translate.py -e "s,#!env,#!/usr/bin/env,"
'';
preConfigure = ''
qmakeFlags="$qmakeFlags QT_HOST_DATA=$out"
'';
postFixup = ''
chmod +x $out/lib/dtk2/*.py
wrapPythonProgramsIn "$out/lib/dtk2" "$out $pythonPath"
'';
enableParallelBuilding = true;
passthru.updateScript = deepin.updateScript { inherit name; };
meta = with stdenv.lib; {
description = "Deepin tool kit core modules";
homepage = https://github.com/linuxdeepin/dtkcore;
license = licenses.gpl3;
platforms = platforms.linux;
maintainers = with maintainers; [ romildo ];
};
}