iosevka: use buildNpmPackage

This commit is contained in:
lunik1 2023-01-29 22:32:50 +00:00
parent bea4062a62
commit 0bc340117a
No known key found for this signature in database
GPG Key ID: 6A37DF9483188492
5 changed files with 19 additions and 2769 deletions

View File

@ -1,4 +1,10 @@
{ stdenv, lib, pkgs, fetchFromGitHub, nodejs, remarshal
{ stdenv
, lib
, pkgs
, buildNpmPackage
, fetchFromGitHub
, nodejs
, remarshal
, ttfautohint-nox
# Custom font set options.
# See https://typeof.net/Iosevka/customizer
@ -47,36 +53,20 @@
assert (privateBuildPlan != null) -> set != null;
assert (extraParameters != null) -> set != null;
let
# We don't know the attribute name for the Iosevka package as it
# changes not when our update script is run (which in turn updates
# node-packages.json, but when node-packages/generate.sh is run
# (which updates node-packages.nix).
#
# Doing it this way ensures that the package can always be built,
# although possibly an older version than ioseva-bin.
nodeIosevka = (import ./node-composition.nix {
inherit pkgs nodejs;
inherit (stdenv.hostPlatform) system;
}).package.override {
src = fetchFromGitHub {
owner = "be5invis";
repo = "Iosevka";
rev = "v15.6.3";
hash = "sha256-wsFx5sD1CjQTcmwpLSt97OYFI8GtVH54uvKQLU1fWTg=";
};
buildNpmPackage rec {
pname = if set != null then "iosevka-${set}" else "iosevka";
version = "17.1.0";
src = fetchFromGitHub {
owner = "be5invis";
repo = "iosevka";
rev = "v${version}";
hash = "sha256-xGRymDhkNP9b2JYTEu4M/CrRINmMGY2S5ZuM3Ot1wGg=";
};
in
stdenv.mkDerivation rec {
pname = if set != null then "iosevka-${set}" else "iosevka";
inherit (nodeIosevka) version src;
npmDepsHash = "sha256-Ncf07ggyOnz/2SpgdmaYS2X/8Bad+J2sz8Yyx9Iri3E=";
nativeBuildInputs = [
nodejs
remarshal
ttfautohint-nox
];
nativeBuildInputs = [ nodejs remarshal ttfautohint-nox ];
buildPlan =
if builtins.isAttrs privateBuildPlan
@ -105,7 +95,6 @@ stdenv.mkDerivation rec {
echo -e "\n" >> params/parameters.toml
cat "$extraParametersPath" >> params/parameters.toml
''}
ln -s ${nodeIosevka}/lib/node_modules/iosevka/node_modules .
runHook postConfigure
'';
@ -126,10 +115,6 @@ stdenv.mkDerivation rec {
enableParallelBuilding = true;
passthru = {
updateScript = ./update-default.sh;
};
meta = with lib; {
homepage = "https://be5invis.github.io/Iosevka";
downloadPage = "https://github.com/be5invis/Iosevka/releases";
@ -146,6 +131,7 @@ stdenv.mkDerivation rec {
babariviere
rileyinman
AluisioASG
lunik1
];
};
}

View File

@ -1,17 +0,0 @@
# This file has been generated by node2nix 1.11.1. Do not edit!
{pkgs ? import <nixpkgs> {
inherit system;
}, system ? builtins.currentSystem, nodejs ? pkgs."nodejs-16_x"}:
let
nodeEnv = import ../../../development/node-packages/node-env.nix {
inherit (pkgs) stdenv lib python2 runCommand writeTextFile writeShellScript;
inherit pkgs nodejs;
libtool = if pkgs.stdenv.isDarwin then pkgs.darwin.cctools else null;
};
in
import ./node-packages.nix {
inherit (pkgs) fetchurl nix-gitignore stdenv lib fetchgit;
inherit nodeEnv;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,21 +0,0 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts coreutils gawk replace
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
nixpkgs=../../../..
repo=https://github.com/be5invis/Iosevka
# Discover the latest version.
current_version=$(nix-instantiate "$nixpkgs" --eval --strict -A iosevka.version | tr -d '"')
new_version=$(list-git-tags --url="$repo" | sort --reverse --version-sort | awk 'match($0, /^v([0-9.]+)$/, m) { print m[1]; exit; }')
if [[ "$new_version" == "$current_version" ]]; then
echo "iosevka: no update found"
exit
fi
# Update the source package in nodePackages.
current_source="$repo/archive/v$current_version.tar.gz"
new_source="$repo/archive/v$new_version.tar.gz"
replace-literal -ef "$current_source" "$new_source" ../../../development/node-packages/node-packages.json
echo "iosevka: $current_version -> $new_version (after nodePackages update)"

View File

@ -183,7 +183,6 @@
, "insect"
, "intelephense"
, "ionic"
, {"iosevka": "https://github.com/be5invis/Iosevka/archive/v15.6.3.tar.gz"}
, "jake"
, "javascript-typescript-langserver"
, "joplin"