aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2015-06-11 18:16:08 -0400
committerAnthony G. Basile <blueness@gentoo.org>2015-06-11 18:16:08 -0400
commit8eddda8072add075ebf56cf6d288bc1450d6b5f8 (patch)
tree373e2d36142a298a821f6643c097007aa38aa29f /media-gfx
downloadmusl-8eddda8072add075ebf56cf6d288bc1450d6b5f8.tar.gz
musl-8eddda8072add075ebf56cf6d288bc1450d6b5f8.tar.bz2
musl-8eddda8072add075ebf56cf6d288bc1450d6b5f8.zip
Initial migration from hardened-dev::musl
Diffstat (limited to 'media-gfx')
-rw-r--r--media-gfx/sane-backends/Manifest13
-rw-r--r--media-gfx/sane-backends/files/niash_array_index.patch140
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.24-automagic_systemd.patch40
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.24-kodakaio_avahi.patch84
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.24-saned_pidfile_location.patch11
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.24-systemd_pkgconfig.patch37
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.24-u_char.patch11
-rw-r--r--media-gfx/sane-backends/files/sane-backends-1.0.24-unused-cups.patch42
-rw-r--r--media-gfx/sane-backends/files/saned10
-rw-r--r--media-gfx/sane-backends/files/saned.confd2
-rw-r--r--media-gfx/sane-backends/files/saned.initd12
-rw-r--r--media-gfx/sane-backends/metadata.xml8
-rw-r--r--media-gfx/sane-backends/sane-backends-1.0.24-r99.ebuild329
13 files changed, 739 insertions, 0 deletions
diff --git a/media-gfx/sane-backends/Manifest b/media-gfx/sane-backends/Manifest
new file mode 100644
index 00000000..fb38f61e
--- /dev/null
+++ b/media-gfx/sane-backends/Manifest
@@ -0,0 +1,13 @@
+AUX niash_array_index.patch 4141 SHA256 a44687911c10e66c1a57efe73508d1c78eed55fa2699fe7e13c62ddc7b646187 SHA512 13dcba7d609cb5fe27442918818b46dd55b3d4c65aeb3f379377671775cf28f8cd48950a0633fb3abb33db29b223798c0b00a86a029956ae0bc323edc344d28f WHIRLPOOL c93d1c770e49550eb72f82f2a48385600b806531cc4e6072fa7317515c16ac7847acb63be7d8c94592fee299e433f438a2f7db82f362d7a57e79c42a2b13940b
+AUX sane-backends-1.0.24-automagic_systemd.patch 1310 SHA256 5461cb3aa8bad1b299cd92c525cf6af5a3af5a82e81a74549a7f660d026ee610 SHA512 1edf28a2d106cf05df92a55ef3bf4ea530c9ee69a2517f14a33a5ff30ba69702d818677da1715ab19169a4d5575f1c7c2755431193d48a40d4f80d11e6308120 WHIRLPOOL 9404f9938567bec86487969fa0e1af21cf83c8aa88344983c09a2380c279c3de7b9c4bcd8a41836ffc3ab9628bfe4f8a38c0c165f5d933adefc66fb589fdf5d6
+AUX sane-backends-1.0.24-kodakaio_avahi.patch 2900 SHA256 83f2a75a379fd964e8662d61394dd61d674bfaf5d4cf13d12725af83aaa36f7e SHA512 c00c01d2b7ad1770117403373ece89b14ff58ed23b6719b01f89c381dd88a1195c6c57c1d3ca25d7036ea21128a36f14675e7bfae0e6db671db24fb4c1422674 WHIRLPOOL ee3be39baa2a33615308d1805d0c5f59ae6e1b4e72f481ef0629c71f94f4d26dbd06e2dca12a969e883f0453e07953c1bfbc8cbafc19dca16f5ec1e2c86ceaeb
+AUX sane-backends-1.0.24-saned_pidfile_location.patch 345 SHA256 c95f305d01fd0dfb63944788f450d798a8882412f1d3e6da5c7e49f33cceba51 SHA512 49519b8fea68292b8cbd7bdcaf5b4803a1b890800e17015ace1d662e4503cc0844f191793c8f42cd6aa7e9922ee9f961d4784e30f22abc497973be1978bf1b24 WHIRLPOOL d72b314c7e4898c83a4c79e6fa39af978bd60e2b78afa58c1f8e1709b5f597292e965d330a58cd4109780fb2051dcd7880008f65d2b204fe476cbf3ce898e22b
+AUX sane-backends-1.0.24-systemd_pkgconfig.patch 1324 SHA256 8a6a253e5869d0a5e9d3296b9e7525c892a74b12e25c8945fffeb52521efeaa8 SHA512 1d503302ef60e7a16d764997768a1aca3cf2a0109fc53d9c353761354aad2b34caa3dc2763c343fe1af6544021ed9c288f0e951e2d10218a80fd9d081aabb5d5 WHIRLPOOL 8e4df791a67f859d9f1893301bc238f1cf26d8568ffbfdefd7321d8e0f87ce5b079a378788af58b42f4506e15cac6bf7607410df2b54dae9b815a83b2134c28f
+AUX sane-backends-1.0.24-u_char.patch 436 SHA256 d9f7c0a88d107122427aba7c9ac83fa8023a6a660615870bc1f6e5ea0028a54d SHA512 0c697abb204d2c9d3d5b907a2d38aada096d0d0935bd904a66a32bf1cff98f5f4d1c700e9673aa946a75de53d0957bb7884b36ab5a1ea837dafd5a8e0fadf92e WHIRLPOOL 0e61a250ba31b5c4944e1f1cd22ad3c5e9b6679c7f3fcfb5075490aa90fa457e8e34db48201e4355df7d1713e5d6b0c1124203fdf997c78a5e63b00d031ab9cc
+AUX sane-backends-1.0.24-unused-cups.patch 1658 SHA256 ceb0b0809c90e8c89da70bf054c62d96a621e8a141ad2d4a9f9e48e222728376 SHA512 9c8eca84f7fe9bb4b9a80e622a577fa270f7790e84ad1cdac3894f8c6fd2f91756f14227a128c3e9252d16c16e7a51b3695c52e983871eae96d8afb2970a0296 WHIRLPOOL cd55ab0dbd86196c54e560a874e8e5c5435655c85068d35d8560fa8888dfb3bac19a4900ebfa59fde5e6a576ce3759b8bd7a61fce614872bec1afb6859cce53d
+AUX saned 150 SHA256 d18856d6dd26fac11988fea5217c8616686ad3c0c024ad5437efbf0fd24984f5 SHA512 26f3d66c6b1e75d87d7d430518aa878c77d5ab8d76a45847cef3ff15566341938eedf46c50d0fa8cdeef828df9cddefdd6fdd767c5de30d3aa7d64ed1911d910 WHIRLPOOL 5bdd707daeba740b980ce6dd51096716eec2c2939681f6abd9e7f73b50d8d384a68a07dcc11e9295cd123cc5d2a53d02def52133a559c3e33d63612028d2aac5
+AUX saned.confd 76 SHA256 197e44ba1f438a18f5f7d9f5858feb19c1ece4286d82a5e63caf9be5b964aa76 SHA512 8f4a99ef24c19b3a7213b3d25ea16f5bca8623735cf25d21e3a706e9e0135ac8cce5d0b8fb8728845977f41dcefe6bd858076d755515fc91b00e05ee5817d751 WHIRLPOOL ede920bf5eb1ee59263296a2ccce1ab2da2b04669c2f8a58de1fc4fa76cc1eee501290eb4fdaece464bc184cc0cfb17d100e9309a33d79c06142a3f03c91b837
+AUX saned.initd 411 SHA256 4dd4e7fa07bf2ab2d4f5753156f5df0ad2277523f6755b0eab3d2db3480989e2 SHA512 ec9c11c84dc405981fd854f99007a5fcae5403685894acd1d1108fc772147a54d9fad9103dcff708765efff644e972260459c19fe439af17db76562dc1b5ba84 WHIRLPOOL bec23753fc557a36a6990ed565519bb62e1bc9a6bd81c0c16cc956cd6dbc1c6fd661775b8c8bf05faa1f5bbbef2406498094a0adc48c9fd81e89f4531669c4e8
+DIST sane-backends-1.0.24.tar.gz 5778749 SHA256 27c7085a54f1505d8b551e6f1e69d30e1ee57328b18429bb2225dabf4c45462d SHA512 1e9f962bb9d27f17067eb662dabfc0a1aa0d06e16bec4bd28868124b468578d82f14f6d2c1f5de63d2cec57ca4584ec12d3b2c2b1de20f1199aece581453ebc5 WHIRLPOOL 19b939c920a3c157044c85a941debdc664d8781562fa3fc04f061b9d216b089be80edfd43479069382adf13e68160518fdbd5c84a5f4c506a46f8521d4ed2a1c
+EBUILD sane-backends-1.0.24-r99.ebuild 7662 SHA256 0d631f5ab4b58cce3c28417c02da0382f91281823202a41bc3f03a64f0ae709c SHA512 679a7ceaf6c4d621baafd2e5de968eb3f59a07cadc3d42a7f457662aee847dedc19e0213a6486223067e2cffe860ac83efadfd64c0d25d3fbab49634c26d2133 WHIRLPOOL 32840ad2b7900da0ddeaceb3256dd881f5e1318c20e92393e25acb21d34de2b42cd2f6feaaa8380ab56ee64ea79c5b0388dab7998ca2c974091abbdb6526996a
+MISC metadata.xml 233 SHA256 c5f5ebf692f6c9e98fb12ac750be2e67f8b316b820dc6d36dfa3f22fead02ca4 SHA512 76ddd2dcdfdb17b98cd96ee032935125b95ee8b78722c1049b9beaef6cf482760c6bd7791d77ef5ca52c4185a5c01222a5f874c033ec3788cce2b4906ed18682 WHIRLPOOL 30cd038d04c297199c5d1d340f3612ce5e4226c099e1272b6c3257c2f9ff61cac32b577ffbcbdee7f888f8ededa9fa6d5aec6801249b2db53586531788f39229
diff --git a/media-gfx/sane-backends/files/niash_array_index.patch b/media-gfx/sane-backends/files/niash_array_index.patch
new file mode 100644
index 00000000..236c4598
--- /dev/null
+++ b/media-gfx/sane-backends/files/niash_array_index.patch
@@ -0,0 +1,140 @@
+--- backend/niash.c 2010-12-02 00:49:58.000000000 +0100
++++ backend/niash.c.new 2011-09-21 20:09:07.000000000 +0200
+@@ -82,14 +82,7 @@
+ optThreshold,
+
+
+- optLast,
+-/* put temporarily disabled options here after optLast */
+-
+- optGroupMisc,
+- optLamp,
+-
+- optCalibrate,
+- optGamma /* analog gamma = single number */
++ optLast
+ } EOptionIndex;
+
+
+@@ -685,17 +678,6 @@
+ pDesc->size = 0;
+ break;
+
+- case optGamma:
+- pDesc->name = SANE_NAME_ANALOG_GAMMA;
+- pDesc->title = SANE_TITLE_ANALOG_GAMMA;
+- pDesc->desc = SANE_DESC_ANALOG_GAMMA;
+- pDesc->type = SANE_TYPE_FIXED;
+- pDesc->constraint_type = SANE_CONSTRAINT_RANGE;
+- pDesc->constraint.range = &rangeGamma;
+- pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT;
+- pVal->w = startUpGamma;
+- break;
+-
+ case optGammaTable:
+ pDesc->name = SANE_NAME_GAMMA_VECTOR;
+ pDesc->title = SANE_TITLE_GAMMA_VECTOR;
+@@ -707,31 +689,6 @@
+ pVal->wa = s->aGammaTable;
+ break;
+
+- case optGroupMisc:
+- pDesc->title = SANE_I18N ("Miscellaneous");
+- pDesc->type = SANE_TYPE_GROUP;
+- pDesc->size = 0;
+- break;
+-
+- case optLamp:
+- pDesc->name = "lamp";
+- pDesc->title = SANE_I18N ("Lamp status");
+- pDesc->desc = SANE_I18N ("Switches the lamp on or off.");
+- pDesc->type = SANE_TYPE_BOOL;
+- pDesc->cap = SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT;
+- /* switch the lamp on when starting for first the time */
+- pVal->w = SANE_TRUE;
+- break;
+-
+- case optCalibrate:
+- pDesc->name = "calibrate";
+- pDesc->title = SANE_I18N ("Calibrate");
+- pDesc->desc = SANE_I18N ("Calibrates for black and white level.");
+- pDesc->type = SANE_TYPE_BUTTON;
+- pDesc->cap = SANE_CAP_SOFT_SELECT;
+- pDesc->size = 0;
+- break;
+-
+ case optGroupMode:
+ pDesc->title = SANE_I18N ("Scan Mode");
+ pDesc->desc = "";
+@@ -1007,7 +964,6 @@
+ /* Get options of type SANE_Word */
+ case optCount:
+ case optDPI:
+- case optGamma:
+ case optTLX:
+ case optTLY:
+ case optBRX:
+@@ -1031,17 +987,6 @@
+ strcpy ((char *) pVal, modeList[s->aValues[optMode].w]);
+ break;
+
+- /* Get options of type SANE_Bool */
+- case optLamp:
+- GetLamp (&s->HWParams, &fLampIsOn);
+- *(SANE_Bool *) pVal = fLampIsOn;
+- break;
+-
+- case optCalibrate:
+- /* although this option has nothing to read,
+- it's added here to avoid a warning when running scanimage --help */
+- break;
+-
+ default:
+ DBG (DBG_MSG, "SANE_ACTION_GET_VALUE: Invalid option (%d)\n", n);
+ }
+@@ -1061,7 +1006,6 @@
+ case optCount:
+ return SANE_STATUS_INVAL;
+
+- case optGamma:
+ case optThreshold:
+ case optDPI:
+
+@@ -1089,15 +1033,7 @@
+ DBG (DBG_MSG,
+ "sane_control_option: SANE_ACTION_SET_VALUE %d = %d\n", n,
+ (int) s->aValues[n].w);
+- if (n == optGamma)
+- {
+- if (!fSame && optLast > optGammaTable)
+- {
+- info |= SANE_INFO_RELOAD_OPTIONS;
+- }
+- _SetScalarGamma (s->aGammaTable, s->aValues[n].w);
+- }
+- break;
++ break;
+
+ case optGammaTable:
+ DBG (DBG_MSG, "Writing gamma table\n");
+@@ -1158,20 +1094,6 @@
+ break;
+
+
+-
+- case optLamp:
+- fVal = *(SANE_Bool *) pVal;
+- DBG (DBG_MSG, "lamp %s\n", fVal ? "on" : "off");
+- if (fVal)
+- _WarmUpLamp (s, WARMUP_INSESSION);
+- else
+- SetLamp (&s->HWParams, SANE_FALSE);
+- break;
+-
+- case optCalibrate:
+-/* SimpleCalib(&s->HWParams); */
+- break;
+-
+ default:
+ DBG (DBG_ERR, "SANE_ACTION_SET_VALUE: Invalid option (%d)\n", n);
+ }
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.24-automagic_systemd.patch b/media-gfx/sane-backends/files/sane-backends-1.0.24-automagic_systemd.patch
new file mode 100644
index 00000000..c0dfe3c5
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.24-automagic_systemd.patch
@@ -0,0 +1,40 @@
+diff --git a/configure.in b/configure.in
+index 4365868..7413646 100644
+--- a/configure.in
++++ b/configure.in
+@@ -344,17 +344,24 @@ dnl $as_echo "in order to autodetect network scanners in kodakaio."
+ dnl with_cups="no"
+ dnl fi
+
+-dnl added by llagendijk 12/7/2012 to detect systemd for saned
+-$as_echo_n "Checking for systemd..."
+-if test -e /usr/include/systemd/sd-daemon.h ; then
+- AC_DEFINE(HAVE_SYSTEMD, 1, [Is /usr/include/systemd/sd-daemon.h available?])
+- with_systemd="yes"
+- SYSTEMD_LIBS=" -lsystemd-daemon"
+- AC_SUBST(SYSTEMD_LIBS)
+- $as_echo "yes"
+-else
+- with_systemd="no"
+- $as_echo "no"
++AC_ARG_WITH(systemd,
++ AC_HELP_STRING([--with-systemd], [enable systemd support @<:@default=yes@:>@]))
++if test "x$with_systemd" != xno ; then
++ dnl added by llagendijk 12/7/2012 to detect systemd for saned
++ $as_echo_n "Checking for systemd..."
++ if test -e /usr/include/systemd/sd-daemon.h ; then
++ AC_DEFINE(HAVE_SYSTEMD, 1, [Is /usr/include/systemd/sd-daemon.h available?])
++ have_systemd="yes"
++ SYSTEMD_LIBS=" -lsystemd-daemon"
++ AC_SUBST(SYSTEMD_LIBS)
++ $as_echo "yes"
++ else
++ have_systemd="no"
++ $as_echo "no"
++ if test "x$with_systemd" = xyes; then
++ AC_MSG_ERROR([Systemd support was requested but systemd was not found])
++ fi
++ fi
+ fi
+
+ dnl ***********
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.24-kodakaio_avahi.patch b/media-gfx/sane-backends/files/sane-backends-1.0.24-kodakaio_avahi.patch
new file mode 100644
index 00000000..e6f52ad6
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.24-kodakaio_avahi.patch
@@ -0,0 +1,84 @@
+diff --git a/backend/kodakaio.c b/backend/kodakaio.c
+index 8c4583a..b442e50 100644
+--- a/backend/kodakaio.c
++++ b/backend/kodakaio.c
+@@ -127,7 +127,7 @@ for ubuntu 12.10
+
+ #define KODAKAIO_VERSION 02
+ #define KODAKAIO_REVISION 4
+-#define KODAKAIO_BUILD 6
++#define KODAKAIO_BUILD 7
+
+ /* for usb (but also used for net though it's not required). */
+ #define MAX_BLOCK_SIZE 32768
+@@ -2184,6 +2184,7 @@ static void resolve_callback(
+ AvahiLookupResultFlags flags,
+ AVAHI_GCC_UNUSED void* userdata) {
+
++ AvahiStringList *vid_pair_list = NULL, *pid_pair_list = NULL;
+ char *pidkey, *pidvalue;
+ char *vidkey, *vidvalue;
+ size_t valuesize;
+@@ -2204,20 +2205,40 @@ static void resolve_callback(
+ avahi_address_snprint(a, sizeof(a), address);
+
+ /* Output short for Kodak ESP */
+- DBG(min(10,DBG_AUTO), "%s:%u %s ", a,port,host_name);
+- avahi_string_list_get_pair(avahi_string_list_find(txt, "vid"),
+- &vidkey, &vidvalue, &valuesize);
+- DBG(min(10,DBG_AUTO), "%s=%s ", vidkey, vidvalue);
+- avahi_string_list_get_pair(avahi_string_list_find(txt, "pid"),
+- &pidkey, &pidvalue, &valuesize);
+- DBG(min(10,DBG_AUTO), "%s=%s\n", pidkey, pidvalue);
++ DBG(min(10,DBG_AUTO), "%s:%u %s\n", a,port,host_name);
+
++ vid_pair_list = avahi_string_list_find(txt, "vid");
++ if(vid_pair_list != NULL) {
++ avahi_string_list_get_pair(vid_pair_list, &vidkey, &vidvalue, &valuesize);
++ DBG(min(10,DBG_AUTO), "%s=%s ", vidkey, vidvalue);
++ }
++ else DBG(min(10,DBG_AUTO), "failed to find key vid\n");
++
++ pid_pair_list = avahi_string_list_find(txt, "pid");
++ if(pid_pair_list != NULL) {
++ avahi_string_list_get_pair(pid_pair_list, &pidkey, &pidvalue, &valuesize);
++ DBG(min(10,DBG_AUTO), "%s=%s\n", pidkey, pidvalue);
++ }
++ else DBG(min(10,DBG_AUTO), "failed to find key pid\n");
++
++ if(pid_pair_list != NULL && vid_pair_list != NULL) {
+ ProcessAvahiDevice(name, vidvalue, pidvalue, a);
+- avahi_free(vidkey); avahi_free(vidvalue);
+- avahi_free(pidkey); avahi_free(pidvalue);
++ }
++ else DBG(min(10,DBG_AUTO), "didn't call ProcessAvahiDevice\n");
++
++ if(vid_pair_list != NULL) {
++ avahi_free(vidkey);
++ avahi_free(vidvalue);
++ DBG(min(15,DBG_AUTO), "vidkey and vidvalue freed\n");
++ }
++ if(pid_pair_list != NULL) {
++ avahi_free(pidkey);
++ avahi_free(pidvalue);
++ DBG(min(15,DBG_AUTO), "pidkey and pidvalue freed\n");
++ }
+ }
+ }
+-
++ DBG(min(10,DBG_AUTO), "ending resolve_callback\n");
+ avahi_service_resolver_free(r);
+ }
+
+diff --git a/doc/descriptions/kodakaio.desc b/doc/descriptions/kodakaio.desc
+index 7882513..5fb18ed 100644
+--- a/doc/descriptions/kodakaio.desc
++++ b/doc/descriptions/kodakaio.desc
+@@ -1,6 +1,6 @@
+ :backend "kodakaio"
+ :url "http://sourceforge.net/projects/cupsdriverkodak/"
+-:version "2.4.6"
++:version "2.4.7"
+ :manpage "sane-kodakaio"
+ :comment "Backend for Kodak AiO ESP and Hero printers. Also possibly Advent AWL10"
+ :devicetype :scanner
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.24-saned_pidfile_location.patch b/media-gfx/sane-backends/files/sane-backends-1.0.24-saned_pidfile_location.patch
new file mode 100644
index 00000000..c682961f
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.24-saned_pidfile_location.patch
@@ -0,0 +1,11 @@
+--- sane-backends-1.0.23/frontend/saned.c
++++ sane-backends-1.0.23/frontend/saned.c
+@@ -221,7 +221,7 @@
+ int numchildren;
+
+ #define SANED_CONFIG_FILE "saned.conf"
+-#define SANED_PID_FILE "/var/run/saned.pid"
++#define SANED_PID_FILE "/var/run/saned/saned.pid"
+
+ #define SANED_SERVICE_NAME "sane-port"
+ #define SANED_SERVICE_PORT 6566
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.24-systemd_pkgconfig.patch b/media-gfx/sane-backends/files/sane-backends-1.0.24-systemd_pkgconfig.patch
new file mode 100644
index 00000000..2d36cfae
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.24-systemd_pkgconfig.patch
@@ -0,0 +1,37 @@
+diff --git a/configure.in b/configure.in
+index 7413646..66828fc 100644
+--- a/configure.in
++++ b/configure.in
+@@ -347,21 +347,18 @@ dnl fi
+ AC_ARG_WITH(systemd,
+ AC_HELP_STRING([--with-systemd], [enable systemd support @<:@default=yes@:>@]))
+ if test "x$with_systemd" != xno ; then
+- dnl added by llagendijk 12/7/2012 to detect systemd for saned
+- $as_echo_n "Checking for systemd..."
+- if test -e /usr/include/systemd/sd-daemon.h ; then
+- AC_DEFINE(HAVE_SYSTEMD, 1, [Is /usr/include/systemd/sd-daemon.h available?])
+- have_systemd="yes"
+- SYSTEMD_LIBS=" -lsystemd-daemon"
+- AC_SUBST(SYSTEMD_LIBS)
+- $as_echo "yes"
+- else
+- have_systemd="no"
+- $as_echo "no"
+- if test "x$with_systemd" = xyes; then
+- AC_MSG_ERROR([Systemd support was requested but systemd was not found])
+- fi
++ PKG_CHECK_MODULES(SYSTEMD, [libsystemd], have_systemd=yes, have_systemd=no)
++ if test "x$have_systemd" = xno; then
++ PKG_CHECK_MODULES(SYSTEMD, [libsystemd-daemon], have_systemd=yes, have_systemd=no)
++ fi
++ if test "x$have_systemd" = xyes; then
++ AC_DEFINE(HAVE_SYSTEMD, 1, [Is /usr/include/systemd/sd-daemon.h available?])
++ AC_SUBST(SYSTEMD_LIBS)
++ else
++ if test "x$with_systemd" = xyes; then
++ AC_MSG_ERROR([Systemd support was requested but systemd was not found])
+ fi
++ fi
+ fi
+
+ dnl ***********
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.24-u_char.patch b/media-gfx/sane-backends/files/sane-backends-1.0.24-u_char.patch
new file mode 100644
index 00000000..0a353355
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.24-u_char.patch
@@ -0,0 +1,11 @@
+diff -ur a/sane-backends-1.0.24/include/sane/sanei_udp.h b/sane-backends-1.0.24/include/sane/sanei_udp.h
+--- a/sane-backends-1.0.24/include/sane/sanei_udp.h
++++ b/sane-backends-1.0.24/include/sane/sanei_udp.h
+@@ -27,6 +27,7 @@
+ #include <netinet/in.h>
+ #include <netdb.h>
+ #endif
++#include <sys/types.h>
+
+ extern SANE_Status sanei_udp_open(const char *host, int port, int *fdp);
+ extern SANE_Status sanei_udp_open_broadcast(int *fdp);
diff --git a/media-gfx/sane-backends/files/sane-backends-1.0.24-unused-cups.patch b/media-gfx/sane-backends/files/sane-backends-1.0.24-unused-cups.patch
new file mode 100644
index 00000000..c8ed34e8
--- /dev/null
+++ b/media-gfx/sane-backends/files/sane-backends-1.0.24-unused-cups.patch
@@ -0,0 +1,42 @@
+diff --git a/configure.in b/configure.in
+index e13888c..4365868 100644
+--- a/configure.in
++++ b/configure.in
+@@ -332,17 +332,17 @@ if test -c /dev/urandom ; then
+ AC_DEFINE(HAVE_DEV_URANDOM, 1, [Is /dev/urandom available?])
+ fi
+
+-dnl added by PN 3/2/12 to detect cups
+-$as_echo "checking for cups"
+-if test -e /usr/include/cups/cups.h ; then
+- AC_DEFINE(HAVE_CUPS, 1, [Is /usr/include/cups/cups.h available?])
+- with_cups="yes"
+- LIBS="-lcups $LIBS"
+-else
+- $as_echo "cups.h not found, you may want to install a cups development package"
+- $as_echo "in order to autodetect network scanners in kodakaio."
+- with_cups="no"
+-fi
++dnl added by PN 3/2/12 to detect cups commented out 15/10/13 since avahi is now used instead
++dnl $as_echo "checking for cups"
++dnl if test -e /usr/include/cups/cups.h ; then
++dnl AC_DEFINE(HAVE_CUPS, 1, [Is /usr/include/cups/cups.h available?])
++dnl with_cups="yes"
++dnl LIBS="-lcups $LIBS"
++dnl else
++dnl $as_echo "cups.h not found, you may want to install a cups development package"
++dnl $as_echo "in order to autodetect network scanners in kodakaio."
++dnl with_cups="no"
++dnl fi
+
+ dnl added by llagendijk 12/7/2012 to detect systemd for saned
+ $as_echo_n "Checking for systemd..."
+@@ -816,7 +816,7 @@ fi
+ echo "IPv6 support: `eval eval echo ${ipv6}`"
+ echo "Avahi support: `eval eval echo ${enable_avahi}`"
+ echo "SNMP support: `eval eval echo ${with_snmp}`"
+-echo "CUPS support: `eval eval echo ${with_cups}`"
++dnl echo "CUPS support: `eval eval echo ${with_cups}`" commented out 15/10/13
+ echo "-> The following backends will be built:"
+ for backend in ${BACKENDS} ; do
+ echo $ECHO_N "${backend} "
diff --git a/media-gfx/sane-backends/files/saned b/media-gfx/sane-backends/files/saned
new file mode 100644
index 00000000..4b3e228e
--- /dev/null
+++ b/media-gfx/sane-backends/files/saned
@@ -0,0 +1,10 @@
+service sane-port
+{
+ socket_type = stream
+ server = /usr/sbin/saned
+ protocol = tcp
+ user = saned
+ group = scanner
+ wait = no
+ disable = yes
+}
diff --git a/media-gfx/sane-backends/files/saned.confd b/media-gfx/sane-backends/files/saned.confd
new file mode 100644
index 00000000..adb1eab2
--- /dev/null
+++ b/media-gfx/sane-backends/files/saned.confd
@@ -0,0 +1,2 @@
+# The user saned should drop its privileges to after startup
+#SANED_USER=""
diff --git a/media-gfx/sane-backends/files/saned.initd b/media-gfx/sane-backends/files/saned.initd
new file mode 100644
index 00000000..26498dd7
--- /dev/null
+++ b/media-gfx/sane-backends/files/saned.initd
@@ -0,0 +1,12 @@
+#!/sbin/runscript
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-gfx/sane-backends/files/saned.initd,v 1.1 2013/03/15 08:15:52 phosphan Exp $
+
+pidfile="/var/run/saned/saned.pid"
+command="/usr/sbin/saned"
+command_args="-a ${SANED_USER:-root}"
+
+start_pre() {
+ checkpath -d -o ${SANED_USER:-root} ${pidfile%/*}
+}
diff --git a/media-gfx/sane-backends/metadata.xml b/media-gfx/sane-backends/metadata.xml
new file mode 100644
index 00000000..95a1b7f6
--- /dev/null
+++ b/media-gfx/sane-backends/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer>
+ <email>teiresias@gentoo.org</email>
+ <name>Chris Brannon</name>
+</maintainer>
+</pkgmetadata>
diff --git a/media-gfx/sane-backends/sane-backends-1.0.24-r99.ebuild b/media-gfx/sane-backends/sane-backends-1.0.24-r99.ebuild
new file mode 100644
index 00000000..7919a11e
--- /dev/null
+++ b/media-gfx/sane-backends/sane-backends-1.0.24-r99.ebuild
@@ -0,0 +1,329 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-gfx/sane-backends/sane-backends-1.0.24-r5.ebuild,v 1.2 2014/06/18 19:24:59 mgorny Exp $
+
+EAPI="5"
+
+inherit autotools eutils flag-o-matic multilib multilib-minimal udev user toolchain-funcs
+
+# gphoto and v4l are handled by their usual USE flags.
+# The pint backend was disabled because I could not get it to compile.
+IUSE_SANE_BACKENDS="
+ abaton
+ agfafocus
+ apple
+ artec
+ artec_eplus48u
+ as6e
+ avision
+ bh
+ canon
+ canon630u
+ canon_dr
+ canon_pp
+ cardscan
+ coolscan
+ coolscan2
+ coolscan3
+ dc210
+ dc240
+ dc25
+ dell1600n_net
+ dmc
+ epjitsu
+ epson
+ epson2
+ fujitsu
+ genesys
+ gt68xx
+ hp
+ hp3500
+ hp3900
+ hp4200
+ hp5400
+ hp5590
+ hpljm1005
+ hpsj5s
+ hs2p
+ ibm
+ kodak
+ kodakaio
+ kvs1025
+ kvs20xx
+ kvs40xx
+ leo
+ lexmark
+ ma1509
+ magicolor
+ matsushita
+ microtek
+ microtek2
+ mustek
+ mustek_pp
+ mustek_usb
+ mustek_usb2
+ nec
+ net
+ niash
+ p5
+ pie
+ pixma
+ plustek
+ plustek_pp
+ pnm
+ qcam
+ ricoh
+ rts8891
+ s9036
+ sceptre
+ sharp
+ sm3600
+ sm3840
+ snapscan
+ sp15c
+ st400
+ stv680
+ tamarack
+ teco1
+ teco2
+ teco3
+ test
+ u12
+ umax
+ umax1220u
+ umax_pp
+ xerox_mfp"
+
+IUSE="avahi doc gphoto2 ipv6 threads usb v4l xinetd snmp systemd"
+
+for backend in ${IUSE_SANE_BACKENDS}; do
+ case ${backend} in
+ # Disable backends that require parallel ports as no one has those anymore.
+ canon_pp|hpsj5s|mustek_pp|\
+ pnm)
+ IUSE+=" -sane_backends_${backend}"
+ ;;
+ mustek_usb2|kvs40xx)
+ IUSE+=" sane_backends_${backend}"
+ ;;
+ *)
+ IUSE+=" +sane_backends_${backend}"
+ esac
+done
+
+REQUIRED_USE="
+ sane_backends_mustek_usb2? ( threads )
+ sane_backends_kvs40xx? ( threads )
+"
+
+DESCRIPTION="Scanner Access Now Easy - Backends"
+HOMEPAGE="http://www.sane-project.org/"
+SRC_URI="https://alioth.debian.org/frs/download.php/file/3958/${P}.tar.gz"
+
+LICENSE="GPL-2 public-domain"
+SLOT="0"
+KEYWORDS="amd64 arm x86"
+
+RDEPEND="
+ sane_backends_dc210? ( >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}] )
+ sane_backends_dc240? ( >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}] )
+ sane_backends_dell1600n_net? ( >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}]
+ >=media-libs/tiff-3.9.7-r1[${MULTILIB_USEDEP}] )
+ avahi? ( >=net-dns/avahi-0.6.31-r2[${MULTILIB_USEDEP}] )
+ sane_backends_canon_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
+ sane_backends_hpsj5s? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
+ sane_backends_mustek_pp? ( >=sys-libs/libieee1284-0.2.11-r3[${MULTILIB_USEDEP}] )
+ usb? ( >=virtual/libusb-1-r1:1[${MULTILIB_USEDEP}] )
+ gphoto2? (
+ >=media-libs/libgphoto2-2.5.3.1:=[${MULTILIB_USEDEP}]
+ >=virtual/jpeg-0-r2[${MULTILIB_USEDEP}]
+ )
+ v4l? ( >=media-libs/libv4l-0.9.5[${MULTILIB_USEDEP}] )
+ xinetd? ( sys-apps/xinetd )
+ snmp? ( net-analyzer/net-snmp )
+ systemd? ( sys-apps/systemd:0= )
+"
+
+DEPEND="${RDEPEND}
+ v4l? ( sys-kernel/linux-headers )
+ doc? (
+ virtual/latex-base
+ dev-texlive/texlive-latexextra
+ )
+ >=sys-apps/sed-4
+
+ >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]"
+
+# We now use new syntax construct (SUBSYSTEMS!="usb|usb_device)
+RDEPEND="${RDEPEND}
+ !<sys-fs/udev-114
+ abi_x86_32? (
+ !<=app-emulation/emul-linux-x86-medialibs-20140508
+ !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)]
+ )"
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/sane-config
+)
+
+pkg_setup() {
+ enewgroup scanner
+ enewuser saned -1 -1 -1 scanner
+}
+
+src_prepare() {
+ cat >> backend/dll.conf.in <<-EOF
+ # Add support for the HP-specific backend. Needs net-print/hplip installed.
+ hpaio
+ # Add support for the Epson-specific backend. Needs media-gfx/iscan installed.
+ epkowa
+ EOF
+ epatch "${FILESDIR}"/niash_array_index.patch \
+ "${FILESDIR}"/${P}-unused-cups.patch \
+ "${FILESDIR}"/${P}-automagic_systemd.patch \
+ "${FILESDIR}"/${P}-systemd_pkgconfig.patch \
+ "${FILESDIR}"/${P}-kodakaio_avahi.patch \
+ "${FILESDIR}"/${P}-saned_pidfile_location.patch \
+ "${FILESDIR}"/${P}-u_char.patch
+ # Fix for "make check".
+ sed -i -e 's/sane-backends 1.0.24git/sane-backends 1.0.24/' testsuite/tools/data/html*
+ AT_NOELIBTOOLIZE=yes eautoreconf
+}
+
+src_configure() {
+ append-flags -fno-strict-aliasing
+
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
+ # the blank is intended - an empty string would result in building ALL backends.
+ local BACKENDS=" "
+
+ use gphoto2 && BACKENDS="gphoto2"
+ use v4l && BACKENDS="${BACKENDS} v4l"
+ for backend in ${IUSE_SANE_BACKENDS}; do
+ if use "sane_backends_${backend}" && [ ${backend} != pnm ]; then
+ BACKENDS="${BACKENDS} ${backend}"
+ fi
+ done
+
+ local myconf=(
+ $(use_enable usb libusb_1_0)
+ $(multilib_native_use_with snmp)
+ )
+
+ # you can only enable this backend, not disable it...
+ if use sane_backends_pnm; then
+ myconf+=( --enable-pnm-backend )
+ fi
+ if ! use doc; then
+ myconf+=( --disable-latex )
+ fi
+ if use sane_backends_mustek_pp; then
+ myconf+=( --enable-parport-directio )
+ fi
+ if ! { use sane_backends_canon_pp || use sane_backends_hpsj5s || use sane_backends_mustek_pp; }; then
+ myconf+=( sane_cv_use_libieee1284=no )
+ fi
+ # if LINGUAS is set, just use the listed and supported localizations.
+ if [ "${LINGUAS-NoLocalesSet}" != NoLocalesSet ]; then
+ mkdir -p po || die
+ echo > po/LINGUAS
+ for lang in ${LINGUAS}; do
+ if [ -a "${S}"/po/${lang}.po ]; then
+ echo ${lang} >> po/LINGUAS
+ fi
+ done
+ fi
+
+ # relative path must be used for tests to work properly
+ ECONF_SOURCE=../${P} \
+ SANEI_JPEG="sanei_jpeg.o" SANEI_JPEG_LO="sanei_jpeg.lo" \
+ BACKENDS="${BACKENDS}" \
+ econf \
+ $(use_with gphoto2) \
+ $(multilib_native_use_with systemd) \
+ $(use_with v4l) \
+ $(use_enable avahi) \
+ $(use_enable ipv6) \
+ $(use_enable threads pthread) \
+ "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ emake VARTEXFONTS="${T}/fonts"
+
+ if use usb; then
+ cd tools/hotplug || die
+ sed -i -e '/^$/d' libsane.usermap || die
+ fi
+
+ if tc-is-cross-compiler; then
+ # The build system sucks and doesn't handle this properly.
+ # https://alioth.debian.org/tracker/index.php?func=detail&aid=314236&group_id=30186&atid=410366
+ tc-export_build_env BUILD_CC
+ cd "${BUILD_DIR}"/tools || die
+ ${BUILD_CC} ${BUILD_CPPFLAGS} ${BUILD_CFLAGS} -I. -I../include -I"${S}"/include \
+ "${S}"/sanei/sanei_config.c "${S}"/sanei/sanei_constrain_value.c \
+ "${S}"/sanei/sanei_init_debug.c "${S}"/tools/sane-desc.c -o sane-desc || die
+ local dirs=( hal hotplug hotplug-ng udev )
+ local targets=(
+ hal/libsane.fdi
+ hotplug/libsane.usermap
+ hotplug-ng/libsane.db
+ udev/libsane.rules
+ )
+ mkdir -p "${dirs[@]}" || die
+ emake "${targets[@]}"
+ fi
+}
+
+multilib_src_install() {
+ emake INSTALL_LOCKPATH="" DESTDIR="${D}" install \
+ docdir="${EPREFIX}"/usr/share/doc/${PF}
+
+ if multilib_is_native_abi; then
+ if use usb; then
+ insinto /etc/hotplug/usb
+ doins tools/hotplug/libsane.usermap
+ fi
+
+ udev_newrules tools/udev/libsane.rules 41-libsane.rules
+ insinto "/usr/share/pkgconfig"
+ doins tools/sane-backends.pc
+ fi
+}
+
+multilib_src_install_all() {
+ keepdir /var/lib/lock/sane
+ fowners root:scanner /var/lib/lock/sane
+ fperms g+w /var/lib/lock/sane
+ dodir /etc/env.d
+
+ if use usb; then
+ exeinto /etc/hotplug/usb
+ doexe tools/hotplug/libusbscanner
+ newdoc tools/hotplug/README README.hotplug
+ fi
+
+ dodoc NEWS AUTHORS ChangeLog* PROBLEMS README README.linux
+ prune_libtool_files --all
+ if use xinetd; then
+ insinto /etc/xinetd.d
+ doins "${FILESDIR}"/saned
+ fi
+
+ newinitd "${FILESDIR}"/saned.initd saned
+ newconfd "${FILESDIR}"/saned.confd saned
+}
+
+pkg_postinst() {
+ if use xinetd; then
+ elog "If you want remote clients to connect, edit"
+ elog "/etc/sane.d/saned.conf and /etc/hosts.allow"
+ fi
+
+ elog "If you are using a USB scanner, add all users who want"
+ elog "to access your scanner to the \"scanner\" group."
+}