Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

osu-mime: fix icon collisions with Nixpkgs' osu-lazer-bin #155

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
19 changes: 13 additions & 6 deletions pkgs/osu-mime/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,16 @@ in
url = "https://raw.githubusercontent.com/ppy/osu-web/${osu-web-rev}/public/images/layout/osu-logo-white.svg";
sha256 = "XvYBIGyvTTfMAozMP9gmr3uYEJaMcvMaIzwO7ZILrkY=";
})
(fetchurl {
url = "https://aur.archlinux.org/cgit/aur.git/plain/osu-file-extensions.xml?h=osu-mime&id=${osu-mime-spec-rev}";
sha256 = "MgQNW0RpnEYTC0ym6wB8cA6a8GCED1igsjOtHPXNZVo=";
(stdenvNoCC.mkDerivation {
name = "osu-file-extensions";
src = fetchurl {
url = "https://aur.archlinux.org/cgit/aur.git/plain/osu-file-extensions.xml?h=osu-mime&id=${osu-mime-spec-rev}";
sha256 = "MgQNW0RpnEYTC0ym6wB8cA6a8GCED1igsjOtHPXNZVo=";
};
unpackPhase = "cp $src ./osu-file-extensions.xml";
installPhase = "cp osu-file-extensions.xml $out";
# Patch to change the icon names from "osu!" to "osu!mime".
patches = [./osu-mime-change-icon.patch];
})
];

Expand Down Expand Up @@ -51,10 +58,10 @@ in
# Generate icon
rsvg-convert -w "$size" -h "$size" -f png -o "osu-logo-triangles.png" "''${srcs[0]}"
rsvg-convert -w "$size" -h "$size" -f png -o "osu-logo-white.png" "''${srcs[1]}"
convert -composite "osu-logo-triangles.png" "osu-logo-white.png" -gravity center 'osu!.png'
convert -composite "osu-logo-triangles.png" "osu-logo-white.png" -gravity center 'osu!mime.png'

mkdir -p "$icon_dir"
mv 'osu!.png' "$icon_dir"
mv 'osu!mime.png' "$icon_dir"
done

cp "''${srcs[2]}" "$mime_dir/osu.xml"
Expand All @@ -63,7 +70,7 @@ in
meta = with lib; {
description = "MIME types for osu!";
license = licenses.agpl3Only; # osu-web uses AGPL v3.0
maintainers = with lib.maintainers; [PlayerNameHere];
maintainers = with lib.maintainers; [dixslyf];
platforms = ["x86_64-linux"];
};
}
48 changes: 48 additions & 0 deletions pkgs/osu-mime/osu-mime-change-icon.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
diff --git a/osu-file-extensions.xml b/osu-file-extensions.xml
index 9270d15..43add11 100644
--- a/osu-file-extensions.xml
+++ b/osu-file-extensions.xml
@@ -6,37 +6,37 @@
<magic priority="60">
<match type="string" offset="0" value="osu file format v"/>
</magic>
- <icon name="osu!"/>
+ <icon name="osu!mime"/>
<comment>osu! beatmap</comment>
</mime-type>
<mime-type type="application/x-osu-storyboard">
<glob pattern="*.osb"/>
<sub-class-of type="text/plain"/>
- <icon name="osu!"/>
+ <icon name="osu!mime"/>
<comment>osu! storyboard</comment>
</mime-type>
<mime-type type="application/x-osu-skin-archive">
<glob pattern="*.osk"/>
<sub-class-of type="application/zip"/>
- <icon name="osu!"/>
+ <icon name="osu!mime"/>
<comment>osu! skin archive</comment>
</mime-type>
<mime-type type="application/x-osu-replay">
<glob pattern="*.osr"/>
<sub-class-of type="application/octet-stream"/>
- <icon name="osu!"/>
+ <icon name="osu!mime"/>
<comment>osu! replay</comment>
</mime-type>
<mime-type type="application/x-osu-beatmap-archive">
<glob pattern="*.osz"/>
<sub-class-of type="application/zip"/>
- <icon name="osu!"/>
+ <icon name="osu!mime"/>
<comment>osu! beatmap archive</comment>
</mime-type>
<mime-type type="application/x-osu-beatmap-archive">
<glob pattern="*.osz2"/>
<sub-class-of type="application/zip"/>
- <icon name="osu!"/>
+ <icon name="osu!mime"/>
<comment>osu! beatmap archive</comment>
</mime-type>
</mime-info>
2 changes: 1 addition & 1 deletion pkgs/osu-stable/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
desktopItems = makeDesktopItem {
name = pname;
exec = "${script}/bin/${pname} %U";
icon = "osu!"; # icon comes from the osu-mime package
icon = "osu!mime"; # icon comes from the osu-mime package
comment = "Rhythm is just a *click* away";
desktopName = "osu!stable";
categories = ["Game"];
Expand Down
Loading