Opened 11 years ago

Closed 9 years ago

Last modified 7 years ago

#12399 closed defect (fixed)

Get pycrypto to build on FreeBSD

Reported by: Karl-Dieter Crisman Owned by: Peter Jeremy
Priority: major Milestone: sage-6.1
Component: porting: BSD Keywords: spkg pycrypto
Cc: Peter Jeremy, Jean-Pierre Flori Merged in:
Authors: Stephen Montgomery-Smith, Jean-Pierre Flori Reviewers: Jean-Pierre Flori
Report Upstream: Reported upstream. No feedback yet. Work issues:
Branch: u/jpflori/ticket/12399 (Commits, GitHub, GitLab) Commit: 528d9887a2438668021908cd9ed4cffbc41e9c37
Dependencies: Stopgaps:

Status badges

Description (last modified by Frédéric Chapoton)

Stephen Montgomery-Smith reports:

OK, I started working on building sage.  So far I can get all the spkg's to build except:

gap-4.4.12.p6
pycrypto-2.1.0
singular-3-1-3-3.p3
maxima-5.23.2.p3
sage-4.8

The build problem with pycrypto-2.1.0 and singular-3-1-3-3.p3 are easy to fix.  

The patch is apparently

--- pycrypto-2.1.0/src/src/libtom/tomcrypt_pk.h-orig 2012-01-21 19:43:56.000000000 +0000
+++ pycrypto-2.1.0/src/src/libtom/tomcrypt_pk.h 2012-01-21 19:45:01.000000000 +0000
@@ -496,7 +496,7 @@
 int der_printable_value_decode(int v);
 
 /* UTF-8 */
-#if (defined(SIZE_MAX) || __STDC_VERSION__ >= 199901L || defined(WCHAR_MAX) || defined(_WCHAR_T) || defined(_WCHAR_T_DEFINED)) && !defined(LTC_NO_WCHAR)
+#if (defined(SIZE_MAX) || __STDC_VERSION__ >= 199901L || defined(WCHAR_MAX) || defined(_WCHAR_T) || defined(_WCHAR_T_DEFINED) || defined(_GCC_WCHAR_T)) && !defined(LTC_NO_WCHAR)
 #include <wchar.h>
 #else
 typedef ulong32 wchar_t;

Use git branch.

Attachments (1)

pycrypto-2.1.0.p0.diff (3.9 KB) - added by Jean-Pierre Flori 9 years ago.
Spkg diff, for review only.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 11 years ago by Stephen Montgomery-Smith

I can confirm that this ticket is still required for building sage with FreeBSD. It should be harmless to all other OS builds.

Add a new file patches/src.libtom.tomcrypt_pk.h (you will have to add the patches directory as well)

--- src/src/libtom/tomcrypt_pk.h-orig	2012-01-21 19:43:56.000000000 +0000
+++ src/src/libtom/tomcrypt_pk.h	2012-01-21 19:45:01.000000000 +0000
@@ -496,7 +496,7 @@
 int der_printable_value_decode(int v);
 
 /* UTF-8 */
-#if (defined(SIZE_MAX) || __STDC_VERSION__ >= 199901L || defined(WCHAR_MAX) || defined(_WCHAR_T) || defined(_WCHAR_T_DEFINED)) && !defined(LTC_NO_WCHAR)
+#if (defined(SIZE_MAX) || __STDC_VERSION__ >= 199901L || defined(WCHAR_MAX) || defined(_WCHAR_T) || defined(_WCHAR_T_DEFINED) || defined(_GCC_WCHAR_T)) && !defined(LTC_NO_WCHAR)
 #include <wchar.h>
 #else
 typedef ulong32 wchar_t;

and patch spkg-install as follows:

--- pycrypto-2.1.0/spkg-install-orig	2012-04-08 01:30:47.000000000 +0000
+++ pycrypto-2.1.0/spkg-install	2012-04-08 01:31:41.000000000 +0000
@@ -12,6 +12,8 @@
     LDFLAGS="-m64 "; export LDFLAGS
 fi
 
+patch -p0 < patches/src.libtom.tomcrypt_pk.h
+
 CFLAGS="-I$SAGE_LOCAL/include -L$SAGE_LOCAL/lib $CFLAGS"
 export CFLAGS
 

comment:2 Changed 11 years ago by Stephen Montgomery-Smith

I erased this comment and the following comment as they were wrong.

Last edited 11 years ago by Stephen Montgomery-Smith (previous) (diff)

comment:3 in reply to:  2 Changed 11 years ago by Stephen Montgomery-Smith

Last edited 11 years ago by Stephen Montgomery-Smith (previous) (diff)

comment:4 Changed 10 years ago by Karl-Dieter Crisman

Authors: Stephen Montgomery-Smith

All that's needed here is a new spkg with an spkg-install that checks whether the patch was applied correctly.

comment:5 Changed 10 years ago by Jean-Pierre Flori

Cc: Jean-Pierre Flori added

comment:6 Changed 10 years ago by Jean-Pierre Flori

The fix is still needed and let pycrypto build on FreeBSD 9.0 x86. I'll package a spkg this weekend.

comment:7 Changed 9 years ago by Jean-Pierre Flori

Authors: Stephen Montgomery-SmithStephen Montgomery-Smith, Jean-Pierre Flori
Description: modified (diff)
Keywords: spkg pycrypto added
Report Upstream: N/ANot yet reported upstream; Will do shortly.
Reviewers: Jean-Pierre Flori
Status: newneeds_review

The week-end was kind of long. Uploaded a simple spkg.

Follow up ticket to upgrade pycrypto at #14854. Note the patch should still be needed. The patched file did not change. Time for an upstream bug report I guess.

Changed 9 years ago by Jean-Pierre Flori

Attachment: pycrypto-2.1.0.p0.diff added

Spkg diff, for review only.

comment:8 Changed 9 years ago by Jeroen Demeyer

Milestone: sage-5.11sage-5.12

comment:9 Changed 9 years ago by Jean-Pierre Flori

Report Upstream: Not yet reported upstream; Will do shortly.Reported upstream. No feedback yet.

I've made a git branch and reported upstream at:

comment:10 Changed 9 years ago by Jean-Pierre Flori

Branch: u/jpflori/ticket/12399
Commit: 036984d734e7a22f65ab657f24ea68e0149ac850
Description: modified (diff)

comment:11 Changed 9 years ago by git

Commit: 036984d734e7a22f65ab657f24ea68e0149ac850528d9887a2438668021908cd9ed4cffbc41e9c37

Branch pushed to git repo; I updated commit sha1. New commits:

528d988Let PyCrypto build on FreeBSD.

comment:12 Changed 9 years ago by Volker Braun

Resolution: fixed
Status: needs_reviewclosed

comment:13 Changed 7 years ago by Frédéric Chapoton

Description: modified (diff)
Note: See TracTickets for help on using tickets.