After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 415694 - Support for non standard packages build - udev
Support for non standard packages build - udev
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2007-03-07 13:20 UTC by Luca Ferretti
Modified: 2007-04-03 18:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Enable the building of libvolume_id, so that we can build hal-0.5.8 (4.71 KB, patch)
2007-03-18 01:53 UTC, Elijah Newren
none Details | Review
Patch to compile HAL 0.5.8.1 (1.59 KB, text/plain)
2007-03-27 18:20 UTC, Frederic Peters
  Details
Build libvolume_id and newer HAL (0.5.9) (8.23 KB, patch)
2007-04-03 08:40 UTC, Frederic Peters
committed Details | Review

Description Luca Ferretti 2007-03-07 13:20:11 UTC
The real issue why I'm reporting this bug is make jhbuild able to provide libvolume-id heades (udev) needed bu recent HAL package.

Whithout libvolume-id jhbuild is using an old HAL version, forcing GNOME 2.18 to depend on this (see ExternalDeps on live.gnome.org)

I tried to add a rule for udev, but there are some issues:
  1 patch sources to change Makefiles rules (from garnome)
  2 no autoconf.sh/configure script
  3 custom args to run "make"
  4 custom args to run "make install"

## 1 ##
From garnome, we have to remove some "usr" references, for example, change includedir from "${prefix}/usr/include" to  "${prefix}/include"

Note that currently jhbuild seems able to apply patches only to <tarball> targets. It could useful add <patch> feature to <autotool> targets.

## 2 ##
udev package don't use autoconf/configure (it's a kernel level package).

Using <tarball>, there is no way to set a custom autogen/configure script (something like use-configure="true")

## 3 ##
From garnome build rule for udev, the "make" step for udev is:

   make EXTRAS=extras/volume_id prefix=$(prefix)

So we need to provide makeargs and pass $prefix to them.

Or we need something like use-make="make ...."

## 4 ##
From garnome build rule for udev, the "install" step for udev is:

   make -C extras/volume_id prefix=$(prefix) install-bin install-man
  
Same as 3, we need to provide args or a new option to set a custom install command.
Comment 1 Luca Ferretti 2007-03-07 13:25:07 UTC
Index: modulesets/gnome-2.18.modules
===================================================================
--- modulesets/gnome-2.18.modules       (revisione 1401)
+++ modulesets/gnome-2.18.modules       (copia locale)
@@ -38,6 +38,16 @@
   <repository type="git" name="git.imendio.com"
     href="git://git.imendio.com/projects/"/>
 
+  <tarball id="udev" version="105"
+                 autogen-sh="true"
+                 makeargs="EXTRAS=extras/volume_id prefix=$prefix">
+    <source href="http://www.us.kernel.org/pub/linux/utils/kernel/hotplug/udev-105.tar.bz2"
+           size="187920" md5sum="e789686432bfdcb6ec23661b111364fa"/>
+    <patches>
+      <patch file="libvolume_id_Makefile.patch" strip="1"/>
+    </patches>
+  </tarball>
+

##################################à

This is the change I applied to my jhbuild sandbox. 

In my first attemp I used <autotools> target, but the patch wasn't applied (the autogen step was successully ignored) and $target wasn't expansed to /opt/gnome2. 

So I tried to switch to <tarball>, but of course the autogen-sh="true" was ignored.
Comment 2 Elijah Newren 2007-03-07 20:47:02 UTC
Awesome, thanks for working on this.  I'm sure it'll require patches to jhbuild itself, but I don't see any way around that.

Note that you should definitely build from tarballs.  We don't want any cvs/svn/git versions of any external dependencies (yeah, we still have one for firefox/xulrunner, but that's a mistake in my opinion and we should correct it).
Comment 3 Luca Ferretti 2007-03-07 21:39:55 UTC
> Note that you should definitely build from tarballs.  We don't want any
> cvs/svn/git versions of any external dependencies (yeah, we still have one for
> firefox/xulrunner, but that's a mistake in my opinion and we should correct
> it).

Of course, I also think this should go to bootstrap.

