Linux packaging #2049

Merged
merged 1 commit into from Jun 25, 2015

Conversation

Projects
None yet
4 participants
@shoogle
Contributor

shoogle commented Jun 6, 2015

Hopefully this will make life easier for the Linux maintainers and reduce turnaround time for new releases on Linux, as discussed here: https://musescore.org/en/node/58996#comment-275776

See commit messages for changes. These should work on any Linux distro that complies with freedesktop.org standards for mimetypes and icons (tested with Ubuntu 15.04).

New dependencies (Linux only - all seem to be included by default on most popular distros):

  • gzip (optional) - for compressing man pages (they install uncompressed if gzip not present)
  • update-mime-database - inform the system about MSCZ, .MSCX and MusicXML files
  • gtk-update-icon-cache - sets icons for .MSCZ, .MSCX and MusicXML files

What this PR doesn't do:

  • Different languages/translations in man pages or mimetype comments (I would need help with this)
  • Packaging into .deb or other distribution-specific packages

It would be nice to be able to replace the icon PNGs with SVGs. Linux does the job of converting to different sizes (e.g. 16x16, 32x32, 48x48, etc) automatically, unlike Windows and Mac. Also, a separate icon for MusicXML files would be very nice.

@shoogle

This comment has been minimized.

Show comment
Hide comment
@shoogle

shoogle Jun 6, 2015

Contributor

The original TravisCI build passed, but a close inspection of the log revealed an error message: gzip: unknown option 'k'. This is because Travis uses an older version of gzip. I changed the command syntax so it will work with any version of gzip.

Contributor

shoogle commented Jun 6, 2015

The original TravisCI build passed, but a close inspection of the log revealed an error message: gzip: unknown option 'k'. This is because Travis uses an older version of gzip. I changed the command syntax so it will work with any version of gzip.

@shoogle

This comment has been minimized.

Show comment
Hide comment
@shoogle

shoogle Jun 9, 2015

Contributor

The code is general but I'm still looking into the availablity of "gtk-update-icon-cache" on non-gnome systems. In the meantime, I found some suitable SVGs at https://musescore.com/press, and I created a new icon to use with MusicXML files.

Proposed icons:

proposedfileicons
The .mp3 and .mid files use system icons and are show for comparison purposes.

Current icons:

currentfileicons

Currently MusicXML files are not given icons so they system assigns generic icons that give no indication that they represent audio data. Also, there is no way to distinguish between compressed or uncompressed MuseScore files. The proposed icons (implemented in the PR) fix this.

Contributor

shoogle commented Jun 9, 2015

The code is general but I'm still looking into the availablity of "gtk-update-icon-cache" on non-gnome systems. In the meantime, I found some suitable SVGs at https://musescore.com/press, and I created a new icon to use with MusicXML files.

Proposed icons:

proposedfileicons
The .mp3 and .mid files use system icons and are show for comparison purposes.

Current icons:

currentfileicons

Currently MusicXML files are not given icons so they system assigns generic icons that give no indication that they represent audio data. Also, there is no way to distinguish between compressed or uncompressed MuseScore files. The proposed icons (implemented in the PR) fix this.

@lasconic

This comment has been minimized.

Show comment
Hide comment
@lasconic

lasconic Jun 9, 2015

Member

In my opinion the proposed MuseScore one are not better than the current one. Is there any guide line for this? MSCZ and MSCX are both documents, maybe they should get the same document look but with the Mu in it?

Member

lasconic commented Jun 9, 2015

In my opinion the proposed MuseScore one are not better than the current one. Is there any guide line for this? MSCZ and MSCX are both documents, maybe they should get the same document look but with the Mu in it?

@shoogle

This comment has been minimized.

Show comment
Hide comment
@shoogle

shoogle Jun 9, 2015

Contributor

The main advantage of the new MuseScore icons is that they are SVGs so they scale nicely. The old icon doesn't scale at all. See: https://musescore.org/en/node/59196 (sorry, I forgot to tag it in the commit message).

I will look for some official style guidelines, but in my experience many apps do aim for a "document look" (though not all). I did not create new icons for MuseScore because I wasn't sure I had permission and the round and square icon do what I wanted (I'm also not really a graphic designer, but I know a bit about using Inkscape.)

Contributor

shoogle commented Jun 9, 2015

The main advantage of the new MuseScore icons is that they are SVGs so they scale nicely. The old icon doesn't scale at all. See: https://musescore.org/en/node/59196 (sorry, I forgot to tag it in the commit message).

