From nobody Sat May 4 02:07:02 2024 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VWWJQ2R4Bz5JH3V; Sat, 4 May 2024 02:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VWWJQ1qWtz43S6; Sat, 4 May 2024 02:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714788422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5DBH1v0HzDtr+xxR5galm4LJBqB/N0Lip1TGzyFC0CY=; b=VmcGZ0LW4xjVEKc2KvbpeYMjm2VOBG+FQyHq5C+RD5Kqe650x1JxhpMmfi7vn9miMBhW0/ zpwH9rKYMYOht04osafmiEoASpCvOSANgd4DdUuIyZ3z5dv/EGXPwe8o/wFm4IbZqtsciA CH4nGXf6F9SkHH11uZTvyPFNMt/QAUIFSGZKQfyZtgE+inaXMz00KsKMktfkhrf5McQGt6 3luWZE8nY1m/jb63gLjEYzkpRgoP2h1TJLfpqUHM/8fLHZQ7t3w9E6uOg5kB4awCv5b94F UsAvlbd5m92pw3w3x/11N0QhNxvGQcmW9e0AsB182+qLoOlEcUzjCTPbIFdl0w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714788422; a=rsa-sha256; cv=none; b=BsEZWfV7BpsrStidZ48DXOnQRPJEqpveBFyzIwtpKgwUkyDBG1GsPCQA4/B4k4fvYcg9QR Ark+5jFqjp5xDjXy4JC+z4sOngpwd5HD5qmqtyFhiIGWSY4NtsN+sOaTpdzsNbhj2tMV6C 7MZiarj9XwNEbhkr9haSD+lnJQUEkp55RCiyOgzllSIYgabEf6l/1hnCaBqVJjMUWnhFPp ubS3b4wJHlwv/CB4Ary27a6q0eFo0GoJT14O1IVtROFKurSk3Ecpzfu0L6ad9aIuPuBt3w MlpMoe3EijLWy9uogQMwwLzKUYgp6uWzkU5h6Pt+yQMUpo26Fq0S8NVVLTm2aw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714788422; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5DBH1v0HzDtr+xxR5galm4LJBqB/N0Lip1TGzyFC0CY=; b=G0cjeLl34WtjBx/IBrkzWiRGCCqnDPtyeFtSH3BhoLZbqp4ZtYro/DKvNAIKwwHwpXV73G LIijIX9/hSeVdgNFEr3clpb8MFyQnoa9Fw4HhYUrsnmjoZJ3A2p37p7s1fRE6qB7Vg2OHS jcKQCc41S88ipgdXjUOMM3F6JjaFXRgIPonydYaNJ7YSykSTYPIUCkhyqGgkuZIdW33pyv miNQdJIoacbnWRa+Bw4galm2u1He8DMBSxJp/jLGCoN1i5uPINI91mbTRoWXz2+jleYxJL ah+lpABY7lSXO00PVG86v+aAiyq9MydNiG+HWybttYHium94RqZk4eXaaGWokA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VWWJQ1QjJz19fl; Sat, 4 May 2024 02:07:02 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 4442728M005846; Sat, 4 May 2024 02:07:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 444272fN005843; Sat, 4 May 2024 02:07:02 GMT (envelope-from git) Date: Sat, 4 May 2024 02:07:02 GMT Message-Id: <202405040207.444272fN005843@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: af42bbacc245 - main - audio/py-samplerate: New port: Python wrapper for libsamplerate based on pybind11 and NumPy List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-ports-main@freebsd.org Sender: owner-dev-commits-ports-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: af42bbacc245be293a76409adef3843d50aef9f0 Auto-Submitted: auto-generated The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=af42bbacc245be293a76409adef3843d50aef9f0 commit af42bbacc245be293a76409adef3843d50aef9f0 Author: Yuri Victorovich AuthorDate: 2024-05-04 00:16:24 +0000 Commit: Yuri Victorovich CommitDate: 2024-05-04 02:06:56 +0000 audio/py-samplerate: New port: Python wrapper for libsamplerate based on pybind11 and NumPy --- audio/Makefile | 1 + audio/py-samplerate/Makefile | 33 ++++++++++++++++++++++++++ audio/py-samplerate/distinfo | 3 +++ audio/py-samplerate/files/patch-CMakeLists.txt | 33 ++++++++++++++++++++++++++ audio/py-samplerate/pkg-descr | 2 ++ 5 files changed, 72 insertions(+) diff --git a/audio/Makefile b/audio/Makefile index 6cb0b167e054..9fa1446c7df8 100644 --- a/audio/Makefile +++ b/audio/Makefile @@ -659,6 +659,7 @@ SUBDIR += py-python-mpd2 SUBDIR += py-pyttsx3 SUBDIR += py-resampy + SUBDIR += py-samplerate SUBDIR += py-simpleaudio SUBDIR += py-soundcloud SUBDIR += py-sounddevice diff --git a/audio/py-samplerate/Makefile b/audio/py-samplerate/Makefile new file mode 100644 index 000000000000..010017d57e9e --- /dev/null +++ b/audio/py-samplerate/Makefile @@ -0,0 +1,33 @@ +PORTNAME= samplerate +DISTVERSION= 0.2.1 +CATEGORIES= audio +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= yuri@FreeBSD.org +COMMENT= Python wrapper for libsamplerate based on pybind11 and NumPy +WWW= https://github.com/tuxu/python-samplerate + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE.rst + +BUILD_DEPENDS= ${PY_SETUPTOOLS} \ + ${PYTHON_PKGNAMEPREFIX}setuptools-scm>=6.2:devel/py-setuptools-scm@${PY_FLAVOR} \ + pybind11>0:devel/pybind11 \ + cmake:devel/cmake-core +LIB_DEPENDS= libsamplerate.so:audio/libsamplerate +RUN_DEPENDS= ${PYNUMPY} + +USES= cmake compiler:c++14-lang pkgconfig python +USE_PYTHON= flavors pytest + +TEST_WRKSRC= ${WRKSRC}/tests +TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} + +PLIST_FILES= ${PYTHON_SITELIBDIR}/samplerate${PYTHON_EXT_SUFFIX}.so + +do-install: + ${MKDIR} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} + ${INSTALL_LIB} ${BUILD_WRKSRC}/samplerate${PYTHON_EXT_SUFFIX}.so ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR} + +.include diff --git a/audio/py-samplerate/distinfo b/audio/py-samplerate/distinfo new file mode 100644 index 000000000000..a0725985f378 --- /dev/null +++ b/audio/py-samplerate/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1714760637 +SHA256 (samplerate-0.2.1.tar.gz) = 464d3574412024184fb7428ecbaa1b2e207bddf5fbc10a5d9ddc3fc1c7b7ab1e +SIZE (samplerate-0.2.1.tar.gz) = 21494 diff --git a/audio/py-samplerate/files/patch-CMakeLists.txt b/audio/py-samplerate/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..7f822e90d3d4 --- /dev/null +++ b/audio/py-samplerate/files/patch-CMakeLists.txt @@ -0,0 +1,33 @@ +--- CMakeLists.txt.orig 2024-01-23 23:51:19 UTC ++++ CMakeLists.txt +@@ -11,7 +11,9 @@ cmake_policy(SET CMP0094 NEW) + cmake_policy(SET CMP0094 NEW) + + # adds the external dependencies +-add_subdirectory(external) ++find_package(PkgConfig REQUIRED) ++find_package(pybind11 CONFIG REQUIRED) ++pkg_check_modules(SAMPLERATE REQUIRED IMPORTED_TARGET samplerate) + + pybind11_add_module(python-samplerate src/samplerate.cpp) + +@@ -25,7 +27,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR + CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR + (CMAKE_CXX_COMPILER_ID MATCHES "Intel" AND NOT WIN32)) +- target_compile_options(python-samplerate PRIVATE -std=c++14 -O3 -Wall -Wextra) ++ target_compile_options(python-samplerate PRIVATE -std=c++14 -Wall -Wextra) + endif() + + ### stick the package and libsamplerate version into the module +@@ -43,4 +45,9 @@ set_target_properties( + LINKER_LANGUAGE C + ) + +-target_link_libraries(python-samplerate PUBLIC samplerate) ++target_compile_options(python-samplerate PRIVATE ++ ${SAMPLERATE_CFLAGS} ++) ++target_link_options(python-samplerate PRIVATE ++ ${SAMPLERATE_LDFLAGS} ++) diff --git a/audio/py-samplerate/pkg-descr b/audio/py-samplerate/pkg-descr new file mode 100644 index 000000000000..7e3b3f7188be --- /dev/null +++ b/audio/py-samplerate/pkg-descr @@ -0,0 +1,2 @@ +samplerate is a wrapper around Erik de Castro Lopo's libsamplerate (aka Secret +Rabbit Code) for high-quality sample rate conversion.