milkytracker: adopt, 1.03.00 -> 1.04.00 (#241669)

* milkytracker: adopt, 1.03.00 -> 1.04.00

* milkytracker: Add Darwin support

* milkytracker: Mark Darwin broken

Only thing that doesn't build are some resource files which require Xcode for ibtool.
I don't have it, and Ofborg seemingly doesn't have it either, so I can't get it to build.

* milkytracker: Remove SDL2MAIN_LIBRARY flag

Doesn't seem necessary anymore?
This commit is contained in:
Christoph Neidahl 2023-07-23 18:21:14 +02:00 committed by GitHub
parent b927535a4e
commit d3d9204ce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 64 additions and 26 deletions

View File

@ -1,49 +1,85 @@
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, pkg-config, makeWrapper
, SDL2, alsa-lib, libjack2, lhasa, perl, rtmidi, zlib, zziplib }:
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, gitUpdater
, alsa-lib
, cmake
, Cocoa
, CoreAudio
, Foundation
, libjack2
, lhasa
, makeWrapper
, perl
, pkg-config
, rtmidi
, SDL2
, zlib
, zziplib
}:
stdenv.mkDerivation rec {
version = "1.03.00";
stdenv.mkDerivation (finalAttrs: {
pname = "milkytracker";
version = "1.04.00";
src = fetchFromGitHub {
owner = "milkytracker";
repo = "MilkyTracker";
rev = "v${version}";
sha256 = "025fj34gq2kmkpwcswcyx7wdxb89vm944dh685zi4bxx0hz16vvk";
owner = "milkytracker";
repo = "MilkyTracker";
rev = "v${finalAttrs.version}";
hash = "sha256-ta4eV/FGBfgTppJwDam0OKQ7udtlinbWly/FPCE+Qss=";
};
patches = [
# Fix crash after querying midi ports
# Remove when version > 1.04.00
(fetchpatch {
name = "CVE-2022-34927.patch";
url = "https://github.com/milkytracker/MilkyTracker/commit/3a5474f9102cbdc10fbd9e7b1b2c8d3f3f45d91b.patch";
hash = "sha256-YnN1Khcbct7iG7TdwxFU1XVCeKR/Zrhe+oMepvh8cRU=";
url = "https://github.com/milkytracker/MilkyTracker/commit/7e9171488fc47ad2de646a4536794fda21e7303d.patch";
hash = "sha256-CmnIwmGGnsnlRrvVAXe2zaQf1CFMB5BJPKmiwGOHgGY=";
})
];
postPatch = ''
# https://github.com/milkytracker/MilkyTracker/issues/262
substituteInPlace CMakeLists.txt \
--replace 'CMAKE_CXX_STANDARD 98' 'CMAKE_CXX_STANDARD 11'
'';
strictDeps = true;
nativeBuildInputs = [ cmake pkg-config makeWrapper ];
nativeBuildInputs = [
cmake
makeWrapper
pkg-config
];
buildInputs = [ SDL2 alsa-lib libjack2 lhasa perl rtmidi zlib zziplib ];
buildInputs = [
lhasa
libjack2
perl
rtmidi
SDL2
zlib
zziplib
] ++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
Cocoa
CoreAudio
Foundation
];
# Somehow this does not get set automatically
cmakeFlags = [ "-DSDL2MAIN_LIBRARY=${SDL2}/lib/libSDL2.so" ];
postInstall = ''
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
install -Dm644 $src/resources/milkytracker.desktop $out/share/applications/milkytracker.desktop
install -Dm644 $src/resources/pictures/carton.png $out/share/pixmaps/milkytracker.png
install -Dm644 $src/resources/milkytracker.appdata $out/share/appdata/milkytracker.appdata.xml
'';
passthru.updateScript = gitUpdater {
rev-prefix = "v";
};
meta = with lib; {
description = "Music tracker application, similar to Fasttracker II";
homepage = "https://milkytracker.org/";
license = licenses.gpl3Plus;
platforms = [ "x86_64-linux" "i686-linux" ];
maintainers = with maintainers; [];
platforms = platforms.unix;
# ibtool -> real Xcode -> I can't get that, and Ofborg can't test that
broken = stdenv.hostPlatform.isDarwin;
maintainers = with maintainers; [ OPNA2608 ];
};
}
})

View File

@ -30138,7 +30138,9 @@ with pkgs;
cutecapture = callPackage ../applications/video/cutecapture { };
milkytracker = callPackage ../applications/audio/milkytracker { };
milkytracker = callPackage ../applications/audio/milkytracker {
inherit (darwin.apple_sdk.frameworks) Cocoa CoreAudio Foundation;
};
ptcollab = libsForQt5.callPackage ../applications/audio/ptcollab { };