summaryrefslogtreecommitdiff
path: root/app-text/barcode/files/barcode-0.99-properly-install-static-lib.patch
blob: 5ebe95423c427a7409386dbd6575286c6db096c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
From 6d9e4aedc565568a39262990c6e6005f0528821c Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz@gentoo.org>
Date: Wed, 6 Aug 2025 21:59:25 -0400
Subject: [PATCH 1/2] reorganize broken upstream includes

Upstream broke library installation when porting to automake/libtool.
Then followed this up by breaking the primary header file -- adding
config.h and lib/gettext.h includes solely because that barcode.h was
included in every other file. Instead, init the gettext infra directly
in each file.
---
 barcode.h | 6 ------
 cmdline.c | 6 ++++++
 library.c | 1 +
 main.c    | 8 +++++++-
 pcl.c     | 6 ++++++
 plessey.c | 6 ++++++
 sample.c  | 6 ++++++
 7 files changed, 32 insertions(+), 7 deletions(-)

diff --git a/barcode.h b/barcode.h
index ed90e0c..0f4ee5a 100644
--- a/barcode.h
+++ b/barcode.h
@@ -23,14 +23,8 @@
 #ifndef _BARCODE_H_
 #define _BARCODE_H_
 
-#include "config.h"
 #include <stdio.h>
 
-#include <gettext.h>
-
-#define _(X) gettext (X)
-#define _N(X) (X)
-
 /*
  * The object
  */
diff --git a/cmdline.c b/cmdline.c
index 0a618a6..8ea7355 100644
--- a/cmdline.c
+++ b/cmdline.c
@@ -22,6 +22,12 @@
  *      Michele Comitini (mcm@glisco.it): better handling of numeric type args.
  */
 
+#include "config.h"
+#include <gettext.h>
+
+#define _(X) gettext (X)
+#define _N(X) (X)
+
 #include "barcode.h"
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/library.c b/library.c
index 30946ff..9ac1675 100644
--- a/library.c
+++ b/library.c
@@ -19,6 +19,7 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "config.h"
 #include "barcode.h"
 
 #include <stdio.h>
diff --git a/main.c b/main.c
index d28e0a6..9ae806a 100644
--- a/main.c
+++ b/main.c
@@ -19,7 +19,13 @@
  *  You should have received a copy of the GNU General Public License
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
-	
+
+#include "config.h"
+#include <gettext.h>
+
+#define _(X) gettext (X)
+#define _N(X) (X)
+
 #include "barcode.h"
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/pcl.c b/pcl.c
index d78b310..6b34a2c 100644
--- a/pcl.c
+++ b/pcl.c
@@ -19,6 +19,12 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "config.h"
+#include <gettext.h>
+
+#define _(X) gettext (X)
+#define _N(X) (X)
+
 #include "barcode.h"
 
 #include <stdio.h>
diff --git a/plessey.c b/plessey.c
index 2f59e39..7f00b9e 100644
--- a/plessey.c
+++ b/plessey.c
@@ -17,6 +17,12 @@
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "config.h"
+#include <gettext.h>
+
+#define _(X) gettext (X)
+#define _N(X) (X)
+
 #include "barcode.h"
 
 #include <stdio.h>
diff --git a/sample.c b/sample.c
index e79798c..1c8256d 100644
--- a/sample.c
+++ b/sample.c
@@ -1,3 +1,9 @@
+#include "config.h"
+#include <gettext.h>
+
+#define _(X) gettext (X)
+#define _N(X) (X)
+
 #include "barcode.h"
 
 #include <stdio.h>
-- 
2.49.1


From 7443318b8f9f0008e2bc29bf60e149a833bfd3db Mon Sep 17 00:00:00 2001
From: Eli Schwartz <eschwartz@gentoo.org>
Date: Wed, 6 Aug 2025 22:05:41 -0400
Subject: [PATCH 2/2] install libbarcode static library

This was broken by the automake/libtool port. and other projects depend
on it.
---
 Makefile.am | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index c3bf085..94832f9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -25,17 +25,19 @@ EXTRA_DIST = barcode.h cmdline.h
 
 bin_PROGRAMS = barcode sample
 
-noinst_LTLIBRARIES = libbarcode.la
+lib_LIBRARIES = libbarcode.a
+
+include_HEADERS = barcode.h
 
 ACLOCAL_AMFLAGS = -I m4
 
-libbarcode_la_SOURCES = library.c ean.c code128.c code39.c code93.c i25.c \
+libbarcode_a_SOURCES = library.c ean.c code128.c code39.c code93.c i25.c \
 		msi.c plessey.c codabar.c \
 		ps.c svg.c pcl.c code11.c
 
 barcode_SOURCES = main.c cmdline.c
-barcode_LDADD = libbarcode.la lib/libgnu.la
+barcode_LDADD = libbarcode.a lib/libgnu.la
 
 
 sample_SOURCES = sample.c
-sample_LDADD = libbarcode.la
+sample_LDADD = libbarcode.a
-- 
2.49.1