Hey Nix Community,
I am really new to Nix and NixOS and so far it is quite a ride.
Today (actually the last couple days) I tried to create a package for the proprietary
programm pianoteq by Modartt (https://www.modartt.com/). It took me quite a while to
figure stuff out but in the end it finally built. (Unfortunately, I only discovered NUR
and the package for pianoteq-stage after I was done with my package… Could’ve saved me
quite some time… https://github.com/nix-community/nur-combined/blob/b7417c71d6b8d4789b3b091c839cb0c64476c9f3/repos/suhr/pkgs/pianoteq-stage/default.nix)
I also checked PKGBUILD - aur.git - AUR Package Repositories for anything I might have forgotten.
Further, I found these two posts mentioning that pianoteq might work on their machine:
SOLVED: One audio plugin seems to be getting low priority
Pianoteq exits with "No display available" on Linux (NixOS) (Page 1) - Pianoteq user forum - Modartt user forum (Even with the same error)
The problem is, that when I try to run the patched executable the following message pops up:
No display available. Use the --headless option in order to run without a GUI.
My env shows DISPLAY=:0
so that should be set correctly.
My flake.nix which describes my derivation looks like this (Probably not optimal):
{
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }@inputs: {
defaultPackage.x86_64-linux =
with import nixpkgs { system = "x86_64-linux"; };
stdenv.mkDerivation rec {
pname = "pianoteq";
version = "7.5.4";
# Downloaded manually
src = ./pianoteq_linux_v754.7z;
nativeBuildInputs = [
autoPatchelfHook
p7zip
];
buildInputs = [
alsa-lib
freetype
xorg.libX11
xorg.libXext
stdenv.cc.cc.lib
libjack2
lv2
];
unpackCmd = "7z x ${src}";
installPhase = ''
install -Dm 755 x86-64bit/Pianoteq\ 7 $out/bin/pianoteq7
install -Dm 755 x86-64bit/Pianoteq\ 7.lv2/Pianoteq_7.so \
$out/lib/lv2/Pianoteq\ 7.lv2/Pianoteq_7.so
cd x86-64bit/Pianoteq\ 7.lv2/
for i in *.ttl; do
install -D "$i" "$out/lib/lv2/Pianoteq 7.lv2/$i"
done
'';
meta = {
homepage = "https://www.modartt.com/";
description = "Pianoteq is a virtual instrument which in contrast to other virtual instruments is physically modelled and thus can simulate the playability and complex behaviour of real acoustic instruments. Because there are no samples, the file size is just a tiny fraction of that required by other virtual instruments.";
platforms = lib.platforms.linux;
};
};
};
}
The build output seems fine and shows this:
pianoteq> unpacking sources
pianoteq> unpacking source archive /nix/store/43dcikdh9waqxzfx0hmmkq9bj9dbwbd0-pianoteq_linux_v754.7z
pianoteq> 7-Zip [64] 17.04 : Copyright (c) 1999-2021 Igor Pavlov : 2017-08-28
pianoteq> p7zip Version 17.04 (locale=C,Utf16=off,HugeFiles=on,64 bits,12 CPUs x64)
pianoteq> Scanning the drive for archives:
pianoteq> 1 file, 33120217 bytes (32 MiB)
pianoteq> Extracting archive: /nix/store/43dcikdh9waqxzfx0hmmkq9bj9dbwbd0-pianoteq_linux_v754.7z
pianoteq> --
pianoteq> Path = /nix/store/43dcikdh9waqxzfx0hmmkq9bj9dbwbd0-pianoteq_linux_v754.7z
pianoteq> Type = 7z
pianoteq> Physical Size = 33120217
pianoteq> Headers Size = 669
pianoteq> Method = LZMA:27
pianoteq> Solid = +
pianoteq> Blocks = 1
pianoteq> Everything is Ok
pianoteq> Folders: 11
pianoteq> Files: 24
pianoteq> Size: 231404515
pianoteq> Compressed: 33120217
pianoteq> source root is Pianoteq 7
pianoteq> setting SOURCE_DATE_EPOCH to timestamp 1644593263 of file Pianoteq
pianoteq> patching sources
pianoteq> configuring
pianoteq> no configure script, doing nothing
pianoteq> building
pianoteq> no Makefile, doing nothing
pianoteq> installing
pianoteq> beep
pianoteq> post-installation fixup
pianoteq> shrinking RPATHs of ELF executables and libraries in /nix/store/cjljwikrfnqkqpfrzn3lrmjrlnlk63q9-pianoteq-7.5.4
pianoteq> shrinking /nix/store/cjljwikrfnqkqpfrzn3lrmjrlnlk63q9-pianoteq-7.5.4/lib/lv2/Pianoteq 7.lv2/Pianoteq_7.so
pianoteq> shrinking /nix/store/cjljwikrfnqkqpfrzn3lrmjrlnlk63q9-pianoteq-7.5.4/bin/pianoteq7
pianoteq> strip is /nix/store/wsxm2bwsjai4nbsxxacdfabriiqsmdk1-binutils-wrapper-2.39/bin/strip
pianoteq> stripping (with command strip and flags -S) in /nix/store/cjljwikrfnqkqpfrzn3lrmjrlnlk63q9-pianoteq-7.5.4/lib /nix/store/cjljwikrfnqkqpfrzn3lrmjrlnlk63q9-pianoteq-7.5.4/bin
pianoteq> patching script interpreter paths in /nix/store/cjljwikrfnqkqpfrzn3lrmjrlnlk63q9-pianoteq-7.5.4
pianoteq> checking for references to /build/ in /nix/store/cjljwikrfnqkqpfrzn3lrmjrlnlk63q9-pianoteq-7.5.4...
pianoteq> automatically fixing dependencies for ELF files
pianoteq> {'ignore_missing': [],
pianoteq> 'libs': [PosixPath('/nix/store/sw5m94nrg6r643arrsl55ihyi19ldh54-auto-patchelf-hook/lib'),
pianoteq> PosixPath('/nix/store/wsxm2bwsjai4nbsxxacdfabriiqsmdk1-binutils-wrapper-2.39/lib'),
pianoteq> PosixPath('/nix/store/gyzc8qrz7l11b18519wafn0zc8y0pdss-p7zip-17.04/lib'),
pianoteq> PosixPath('/nix/store/0arxxg8ggpr3fc5i37hkfpsd7bya61c6-patchelf-0.15.0/lib'),
pianoteq> PosixPath('/nix/store/59jmzisg8fkm9c125fw384dqq1np602l-move-docs.sh/lib'),
pianoteq> PosixPath('/nix/store/kxw6q8v6isaqjm702d71n2421cxamq68-make-symlinks-relative.sh/lib'),
pianoteq> PosixPath('/nix/store/m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh/lib'),
pianoteq> PosixPath('/nix/store/g8xg0i02aqwhgxwd2vnp5ax3d6lrkg1v-strip.sh/lib'),
pianoteq> PosixPath('/nix/store/bnj8d7mvbkg3vdb07yz74yhl3g107qq5-patch-shebangs.sh/lib'),
pianoteq> PosixPath('/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh/lib'),
pianoteq> PosixPath('/nix/store/8zxndz5ag0p6s526c2xyllhk1nrn4c3i-audit-tmpdir.sh/lib'),
pianoteq> PosixPath('/nix/store/c8n9kcdddp9np665xz6ri61b383nxvz8-move-systemd-user-units.sh/lib'),
pianoteq> PosixPath('/nix/store/1i5y55x4b4m9qkx5dqbmr1r6bvrqbanw-multiple-outputs.sh/lib'),
pianoteq> PosixPath('/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh/lib'),
pianoteq> PosixPath('/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh/lib'),
pianoteq> PosixPath('/nix/store/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh/lib'),
pianoteq> PosixPath('/nix/store/wlwcf1nw2b21m4gghj70hbg1v7x53ld8-reproducible-builds.sh/lib'),
pianoteq> PosixPath('/nix/store/j061mvdxw70xz20r2r0lr5lk0rcsjf9i-gcc-wrapper-11.3.0/lib'),
pianoteq> PosixPath('/nix/store/hk75004j435l09ij4gawlkzg4wfs839w-binutils-wrapper-2.39/lib'),
pianoteq> PosixPath('/nix/store/xxlhlnhvmgq87q3rr7py91rmc07ip9vd-alsa-lib-1.2.7.2-dev/lib'),
pianoteq> PosixPath('/nix/store/ngnrwp3b4zc1jha4zpfcj6gknn1x27ml-alsa-lib-1.2.7.2/lib'),
pianoteq> PosixPath('/nix/store/vx31vg1dxs49gwf25lk4rna57kgyz7y9-freetype-2.12.1-dev/lib'),
pianoteq> PosixPath('/nix/store/ilr6sa1pzik3xdssrp6h92bb1mcisw2s-zlib-1.2.12-dev/lib'),
pianoteq> PosixPath('/nix/store/7pjbsjdpycjn62326663p1qi8d4jk92n-zlib-1.2.12/lib'),
pianoteq> PosixPath('/nix/store/icvgv2jkyfadm0y8ddvbdcdk7xhvhipn-bzip2-1.0.8-dev/lib'),
pianoteq> PosixPath('/nix/store/9q56fhpyx870wilk7358wn9pyzkyxw40-bzip2-1.0.8-bin/lib'),
pianoteq> PosixPath('/nix/store/lh7i8vfpqzs2if7yq8xg44r4qv8ypgfh-bzip2-1.0.8/lib'),
pianoteq> PosixPath('/nix/store/20rc37wjs1ahgawpv6yfc72nfxrklsxc-libpng-apng-1.6.37-dev/lib'),
pianoteq> PosixPath('/nix/store/wmv2k3736qdja8a0pkp9bfrj852r48hy-libpng-apng-1.6.37/lib'),
pianoteq> PosixPath('/nix/store/md56q0amhj1q9h4s9swx1g7y38lzr46a-freetype-2.12.1/lib'),
pianoteq> PosixPath('/nix/store/zv018d2541kyxdsy08vhvkk3gi3sgxin-libX11-1.8.1-dev/lib'),
pianoteq> PosixPath('/nix/store/f61zxzmq6dikmrzvj44ivd8wmk85s8i4-xorgproto-2021.5/lib'),
pianoteq> PosixPath('/nix/store/k73rnz4qh2v7xnz2cdhwpyy6s2h16cfk-libxcb-1.14-dev/lib'),
pianoteq> PosixPath('/nix/store/2wabjgmbhgir772732dbnrqaz5cww100-libxcb-1.14/lib'),
pianoteq> PosixPath('/nix/store/9ckz4x424lrsypkqfpfk432sa75yjsx7-libX11-1.8.1/lib'),
pianoteq> PosixPath('/nix/store/ay7nsa6l67lw2y45l4mmaxmji43fpd9p-libXext-1.3.4-dev/lib'),
pianoteq> PosixPath('/nix/store/gw394q0zg5wdksxphpm2swi8nagpzdl6-libXau-1.0.9-dev/lib'),
pianoteq> PosixPath('/nix/store/v611hwz7kszryv105wz9vdr34c2qj53n-libXau-1.0.9/lib'),
pianoteq> PosixPath('/nix/store/cjqp3wirsafkpwaxyc8b0k15l9rsp78r-libXext-1.3.4/lib'),
pianoteq> PosixPath('/nix/store/glnknyx742009d61mrg0dccd0nlhchsr-gcc-11.3.0-lib/lib'),
pianoteq> PosixPath('/nix/store/gh7i4277n8w8y5r1s7834h4slh4dwg1l-libjack2-1.9.19/lib'),
pianoteq> PosixPath('/nix/store/11v8i3qxqdrzrnf8nnh8d5wfbv3v4f8x-lv2-1.18.2-dev/lib'),
pianoteq> PosixPath('/nix/store/c1q71s349x227capdkpdv05fanx4wlk2-lv2-1.18.2/lib'),
pianoteq> PosixPath('/nix/store/sw5m94nrg6r643arrsl55ihyi19ldh54-auto-patchelf-hook/lib'),
pianoteq> PosixPath('/nix/store/wsxm2bwsjai4nbsxxacdfabriiqsmdk1-binutils-wrapper-2.39/lib'),
pianoteq> PosixPath('/nix/store/gyzc8qrz7l11b18519wafn0zc8y0pdss-p7zip-17.04/lib'),
pianoteq> PosixPath('/nix/store/0arxxg8ggpr3fc5i37hkfpsd7bya61c6-patchelf-0.15.0/lib'),
pianoteq> PosixPath('/nix/store/59jmzisg8fkm9c125fw384dqq1np602l-move-docs.sh/lib'),
pianoteq> PosixPath('/nix/store/kxw6q8v6isaqjm702d71n2421cxamq68-make-symlinks-relative.sh/lib'),
pianoteq> PosixPath('/nix/store/m54bmrhj6fqz8nds5zcj97w9s9bckc9v-compress-man-pages.sh/lib'),
pianoteq> PosixPath('/nix/store/g8xg0i02aqwhgxwd2vnp5ax3d6lrkg1v-strip.sh/lib'),
pianoteq> PosixPath('/nix/store/bnj8d7mvbkg3vdb07yz74yhl3g107qq5-patch-shebangs.sh/lib'),
pianoteq> PosixPath('/nix/store/cickvswrvann041nqxb0rxilc46svw1n-prune-libtool-files.sh/lib'),
pianoteq> PosixPath('/nix/store/8zxndz5ag0p6s526c2xyllhk1nrn4c3i-audit-tmpdir.sh/lib'),
pianoteq> PosixPath('/nix/store/c8n9kcdddp9np665xz6ri61b383nxvz8-move-systemd-user-units.sh/lib'),
pianoteq> PosixPath('/nix/store/1i5y55x4b4m9qkx5dqbmr1r6bvrqbanw-multiple-outputs.sh/lib'),
pianoteq> PosixPath('/nix/store/kd4xwxjpjxi71jkm6ka0np72if9rm3y0-move-sbin.sh/lib'),
pianoteq> PosixPath('/nix/store/fyaryjvghbkpfnsyw97hb3lyb37s1pd6-move-lib64.sh/lib'),
pianoteq> PosixPath('/nix/store/ngg1cv31c8c7bcm2n8ww4g06nq7s4zhm-set-source-date-epoch-to-latest.sh/lib'),
pianoteq> PosixPath('/nix/store/wlwcf1nw2b21m4gghj70hbg1v7x53ld8-reproducible-builds.sh/lib'),
pianoteq> PosixPath('/nix/store/j061mvdxw70xz20r2r0lr5lk0rcsjf9i-gcc-wrapper-11.3.0/lib'),
pianoteq> PosixPath('/nix/store/hk75004j435l09ij4gawlkzg4wfs839w-binutils-wrapper-2.39/lib'),
pianoteq> PosixPath('/nix/store/xxlhlnhvmgq87q3rr7py91rmc07ip9vd-alsa-lib-1.2.7.2-dev/lib'),
pianoteq> PosixPath('/nix/store/ngnrwp3b4zc1jha4zpfcj6gknn1x27ml-alsa-lib-1.2.7.2/lib'),
pianoteq> PosixPath('/nix/store/vx31vg1dxs49gwf25lk4rna57kgyz7y9-freetype-2.12.1-dev/lib'),
pianoteq> PosixPath('/nix/store/ilr6sa1pzik3xdssrp6h92bb1mcisw2s-zlib-1.2.12-dev/lib'),
pianoteq> PosixPath('/nix/store/7pjbsjdpycjn62326663p1qi8d4jk92n-zlib-1.2.12/lib'),
pianoteq> PosixPath('/nix/store/icvgv2jkyfadm0y8ddvbdcdk7xhvhipn-bzip2-1.0.8-dev/lib'),
pianoteq> PosixPath('/nix/store/9q56fhpyx870wilk7358wn9pyzkyxw40-bzip2-1.0.8-bin/lib'),
pianoteq> PosixPath('/nix/store/lh7i8vfpqzs2if7yq8xg44r4qv8ypgfh-bzip2-1.0.8/lib'),
pianoteq> PosixPath('/nix/store/20rc37wjs1ahgawpv6yfc72nfxrklsxc-libpng-apng-1.6.37-dev/lib'),
pianoteq> PosixPath('/nix/store/wmv2k3736qdja8a0pkp9bfrj852r48hy-libpng-apng-1.6.37/lib'),
pianoteq> PosixPath('/nix/store/md56q0amhj1q9h4s9swx1g7y38lzr46a-freetype-2.12.1/lib'),
pianoteq> PosixPath('/nix/store/zv018d2541kyxdsy08vhvkk3gi3sgxin-libX11-1.8.1-dev/lib'),
pianoteq> PosixPath('/nix/store/f61zxzmq6dikmrzvj44ivd8wmk85s8i4-xorgproto-2021.5/lib'),
pianoteq> PosixPath('/nix/store/k73rnz4qh2v7xnz2cdhwpyy6s2h16cfk-libxcb-1.14-dev/lib'),
pianoteq> PosixPath('/nix/store/2wabjgmbhgir772732dbnrqaz5cww100-libxcb-1.14/lib'),
pianoteq> PosixPath('/nix/store/9ckz4x424lrsypkqfpfk432sa75yjsx7-libX11-1.8.1/lib'),
pianoteq> PosixPath('/nix/store/ay7nsa6l67lw2y45l4mmaxmji43fpd9p-libXext-1.3.4-dev/lib'),
pianoteq> PosixPath('/nix/store/gw394q0zg5wdksxphpm2swi8nagpzdl6-libXau-1.0.9-dev/lib'),
pianoteq> PosixPath('/nix/store/v611hwz7kszryv105wz9vdr34c2qj53n-libXau-1.0.9/lib'),
pianoteq> PosixPath('/nix/store/cjqp3wirsafkpwaxyc8b0k15l9rsp78r-libXext-1.3.4/lib'),
pianoteq> PosixPath('/nix/store/glnknyx742009d61mrg0dccd0nlhchsr-gcc-11.3.0-lib/lib'),
pianoteq> PosixPath('/nix/store/gh7i4277n8w8y5r1s7834h4slh4dwg1l-libjack2-1.9.19/lib'),
pianoteq> PosixPath('/nix/store/11v8i3qxqdrzrnf8nnh8d5wfbv3v4f8x-lv2-1.18.2-dev/lib'),
pianoteq> PosixPath('/nix/store/c1q71s349x227capdkpdv05fanx4wlk2-lv2-1.18.2/lib')],
pianoteq> 'paths': [PosixPath('/nix/store/cjljwikrfnqkqpfrzn3lrmjrlnlk63q9-pianoteq-7.5.4')],
pianoteq> 'recursive': True,
pianoteq> 'runtime_dependencies': []}
pianoteq> searching for dependencies of /nix/store/cjljwikrfnqkqpfrzn3lrmjrlnlk63q9-pianoteq-7.5.4/lib/lv2/Pianoteq 7.lv2/Pianoteq_7.so
pianoteq> libX11.so.6 -> found: /nix/store/9ckz4x424lrsypkqfpfk432sa75yjsx7-libX11-1.8.1/lib
pianoteq> libfreetype.so.6 -> found: /nix/store/md56q0amhj1q9h4s9swx1g7y38lzr46a-freetype-2.12.1/lib
pianoteq> libstdc++.so.6 -> found: /nix/store/glnknyx742009d61mrg0dccd0nlhchsr-gcc-11.3.0-lib/lib
pianoteq> setting RPATH to: /nix/store/9ckz4x424lrsypkqfpfk432sa75yjsx7-libX11-1.8.1/lib:/nix/store/md56q0amhj1q9h4s9swx1g7y38lzr46a-freetype-2.12.1/lib:/nix/store/glnknyx742009d61mrg0dccd0nlhchsr-gcc-11.3.0-lib/lib
pianoteq> setting interpreter of /nix/store/cjljwikrfnqkqpfrzn3lrmjrlnlk63q9-pianoteq-7.5.4/bin/pianoteq7
pianoteq> searching for dependencies of /nix/store/cjljwikrfnqkqpfrzn3lrmjrlnlk63q9-pianoteq-7.5.4/bin/pianoteq7
pianoteq> libasound.so.2 -> found: /nix/store/ngnrwp3b4zc1jha4zpfcj6gknn1x27ml-alsa-lib-1.2.7.2/lib
pianoteq> libfreetype.so.6 -> found: /nix/store/md56q0amhj1q9h4s9swx1g7y38lzr46a-freetype-2.12.1/lib
pianoteq> setting RPATH to: /nix/store/ngnrwp3b4zc1jha4zpfcj6gknn1x27ml-alsa-lib-1.2.7.2/lib:/nix/store/md56q0amhj1q9h4s9swx1g7y38lzr46a-freetype-2.12.1/lib
pianoteq> auto-patchelf: 0 dependencies could not be satisfied
I also tried the manual patchelf approach from the NUR package which yielded the same result.
I am also not quite sure, why the actual binary for pianoteq does not depend on libX11
I also checked the resulting binary for missing libs with:
ldd result/bin/pianoteq7 | rg 'not found'
patchelf --print-needed result/bin/pianoteq7
Which looked fine imo, but I am not too familiar with this whole process yet.
Any help or hints to documentation or other examples is appreciated.
Thanks!