From 8446c290e7394fc3ffa39798fdc24c19a21f8955 Mon Sep 17 00:00:00 2001 From: Andreas Oberritter Date: Wed, 30 Oct 2019 20:45:38 +0100 Subject: [PATCH] accuraterip-checksum.c: Port to Python 3 Accuraterip-checksum extension will be Python 3 only (JoeLametta). Co-authored-by: JoeLametta Signed-off-by: Andreas Oberritter Signed-off-by: JoeLametta --- README.md | 16 +--------------- src/accuraterip-checksum.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 4c5e599..52dd928 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,7 @@ We've nearly completed porting the codebase to Python 3 (Python 2 won't be suppo - [Building](#building) 1. [Required dependencies](#required-dependencies) 2. [Fetching the source code](#fetching-the-source-code) - 3. [Building the bundled dependencies](#building-the-bundled-dependencies) - 4. [Finalizing the build](#finalizing-the-build) + 3. [Finalizing the build](#finalizing-the-build) - [Usage](#usage) - [Getting started](#getting-started) - [Configuration file documentation](#configuration-file-documentation) @@ -164,19 +163,6 @@ git clone https://github.com/whipper-team/whipper.git cd whipper ``` -### Building the bundled dependencies - -Whipper uses and packages a slightly different version of the `accuraterip-checksum` tool: - -You can edit the install path in `config.mk` - -```bash -cd src -make -sudo make install -cd .. -``` - ### Finalizing the build Install whipper: `python2 setup.py install` diff --git a/src/accuraterip-checksum.c b/src/accuraterip-checksum.c index ee784d9..652b385 100644 --- a/src/accuraterip-checksum.c +++ b/src/accuraterip-checksum.c @@ -147,7 +147,13 @@ static PyMethodDef accuraterip_methods[] = { { NULL, NULL, 0, NULL }, }; -PyMODINIT_FUNC initaccuraterip(void) +static struct PyModuleDef accuraterip_module = { + .m_base = PyModuleDef_HEAD_INIT, + .m_name = "accuraterip", + .m_methods = accuraterip_methods, +}; + +PyMODINIT_FUNC PyInit_accuraterip(void) { - Py_InitModule("accuraterip", accuraterip_methods); + return PyModule_Create(&accuraterip_module); }