BTW please note that <autotool> target is able to build from tarball, see the bootstrap.modules. If I'm right, <autotool> is the recent multi-purpose replacement for any kind of source (cvs/svn/git/tarball), so we should ideally use it instead <tarball>

Comment 4 Elijah Newren 2007-03-07 22:03:06 UTC
(In reply to comment #3)
> BTW please note that <autotool> target is able to build from tarball, see the
> bootstrap.modules. If I'm right, <autotool> is the recent multi-purpose
> replacement for any kind of source (cvs/svn/git/tarball), so we should ideally
> use it instead <tarball>

Oh right, I keep forgetting about that.  Thanks for the reminder.  :) 

Comment 5 Elijah Newren 2007-03-17 23:15:42 UTC
(In reply to comment #0)
> Note that currently jhbuild seems able to apply patches only to <tarball>
> targets. It could useful add <patch> feature to <autotool> targets.

I don't believe this is true.  I think you can make it work by just making sure that <patch> is a subnode of <branch> (which is a subnode of <autotool>), rather than making <patch> a subnode of <patches> (which is a subnode of <tarball>).  See the libtool entry in modulesets/bootstrap.modules.
Comment 6 Elijah Newren 2007-03-18 01:53:11 UTC
Created attachment 84811 [details] [review]
Enable the building of libvolume_id, so that we can build hal-0.5.8

Here's a patch that adds libvolume_id to freedesktop-2.18.modules (the same entry can be cut-and-pasted for 2.20) and adds the necessary hooks/changes to enable it to build.  Not sure if this is the way James/Frederic would want to see it done, but at least it's a reference point.  Let me know if I should change something.  The basic modifications I made:
  - Add a skip-autogen flag
  - Add a makeinstallargs, since the install target is special for libvolume_id
  - Perform substition on '${prefix}', if contained in makeargs or
    makeinstallargs (so that installation location can be specified)

Oh, and also using autogen-sh="true" as suggested by Luca doesn't work anymore.  jhbuild will attempt to run "./true" rather than "true", and of course there won't be any executable named true in the current directory.
Comment 7 Luca Ferretti 2007-03-19 13:29:41 UTC
Maybe a fresh "skip-autogen" is better then a stupid trick like use true(1) :-)

I tried the patch and seems to work fine: here is the console log on my terminal.

########################

patch -p1 < "/home/luca/cvs/gnome2/jhbuild/patches/libvolume_id_Makefile.patch"
patching file extras/volume_id/Makefile
Hunk #1 succeeded at 15 with fuzz 1.
patching file extras/volume_id/lib/Makefile
*** Building libvolume_id *** [1/1]

make EXTRAS=extras/volume_id prefix=/opt/gnome2 
  GENHDR   udev_version.h
  CC       udev_device.o
  CC       udev_config.o
  CC       udev_node.o
  CC       udev_db.o
  CC       udev_sysfs.o
  CC       udev_rules.o
  CC       udev_rules_parse.o
  CC       udev_utils.o
  CC       udev_utils_string.o
  CC       udev_utils_file.o
  CC       udev_utils_run.o
  CC       udev_sysdeps.o
  AR       libudev.a
  RANLIB   libudev.a
  CC       udevd.o
  LD       udevd
  CC       udevtrigger.o
  LD       udevtrigger
  CC       udevsettle.o
  LD       udevsettle
  CC       udevcontrol.o
  LD       udevcontrol
  CC       udevmonitor.o
  LD       udevmonitor
  CC       udevinfo.o
  LD       udevinfo
  CC       udevtest.o
  LD       udevtest
  CC       test-udev.o
  LD       test-udev
  CC       udevstart.o
  LD       udevstart
make[1]: Entering directory `/home/luca/cvs/gnome2/udev-105/extras/volume_id'
  CC       vol_id.o
make[2]: Entering directory `/home/luca/cvs/gnome2/udev-105/extras/volume_id/lib'
  CC       ext.o
  CC       fat.o
  CC       hfs.o
  CC       highpoint.o
  CC       isw_raid.o
  CC       lsi_raid.o
  CC       via_raid.o
  CC       silicon_raid.o
  CC       nvidia_raid.o
  CC       promise_raid.o
  CC       adaptec_raid.o
  CC       jmicron_raid.o
  CC       iso9660.o
  CC       jfs.o
  CC       linux_raid.o
  CC       linux_swap.o
  CC       lvm.o
  CC       ntfs.o
  CC       reiserfs.o
  CC       udf.o
  CC       ufs.o
  CC       xfs.o
  CC       cramfs.o
  CC       hpfs.o
  CC       romfs.o
  CC       sysv.o
  CC       minix.o
  CC       gfs.o
  CC       luks.o
  CC       ocfs.o
  CC       vxfs.o
  CC       squashfs.o
  CC       netware.o
  CC       volume_id.o
  CC       util.o
  AR       libvolume_id.a
  RANLIB   libvolume_id.a
  CC       .shlib/ext.o
  CC       .shlib/fat.o
  CC       .shlib/hfs.o
  CC       .shlib/highpoint.o
  CC       .shlib/isw_raid.o
  CC       .shlib/lsi_raid.o
  CC       .shlib/via_raid.o
  CC       .shlib/silicon_raid.o
  CC       .shlib/nvidia_raid.o
  CC       .shlib/promise_raid.o
  CC       .shlib/adaptec_raid.o
  CC       .shlib/jmicron_raid.o
  CC       .shlib/iso9660.o
  CC       .shlib/jfs.o
  CC       .shlib/linux_raid.o
  CC       .shlib/linux_swap.o
  CC       .shlib/lvm.o
  CC       .shlib/ntfs.o
  CC       .shlib/reiserfs.o
  CC       .shlib/udf.o
  CC       .shlib/ufs.o
  CC       .shlib/xfs.o
  CC       .shlib/cramfs.o
  CC       .shlib/hpfs.o
  CC       .shlib/romfs.o
  CC       .shlib/sysv.o
  CC       .shlib/minix.o
  CC       .shlib/gfs.o
  CC       .shlib/luks.o
  CC       .shlib/ocfs.o
  CC       .shlib/vxfs.o
  CC       .shlib/squashfs.o
  CC       .shlib/netware.o
  CC       .shlib/volume_id.o
  CC       .shlib/util.o
  CC       libvolume_id.so.0.75.0
  GENPC    libvolume_id.pc
make[2]: Leaving directory `/home/luca/cvs/gnome2/udev-105/extras/volume_id/lib'
  LD       vol_id
make[1]: Leaving directory `/home/luca/cvs/gnome2/udev-105/extras/volume_id'
*** Installing libvolume_id *** [1/1]

make -C extras/volume_id prefix=/opt/gnome2 install-bin install-man
make: Entering directory `/home/luca/cvs/gnome2/udev-105/extras/volume_id'
install -c -D vol_id /opt/gnome2/lib/udev/vol_id
make -C lib install
make[1]: Entering directory `/home/luca/cvs/gnome2/udev-105/extras/volume_id/lib'
install -c -m 644 -D libvolume_id.h /opt/gnome2/include/libvolume_id.h
install -c -m 755 -D libvolume_id.a /opt/gnome2/lib/libvolume_id.a
install -c -m 755 -D libvolume_id.so.0.75.0 /opt/gnome2/lib/libvolume_id.so.0.75.0
ln -sf /opt/gnome2/lib/libvolume_id.so.0.75.0 /opt/gnome2/lib/libvolume_id.so.0
ln -sf /opt/gnome2/lib/libvolume_id.so.0.75.0 /opt/gnome2/lib/libvolume_id.so
install -c -m 644 -D libvolume_id.pc /opt/gnome2/lib/pkgconfig/libvolume_id.pc
make[1]: Leaving directory `/home/luca/cvs/gnome2/udev-105/extras/volume_id/lib'
install -c -m 644 -D vol_id.8 /opt/gnome2/share/man/man8/vol_id.8
make: Leaving directory `/home/luca/cvs/gnome2/udev-105/extras/volume_id'
*** success *** [1/1]

######################

It seems that garnome's patch (libvolume_id_Makefile.patch) needs a little love before using (it's available here[1]).

I'll try to update hal package in my sandbox.


[1] http://svn.gnome.org/viewcvs/garnome/trunk/bootstrap/libvolume_id/files/libvolume_id_Makefile.patch?revision=4867
Comment 8 Luca Ferretti 2007-03-19 14:08:57 UTC
OK, I tried to update hal from 0.5.7.1 to 0.5.8.1. I disabled PolicyKit from build (autogenargs="--disable-policy-kit"), while it's strongly discouraged. 

Ufortunately I've now some build troubles. In fact:

###################

creating hald-probe-hiddev
if gcc -DHAVE_CONFIG_H -I. -I. -I../../.. -DPACKAGE_SYSCONF_DIR=\""/opt/gnome2/etc"\" -DPACKAGE_DATA_DIR=\""/opt/gnome2/share"\" -DPACKAGE_BIN_DIR=\""/opt/gnome2/bin"\" -DPACKAGE_LOCALE_DIR=\""/opt/gnome2/share/locale"\" -DPACKAGE_LOCALSTATEDIR=\""/opt/gnome2/var"\" -I../../.. -I/opt/gnome2/include/glib-2.0 -I/opt/gnome2/lib/glib-2.0/include -I/opt/gnome2/include/dbus-1.0 -I/opt/gnome2/lib/dbus-1.0/include   -I/opt/gnome2/include/dbus-1.0 -I/opt/gnome2/lib/dbus-1.0/include      -g -O2 -lz -Wall -Wchar-subscripts -Wmissing-declarations -Wnested-externs -Wpointer-arith -Wcast-align -Wsign-compare -MT probe-storage.o -MD -MP -MF ".deps/probe-storage.Tpo" -c -o probe-storage.o probe-storage.c; \
        then mv -f ".deps/probe-storage.Tpo" ".deps/probe-storage.Po"; else rm -f ".deps/probe-storage.Tpo"; exit 1; fi
probe-storage.c:46:26: error: libvolume_id.h: Nessun file o directory
probe-storage.c: In function ‘main’:
probe-storage.c:119: error: ‘volume_id_log_fn’ undeclared (first use in this function)
probe-storage.c:119: error: (Each undeclared identifier is reported only once
probe-storage.c:119: error: for each function it appears in.)
probe-storage.c:428: warning: implicit declaration of function ‘volume_id_open_fd’
probe-storage.c:428: warning: nested extern declaration of ‘volume_id_open_fd’
probe-storage.c:428: warning: assignment makes pointer from integer without a cast
probe-storage.c:430: warning: implicit declaration of function ‘volume_id_probe_all’
probe-storage.c:430: warning: nested extern declaration of ‘volume_id_probe_all’
probe-storage.c:435: error: dereferencing pointer to incomplete type
probe-storage.c:435: error: ‘VOLUME_ID_FILESYSTEM’ undeclared (first use in this function)
probe-storage.c:436: error: dereferencing pointer to incomplete type
probe-storage.c:436: error: ‘VOLUME_ID_RAID’ undeclared (first use in this function)
probe-storage.c:437: error: dereferencing pointer to incomplete type
probe-storage.c:437: error: ‘VOLUME_ID_OTHER’ undeclared (first use in this function)
probe-storage.c:438: error: dereferencing pointer to incomplete type
probe-storage.c:438: error: ‘VOLUME_ID_CRYPTO’ undeclared (first use in this function)
probe-storage.c:443: warning: implicit declaration of function ‘volume_id_close’
probe-storage.c:443: warning: nested extern declaration of ‘volume_id_close’
make[5]: *** [probe-storage.o] Error 1
make[5]: Leaving directory `/home/luca/cvs/gnome2/hal-0.5.8.1/hald/linux/probing'
make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory `/home/luca/cvs/gnome2/hal-0.5.8.1/hald/linux'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/luca/cvs/gnome2/hal-0.5.8.1/hald'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/luca/cvs/gnome2/hal-0.5.8.1/hald'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/luca/cvs/gnome2/hal-0.5.8.1'
make: *** [all] Error 2

###################

But libvolume_id is checked using pkg-config (libvolume_id.pc) and in config.log I've VOLUME_ID_CFLAGS='-I/opt/gnome2/include  ' and VOLUME_ID_LIBS='-L/opt/gnome2/lib -lvolume_id  '. This is strange :-(

