From f736de517adae6e2262266e848b4369584c0085e Mon Sep 17 00:00:00 2001 From: kochelmonster Date: Mon, 9 Nov 2020 16:20:10 +0100 Subject: [PATCH 1/5] Compile for 32bit. --- setup.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 2ddb83a..9ee7fe1 100755 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ import io import re +import sys from os import path import setuptools @@ -66,6 +67,11 @@ include_dirs = [path.join(CLD2_PATH, "internal"), path.join(CLD2_PATH, "public")] +is_64bits = sys.maxsize > 2 ** 32 +compile_args = ["-w", "-O2", "-fPIC"] +if is_64bits: + compile_args.append("-m64") + module = setuptools.Extension( # First arg (name) is the full name of the extension, including # any packages - ie. not a filename or pathname, but Python dotted @@ -74,8 +80,7 @@ sources=src_files, include_dirs=include_dirs, language="c++", - # TODO: -m64 may break 32 bit builds - extra_compile_args=["-w", "-O2", "-m64", "-fPIC"], + extra_compile_args=compile_args, ) # We define version as PYCLD2_VERSION in the C++ module. From 8c6638c487afc9ed55be4193e5fbc8a096728a47 Mon Sep 17 00:00:00 2001 From: kochelmonster Date: Sat, 21 Nov 2020 22:32:47 +0100 Subject: [PATCH 2/5] More specific for -M64 flag. --- setup.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 9ee7fe1..758d2cd 100755 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ import io import re -import sys +import platform from os import path import setuptools @@ -67,9 +67,9 @@ include_dirs = [path.join(CLD2_PATH, "internal"), path.join(CLD2_PATH, "public")] -is_64bits = sys.maxsize > 2 ** 32 + compile_args = ["-w", "-O2", "-fPIC"] -if is_64bits: +if platform.machine() == 'x86_64': compile_args.append("-m64") module = setuptools.Extension( From 3a402873e98ff2188c7a7ce0e03d92b238c16846 Mon Sep 17 00:00:00 2001 From: kochelmonster Date: Sat, 17 Jul 2021 18:36:16 +0200 Subject: [PATCH 3/5] added conda recipe --- conda.recipe/build.sh | 1 + conda.recipe/meta.yaml | 31 +++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 conda.recipe/build.sh create mode 100644 conda.recipe/meta.yaml diff --git a/conda.recipe/build.sh b/conda.recipe/build.sh new file mode 100644 index 0000000..7eef327 --- /dev/null +++ b/conda.recipe/build.sh @@ -0,0 +1 @@ +CFLAGS="-fno-stack-protector -Wno-narrowing" $PYTHON -m pip install --no-deps --ignore-installed . diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml new file mode 100644 index 0000000..096e757 --- /dev/null +++ b/conda.recipe/meta.yaml @@ -0,0 +1,31 @@ +package: + name: pycld2 + version: 0.42 + +source: + - path: .. + +build: + number: 0 + +requirements: + host: + - python + + build: + - {{ compiler('cxx') }} + +test: + requires: + - python + + source_files: + - test_pycld2.py + + commands: + - python test_pycld2.py -v + +about: + home: https://github.com/aboSamoor/pycld2 + license: Apache Software License + summary: Python bindings around Google Chromium's embedded compact language detection library (CLD2) From 0aa4dd93601e7f229be413a0589d3af9bfedb30b Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 14 Dec 2021 12:42:54 +0000 Subject: [PATCH 4/5] updated conda recipe --- conda.recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index 096e757..ddda41a 100644 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -6,7 +6,7 @@ source: - path: .. build: - number: 0 + number: 1 requirements: host: From 6a50aea5df1d54788b09b5000e2af0eb4c5d01ca Mon Sep 17 00:00:00 2001 From: kochelmonster Date: Sat, 18 Jun 2022 12:24:09 +0200 Subject: [PATCH 5/5] updated conda recipe --- conda.recipe/meta.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda.recipe/meta.yaml b/conda.recipe/meta.yaml index ddda41a..5b8bdc6 100644 --- a/conda.recipe/meta.yaml +++ b/conda.recipe/meta.yaml @@ -6,7 +6,7 @@ source: - path: .. build: - number: 1 + number: 2 requirements: host: