3snowp7im / urn

Split tracker / timer with GTK+ frontend
GNU General Public License v3.0
127 stars 36 forks source link

How to install? #40

Open Fabian42 opened 6 years ago

Fabian42 commented 6 years ago

Similar to #17: I have no idea how to install this. I also guessed to enter sudo make (install), but that just gives this output:

xxd --include urn-gtk.css > urn-gtk.h || (rm urn-gtk.h; false)
/bin/sh: 1: xxd: not found
GNUmakefile:23: recipe for target 'urn-gtk.h' failed
make: *** [urn-gtk.h] Error 1

There is no file called something with "make" in the downloaded zip (also visible here on Github). There's also no script that I can see. What do I do to install this?

ghost commented 5 years ago

It's make then sudo make install, in case you meant something else, I realize you asked this a while ago. It worked for me but this project seems abandoned so I may try to work on my own alternative that doesn't rely on gsettings.

Fabian42 commented 5 years ago

Since this was a long time ago, the system doesn't exist anymore on which I tried to install this. So I made a Debian VM. First issue: libgtk+-3.0 is not a package in Synaptic (or apt-get). How to install it?

ghost commented 5 years ago

I don't use Debian, but have you tried libgtk-3-dev? It may be this package: https://packages.debian.org/sid/libgtk-3-dev

Fabian42 commented 5 years ago

Worked!

Next: x11. There's no package with that name, but I have 20 packages installed that start with x11, so I guess that works, too? If no, please tell me, if yes, someone please update readme.

Next: libjansson: I have libjansson4 installed, I guess that's what is meant by that.

Next: make. Output:

cc `pkg-config --cflags gtk+-3.0 x11 jansson` -Wall -Wno-unused-parameter -std=gnu99   -c -o urn-gtk.o urn-gtk.c
Package jansson was not found in the pkg-config search path.
Perhaps you should add the directory containing `jansson.pc'
to the PKG_CONFIG_PATH environment variable
No package 'jansson' found
urn-gtk.c:8:21: fatal error: gtk/gtk.h: No such file or directory
 #include <gtk/gtk.h>
                     ^
compilation terminated.
<builtin>: recipe for target 'urn-gtk.o' failed
make: *** [urn-gtk.o] Error 1

Sounds like that "jansson" package was not the right one maybe. So what now?

ghost commented 5 years ago

Can you also install the dev package for jansson: https://packages.debian.org/sid/libjansson-dev It may be needed on Debian to compile. However it seems you also have an error with trying to find the gtk/gtk.h header. If it happens, you may need to modify the Makefile and add -I/usr/include/gtk-3.0/ to the CFLAGS variable.

edit: btw I found a fork of this project with added features and fixes, as well as instructions for a Debian installation in the README: https://github.com/xPMo/urn/tree/master

Fabian42 commented 5 years ago

After installing libjansson-dev, this is the output:

cc `pkg-config --cflags gtk+-3.0 x11 jansson` -Wall -Wno-unused-parameter -std=gnu99   -c -o urn-gtk.o urn-gtk.c
cc `pkg-config --cflags gtk+-3.0 x11 jansson` -Wall -Wno-unused-parameter -std=gnu99   -c -o urn.o urn.c
cc `pkg-config --cflags gtk+-3.0 x11 jansson` -Wall -Wno-unused-parameter -std=gnu99   -c -o bind.o bind.c
cc `pkg-config --cflags gtk+-3.0 x11 jansson` -Wall -Wno-unused-parameter -std=gnu99   -c -o components/urn-component.o components/urn-component.c
cc `pkg-config --cflags gtk+-3.0 x11 jansson` -Wall -Wno-unused-parameter -std=gnu99   -c -o components/title.o components/title.c
cc `pkg-config --cflags gtk+-3.0 x11 jansson` -Wall -Wno-unused-parameter -std=gnu99   -c -o components/splits.o components/splits.c
cc `pkg-config --cflags gtk+-3.0 x11 jansson` -Wall -Wno-unused-parameter -std=gnu99   -c -o components/timer.o components/timer.c
cc `pkg-config --cflags gtk+-3.0 x11 jansson` -Wall -Wno-unused-parameter -std=gnu99   -c -o components/prev-segment.o components/prev-segment.c
cc `pkg-config --cflags gtk+-3.0 x11 jansson` -Wall -Wno-unused-parameter -std=gnu99   -c -o components/best-sum.o components/best-sum.c
cc `pkg-config --cflags gtk+-3.0 x11 jansson` -Wall -Wno-unused-parameter -std=gnu99   -c -o components/pb.o components/pb.c
cc `pkg-config --cflags gtk+-3.0 x11 jansson` -Wall -Wno-unused-parameter -std=gnu99   -c -o components/wr.o components/wr.c
cc   urn-gtk.o urn.o bind.o components/urn-component.o components/title.o components/splits.o components/timer.o components/prev-segment.o components/best-sum.o components/pb.o components/wr.o  `pkg-config --libs gtk+-3.0 x11 jansson` -o urn-gtk

Then on sudo make install:

cp urn-gtk /usr/local/bin
cp urn.desktop /usr/share/applications
for size in 16 22 24 32 36 48 64 72 96 128 256 512; do \
  convert urn.svg -resize "$size"x"$size" \
          /usr/share/icons/hicolor/"$size"x"$size"/apps/urn.png ; \
done
gtk-update-icon-cache -f -t /usr/share/icons/hicolor
gtk-update-icon-cache: Cache file created successfully.
cp urn-gtk.gschema.xml /usr/share/glib-2.0/schemas
glib-compile-schemas /usr/share/glib-2.0/schemas
mkdir -p /usr/share/urn/themes
rsync -a --exclude=".*" themes /usr/share/urn
/bin/sh: 1: rsync: not found
GNUmakefile:26: recipe for target 'install' failed
make: *** [install] Error 127

What? rsync? Why would I need to install a cloud download/upload software?

Anyway, I installed it, then the output changed to:

cp urn-gtk /usr/local/bin
cp urn.desktop /usr/share/applications
for size in 16 22 24 32 36 48 64 72 96 128 256 512; do \
  convert urn.svg -resize "$size"x"$size" \
          /usr/share/icons/hicolor/"$size"x"$size"/apps/urn.png ; \
done
gtk-update-icon-cache -f -t /usr/share/icons/hicolor
gtk-update-icon-cache: Cache file created successfully.
cp urn-gtk.gschema.xml /usr/share/glib-2.0/schemas
glib-compile-schemas /usr/share/glib-2.0/schemas
mkdir -p /usr/share/urn/themes
rsync -a --exclude=".*" themes /usr/share/urn

Now Urn actually appears in the menu as a program, yay! Readme should definitely be updated a lot.

Next problem: I start it and it opens a file selection dialog. Why? What should I select? I can also close the file selection window, then I get a black square and a "File" menu with open, save, close, etc. But no "new" or anything that sounds like I could start timing stuff.

ghost commented 5 years ago

The file selection dialog is to select a splits json file to open. You can test it by opening sotn.json in the splits folder. Otherwise, you have to make your own splits file using this json format.

Fabian42 commented 5 years ago

Awesome, seems to work great! I also installed it on my real computer now, worked fine as well.

But only in the default configuration. The readme says I need gsettings, which is indeed a command, but it doesn't tell me how to use it. I've tried stuff like gsettings --schemadir wildmouse.urn list-schemas and a few others, it always tells me:

Could not load schemas from wildmouse.urn: Failed to open file 'wildmouse.urn/gschemas.compiled': open() failed: No such file or directory
ghost commented 5 years ago

gsettings list-keys wildmouse.urn But even I struggled to use gsettings to change the configuration keys and ended up modifying urn-gtk.gschema.xml and recompiling.

Fabian42 commented 5 years ago

Seems to work fine for me:

fabian@debian:~$ gsettings get wildmouse.urn global-hotkeys
false
fabian@debian:~$ gsettings set wildmouse.urn global-hotkeys true
fabian@debian:~$ gsettings get wildmouse.urn global-hotkeys
true

Thank you a lot for your help! Now the only thing left to do is updating readme so that other people don't get the same issues.

ptkato commented 5 years ago

When I try to compile I get

Error: 4 unsupported relocations
Error: 4 unsupported relocations
convert: MagickCore/opencl.c:1495: CopyMagickCLCacheInfo: Assertion `pixels == info->pixels' failed.
/bin/sh: line 1:  3944 Aborted                 (core dumped) convert urn.svg -resize "$size"x"$size" /usr/share/icons/hicolor/"$size"x"$size"/apps/urn.png
make: *** [GNUmakefile:28: install] Error 134

multiple times, however an executable is created, and when run it, I get

(urn-gtk:4021): GLib-GIO-ERROR **: 16:36:02.832: Settings schema 'wildmouse.urn' is not installed
fish: “./urn-gtk” terminated by signal SIGTRAP (Trace or breakpoint trap)

I'm completely clueless

ghost commented 5 years ago

For the error during compilation, this is because imagemagick is needed but the developers forgot to specify it as a dependency.

For the error during runtime, try to install gsettings-desktop-schemas.

ptkato commented 5 years ago

I have both packages installed already.

ghost commented 5 years ago

I'm unsure for the compilation error, I don't understand what makes imagemagick crash, but I don't think it's quite important since it's only installing the icon. For the runtime crash, according to this github issue, running glib-compile-schemas /usr/share/glib-2.0/schemas/ as root could fix it. I can't help much besides googling those error messages for you, I don't know GTK+ well.