Oh, the moduleset entry I used is:

  <tarball id="hal" version="0.5.8.1" autogenargs="--disable-policy-kit">
    <source href="http://people.freedesktop.org/~david/dist/hal-0.5.8.1.tar.gz"
            md5sum="568d7ce9831c18a5e6e502abd6781257" size="1752840"/>
    <dependencies>
      <dep package="dbus-glib"/>
      <dep package="libvolume_id"/>
    </dependencies>
  </tarball>
Comment 9 Elijah Newren 2007-03-19 14:21:02 UTC
I'll look into this when I get back from my trip...
Comment 10 Frederic Peters 2007-03-27 08:33:42 UTC
I am back from my own trip and looked at patch in attachment 84811 [details] [review]; seems ok.
I will do some tests with it and a newer HAL.
Comment 11 Frederic Peters 2007-03-27 09:13:35 UTC
Luca: your problem is hald/linux/probing/Makefile.am missing @VOLUME_ID_CFLAGS@ in its INCLUDES= line. (not fixed in upstream git)

hald/linux/addons/Makefile.am is also missing -lz in that line:

  hald_addon_macbookpro_backlight_LDADD = $(top_builddir)/libhal/libhal.la -lpci @GLIB_LIBS@

(fixed in upstream git)

I also had a problem with configure not finding pkg-config, resolved by moving the D-BUS pkg check before the PolicyKit pkg check.  (fixed in upstream git)

Once those three problems were fixed, I was able to install HAL 0.5.8.1 with your moduleset <tarball> entry.
Comment 12 Frederic Peters 2007-03-27 17:26:16 UTC
David Zeuthen just commited the fix:
http://gitweb.freedesktop.org/?p=hal.git;a=commitdiff;h=6f5b3987d668863d1b1338bcac3a9e6390dbcaf7

Do we want to wait for HAL 0.5.9 with all the fixes or do we add 0.5.8.1 as is, along a big patch ?
Comment 13 Elijah Newren 2007-03-27 17:37:21 UTC
My personal opinion: While it is suboptimal to ship with patches, we've already been running with a patched 0.5.7.1 for a long time so I don't see the harm in switching to 0.5.8.1 with a big patch for now.  However, we should definitely start applying pressure for a clean 0.5.9 release if we don't get it soon.

Thanks for working on this, Luca and Frederic.
Comment 14 Frederic Peters 2007-03-27 18:20:38 UTC
Created attachment 85397 [details]
Patch to compile HAL 0.5.8.1

This is the straight HAL patch; covering configure.in and two Makefile.am; it should also include newly generated configure and Makefile.in but this produces
a 600KB patch, probably because I don't have the exact same autoconf and automake versions.

Could somebody with autoconf 2.59 and automake 1.9.6 give it a try so we have a smaller patch ?
Comment 15 Frederic Peters 2007-04-03 08:40:43 UTC
Created attachment 85754 [details] [review]
Build libvolume_id and newer HAL (0.5.9)

HAL 0.5.9 has been released, without any build glitch.  Updated patch to use that
version.  Elijah: is this ok for external deps ?
Comment 16 Elijah Newren 2007-04-03 15:11:50 UTC
Ah, only four months late.  ;-)  David said he'd be releasing 0.5.9 in early December when this issue erupted last September or so, and I believe at that time we said we'd plan on trying to update to 0.5.9 when it came out assuming it caused no big build issues.  So, yeah, let's update to it.

Thanks!
Comment 17 Frederic Peters 2007-04-03 18:46:13 UTC
2007-04-03  Frederic Peters  <fpeters@0d.be>

        * jhbuild/modtypes/autotools.py, patches/libvolume_id_Makefile.patch
        modulesets/gnome-external-deps-2.20.modules: added new makeinstallargs
        and skip-autogen attributes to <autotools> nodes; required to build
        libvolume_id, required for newer HAL versions.  Added libvolume_id (and
        patch required to build it) and updated HAL to 0.5.9 in GNOME 2.20
        external deps moduleset.