pikpik / minix-pkgsrc

13 stars 12 forks source link

Ready for testing: dbus-port by Morgawr #6

Open Morgawr opened 13 years ago

Morgawr commented 13 years ago

Hey guys... I've ported dbus, it's in the dbus-branch...

I honestly don't know how well this would work and how much it will be needed, being minix3 a micro-kernel and everything, but I was trying to build emacs and dbus was needed for that so... why not? :)

Before you try to install it, though, you need to create a group called dbus and a user called dbus in the dbus group.

After that, it builds beautifully (at least to me).

All I had to do was patch two .c files (patches in the files folder of the package) with a !defined(_MINIX) flag because the OS wasn't recognizing two macros... I know this may be a quick and dirty hack, but it appears to be working now. If anyone has better ideas let me know :)

pikpik commented 13 years ago

Hi!

On your "dbus-branch," sysutils/dbus isn't building for me.

It says:

checking for XML_ParserCreate_MM in -lexpat... no configure: error: Explicitly requested expat but expat not found

This wasn't on a fresh virtual machine though, so I'll retry later to be certain.

pikpik commented 13 years ago

Hi,

Ok, it builds for me two ways:

  1. After building and installing expat, and
  2. After installing the package of expat from Ben Gras' repository.

So, I guess the current binary package of expat was the problem.

About your changes themselves, I think they look good. I'm not completely sure which is more correct, "__minix" or "_MINIX," but either should be fine. By the way, did you use "pkgvi" to edit the original files in the work directory? If not, I think it would be best to.

The remaining issues are:

  1. Has D-BUS been tested with a program that depends on it, such as Emacs?
  2. Is this user & group requirement an issue?
    • It seems reasonable, but wouldn't it cause this package and its dependents to fail during bulk builds?
    • Maybe we could ask on #pkgsrc if they know if there's a proper way of dealing with that (i.e. users should just add the user and group manually, the package should do it somehow, or MINIX should have the user and group added by default)?
Morgawr commented 13 years ago

No, I didn't use pkgvi to edit the original files, I just edited them manually and then moved to the "files" directory (or whatever is the name, I forgot :P ) and then added the patching in the post-install in the Makefile. I know it's pretty unorthodox, but I tried to imitate the pkgsrc structure I've seen in other packages (like Python for example). I didn't know there was another way.

As for the _MINIX flag, I think that's the right flag cause it's the same one passed in all compiling packages from the Makefile...

1) I haven't yet tested D-BUS with any program, I tried to compile Emacs but I had other issues and I haven't looked into it yet (I might if no one else does), however at startup the Minix OS does say something about dbus successfully running as user process (or something like that) so I think it is being successfully recognized by the OS..

2) Yes, the user&group stuff is really bothersome, especially for people who want an automatic installation... I have no idea how other package managers for other linux distro handle it (like apt-get, pacman, portage etc etc), but I seem to remember installing dbus on my arch with a simple "pacman -S dbus", so I don't know what kind of magic happens there. Maybe there's a way to setup an automatic script in the pkgsrc that creates those groups?

pikpik commented 13 years ago

About pkgvi:

Ok, let's try cleaning up the changes then. It should allow our MINIX-specific changes to be accepted upstream (NetBSD and the official pkgsrc) with few issues.

Here's basically how to do this:

  1. A package is broken, and you want to fix it.
  2. Install pkgtools/pkgdiff. (This also installs pkgvi.)
  3. Clean the package's work directory (bmake clean or rm -rf /usr/tmp/work/.../package).
  4. Only apply patches for the package (bmake patch); don't build it yet.
  5. Go to the work directory.
  6. Use pkgvi to edit files there. (Pkgvi uses vi by default, but, for example, EDITOR=nano pkgvi path/to/file.c will use Nano.)
  7. Go back to the pkgsrc directory (pkgsrc/.../package).
  8. Build the package (bmake).
  9. If it builds, make patches for it:
    • mkpatches -d patches
    • rm patches/*.orig
    • bmake mdi
  10. Clean & build again.
  11. If it works, then your done. :)

There are two guides for this. Rely on the MINIX one, but keep the official one in mind:

About _MINIX:

I prefer using __minix. But yes, it should be absolutely fine.

About testing D-BUS:

That sounds good. I guess it's normal to submit things that at least build for now. It would be best to test it with something that definitely uses it though, if that's possible.

About the user & group stuff:

Yeah, I'm not sure either. That's why I think we should ask on #pkgsrc (Freenode). :)

Morgawr commented 13 years ago

Thanks for the help and tips, I'm going to check all this now and see if I can get it to run using pkgvi and pkgdiff.. :)

pikpik commented 13 years ago

You're welcome. :)

Sorry for the gigantic headings. I'm still getting used to GitHub's Markdown.

Morgawr commented 13 years ago

Okay, I cleaned up the changes and used pkgvi as you suggested. It should be working now, please test it out because I might have screwed up the git commit (I still have some problems with git... ).

Anyhow, adding the DBUS_ENABLE="YES" line in rc.conf file (in /etc) should've started the dbus process at boot, however it still seems to be giving problems... seems to be complaining about user/group for dbus... I have absolutely no idea how to fix this and I also don't know if dbus actually run/works, I don't know which programs use it so, if someone could actually test it for me (or tell me how to) it would be awesome.

pikpik commented 13 years ago

Okay, I cleaned up the changes and used pkgvi as you suggested. It should be working now, please test it out because I might have screwed up the git commit (I still have some problems with git... ).

The commit looks good, and it built and installed with no problems whatsoever. It's really looking great!

Anyhow, adding the DBUS_ENABLE="YES" line in rc.conf file (in /etc) should've started the dbus process at boot, however it still seems to be giving problems... seems to be complaining about user/group for dbus... I have absolutely no idea how to fix this and I also don't know if dbus actually run/works,

Well, it looks like it does indeed run at start-up, hence the error message. My best guess about the user/group error is to ask the MINIX team what they think: should we port D-BUS to using MINIX's API or wait for the NetBSD userland GSoC project to complete?

I don't know which programs use it so, if someone could actually test it for me (or tell me how to) it would be awesome.

I don't have any good ideas about programs that stress D-BUS, but I can look.

Thank you very much for all the effort you've put into this! :)