1{
2 stdenv,
3 lib,
4 fetchFromGitHub,
5 unstableGitUpdater,
6 libarchive,
7 libzip,
8 pkg-config,
9}:
10
11stdenv.mkDerivation (finalAttrs: {
12 pname = "vgm2x";
13 version = "0-unstable-2024-12-13";
14
15 src = fetchFromGitHub {
16 owner = "vampirefrog";
17 repo = "vgm2x";
18 rev = "ae37e3a8a2d563733c89e00597a18b5deac80b4f";
19 fetchSubmodules = true;
20 hash = "sha256-wRwfRlABy5Ojyjohs68Uqvq0otMbvBCexLpGPmx6sds=";
21 };
22
23 postPatch = ''
24 substituteInPlace Makefile \
25 --replace-fail 'pkg-config' "$PKG_CONFIG"
26 '';
27
28 strictDeps = true;
29
30 enableParallelBuilding = true;
31
32 nativeBuildInputs = [ pkg-config ];
33
34 buildInputs = [
35 libarchive
36 libzip
37 ];
38
39 buildFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
40
41 installPhase = ''
42 runHook preInstall
43
44 install -Dm755 vgm2x $out/bin/vgm2x
45
46 runHook postInstall
47 '';
48
49 passthru = {
50 updateScript = unstableGitUpdater { };
51 };
52
53 meta = {
54 description = "VGM file extraction tools";
55 homepage = "https://github.com/vampirefrog/vgm2x";
56 license = lib.licenses.gpl3Only;
57 mainProgram = "vgm2x";
58 maintainers = with lib.maintainers; [ OPNA2608 ];
59 platforms = lib.platforms.all;
60 };
61})