Blame SOURCES/0074-cleanup-Don-t-make-nbis-depend-on-libfprint-built-so.patch

73b847
From c5e8baac5bfb57c3c96f03c9534cc38002de3cca Mon Sep 17 00:00:00 2001
73b847
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
73b847
Date: Wed, 4 Dec 2019 15:08:12 +0100
73b847
Subject: [PATCH 074/181] cleanup: Don't make nbis depend on libfprint
73b847
 built-sources
73b847
73b847
Now that nbis is a static library it should be possible to compile it
73b847
without any fprint-built dependency, although since it included fp_internal
73b847
there was a compile-time dependency on the fp-enums that can be generated at
73b847
later times.
73b847
73b847
So:
73b847
 - Move nbis-helpers to nbis includes (and remove inclusion in fp_internal)
73b847
 - Move the Minutiae definitions inside a standalone fpi-minutiae header
73b847
 - Include fpi-minutiae.h in fp_internal.h
73b847
 - Include nbis-hepers.h and fpi-minutiae.h in nbis' lfs.h
73b847
 - Adapt missing definitions in libfprint
73b847
---
73b847
 libfprint/fp-image.c                          |  1 +
73b847
 libfprint/fp-print.c                          |  1 +
73b847
 libfprint/fp_internal.h                       | 35 ++-------------
73b847
 libfprint/fpi-minutiae.h                      | 45 +++++++++++++++++++
73b847
 libfprint/nbis/include/lfs.h                  |  3 +-
73b847
 libfprint/nbis/lfs.h.patch                    | 13 +++---
73b847
 .../libfprint-include}/nbis-helpers.h         |  0
73b847
 7 files changed, 59 insertions(+), 39 deletions(-)
73b847
 create mode 100644 libfprint/fpi-minutiae.h
73b847
 rename libfprint/{ => nbis/libfprint-include}/nbis-helpers.h (100%)
73b847
73b847
diff --git a/libfprint/fp-image.c b/libfprint/fp-image.c
73b847
index c66b010..16837a8 100644
73b847
--- a/libfprint/fp-image.c
73b847
+++ b/libfprint/fp-image.c
73b847
@@ -19,6 +19,7 @@
73b847
  */
73b847
 
73b847
 #include "fpi-image.h"
73b847
+#include "fpi-log.h"
73b847
 
73b847
 #include <nbis.h>
73b847
 
73b847
diff --git a/libfprint/fp-print.c b/libfprint/fp-print.c
73b847
index ed29ec1..f724c77 100644
73b847
--- a/libfprint/fp-print.c
73b847
+++ b/libfprint/fp-print.c
73b847
@@ -20,6 +20,7 @@
73b847
 
73b847
 #include "fpi-print.h"
73b847
 #include "fpi-image.h"
73b847
+#include "fpi-log.h"
73b847
 #include "fpi-device.h"
73b847
 
73b847
 #include <nbis.h>
73b847
diff --git a/libfprint/fp_internal.h b/libfprint/fp_internal.h
73b847
index 8147089..56ada18 100644
73b847
--- a/libfprint/fp_internal.h
73b847
+++ b/libfprint/fp_internal.h
73b847
@@ -1,6 +1,6 @@
73b847
 /*
73b847
  * Internal/private definitions for libfprint
73b847
- * Copyright (C) 2007-2008 Daniel Drake <dsd@gentoo.org>
73b847
+ * Copyright (C) 2019 Marco Trevisan <marco.trevisan@canonical.com>
73b847
  *
73b847
  * This library is free software; you can redistribute it and/or
73b847
  * modify it under the terms of the GNU Lesser General Public
73b847
@@ -17,38 +17,9 @@
73b847
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
73b847
  */
73b847
 
73b847
-#ifndef __FPRINT_INTERNAL_H__
73b847
-#define __FPRINT_INTERNAL_H__
73b847
+#pragma once
73b847
 
73b847
 #include "fpi-log.h"
73b847
-#include "nbis-helpers.h"
73b847
 #include "fpi-image.h"
73b847
 #include "fpi-image-device.h"
