mirror of
https://github.com/slavfox/Cozette.git
synced 2026-03-11 08:54:33 +00:00
Update flake to use bitsnpicas from nixpkgs
Bits'N'Picas is available since nixpkgs 25.11:
29ed443f2c
Flake lock file updates:
• Updated input 'nixpkgs':
'github:nixos/nixpkgs/bf3287dac860542719fe7554e21e686108716879?narHash=sha256-kwaaguGkAqTZ1oK0yXeQ3ayYjs8u/W7eEfrFpFfIDFA%3D' (2025-05-02)
→ 'github:nixos/nixpkgs/c6f52ebd45e5925c188d1a20119978aa4ffd5ef6?narHash=sha256-m5KWt1nOm76ILk/JSCxBM4MfK3rYY7Wq9/TZIIeGnT8%3D' (2025-12-15)
This commit is contained in:
parent
d2282e728a
commit
8c6ab0e2d5
2 changed files with 27 additions and 49 deletions
|
|
@ -20,16 +20,16 @@
|
|||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1746183838,
|
||||
"narHash": "sha256-kwaaguGkAqTZ1oK0yXeQ3ayYjs8u/W7eEfrFpFfIDFA=",
|
||||
"lastModified": 1765838191,
|
||||
"narHash": "sha256-m5KWt1nOm76ILk/JSCxBM4MfK3rYY7Wq9/TZIIeGnT8=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "bf3287dac860542719fe7554e21e686108716879",
|
||||
"rev": "c6f52ebd45e5925c188d1a20119978aa4ffd5ef6",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
"owner": "nixos",
|
||||
"ref": "nixos-24.11",
|
||||
"ref": "nixos-25.11",
|
||||
"repo": "nixpkgs",
|
||||
"type": "github"
|
||||
}
|
||||
|
|
|
|||
68
flake.nix
68
flake.nix
|
|
@ -1,18 +1,24 @@
|
|||
{
|
||||
description = "A bitmap programming font optimized for coziness";
|
||||
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
|
||||
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
|
||||
inputs.flake-utils.url = "github:numtide/flake-utils";
|
||||
|
||||
outputs = { self, nixpkgs, flake-utils }:
|
||||
flake-utils.lib.eachDefaultSystem (system:
|
||||
let pkgs = nixpkgs.legacyPackages.${system};
|
||||
in {
|
||||
outputs =
|
||||
{
|
||||
self,
|
||||
nixpkgs,
|
||||
flake-utils,
|
||||
}:
|
||||
flake-utils.lib.eachDefaultSystem (
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
in
|
||||
{
|
||||
devShells = {
|
||||
default = pkgs.mkShellNoCC {
|
||||
packages = with pkgs; [
|
||||
# BitsNPicas GUI wrapped with java
|
||||
self.packages.${system}.bitsnpicas-bin
|
||||
# FontForge GUI
|
||||
fontforge-gtk
|
||||
# Python tools
|
||||
|
|
@ -24,35 +30,6 @@
|
|||
};
|
||||
};
|
||||
packages = rec {
|
||||
# BitsNPicas needs to be fetched here since `nix build` is sandboxed
|
||||
# and does not have internet access
|
||||
bitsnpicas = pkgs.stdenvNoCC.mkDerivation rec {
|
||||
pname = "bitsnpicas";
|
||||
version = "2.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "kreativekorp";
|
||||
repo = "bitsnpicas";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-hw7UuzesqpmnTjgpfikAIYyY70ni7BxjaUtHAPEdkXI=";
|
||||
};
|
||||
buildInputs = [ pkgs.zulu23 pkgs.zip ];
|
||||
buildPhase = ''
|
||||
cd main/java/BitsNPicas
|
||||
make
|
||||
'';
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
cp BitsNPicas.jar $out
|
||||
cp KeyEdit.jar $out
|
||||
cp MapEdit.jar $out
|
||||
'';
|
||||
};
|
||||
|
||||
# Shell script to run the BitsNPicas GUI
|
||||
bitsnpicas-bin = pkgs.writeShellScriptBin "bitsnpicas" ''
|
||||
${pkgs.zulu23}/bin/java -jar ${bitsnpicas}/BitsNPicas.jar $@
|
||||
'';
|
||||
|
||||
# Derivation to build and install cozette
|
||||
cozette = pkgs.stdenvNoCC.mkDerivation {
|
||||
pname = "cozette";
|
||||
|
|
@ -61,8 +38,8 @@
|
|||
src = ./.;
|
||||
|
||||
buildInputs = with pkgs; [
|
||||
(pkgs.python312.withPackages (ppkgs:
|
||||
with ppkgs; [
|
||||
(pkgs.python312.withPackages (
|
||||
ppkgs: with ppkgs; [
|
||||
numpy
|
||||
pillow
|
||||
fonttools
|
||||
|
|
@ -70,18 +47,18 @@
|
|||
gitpython
|
||||
setuptools
|
||||
pip
|
||||
]))
|
||||
]
|
||||
))
|
||||
fontforge
|
||||
zulu23
|
||||
bitsnpicas
|
||||
];
|
||||
|
||||
configurePhase = ''
|
||||
mkdir -p deps
|
||||
cp ${bitsnpicas}/BitsNPicas.jar deps/
|
||||
postPatch = ''
|
||||
substituteInPlace build.py --replace-fail \
|
||||
'bitsnpicas.sh' '${pkgs.lib.getExe pkgs.bitsnpicas}'
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
patchShebangs bitsnpicas.sh
|
||||
python3 build.py fonts
|
||||
'';
|
||||
|
||||
|
|
@ -102,5 +79,6 @@
|
|||
};
|
||||
default = cozette;
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue