Last active
May 3, 2021 20:48
-
-
Save raboof/bb744b45eb01443cd155956124a6e83d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: | |
let | |
texlive = pkgs.texlive.combined.scheme-basic; | |
python = pkgs.python3; | |
textext = python.pkgs.buildPythonPackage rec { | |
pname = "textext"; | |
version = "1.3.1"; | |
src = pkgs.fetchFromGitHub { | |
owner = "textext"; | |
repo = "textext"; | |
rev = "1.3.1"; | |
sha256 = "0sq2gwlklgz55lqxrjnivjl8lmakr2c7dm3q10xlr0slhilrs7sv"; | |
}; | |
propagatedBuildInputs = [ | |
# GTK is recommended, but we don't package | |
# pygi yet so that is left as a future improvement | |
python.pkgs.tkinter | |
]; | |
# textext doesn't have a 'bdist_wheel' target | |
dontUseSetuptoolsBuild = true; | |
buildPhase = '' | |
runHook preBuild | |
mkdir dist | |
python setup.py \ | |
--inkscape-executable=${pkgs.inkscape}/bin/inkscape \ | |
--pdflatex-executable=${texlive}/bin/pdflatex \ | |
--lualatex-executable=${texlive}/bin/lualatex \ | |
--inkscape-extensions-path=dist | |
runHook postBuild | |
''; | |
doCheck = false; | |
installPhase = '' | |
runHook preInstall | |
mkdir -p $out/share/inkscape/extensions | |
cp -r dist/textext $out/share/inkscape/extensions | |
runHook postInstall | |
''; | |
}; | |
in | |
pkgs.mkShell { | |
buildInputs = [ | |
texlive | |
(pkgs.inkscape-with-extensions.override { | |
inkscapeExtensions = [ | |
textext | |
pkgs.inkcut | |
]; | |
}) | |
]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment