git.iko.soy/typeable/nixpkgs
on master help sign in
soundconverter: init at 4.0.3

Signed-off-by: Jakub Sokołowski <jakub@status.im>

commit073e7d59f48f1bf24055afd92988fdd020ddc3df authorJakub Sokołowski <jakub@status.im> dateThu 21 Oct 2021, 21:43 (5 years ago) parenta85c71a
2 files changed+87
pkgs/applications/audio/soundconverter/default.nix+85 pkgs/top-level/all-packages.nix+2
pkgs/applications/audio/soundconverter/default.nixnew file+85
@@ -0,0 +1,85 @@
1+{ lib, fetchurl
2+# Optional due to unfree license.
3+, faacSupport ? false
4+, glib, python3Packages, gtk3, wrapGAppsHook
5+, gsettings-desktop-schemas, intltool, xvfb-run
6+, gobject-introspection, gst_all_1, fdk-aac-encoder }:
7+
8+python3Packages.buildPythonApplication rec {
9+ pname = "soundconverter";
10+ version = "4.0.3";
11+
12+ src = fetchurl {
13+ url = "https://launchpad.net/soundconverter/trunk/${version}/+download/${pname}-${version}.tar.gz";
14+ sha256 = "sha256-hzIG/4LD3705erPYvXb7uoRwF9LtKKIKB3jrhpYMsZ0=";
15+ };
16+
17+ buildInputs = [
18+ gtk3
19+ fdk-aac-encoder
20+ gobject-introspection
21+ gst_all_1.gst-libav
22+ gst_all_1.gst-plugins-base
23+ gst_all_1.gst-plugins-good
24+ gst_all_1.gst-plugins-ugly
25+ (gst_all_1.gst-plugins-bad.override { inherit faacSupport; })
26+ ];
27+
28+ nativeBuildInputs = [
29+ intltool
30+ wrapGAppsHook
31+ ];
32+
33+ propagatedBuildInputs = [
34+ python3Packages.gst-python
35+ python3Packages.distutils_extra
36+ python3Packages.setuptools
37+ python3Packages.pygobject3
38+ ];
39+
40+ checkInputs = [
41+ xvfb-run
42+ ];
43+
44+ postPatch = ''
45+ substituteInPlace bin/soundconverter --replace \
46+ "DATA_PATH = os.path.join(SOURCE_PATH, 'data')" \
47+ "DATA_PATH = '$out/share/soundconverter'"
48+ '';
49+
50+ preCheck = let
51+ self = { outPath = "$out"; name = "${pname}-${version}"; };
52+ xdgPaths = lib.concatMapStringsSep ":" glib.getSchemaDataDirPath;
53+ in ''
54+ export HOME=$TMPDIR
55+ export XDG_DATA_DIRS=$XDG_DATA_DIRS:${xdgPaths [gtk3 gsettings-desktop-schemas self]}
56+ # FIXME: Fails due to weird Gio.file_parse_name() behavior.
57+ sed -i '49 a\ @unittest.skip("Gio.file_parse_name issues")' tests/testcases/names.py
58+ '' + lib.optionalString (!faacSupport) ''
59+ substituteInPlace tests/testcases/integration.py --replace \
60+ "for encoder in ['fdkaacenc', 'faac', 'avenc_aac']:" \
61+ "for encoder in ['fdkaacenc', 'avenc_aac']:"
62+ '';
63+
64+ checkPhase = ''
65+ runHook preCheck
66+ xvfb-run python tests/test.py
67+ runHook postCheck
68+ '';
69+
70+ # Necessary to set GDK_PIXBUF_MODULE_FILE.
71+ strictDeps = false;
72+
73+ meta = with lib; {
74+ homepage = "https://soundconverter.org/";
75+ description = "Leading audio file converter for the GNOME Desktop";
76+ longDescription = ''
77+ SoundConverter reads anything the GStreamer library can read,
78+ and writes WAV, FLAC, MP3, AAC and Ogg Vorbis files.
79+ Uses Python and GTK+ GUI toolkit, and runs on X Window System.
80+ '';
81+ license = licenses.gpl3Only;
82+ platforms = platforms.linux;
83+ maintainers = with maintainers; [ jakubgs ];
84+ };
85+}
pkgs/top-level/all-packages.nix+2
@@ -9734,6 +9734,8 @@ with pkgs;
97349734
97359735 sony-headphones-client = callPackage ../applications/audio/sony-headphones-client { };
97369736
9737+ soundconverter = callPackage ../applications/audio/soundconverter { };
9738+
97379739 soundkonverter = libsForQt5.soundkonverter;
97389740
97399741 soundwireserver = callPackage ../applications/audio/soundwireserver { };