Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#25330 closed enhancement (fixed)

sane-backends 1.0.21 and variants to limit which backends are built

Reported by: aguynamedryan+macports@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 1.9.1
Keywords: haspatch Cc: ryandesign (Ryan Carsten Schmidt)
Port: sane-backends

Description (last modified by jmroot (Joshua Root))

I have made the following updates to the sane-backends Portfile

  • updated to build sane-backends 1.0.21
    • set revision to 0
    • updated checksums
  • listed myself as the maintainer
  • set use_parallel_build to yes

I've made the following enhancement:

I noticed that the command:

scanimage -L

runs very slowly and the debug messages from SANE_DEBUG_DLL seem to indicate that scanimage takes a long time to run through each of the 75 backends when it searches for scanners.

It is possible to build sane-backends with a subset of the backends by setting the environment variable BACKENDS to the list of backends you'd like to compile before you run ./configure.

Accordingly, I made variants for the 75 backends in the sane-backends Portfile so a user can now run install like so:

port install sane-backends +net +hp +fujitsu

to build only the net, hp, and fujitsu backends. This made scanadf run faster for me since it had fewer backends to iterate through. As a bonus, compilation also takes far less time if just a few backends are specified.

I'm new to TCL and I'm not sure the way I specified the variants is particularly efficient, but it works. If there is a better way to structure the variants in the Portfile I'd love to learn.

Attachments (1)

Portfile-sane-backends.diff (10.7 KB) - added by aguynamedryan+macports@… 14 years ago.
update to sane-backends 1.0.21 and add 75 variants to specify subset of backends to build

Download all attachments as: .zip

Change History (13)

Changed 14 years ago by aguynamedryan+macports@…

Attachment: Portfile-sane-backends.diff added

update to sane-backends 1.0.21 and add 75 variants to specify subset of backends to build

comment:1 Changed 14 years ago by jmroot (Joshua Root)

Description: modified (diff)
Keywords: haspatch added

comment:2 Changed 14 years ago by mf2k (Frank Schima)

Why shouldn't we just build all of the backends?

comment:3 Changed 14 years ago by mf2k (Frank Schima)

Heh, sorry for not reading. I still think this is not reasonable to have so many variants. But I'd like to think we can come up with a better solution.

comment:4 Changed 14 years ago by aguynamedryan+macports@…

I hope we can come up with a better solution as well.

Is there a way to set an environment variable before invoking 'port install' so that the ./configure command in the configure phase will see it? That would solve my problems.

Just to hammer in my point that scanimage is slowed by the number of backends installed, when all backends are installed 'scanimage -L' takes 26 seconds to complete. When I trim that down to the two I need: net and fujitsu, 'scanimage -L' complete in 1.26 seconds.

comment:5 Changed 14 years ago by nerdling (Jeremy Lavergne)

MacPorts has a configure.env variable, which you can see in the Guide.

comment:6 in reply to:  5 Changed 14 years ago by aguynamedryan+macports@…

Replying to snc@…:

In the patch I've submitted I'm using the configure.env-append command to add the BACKENDS variable to the environment.

Can I somehow use configure.env from the command line before I invoke port install?

comment:7 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added

In r68993 I updated sane-backends to 1.0.21, enabled the parallel build, and made you the maintainer. But I won't add that profusion of variants. MacPorts policy is that ports should be as featureful as possible, if that's not too inconvenient, and the port already accomplishes that without any variants.

If 26 seconds is an unreasonable time for that command to complete, you should report that problem to the developers of this software. On my system it takes 19 seconds, which still seems a long time to me.

comment:8 in reply to:  7 ; Changed 14 years ago by aguynamedryan+macports@…

Replying to ryandesign@…:

Thank you for committing only the update portion of the Portfile.

Much to my chagrine, it turns out that my multitude of variants wasn't necessary anyway. I just stumbled across a feature of sane-backends. After installing sane-backends with all backends compiled, you can edit /opt/local/etc/sane.d/dll.conf and specify which backends you'd like to load in that file. By commenting out all but the net and fujitsu backends in this file I was able to get scanimage -L to run in 1.2 seconds...

I've confirmed that everything is working for me when I use the Portfile from 'port selfupdate'. Looks good!

Thanks everyone for the help on this!

comment:9 in reply to:  8 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to aguynamedryan+macports@…:

you can edit /opt/local/etc/sane.d/dll.conf and specify which backends you'd like to load

Cool, maybe you could add a "notes" entry to the port that tells the user this?

comment:10 Changed 14 years ago by nerdling (Jeremy Lavergne)

Resolution: fixed
Status: newclosed

This ticket was resolved by Ryan in r68993 and by me in r69054.

comment:11 in reply to:  10 Changed 14 years ago by aguynamedryan+macports@…

Replying to snc@…:

Thanks for adding the notes section. I couldn't find any documentation on how to do that.

comment:12 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)

Sorry, there isn't any documentation about the notes feature in the guide or in the wiki yet. You'd have to have seen the messages on the mailing list discussing the feature, or looked at the few ports that use it to see how it works.

Note: See TracTickets for help on using tickets.