aboutsummaryrefslogtreecommitdiffstats
path: root/community/dsfmt
diff options
context:
space:
mode:
authorJakub Jirutka <jakub@jirutka.cz>2016-08-17 14:10:09 +0200
committerJakub Jirutka <jakub@jirutka.cz>2016-08-17 14:10:56 +0200
commitcaf57ec52c3418da12a47a712d33da019932058a (patch)
tree7a1faa6748a2f7977938cc647ead9429bb2c0e81 /community/dsfmt
parent355feb3d1a5e13bab80b7cc88a558853482b2ffb (diff)
downloadaports-caf57ec52c3418da12a47a712d33da019932058a.tar.bz2
aports-caf57ec52c3418da12a47a712d33da019932058a.tar.xz
community/dsfmt: move from testing
Diffstat (limited to 'community/dsfmt')
-rw-r--r--community/dsfmt/0001-dSFMT.patch458
-rw-r--r--community/dsfmt/APKBUILD61
-rw-r--r--community/dsfmt/dsfmt.pc11
3 files changed, 530 insertions, 0 deletions
diff --git a/community/dsfmt/0001-dSFMT.patch b/community/dsfmt/0001-dSFMT.patch
new file mode 100644
index 0000000000..8048ab2565
--- /dev/null
+++ b/community/dsfmt/0001-dSFMT.patch
@@ -0,0 +1,458 @@
+From: Jakub Jirutka <jakub@jirutka.cz>
+Date: Wed, 08 Jun 2016 20:49:00 +0200
+Subject: [PATCH] Port patches from Julia
+
+Patches copied from the Julia Language:
+
+* https://github.com/JuliaLang/julia/blob/615f7ca7965fec2b57dddca88e3ba518384b18db/deps/patches/dSFMT.c.patch
+* https://github.com/JuliaLang/julia/blob/615f7ca7965fec2b57dddca88e3ba518384b18db/deps/patches/dSFMT.h.patch
+
+--- a/dSFMT.c 2012-06-29 03:24:27.000000000 -0400
++++ b/dSFMT.c 2012-12-20 12:45:45.000000000 -0500
+@@ -32,13 +32,13 @@
+ inline static uint32_t ini_func1(uint32_t x);
+ inline static uint32_t ini_func2(uint32_t x);
+ inline static void gen_rand_array_c1o2(dsfmt_t *dsfmt, w128_t *array,
+- int size);
++ ptrdiff_t size);
+ inline static void gen_rand_array_c0o1(dsfmt_t *dsfmt, w128_t *array,
+- int size);
++ ptrdiff_t size);
+ inline static void gen_rand_array_o0c1(dsfmt_t *dsfmt, w128_t *array,
+- int size);
++ ptrdiff_t size);
+ inline static void gen_rand_array_o0o1(dsfmt_t *dsfmt, w128_t *array,
+- int size);
++ ptrdiff_t size);
+ inline static int idxof(int i);
+ static void initial_mask(dsfmt_t *dsfmt);
+ static void period_certification(dsfmt_t *dsfmt);
+@@ -142,8 +142,8 @@
+ * @param size number of 128-bit pseudorandom numbers to be generated.
+ */
+ inline static void gen_rand_array_c1o2(dsfmt_t *dsfmt, w128_t *array,
+- int size) {
+- int i, j;
++ ptrdiff_t size) {
++ ptrdiff_t i, j;
+ w128_t lung;
+
+ lung = dsfmt->status[DSFMT_N];
+@@ -180,8 +180,8 @@
+ * @param size number of 128-bit pseudorandom numbers to be generated.
+ */
+ inline static void gen_rand_array_c0o1(dsfmt_t *dsfmt, w128_t *array,
+- int size) {
+- int i, j;
++ ptrdiff_t size) {
++ ptrdiff_t i, j;
+ w128_t lung;
+
+ lung = dsfmt->status[DSFMT_N];
+@@ -223,8 +223,8 @@
+ * @param size number of 128-bit pseudorandom numbers to be generated.
+ */
+ inline static void gen_rand_array_o0o1(dsfmt_t *dsfmt, w128_t *array,
+- int size) {
+- int i, j;
++ ptrdiff_t size) {
++ ptrdiff_t i, j;
+ w128_t lung;
+
+ lung = dsfmt->status[DSFMT_N];
+@@ -266,8 +266,8 @@
+ * @param size number of 128-bit pseudorandom numbers to be generated.
+ */
+ inline static void gen_rand_array_o0c1(dsfmt_t *dsfmt, w128_t *array,
+- int size) {
+- int i, j;
++ ptrdiff_t size) {
++ ptrdiff_t i, j;
+ w128_t lung;
+
+ lung = dsfmt->status[DSFMT_N];
+@@ -453,7 +453,7 @@
+ * memory. Mac OSX doesn't have these functions, but \b malloc of OSX
+ * returns the pointer to the aligned memory block.
+ */
+-void dsfmt_fill_array_close1_open2(dsfmt_t *dsfmt, double array[], int size) {
++void dsfmt_fill_array_close1_open2(dsfmt_t *dsfmt, double array[], ptrdiff_t size) {
+ assert(size % 2 == 0);
+ assert(size >= DSFMT_N64);
+ gen_rand_array_c1o2(dsfmt, (w128_t *)array, size / 2);
+@@ -471,7 +471,7 @@
+ * @param size the number of pseudorandom numbers to be generated.
+ * see also \sa fill_array_close1_open2()
+ */
+-void dsfmt_fill_array_open_close(dsfmt_t *dsfmt, double array[], int size) {
++void dsfmt_fill_array_open_close(dsfmt_t *dsfmt, double array[], ptrdiff_t size) {
+ assert(size % 2 == 0);
+ assert(size >= DSFMT_N64);
+ gen_rand_array_o0c1(dsfmt, (w128_t *)array, size / 2);
+@@ -489,7 +489,7 @@
+ * @param size the number of pseudorandom numbers to be generated.
+ * see also \sa fill_array_close1_open2()
+ */
+-void dsfmt_fill_array_close_open(dsfmt_t *dsfmt, double array[], int size) {
++void dsfmt_fill_array_close_open(dsfmt_t *dsfmt, double array[], ptrdiff_t size) {
+ assert(size % 2 == 0);
+ assert(size >= DSFMT_N64);
+ gen_rand_array_c0o1(dsfmt, (w128_t *)array, size / 2);
+@@ -507,7 +507,7 @@
+ * @param size the number of pseudorandom numbers to be generated.
+ * see also \sa fill_array_close1_open2()
+ */
+-void dsfmt_fill_array_open_open(dsfmt_t *dsfmt, double array[], int size) {
++void dsfmt_fill_array_open_open(dsfmt_t *dsfmt, double array[], ptrdiff_t size) {
+ assert(size % 2 == 0);
+ assert(size >= DSFMT_N64);
+ gen_rand_array_o0o1(dsfmt, (w128_t *)array, size / 2);
+--- a/dSFMT.h 2012-06-29 03:24:27.000000000 -0400
++++ b/dSFMT.h 2012-12-20 12:35:44.000000000 -0500
+@@ -40,6 +40,7 @@
+
+ #include <stdio.h>
+ #include <assert.h>
++#include <stddef.h>
+
+ #if !defined(DSFMT_MEXP)
+ #ifdef __GNUC__
+@@ -178,16 +179,17 @@
+ extern const int dsfmt_global_mexp;
+
+ void dsfmt_gen_rand_all(dsfmt_t *dsfmt);
+-void dsfmt_fill_array_open_close(dsfmt_t *dsfmt, double array[], int size);
+-void dsfmt_fill_array_close_open(dsfmt_t *dsfmt, double array[], int size);
+-void dsfmt_fill_array_open_open(dsfmt_t *dsfmt, double array[], int size);
+-void dsfmt_fill_array_close1_open2(dsfmt_t *dsfmt, double array[], int size);
++void dsfmt_fill_array_open_close(dsfmt_t *dsfmt, double array[], ptrdiff_t size);
++void dsfmt_fill_array_close_open(dsfmt_t *dsfmt, double array[], ptrdiff_t size);
++void dsfmt_fill_array_open_open(dsfmt_t *dsfmt, double array[], ptrdiff_t size);
++void dsfmt_fill_array_close1_open2(dsfmt_t *dsfmt, double array[], ptrdiff_t size);
+ void dsfmt_chk_init_gen_rand(dsfmt_t *dsfmt, uint32_t seed, int mexp);
+ void dsfmt_chk_init_by_array(dsfmt_t *dsfmt, uint32_t init_key[],
+ int key_length, int mexp);
+ const char *dsfmt_get_idstring(void);
+ int dsfmt_get_min_array_size(void);
+
++/*
+ #if defined(__GNUC__)
+ # define DSFMT_PRE_INLINE inline static
+ # define DSFMT_PST_INLINE __attribute__((always_inline))
+@@ -198,6 +200,10 @@
+ # define DSFMT_PRE_INLINE inline static
+ # define DSFMT_PST_INLINE
+ #endif
++*/
++#define DSFMT_PRE_INLINE
++#define DSFMT_PST_INLINE
++
+ DSFMT_PRE_INLINE uint32_t dsfmt_genrand_uint32(dsfmt_t *dsfmt) DSFMT_PST_INLINE;
+ DSFMT_PRE_INLINE double dsfmt_genrand_close1_open2(dsfmt_t *dsfmt)
+ DSFMT_PST_INLINE;
+@@ -212,13 +218,13 @@
+ DSFMT_PRE_INLINE double dsfmt_gv_genrand_close_open(void) DSFMT_PST_INLINE;
+ DSFMT_PRE_INLINE double dsfmt_gv_genrand_open_close(void) DSFMT_PST_INLINE;
+ DSFMT_PRE_INLINE double dsfmt_gv_genrand_open_open(void) DSFMT_PST_INLINE;
+-DSFMT_PRE_INLINE void dsfmt_gv_fill_array_open_close(double array[], int size)
++DSFMT_PRE_INLINE void dsfmt_gv_fill_array_open_close(double array[], ptrdiff_t size)
+ DSFMT_PST_INLINE;
+-DSFMT_PRE_INLINE void dsfmt_gv_fill_array_close_open(double array[], int size)
++DSFMT_PRE_INLINE void dsfmt_gv_fill_array_close_open(double array[], ptrdiff_t size)
+ DSFMT_PST_INLINE;
+-DSFMT_PRE_INLINE void dsfmt_gv_fill_array_open_open(double array[], int size)
++DSFMT_PRE_INLINE void dsfmt_gv_fill_array_open_open(double array[], ptrdiff_t size)
+ DSFMT_PST_INLINE;
+-DSFMT_PRE_INLINE void dsfmt_gv_fill_array_close1_open2(double array[], int size)
++DSFMT_PRE_INLINE void dsfmt_gv_fill_array_close1_open2(double array[], ptrdiff_t size)
+ DSFMT_PST_INLINE;
+ DSFMT_PRE_INLINE void dsfmt_gv_init_gen_rand(uint32_t seed) DSFMT_PST_INLINE;
+ DSFMT_PRE_INLINE void dsfmt_gv_init_by_array(uint32_t init_key[],
+@@ -236,7 +242,7 @@
+ * @param dsfmt dsfmt internal state date
+ * @return double precision floating point pseudorandom number
+ */
+-inline static uint32_t dsfmt_genrand_uint32(dsfmt_t *dsfmt) {
++uint32_t dsfmt_genrand_uint32(dsfmt_t *dsfmt) {
+ uint32_t r;
+ uint64_t *psfmt64 = &dsfmt->status[0].u[0];
+
+@@ -257,7 +263,7 @@
+ * @param dsfmt dsfmt internal state date
+ * @return double precision floating point pseudorandom number
+ */
+-inline static double dsfmt_genrand_close1_open2(dsfmt_t *dsfmt) {
++double dsfmt_genrand_close1_open2(dsfmt_t *dsfmt) {
+ double r;
+ double *psfmt64 = &dsfmt->status[0].d[0];
+
+@@ -276,7 +282,7 @@
+ * before this function. This function uses \b global variables.
+ * @return double precision floating point pseudorandom number
+ */
+-inline static uint32_t dsfmt_gv_genrand_uint32(void) {
++uint32_t dsfmt_gv_genrand_uint32(void) {
+ return dsfmt_genrand_uint32(&dsfmt_global_data);
+ }
+
+@@ -287,7 +293,7 @@
+ * before this function. This function uses \b global variables.
+ * @return double precision floating point pseudorandom number
+ */
+-inline static double dsfmt_gv_genrand_close1_open2(void) {
++double dsfmt_gv_genrand_close1_open2(void) {
+ return dsfmt_genrand_close1_open2(&dsfmt_global_data);
+ }
+
+@@ -299,7 +305,7 @@
+ * @param dsfmt dsfmt internal state date
+ * @return double precision floating point pseudorandom number
+ */
+-inline static double dsfmt_genrand_close_open(dsfmt_t *dsfmt) {
++double dsfmt_genrand_close_open(dsfmt_t *dsfmt) {
+ return dsfmt_genrand_close1_open2(dsfmt) - 1.0;
+ }
+
+@@ -310,7 +316,7 @@
+ * before this function. This function uses \b global variables.
+ * @return double precision floating point pseudorandom number
+ */
+-inline static double dsfmt_gv_genrand_close_open(void) {
++double dsfmt_gv_genrand_close_open(void) {
+ return dsfmt_gv_genrand_close1_open2() - 1.0;
+ }
+
+@@ -322,7 +328,7 @@
+ * @param dsfmt dsfmt internal state date
+ * @return double precision floating point pseudorandom number
+ */
+-inline static double dsfmt_genrand_open_close(dsfmt_t *dsfmt) {
++double dsfmt_genrand_open_close(dsfmt_t *dsfmt) {
+ return 2.0 - dsfmt_genrand_close1_open2(dsfmt);
+ }
+
+@@ -333,7 +339,7 @@
+ * before this function. This function uses \b global variables.
+ * @return double precision floating point pseudorandom number
+ */
+-inline static double dsfmt_gv_genrand_open_close(void) {
++double dsfmt_gv_genrand_open_close(void) {
+ return 2.0 - dsfmt_gv_genrand_close1_open2();
+ }
+
+@@ -345,7 +351,7 @@
+ * @param dsfmt dsfmt internal state date
+ * @return double precision floating point pseudorandom number
+ */
+-inline static double dsfmt_genrand_open_open(dsfmt_t *dsfmt) {
++double dsfmt_genrand_open_open(dsfmt_t *dsfmt) {
+ double *dsfmt64 = &dsfmt->status[0].d[0];
+ union {
+ double d;
+@@ -368,7 +374,7 @@
+ * before this function. This function uses \b global variables.
+ * @return double precision floating point pseudorandom number
+ */
+-inline static double dsfmt_gv_genrand_open_open(void) {
++double dsfmt_gv_genrand_open_open(void) {
+ return dsfmt_genrand_open_open(&dsfmt_global_data);
+ }
+
+@@ -383,7 +389,7 @@
+ * @param size the number of pseudorandom numbers to be generated.
+ * see also \sa dsfmt_fill_array_close1_open2()
+ */
+-inline static void dsfmt_gv_fill_array_close1_open2(double array[], int size) {
++void dsfmt_gv_fill_array_close1_open2(double array[], ptrdiff_t size) {
+ dsfmt_fill_array_close1_open2(&dsfmt_global_data, array, size);
+ }
+
+@@ -399,7 +405,7 @@
+ * see also \sa dsfmt_fill_array_close1_open2() and \sa
+ * dsfmt_gv_fill_array_close1_open2()
+ */
+-inline static void dsfmt_gv_fill_array_open_close(double array[], int size) {
++void dsfmt_gv_fill_array_open_close(double array[], ptrdiff_t size) {
+ dsfmt_fill_array_open_close(&dsfmt_global_data, array, size);
+ }
+
+@@ -415,7 +421,7 @@
+ * see also \sa dsfmt_fill_array_close1_open2() \sa
+ * dsfmt_gv_fill_array_close1_open2()
+ */
+-inline static void dsfmt_gv_fill_array_close_open(double array[], int size) {
++void dsfmt_gv_fill_array_close_open(double array[], ptrdiff_t size) {
+ dsfmt_fill_array_close_open(&dsfmt_global_data, array, size);
+ }
+
+@@ -431,7 +437,7 @@
+ * see also \sa dsfmt_fill_array_close1_open2() \sa
+ * dsfmt_gv_fill_array_close1_open2()
+ */
+-inline static void dsfmt_gv_fill_array_open_open(double array[], int size) {
++void dsfmt_gv_fill_array_open_open(double array[], ptrdiff_t size) {
+ dsfmt_fill_array_open_open(&dsfmt_global_data, array, size);
+ }
+
+@@ -441,7 +447,7 @@
+ * @param dsfmt dsfmt state vector.
+ * @param seed a 32-bit integer used as the seed.
+ */
+-inline static void dsfmt_init_gen_rand(dsfmt_t *dsfmt, uint32_t seed) {
++void dsfmt_init_gen_rand(dsfmt_t *dsfmt, uint32_t seed) {
+ dsfmt_chk_init_gen_rand(dsfmt, seed, DSFMT_MEXP);
+ }
+
+@@ -451,7 +457,7 @@
+ * @param seed a 32-bit integer used as the seed.
+ * see also \sa dsfmt_init_gen_rand()
+ */
+-inline static void dsfmt_gv_init_gen_rand(uint32_t seed) {
++void dsfmt_gv_init_gen_rand(uint32_t seed) {
+ dsfmt_init_gen_rand(&dsfmt_global_data, seed);
+ }
+
+@@ -462,7 +468,7 @@
+ * @param init_key the array of 32-bit integers, used as a seed.
+ * @param key_length the length of init_key.
+ */
+-inline static void dsfmt_init_by_array(dsfmt_t *dsfmt, uint32_t init_key[],
++void dsfmt_init_by_array(dsfmt_t *dsfmt, uint32_t init_key[],
+ int key_length) {
+ dsfmt_chk_init_by_array(dsfmt, init_key, key_length, DSFMT_MEXP);
+ }
+@@ -475,7 +481,7 @@
+ * @param key_length the length of init_key.
+ * see also \sa dsfmt_init_by_array()
+ */
+-inline static void dsfmt_gv_init_by_array(uint32_t init_key[], int key_length) {
++void dsfmt_gv_init_by_array(uint32_t init_key[], int key_length) {
+ dsfmt_init_by_array(&dsfmt_global_data, init_key, key_length);
+ }
+
+@@ -489,13 +495,13 @@
+ DSFMT_PRE_INLINE double genrand_close_open(void) DSFMT_PST_INLINE;
+ DSFMT_PRE_INLINE double genrand_open_close(void) DSFMT_PST_INLINE;
+ DSFMT_PRE_INLINE double genrand_open_open(void) DSFMT_PST_INLINE;
+-DSFMT_PRE_INLINE void fill_array_open_close(double array[], int size)
++DSFMT_PRE_INLINE void fill_array_open_close(double array[], ptrdiff_t size)
+ DSFMT_PST_INLINE;
+-DSFMT_PRE_INLINE void fill_array_close_open(double array[], int size)
++DSFMT_PRE_INLINE void fill_array_close_open(double array[], ptrdiff_t size)
+ DSFMT_PST_INLINE;
+-DSFMT_PRE_INLINE void fill_array_open_open(double array[], int size)
++DSFMT_PRE_INLINE void fill_array_open_open(double array[], ptrdiff_t size)
+ DSFMT_PST_INLINE;
+-DSFMT_PRE_INLINE void fill_array_close1_open2(double array[], int size)
++DSFMT_PRE_INLINE void fill_array_close1_open2(double array[], ptrdiff_t size)
+ DSFMT_PST_INLINE;
+
+ /**
+@@ -503,7 +509,7 @@
+ * @return id string.
+ * see also \sa dsfmt_get_idstring()
+ */
+-inline static const char *get_idstring(void) {
++const char *get_idstring(void) {
+ return dsfmt_get_idstring();
+ }
+
+@@ -512,7 +518,7 @@
+ * @return minimum size of array used for fill_array functions.
+ * see also \sa dsfmt_get_min_array_size()
+ */
+-inline static int get_min_array_size(void) {
++int get_min_array_size(void) {
+ return dsfmt_get_min_array_size();
+ }
+
+@@ -521,7 +527,7 @@
+ * @param seed a 32-bit integer used as the seed.
+ * see also \sa dsfmt_gv_init_gen_rand(), \sa dsfmt_init_gen_rand().
+ */
+-inline static void init_gen_rand(uint32_t seed) {
++void init_gen_rand(uint32_t seed) {
+ dsfmt_gv_init_gen_rand(seed);
+ }
+
+@@ -531,7 +537,7 @@
+ * @param key_length the length of init_key.
+ * see also \sa dsfmt_gv_init_by_array(), \sa dsfmt_init_by_array().
+ */
+-inline static void init_by_array(uint32_t init_key[], int key_length) {
++void init_by_array(uint32_t init_key[], int key_length) {
+ dsfmt_gv_init_by_array(init_key, key_length);
+ }
+
+@@ -541,7 +547,7 @@
+ * see also \sa dsfmt_genrand_close1_open2() \sa
+ * dsfmt_gv_genrand_close1_open2()
+ */
+-inline static double genrand_close1_open2(void) {
++double genrand_close1_open2(void) {
+ return dsfmt_gv_genrand_close1_open2();
+ }
+
+@@ -551,7 +557,7 @@
+ * see also \sa dsfmt_genrand_close_open() \sa
+ * dsfmt_gv_genrand_close_open()
+ */
+-inline static double genrand_close_open(void) {
++double genrand_close_open(void) {
+ return dsfmt_gv_genrand_close_open();
+ }
+
+@@ -561,7 +567,7 @@
+ * see also \sa dsfmt_genrand_open_close() \sa
+ * dsfmt_gv_genrand_open_close()
+ */
+-inline static double genrand_open_close(void) {
++double genrand_open_close(void) {
+ return dsfmt_gv_genrand_open_close();
+ }
+
+@@ -571,7 +577,7 @@
+ * see also \sa dsfmt_genrand_open_open() \sa
+ * dsfmt_gv_genrand_open_open()
+ */
+-inline static double genrand_open_open(void) {
++double genrand_open_open(void) {
+ return dsfmt_gv_genrand_open_open();
+ }
+
+@@ -584,7 +590,7 @@
+ * dsfmt_fill_array_close1_open2(), \sa
+ * dsfmt_gv_fill_array_close1_open2()
+ */
+-inline static void fill_array_open_close(double array[], int size) {
++void fill_array_open_close(double array[], ptrdiff_t size) {
+ dsfmt_gv_fill_array_open_close(array, size);
+ }
+
+@@ -597,7 +603,7 @@
+ * dsfmt_fill_array_close1_open2(), \sa
+ * dsfmt_gv_fill_array_close1_open2()
+ */
+-inline static void fill_array_close_open(double array[], int size) {
++void fill_array_close_open(double array[], ptrdiff_t size) {
+ dsfmt_gv_fill_array_close_open(array, size);
+ }
+
+@@ -610,7 +616,7 @@
+ * dsfmt_fill_array_close1_open2(), \sa
+ * dsfmt_gv_fill_array_close1_open2()
+ */
+-inline static void fill_array_open_open(double array[], int size) {
++void fill_array_open_open(double array[], ptrdiff_t size) {
+ dsfmt_gv_fill_array_open_open(array, size);
+ }
+
+@@ -622,7 +628,7 @@
+ * see also \sa dsfmt_fill_array_close1_open2(), \sa
+ * dsfmt_gv_fill_array_close1_open2()
+ */
+-inline static void fill_array_close1_open2(double array[], int size) {
++void fill_array_close1_open2(double array[], ptrdiff_t size) {
+ dsfmt_gv_fill_array_close1_open2(array, size);
+ }
+ #endif /* DSFMT_DO_NOT_USE_OLD_NAMES */
diff --git a/community/dsfmt/APKBUILD b/community/dsfmt/APKBUILD
new file mode 100644
index 0000000000..fd7d2d819a
--- /dev/null
+++ b/community/dsfmt/APKBUILD
@@ -0,0 +1,61 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=dsfmt
+_pkgname=dSFMT
+pkgver=2.2.3
+pkgrel=0
+pkgdesc="Double precision SIMD-oriented Fast Mersenne Twister"
+url="http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/#dSFMT"
+arch="all"
+license="BSD"
+depends=""
+makedepends=""
+subpackages="$pkgname-dev"
+source="http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/$_pkgname-src-$pkgver.tar.gz
+ $pkgname.pc
+ 0001-dSFMT.patch
+ "
+builddir="$srcdir/$_pkgname-src-$pkgver"
+
+_soname="lib$_pkgname.so"
+
+prepare() {
+ cd "$builddir"
+
+ sed "s/@VERSION@/$pkgver/" "$srcdir"/$pkgname.pc > $pkgname.pc || return 1
+ default_prepare
+}
+
+build() {
+ cd "$builddir"
+
+ # copied from https://github.com/JuliaLang/julia/blob/master/deps/dsfmt.mk
+ local cflags="$CFLAGS -DNDEBUG -DDSFMT_MEXP=19937 -DDSFMT_DO_NOT_USE_OLD_NAMES
+ -fPIC -O3 -finline-functions -fomit-frame-pointer
+ -fno-strict-aliasing --param max-inline-insns-single=1800
+ -Wmissing-prototypes -Wall -std=c99 -shared"
+
+ if [ "$CARCH" = x86_64 ]; then
+ cflags="$cflags -msse2 -DHAVE_SSE2"
+ fi
+
+ gcc $cflags dSFMT.c -o $_soname
+}
+
+package() {
+ cd "$builddir"
+
+ install -D $_soname "$pkgdir"/usr/lib/$_soname || return 1
+ install -D dSFMT.h "$pkgdir"/usr/include/dSFMT.h || return 1
+ install -D $pkgname.pc "$pkgdir"/usr/lib/pkgconfig/$pkgname.pc
+}
+
+md5sums="057c5a11d28296825fba584f561a4369 dSFMT-src-2.2.3.tar.gz
+57e48cb6635f9a84e70b5cb555b664cc dsfmt.pc
+dd236061b7019a9334b0174ce9d9e2fa 0001-dSFMT.patch"
+sha256sums="82344874522f363bf93c960044b0a6b87b651c9565b6312cf8719bb8e4c26a0e dSFMT-src-2.2.3.tar.gz
+0dd529b54ef6b300f030854de1b229f63af371d3129fa830bafaad930a2a993f dsfmt.pc
+9e0659814256b870468f23dcc4cf1da6ede781061c1df2edddd811a7114fc8da 0001-dSFMT.patch"
+sha512sums="6d8ddcd01aab3f9039f4f0288a8af53e290cc2f293ed8c4a8c9f3b3f12398e7eedfce8016117b425766ba89c61c86c13b3e420035b5f9bf91315b8b814c03662 dSFMT-src-2.2.3.tar.gz
+07810381fea8477478a968aaeca983ef639dd42ee0efccf7bdc910d137b07f55c43f3feb1ee59eaf97f4143ac273e32a02f557cb3a0d4e430480f650efee4fbd dsfmt.pc
+9feac5b96e431d110e88631e5540cec1e8ce3443c0c74afd8132650a077ae569e0214bbee9326d4f8a91e8fc10603fdcceedebbc3713bf0c3713117906b1f6da 0001-dSFMT.patch"
diff --git a/community/dsfmt/dsfmt.pc b/community/dsfmt/dsfmt.pc
new file mode 100644
index 0000000000..d6a96edc3a
--- /dev/null
+++ b/community/dsfmt/dsfmt.pc
@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=${prefix}
+includedir=${prefix}/include
+libdir=${exec_prefix}/lib
+
+Name: dSFMT
+Version: @VERSION@
+URL: http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT/#dSFMT
+Description: Double precision SIMD-oriented Fast Mersenne Twister
+Cflags: -I${includedir}
+Libs: -L${libdir} -ldSFMT