DMDircthe intelligent IRC client

Even more supported operating systems

Filed under: BSD, Installer, Linux, OSX, Plugins, Solaris, Windows — Shane on July 25, 2008 @ 10:46 pm — Permalink

With the upcoming version 0.6 of DMDirc (we know that it’s been a while since the last big release, we’ll blog about that soon) we have added support for even more operating systems.

As you probably know, DMDirc is written in Java which gives us a huge advantage as far as cross-platform compatibility is concerned. Java runs on all the major operating systems so most of the hard work has been done for us.

Up to DMDirc 0.5.6 we only supported Windows and Linux and provided a separate jar-only download for other platforms. For 0.6 the supported list of operating systems has more than doubled; we now package DMDirc for:

  1. Linux
  2. Windows
  3. OS X
  4. Open Solaris (and normal Solaris)
  5. BSD (tested on PC-BSD, which is FreeBSD at the core)

This pretty much covers all major non-server operating systems, which we are quite pleased about.

The Installer for DMDirc runs on all of the above systems (apart from OS X, which has its own installation method) and where possible can download and install Java automatically. Currently the only exception to this is BSD, where users will need to compile the jdk16 port manually — unfortunately Sun’s licensing prevents redistribution of the modified JRE used on BSD.

The nightly builds have been working on all of the above operating systems for a while now, and you can browse and download the installers from our nightly builds page.

OS X Support: Part 2

Filed under: Installer, OSX, Tech — Shane on June 13, 2008 @ 7:33 pm — Permalink

As previously mentioned, once Apple released Java6 for OS X I set about updating the scripts we use for building the installers and nightlies so that we could support OS X officially for DMDirc 0.6.

To do this we needed to be able to create a DMG file to distribute it in, and we wanted this to be done by our current build scripts. As you may be aware, we do all of our development on Ubuntu Linux (which we also use on the DMDirc build/web server) so our current build scripts are a bunch of bash scripts that build the various installers (.run files for Linux, and .exes for Windows).

Other projects exist which distribute their cross-platform releases on Linux, OS X and Windows, so I looked at the build processes for both Firefox and Inkscape which both have apple releases. Unfortunately both of these projects appear to use an Apple machine to create the releases. This roughly translated to the following:

	# DMDirc-dmg contains the files we want to put in the dmg
	hdiutil create -volname "DMDirc" -fs HFS+ -srcfolder DMDirc-dmg -format UDRW DMDirc.RW.dmg
	hdiutil attach DMDirc.RW.dmg
	bless -openfolder /Volumes/DMDirc
	hdiutil detach /Volumes/DMDirc
	hdiutil convert DMDirc.RW.dmg -format UDZO -imagekey zlib-level=9 -o DMDirc.dmg

Which, while it does work (and is what we use if the installer is being built on OS X), wasn’t an acceptable solution as it relied on an OS X install.