73b847
-
73b847
-/* fp_minutia structure definition */
73b847
-struct fp_minutia
73b847
-{
73b847
-  int    x;
73b847
-  int    y;
73b847
-  int    ex;
73b847
-  int    ey;
73b847
-  int    direction;
73b847
-  double reliability;
73b847
-  int    type;
73b847
-  int    appearing;
73b847
-  int    feature_id;
73b847
-  int   *nbrs;
73b847
-  int   *ridge_counts;
73b847
-  int    num_nbrs;
73b847
-};
73b847
-
73b847
-/* fp_minutiae structure definition */
73b847
-struct fp_minutiae
73b847
-{
73b847
-  int                 alloc;
73b847
-  int                 num;
73b847
-  struct fp_minutia **list;
73b847
-};
73b847
-
73b847
-
73b847
-#endif
73b847
+#include "fpi-minutiae.h"
73b847
diff --git a/libfprint/fpi-minutiae.h b/libfprint/fpi-minutiae.h
73b847
new file mode 100644
73b847
index 0000000..24dc761
73b847
--- /dev/null
73b847
+++ b/libfprint/fpi-minutiae.h
73b847
@@ -0,0 +1,45 @@
73b847
+/*
73b847
+ * Internal/private definitions for libfprint
73b847
+ * Copyright (C) 2007-2008 Daniel Drake <dsd@gentoo.org>
73b847
+ *
73b847
+ * This library is free software; you can redistribute it and/or
73b847
+ * modify it under the terms of the GNU Lesser General Public
73b847
+ * License as published by the Free Software Foundation; either
73b847
+ * version 2.1 of the License, or (at your option) any later version.
73b847
+ *
73b847
+ * This library is distributed in the hope that it will be useful,
73b847
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
73b847
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
73b847
+ * Lesser General Public License for more details.
73b847
+ *
73b847
+ * You should have received a copy of the GNU Lesser General Public
73b847
+ * License along with this library; if not, write to the Free Software
73b847
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
73b847
+ */
73b847
+
73b847
+#pragma once
73b847
+
73b847
+/* fp_minutia structure definition */
73b847
+struct fp_minutia
73b847
+{
73b847
+  int    x;
73b847
+  int    y;
73b847
+  int    ex;
73b847
+  int    ey;
73b847
+  int    direction;
73b847
+  double reliability;
73b847
+  int    type;
73b847
+  int    appearing;
73b847
+  int    feature_id;
73b847
+  int   *nbrs;
73b847
+  int   *ridge_counts;
73b847
+  int    num_nbrs;
73b847
+};
73b847
+
73b847
+/* fp_minutiae structure definition */
73b847
+struct fp_minutiae
73b847
+{
73b847
+  int                 alloc;
73b847
+  int                 num;
73b847
+  struct fp_minutia **list;
73b847
+};
73b847
diff --git a/libfprint/nbis/include/lfs.h b/libfprint/nbis/include/lfs.h
73b847
index ae7aee5..f4f38d7 100644
73b847
--- a/libfprint/nbis/include/lfs.h
73b847
+++ b/libfprint/nbis/include/lfs.h
73b847
@@ -66,7 +66,8 @@ of the software.
73b847
 
73b847
 #include <math.h>
73b847
 #include <stdio.h>
73b847
-#include <fp_internal.h>
73b847
+#include <nbis-helpers.h>
73b847
+#include <fpi-minutiae.h>
73b847
 
73b847
 /*************************************************************************/
73b847
 /*        OUTPUT FILE EXTENSIONS                                         */
73b847
diff --git a/libfprint/nbis/lfs.h.patch b/libfprint/nbis/lfs.h.patch
73b847
index 2be6ebf..3342bc5 100644
73b847
--- a/libfprint/nbis/lfs.h.patch
73b847
+++ b/libfprint/nbis/lfs.h.patch
73b847
@@ -1,15 +1,16 @@
73b847
---- include/lfs.h	2018-08-24 15:31:54.535579623 +0200
73b847
-+++ include/lfs.h.orig	2018-08-24 15:31:48.781587933 +0200
73b847
-@@ -66,7 +43,7 @@ of the software.
73b847
+--- include/lfs.h
73b847
++++ include/lfs.h
73b847
+@@ -66,7 +66,8 @@ of the software.
73b847
  
73b847
  #include <math.h>
73b847
  #include <stdio.h>
73b847
 -#include <an2k.h>  /* Needed by to_type9.c */
73b847
-+#include <fp_internal.h>
73b847
++#include <nbis-helpers.h>
73b847
++#include <fpi-minutiae.h>
73b847
  
73b847
  /*************************************************************************/
73b847
  /*        OUTPUT FILE EXTENSIONS                                         */
73b847
-@@ -154,26 +131,8 @@ typedef struct rotgrids{
73b847
+@@ -154,26 +155,8 @@ typedef struct rotgrids{
73b847
  #define DISAPPEARING    0
73b847
  #define APPEARING       1
73b847
  
73b847
@@ -38,7 +39,7 @@
73b847
  
73b847
  typedef struct feature_pattern{
73b847
     int type;
73b847
-@@ -1185,17 +1185,6 @@ extern void bubble_sort_double_inc_2(double *, int *, const int);
73b847
+@@ -1203,17 +1186,6 @@ extern void bubble_sort_double_inc_2(double *, int *, const int);
73b847
  extern void bubble_sort_double_dec_2(double *, int *,  const int);
73b847
  extern void bubble_sort_int_inc(int *, const int);
73b847
  
73b847
diff --git a/libfprint/nbis-helpers.h b/libfprint/nbis/libfprint-include/nbis-helpers.h
73b847
similarity index 100%
73b847
rename from libfprint/nbis-helpers.h
73b847
rename to libfprint/nbis/libfprint-include/nbis-helpers.h
73b847
-- 
73b847
2.24.1
73b847