nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 cmake,
3 doxygen,
4 fetchurl,
5 graphviz,
6 lib,
7 libogg,
8 nix-update-script,
9 buildPackages,
10 pkg-config,
11 stdenv,
12 versionCheckHook,
13}:
14stdenv.mkDerivation (finalAttrs: {
15 pname = "flac";
16 version = "1.5.0";
17
18 # Building from tarball instead of GitHub to include pre-built manpages.
19 # This prevents huge numbers of rebuilds for pandoc / haskell-updates.
20 # It also enables manpages for platforms where pandoc is not available.
21 src = fetchurl {
22 url = "http://downloads.xiph.org/releases/flac/flac-${finalAttrs.version}.tar.xz";
23 hash = "sha256-8sHHZZKoL//4QTujxKEpm2x6sGxzTe4D/YhjBIXCuSA=";
24 };
25
26 hardeningDisable = [ "trivialautovarinit" ];
27
28 nativeBuildInputs = [
29 cmake
30 doxygen
31 graphviz
32 pkg-config
33 ];
34
35 buildInputs = [ libogg ];
36
37 cmakeFlags = lib.optionals (!stdenv.hostPlatform.isStatic) [
38 "-DBUILD_SHARED_LIBS=ON"
39 ];
40
41 CFLAGS = [
42 "-O3"
43 "-funroll-loops"
44 ];
45 CXXFLAGS = [ "-O3" ];
46
47 patches = [ ./package.patch ];
48 doCheck = true;
49
50 outputs = [
51 "bin"
52 "dev"
53 "doc"
54 "out"
55 "man"
56 ];
57
58 nativeInstallCheckInputs = [ versionCheckHook ];
59 doInstallCheck = true;
60
61 passthru.updateScript = nix-update-script { };
62
63 meta = {
64 homepage = "https://xiph.org/flac/";
65 description = "Library and tools for encoding and decoding the FLAC lossless audio file format";
66 changelog = "https://github.com/xiph/flac/releases/tag/${finalAttrs.version}";
67 mainProgram = "flac";
68 platforms = lib.platforms.all;
69 license = with lib.licenses; [
70 bsd3
71 fdl13Plus
72 gpl2Plus
73 lgpl21Plus
74 ];
75 maintainers = with lib.maintainers; [ ruuda ];
76 };
77})