I will look for some official style guidelines, but in my experience many apps do aim for a "document look" (though not all). I did not create new icons for MuseScore because I wasn't sure I had permission and the round and square icon do what I wanted (I'm also not really a graphic designer, but I know a bit about using Inkscape.)

@shoogle

This comment has been minimized.

Show comment
Hide comment
@shoogle

shoogle Jun 9, 2015

Contributor

I've looked into icon style guidelines. Using the MuseScore executable icon for MSCZ or MSCX files is fine (most applications just do that). If we want a special icon for MSCZ and MSCX files then a "folded paper" template would be consistent with many applications. I think that a folded paper template would look good, but we should probably make our own design rather than using an existing one because it would fit in with one particular distro and not others.

Background information

Icons on Linux are set by "icon themes". Popular themes are "Humanity" (default on Ubuntu/gnome) and "Oxygen" (I think default on KDE). Both Humanity and Oxygen use a "folded paper" template for file mimetype icons. In Humanity the fold is top right, in Oxygen the fold is bottom right.

The Tango Icon Theme (recommended by Freedestop.org) provides some independent guidelines that are adhered to by most of the themes on gnome and KDE. However:

  • Tango is for desktop environments (gnome), not applications (MuseScore), so we can do what we like (e.g. don't have to restrict ourselves to the Tango colour palette.)
  • Tango makes no mention of using a "folded paper" template for mimetypes (file icons) but many themes do choose to use one.

What tends to happen on Linux is that apps use their executable icon as their mimetype icon until they become very popular (e.g. LibreOffice) at which point somebody else creates theme icons for them. LibreOffice has completely different icons under Humanity and Oxygen. This probably wouldn't be good for MuseScore in terms of brand recognition at this stage.

Contributor

shoogle commented Jun 9, 2015

I've looked into icon style guidelines. Using the MuseScore executable icon for MSCZ or MSCX files is fine (most applications just do that). If we want a special icon for MSCZ and MSCX files then a "folded paper" template would be consistent with many applications. I think that a folded paper template would look good, but we should probably make our own design rather than using an existing one because it would fit in with one particular distro and not others.

Background information

Icons on Linux are set by "icon themes". Popular themes are "Humanity" (default on Ubuntu/gnome) and "Oxygen" (I think default on KDE). Both Humanity and Oxygen use a "folded paper" template for file mimetype icons. In Humanity the fold is top right, in Oxygen the fold is bottom right.

The Tango Icon Theme (recommended by Freedestop.org) provides some independent guidelines that are adhered to by most of the themes on gnome and KDE. However:

  • Tango is for desktop environments (gnome), not applications (MuseScore), so we can do what we like (e.g. don't have to restrict ourselves to the Tango colour palette.)
  • Tango makes no mention of using a "folded paper" template for mimetypes (file icons) but many themes do choose to use one.

What tends to happen on Linux is that apps use their executable icon as their mimetype icon until they become very popular (e.g. LibreOffice) at which point somebody else creates theme icons for them. LibreOffice has completely different icons under Humanity and Oxygen. This probably wouldn't be good for MuseScore in terms of brand recognition at this stage.

@shoogle

This comment has been minimized.

Show comment
Hide comment
@shoogle

shoogle Jun 9, 2015

Contributor

(Just to clarify: the "proposed" MSCZ and MSCX icons were not made by me. They are the current icons for MuseScore on Mac and Windows respectively. Only the MusicXML icons were made by me.)

However, I have now made some icons for MSCZ and MSCX. These are consistent with icons from the "Humanity" icon theme (default icon theme on Ubuntu) and will not look out of place on other Linux (and probably wouldn't look bad on Windows or Mac either).

New proposed icons ("folded paper" template)

proposedfileicons2
The Excel spreadsheet icon is just an example to show that icons don't always have a grey background.

Contributor

shoogle commented Jun 9, 2015

(Just to clarify: the "proposed" MSCZ and MSCX icons were not made by me. They are the current icons for MuseScore on Mac and Windows respectively. Only the MusicXML icons were made by me.)

However, I have now made some icons for MSCZ and MSCX. These are consistent with icons from the "Humanity" icon theme (default icon theme on Ubuntu) and will not look out of place on other Linux (and probably wouldn't look bad on Windows or Mac either).

New proposed icons ("folded paper" template)

proposedfileicons2
The Excel spreadsheet icon is just an example to show that icons don't always have a grey background.

CMakeLists.txt
@@ -402,6 +402,35 @@ if (NOT MINGW AND NOT APPLE)
set (CMAKE_EXE_LINKER_FLAGS "-Wl,-rpath=${_qt5Core_install_prefix}/lib")
# install desktop file
install( FILES build/mscore.desktop DESTINATION share/applications)
+ # compress man pages if gzip is present on system
+ set(MAN_TARGET ${PROJECT_SOURCE_DIR}/build/mscore.1)
+ find_program( GZIP_EXECUTABLE gzip DOC "A tool for compressing manpages (optional)." )

This comment has been minimized.

@ibara

ibara Jun 10, 2015

Can you set this to if GZIP and NOT OpenBSD? We never compress man pages on OpenBSD.

@ibara

ibara Jun 10, 2015

Can you set this to if GZIP and NOT OpenBSD? We never compress man pages on OpenBSD.

This comment has been minimized.

@shoogle

shoogle Jun 10, 2015

Contributor

Certainly. Thanks very much for the input!

@shoogle

shoogle Jun 10, 2015

Contributor

Certainly. Thanks very much for the input!

This comment has been minimized.

@shoogle

shoogle Jun 10, 2015

Contributor

I don't think CMake has an "OpenBSD" variable so I am going to test this using CMAKE_SYSTEM_NAME which stores a value equivalent to running $ uname -s.
Can you confirm for me that the output of running $ uname -s on OpenBSD is exactly "OpenBSD" and nothing else?

(Also, I read here that man pages can be compressed on OpenBSD, but I take it that's not standard practice?)

@shoogle

shoogle Jun 10, 2015

Contributor

I don't think CMake has an "OpenBSD" variable so I am going to test this using CMAKE_SYSTEM_NAME which stores a value equivalent to running $ uname -s.
Can you confirm for me that the output of running $ uname -s on OpenBSD is exactly "OpenBSD" and nothing else?

(Also, I read here that man pages can be compressed on OpenBSD, but I take it that's not standard practice?)

This comment has been minimized.

@ibara

ibara Jun 10, 2015

CMAKE_SYSTEM_NAME matches "OpenBSD" is the correct way to do it, and the way we always do it on OpenBSD.

Not only is that FAQ page five years old, it is for something different. It is unacceptable for OpenBSD ports and packages to have compressed man pages.

@ibara

ibara Jun 10, 2015

CMAKE_SYSTEM_NAME matches "OpenBSD" is the correct way to do it, and the way we always do it on OpenBSD.

Not only is that FAQ page five years old, it is for something different. It is unacceptable for OpenBSD ports and packages to have compressed man pages.

This comment has been minimized.

@shoogle

shoogle Jun 10, 2015

Contributor

Thanks for information, I really appreciate your help. I am still learning CMake and I am completely new to OpenBSD (and have no way of testing on it) so I didn't want to risk just taking your word on it; a link to evidence is always appreciated. The title of the page is "Getting to know OpenBSD" so it seemed appropriate to me, and I would have no way of knowing otherwise.

@shoogle

shoogle Jun 10, 2015

Contributor

Thanks for information, I really appreciate your help. I am still learning CMake and I am completely new to OpenBSD (and have no way of testing on it) so I didn't want to risk just taking your word on it; a link to evidence is always appreciated. The title of the page is "Getting to know OpenBSD" so it seemed appropriate to me, and I would have no way of knowing otherwise.

This comment has been minimized.

@ibara

ibara Jun 10, 2015

You should take my word for it: I am an OpenBSD developer and maintainer of the OpenBSD port of MuseScore.

@ibara

ibara Jun 10, 2015

You should take my word for it: I am an OpenBSD developer and maintainer of the OpenBSD port of MuseScore.

This comment has been minimized.

@shoogle

shoogle Jun 10, 2015

Contributor

Thanks for letting me know.

@shoogle

shoogle Jun 10, 2015

Contributor

Thanks for letting me know.

@shoogle

This comment has been minimized.

Show comment
Hide comment
@shoogle

shoogle Jun 12, 2015

Contributor

@lasconic this should be safe on all Linux. I normally use Ubuntu (Unity/GNOME) but I've just download a copy of OpenSUSE (KDE) and all of the commands are available (gzip, update-mime-database, gtk-update-icon-cache). Apparently they are also available in Fedora and probably every other distro that is recent enough to run MuseScore.

Even if these commands are not available on a particular Linux, MuseScore will still compile and install as before. The only thing the user would lose out on is the icons. (They also won't get the icons or man pages if they choose a non-standard $PREFIX, but that is the desired behaviour.)

I am still looking into automated packaging services, but that can wait for another PR. It would be good to get this one out there first just to make double sure that there are no problems with it. What do you think of the new icons?

Contributor

shoogle commented Jun 12, 2015

@lasconic this should be safe on all Linux. I normally use Ubuntu (Unity/GNOME) but I've just download a copy of OpenSUSE (KDE) and all of the commands are available (gzip, update-mime-database, gtk-update-icon-cache). Apparently they are also available in Fedora and probably every other distro that is recent enough to run MuseScore.

Even if these commands are not available on a particular Linux, MuseScore will still compile and install as before. The only thing the user would lose out on is the icons. (They also won't get the icons or man pages if they choose a non-standard $PREFIX, but that is the desired behaviour.)

I am still looking into automated packaging services, but that can wait for another PR. It would be good to get this one out there first just to make double sure that there are no problems with it. What do you think of the new icons?

@lasconic

This comment has been minimized.

Show comment
Hide comment
@lasconic

lasconic Jun 12, 2015

Member

I'm jealous, they look better than the Mac and Windows ones ;)

Member

lasconic commented Jun 12, 2015

I'm jealous, they look better than the Mac and Windows ones ;)

@shoogle

This comment has been minimized.

Show comment
Hide comment
@shoogle

shoogle Jun 12, 2015

Contributor

Thanks! I can generate thumbnails at different sizes if you want to integrate them into Windows and Mac. I don't know how to do the integration bit for those OSs though.

Contributor

shoogle commented Jun 12, 2015

Thanks! I can generate thumbnails at different sizes if you want to integrate them into Windows and Mac. I don't know how to do the integration bit for those OSs though.

@shoogle

This comment has been minimized.

Show comment
Hide comment
@shoogle

shoogle Jun 13, 2015

Contributor

@lasconic is there anything in particular you want me to do before this gets merged, or are you just waiting for some more package maintainers to comment on it?

Contributor

shoogle commented Jun 13, 2015

@lasconic is there anything in particular you want me to do before this gets merged, or are you just waiting for some more package maintainers to comment on it?

@lasconic

This comment has been minimized.

Show comment
Hide comment
@lasconic

lasconic Jun 13, 2015

Member

I want to take another look in the next days, and it would be great if @tsmithe could take a look as he knows the ubuntu packaging process inside out. Nothing in particular for now.

Member

lasconic commented Jun 13, 2015

I want to take another look in the next days, and it would be great if @tsmithe could take a look as he knows the ubuntu packaging process inside out. Nothing in particular for now.

@tsmithe

This comment has been minimized.

Show comment
Hide comment
@tsmithe

tsmithe Jun 13, 2015

Hi all -- this looks totally fine to me, as long as it's fine for the core team.

tsmithe commented Jun 13, 2015

Hi all -- this looks totally fine to me, as long as it's fine for the core team.

@lasconic

This comment has been minimized.

Show comment
Hide comment
@lasconic

lasconic Jun 13, 2015

Member

@tsmithe the real question is "Does it make your job as the package maintainer easier, equal, or harder?"

Member

lasconic commented Jun 13, 2015

@tsmithe the real question is "Does it make your job as the package maintainer easier, equal, or harder?"

@ibara

This comment has been minimized.

Show comment
Hide comment
@ibara

ibara Jun 13, 2015

@lasconic This pull request as-is is effectively a no-op for OpenBSD packaging.

ibara commented Jun 13, 2015

@lasconic This pull request as-is is effectively a no-op for OpenBSD packaging.

@tsmithe

This comment has been minimized.

Show comment
Hide comment
@tsmithe

tsmithe Jun 13, 2015

Equal -- the Debian / Ubuntu package already does this (or at least it is supposed to!) -- except of course the new icons.

So in some sense, it makes life a bit harder, because initially the package will have to change. But probably it will improve things in the long term.

tsmithe commented Jun 13, 2015

Equal -- the Debian / Ubuntu package already does this (or at least it is supposed to!) -- except of course the new icons.

So in some sense, it makes life a bit harder, because initially the package will have to change. But probably it will improve things in the long term.

@lasconic

This comment has been minimized.

Show comment
Hide comment
@lasconic

lasconic Jun 13, 2015

Member

Ok, great! That's what I wanted to hear. If we can make things easier in the long term, it's definitely a win.
No-op is fine too. I just don't want to make your job harder.

Member

lasconic commented Jun 13, 2015

Ok, great! That's what I wanted to hear. If we can make things easier in the long term, it's definitely a win.
No-op is fine too. I just don't want to make your job harder.

@shoogle

This comment has been minimized.

Show comment
Hide comment
@shoogle

shoogle Jun 13, 2015

Contributor

Thanks for commenting guys. @tsmithe, @lasconic I was hoping to create an "unstable" PPA for Debian/Ubuntu that would do automated builds of the Github master every day (similar to the current Mac and Windows nightlies). Would you object to this, or do you have any comments?

Contributor

shoogle commented Jun 13, 2015

Thanks for commenting guys. @tsmithe, @lasconic I was hoping to create an "unstable" PPA for Debian/Ubuntu that would do automated builds of the Github master every day (similar to the current Mac and Windows nightlies). Would you object to this, or do you have any comments?

@tsmithe

This comment has been minimized.

Show comment
Hide comment
@tsmithe

tsmithe Jun 13, 2015

Not at all. But if you join the mscore-ubuntu team, you can do it there, with the others.

The problem in the past was that there were patches that had to be updated quite a lot with changes to the master repo. But those have almost all been upstreamed, so it should be easier now.

tsmithe commented Jun 13, 2015

Not at all. But if you join the mscore-ubuntu team, you can do it there, with the others.

The problem in the past was that there were patches that had to be updated quite a lot with changes to the master repo. But those have almost all been upstreamed, so it should be easier now.

@tsmithe

This comment has been minimized.

Show comment
Hide comment
@tsmithe

tsmithe Jun 13, 2015

I've just added you to the team

tsmithe commented Jun 13, 2015

I've just added you to the team

@shoogle

This comment has been minimized.

Show comment
Hide comment
@shoogle

shoogle Jun 13, 2015

Contributor

Thanks very much! My hope is that most things that were previously done through patches can be implemented in the upstream code. There are differences between Linux distros, but there is also quite a lot they have in common so it would be silly to have all the different maintainers having to manually apply patches that do essentially the same thing.

Because I want to implement changes to the upstream code I might have the "unstable" PPA grab code from my own Github repository for a short time while I get it up and running, so it's probably best not to advertise it's existence for the time being!

Contributor

shoogle commented Jun 13, 2015

Thanks very much! My hope is that most things that were previously done through patches can be implemented in the upstream code. There are differences between Linux distros, but there is also quite a lot they have in common so it would be silly to have all the different maintainers having to manually apply patches that do essentially the same thing.

Because I want to implement changes to the upstream code I might have the "unstable" PPA grab code from my own Github repository for a short time while I get it up and running, so it's probably best not to advertise it's existence for the time being!

@lasconic

This comment has been minimized.

Show comment
Hide comment
@lasconic

lasconic Jun 23, 2015

Member

Looks good and ready to merge. Would you mind squashing the commits together? http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html

Member

lasconic commented Jun 23, 2015

Looks good and ready to merge. Would you mind squashing the commits together? http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html

improving Linux packaging (node:60131)
- automatic installation of Linux man page
- compress man page if gzip is present on system
- updated Linux man page
- tidied Linux man page
- Add .MSCZ and .MSCX to MIME database on Linux
- new Makefile targets to uninstall on Linux
- add MusicXML files to MIME database on Linux
- install mimetype icons on Linux
- changed gzip syntax to support older versions for Linux man page compression
- replaced PNG icons with SVGs
- fix #59196: new MSCZ and MSCX icon designs (SVG)
- never compress man pages on OpenBSD
@shoogle

This comment has been minimized.

Show comment
Hide comment
@shoogle

shoogle Jun 25, 2015

Contributor

Not at all, thanks for the link. Should I always squash them, or would you like them to be kept separate to make it easier to see what each commit does? I don't mind squashing them after you've checked.

Contributor

shoogle commented Jun 25, 2015

Not at all, thanks for the link. Should I always squash them, or would you like them to be kept separate to make it easier to see what each commit does? I don't mind squashing them after you've checked.

lasconic added a commit that referenced this pull request Jun 25, 2015

@lasconic lasconic merged commit d6b2232 into musescore:master Jun 25, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@shoogle shoogle deleted the shoogle:linux-packaging branch Jun 26, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment