nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 cmake,
6 alsa-lib,
7 libX11,
8}:
9
10stdenv.mkDerivation (finalAttrs: {
11 pname = "osmid";
12 version = "0.8.0";
13
14 src = fetchFromGitHub {
15 owner = "llloret";
16 repo = "osmid";
17 rev = "v${finalAttrs.version}";
18 sha256 = "1s1wsrp6g6wb0y61xzxvaj59mwycrgy52r4h456086zkz10ls6hw";
19 };
20
21 postPatch = ''
22 # replace deprecated cmake version that are no longer supported by CMake > 4
23 # https://github.com/NixOS/nixpkgs/issues/445447
24
25 substituteInPlace CMakeLists.txt \
26 --replace-fail "cmake_minimum_required (VERSION 3.0)" "cmake_minimum_required (VERSION 3.10)"
27 substituteInPlace external_libs/oscpack_1_1_0/CMakeLists.txt \
28 --replace-fail "cmake_minimum_required(VERSION 2.6)" "cmake_minimum_required (VERSION 3.10)"
29 '';
30
31 nativeBuildInputs = [ cmake ];
32
33 buildInputs = [
34 alsa-lib
35 libX11
36 ];
37
38 installPhase = ''
39 runHook preInstall
40 mkdir -p $out/bin
41 cp {m2o,o2m} $out/bin/
42 runHook postInstall
43 '';
44
45 meta = {
46 homepage = "https://github.com/llloret/osmid";
47 description = "Lightweight, portable, easy to use tool to convert MIDI to OSC and OSC to MIDI";
48 license = lib.licenses.mit;
49 maintainers = with lib.maintainers; [ c0deaddict ];
50 platforms = lib.platforms.linux;
51 };
52})