nixpkgs/pkgs/by-name/od/odin2/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

88 lines
1.6 KiB
Nix

{ stdenv
, lib
, fetchFromGitHub
, cmake
, pkg-config
, alsa-lib
, freetype
, libjack2
, lv2
, libX11
, libXcursor
, libXext
, libXinerama
, libXrandr
, libGL
, gcc-unwrapped
}:
stdenv.mkDerivation rec {
pname = "odin2";
version = "2.3.4";
src = fetchFromGitHub {
owner = "TheWaveWarden";
repo = "odin2";
rev = "v${version}";
fetchSubmodules = true;
hash = "sha256-N96Nb7G6hqfh8DyMtHbttl/fRZUkS8f2KfPSqeMAhHY=";
};
postPatch = ''
sed '1i#include <utility>' -i \
libs/JUCELV2/modules/juce_gui_basics/windows/juce_ComponentPeer.h # gcc12
'';
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
alsa-lib
freetype
libjack2
lv2
libX11
libXcursor
libXext
libXinerama
libXrandr
libGL
];
# JUCE dlopen's these at runtime, crashes without them
NIX_LDFLAGS = (toString [
"-lX11"
"-lXext"
"-lXcursor"
"-lXinerama"
"-lXrandr"
]);
cmakeFlags = [
"-DCMAKE_AR=${gcc-unwrapped}/bin/gcc-ar"
"-DCMAKE_RANLIB=${gcc-unwrapped}/bin/gcc-ranlib"
"-DCMAKE_NM=${gcc-unwrapped}/bin/gcc-nm"
];
installPhase = ''
mkdir -p $out/bin $out/lib/vst3 $out/lib/lv2 $out/lib/clap
cd Odin2_artefacts/Release
cp Standalone/Odin2 $out/bin
cp -r VST3/Odin2.vst3 $out/lib/vst3
cp -r LV2/Odin2.lv2 $out/lib/lv2
cp -r CLAP/Odin2.clap $out/lib/clap
'';
meta = with lib; {
description = "Odin 2 Synthesizer Plugin";
homepage = "https://thewavewarden.com/odin2";
license = licenses.gpl3;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ magnetophon ];
mainProgram = "Odin2";
};
}