jendrikseipp / rednotebook

RedNotebook is a cross-platform journal
https://rednotebook.app
GNU General Public License v2.0
489 stars 111 forks source link

Up to date MacOS installer #322

Closed gagarine closed 1 year ago

gagarine commented 7 years ago

The option to install it on MacOS are to complex (on top of that macport is relatively unstable and messy) for most users. Would be great to generate a MacOS app.

jendrikseipp commented 7 years ago

I completely agree. Unfortunately, I don't have a Mac. If somebody started working on that, I'd be glad to help out.

gagarine commented 7 years ago

I will test https://github.com/twostairs/paperwork if it doesn't fit my need I will certainly come back on this issue. I think the first step would be to create a brew script.

jendrikseipp commented 7 years ago

@milysun has recently installed RedNotebook successfully on MacOS. Here are the instructions (please keep in mind that for the most recent version you need newer versions of the dependencies (https://github.com/jendrikseipp/rednotebook/blob/master/README.md), e.g. Python 3):

Basically the blog back in 2010 is the guideline. https://jamesthedisciple.wordpress.com/2010/04/09/rednotebook-on-osx-how-to/

I've tried both the jhbuild method to compile and also used "brew install pygobject3 --with-python3 gtk+3". However because I used anaconda for my python3, the gi package was not installed to the correct directory and could not be found. I realised this too late and wasted too much time compiling different version of modules, so I can't really tell the minimal necessary steps need to be taken. Eventually I found the gi package folder should be placed under anaconda directory and move it over, problem solved and the RNB runs happily. I also install gdk-pixbuf2 through homebrew but as I said I have no idea if it's necessary or sufficient. Only additional package required is the gnome-icon-theme otherwise RNB can not find correct icons.

Here is the text from https://jamesthedisciple.wordpress.com/2010/04/09/rednotebook-on-osx-how-to/:

This is a short how-to for using RedNotebook on OSX Snow Leopard. Firstly, some notes: I am not an expert on doing these things. Below is just a guide and following them is done at your own risk, just because it works for me doesn’t mean it will work for you. For getting RedNotebook to run was a bit of trail and error and as I haven’t worked out all the reasons for doing this way and not streamlining it, it is a little long winded. And so onward…

What is RedNotebook and why use it? I have been using it for some time for my journal and notes for my blogs. It runs great on GNU/Linux and has a Windows installer, but I don’t use Windows very much and I do have an Apple machine. And to quote the RedNotebook home page “RedNotebook is a graphical diary and journal helping you keep track of notes and thoughts. It includes a calendar navigation, customizable templates, export functionality and word clouds. You can also format, tag and search your entries.”

I didn’t work out how to run it on OSX for my self completely, I used a few guides, tried each and it worked. In theory, you just be able to follow the instructions at Softpedia which is laid out (along with the other) below so all I did is in one place.

RedNotebookis needs python, gtk and PyYaml to run. It would also be useful to have the Developer Tools (XCode) 2.3 or newer; 2.5 or 3.x is recommended (availble from Apple (requires id) for free). So here is what I did.

Downloaded RedNotebook and unpacked it. Downloaded PyYaml formhere and unpacked it.

I have MacPorts installed so I first installed what I thought was needed (in terminal):-

$: sudo port install python_select python26 py26-gtk py26-webkitgtk gnome-python26-extras py26-yaml

Then cd’d in rednotebook directory and did the same

$: sudo python setup.py install

Then:

$ rednotebook

To see if it would work or give me pointers as to what is missing.

As this didn’t work fully I did PyYAML directly. Then cd’d in to PyYAML directory the in terminal:

$: python setup.py build $: sudo python setup.py install

Some of the packages are not recognised as being installed so next on to installing GTK and Py-GTK using jhbuild. The problem is that jhbuild will fail if macports or fink is on the system, so two choices exist, remove macports/fink or create another user with admin rights, log out and log into new account. I did the latter Then: I downloaded and installed git (from here because I needed for GTK-OSX Once git was installed I then Downloaded gtk-osx-setup.sh to my home directory and ran it with

$ sh gtk-osx-build-setup.sh

This installs jhbuild in ~/.local/bin/jhbuild. It will also install ~/.jhbuildrc and ~/.jhbuildrc-custom and will copy the current gtk-osx modules into ~/Source/jhbuild/modulesets. (If you’re running Tiger see here as some of Tiger’s software need upgrading) As jhbiuld is installed in ~/.local/bin you must either add that path to your path, alias jhbuild, or call jhbuild with that path, eg.

$ ~/.local/bin/jhbuild shell

I chose to type in terminal:

$ echo ‘export PATH=~/.local/bin/jhbuild:$PATH’ >> ~/.profile

Closed terminal and then opened again. Then

$ jhbuild bootstrap $ jhbuild build meta-gtk-osx-bootstrap $ jhbuild build meta-gtk-osx-core

The boostrap was successful but the other two weren’t. When a module fails you are presented with a menu. I always tried number 1 first and went down the list in order to see what each did. On most occasions the module was skipped and jhbuild moved on to the next until it could go no further. I did this for osx-bootstrap and osx-core. Once done I logged out and logged back into my original account and fired up the terminal. I then cd’d into PyYAML and ran the command:

$: sudo python setup.py install

then

$ rednotebook

And it worked,

The pywebkit installed with macports is for some new features. It is available here which you can download and compile the usual way (read install notes that comes with the package)

I hope this helps someone to enjoy the very useful RedNotebook on OSX Snow Leopard.

jendrikseipp commented 7 years ago

@milysun: Do you know how to create dmg files?

milysun commented 7 years ago

@jendrikseipp Hi, sorry I am pretty much a newbie to Mac and quite ignorant in python as well, so I don't know what's required and how to make a dmg file that solves/contains all required dependents.

oussjarrousse commented 5 years ago

I am not familiar with creating .dmg files. Anyway, I wrote this guide for installing from source. Maybe it could help creating the next installer .dmg... https://jarrousse.org/installing-rednotebook-from-source-on-mac-os-x/

jendrikseipp commented 5 years ago

Awesome, thank you! I'll link to your post from the homepage.

liwoxa commented 5 years ago

@oussjarrousse Thanks! I followed your directions but unfortunately upon running the rednotebook executable got the error

[..] os.path.join(filesystem.frame_icon_dir, 'rednotebook.svg'))
gi.repository.GLib.Error: gdk-pixbuf-error-quark: Couldn’t recognize the image file format for file “[..]/rednotebook/images/rednotebook-icon/rednotebook.svg”

Any idea why?

I tried poking around a little, and found that there is no svg in gdk-pixbuf-query-loaders (see contents below), maybe that is the problem. I got the idea here.

  $ gdk-pixbuf-query-loaders

# GdkPixbuf Image Loader Modules file
# Automatically generated file, do not edit
# Created by gdk-pixbuf-query-loaders from gdk-pixbuf-2.40.0
#
# LoaderDir = /usr/local/Cellar/gdk-pixbuf/2.40.0/lib/gdk-pixbuf-2.0/2.10.0/loaders
#
"/usr/local/Cellar/gdk-pixbuf/2.40.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ani.so"
"ani" 4 "gdk-pixbuf" "Windows animated cursor" "LGPL"
"application/x-navi-animation" ""
"ani" ""
"RIFF    ACON" "    xxxx    " 100

"/usr/local/Cellar/gdk-pixbuf/2.40.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-bmp.so"
"bmp" 5 "gdk-pixbuf" "BMP" "LGPL"
"image/bmp" "image/x-bmp" "image/x-MS-bmp" ""
"bmp" ""
"BM" "" 100

"/usr/local/Cellar/gdk-pixbuf/2.40.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-gif.so"
"gif" 4 "gdk-pixbuf" "GIF" "LGPL"
"image/gif" ""
"gif" ""
"GIF8" "" 100

"/usr/local/Cellar/gdk-pixbuf/2.40.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-icns.so"
"icns" 4 "gdk-pixbuf" "MacOS X icon" "GPL"
"image/x-icns" ""
"icns" ""
"icns" "" 100

"/usr/local/Cellar/gdk-pixbuf/2.40.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-ico.so"
"ico" 5 "gdk-pixbuf" "Windows icon" "LGPL"
"image/x-icon" "image/x-ico" "image/x-win-bitmap" "image/vnd.microsoft.icon" "application/ico" "image/ico" "image/icon" "text/ico" ""
"ico" "cur" ""
"  \001   " "zz znz" 100
"  \002   " "zz znz" 100

"/usr/local/Cellar/gdk-pixbuf/2.40.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-jpeg.so"
"jpeg" 5 "gdk-pixbuf" "JPEG" "LGPL"
"image/jpeg" ""
"jpeg" "jpe" "jpg" ""
"\377\330" "" 100

"/usr/local/Cellar/gdk-pixbuf/2.40.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-png.so"
"png" 5 "gdk-pixbuf" "PNG" "LGPL"
"image/png" ""
"png" ""
"\211PNG\r\n\032\n" "" 100

"/usr/local/Cellar/gdk-pixbuf/2.40.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-pnm.so"
"pnm" 4 "gdk-pixbuf" "PNM/PBM/PGM/PPM" "LGPL"
"image/x-portable-anymap" "image/x-portable-bitmap" "image/x-portable-graymap" "image/x-portable-pixmap" ""
"pnm" "pbm" "pgm" "ppm" ""
"P1" "" 100
"P2" "" 100
"P3" "" 100
"P4" "" 100
"P5" "" 100
"P6" "" 100

"/usr/local/Cellar/gdk-pixbuf/2.40.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-qtif.so"
"qtif" 4 "gdk-pixbuf" "QuickTime" "LGPL"
"image/x-quicktime" "image/qtif" ""
"qtif" "qif" ""
"abcdidsc" "xxxx    " 100
"abcdidat" "xxxx    " 100

"/usr/local/Cellar/gdk-pixbuf/2.40.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-tga.so"
"tga" 4 "gdk-pixbuf" "Targa" "LGPL"
"image/x-tga" ""
"tga" "targa" ""
" \001\001" "x  " 100
" \001\t" "x  " 100
"  \002" "xz " 99
"  \003" "xz " 100
"  \n" "xz " 100
"  \v" "xz " 100

"/usr/local/Cellar/gdk-pixbuf/2.40.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-tiff.so"
"tiff" 5 "gdk-pixbuf" "TIFF" "LGPL"
"image/tiff" ""
"tiff" "tif" ""
"MM *" "  z " 100
"II* " "   z" 100
"II* \020   CR\002 " "   z zzz   z" 0

"/usr/local/Cellar/gdk-pixbuf/2.40.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-xbm.so"
"xbm" 4 "gdk-pixbuf" "XBM" "LGPL"
"image/x-xbitmap" ""
"xbm" ""
"#define " "" 100
"/*" "" 50

"/usr/local/Cellar/gdk-pixbuf/2.40.0/lib/gdk-pixbuf-2.0/2.10.0/loaders/libpixbufloader-xpm.so"
"xpm" 4 "gdk-pixbuf" "XPM" "LGPL"
"image/x-xpixmap" ""
"xpm" ""
"/* XPM */" "" 100

By the way, in your post there are some missing calls to cd, after mkdir and wget in particular.

oussjarrousse commented 5 years ago

@liwoxa thanks for the review. I've updated the article and added some missing "cd" commands. I also noticed that GTK changed the url of the installation/build shell script and i update that aswell.

Regarding the error message it could be that GTK does not recognise the svg file format. did this command succeed?

brew install librsvg

If you managed to solve the issue, i would appreciate if you add the solution here.

oussjarrousse commented 5 years ago

Regarding the MacOS Installer: there are two solutions:

I could look into both solutions, and i would appreciate it if someone is willing to help (I don't like working on my own) :-)

jendrikseipp commented 5 years ago

It would be great if you guys could look into one of the two solutions. Since I don't have a Mac, I can't help out much though. If you go for the *.dmg solution, I think it would be ideal if we could add a travis-ci script that builds a dmg for each push to the repo in their macOS containers.

echaz commented 4 years ago

The brew recipe looks like the easier option, as X is a prerequisite of this app working on mac, as it stands right now, and getting some of those packages up and running aren't trivial, unless someone is willing to do a native port.

oussjarrousse commented 2 years ago

I just managed to bundle the latest version of rednotebook as a rednotebook.app using PyInstaller. I am currently testing the solution. If all is running well. I would proceed by creating a brew cask for rednotebook rather than a brew formula.

my fork containing the required configurations for pyinstaller: https://github.com/oussjarrousse/rednotebook an blog post about bundling rednotebook for mac os x with pyinstaller: https://blog.jarrousse.org/2022/10/19/packaging-rednotebook-for-mac-os-x-with-pyinstaller/

looking forward for your feedback, and improvement suggestions.

jendrikseipp commented 2 years ago

That's great news @oussjarrousse! And I like the blog post :-) It would be awesome if you could open a pull request for this. I suggest to put all the extra files that can't be autogenerated into a new "macos" directory, next to the "win" directory. But it seems that you could also simply put all instructions for generating the rednotebook.app file into a new GitHub Actions workflow file.

jendrikseipp commented 1 year ago

Let's continue the discussion in issue #607, which is more up to date.