fix: remove custom pygments-style-github (#307)

It has been added to Nix at: https://github.com/NixOS/nixpkgs/pull/214015
This commit is contained in:
Pol Dellaiera 2023-02-03 12:09:56 +01:00 committed by GitHub
parent de799935b2
commit d15c0558d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 28 additions and 45 deletions

View File

@ -5,11 +5,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1674771137,
"narHash": "sha256-Zpk1GbEsYrqKmuIZkx+f+8pU0qcCYJoSUwNz1Zk+R00=",
"lastModified": 1675295133,
"narHash": "sha256-dU8fuLL98WFXG0VnRgM00bqKX6CEPBLybhiIDIgO45o=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "7c7a8bce3dffe71203dcd4276504d1cb49dfe05f",
"rev": "bf53492df08f3178ce85e0c9df8ed8d03c030c9f",
"type": "github"
},
"original": {
@ -19,11 +19,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1675153841,
"narHash": "sha256-EWvU3DLq+4dbJiukfhS7r6sWZyJikgXn6kNl7eHljW8=",
"lastModified": 1675309347,
"narHash": "sha256-D3CQ6HRDT2m3XJlrzb5jKq4vNFR5xFTEFKC7iSjlFpM=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "ea692c2ad1afd6384e171eabef4f0887d2b882d3",
"rev": "006c3bd4dd2f5d1d2094047f307cbf9e2b73d9c5",
"type": "github"
},
"original": {
@ -36,11 +36,11 @@
"nixpkgs-lib": {
"locked": {
"dir": "lib",
"lastModified": 1672350804,
"narHash": "sha256-jo6zkiCabUBn3ObuKXHGqqORUMH27gYDIFFfLq5P4wg=",
"lastModified": 1675183161,
"narHash": "sha256-Zq8sNgAxDckpn7tJo7V1afRSk2eoVbu3OjI1QklGLNg=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "677ed08a50931e38382dbef01cba08a8f7eac8f6",
"rev": "e1e1b192c1a5aab2960bf0a0bd53a2e8124fa18e",
"type": "github"
},
"original": {

View File

@ -26,8 +26,8 @@
pkgs = nixpkgs.legacyPackages.${system};
###########################################################################
# LaTeX font
########################################################################
# LaTeX Font
inconsolata-lgc-latex = pkgs.stdenvNoCC.mkDerivation {
name = "inconsolata-lgc-latex";
pname = "inconsolata-lgc-latex";
@ -49,7 +49,7 @@
tlType = "run";
};
###########################################################################
########################################################################
# LaTeX Environment
texliveEnv = pkgs.texlive.combine {
inherit
@ -113,33 +113,14 @@
};
};
###########################################################################
# Python Environment
# Pin the Python version and its associated package set in a single place.
python = pkgs.python311;
pythonPkgs = pkgs.python311Packages;
pygments-style-github = pythonPkgs.buildPythonPackage rec {
pname = "pygments-style-github";
version = "0.4";
doCheck = false; # Hopefully someone else has run the tests.
src = pythonPkgs.fetchPypi {
inherit pname version;
sha256 = "19zl8l5fyb8z3j8pdlm0zbgag669af66f8gn81ichm3x2hivvjhg";
};
# Anything depending on this derivation is probably also gonna want
# pygments to be available.
propagatedBuildInputs = with pythonPkgs; [pygments];
};
pythonEnv = python.withPackages (p: [p.pygments pygments-style-github]);
commonAttrs = {
nativeBuildInputs = [texliveEnv pythonEnv pkgs.which];
nativeBuildInputs = [
texliveEnv
(
pkgs.python3.withPackages (p: [p.pygments p.pygments-style-github])
)
pkgs.which
];
};
mkLatex = variant: edition: let
@ -149,16 +130,16 @@
if variant == null
then "reader"
else variant;
suffix = maybeVariant + maybeEdition;
basename = "ctfp-${variantStr}${maybeEdition}";
version = self.shortRev or self.lastModifiedDate;
suffix = maybeVariant + maybeEdition;
fullname = "ctfp${suffix}";
in
pkgs.stdenv.mkDerivation (commonAttrs
pkgs.stdenvNoCC.mkDerivation (commonAttrs
// {
inherit basename version;
name = basename;
name = "ctfp${suffix}";
fullname = "ctfp${suffix}";
src = "${self}/src";
configurePhase = ''
@ -166,13 +147,15 @@
'';
buildPhase = ''
latexmk -file-line-error -shell-escape -logfilewarninglist -interaction=nonstopmode -halt-on-error \
-norc -jobname=ctfp -pdflatex="xelatex %O %S" -pdfxe "$basename.tex"
latexmk -file-line-error -shell-escape -logfilewarninglist \
-interaction=nonstopmode -halt-on-error -norc \
-jobname=ctfp -pdflatex="xelatex %O %S" -pdfxe \
"$basename.tex"
'';
installPhase = "install -m 0644 -vD ctfp.pdf \"$out/$fullname.pdf\"";
passthru.packageName = "ctfp${suffix}";
passthru.packageName = fullname;
});
editions = [null "scala" "ocaml" "reason"];