maple-mono: 6.4 -> 7.0 (#390400)
This commit is contained in:
@@ -6,18 +6,21 @@
|
||||
}:
|
||||
|
||||
let
|
||||
|
||||
hashes = lib.importJSON ./hashes.json;
|
||||
|
||||
maple-font =
|
||||
{
|
||||
pname,
|
||||
sha256,
|
||||
hash,
|
||||
desc,
|
||||
}:
|
||||
stdenv.mkDerivation rec {
|
||||
inherit pname;
|
||||
version = "6.4";
|
||||
version = "7.0";
|
||||
src = fetchurl {
|
||||
url = "https://github.com/subframe7536/Maple-font/releases/download/v${version}/${pname}.zip";
|
||||
inherit sha256;
|
||||
inherit hash;
|
||||
};
|
||||
|
||||
# Work around the "unpacker appears to have produced no directories"
|
||||
@@ -41,41 +44,105 @@ let
|
||||
};
|
||||
};
|
||||
|
||||
typeVariants = {
|
||||
truetype = {
|
||||
suffix = "TTF";
|
||||
desc = "monospace TrueType";
|
||||
};
|
||||
|
||||
truetype-autohint = {
|
||||
suffix = "TTF-AutoHint";
|
||||
desc = "monospace ttf autohint";
|
||||
};
|
||||
|
||||
variable = {
|
||||
suffix = "Variable";
|
||||
desc = "monospace variable";
|
||||
};
|
||||
|
||||
woff2 = {
|
||||
suffix = "Woff2";
|
||||
desc = "WOFF2.0";
|
||||
};
|
||||
|
||||
opentype = {
|
||||
suffix = "OTF";
|
||||
desc = "OpenType";
|
||||
};
|
||||
|
||||
NF = {
|
||||
suffix = "NF";
|
||||
desc = "Nerd Font";
|
||||
};
|
||||
|
||||
NF-unhinted = {
|
||||
suffix = "NF-unhinted";
|
||||
desc = "Nerd Font unhinted";
|
||||
};
|
||||
|
||||
CN = {
|
||||
suffix = "CN";
|
||||
desc = "monospace CN";
|
||||
};
|
||||
|
||||
CN-unhinted = {
|
||||
suffix = "CN-unhinted";
|
||||
desc = "monospace CN unhinted";
|
||||
};
|
||||
|
||||
NF-CN = {
|
||||
suffix = "NF-CN";
|
||||
desc = "Nerd Font CN";
|
||||
};
|
||||
|
||||
NF-CN-unhinted = {
|
||||
suffix = "NF-CN-unhinted";
|
||||
desc = "Nerd Font CN unhinted";
|
||||
};
|
||||
};
|
||||
|
||||
ligatureVariants = {
|
||||
No-Ligature = {
|
||||
suffix = "NL";
|
||||
desc = "No Ligature";
|
||||
};
|
||||
Normal-Ligature = {
|
||||
suffix = "Normal";
|
||||
desc = "Normal Ligature";
|
||||
};
|
||||
Normal-No-Ligature = {
|
||||
suffix = "NormalNL";
|
||||
desc = "Normal No Ligature";
|
||||
};
|
||||
};
|
||||
|
||||
combinedFonts =
|
||||
lib.concatMapAttrs (
|
||||
ligName: ligVariant:
|
||||
lib.concatMapAttrs (
|
||||
typeName: typeVariant:
|
||||
let
|
||||
pname = "MapleMono${ligVariant.suffix}-${typeVariant.suffix}";
|
||||
in
|
||||
{
|
||||
"${ligVariant.suffix}-${typeVariant.suffix}" = maple-font {
|
||||
inherit pname;
|
||||
desc = "${ligVariant.desc} ${typeVariant.desc}";
|
||||
hash = hashes.${pname};
|
||||
};
|
||||
}
|
||||
) typeVariants
|
||||
) ligatureVariants
|
||||
// lib.mapAttrs (
|
||||
_: value:
|
||||
let
|
||||
pname = "MapleMono-${value.suffix}";
|
||||
in
|
||||
maple-font {
|
||||
inherit pname;
|
||||
inherit (value) desc;
|
||||
hash = hashes.${pname};
|
||||
}
|
||||
) typeVariants;
|
||||
in
|
||||
{
|
||||
Mono = maple-font {
|
||||
pname = "MapleMono-ttf";
|
||||
sha256 = "sha256-a06JLIP5aVb9SeEz6kw+LqKy0ydCgaUlPDFWA2Y0G8Q=";
|
||||
desc = "monospace TrueType";
|
||||
};
|
||||
|
||||
NF = maple-font {
|
||||
pname = "MapleMono-NF";
|
||||
sha256 = "sha256-fy+hdUYZDW5nkMVirhkmys3tIkWezPDrlpNxnRMl4WU=";
|
||||
desc = "Nerd Font";
|
||||
};
|
||||
|
||||
SC-NF = maple-font {
|
||||
pname = "MapleMono-SC-NF";
|
||||
sha256 = "sha256-SbXWkrpLJUrq+Jt1h3GBP9md5TbYpPchdiR0oEDMAgY=";
|
||||
desc = "Nerd Font SC";
|
||||
};
|
||||
|
||||
opentype = maple-font {
|
||||
pname = "MapleMono-otf";
|
||||
sha256 = "sha256-fwfFlNbaWXFCjcno7NK3dZqAzsHLh9rdGkSq26xc9qw=";
|
||||
desc = "OpenType";
|
||||
};
|
||||
|
||||
woff2 = maple-font {
|
||||
pname = "MapleMono-woff2";
|
||||
sha256 = "sha256-4akpZGGth4yZjI5wjO3ZXrXcWNxb7/6YChU7T5fNVKs=";
|
||||
desc = "WOFF2.0";
|
||||
};
|
||||
|
||||
autohint = maple-font {
|
||||
pname = "MapleMono-ttf-autohint";
|
||||
sha256 = "sha256-rSYIC42Bt+KFgxhwRhXS4sbh4etKYkCOo5nP2J2BHt4=";
|
||||
desc = "ttf autohint";
|
||||
};
|
||||
}
|
||||
combinedFonts
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
{
|
||||
"MapleMono-CN-unhinted": "sha256-L2EasFES9EYmNtOs/CKwqqQNzkxAZgoBT8qN1dWipBc=",
|
||||
"MapleMono-CN": "sha256-vQkZD1wa/pzAZR8b9krfApGCUS+ARkZNvhqJ/ZGpnLs=",
|
||||
"MapleMono-NF-CN-unhinted": "sha256-x7ZnObDkGMR4nPpMbBfRfE6M4o19rZgApQeG69P6TZg=",
|
||||
"MapleMono-NF-CN": "sha256-IUBHSBIW//vWwlumefFW48eSULJmY9e8F9Ymhbt/KU0=",
|
||||
"MapleMono-NF-unhinted": "sha256-5P42BHDnIv4ZN4rDtEWFCWEc+NfPd0qHT2VOW2Jhn+Q=",
|
||||
"MapleMono-NF": "sha256-HgZkIrEV5zmRhBvAI4/uT+nfUhDaD0H81upTXfJNhaA=",
|
||||
"MapleMono-OTF": "sha256-4zPKejWZS52bhw0FLJX69kMr8kbv6P5l5cQ8orYcT5o=",
|
||||
"MapleMono-TTF-AutoHint": "sha256-Xa7cSDXKby0UILmxj96xbD6ZhDDwBee9lymOx7FPmoE=",
|
||||
"MapleMono-TTF": "sha256-FglonkbnphiwmxGj7Z0ozfHMwpJj7+96g6WMtMe3rIo=",
|
||||
"MapleMono-Variable": "sha256-EILfODQ8DJiyTwgmTogwcNlz+YBIdmlk/mnfFZ4Eme8=",
|
||||
"MapleMono-Woff2": "sha256-S7lWI+Xr7LxdFvjnngktx5uaixEVlxdLUDKMmFlARCk=",
|
||||
"MapleMonoNL-CN-unhinted": "sha256-0wKF/0hUj45aApnHbp0jQqPtw8YcIsvE88HFob0U8n0=",
|
||||
"MapleMonoNL-CN": "sha256-JUCHV2TkDTFxpZXibLq8/ENyn7KER5AqT5Yx4tK6eW8=",
|
||||
"MapleMonoNL-NF-CN-unhinted": "sha256-t7pOo8YsewYR31AB2J4BIZU+JW3Qp770Esbpy38Y2Ts=",
|
||||
"MapleMonoNL-NF-CN": "sha256-S9a8qXpebYMmJmSr+JG945GYuucQC5bbURf3h0jwH40=",
|
||||
"MapleMonoNL-NF-unhinted": "sha256-j2M6kLSALRzdOl8vyMsX+4wvGVcVDYvlYRLuX1XYhic=",
|
||||
"MapleMonoNL-NF": "sha256-k+FsBxlZheaAzJFdpdKtr4NUTnSue6GNgNa/U5B6dPI=",
|
||||
"MapleMonoNL-OTF": "sha256-TV+6rZ3MNabt+1n33UeElP2zcGktYIYOos3dF4XlQaM=",
|
||||
"MapleMonoNL-TTF-AutoHint": "sha256-VD4d0BdUzRiAUao9sGJKIeLkD3AAuhfJoIdrvdJPP0s=",
|
||||
"MapleMonoNL-TTF": "sha256-bbJxcIYarftrinBO9rLAqUz3jLoWzkcZ+qZCmLeko8U=",
|
||||
"MapleMonoNL-Variable": "sha256-+6WgaUddD2LSYsaVajpYNw+ypuQI27stjc6hPnQtHrw=",
|
||||
"MapleMonoNL-Woff2": "sha256-bbMqjLHRI0aMTa7pxMvRU2RsiE97e3pavkJuMfVXctA=",
|
||||
"MapleMonoNormal-CN-unhinted": "sha256-Ew/7KwKPWluFtYRDD/0hg26tQCVKYCIUTNqClYndVfI=",
|
||||
"MapleMonoNormal-CN": "sha256-ODTWB+9nTMmgEaqlv1/Fq4GABh45CLTA0HKWHM9G9Aw=",
|
||||
"MapleMonoNormal-NF-CN-unhinted": "sha256-vOlFwb0a97ydJPR7YeEJqnmTjK9pKE2O6szGGQJHShQ=",
|
||||
"MapleMonoNormal-NF-CN": "sha256-5Jk/Fqd7pMuDghhaFvIegPJqK21iMJuN/nJt9y5hebc=",
|
||||
"MapleMonoNormal-NF-unhinted": "sha256-9FhbDhBnGEFwX2YE2GEeyteIWA5z3b4VJwURTWsWf3k=",
|
||||
"MapleMonoNormal-NF": "sha256-SMntZ0XVRsdLocSd9BsN3/ORmkUi8XgTSicULqEG0po=",
|
||||
"MapleMonoNormal-OTF": "sha256-flHGOMuURNehlLw0JzbIPNLXNb7B7g8YXl8PoN/Wqt0=",
|
||||
"MapleMonoNormal-TTF-AutoHint": "sha256-/giwB5H0FQ8NTYViqz81Bed+uWuOL9ipH+CKS1p34vU=",
|
||||
"MapleMonoNormal-TTF": "sha256-vL6fRwEP2GSORBrOGvEgSA+fxjrZyYmpbNeuIMpVvYM=",
|
||||
"MapleMonoNormal-Variable": "sha256-S/76i2fj1e+KAxQlAjngGDmOMx8t6Y7Zn8487zJJJXw=",
|
||||
"MapleMonoNormal-Woff2": "sha256-gsyUKyibV5q0llNi0Inwqk/ZOEEF+pH1ZCf9sMadkc8=",
|
||||
"MapleMonoNormalNL-CN-unhinted": "sha256-ht/MwZcc2RvEzZ1mpqCMkfU6J6OD8F4V4lMlrsuo1/E=",
|
||||
"MapleMonoNormalNL-CN": "sha256-pGxsKUFSO5hzOPWW0rgYG8fpgunmPkswnZ8a+C5A+TM=",
|
||||
"MapleMonoNormalNL-NF-CN-unhinted": "sha256-N+JSUc8reu2Sile2ivHu325zzg7MFKJBzbggUg4orZA=",
|
||||
"MapleMonoNormalNL-NF-CN": "sha256-li/xPAHJIFtWDEK1TttQuOjZ7OJqXk+dncHFpwsh3FY=",
|
||||
"MapleMonoNormalNL-NF-unhinted": "sha256-xBRiZaXswGy+DcT3h2m8nCxZBjLgq/5eX6ST4496hw0=",
|
||||
"MapleMonoNormalNL-NF": "sha256-j8Li+I/NgdNSwTAY31YbBJFTc2IXffyqQnv/KVfBeMU=",
|
||||
"MapleMonoNormalNL-OTF": "sha256-+exfPalJXhHScVArcdwLVde5JhxPAyxyebQAE2yBkos=",
|
||||
"MapleMonoNormalNL-TTF-AutoHint": "sha256-Cdo0FhIIp7c+OIlz7D66G8xsBk0JaNq9vn6GugUJiZM=",
|
||||
"MapleMonoNormalNL-TTF": "sha256-xbp1ZhbYysHHOKkoUyu0Tv76/jDqCbo2U6fzHiFPt50=",
|
||||
"MapleMonoNormalNL-Variable": "sha256-mQdYcLT/30kJjPGm4j2pZXrJ8EuiY7M/gsQuI+i1Y3A=",
|
||||
"MapleMonoNormalNL-Woff2": "sha256-WQp+/sKQg/QHYeeFP5k9IPPcQJKGULlmCyrAOUOvfmk="
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
import re
|
||||
import json
|
||||
import base64
|
||||
import argparse
|
||||
import requests
|
||||
from urllib.parse import urlparse
|
||||
|
||||
def process_github_release(url, token=None):
|
||||
parsed = urlparse(url)
|
||||
path_parts = parsed.path.strip('/').split('/')
|
||||
if len(path_parts) < 5 or parsed.netloc != 'github.com':
|
||||
raise ValueError("Invalid GitHub release URL format")
|
||||
owner, repo, _, _, tag = path_parts[:5]
|
||||
headers = {"Accept": "application/vnd.github.v3+json"}
|
||||
if token:
|
||||
headers["Authorization"] = f"Bearer {token}"
|
||||
response = requests.get(
|
||||
f"https://api.github.com/repos/{owner}/{repo}/releases/tags/{tag}",
|
||||
headers=headers
|
||||
)
|
||||
if response.status_code != 200:
|
||||
raise RuntimeError(f"Failed to fetch release info: {response.status_code} ({response.json().get('message')})")
|
||||
release_data = response.json()
|
||||
assets = release_data.get('assets', [])
|
||||
result = {}
|
||||
sha256_pattern = re.compile(r"^[a-fA-F0-9]{64}$")
|
||||
for asset in assets:
|
||||
if not asset['name'].endswith('.sha256'):
|
||||
continue
|
||||
download_url = asset['browser_download_url']
|
||||
content_response = requests.get(download_url, headers=headers)
|
||||
if content_response.status_code != 200:
|
||||
raise RuntimeError(
|
||||
f"Failed to download {asset['name']}: "
|
||||
f"{content_response.status_code} {content_response.text}"
|
||||
)
|
||||
hex_hash = content_response.text.strip()
|
||||
if not sha256_pattern.match(hex_hash):
|
||||
raise ValueError(f"Invalid SHA256 format in {asset['name']}")
|
||||
try:
|
||||
byte_data = bytes.fromhex(hex_hash)
|
||||
base64_hash = base64.b64encode(byte_data).decode('utf-8')
|
||||
except Exception as e:
|
||||
raise RuntimeError(f"Error processing {asset['name']}: {str(e)}")
|
||||
filename = asset['name'][:-7]
|
||||
result[filename] = f"sha256-{base64_hash}"
|
||||
output_file = f"{repo}_{tag}_hashes.json"
|
||||
with open(output_file, 'w', encoding='utf-8') as f:
|
||||
json.dump(result, f, indent=2, ensure_ascii=False)
|
||||
print(f"Successfully generated {output_file}")
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser(description='Process GitHub release hashes')
|
||||
parser.add_argument('url', help='GitHub release URL')
|
||||
parser.add_argument('-t', '--token', help='GitHub API token (optional)')
|
||||
args = parser.parse_args()
|
||||
try:
|
||||
process_github_release(args.url, args.token)
|
||||
except Exception as e:
|
||||
print(f"Error: {str(e)}")
|
||||
sys.exit(1)
|
||||
@@ -940,6 +940,33 @@ mapAliases {
|
||||
maligned = throw "maligned was deprecated upstream in favor of x/tools/go/analysis/passes/fieldalignment"; # Added 20204-08-24
|
||||
manicode = throw "manicode has been renamed to codebuff"; # Added 2024-12-10
|
||||
manta = throw "manta does not support python3, and development has been abandoned upstream"; # Added 2025-03-17
|
||||
|
||||
maple-mono-NF = throw ''
|
||||
maple-mono-NF had been moved to maple-mono.NF.
|
||||
for installing all maple-mono:
|
||||
fonts.packages = [ ... ] ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.maple-mono)
|
||||
'';
|
||||
maple-mono-otf = throw ''
|
||||
maple-mono-otf had been moved to maple-mono.opentype.
|
||||
for installing all maple-mono:
|
||||
fonts.packages = [ ... ] ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.maple-mono)
|
||||
'';
|
||||
maple-mono-woff2 = throw ''
|
||||
maple-mono-woff2 had been moved to maple-mono.woff2.
|
||||
for installing all maple-mono:
|
||||
fonts.packages = [ ... ] ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.maple-mono)
|
||||
'';
|
||||
maple-mono-SC-NF = throw ''
|
||||
mono-SC-NF had been superseded by maple-mono.NF-CN.
|
||||
for installing all maple-mono:
|
||||
fonts.packages = [ ... ] ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.maple-mono)
|
||||
'';
|
||||
maple-mono-autohint = throw ''
|
||||
maple-mono-autohint had been moved to maple-mono.truetype-autohint.
|
||||
for installing all maple-mono:
|
||||
fonts.packages = [ ... ] ++ builtins.filter lib.attrsets.isDerivation (builtins.attrValues pkgs.maple-mono)
|
||||
'';
|
||||
|
||||
marwaita-manjaro = lib.warnOnInstantiate "marwaita-manjaro has been renamed to marwaita-teal" marwaita-teal; # Added 2024-07-08
|
||||
marwaita-peppermint = lib.warnOnInstantiate "marwaita-peppermint has been renamed to marwaita-red" marwaita-red; # Added 2024-07-01
|
||||
marwaita-ubuntu = lib.warnOnInstantiate "marwaita-ubuntu has been renamed to marwaita-orange" marwaita-orange; # Added 2024-07-08
|
||||
|
||||
@@ -2418,13 +2418,6 @@ with pkgs;
|
||||
|
||||
maliit-keyboard = libsForQt5.callPackage ../applications/misc/maliit-keyboard { };
|
||||
|
||||
maple-mono = (callPackage ../data/fonts/maple-font { }).Mono;
|
||||
maple-mono-NF = (callPackage ../data/fonts/maple-font { }).NF;
|
||||
maple-mono-SC-NF = (callPackage ../data/fonts/maple-font { }).SC-NF;
|
||||
maple-mono-otf = (callPackage ../data/fonts/maple-font { }).opentype;
|
||||
maple-mono-woff2 = (callPackage ../data/fonts/maple-font { }).woff2;
|
||||
maple-mono-autohint = (callPackage ../data/fonts/maple-font { }).autohint;
|
||||
|
||||
mat2 = with python3.pkgs; toPythonApplication mat2;
|
||||
|
||||
materialx = with python3Packages; toPythonApplication materialx;
|
||||
@@ -4215,6 +4208,8 @@ with pkgs;
|
||||
|
||||
nerd-fonts = recurseIntoAttrs (callPackage ../data/fonts/nerd-fonts { });
|
||||
|
||||
maple-mono = recurseIntoAttrs (callPackage ../data/fonts/maple-font { });
|
||||
|
||||
netcdf-mpi = netcdf.override {
|
||||
hdf5 = hdf5-mpi.override { usev110Api = true; };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user