2022-03-30 09:31:56 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, gitUpdater
|
2022-04-27 09:35:20 +00:00
|
|
|
, testers
|
2022-03-30 09:31:56 +00:00
|
|
|
, furnace
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, pkg-config
|
|
|
|
, makeWrapper
|
2022-07-14 12:49:19 +00:00
|
|
|
, fftw
|
2022-03-30 09:31:56 +00:00
|
|
|
, fmt_8
|
|
|
|
, libsndfile
|
2022-07-14 12:49:19 +00:00
|
|
|
, rtmidi
|
2022-03-30 09:31:56 +00:00
|
|
|
, SDL2
|
|
|
|
, zlib
|
|
|
|
, withJACK ? stdenv.hostPlatform.isUnix
|
|
|
|
, libjack2
|
|
|
|
, withGUI ? true
|
|
|
|
, Cocoa
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "furnace";
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "0.6pre3";
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tildearrow";
|
|
|
|
repo = "furnace";
|
|
|
|
rev = "v${version}";
|
|
|
|
fetchSubmodules = true;
|
2023-01-11 07:51:40 +00:00
|
|
|
sha256 = "sha256-bHVeTw69k6LLcrfkmGxvjlFfR/hWiCfm/P3utknid1o=";
|
2022-03-30 09:31:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2022-07-14 12:49:19 +00:00
|
|
|
fftw
|
2022-03-30 09:31:56 +00:00
|
|
|
fmt_8
|
|
|
|
libsndfile
|
2022-07-14 12:49:19 +00:00
|
|
|
rtmidi
|
2022-03-30 09:31:56 +00:00
|
|
|
SDL2
|
|
|
|
zlib
|
|
|
|
] ++ lib.optionals withJACK [
|
|
|
|
libjack2
|
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
|
|
|
|
Cocoa
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_GUI=${if withGUI then "ON" else "OFF"}"
|
2022-07-14 12:49:19 +00:00
|
|
|
"-DSYSTEM_FFTW=ON"
|
2022-03-30 09:31:56 +00:00
|
|
|
"-DSYSTEM_FMT=ON"
|
|
|
|
"-DSYSTEM_LIBSNDFILE=ON"
|
2022-07-14 12:49:19 +00:00
|
|
|
"-DSYSTEM_RTMIDI=ON"
|
2022-03-30 09:31:56 +00:00
|
|
|
"-DSYSTEM_SDL2=ON"
|
2022-07-14 12:49:19 +00:00
|
|
|
"-DSYSTEM_ZLIB=ON"
|
2022-03-30 09:31:56 +00:00
|
|
|
"-DWITH_JACK=${if withJACK then "ON" else "OFF"}"
|
|
|
|
"-DWARNINGS_ARE_ERRORS=ON"
|
|
|
|
];
|
|
|
|
|
2023-02-16 17:41:37 +00:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optionals (stdenv.cc.isGNU && lib.versionAtLeast stdenv.cc.version "12") [
|
|
|
|
# Needed with GCC 12 but breaks on darwin (with clang) or aarch64 (old gcc)
|
|
|
|
"-Wno-error=mismatched-new-delete"
|
|
|
|
"-Wno-error=use-after-free"
|
|
|
|
];
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
|
|
|
|
# Normal CMake install phase on Darwin only installs the binary, the user is expected to use CPack to build a
|
|
|
|
# bundle. That adds alot of overhead for not much benefit (CPack is currently abit broken, and needs impure access
|
|
|
|
# to /usr/bin/hdiutil). So we'll manually assemble & install everything instead.
|
|
|
|
|
|
|
|
mkdir -p $out/{Applications/Furnace.app/Contents/{MacOS,Resources},share/{,doc,licenses}/furnace}
|
|
|
|
mv $out/{bin,Applications/Furnace.app/Contents/MacOS}/furnace
|
|
|
|
makeWrapper $out/{Applications/Furnace.app/Contents/MacOS,bin}/furnace
|
|
|
|
|
|
|
|
install -m644 {../res,$out/Applications/Furnace.app/Contents}/Info.plist
|
|
|
|
install -m644 ../res/icon.icns $out/Applications/Furnace.app/Contents/Resources/Furnace.icns
|
|
|
|
install -m644 {..,$out/share/licenses/furnace}/LICENSE
|
|
|
|
cp -r ../papers $out/share/doc/furnace/
|
|
|
|
cp -r ../demos $out/share/furnace/
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
|
|
|
updateScript = gitUpdater {
|
|
|
|
rev-prefix = "v";
|
|
|
|
};
|
2022-04-27 09:35:20 +00:00
|
|
|
tests.version = testers.testVersion {
|
2022-03-30 09:31:56 +00:00
|
|
|
package = furnace;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Multi-system chiptune tracker compatible with DefleMask modules";
|
|
|
|
homepage = "https://github.com/tildearrow/furnace";
|
|
|
|
license = with licenses; [ gpl2Plus ];
|
|
|
|
maintainers = with maintainers; [ OPNA2608 ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|