base16-schemes: unstable-2024-06-21 -> unstable-2024-11-12
[NixPkgs.git] / pkgs / by-name / ym / ymuse / package.nix
blob19859a1d819d9be7dd9f4da73f83a7aa7357522d
1 { lib
2 , fetchFromGitHub
3 , buildGoModule
4 , wrapGAppsHook3
5 , pkg-config
6 , glib
7 , gobject-introspection
8 , gtk3
9 , gdk-pixbuf
10 , gettext
11 , librsvg
14 buildGoModule rec {
15   pname = "ymuse";
16   version = "0.22";
18   src = fetchFromGitHub {
19     owner = "yktoo";
20     repo = "ymuse";
21     rev = "v${version}";
22     hash = "sha256-WbIeqOAhdqxU8EvHEsG7ASwy5xZG1domZKT5ccOggHg=";
23   };
25   vendorHash = "sha256-YT4JiieVI6/t4inezE3K2WQBI51W+/MoWr7R/uBzn+8=";
27   nativeBuildInputs = [
28     pkg-config
29     wrapGAppsHook3
30     glib
31     gobject-introspection
32     gdk-pixbuf
33     gettext
34   ];
36   buildInputs = [
37     gtk3
38     librsvg
39   ];
41   postInstall = ''
42     install -Dm644 ./resources/com.yktoo.ymuse.desktop -t $out/share/applications
43     install -Dm644 ./resources/metainfo/com.yktoo.ymuse.metainfo.xml -t $out/share/metainfo
44     cp -r ./resources/icons $out/share
46     app_id="ymuse"
47     find ./resources/i18n -type f -name '*.po' |
48     while read file; do
49         # Language is the filename without the extension
50         lang="$(basename "$file")"
51         lang="''${lang%.*}"
53         # Create the target dir if needed
54         target_dir="$out/share/locale/$lang/LC_MESSAGES"
55         mkdir -p "$target_dir"
57         # Compile the .po into a .mo
58         echo "Compiling $file" into "$target_dir/$app_id.mo"
59         msgfmt "$file" -o "$target_dir/$app_id.mo"
60     done
61   '';
63   # IDK how to deal with tests that open up display.
64   doCheck = false;
66   meta = with lib; {
67     homepage = "https://yktoo.com/en/software/ymuse/";
68     description = "GTK client for Music Player Daemon (MPD)";
69     license = licenses.asl20;
70     maintainers = with maintainers; [ foo-dogsquared ];
71     mainProgram = "ymuse";
72     platforms = platforms.unix;
73   };