audiveris
CI / Nix Flake Check (push) Successful in 53s
CI / Build Packages (default) (push) Successful in 50s
CI / Build Packages (example-b) (push) Successful in 45s
CI / Build Packages (example-a) (push) Successful in 46s
CI / Build Packages (pyzotero) (push) Successful in 55s
CI / Build Packages (pyzotero-cli) (push) Successful in 56s

This commit is contained in:
2026-06-14 21:22:36 +02:00
parent 7a33b2aa3e
commit dd986e9709
11 changed files with 260 additions and 87 deletions
+1
View File
@@ -6,6 +6,7 @@ A Nix flake exposing custom packages, a development shell, checks, and a nixpkgs
| Package | Version | Description |
|----------------|---------|--------------------------------------------------------------|
| `audiveris` | 5.10.2 | Open-source Optical Music Recognition (OMR) engine & editor |
| `example-a` | 0.1.0 | Example package A |
| `example-b` | 0.1.0 | Example package B |
| `pyzotero` | 1.6.11 | Python API client for the Zotero API |
+6 -8
View File
@@ -2,14 +2,12 @@
pkgs,
}:
pkgs.mkShell {
packages =
with pkgs;
[
nixfmt-rfc-style
nil
nix-tree
nix
];
packages = with pkgs; [
nixfmt-rfc-style
nil
nix-tree
nix
];
shellHook = ''
echo "Nix packages development environment"
+12 -1
View File
@@ -3,5 +3,16 @@ let
packages = import ../pkgs { pkgs = prev; };
in
{
inherit (packages) example-a example-b pyzotero pyzotero-cli khal-export org-zotero-export jls harper-ls eqc;
inherit (packages)
audiveris
example-a
example-b
pyzotero
pyzotero-cli
khal-export
org-zotero-export
jls
harper-ls
eqc
;
}
+134
View File
@@ -0,0 +1,134 @@
{
lib,
stdenv,
fetchurl,
dpkg,
unzip,
zip,
patchelf,
autoPatchelfHook,
makeWrapper,
alsa-lib,
freetype,
fontconfig,
libGL,
dejavu_fonts,
xorg,
}:
let
ccLib = stdenv.cc.cc.lib;
in
stdenv.mkDerivation rec {
pname = "audiveris";
version = "5.10.2";
src = fetchurl {
url = "https://github.com/Audiveris/audiveris/releases/download/${version}/Audiveris-${version}-ubuntu24.04-x86_64.deb";
hash = "sha256-ytufr8C+IocYwvvvLoAuBHhyQRUDmHFCUbAMUeMbUZg=";
};
# The .deb bundles its own JRE and the Tesseract/Leptonica native libs (via
# JavaCPP); we only supply the GUI/system runtime libs those binaries load.
nativeBuildInputs = [
dpkg
unzip
zip
patchelf
autoPatchelfHook
makeWrapper
];
buildInputs = [
ccLib
alsa-lib
freetype
fontconfig
libGL
dejavu_fonts
xorg.libX11
xorg.libXext
xorg.libXrender
xorg.libXtst
xorg.libXi
];
dontBuild = true;
unpackPhase = ''
runHook preUnpack
dpkg-deb -x $src .
runHook postUnpack
'';
installPhase = ''
runHook preInstall
mkdir -p $out/opt $out/bin
cp -r opt/audiveris $out/opt/
# Java AWT initializes its font subsystem (and fontconfig) even in batch
# mode, so ship a fontconfig file pointing at a bundled font. Without this,
# the JVM dies with "Fontconfig head is null".
mkdir -p $out/etc/fonts
cat > $out/etc/fonts/fonts.conf <<'CONF'
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<dir>@dejavu@/share/fonts/truetype</dir>
<dir>/usr/share/fonts</dir>
<cachedir>~/.cache/fontconfig</cachedir>
</fontconfig>
CONF
substituteInPlace $out/etc/fonts/fonts.conf \
--replace-fail "@dejavu@" "${dejavu_fonts}"
# The jpackage launcher derives its layout from its own path, so relocating
# /opt/audiveris -> $out/opt/audiveris needs no path rewriting. The bundled
# JRE dlopens libfontconfig/libfreetype at runtime (not a NEEDED dep), so we
# put the runtime libs on the loader path.
makeWrapper $out/opt/audiveris/bin/Audiveris $out/bin/audiveris \
--set FONTCONFIG_FILE "$out/etc/fonts/fonts.conf" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath buildInputs}"
# Desktop integration with relocated paths (source .desktop ships in the deb).
mkdir -p $out/share/applications $out/share/icons/hicolor/256x256/apps
cp $out/opt/audiveris/lib/Audiveris.png \
$out/share/icons/hicolor/256x256/apps/audiveris.png
substitute $out/opt/audiveris/lib/audiveris-Audiveris.desktop \
$out/share/applications/audiveris.desktop \
--replace-fail "/opt/audiveris/bin/Audiveris" "$out/bin/audiveris" \
--replace-fail "/opt/audiveris/lib/Audiveris.png" \
"$out/share/icons/hicolor/256x256/apps/audiveris.png"
runHook postInstall
'';
# Tesseract/Leptonica native libs are zipped inside JavaCPP platform jars and
# extracted by JavaCPP at runtime, so autoPatchelfHook cannot reach them. We
# pull them out, bake an RPATH to libstdc++/libgcc_s, and repack the jars.
postInstall = ''
repack_jar() {
local jar="$1"
local tmp
tmp="$(mktemp -d)"
( cd "$tmp" && unzip -o "$jar" >/dev/null )
find "$tmp" -name '*.so*' -type f -print0 \
| xargs -0 -r ${patchelf}/bin/patchelf --add-rpath ${ccLib}/lib 2>/dev/null || true
( cd "$tmp" && zip -r -X "$jar" . >/dev/null )
rm -rf "$tmp"
}
for j in \
$out/opt/audiveris/lib/app/tesseract-5.5.1-1.5.12-linux-x86_64.jar \
$out/opt/audiveris/lib/app/leptonica-1.85.0-1.5.12-linux-x86_64.jar; do
repack_jar "$j"
done
'';
meta = {
description = "Open-source Optical Music Recognition (OMR) engine and editor";
homepage = "https://github.com/Audiveris/audiveris";
license = lib.licenses.agpl3Only;
mainProgram = "audiveris";
platforms = [ "x86_64-linux" ];
};
}
+1
View File
@@ -3,6 +3,7 @@
}:
let
self = {
audiveris = pkgs.callPackage ./audiveris { };
dolos = pkgs.callPackage ./dolos { nodejs = pkgs.nodejs_22; };
eqc = pkgs.callPackage ./eqc { };
example-a = pkgs.callPackage ./example-a { };
+53 -53
View File
@@ -48,65 +48,65 @@ buildNpmPackage rec {
'';
preBuild = ''
cp -r ${tree-sitter-elixir} parsers/elixir
chmod -R u+w parsers/elixir
cp -r ${tree-sitter-elixir} parsers/elixir
chmod -R u+w parsers/elixir
cat > parsers/elixir/binding.gyp << 'GYPEOF'
{
"targets": [
cat > parsers/elixir/binding.gyp << 'GYPEOF'
{
"target_name": "tree_sitter_elixir_binding",
"dependencies": [
"<!(node -p \"require('node-addon-api').targets\"):node_addon_api_except",
],
"include_dirs": [
"src",
"src/tree_sitter",
],
"sources": [
"bindings/node/binding.cc",
"src/parser.c",
"src/scanner.c",
],
"cflags_c": ["-std=c11"],
"targets": [
{
"target_name": "tree_sitter_elixir_binding",
"dependencies": [
"<!(node -p \"require('node-addon-api').targets\"):node_addon_api_except",
],
"include_dirs": [
"src",
"src/tree_sitter",
],
"sources": [
"bindings/node/binding.cc",
"src/parser.c",
"src/scanner.c",
],
"cflags_c": ["-std=c11"],
}
]
}
]
}
GYPEOF
GYPEOF
cat > parsers/binding.gyp << 'GYPEOF'
{
"includes": [
"bash/binding.gyp",
"c/binding.gyp",
"cpp/binding.gyp",
"c_sharp/binding.gyp",
"elm/binding.gyp",
"elixir/binding.gyp",
"go/binding.gyp",
"groovy/binding.gyp",
"java/binding.gyp",
"javascript/binding.gyp",
"modelica/binding.gyp",
"ocaml/binding.gyp",
"php/binding.gyp",
"python/binding.gyp",
"r/binding.gyp",
"rust/binding.gyp",
"scala/binding.gyp",
"sql/binding.gyp",
"typescript/binding.gyp",
"verilog/binding.gyp"
]
}
GYPEOF
cat > parsers/binding.gyp << 'GYPEOF'
{
"includes": [
"bash/binding.gyp",
"c/binding.gyp",
"cpp/binding.gyp",
"c_sharp/binding.gyp",
"elm/binding.gyp",
"elixir/binding.gyp",
"go/binding.gyp",
"groovy/binding.gyp",
"java/binding.gyp",
"javascript/binding.gyp",
"modelica/binding.gyp",
"ocaml/binding.gyp",
"php/binding.gyp",
"python/binding.gyp",
"r/binding.gyp",
"rust/binding.gyp",
"scala/binding.gyp",
"sql/binding.gyp",
"typescript/binding.gyp",
"verilog/binding.gyp"
]
}
GYPEOF
sed -i '/^parsers.verilog/a \
parsers.elixir = require("./build/Release/tree_sitter_elixir_binding");\
parsers.elixir.nodeTypeInfo = require("./elixir/src/node-types.json");
' parsers/index.js
sed -i '/^parsers.verilog/a \
parsers.elixir = require("./build/Release/tree_sitter_elixir_binding");\
parsers.elixir.nodeTypeInfo = require("./elixir/src/node-types.json");
' parsers/index.js
npm run build -w parsers
npm run build -w parsers
'';
buildPhase = ''
+39 -10
View File
@@ -7,17 +7,46 @@
}:
let
versions = {
"28" = { eqcVersion = "1.48.3"; hash = "sha256-qWV8lsBGwCcrdgJdgpL2Blj3BU92NTfIFy3AkmkcR8o="; };
"27" = { eqcVersion = "1.48.3"; hash = "sha256-Y/JgElZkRtIP139/f+fmTESerMlFK3g++8lyNDLuBM8="; };
"26" = { eqcVersion = "1.48.1"; hash = "sha256-Acnm74iEEpdwYDJzFo0cBZd4DH9y9jXFtgKmodUHzBM="; };
"25" = { eqcVersion = "1.46.2"; hash = "sha256-oGclmRf15XpdO6J9CVIiC4rF9mq84r1C7nbvve4Qgrw="; };
"24" = { eqcVersion = "1.46.1"; hash = "sha256-crofH7OZ35Xs2JT9uONBO2YmCjTNaELkJ+dGfiGSM9c="; };
"23" = { eqcVersion = "1.45.1"; hash = "sha256-ifObOCNvQQniQFG9jf8FkMNYT2NhH6K12AX/D14rttY="; };
"22" = { eqcVersion = "1.45.1"; hash = "sha256-iIxI+UavRpbXWRcI6u50SX6PGzL5ZZ918rhLKyJFHqg="; };
"21" = { eqcVersion = "1.45.1"; hash = "sha256-k57376cDfStG72Jue6sDP830lTiIkCuPsSjf2kQ4="; };
"20" = { eqcVersion = "1.45.1"; hash = "sha256-Bi5nccILoJidDCHb7TK+Ha+YV2FRYZFiNVJ3WZFMCr0="; };
"28" = {
eqcVersion = "1.48.3";
hash = "sha256-qWV8lsBGwCcrdgJdgpL2Blj3BU92NTfIFy3AkmkcR8o=";
};
"27" = {
eqcVersion = "1.48.3";
hash = "sha256-Y/JgElZkRtIP139/f+fmTESerMlFK3g++8lyNDLuBM8=";
};
"26" = {
eqcVersion = "1.48.1";
hash = "sha256-Acnm74iEEpdwYDJzFo0cBZd4DH9y9jXFtgKmodUHzBM=";
};
"25" = {
eqcVersion = "1.46.2";
hash = "sha256-oGclmRf15XpdO6J9CVIiC4rF9mq84r1C7nbvve4Qgrw=";
};
"24" = {
eqcVersion = "1.46.1";
hash = "sha256-crofH7OZ35Xs2JT9uONBO2YmCjTNaELkJ+dGfiGSM9c=";
};
"23" = {
eqcVersion = "1.45.1";
hash = "sha256-ifObOCNvQQniQFG9jf8FkMNYT2NhH6K12AX/D14rttY=";
};
"22" = {
eqcVersion = "1.45.1";
hash = "sha256-iIxI+UavRpbXWRcI6u50SX6PGzL5ZZ918rhLKyJFHqg=";
};
"21" = {
eqcVersion = "1.45.1";
hash = "sha256-k57376cDfStG72Jue6sDP830lTiIkCuPsSjf2kQ4=";
};
"20" = {
eqcVersion = "1.45.1";
hash = "sha256-Bi5nccILoJidDCHb7TK+Ha+YV2FRYZFiNVJ3WZFMCr0=";
};
};
cfg = versions.${erlangVersion} or (throw "Unsupported Erlang/OTP version: ${erlangVersion}. Supported: ${builtins.concatStringsSep ", " (builtins.attrNames versions)}");
cfg =
versions.${erlangVersion}
or (throw "Unsupported Erlang/OTP version: ${erlangVersion}. Supported: ${builtins.concatStringsSep ", " (builtins.attrNames versions)}");
in
stdenv.mkDerivation {
name = "eqc";
-1
View File
@@ -1,4 +1,3 @@
{
lib,
stdenv,
-1
View File
@@ -1,4 +1,3 @@
{
lib,
stdenv,
+12 -12
View File
@@ -59,22 +59,22 @@ maven.buildMavenPackage rec {
];
in
''
runHook preInstall
runHook preInstall
mkdir -p $out/share/jls $out/bin
mkdir -p $out/share/jls $out/bin
cp dist/classpath/*.jar $out/share/jls/
cp dist/classpath/*.jar $out/share/jls/
cat > $out/bin/jls <<'WRAPPER'
#!/bin/sh
exec @java@ ${jvmFlags} -classpath "@classpath@" org.javacs.Main "$@"
WRAPPER
chmod +x $out/bin/jls
substituteInPlace $out/bin/jls \
--replace-fail "@java@" "${jdk}/bin/java" \
--replace-fail "@classpath@" "$out/share/jls/*"
cat > $out/bin/jls <<'WRAPPER'
#!/bin/sh
exec @java@ ${jvmFlags} -classpath "@classpath@" org.javacs.Main "$@"
WRAPPER
chmod +x $out/bin/jls
substituteInPlace $out/bin/jls \
--replace-fail "@java@" "${jdk}/bin/java" \
--replace-fail "@classpath@" "$out/share/jls/*"
runHook postInstall
runHook postInstall
'';
meta = {
+2 -1
View File
@@ -22,7 +22,8 @@ python3Packages.buildPythonApplication rec {
dependencies = [
pyzotero
] ++ (with python3Packages; [
]
++ (with python3Packages; [
click
pyyaml
tabulate