Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ whipper.egg-info/

# From coverage report
.coverage

# nix
result
result-man
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
};

outputs =
{ self, nixpkgs }:
let
inherit (nixpkgs) lib;
in
{
packages = lib.genAttrs lib.systems.flakeExposed (system: rec {
default = whipper;
whipper = nixpkgs.legacyPackages.${system}.callPackage ./nix/package.nix { };
});
};
}
114 changes: 114 additions & 0 deletions nix/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
{
lib,
python3,
fetchFromGitHub,
fetchpatch,
installShellFiles,
wrapGAppsNoGuiHook,
gobject-introspection,
libcdio-paranoia,
cdrdao,
libsndfile,
glib,
flac,
sox,
util-linux,
testers,
whipper,
}:
let
bins = [
libcdio-paranoia
cdrdao
flac
sox
util-linux
];
in
python3.pkgs.buildPythonApplication rec {
pname = "whipper";
version = "0.10.0";
pyproject = true;

src = ./..;

nativeBuildInputs = [
gobject-introspection
installShellFiles
wrapGAppsNoGuiHook
];

build-system = with python3.pkgs; [
docutils
setuptools-scm
];

propagatedBuildInputs = with python3.pkgs; [
discid
musicbrainzngs
mutagen
packaging
pillow
pycdio
pygobject3
ruamel-yaml
setuptools
];

buildInputs = [
libsndfile
glib
];

nativeCheckInputs =
with python3.pkgs;
[
pytestCheckHook
twisted
]
++ bins;

makeWrapperArgs = [
"--prefix"
"PATH"
":"
(lib.makeBinPath bins)
"\${gappsWrapperArgs[@]}"
];

dontWrapGApps = true;

outputs = [
"out"
"man"
];
postBuild = ''
make -C man
'';

preCheck = ''
# disable tests that require internet access
# https://github.com/JoeLametta/whipper/issues/291
substituteInPlace whipper/test/test_common_accurip.py \
--replace "test_AccurateRipResponse" "dont_test_AccurateRipResponse"
export HOME=$TMPDIR
'';

postInstall = ''
installManPage man/*.1
'';

passthru.tests.version = testers.testVersion {
package = whipper;
command = "HOME=$TMPDIR whipper --version";
};

meta = {
homepage = "https://github.com/whipper-team/whipper";
description = "CD ripper aiming for accuracy over speed";
maintainers = with lib.maintainers; [ mib ];
license = lib.licenses.gpl3Plus;
platforms = lib.platforms.unix;
mainProgram = "whipper";
};
}