tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Fixing print/qpdf on NetBSD/i386



Dear pkgsrc developers,

I would like to fix the build of print/qpdf on NetBSD/i386
(and other affected platforms, if possible). The patch
below fixes the build and limited testing seems to work
fine, but the patch is clearly the wrong way to fix the
problem.

Any ideas on how to fix this correctly?

-- 
Kind regards,

Yorick Hardy


Index: print/qpdf/distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/print/qpdf/distinfo,v
retrieving revision 1.31
diff -u -u -r1.31 distinfo
--- print/qpdf/distinfo	30 Oct 2020 15:13:31 -0000	1.31
+++ print/qpdf/distinfo	14 Dec 2020 22:04:35 -0000
@@ -5,4 +5,5 @@
 SHA512 (qpdf-10.0.2.tar.gz) = f1eec57dc76d0300296a1ec2f2d04bea8a75395ac480b37953d0da6924f96d13a258e4523893ef4e2ee89965686ae48f320886bc95120640fd3103cc3aed7032
 Size (qpdf-10.0.2.tar.gz) = 18458344 bytes
 SHA1 (patch-libqpdf.pc.in) = f592899487bb958a01931afbe4ddf3c749ea103e
+SHA1 (patch-libqpdf_QPDF.cc) = b17b48ada1e58e72bc717028f4a6675bebc9cbac
 SHA1 (patch-make_libtool.mk) = 8622d6a446da284269102dde38bf14271363dfdc

--- /dev/null	2020-12-15 00:02:01.128516021 +0200
+++ print/qpdf/patches/patch-libqpdf_QPDF.cc	2020-12-10 13:57:53.000000000 +0200
@@ -0,0 +1,19 @@
+$NetBSD$
+
+64 bit atomic operations are not defined on NetBSD/i386.
+
+--- libqpdf/QPDF.cc.orig	2020-10-27 15:57:48.000000000 +0000
++++ libqpdf/QPDF.cc
+@@ -183,7 +183,11 @@ QPDF::QPDF() :
+     // Generate a unique ID. It just has to be unique among all QPDF
+     // objects allocated throughout the lifetime of this running
+     // application.
+-    static std::atomic<unsigned long long> unique_id{0};
++#if defined(__NetBSD__) && !defined(__HAVE_ATOMIC64_OPS)
++    static std::atomic<unsigned long> unique_id{0};
++#else
++    static std::atomic<unsigned long long> unique_id{0};
++#endif
+     m->unique_id = unique_id.fetch_add(1ULL);
+ }
+ 


Home | Main Index | Thread Index | Old Index