I then discovered a wiki page which describes a method that works under Linux. After compiling a Linux-compatible version of Apple’s mkhfs program we could now do something along the lines of:

	# DMDirc-dmg contains the files we want to put in the dmg
	SIZE=$((`du -sb DMDirc-dmg | awk '{print $1}'`  + 10))
	if [ ${SIZE} -lt 4194304 ]; then
		echo "Size is less than 4MB"
		SIZE=4194304;
	fi;
	dd if=/dev/zero of=DMDirc.img bs=${SIZE} count=1
	mkfs.hfsplus -v 'DMDirc' DMDirc.img

	mkdir DMDirc.img-mounted
	mount DMDirc.img-mounted
	MOUNTRES=${?}
	if [ ${MOUNTRES} -ne 0 ]; then
		# Try using full parameters - could be running as root.
		mount -t hfsplus -o loop DMDirc.img DMDirc.img-mounted
		MOUNTRES=${?}
	fi;
	if [ ${MOUNTRES} -ne 0 ]; then
		echo "Unable to mount, need root access or an fstab entry like:"
		echo "${PWD}/DMDirc.img ${PWD}/DMDirc.img-mounted auto users,noauto,loop 0 0"
		exit 1;
	fi;
	mv -fv $DMDirc-dmg/* DMDirc.img-mounted
	mv -fv DMDirc-dmg/.[A-Za-z]* DMDirc.img-mounted
	umount DMDirc.img-mounted
	mv DMDirc.img DMDirc.dmg

This was an improvement, as images could now be created under Linux, however it still also had lots of problems:

  • images have to be at least 4MB (compared to 1.3mb when created using the OS X method),
  • they’re created read-write (compared to read-only when created using the OS X method), and
  • they do not auto-open when mounted (the OS X method can “bless” the image).

After a short while, I discovered the gentoo wiki had a page on hfsplus, which had a version of diskdev-cmds that allowed for images that were as small as 512kb. Using this, I was able to edit the first part of above code to something like:

	# DMDirc-dmg contains the files we want to put in the dmg
	SIZE=$((`du -sb DMDirc-dmg | awk '{print $1}'`  + 10))
	if [ ${SIZE} -lt 524288 ]; then
		echo "Size is less than 512kb"
		SIZE=524288;
	fi;
	dd if=/dev/zero of=DMDirc.img bs=${SIZE} count=1
	mkfs.hfsplus -v 'DMDirc' DMDirc.img
	# however older versions of mkfs.hfs will only create 4mb+ sized images :/
	if [ $? -eq 1 ]; then
		if [ ${SIZE} -lt 4194304 ]; then
			echo "Size is less than 4MB"
			SIZE=4194304;
		fi;
		dd if=/dev/zero of=DMDirc.img bs=${SIZE} count=1
		mkfs.hfsplus -v 'DMDirc' DMDirc.img
	fi;

This still produced 3.8mb images, so basically had all the same problems as the old method. The actual code we used was also a lot less tidy as sometimes the size returned by du was too small, so the code looped increasing the size until it got a successful image.

However I recently discovered a much tidier method, which we now use. mkisofs has the ability to create and bless hfs images:

	# DMDirc-dmg contains the files we want to put in the dmg
	mkisofs -V 'DMDirc' -no-pad -r -apple -o "DMDirc-dmg" -hfs-bless "/Volumes/DMDirc" DMDirc.dmg

This code has the advantages of:

  • being much tidier than the old code,
  • not requiring a loop to get a correctly-sized image,
  • being able to bless the image,
  • creating a read-only image, and
  • not requiring a patched version of Apple’s diskdev-cmds

All that was left now was to fix the file size (which was still 3.8 mb). To do this, I found a new project (libdmg-hfsplus) which is a DMG manipulation library for Linux capable of producing compressed DMG files. I jumped at this, downloaded and compiled it, and came up with:

	# DMDirc-dmg contains the files we want to put in the dmg
	mkisofs -V 'DMDirc' -no-pad -r -apple -o "DMDirc-dmg" -hfs-bless "/Volumes/DMDirc" DMDirc.dmg.pre
	./dmg dmg DMDirc.dmg.pre DMDirc.dmg

I copied this image to an OS X machine and tried to open it and was greeted by a “CRC Mismatch” error. After digging around a little I found the cause of this (The code generates a “Master Checksum” which always seems to generate the same for converting DMGs using the code above, but OS X doesn’t like it), and produced a patched version of libdmg, which can be found on my personal website: http://shanemcc.co.uk/libdmg/, along with a script that will patch it for you if you want to compile your own.

With this newly patched version of the DMG binary from libdmg-hfsplus we are now able to produce DMDirc.dmg on both OS X and Linux with similar results (read-only, blessed and compressed).

It is also worth pointing out that Java 6 for OS X is no longer a “developer preview” only, and can be obtained by anyone with a 64-bit Intel-based Mac running 10.5.2 or later from the Apple website. I would imagine that it is also available using the software update facility in the Apple menu.

OS X nightly builds of DMDirc are available on the nightly builds page of the website.

OS X Support

Filed under: General, OSX, Tech — Shane on March 6, 2008 @ 10:41 am — Permalink

Now that Apple have re-released their ‘developer preview’ of Java 6, we can begin work on improving DMDirc’s compatibility with OS X. Currently the release only works on 64-bit Intel processors (Xeons or Core2Duos - not CoreDuos, CoreSolos or PowerPCs) running Leopard. They had previously released a developer preview for Tiger, but we do not have access to it, so are unable to tell how well it works with DMDirc (if at all).

If your machine fits the bill, you can download the developer preview from the Apple Developer site:

  • Go to http://www.apple.com/java
  • Click on “Java Downloads”
  • Click on “Java SE 6 Developer Preview” — This will redirect you to the ADC site.
  • Login to the ADC site (you may need to register first.)
  • Click on “Downloads”
  • Click on “Java” in the sidebar
  • Download the “Java SE 6 Developer Preview”
  • Install

Once you have the developer preview installed, you can download a nightly build of DMDirc from http://www.dmdirc.com/nightlies or you can build your own by checking out the source code from our subversion repository (if you have the developer tools installed) by running the following commands:

svn checkout http://dmdirc.googlecode.com/svn/trunk/ dmdirc
cd dmdirc/trunk/installer
./release.sh --target osx this
mv output/DMDirc.dmg ~/Desktop/DMDirc.dmg

Now you can mount the image, and drag DMDirc to the applications folder to install it.

However, at the moment there is a bug with the “First Run Wizard” that we use to extract plugins and actions for the first time, so you will need to run the following in a terminal prior to running the client to make it work. This assumes that you installed DMDirc into the Applications folder and not somewhere else.
Edit: This bug has been fixed.

mkdir -p ~/Library/Preferences/DMDirc/
cd ~/Library/Preferences/DMDirc/
unzip /Applications/DMDirc.app/Contents/Resources/Java/DMDirc.jar plugins/*.jar com/dmdirc/actions/defaults/*
mv com/dmdirc/actions/defaults actions
rm -Rf com
echo "general.firstRun=false" >> dmdirc.config
echo "general.addonrevision=10" >> dmdirc.config
echo "updater.enable=true" >> dmdirc.config
echo "general.submitErrors=true" >> dmdirc.config

The last two lines can be omitted if you do not wish to receive update notifications, or automatically send error reports to the developers. We would however prefer you to have them both enabled.

Now you can enjoy DMDirc on OS X :)

Feel free to raise any issues on our bug tracker, leave a comment here, or contact us in #DMDirc on Quakenet

Powered by WordPress